Skip to content

Commit

Permalink
bcm2835: Match BCM270X Device Trees
Browse files Browse the repository at this point in the history
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  • Loading branch information
notro authored and popcornmix committed Jun 7, 2015
1 parent 493b7b5 commit e98419e
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 49 deletions.
45 changes: 29 additions & 16 deletions arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
Expand Up @@ -4,27 +4,40 @@
/ {
compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
model = "Raspberry Pi Model B+";
};

&gpio {
i2s_pins: i2s {
brcm,pins = <18 19 20 21>;
brcm,function = <4>; /* alt0 */
};
};

leds {
act {
gpios = <&gpio 47 0>;
};
&i2s {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&i2s_pins>;
};

&act_led {
gpios = <&gpio 47 0>;
};

pwr {
label = "PWR";
gpios = <&gpio 35 0>;
default-state = "keep";
linux,default-trigger = "default-on";
};
&leds {
pwr_led: pwr {
label = "led1";
linux,default-trigger = "input";
gpios = <&gpio 35 0>;
};
};

&gpio {
pinctrl-0 = <&gpioout &alt0 &i2s_alt0 &alt3>;
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
act_led_activelow = <&act_led>,"gpios:8";

/* I2S interface */
i2s_alt0: i2s_alt0 {
brcm,pins = <18 19 20 21>;
brcm,function = <4>; /* alt0 */
pwr_led_gpio = <&pwr_led>,"gpios:4";
pwr_led_activelow = <&pwr_led>,"gpios:8";
pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
};
};
29 changes: 19 additions & 10 deletions arch/arm/boot/dts/bcm2835-rpi-b.dts
Expand Up @@ -5,19 +5,28 @@
compatible = "raspberrypi,model-b", "brcm,bcm2835";
model = "Raspberry Pi Model B";

leds {
act {
gpios = <&gpio 16 1>;
};
};
};

&gpio {
pinctrl-0 = <&gpioout &alt0 &i2s_alt2 &alt3>;

/* I2S interface */
i2s_alt2: i2s_alt2 {
i2s_pins: i2s {
brcm,pins = <28 29 30 31>;
brcm,function = <6>; /* alt2 */
brcm,function = <4>; /* alt0 */
};
};

&i2s {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&i2s_pins>;
};

&act_led {
gpios = <&gpio 16 1>;
};

/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
act_led_activelow = <&act_led>,"gpios:8";
};
};
85 changes: 68 additions & 17 deletions arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -1,53 +1,91 @@
/include/ "bcm2835.dtsi"

/ {
/* This is left here in case u-boot needs it */
memory {
reg = <0 0x10000000>;
};

leds {
aliases {
soc = &soc;
spi0 = &spi0;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2s = &i2s;
gpio = &gpio;
intc = &intc;
leds = &leds;
sound = &sound;
};

leds: leds {
compatible = "gpio-leds";

act {
label = "ACT";
default-state = "keep";
linux,default-trigger = "heartbeat";
act_led: act {
label = "led0";
linux,default-trigger = "mmc0";
};
};

/* Onboard audio */
audio: audio {
compatible = "brcm,bcm2835-audio";
brcm,pwm-channels = <8>;
status = "disabled";
};

/* External sound card */
sound: sound {
};
};

&gpio {
pinctrl-names = "default";
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,function = <4>; /* alt0 */
};

gpioout: gpioout {
brcm,pins = <6>;
brcm,function = <1>; /* GPIO out */
i2c0_pins: i2c0 {
brcm,pins = <0 1>;
brcm,function = <4>;
};

alt0: alt0 {
brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>;
brcm,function = <4>; /* alt0 */
i2c1_pins: i2c1 {
brcm,pins = <2 3>;
brcm,function = <4>;
};
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;

alt3: alt3 {
brcm,pins = <48 49 50 51 52 53>;
brcm,function = <7>; /* alt3 */
spidev@0{
compatible = "spidev";
reg = <0>; /* CE0 */
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <500000>;
};

spidev@1{
compatible = "spidev";
reg = <1>; /* CE1 */
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <500000>;
};
};

&i2c0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
clock-frequency = <100000>;
};

&i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
clock-frequency = <100000>;
};

Expand All @@ -59,3 +97,16 @@
&fb {
status = "okay";
};

/ {
__overrides__ {
i2s = <&i2s>,"status";
spi = <&spi0>,"status";
i2c0 = <&i2c0>,"status";
i2c1 = <&i2c1>,"status";
i2c0_baudrate = <&i2c0>,"clock-frequency:0";
i2c1_baudrate = <&i2c1>,"clock-frequency:0";
act_led_trigger = <&act_led>,"linux,default-trigger";
audio = <&audio>,"status";
};
};
12 changes: 6 additions & 6 deletions arch/arm/boot/dts/bcm2835.dtsi
Expand Up @@ -9,7 +9,7 @@
bootargs = "";
};

soc {
soc: soc {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
Expand Down Expand Up @@ -51,12 +51,12 @@
#interrupt-cells = <2>;
};

watchdog@7e100000 {
watchdog: watchdog@7e100000 {
compatible = "brcm,bcm2835-pm-wdt";
reg = <0x7e100000 0x28>;
};

rng@7e104000 {
random: rng@7e104000 {
compatible = "brcm,bcm2835-rng";
reg = <0x7e104000 0x10>;
};
Expand Down Expand Up @@ -90,7 +90,7 @@
#interrupt-cells = <2>;
};

uart@7e201000 {
uart0: uart@7e201000 {
compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
reg = <0x7e201000 0x1000>;
interrupts = <2 25>;
Expand All @@ -109,7 +109,7 @@
status = "disabled";
};

spi: spi@7e204000 {
spi0: spi@7e204000 {
compatible = "brcm,bcm2835-spi";
reg = <0x7e204000 0x1000>;
interrupts = <2 22>;
Expand Down Expand Up @@ -150,7 +150,7 @@
status = "disabled";
};

usb@7e980000 {
usb: usb@7e980000 {
compatible = "brcm,bcm2835-usb";
reg = <0x7e980000 0x10000>;
interrupts = <1 9>;
Expand Down

0 comments on commit e98419e

Please sign in to comment.