Raspberry Pi 32/64 support
Subsystems (8)
cover Raspberry Pi 32/64 support
From: Andrei Gherzan <[email protected]>
This PR consolidates the work we've done to support the new Raspberry Pi 4 board. It also includes commits from
https://github.com/mbgg/u-boot.git (credits to Matthias Brugger).
Andrei Gherzan (13):
dts: Create a dtsi for BCM2835/6/7 specific configuration
dts: Add initial support for bcm2838
arm: mach-bcm283x: Define configs for RaspberryPi 4
arm: mach-bcm283x: Define mbox address for BCM2838
rpi: Add rpi_model entry for RaspberryPi 4
dt-bindings: Define BCM2838_CLOCK_EMMC2 needed for RaspberryPi 4
arm: bcm283x: Include definition for additional emmc clock
arm: bcm283x: Define device base addresses for bcm2835
config: rpi4: Add defconfig for rpi4-32
dts: bcm2838-rpi-4-b: Use the emmc2 interface for sdhci
rpi: Add memory map for bcm2838
configs: rpi4: Remove DWC2 and USB_ETHER configs
dts: bcm2838-rpi-4-b: Use the emmc2/2811 compatible string for SDHCI
Fabian Vogt (2):
bcm2835 video: Bail out early if querying video information fails bcm283x mbox: Correctly wait for space to send
Matthias Brugger (1):
mmc: bcm2835_sdhci: Add support for bcm2711 device
arch/arm/dts/Makefile | 4 +- arch/arm/dts/bcm2835-common.dtsi | 53 +++++ arch/arm/dts/bcm2835.dtsi | 1 + arch/arm/dts/bcm2836.dtsi | 1 + arch/arm/dts/bcm2837.dtsi | 1 + arch/arm/dts/bcm2838-rpi-4-b.dts | 52 +++++ arch/arm/dts/bcm2838.dtsi | 237 +++++++++++++++++++++ arch/arm/dts/bcm283x.dtsi | 45 +--- arch/arm/mach-bcm283x/Kconfig | 35 +++ arch/arm/mach-bcm283x/include/mach/mbox.h | 13 +- arch/arm/mach-bcm283x/include/mach/sdhci.h | 4 + arch/arm/mach-bcm283x/include/mach/timer.h | 4 + arch/arm/mach-bcm283x/include/mach/wdog.h | 4 + arch/arm/mach-bcm283x/mbox.c | 6 +- board/raspberrypi/rpi/rpi.c | 32 ++- configs/rpi_4_32b_defconfig | 40 ++++ configs/rpi_4_defconfig | 3 - drivers/mmc/bcm2835_sdhci.c | 12 +- drivers/video/bcm2835.c | 4 +- include/dt-bindings/clock/bcm2835.h | 2 + 20 files changed, 494 insertions(+), 59 deletions(-) create mode 100644 arch/arm/dts/bcm2835-common.dtsi create mode 100644 arch/arm/dts/bcm2838-rpi-4-b.dts create mode 100644 arch/arm/dts/bcm2838.dtsi create mode 100644 configs/rpi_4_32b_defconfig
Signature · 1 line
2.22.0
PATCH 1/16 dts: Create a dtsi for BCM2835/6/7 specific configuration
From: Andrei Gherzan <[email protected]>
This follows a similar change in kernel[1]. The change moves configuration that was not applicable for all bcm2835/6/7/8 out of bcm283x.dtsi. The new file is bcm2835-common.dtsi and contains conifguration that is common for bcm2835/6/7 (not bcm2838).
--- arch/arm/dts/bcm2835-common.dtsi | 53 ++++++++++++++++++++++++++++++++ arch/arm/dts/bcm2835.dtsi | 1 + arch/arm/dts/bcm2836.dtsi | 1 + arch/arm/dts/bcm2837.dtsi | 1 + arch/arm/dts/bcm283x.dtsi | 45 +-------------------------- 5 files changed, 57 insertions(+), 44 deletions(-) create mode 100644 arch/arm/dts/bcm2835-common.dtsi
arch/arm/dts/bcm2835-common.dtsi new file +53 -0
@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* This include file covers the common peripherals and configuration between + * bcm2835, bcm2836 and bcm2837 implementations. + */ + +/ { + soc { + timer at 7e003000 { + compatible = "brcm,bcm2835-system-timer"; + reg = <0x7e003000 0x1000>; + interrupts = <1 0>, <1 1>, <1 2>, <1 3>; + /* This could be a reference to BCM2835_CLOCK_TIMER, + * but we don't have the driver using the common clock + * support yet. + */ + clock-frequency = <1000000>; + }; + + intc: interrupt-controller at 7e00b200 { + compatible = "brcm,bcm2835-armctrl-ic"; + reg = <0x7e00b200 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + thermal: thermal at 7e212000 { + compatible = "brcm,bcm2835-thermal"; + reg = <0x7e212000 0x8>; + clocks = <&clocks BCM2835_CLOCK_TSENS>; + #thermal-sensor-cells = <0>; + status = "disabled"; + }; + + v3d: v3d at 7ec00000 { + compatible = "brcm,bcm2835-v3d"; + reg = <0x7ec00000 0x1000>; + interrupts = <1 10>; + }; + }; +}; + +&gpio { + i2c_slave_gpio18: i2c_slave_gpio18 { + brcm,pins = <18 19 20 21>; + brcm,function = <BCM2835_FSEL_ALT3>; + }; + + jtag_gpio4: jtag_gpio4 { + brcm,pins = <4 5 6 12 13>; + brcm,function = <BCM2835_FSEL_ALT5>; + }; +};
arch/arm/dts/bcm2835.dtsi +1 -0
@@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" +#include "bcm2835-common.dtsi" / { compatible = "brcm,bcm2835";
arch/arm/dts/bcm2836.dtsi +1 -0
@@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" +#include "bcm2835-common.dtsi" / { compatible = "brcm,bcm2836";
arch/arm/dts/bcm2837.dtsi +1 -0
@@ -1,4 +1,5 @@ #include "bcm283x.dtsi" +#include "bcm2835-common.dtsi" / { compatible = "brcm,bcm2837";
arch/arm/dts/bcm283x.dtsi +1 -44
81 lines not on this page · raw message
Signature · 1 line
2.22.0
PATCH 1/16 dts: Create a dtsi for BCM2835/6/7 specific configuration
Quoted 10 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
This follows a similar change in kernel[1]. The change moves configuration that was not applicable for all bcm2835/6/7/8 out of
bcm283x.dtsi. The new file isbcm2835-common.dtsiand contains conifguration that is common for bcm2835/6/7 (not bcm2838).Signed-off-by Andrei Gherzan <[email protected]>
My opinion is that we should wait for official dts instead of using some work-in-progress ones. So my opinion is to use the DTB from the FW for now until we have something stable.
Quoted 192 lines
--- arch/arm/dts/bcm2835-common.dtsi | 53 ++++++++++++++++++++++++++++++++ arch/arm/dts/bcm2835.dtsi | 1 + arch/arm/dts/bcm2836.dtsi | 1 + arch/arm/dts/bcm2837.dtsi | 1 + arch/arm/dts/bcm283x.dtsi | 45 +-------------------------- 5 files changed, 57 insertions(+), 44 deletions(-) create mode 100644 arch/arm/dts/bcm2835-common.dtsiarch/arm/dts/bcm2835-common.dtsi new file +53
-0@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* This include file covers the common peripherals and configuration between + * bcm2835, bcm2836 and bcm2837 implementations. + */ + +/ { + soc { + timer at 7e003000 { + compatible = "brcm,bcm2835-system-timer"; + reg = <0x7e003000 0x1000>; + interrupts = <1 0>, <1 1>, <1 2>, <1 3>; + /* This could be a reference to BCM2835_CLOCK_TIMER, + * but we don't have the driver using the common clock + * support yet. + */ + clock-frequency = <1000000>; + }; + + intc: interrupt-controller at 7e00b200 { + compatible = "brcm,bcm2835-armctrl-ic"; + reg = <0x7e00b200 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + thermal: thermal at 7e212000 { + compatible = "brcm,bcm2835-thermal"; + reg = <0x7e212000 0x8>; + clocks = <&clocks BCM2835_CLOCK_TSENS>; + #thermal-sensor-cells = <0>; + status = "disabled"; + }; + + v3d: v3d at 7ec00000 { + compatible = "brcm,bcm2835-v3d"; + reg = <0x7ec00000 0x1000>; + interrupts = <1 10>; + }; + }; +}; + +&gpio { + i2c_slave_gpio18: i2c_slave_gpio18 { + brcm,pins = <18 19 20 21>; + brcm,function = <BCM2835_FSEL_ALT3>; + }; + + jtag_gpio4: jtag_gpio4 { + brcm,pins = <4 5 6 12 13>; + brcm,function = <BCM2835_FSEL_ALT5>; + }; +};arch/arm/dts/bcm2835.dtsi +1
-0@@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" +#include "bcm2835-common.dtsi" / { compatible = "brcm,bcm2835";arch/arm/dts/bcm2836.dtsi +1
-0@@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" +#include "bcm2835-common.dtsi" / { compatible = "brcm,bcm2836";arch/arm/dts/bcm2837.dtsi +1
-0@@ -1,4 +1,5 @@ #include "bcm283x.dtsi" +#include "bcm2835-common.dtsi" / { compatible = "brcm,bcm2837";arch/arm/dts/bcm283x.dtsi +1
-44@@ -56,17 +56,6 @@ #address-cells = <1>; #size-cells = <1>; - timer at 7e003000 { - compatible = "brcm,bcm2835-system-timer"; - reg = <0x7e003000 0x1000>; - interrupts = <1 0>, <1 1>, <1 2>, <1 3>; - /* This could be a reference to BCM2835_CLOCK_TIMER, - * but we don't have the driver using the common clock - * support yet. - */ - clock-frequency = <1000000>; - }; - txp at 7e004000 { compatible = "brcm,bcm2835-txp"; reg = <0x7e004000 0x20>;@@ -114,13 +103,6 @@ brcm,dma-channel-mask = <0x7f35>; }; - intc: interrupt-controller at 7e00b200 { - compatible = "brcm,bcm2835-armctrl-ic"; - reg = <0x7e00b200 0x200>; - interrupt-controller; - #interrupt-cells = <2>; - }; - pm: watchdog at 7e100000 { compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt"; #power-domain-cells = <1>;@@ -184,8 +166,7 @@ interrupt-controller; #interrupt-cells = <2>; - /* Defines pin muxing groups according to - * BCM2835-ARM-Peripherals.pdf page 102. + /* Defines common pin muxing groups * * While each pin can have its mux selected * for various functions individually, some@@ -263,15 +244,6 @@ brcm,pins = <44 45>; brcm,function = <BCM2835_FSEL_ALT2>; }; - i2c_slave_gpio18: i2c_slave_gpio18 { - brcm,pins = <18 19 20 21>; - brcm,function = <BCM2835_FSEL_ALT3>; - }; - - jtag_gpio4: jtag_gpio4 { - brcm,pins = <4 5 6 12 13>; - brcm,function = <BCM2835_FSEL_ALT5>; - }; jtag_gpio22: jtag_gpio22 { brcm,pins = <22 23 24 25 26 27>; brcm,function = <BCM2835_FSEL_ALT4>;@@ -488,14 +460,6 @@ }; - thermal: thermal at 7e212000 { - compatible = "brcm,bcm2835-thermal"; - reg = <0x7e212000 0x8>; - clocks = <&clocks BCM2835_CLOCK_TSENS>; - #thermal-sensor-cells = <0>; - status = "disabled"; - }; - aux: aux at 7e215000 { compatible = "brcm,bcm2835-aux"; #clock-cells = <1>;@@ -635,13 +599,6 @@ phy-names = "usb2-phy"; }; - v3d: v3d at 7ec00000 { - compatible = "brcm,bcm2835-v3d"; - reg = <0x7ec00000 0x1000>; - interrupts = <1 10>; - power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>; - }; - vc4: gpu { compatible = "brcm,bcm2835-vc4"; };
PATCH 2/16 dts: Add initial support for bcm2838
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- arch/arm/dts/Makefile | 4 +- arch/arm/dts/bcm2838-rpi-4-b.dts | 56 ++++++++ arch/arm/dts/bcm2838.dtsi | 237 +++++++++++++++++++++++++++++++ 3 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/bcm2838-rpi-4-b.dts create mode 100644 arch/arm/dts/bcm2838.dtsi
arch/arm/dts/Makefile +3 -1
@@ -749,7 +749,9 @@ dtb-$(CONFIG_ARCH_BCM283X) += \ bcm2837-rpi-3-a-plus.dtb \ bcm2837-rpi-3-b.dtb \ bcm2837-rpi-3-b-plus.dtb \ - bcm2837-rpi-cm3-io3.dtb + bcm2837-rpi-cm3-io3.dtb \ + bcm2837-rpi-3-b.dtb \ + bcm2838-rpi-4-b.dtb dtb-$(CONFIG_ARCH_BCM63158) += \ bcm963158.dtb
arch/arm/dts/bcm2838-rpi-4-b.dts new file +56 -0
56 lines not on this page · raw message
arch/arm/dts/bcm2838.dtsi new file +237 -0
237 lines not on this page · raw message
Signature · 1 line
2.22.0
PATCH 2/16 dts: Add initial support for bcm2838
Quoted 16 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
Signed-off-by Andrei Gherzan <[email protected]>--- arch/arm/dts/Makefile | 4 +- arch/arm/dts/bcm2838-rpi-4-b.dts | 56 ++++++++ arch/arm/dts/bcm2838.dtsi | 237 +++++++++++++++++++++++++++++++ 3 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/bcm2838-rpi-4-b.dts create mode 100644 arch/arm/dts/bcm2838.dtsiarch/arm/dts/Makefile +0
-0
arch/arm/dts/Makefile dtb-$(CONFIG_ARCH_BCM283X) += \ · line 753
Quoted 6 lines
arch/arm/dts/Makefile +2
-1@@ -749,7 +749,9 @@ dtb-$(CONFIG_ARCH_BCM283X) += \ bcm2837-rpi-3-a-plus.dtb \ bcm2837-rpi-3-b.dtb \ bcm2837-rpi-3-b-plus.dtb \ - bcm2837-rpi-cm3-io3.dtb + bcm2837-rpi-cm3-io3.dtb \ + bcm2837-rpi-3-b.dtb \
You added rpi-3-b again, no need for that.
Quoted 310 lines
arch/arm/dts/Makefile +1
-0+ bcm2838-rpi-4-b.dtb dtb-$(CONFIG_ARCH_BCM63158) += \ bcm963158.dtbarch/arm/dts/bcm2838-rpi-4-b.dts new file +56
-0@@ -0,0 +1,56 @@ +/dts-v1/; +#include "bcm2838.dtsi" + +/ { + compatible = "raspberrypi,4-model-b","brcm,bcm2838","brcm,bcm2837"; + model = "Raspberry Pi 4 Model B"; + + memory { + reg = <0 0 0x40000000>; + }; + + leds { + act { + gpios = <&gpio 47 0>; + }; + }; +}; + +/* uart0 communicates with the BT module */ +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>; + status = "okay"; +}; + +/* uart1 is mapped to the pin header */ +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; +}; + +/* SDHCI is used to control the SDIO for wireless */ +&sdhci { + pinctrl-names = "default"; + pinctrl-0 = <&emmc_gpio34>; + status = "okay"; + bus-width = <4>; + non-removable; +}; + +/* SDHOST is used to drive the SD card */ +&sdhost { + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_gpio48>; + status = "okay"; + bus-width = <4>; +}; + +&gpio { + uart1_pins: uart1_pins { + brcm,pins; + brcm,function; + brcm,pull; + }; +};arch/arm/dts/bcm2838.dtsi new file +237
-0@@ -0,0 +1,237 @@ +#include "bcm283x.dtsi" +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/power/raspberrypi-power.h> + +/ { + compatible = "brcm,bcm2838"; + + #address-cells = <2>; + #size-cells = <1>; + + interrupt-parent = <&gic>; + + soc { + ranges = <0x7e000000 0x0 0xfe000000 0x01800000>, + <0x7c000000 0x0 0xfc000000 0x02000000>, + <0x40000000 0x0 0xff800000 0x00800000>; + dma-ranges = <0xc0000000 0x0 0x00000000 0x3c000000>; + + gic: gic400 at 40041000 { + interrupt-controller; + #interrupt-cells = <3>; + compatible = "arm,gic-400"; + reg = <0x40041000 0x1000>, + <0x40042000 0x2000>, + <0x40044000 0x2000>, + <0x40046000 0x2000>; + }; + + thermal: thermal at 7d5d2200 { + compatible = "brcm,avs-tmon-bcm2838"; + reg = <0x7d5d2200 0x2c>; + interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tmon"; + clocks = <&clocks BCM2835_CLOCK_TSENS>; + #thermal-sensor-cells = <0>; + status = "okay"; + }; + + spi at 7e204000 { + reg = <0x7e204000 0x0200>; + interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>; + }; + + pixelvalve at 7e206000 { + interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; + }; + + pixelvalve at 7e207000 { + interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>; + }; + + hvs at 7e400000 { + interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>; + }; + + emmc2: emmc2 at 7e340000 { + compatible = "brcm,bcm2711-emmc2"; + status = "okay"; + interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clocks BCM2838_CLOCK_EMMC2>; + reg = <0x7e340000 0x100>; + }; + + pixelvalve at 7e807000 { + interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; + }; + + }; + + arm-pmu { + /* + * N.B. the A72 PMU support only exists in arch/arm64, hence + * the fallback to the A53 version. + */ + compatible = "arm,cortex-a72-pmu", "arm,cortex-a53-pmu"; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | + IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | + IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | + IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | + IRQ_TYPE_LEVEL_LOW)>; + arm,cpu-registers-not-fw-configured; + always-on; + }; + + cpus: cpus { + #address-cells = <1>; + #size-cells = <0>; + enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit + + cpu0: cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <0>; + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x000000d8>; + }; + + cpu1: cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <1>; + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x000000e0>; + }; + + cpu2: cpu at 2 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <2>; + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x000000e8>; + }; + + cpu3: cpu at 3 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <3>; + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x000000f0>; + }; + }; +}; + +&clk_osc { + clock-frequency = <54000000>; +}; + +&clocks { + compatible = "brcm,bcm2838-cprman"; +}; + +&cpu_thermal { + coefficients = <(-487) 410040>; +}; + +&dsi0 { + interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>; +}; + +&dsi1 { + interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; +}; + +&gpio { + compatible = "brcm,bcm2838-gpio", "brcm,bcm2835-gpio"; + interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>; +}; + +&vec { + interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; +}; + +&usb { + interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; +}; + +&hdmi { + interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; +}; + +&uart1 { + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; +}; + +&spi1 { + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; +}; + +&spi2 { + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; +}; + +&i2c0 { + interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; +}; + +&i2c1 { + interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; +}; + +&i2c2 { + interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; +}; + +&mailbox { + interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; +}; + +&sdhost { + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; +}; + +&uart0 { + interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; +}; + +&dma { + reg = <0x7e007000 0xb00>; + interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>, /* dmalite 7 */ + <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>, /* dmalite 8 */ + <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>, /* dmalite 9 */ + <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>; /* dmalite 10 */ + interrupt-names = "dma0", + "dma1", + "dma2", + "dma3", + "dma4", + "dma5", + "dma6", + "dma7", + "dma8", + "dma9", + "dma10"; + brcm,dma-channel-mask = <0x07f5>; +};
PATCH 3/16 arm: mach-bcm283x: Define configs for RaspberryPi 4
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- arch/arm/mach-bcm283x/Kconfig | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm/mach-bcm283x/Kconfig +35 -0
@@ -26,6 +26,23 @@ config BCM2837_64B select BCM2837 select ARM64 +config BCM2838 + bool "Broadcom BCM2838 SoC support" + depends on ARCH_BCM283X + +config BCM2838_32B + bool "Broadcom BCM2838 SoC 32-bit support" + depends on ARCH_BCM283X + select BCM2838 + select ARMV7_LPAE + select CPU_V7A + +config BCM2838_64B + bool "Broadcom BCM2838 SoC 64-bit support" + depends on ARCH_BCM283X + select BCM2838 + select ARM64 + menu "Broadcom BCM283X family" depends on ARCH_BCM283X
@@ -127,6 +144,24 @@ config TARGET_RPI_3 This option creates a build targeting the ARMv8/AArch64 ISA. select BCM2837_64B +config TARGET_RPI_4 + bool "Raspberry Pi 4 64-bit build" + help + Support for all BCM2838-based Raspberry Pi variants, such as + the RPi 4 model B, in AArch64 (64-bit) mode. + + This option creates a build targeting the ARMv8/AArch64 ISA. + select BCM2838_64B + +config TARGET_RPI_4_32B + bool "Raspberry Pi 4 32-bit build" + help + Support for all BCM2838-based Raspberry Pi variants, such as + the RPi 4 model B, in AArch32 (32-bit) mode. + + This option creates a build targeting the ARMv7/AArch32 ISA. + select BCM2838_32B + endchoice config SYS_BOARD
Signature · 1 line
2.22.0
PATCH 4/16 arm: mach-bcm283x: Define mbox address for BCM2838
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- arch/arm/mach-bcm283x/include/mach/mbox.h | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/mach-bcm283x/include/mach/mbox.h +5 -0
@@ -38,11 +38,16 @@/* Raw mailbox HW */ #ifndef CONFIG_BCM2835 +#ifdef CONFIG_BCM2838 +#define BCM2835_MBOX_PHYSADDR 0xfe00b880 +#else #define BCM2835_MBOX_PHYSADDR 0x3f00b880 +#endif #else #define BCM2835_MBOX_PHYSADDR 0x2000b880#endif +struct bcm2835_mbox_regs {u32 read;u32 rsvd0[5 ];
Signature · 1 line
2.22.0
PATCH 4/16 arm: mach-bcm283x: Define mbox address for BCM2838
Quoted 12 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
Signed-off-by Andrei Gherzan <[email protected]>--- arch/arm/mach-bcm283x/include/mach/mbox.h | 5 +++++ 1 file changed, 5 insertions(+)arch/arm/mach-bcm283x/include/mach/mbox.h +0
-0
arch/arm/mach-bcm283x/include/mach/mbox.h line 43
Quoted 6 lines
arch/arm/mach-bcm283x/include/mach/mbox.h +3
-0@@ -38,11 +38,16 @@/* Raw mailbox HW */ #ifndef CONFIG_BCM2835 +#ifdef CONFIG_BCM2838 +#define BCM2835_MBOX_PHYSADDR 0xfe00b880 +#else
That gets really complicated. I prefer to add CONFIG_BCM283x_BASE or something like that and then add the offset in the header files.
Quoted 11 lines
arch/arm/mach-bcm283x/include/mach/mbox.h +2
-0#define BCM2835_MBOX_PHYSADDR 0x3f00b880 +#endif #else #define BCM2835_MBOX_PHYSADDR 0x2000b880#endif +struct bcm2835_mbox_regs {u32 read;u32 rsvd0[5 ];
PATCH 5/16 rpi: Add rpi_model entry for RaspberryPi 4
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- board/raspberrypi/rpi/rpi.c | 5 +++++ 1 file changed, 5 insertions(+)
board/raspberrypi/rpi/rpi.c +5 -0
@@ -148,6 +148,11 @@ static const struct rpi_model rpi_models_new_scheme[] = {DTB_DIR "bcm2837-rpi-cm3.dtb" , false, }, + [0x11] = { +"4 Model B" , +DTB_DIR "bcm2711-rpi-4-b.dtb" , + true, + }, }; static const struct rpi_model rpi_models_old_scheme[] = {
Signature · 1 line
2.22.0
PATCH 5/16 rpi: Add rpi_model entry for RaspberryPi 4
Quoted 3 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
Signed-off-by Andrei Gherzan <[email protected]>
Commit message missing.
Quoted 21 lines
--- board/raspberrypi/rpi/rpi.c | 5 +++++ 1 file changed, 5 insertions(+)board/raspberrypi/rpi/rpi.c +5
-0@@ -148,6 +148,11 @@ static const struct rpi_model rpi_models_new_scheme[] = {DTB_DIR "bcm2837-rpi-cm3.dtb" , false, }, + [0x11] = { +"4 Model B" , +DTB_DIR "bcm2711-rpi-4-b.dtb" , + true, + }, }; static const struct rpi_model rpi_models_old_scheme[] = {
PATCH 6/16 dt-bindings: Define BCM2838_CLOCK_EMMC2 needed for RaspberryPi 4
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
On BCM2838 there is an additional clock. This clock was added in the same bcm2835-cprman driver and is used by the emmc2 dt node.
--- include/dt-bindings/clock/bcm2835.h | 2 ++ 1 file changed, 2 insertions(+)
include/dt-bindings/clock/bcm2835.h +2 -0
@@ -58,3 +58,5 @@#define BCM2835_CLOCK_DSI1E 48#define BCM2835_CLOCK_DSI0P 49#define BCM2835_CLOCK_DSI1P 50 + +#define BCM2838_CLOCK_EMMC2 51
Signature · 1 line
2.22.0
PATCH 6/16 dt-bindings: Define BCM2838_CLOCK_EMMC2 needed for RaspberryPi 4
Quoted 15 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
On BCM2838 there is an additional clock. This clock was added in the same bcm2835-cprman driver and is used by the emmc2 dt node.
Signed-off-by Andrei Gherzan <[email protected]>--- include/dt-bindings/clock/bcm2835.h | 2 ++ 1 file changed, 2 insertions(+)include/dt-bindings/clock/bcm2835.h +0
-0
include/dt-bindings/clock/bcm2835.h line 62
Quoted 5 lines
include/dt-bindings/clock/bcm2835.h +2
-0@@ -58,3 +58,5 @@#define BCM2835_CLOCK_DSI1E 48#define BCM2835_CLOCK_DSI0P 49#define BCM2835_CLOCK_DSI1P 50 + +#define BCM2838_CLOCK_EMMC2 51
no new line please.
PATCH 7/16 arm: bcm283x: Include definition for additional emmc clock
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
This clock has a different mbox ID[1] so have this included in the relevant header file.
[1] https://github.com/raspberrypi/firmware/issues/1179
--- arch/arm/mach-bcm283x/include/mach/mbox.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-bcm283x/include/mach/mbox.h +1 -0
@@ -239,6 +239,7 @@ struct bcm2835_mbox_tag_set_power_state {#define BCM2835_MBOX_CLOCK_ID_SDRAM 8#define BCM2835_MBOX_CLOCK_ID_PIXEL 9#define BCM2835_MBOX_CLOCK_ID_PWM 10 +#define BCM2835_MBOX_CLOCK_ID_EMMC2 12struct bcm2835_mbox_tag_get_clock_rate {struct bcm2835_mbox_tag_hdr tag_hdr;
Signature · 1 line
2.22.0
PATCH 8/16 mmc: bcm2835_sdhci: Add support for bcm2711 device
In reply to andrei at gherzan.roFrom: Matthias Brugger <[email protected]>
The bcm2711 has two emmc controller. The difference is the clocks they use. Add support for the second emmc contoller.
--- drivers/mmc/bcm2835_sdhci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/mmc/bcm2835_sdhci.c +10 -2
@@ -178,12 +178,13 @@ static int bcm2835_sdhci_probe(struct udevice *dev)fdt_addr_t base;int emmc_freq;int ret; +int clock_id = (int )dev_get_driver_data (dev); base =devfdt_get_addr (dev);if (base ==FDT_ADDR_T_NONE )return -EINVAL ; - ret =bcm2835_get_mmc_clock (BCM2835_MBOX_CLOCK_ID_EMMC ); + ret =bcm2835_get_mmc_clock (clock_id);if (ret <0 ) {debug ("%s: Failed to set MMC clock (err=%d)\n" , __func__, ret);return ret;
@@ -228,7 +229,14 @@ static int bcm2835_sdhci_probe(struct udevice *dev) }static const struct udevice_id bcm2835_sdhci_match[] = { - { .compatible ="brcm,bcm2835-sdhci" }, + { + .compatible ="brcm,bcm2835-sdhci" , + .data =BCM2835_MBOX_CLOCK_ID_EMMC + }, + { + .compatible ="brcm,bcm2711-emmc2" , + .data =BCM2835_MBOX_CLOCK_ID_EMMC2 + }, {/* sentinel */ } };
Signature · 1 line
2.22.0
PATCH 8/16 mmc: bcm2835_sdhci: Add support for bcm2711 device
Quoted 6 lines · andrei at gherzan.ro
From: Matthias Brugger <[email protected]>
The bcm2711 has two emmc controller. The difference is the clocks they use. Add support for the second emmc contoller.
Signed-off-by Matthias Brugger <[email protected]>
missing your signed-off-by.
Quoted 40 lines
--- drivers/mmc/bcm2835_sdhci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)drivers/mmc/bcm2835_sdhci.c +10
-2@@ -178,12 +178,13 @@ static int bcm2835_sdhci_probe(struct udevice *dev)fdt_addr_t base;int emmc_freq;int ret; +int clock_id = (int )dev_get_driver_data (dev); base =devfdt_get_addr (dev);if (base ==FDT_ADDR_T_NONE )return -EINVAL ; - ret =bcm2835_get_mmc_clock (BCM2835_MBOX_CLOCK_ID_EMMC ); + ret =bcm2835_get_mmc_clock (clock_id);if (ret <0 ) {debug ("%s: Failed to set MMC clock (err=%d)\n" , __func__, ret);return ret;@@ -228,7 +229,14 @@ static int bcm2835_sdhci_probe(struct udevice *dev) }static const struct udevice_id bcm2835_sdhci_match[] = { - { .compatible ="brcm,bcm2835-sdhci" }, + { + .compatible ="brcm,bcm2835-sdhci" , + .data =BCM2835_MBOX_CLOCK_ID_EMMC + }, + { + .compatible ="brcm,bcm2711-emmc2" , + .data =BCM2835_MBOX_CLOCK_ID_EMMC2 + }, {/* sentinel */ } };
PATCH 9/16 arm: bcm283x: Define device base addresses for bcm2835
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- arch/arm/mach-bcm283x/include/mach/sdhci.h | 4 ++++ arch/arm/mach-bcm283x/include/mach/timer.h | 4 ++++ arch/arm/mach-bcm283x/include/mach/wdog.h | 4 ++++ 3 files changed, 12 insertions(+)
arch/arm/mach-bcm283x/include/mach/sdhci.h +4 -0
@@ -7,7 +7,11 @@#define _BCM2835_SDHCI_H_#ifndef CONFIG_BCM2835 +#ifdef CONFIG_BCM2838 +#define BCM2835_SDHCI_BASE 0xfe300000 +#else #define BCM2835_SDHCI_BASE 0x3f300000 +#endif #else #define BCM2835_SDHCI_BASE 0x20300000#endif
arch/arm/mach-bcm283x/include/mach/timer.h +4 -0
@@ -7,7 +7,11 @@#define _BCM2835_TIMER_H#ifndef CONFIG_BCM2835 +#ifdef CONFIG_BCM2838 +#define BCM2835_TIMER_PHYSADDR 0xfe003000 +#else #define BCM2835_TIMER_PHYSADDR 0x3f003000 +#endif #else #define BCM2835_TIMER_PHYSADDR 0x20003000#endif
arch/arm/mach-bcm283x/include/mach/wdog.h +4 -0
@@ -7,7 +7,11 @@#define _BCM2835_WDOG_H#ifndef CONFIG_BCM2835 +#ifdef CONFIG_BCM2838 +#define BCM2835_WDOG_PHYSADDR 0xfe100000 +#else #define BCM2835_WDOG_PHYSADDR 0x3f100000 +#endif #else #define BCM2835_WDOG_PHYSADDR 0x20100000#endif
Signature · 1 line
2.22.0
PATCH 10/16 bcm2835 video: Bail out early if querying video information fails
In reply to andrei at gherzan.roFrom: Fabian Vogt <[email protected]>
Otherwise there is a crash with newer RPi firmware, see
https://github.com/raspberrypi/firmware/issues/1157
--- drivers/video/bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/bcm2835.c +3 -1
@@ -19,13 +19,15 @@ static int bcm2835_video_probe(struct udevice *dev)debug ("bcm2835: Query resolution...\n" ); ret =bcm2835_get_video_size (&w, &h); -if (ret) +if (ret || w ==0 || h ==0 )return -EIO ;debug ("bcm2835: Setting up display for %d x %d\n" , w, h); ret =bcm2835_set_video_params (&w, &h,32 ,BCM2835_MBOX_PIXEL_ORDER_RGB ,BCM2835_MBOX_ALPHA_MODE_IGNORED , &fb_base, &fb_size, &pitch); +if (ret) +return -EIO ;debug ("bcm2835: Final resolution is %d x %d\n" , w, h);
Signature · 1 line
2.22.0
PATCH 11/16 bcm283x mbox: Correctly wait for space to send
In reply to andrei at gherzan.roFrom: Fabian Vogt <[email protected]>
For sending, the second mailbox is used, but previously the status register of the first one was read.
--- arch/arm/mach-bcm283x/include/mach/mbox.h | 7 +++++-- arch/arm/mach-bcm283x/mbox.c | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-)
arch/arm/mach-bcm283x/include/mach/mbox.h +5 -2
@@ -51,9 +51,12 @@struct bcm2835_mbox_regs {u32 read;u32 rsvd0[5 ]; -u32 status; -u32 config; +u32 status_r; +u32 config_r;u32 write; +u32 rsvd1[5 ]; +u32 status_w; +u32 config_w; };#define BCM2835_MBOX_STATUS_WR_FULL 0x80000000
arch/arm/mach-bcm283x/mbox.c +3 -3
@@ -27,7 +27,7 @@ int bcm2835_mbox_call_raw(u32 chan, u32 send, u32 *recv)/* Drain any stale responses */ for (;;) { - val =readl (®s->status); + val =readl (®s->status_r);if (val &BCM2835_MBOX_STATUS_RD_EMPTY )break ;if (get_timer (0 ) >= endtime) {
@@ -40,7 +40,7 @@ int bcm2835_mbox_call_raw(u32 chan, u32 send, u32 *recv)/* Wait for space to send */ for (;;) { - val =readl (®s->status); + val =readl (®s->status_w);if (!(val &BCM2835_MBOX_STATUS_WR_FULL ))break ;if (get_timer (0 ) >= endtime) {
@@ -58,7 +58,7 @@ int bcm2835_mbox_call_raw(u32 chan, u32 send, u32 *recv)/* Wait for the response */ for (;;) { - val =readl (®s->status); + val =readl (®s->status_r);if (!(val &BCM2835_MBOX_STATUS_RD_EMPTY ))break ;if (get_timer (0 ) >= endtime) {
Signature · 1 line
2.22.0
PATCH 12/16 config: rpi4: Add defconfig for rpi4-32
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- configs/rpi_4_32b_defconfig | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 configs/rpi_4_32b_defconfig
configs/rpi_4_32b_defconfig new file +43 -0
@@ -0,0 +1,43 @@ +CONFIG_ARM=y +CONFIG_ARCH_BCM283X=y +CONFIG_SYS_TEXT_BASE=0x00008000 +CONFIG_TARGET_RPI_4_32B=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_OF_BOARD_SETUP=y +CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_SYS_PROMPT="U-Boot> " +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_FS_UUID=y +CONFIG_OF_EMBED=y +CONFIG_DEFAULT_DEVICE_TREE="bcm2838-rpi-4-b" +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DM_KEYBOARD=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PHYLIB=y +CONFIG_DM_ETH=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_DWC2=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_LAN78XX=y +CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.22.0
PATCH 12/16 config: rpi4: Add defconfig for rpi4-32
Quoted 42 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
Signed-off-by Andrei Gherzan <[email protected]>--- configs/rpi_4_32b_defconfig | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 configs/rpi_4_32b_defconfigconfigs/rpi_4_32b_defconfig new file +28
-0@@ -0,0 +1,43 @@ +CONFIG_ARM=y +CONFIG_ARCH_BCM283X=y +CONFIG_SYS_TEXT_BASE=0x00008000 +CONFIG_TARGET_RPI_4_32B=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_OF_BOARD_SETUP=y +CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_SYS_PROMPT="U-Boot> " +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_FS_UUID=y +CONFIG_OF_EMBED=y +CONFIG_DEFAULT_DEVICE_TREE="bcm2838-rpi-4-b" +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DM_KEYBOARD=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PHYLIB=y +CONFIG_DM_ETH=y
configs/rpi_4_32b_defconfig line 38
Quoted 10 lines
configs/rpi_4_32b_defconfig new file +10
-0+CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_DWC2=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_LAN78XX=y +CONFIG_USB_ETHER_SMSC95XX=y
Network is connected via PCI, why do we need this options here?
Quoted 6 lines
configs/rpi_4_32b_defconfig new file +5
-0+CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_OF_LIBFDT_OVERLAY=y
PATCH 12/16 config: rpi4: Add defconfig for rpi4-32
Quoted 50 lines · Matthias Brugger
Quoted 46 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
Signed-off-by Andrei Gherzan <[email protected]>--- configs/rpi_4_32b_defconfig | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 configs/rpi_4_32b_defconfigconfigs/rpi_4_32b_defconfig new file +32
-0@@ -0,0 +1,43 @@ +CONFIG_ARM=y +CONFIG_ARCH_BCM283X=y +CONFIG_SYS_TEXT_BASE=0x00008000 +CONFIG_TARGET_RPI_4_32B=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_OF_BOARD_SETUP=y +CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_SYS_PROMPT="U-Boot> " +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_FS_UUID=y +CONFIG_OF_EMBED=y +CONFIG_DEFAULT_DEVICE_TREE="bcm2838-rpi-4-b" +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DM_KEYBOARD=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PHYLIB=y +CONFIG_DM_ETH=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_USB=y
Quoted 8 lines
configs/rpi_4_32b_defconfig line 38
Quoted 6 lines
configs/rpi_4_32b_defconfig new file +6
-0+CONFIG_DM_USB=y +CONFIG_USB_DWC2=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_LAN78XX=y +CONFIG_USB_ETHER_SMSC95XX=yNetwork is connected via PCI, why do we need this options here?
Network is attached to a PHY not via PCI, that would be the USB.
It seems they're removed in patch 15 but the two should be squashed together.
Quoted 10 lines
configs/rpi_4_32b_defconfig line 43
Quoted 6 lines
configs/rpi_4_32b_defconfig new file +5
-0+CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_OF_LIBFDT_OVERLAY=y_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 13/16 dts: bcm2838-rpi-4-b: Use the emmc2 interface for sdhci
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- arch/arm/dts/bcm2838-rpi-4-b.dts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
arch/arm/dts/bcm2838-rpi-4-b.dts +6 -10
@@ -30,21 +30,17 @@ status = "okay"; }; -/* SDHCI is used to control the SDIO for wireless */ &sdhci { - pinctrl-names = "default"; - pinctrl-0 = <&emmc_gpio34>; - status = "okay"; - bus-width = <4>; - non-removable; + status = "disabled"; }; -/* SDHOST is used to drive the SD card */ &sdhost { - pinctrl-names = "default"; - pinctrl-0 = <&sdhost_gpio48>; + status = "disabled"; +}; + +&emmc2 { + compatible = "brcm,bcm2835-sdhci"; status = "okay"; - bus-width = <4>; }; &gpio {
Signature · 1 line
2.22.0
PATCH 13/16 dts: bcm2838-rpi-4-b: Use the emmc2 interface for sdhci
Quoted 3 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
Signed-off-by Andrei Gherzan <[email protected]>
Commit message.
You fix a file that you introduced in this series. Any reason why you don't just send the file already fixed?
Quoted 37 lines
--- arch/arm/dts/bcm2838-rpi-4-b.dts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)arch/arm/dts/bcm2838-rpi-4-b.dts +6
-10@@ -30,21 +30,17 @@ status = "okay"; }; -/* SDHCI is used to control the SDIO for wireless */ &sdhci { - pinctrl-names = "default"; - pinctrl-0 = <&emmc_gpio34>; - status = "okay"; - bus-width = <4>; - non-removable; + status = "disabled"; }; -/* SDHOST is used to drive the SD card */ &sdhost { - pinctrl-names = "default"; - pinctrl-0 = <&sdhost_gpio48>; + status = "disabled"; +}; + +&emmc2 { + compatible = "brcm,bcm2835-sdhci"; status = "okay"; - bus-width = <4>; }; &gpio {
PATCH 14/16 rpi: Add memory map for bcm2838
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- board/raspberrypi/rpi/rpi.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
board/raspberrypi/rpi/rpi.c +24 -3
@@ -249,7 +249,8 @@ static uint32_t rev_type;static const struct rpi_model *model; #ifdef CONFIG_ARM64 -static struct mm_region bcm2837_mem_map[] = { +#ifndef CONFIG_BCM2838 +static struct mm_region bcm283x_mem_map[] = { { .virt = 0x00000000UL, .phys = 0x00000000UL,
@@ -268,8 +269,28 @@ static struct mm_region bcm2837_mem_map[] = { 0, } }; - -struct mm_region *mem_map = bcm2837_mem_map; +#else +static struct mm_region bcm283x_mem_map[] = { + { + .virt =0x00000000UL , + .phys =0x00000000UL , + .size =0xf3000000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_NORMAL ) | +PTE_BLOCK_INNER_SHARE + }, { + .virt =0xfe000000UL , + .phys =0xfe000000UL , + .size =0x01800000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_DEVICE_NGNRNE ) | +PTE_BLOCK_NON_SHARE | +PTE_BLOCK_PXN |PTE_BLOCK_UXN + }, { +/* List terminator */ +0 , + } +}; +#endif +struct mm_region *mem_map = bcm283x_mem_map;#endif int dram_init (void )
Signature · 1 line
2.22.0
PATCH 15/16 configs: rpi4: Remove DWC2 and USB_ETHER configs
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
dwc2 is only connected to the usb-c port so we don't have any real benefit in having it enabled in uboot.
Also, the GENET interface is connected directly to the SoC so we can drop the USB_ETHER configs.
--- configs/rpi_4_32b_defconfig | 3 --- configs/rpi_4_defconfig | 3 --- 2 files changed, 6 deletions(-)
configs/rpi_4_32b_defconfig +0 -3
@@ -31,11 +31,8 @@ CONFIG_PINCTRL=y # CONFIG_REQUIRE_SERIAL_CONSOLE is not set CONFIG_USB=y CONFIG_DM_USB=y -CONFIG_USB_DWC2=y CONFIG_USB_KEYBOARD=y CONFIG_USB_HOST_ETHER=y -CONFIG_USB_ETHER_LAN78XX=y -CONFIG_USB_ETHER_SMSC95XX=y CONFIG_DM_VIDEO=y CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=10
configs/rpi_4_defconfig +0 -3
@@ -31,11 +31,8 @@ CONFIG_PINCTRL=y # CONFIG_REQUIRE_SERIAL_CONSOLE is not set CONFIG_USB=y CONFIG_DM_USB=y -CONFIG_USB_DWC2=y CONFIG_USB_KEYBOARD=y CONFIG_USB_HOST_ETHER=y -CONFIG_USB_ETHER_LAN78XX=y -CONFIG_USB_ETHER_SMSC95XX=y CONFIG_DM_VIDEO=y CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=10
Signature · 1 line
2.22.0
PATCH 16/16 dts: bcm2838-rpi-4-b: Use the emmc2/2811 compatible string for SDHCI
In reply to andrei at gherzan.roFrom: Andrei Gherzan <[email protected]>
--- arch/arm/dts/bcm2838-rpi-4-b.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/bcm2838-rpi-4-b.dts +1 -1
@@ -39,7 +39,7 @@ }; &emmc2 { - compatible = "brcm,bcm2835-sdhci"; + compatible = "brcm,bcm2711-emmc2"; status = "okay"; };
Signature · 1 line
2.22.0
cover Raspberry Pi 32/64 support
In reply to andrei at gherzan.roQuoted 3 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
This PR consolidates the work we've done to support the new Raspberry Pi
I don't understand why you posted these while you asked me if I'll submit them. That's not a good way to collaborate on upstream.
Please use get_maintainers.pl to see whom you have to send the patches to.
Quoted 18 lines
4 board. It also includes commits from
https://github.com/mbgg/u-boot.git (credits to Matthias Brugger).Andrei Gherzan (13):
dts: Create a dtsi for BCM2835/6/7 specific configuration
dts: Add initial support for bcm2838
arm: mach-bcm283x: Define configs for RaspberryPi 4
arm: mach-bcm283x: Define mbox address for BCM2838
rpi: Addrpi_modelentry for RaspberryPi 4
dt-bindings: DefineBCM2838_CLOCK_EMMC2needed for RaspberryPi 4
arm: bcm283x: Include definition for additional emmc clock
arm: bcm283x: Define device base addresses for bcm2835
config: rpi4: Add defconfig for rpi4-32
dts: bcm2838-rpi-4-b: Use the emmc2 interface for sdhci
rpi: Add memory map for bcm2838
configs: rpi4: Remove DWC2 andUSB_ETHERconfigs
dts: bcm2838-rpi-4-b: Use the emmc2/2811 compatible string for SDHCI
Quoted 3 lines
Fabian Vogt (2):
bcm2835 video: Bail out early if querying video information fails bcm283x mbox: Correctly wait for space to send
Both not needed with FW at025759b86 ("firmware: Rename hdmi_enable_4k to hdmi_enable_4kp60") Apart from that they have already been posted.
Quoted 30 lines
Matthias Brugger (1):
mmc:bcm2835_sdhci: Add support for bcm2711 devicearch/arm/dts/Makefile | 4 +- arch/arm/dts/bcm2835-common.dtsi | 53 +++++ arch/arm/dts/bcm2835.dtsi | 1 + arch/arm/dts/bcm2836.dtsi | 1 + arch/arm/dts/bcm2837.dtsi | 1 + arch/arm/dts/bcm2838-rpi-4-b.dts | 52 +++++ arch/arm/dts/bcm2838.dtsi | 237 +++++++++++++++++++++ arch/arm/dts/bcm283x.dtsi | 45 +--- arch/arm/mach-bcm283x/Kconfig | 35 +++ arch/arm/mach-bcm283x/include/mach/mbox.h | 13 +- arch/arm/mach-bcm283x/include/mach/sdhci.h | 4 + arch/arm/mach-bcm283x/include/mach/timer.h | 4 + arch/arm/mach-bcm283x/include/mach/wdog.h | 4 + arch/arm/mach-bcm283x/mbox.c | 6 +- board/raspberrypi/rpi/rpi.c | 32 ++- configs/rpi_4_32b_defconfig | 40 ++++ configs/rpi_4_defconfig | 3 - drivers/mmc/bcm2835_sdhci.c | 12 +- drivers/video/bcm2835.c | 4 +- include/dt-bindings/clock/bcm2835.h | 2 + 20 files changed, 494 insertions(+), 59 deletions(-) create mode 100644 arch/arm/dts/bcm2835-common.dtsi create mode 100644 arch/arm/dts/bcm2838-rpi-4-b.dts create mode 100644 arch/arm/dts/bcm2838.dtsi create mode 100644 configs/rpi_4_32b_defconfig
cover Raspberry Pi 32/64 support
Hi,
Quoted 11 lines · Matthias Brugger
Quoted 3 lines · andrei at gherzan.ro
From: Andrei Gherzan <[email protected]>
This PR consolidates the work we've done to support the new Raspberry
Pi
I don't understand why you posted these while you asked me if I'll submit them.
That's not a good way to collaborate on upstream.
As I have mentioned privately, I've done that due to the fact that I haven't gotten any feedback from you. Nevertheless, I will sync up with you for the next iteration for this PR which will include the changes requested.
--
Andrei Gherzan
gpg: rsa4096/D4D94F67AD0E9640 | t: @agherzan
v2 cover Raspberry Pi 32/64 support
In reply to andrei at gherzan.roChanges for v2:
- Removed patches that are not needed anymore due to firmware update
- Removed usage of embedded dtb as opposed to reusing the loaded dtb by the firmware
- Removed known unsupported/not applicable peripherals (i.e USB) from defconfigs
- Make sure the memory/reg is left untouched as configured by the firmware
Andrei Gherzan (6):
RPI: Add defconfigs for rpi4 (32/64)
ARM: bcm283x: Define configs for RaspberryPi 4
RPI: Add entry for Raspberry Pi 4 model B
ARM: bcm283x: Include definition for additional emmc clock
RPI: Add memory map for bcm2838
git-mailrc: Add rpi and bcm283x maintainer
Matthias Brugger (2):
ARM: bcm283x: Add BCM283x_BASE define
mmc: bcm283x: Add support for bcm2711 device in bcm2835_sdhci
arch/arm/mach-bcm283x/Kconfig | 67 ++++++++++++++++++++++ arch/arm/mach-bcm283x/include/mach/mbox.h | 7 +-- arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +- arch/arm/mach-bcm283x/include/mach/timer.h | 6 +- arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +- board/raspberrypi/rpi/rpi.c | 32 ++++++++++- configs/rpi_4_32b_defconfig | 33 +++++++++++ configs/rpi_4_defconfig | 33 +++++++++++ doc/git-mailrc | 4 ++ drivers/mmc/bcm2835_sdhci.c | 12 +++- 10 files changed, 181 insertions(+), 25 deletions(-) create mode 100644 configs/rpi_4_32b_defconfig create mode 100644 configs/rpi_4_defconfig
Signature · 1 line
2.22.0
PATCH v2 1/8 RPI: Add defconfigs for rpi4 (32/64)
This defines a minimum defconfig for each of the two Raspberry Pi 4 variants. One notable difference is that we don't have a embedded dt for this board given that the fw supplies us with one which we can reuse. Furthermore, the ram size is not queryable through mbox interface as the maximum reported size is 1G. The fw patches the dt with the right memory configuration and uboot uses it as it is. We avoid u-boot touching this configuration by making sure CONFIG_ARCH_FIXUP_FDT_MEMORY is deactivated.
--- configs/rpi_4_32b_defconfig | 33 +++++++++++++++++++++++++++++++++ configs/rpi_4_defconfig | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 configs/rpi_4_32b_defconfig create mode 100644 configs/rpi_4_defconfig
configs/rpi_4_32b_defconfig new file +33 -0
@@ -0,0 +1,33 @@ +CONFIG_ARM=y +CONFIG_ARCH_BCM283X=y +CONFIG_SYS_TEXT_BASE=0x00008000 +CONFIG_TARGET_RPI_4_32B=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set +CONFIG_OF_BOARD=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_SYS_PROMPT="U-Boot> " +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_FS_UUID=y +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DM_KEYBOARD=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_OF_LIBFDT_OVERLAY=y
configs/rpi_4_defconfig new file +33 -0
@@ -0,0 +1,33 @@ +CONFIG_ARM=y +CONFIG_ARCH_BCM283X=y +CONFIG_SYS_TEXT_BASE=0x00080000 +CONFIG_TARGET_RPI_4=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set +CONFIG_OF_BOARD=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_SYS_PROMPT="U-Boot> " +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_FS_UUID=y +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DM_KEYBOARD=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.22.0
PATCH v2 2/8 ARM: bcm283x: Add BCM283x_BASE define
In reply to Andrei GherzanFrom: Matthias Brugger <[email protected]>
Devices of bcm283x have different base address, depending if they are on bcm2835 or bcm2836/7. Use BCM283x_BASE depending on the SoC you want to build and only add the offset in the header files.
--- arch/arm/mach-bcm283x/Kconfig | 5 +++++ arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +----- arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +----- arch/arm/mach-bcm283x/include/mach/timer.h | 6 +----- arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +----- 5 files changed, 9 insertions(+), 20 deletions(-)
arch/arm/mach-bcm283x/Kconfig +5 -0
@@ -141,4 +141,9 @@ config SYS_SOC config SYS_CONFIG_NAME default "rpi" +config BCM283x_BASE + hex + default "0x20000000" if BCM2835 + default "0x3f000000" if BCM2836 || BCM2837 + endmenu
arch/arm/mach-bcm283x/include/mach/mbox.h +1 -5
@@ -37,11 +37,7 @@/* Raw mailbox HW */ -#ifndef CONFIG_BCM2835 -#define BCM2835_MBOX_PHYSADDR 0x3f00b880 -#else -#define BCM2835_MBOX_PHYSADDR 0x2000b880 -#endif +#define BCM2835_MBOX_PHYSADDR (CONFIG_BCM283x_BASE + 0x0000b880)struct bcm2835_mbox_regs {u32 read;
arch/arm/mach-bcm283x/include/mach/sdhci.h +1 -5
@@ -6,11 +6,7 @@#ifndef _BCM2835_SDHCI_H_#define _BCM2835_SDHCI_H_ -#ifndef CONFIG_BCM2835 -#define BCM2835_SDHCI_BASE 0x3f300000 -#else -#define BCM2835_SDHCI_BASE 0x20300000 -#endif +#define BCM2835_SDHCI_BASE (CONFIG_BCM283x_BASE + 0x00300000)int bcm2835_sdhci_init (u32 regbase,u32 emmc_freq);
arch/arm/mach-bcm283x/include/mach/timer.h +1 -5
@@ -6,11 +6,7 @@#ifndef _BCM2835_TIMER_H#define _BCM2835_TIMER_H -#ifndef CONFIG_BCM2835 -#define BCM2835_TIMER_PHYSADDR 0x3f003000 -#else -#define BCM2835_TIMER_PHYSADDR 0x20003000 -#endif +#define BCM2835_TIMER_PHYSADDR (CONFIG_BCM283x_BASE + 0x00003000)#define BCM2835_TIMER_CS_M3 (1 << 3)#define BCM2835_TIMER_CS_M2 (1 << 2)
arch/arm/mach-bcm283x/include/mach/wdog.h +1 -5
@@ -6,11 +6,7 @@ #ifndef _BCM2835_WDOG_H #define _BCM2835_WDOG_H -#ifndef CONFIG_BCM2835 -#define BCM2835_WDOG_PHYSADDR 0x3f100000 -#else -#define BCM2835_WDOG_PHYSADDR 0x20100000 -#endif +#define BCM2835_WDOG_PHYSADDR (CONFIG_BCM283x_BASE + 0x00100000) struct bcm2835_wdog_regs { u32 unknown0[7];
Signature · 1 line
2.22.0
PATCH v2 2/8 ARM: bcm283x: Add BCM283x_BASE define
Quoted 21 lines · Andrei Gherzan
From: Matthias Brugger <[email protected]>
Devices of bcm283x have different base address, depending if they are on bcm2835 or bcm2836/7. Use
BCM283x_BASEdepending on the SoC you want to build and only add the offset in the header files.Signed-off-by Matthias Brugger <[email protected]>Signed-off-by Andrei Gherzan <[email protected]>--- arch/arm/mach-bcm283x/Kconfig | 5 +++++ arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +----- arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +----- arch/arm/mach-bcm283x/include/mach/timer.h | 6 +----- arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +----- 5 files changed, 9 insertions(+), 20 deletions(-)arch/arm/mach-bcm283x/Kconfig +0
-0
arch/arm/mach-bcm283x/Kconfig config SYS_SOC · line 147
Quoted 7 lines
arch/arm/mach-bcm283x/Kconfig +4
-0@@ -141,4 +141,9 @@ config SYS_SOC config SYS_CONFIG_NAME default "rpi" +config BCM283x_BASE + hex + default "0x20000000" if BCM2835 + default "0x3f000000" if BCM2836 || BCM2837
How hard would it be to make the base a global variable instead and just set it early on board init based on the FDT or maybe even CPU core revision registers?
That would allow us to support RPi3 & 4 with the same U-Boot binary.
Alex
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 2/8 ARM: bcm283x: Add BCM283x_BASE define
Quoted 37 lines · Matthias Brugger
Quoted 19 lines · Alexander Graf
Quoted 16 lines · Andrei Gherzan
From: Matthias Brugger <[email protected]>
Devices of bcm283x have different base address, depending if they are on bcm2835 or bcm2836/7. Use
BCM283x_BASEdepending on the SoC you want to build and only add the offset in the header files.Signed-off-by Matthias Brugger <[email protected]>Signed-off-by Andrei Gherzan <[email protected]>--- arch/arm/mach-bcm283x/Kconfig | 5 +++++ arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +----- arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +----- arch/arm/mach-bcm283x/include/mach/timer.h | 6 +----- arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +----- 5 files changed, 9 insertions(+), 20 deletions(-)Quoted 14 lines
arch/arm/mach-bcm283x/Kconfig config SYS_SOC · line 146
Quoted 11 lines
arch/arm/mach-bcm283x/Kconfig +3
-0@@ -141,4 +141,9 @@ config SYS_SOC config SYS_CONFIG_NAME default "rpi" +config BCM283x_BASE + hex + default "0x20000000" if BCM2835 + default "0x3f000000" if BCM2836 || BCM2837How hard would it be to make the base a global variable instead and just set it early on board init based on the FDT or maybe even CPU core revision registers?
Quoted 7 lines
Might be possible. Candidates to implement this are
board_early_init_formisc_init_f, I think.Quoted 2 lines
That would allow us to support RPi3 & 4 with the same U-Boot binary.
Good point :)
Yeah, then you only need to do the memory map dynamically as well and the rest should all be handled by DT :). Which again means you don't need a new config target at all!
Alex
PATCH v2 2/8 ARM: bcm283x: Add BCM283x_BASE define
Hi,
Quoted 50 lines · Alexander Graf
Quoted 47 lines · Matthias Brugger
Quoted 30 lines · Alexander Graf
Quoted 27 lines · Andrei Gherzan
From: Matthias Brugger <[email protected]>
Devices of bcm283x have different base address, depending if they are on
bcm2835 or bcm2836/7. UseBCM283x_BASEdepending on the SoC you want to
build and only add the offset in the header files.Signed-off-by Matthias Brugger <[email protected]>Signed-off-by Andrei Gherzan <[email protected]>---
arch/arm/mach-bcm283x/Kconfig | 5 +++++ arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +-----arch/arm/mach-bcm283x/include/mach/sdhci.h| 6 +-----arch/arm/mach-bcm283x/include/mach/timer.h| 6 +----- arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +-----5 files changed, 9 insertions(+), 20 deletions(-)arch/arm/mach-bcm283x/Kconfig +0
-0@@ -141,4 +141,9 @@ config SYS_SOCconfig
SYS_CONFIG_NAME
default "rpi"
+configBCM283x_BASEQuoted 8 lines
Quoted 3 lines
+ hex
+ default "0x20000000" if BCM2835
+ default "0x3f000000" if BCM2836 || BCM2837How hard would it be to make the base a global variable instead and just set it
early on board init based on the FDT or maybe even CPU core revision registers?Might be possible. Candidates to implement this are
board_early_init_formisc_init_f, I think.Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
That would allow us to support RPi3 & 4 with the same U-Boot binary.
Good point :)
Yeah, then you only need to do the memory map dynamically as well and the rest should all be handled by DT :). Which again means you don't need a new config target at all!
I like that. It will bring a little confusion though when using a rpi3 defconfig for rpi4. I guess we could just copy it.
Signature · 2 lines
Andrei Gherzan gpg: rsa4096/D4D94F67AD0E9640 | t: @agherzan
PATCH v2 2/8 ARM: bcm283x: Add BCM283x_BASE define
Quoted 55 lines · Andrei Gherzan
Hi,
Quoted 52 lines · Alexander Graf
Quoted 49 lines · Matthias Brugger
Quoted 30 lines · Alexander Graf
Quoted 27 lines · Andrei Gherzan
From: Matthias Brugger <[email protected]>
Devices of bcm283x have different base address, depending if they are on
bcm2835 or bcm2836/7. UseBCM283x_BASEdepending on the SoC you want to
build and only add the offset in the header files.Signed-off-by Matthias Brugger <[email protected]>Signed-off-by Andrei Gherzan <[email protected]>---
arch/arm/mach-bcm283x/Kconfig | 5 +++++ arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +-----arch/arm/mach-bcm283x/include/mach/sdhci.h| 6 +-----arch/arm/mach-bcm283x/include/mach/timer.h| 6 +----- arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +-----5 files changed, 9 insertions(+), 20 deletions(-)arch/arm/mach-bcm283x/Kconfig +0
-0@@ -141,4 +141,9 @@ config SYS_SOCconfig
SYS_CONFIG_NAME
default "rpi"
+configBCM283x_BASEQuoted 8 lines
Quoted 3 lines
+ hex
+ default "0x20000000" if BCM2835
+ default "0x3f000000" if BCM2836 || BCM2837How hard would it be to make the base a global variable instead and just set it
early on board init based on the FDT or maybe even CPU core revision registers?Might be possible. Candidates to implement this are
board_early_init_formisc_init_f, I think.Quoted 2 lines
That would allow us to support RPi3 & 4 with the same U-Boot binary.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Good point :)
Yeah, then you only need to do the memory map dynamically as well and the rest should all be handled by DT :). Which again means you don't need a new config target at all!
I like that. It will bring a little confusion though when using a rpi3 defconfig for rpi4. I guess we could just copy it.
I have a working POC of this feature, but it needs more time. I propose to merge RPi4 support now, so that it can get accepted for v2019.10. Afterwards we can implement a unified u-boot binary for RPi[34] and maybe even RPi[12] in the future.
If nobody shouts I'll merge this series fixing the two comments I had. Please let me know if you disagree.
Regards,
Matthias
PATCH v2 3/8 ARM: bcm283x: Define configs for RaspberryPi 4
In reply to Andrei GherzanDefine two target configs for Raspberry Pi 4 (32 and 64bit) and the corresponding BCM2838* configs.
Be aware of the current limitation in firmware which requires an explicit configuration to force the arm in 64bit mode when the respective target is used.
--- arch/arm/mach-bcm283x/Kconfig | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)
arch/arm/mach-bcm283x/Kconfig +62 -0
@@ -26,6 +26,23 @@ config BCM2837_64B select BCM2837 select ARM64 +config BCM2838 + bool "Broadcom BCM2838 SoC support" + depends on ARCH_BCM283X + +config BCM2838_32B + bool "Broadcom BCM2838 SoC 32-bit support" + depends on ARCH_BCM283X + select BCM2838 + select ARMV7_LPAE + select CPU_V7A + +config BCM2838_64B + bool "Broadcom BCM2838 SoC 64-bit support" + depends on ARCH_BCM283X + select BCM2838 + select ARM64 + menu "Broadcom BCM283X family" depends on ARCH_BCM283X
@@ -127,6 +144,50 @@ config TARGET_RPI_3 This option creates a build targeting the ARMv8/AArch64 ISA. select BCM2837_64B +config TARGET_RPI_4_32B + bool "Raspberry Pi 4 32-bit build" + help + Support for all BCM2838-based Raspberry Pi variants, such as + the RPi 4 model B, in AArch32 (32-bit) mode. + + This option assumes the VideoCore firmware is configured to use the + mini UART (rather than PL011) for the serial console. This is the + default on the RPi 4. To enable the UART console, the following non- + default option must be present in config.txt: enable_uart=1. This is + required for U-Boot to operate correctly, even if you only care + about the HDMI/usbkbd console. + + Due to hardware incompatibilities, this can't be used with + BCM283/5/6/7. + + This option creates a build targeting the ARMv7/AArch32 ISA. + select BCM2838_32B + +config TARGET_RPI_4 + bool "Raspberry Pi 4 64-bit build" + help + Support for all BCM2838-based Raspberry Pi variants, such as + the RPi 4 model B, in AArch64 (64-bit) mode. + + This option assumes the VideoCore firmware is configured to use the + mini UART (rather than PL011) for the serial console. This is the + default on the RPi 4. To enable the UART console, the following non- + default option must be present in config.txt: enable_uart=1. This is + required for U-Boot to operate correctly, even if you only care + about the HDMI/usbkbd console. + + Due to hardware incompatibilities, this can't be used with + BCM283/5/6/7. + + Also, due to a bug in firmware, switching to 64bit mode doesn't + happen automatically based on the kernel's image filename. See + https://github.com/raspberrypi/firmware/issues/1193 for more details. + Until that is resolved, the configuration (config.txt) needs to + explicitly set: arm_64bit=1. + + This option creates a build targeting the ARMv8/AArch64 ISA. + select BCM2838_64B + endchoice config SYS_BOARD
@@ -145,5 +206,6 @@ config BCM283x_BASE hex default "0x20000000" if BCM2835 default "0x3f000000" if BCM2836 || BCM2837 + default "0xfe000000" if BCM2838 endmenu
Signature · 1 line
2.22.0
PATCH v2 3/8 ARM: bcm283x: Define configs for RaspberryPi 4
Quoted 93 lines · Andrei Gherzan
Define two target configs for Raspberry Pi 4 (32 and 64bit) and the corresponding BCM2838* configs.
Be aware of the current limitation in firmware which requires an explicit configuration to force the arm in 64bit mode when the respective target is used.
Signed-off-by Andrei Gherzan <[email protected]>Signed-off-by Matthias Brugger <[email protected]>--- arch/arm/mach-bcm283x/Kconfig | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)arch/arm/mach-bcm283x/Kconfig +61
-0@@ -26,6 +26,23 @@ config BCM2837_64B select BCM2837 select ARM64 +config BCM2838 + bool "Broadcom BCM2838 SoC support" + depends on ARCH_BCM283X + +config BCM2838_32B + bool "Broadcom BCM2838 SoC 32-bit support" + depends on ARCH_BCM283X + select BCM2838 + select ARMV7_LPAE + select CPU_V7A + +config BCM2838_64B + bool "Broadcom BCM2838 SoC 64-bit support" + depends on ARCH_BCM283X + select BCM2838 + select ARM64 + menu "Broadcom BCM283X family" depends on ARCH_BCM283X@@ -127,6 +144,50 @@ config TARGET_RPI_3 This option creates a build targeting the ARMv8/AArch64 ISA. select BCM2837_64B +config TARGET_RPI_4_32B + bool "Raspberry Pi 4 32-bit build" + help + Support for all BCM2838-based Raspberry Pi variants, such as + the RPi 4 model B, in AArch32 (32-bit) mode. + + This option assumes the VideoCore firmware is configured to use the + mini UART (rather than PL011) for the serial console. This is the + default on the RPi 4. To enable the UART console, the following non- + default option must be present in config.txt: enable_uart=1. This is + required for U-Boot to operate correctly, even if you only care + about the HDMI/usbkbd console. + + Due to hardware incompatibilities, this can't be used with + BCM283/5/6/7. + + This option creates a build targeting the ARMv7/AArch32 ISA. + select BCM2838_32B + +config TARGET_RPI_4 + bool "Raspberry Pi 4 64-bit build" + help + Support for all BCM2838-based Raspberry Pi variants, such as + the RPi 4 model B, in AArch64 (64-bit) mode. + + This option assumes the VideoCore firmware is configured to use the + mini UART (rather than PL011) for the serial console. This is the + default on the RPi 4. To enable the UART console, the following non- + default option must be present in config.txt: enable_uart=1. This is + required for U-Boot to operate correctly, even if you only care + about the HDMI/usbkbd console. + + Due to hardware incompatibilities, this can't be used with + BCM283/5/6/7. + + Also, due to a bug in firmware, switching to 64bit mode doesn't + happen automatically based on the kernel's image filename. See + https://github.com/raspberrypi/firmware/issues/1193 for more details. + Until that is resolved, the configuration (config.txt) needs to + explicitly set: arm_64bit=1. + + This option creates a build targeting the ARMv8/AArch64 ISA. + select BCM2838_64B + endchoice config SYS_BOARD
arch/arm/mach-bcm283x/Kconfig config BCM283x_BASE · line 210
Quoted 5 lines
arch/arm/mach-bcm283x/Kconfig +1
-0@@ -145,5 +206,6 @@ config BCM283x_BASE hex default "0x20000000" if BCM2835 default "0x3f000000" if BCM2836 || BCM2837 + default "0xfe000000" if BCM2838
In upstream kernel the SoC uses bcm2711 as identifier. So this get's messy here, because we have all the bcm283x stuff. Anyway we should try to keep the confusion as low as possible, so I propose to rename all BCM2838 in here to BCM2711.
It's not perfect but I think it's the best we can get right now.
Regards,
Matthias
PATCH v2 4/8 RPI: Add entry for Raspberry Pi 4 model B
In reply to Andrei GherzanThe Raspebrry Pi 4 uses the new revision code scheme as documented by the foundation. This change adds an entry for this board as well.
--- board/raspberrypi/rpi/rpi.c | 5 +++++ 1 file changed, 5 insertions(+)
board/raspberrypi/rpi/rpi.c +5 -0
@@ -148,6 +148,11 @@ static const struct rpi_model rpi_models_new_scheme[] = {DTB_DIR "bcm2837-rpi-cm3.dtb" , false, }, + [0x11] = { +"4 Model B" , +DTB_DIR "bcm2711-rpi-4-b.dtb" , + true, + }, }; static const struct rpi_model rpi_models_old_scheme[] = {
Signature · 1 line
2.22.0
PATCH v2 5/8 ARM: bcm283x: Include definition for additional emmc clock
In reply to Andrei GherzanThis clock has a different mbox ID so have this included in the relevant header file.
--- arch/arm/mach-bcm283x/include/mach/mbox.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-bcm283x/include/mach/mbox.h +1 -0
@@ -230,6 +230,7 @@ struct bcm2835_mbox_tag_set_power_state {#define BCM2835_MBOX_CLOCK_ID_SDRAM 8#define BCM2835_MBOX_CLOCK_ID_PIXEL 9#define BCM2835_MBOX_CLOCK_ID_PWM 10 +#define BCM2835_MBOX_CLOCK_ID_EMMC2 12struct bcm2835_mbox_tag_get_clock_rate {struct bcm2835_mbox_tag_hdr tag_hdr;
Signature · 1 line
2.22.0
PATCH v2 6/8 mmc: bcm283x: Add support for bcm2711 device in bcm2835_sdhci
In reply to Andrei GherzanFrom: Matthias Brugger <[email protected]>
The bcm2711 has two emmc controllers. The difference is the clocks they use. Add support for the second emmc controller.
--- drivers/mmc/bcm2835_sdhci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/mmc/bcm2835_sdhci.c +10 -2
@@ -178,12 +178,13 @@ static int bcm2835_sdhci_probe(struct udevice *dev)fdt_addr_t base;int emmc_freq;int ret; +int clock_id = (int )dev_get_driver_data (dev); base =devfdt_get_addr (dev);if (base ==FDT_ADDR_T_NONE )return -EINVAL ; - ret =bcm2835_get_mmc_clock (BCM2835_MBOX_CLOCK_ID_EMMC ); + ret =bcm2835_get_mmc_clock (clock_id);if (ret <0 ) {debug ("%s: Failed to set MMC clock (err=%d)\n" , __func__, ret);return ret;
@@ -228,7 +229,14 @@ static int bcm2835_sdhci_probe(struct udevice *dev) }static const struct udevice_id bcm2835_sdhci_match[] = { - { .compatible ="brcm,bcm2835-sdhci" }, + { + .compatible ="brcm,bcm2835-sdhci" , + .data =BCM2835_MBOX_CLOCK_ID_EMMC + }, + { + .compatible ="brcm,bcm2711-emmc2" , + .data =BCM2835_MBOX_CLOCK_ID_EMMC2 + }, {/* sentinel */ } };
Signature · 1 line
2.22.0
PATCH v2 7/8 RPI: Add memory map for bcm2838
In reply to Andrei GherzanDefine the memory map for the BCM2838 based on the dt configuration available in the Raspberry Pi kernel fork.
--- board/raspberrypi/rpi/rpi.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
board/raspberrypi/rpi/rpi.c +24 -3
@@ -249,7 +249,8 @@ static uint32_t rev_type;static const struct rpi_model *model; #ifdef CONFIG_ARM64 -static struct mm_region bcm2837_mem_map[] = { +#ifndef CONFIG_BCM2838 +static struct mm_region bcm283x_mem_map[] = { { .virt = 0x00000000UL, .phys = 0x00000000UL,
@@ -268,8 +269,28 @@ static struct mm_region bcm2837_mem_map[] = { 0, } }; - -struct mm_region *mem_map = bcm2837_mem_map; +#else +static struct mm_region bcm283x_mem_map[] = { + { + .virt =0x00000000UL , + .phys =0x00000000UL , + .size =0xfe000000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_NORMAL ) | +PTE_BLOCK_INNER_SHARE + }, { + .virt =0xfe000000UL , + .phys =0xfe000000UL , + .size =0x01800000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_DEVICE_NGNRNE ) | +PTE_BLOCK_NON_SHARE | +PTE_BLOCK_PXN |PTE_BLOCK_UXN + }, { +/* List terminator */ +0 , + } +}; +#endif +struct mm_region *mem_map = bcm283x_mem_map;#endif int dram_init (void )
Signature · 1 line
2.22.0
PATCH v2 8/8 git-mailrc: Add rpi and bcm283x maintainer
In reply to Andrei Gherzan--- doc/git-mailrc | 4 ++++ 1 file changed, 4 insertions(+)
doc/git-mailrc +4 -0
@@ -35,6 +35,7 @@ alias mariosix Mario Six <[email protected]> alias masahiro Masahiro Yamada <[email protected]> alias mateusz Mateusz Kulikowski <[email protected]> alias maxime Maxime Ripard <[email protected]> +alias mbrugger Matthias Brugger <[email protected]> alias monstr Michal Simek <[email protected]> alias prom Minkyu Kang <[email protected]> alias ptomsich Philipp Tomsich <[email protected]>
@@ -74,6 +75,9 @@ alias uniphier uboot, masahiro alias zynq uboot, monstr alias rockchip uboot, sjg, kevery, ptomsich +alias bcm283x uboot,mbrugger +alias rpi uboot,mbrugger + alias m68k uboot, alisonwang, angelo_ts alias coldfire m68k
Signature · 1 line
2.22.0
PATCH v2 8/8 git-mailrc: Add rpi and bcm283x maintainer
Quoted 1 line · Andrei Gherzan
Signed-off-by Andrei Gherzan <[email protected]>
Missing commit message. Maybe something like:
Add entries for bcm283x and rpi prefix.
Other then that:
Quoted 27 lines
--- doc/git-mailrc | 4 ++++ 1 file changed, 4 insertions(+)doc/git-mailrc +4
-0@@ -35,6 +35,7 @@ alias mariosix Mario Six <[email protected]> alias masahiro Masahiro Yamada <[email protected]> alias mateusz Mateusz Kulikowski <[email protected]> alias maxime Maxime Ripard <[email protected]> +alias mbrugger Matthias Brugger <[email protected]> alias monstr Michal Simek <[email protected]> alias prom Minkyu Kang <[email protected]> alias ptomsich Philipp Tomsich <[email protected]>@@ -74,6 +75,9 @@ alias uniphier uboot, masahiro alias zynq uboot, monstr alias rockchip uboot, sjg, kevery, ptomsich +alias bcm283x uboot,mbrugger +alias rpi uboot,mbrugger + alias m68k uboot, alisonwang, angelo_ts alias coldfire m68k