dfb067aaa5deab433b6e68e03f53a8075d867c2a
[openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0111-BCM270X_DT-Add-at86rf233-overlay.patch
1 From d0219e9506be92eb12b2a303e5cbb2261e0dc05a Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 5 Oct 2015 10:47:45 +0100
4 Subject: [PATCH 111/127] BCM270X_DT: Add at86rf233 overlay
5
6 Add an overlay to support the Atmel AT86RF233 WPAN transceiver on spi0.0.
7
8 See: https://github.com/raspberrypi/linux/issues/1151
9 ---
10  arch/arm/boot/dts/overlays/Makefile              |  1 +
11  arch/arm/boot/dts/overlays/README                | 21 +++++++--
12  arch/arm/boot/dts/overlays/at86rf233-overlay.dts | 54 ++++++++++++++++++++++++
13  3 files changed, 72 insertions(+), 4 deletions(-)
14  create mode 100644 arch/arm/boot/dts/overlays/at86rf233-overlay.dts
15
16 --- a/arch/arm/boot/dts/overlays/Makefile
17 +++ b/arch/arm/boot/dts/overlays/Makefile
18 @@ -13,6 +13,7 @@ ifeq ($(CONFIG_ARCH_BCM2835),y)
19  endif
20  
21  dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb
22 +dtb-$(RPI_DT_OVERLAYS) += at86rf233-overlay.dtb
23  dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
24  dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb
25  dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
26 --- a/arch/arm/boot/dts/overlays/README
27 +++ b/arch/arm/boot/dts/overlays/README
28 @@ -69,13 +69,14 @@ DT parameters:
29  
30  Parameters always have default values, although in some cases (e.g. "w1-gpio")
31  it is necessary to provided multiple overlays in order to get the desired
32 -behaviour. See the list of overlays below for a description of the parameters and their defaults.
33 +behaviour. See the list of overlays below for a description of the parameters
34 +and their defaults.
35  
36  The Overlay and Parameter Reference
37  ===================================
38  
39 -N.B. When editing this file, please preserve the indentation levels to make it simple to parse
40 -programmatically. NO HARD TABS.
41 +N.B. When editing this file, please preserve the indentation levels to make it
42 +simple to parse programmatically. NO HARD TABS.
43  
44  
45  Name:   <The base DTB>
46 @@ -149,7 +150,7 @@ Name:   ads7846
47  Info:   ADS7846 Touch controller
48  Load:   dtoverlay=ads7846,<param>=<val>
49  Params: cs                       SPI bus Chip Select (default 1)
50 -        speed                    SPI bus speed (default 2Mhz, max 3.25MHz)
51 +        speed                    SPI bus speed (default 2MHz, max 3.25MHz)
52          penirq                   GPIO used for PENIRQ. REQUIRED
53          penirq_pull              Set GPIO pull (default 0=none, 2=pullup)
54          swapxy                   Swap x and y axis
55 @@ -170,6 +171,18 @@ Params: cs                       SPI bus
56          www.kernel.org/doc/Documentation/devicetree/bindings/input/ads7846.txt
57  
58  
59 +Name:   at86rf233
60 +Info:   Configures the Atmel AT86RF233 802.15.4 low-power WPAN transceiver,
61 +        connected to spi0.0
62 +Load:   dtoverlay=at86rf233,<param>=<val>
63 +Params: interrupt                GPIO used for INT (default 23)
64 +        reset                    GPIO used for Reset (default 24)
65 +        sleep                    GPIO used for Sleep (default 25)
66 +        speed                    SPI bus speed in Hz (default 6000000)
67 +        trim                     Fine tuning of the internal capacitance
68 +                                 arrays (0=+0pF, 15=+4.5pF, default 15)
69 +
70 +
71  Name:   bmp085_i2c-sensor
72  Info:   Configures the BMP085/BMP180 digital barometric pressure and temperature
73          sensors from Bosch Sensortec
74 --- /dev/null
75 +++ b/arch/arm/boot/dts/overlays/at86rf233-overlay.dts
76 @@ -0,0 +1,54 @@
77 +/dts-v1/;
78 +/plugin/;
79 +
80 +/* Overlay for Atmel AT86RF233 IEEE 802.15.4 WPAN transceiver on spi0.0 */
81 +
82 +/ {
83 +       compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
84 +
85 +       fragment@0 {
86 +               target = <&spi0>;
87 +               __overlay__ {
88 +                       #address-cells = <1>;
89 +                       #size-cells = <0>;
90 +
91 +                       status = "okay";
92 +
93 +                       spidev@0{
94 +                               status = "disabled";
95 +                       };
96 +
97 +                       lowpan0: at86rf233@0 {
98 +                               compatible = "atmel,at86rf233";
99 +                               reg = <0>;
100 +                               interrupt-parent = <&gpio>;
101 +                               interrupts = <23 4>; /* active high */
102 +                               reset-gpio = <&gpio 24 1>;
103 +                               sleep-gpio = <&gpio 25 1>;
104 +                               spi-max-frequency = <6000000>;
105 +                               xtal-trim = /bits/ 8 <0xf>;
106 +                       };
107 +               };
108 +       };
109 +
110 +       fragment@1 {
111 +               target = <&gpio>;
112 +               __overlay__ {
113 +                       lowpan0_pins: lowpan0_pins {
114 +                               brcm,pins = <23 24 25>;
115 +                               brcm,function = <0 1 1>; /* in out out */
116 +                       };
117 +               };
118 +       };
119 +
120 +       __overrides__ {
121 +               interrupt = <&lowpan0>, "interrupts:0",
122 +                       <&lowpan0_pins>, "brcm,pins:0";
123 +               reset     = <&lowpan0>, "reset-gpio:4",
124 +                       <&lowpan0_pins>, "brcm,pins:4";
125 +               sleep     = <&lowpan0>, "sleep-gpio:4",
126 +                       <&lowpan0_pins>, "brcm,pins:8";
127 +               speed     = <&lowpan0>, "spi-max-frequency:0";
128 +               trim      = <&lowpan0>, "xtal-trim.0";
129 +       };
130 +};