Skip to content

Commit

Permalink
Merge pull request #1005 from pelwell/rpi-4.0.y
Browse files Browse the repository at this point in the history
BCM270x_DT: Configure UART using DT
  • Loading branch information
pelwell committed Jun 4, 2015
2 parents a994129 + 2408bc9 commit 3ff92a0
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 8 deletions.
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
Expand Up @@ -16,6 +16,7 @@
intc = &intc;
leds = &leds;
sound = &sound;
uart0 = &uart0;
};

sound: sound {
Expand Down Expand Up @@ -53,6 +54,10 @@
status = "okay";
};

&uart0 {
status = "okay";
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
Expand Down Expand Up @@ -108,6 +113,8 @@

/ {
__overrides__ {
uart0 = <&uart0>,"status";
uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
i2s = <&i2s>,"status";
spi = <&spi0>,"status";
i2c0 = <&i2c0>,"status";
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/bcm2708-rpi-b.dts
Expand Up @@ -16,6 +16,7 @@
intc = &intc;
leds = &leds;
sound = &sound;
uart0 = &uart0;
};

sound: sound {
Expand Down Expand Up @@ -53,6 +54,10 @@
status = "okay";
};

&uart0 {
status = "okay";
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
Expand Down Expand Up @@ -102,6 +107,8 @@

/ {
__overrides__ {
uart0 = <&uart0>,"status";
uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
i2s = <&i2s>,"status";
spi = <&spi0>,"status";
i2c0 = <&i2c0>,"status";
Expand Down
27 changes: 27 additions & 0 deletions arch/arm/boot/dts/bcm2708_common.dtsi
Expand Up @@ -84,6 +84,17 @@
status = "disabled";
};

uart0: uart@7e201000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x7e201000 0x1000>;
interrupts = <2 25>;
clocks = <&clk_uart0 &clk_apb_p>;
clock-names = "uartclk","apb_pclk";
arm,primecell-periphid = <0x00241011>; // For an explanation, see
// https://github.com/raspberrypi/linux/commit/13731d862cf5219216533a3b0de052cee4cc5038
status = "disabled";
};

i2s: i2s@7e203000 {
compatible = "brcm,bcm2708-i2s";
reg = <0x7e203000 0x20>,
Expand Down Expand Up @@ -188,5 +199,21 @@
clock-output-names = "spi";
clock-frequency = <250000000>;
};

clk_uart0: clock@3 {
compatible = "fixed-clock";
reg = <3>;
#clock-cells = <0>;
clock-output-names = "uart0_pclk";
clock-frequency = <3000000>;
};

clk_apb_p: clock@4 {
compatible = "fixed-clock";
reg = <4>;
#clock-cells = <0>;
clock-output-names = "apb_pclk";
clock-frequency = <126000000>;
};
};
};
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/bcm2709-rpi-2-b.dts
Expand Up @@ -16,6 +16,7 @@
intc = &intc;
leds = &leds;
sound = &sound;
uart0 = &uart0;
};

sound: sound {
Expand Down Expand Up @@ -53,6 +54,10 @@
status = "okay";
};

&uart0 {
status = "okay";
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
Expand Down Expand Up @@ -108,6 +113,8 @@

/ {
__overrides__ {
uart0 = <&uart0>,"status";
uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
i2s = <&i2s>,"status";
spi = <&spi0>,"status";
i2c0 = <&i2c0>,"status";
Expand Down
9 changes: 5 additions & 4 deletions arch/arm/mach-bcm2708/bcm2708.c
Expand Up @@ -1020,10 +1020,11 @@ void __init bcm2708_init(void)
i2c_register_board_info_dt(1, snd_pcm512x_i2c_devices, ARRAY_SIZE(snd_pcm512x_i2c_devices));
#endif


for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
amba_device_register(d, &iomem_resource);
if (!use_dt) {
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
amba_device_register(d, &iomem_resource);
}
}
system_rev = boardrev;
system_serial_low = serial;
Expand Down
9 changes: 5 additions & 4 deletions arch/arm/mach-bcm2709/bcm2709.c
Expand Up @@ -1043,10 +1043,11 @@ void __init bcm2709_init(void)
i2c_register_board_info_dt(1, snd_pcm512x_i2c_devices, ARRAY_SIZE(snd_pcm512x_i2c_devices));
#endif


for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
amba_device_register(d, &iomem_resource);
if (!use_dt) {
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
amba_device_register(d, &iomem_resource);
}
}
system_rev = boardrev;
system_serial_low = serial;
Expand Down

0 comments on commit 3ff92a0

Please sign in to comment.