summaryrefslogtreecommitdiff
path: root/src/arm/BB-RTC-01-00A0.dts
blob: b06dbe43f14a3db054c707f7486795606afebe82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
 * Copyright (C) 2015 Robert Nelson <robertcnelson@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>

/ {
	/*
	 * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
	 */
	fragment@0 {
		target-path="/";
		__overlay__ {

			chosen {
				overlays {
					BB-RTC-01-00A0 = __TIMESTAMP__;
				};
			};
		};
	};

	/*
	 * Free up the pins used by the cape from the pinmux helpers.
	 */
	fragment@1 {
		target = <&ocp>;
		__overlay__ {
			P8_26_pinmux { status = "disabled"; };	/* P8_26: gpmc_csn0.gpio1_29 */

			P9_18_pinmux { status = "disabled"; };	/* P9_18: spi0_d1.i2c1_sda */
			P9_17_pinmux { status = "disabled"; };	/* P9_17: spi0_cs0.i2c1_scl */
		};
	};

	fragment@2 {
		target-path="/";
		__overlay__ {
			aliases {
				rtc0 = &extrtc;
				rtc1 = "/ocp/rtc@44e3e000";
			};
		};
	};

	fragment@3 {
		target = <&am33xx_pinmux>;
		__overlay__ {

			bb_gpio1_29_pins: pinmux_bb_gpio1_29_pins {
				pinctrl-single,pins = <
					BONE_P8_26 (PIN_INPUT | MUX_MODE7)	/* P8_26: gpmc_csn0.gpio1_29 */
				>;
			};

			bb_i2c1_pins: pinmux_bb_i2c1_pins {
				pinctrl-single,pins = <
					BONE_P9_18 (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE2)	/* P9_18: spi0_d1.i2c1_sda */
					BONE_P9_17 (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE2)	/* P9_17: spi0_cs0.i2c1_scl */
				>;
			};
		};
	};

	fragment@4 {
		target-path="/";
		__overlay__ {

			gpio_keys {
				compatible = "gpio-keys";
				pinctrl-names = "default";
				pinctrl-0 = <&bb_gpio1_29_pins>;

				rtc_mfp@1 {
					label = "rtc_mfp";
					gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
					linux,code = <143>; /* System Wake Up */
					gpio-key,wakeup;
				};
			};
		};
	};

	fragment@5 {
		target = <&i2c1>;
		__overlay__ {
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <&bb_i2c1_pins>;

			clock-frequency = <100000>;

			#address-cells = <1>;
			#size-cells = <0>;

			extrtc: mcp7940x@68 {
				compatible = "microchip,mcp7940x";
				reg = <0x68>;
			};
		};
	};
};