summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMirza Krak <mirza.krak@endian.se>2017-12-07 15:07:18 +0000
committerAndrei Gherzan <andrei@gherzan.com>2018-01-11 21:33:55 +0000
commitf900a6568cca94039e2204926a0f3196cc42d79b (patch)
tree350060f3860cda8b7a8200d23e5bb834d4a3bd5e
parent24ffe9fb592dda483fb5dfec30782955fcc18a5e (diff)
downloadmeta-raspberrypi-f900a6568cca94039e2204926a0f3196cc42d79b.tar.gz
u-boot: add support for Raspberry Pi Zero W
It is all ready supported upstream and this will apply a backported patch until next U-boot release. Signed-off-by: Mirza Krak <mirza.krak@endian.se>
-rw-r--r--recipes-bsp/u-boot/u-boot/0001-add-support-for-Raspberry-Pi-Zero-W.patch143
-rw-r--r--recipes-bsp/u-boot/u-boot_%.bbappend6
2 files changed, 149 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot/0001-add-support-for-Raspberry-Pi-Zero-W.patch b/recipes-bsp/u-boot/u-boot/0001-add-support-for-Raspberry-Pi-Zero-W.patch
new file mode 100644
index 0000000..f011208
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot/0001-add-support-for-Raspberry-Pi-Zero-W.patch
@@ -0,0 +1,143 @@
1From 8993056fb3d4af4f0cd078df20130d4e7c35c2f7 Mon Sep 17 00:00:00 2001
2From: Dmitry Korunov <dessel.k@gmail.com>
3Date: Sun, 26 Nov 2017 13:38:53 +0400
4Subject: [PATCH 1/1] add support for Raspberry Pi Zero W
5
6Signed-off-by: Dmitry Korunov <dessel.k@gmail.com>
7Signed-off-by: Mirza Krak <mirza.krak@gmail.com>
8Upstream-status: Backport
9---
10 arch/arm/dts/bcm2835-rpi-zero-w.dts | 26 ++++++++++++++++++++++++++
11 arch/arm/mach-bcm283x/Kconfig | 16 ++++++++++++++++
12 board/raspberrypi/rpi/rpi.c | 5 +++++
13 configs/rpi_0_w_defconfig | 28 ++++++++++++++++++++++++++++
14 include/configs/rpi.h | 2 +-
15 5 files changed, 76 insertions(+), 1 deletion(-)
16 create mode 100644 arch/arm/dts/bcm2835-rpi-zero-w.dts
17 create mode 100644 configs/rpi_0_w_defconfig
18
19diff --git a/arch/arm/dts/bcm2835-rpi-zero-w.dts b/arch/arm/dts/bcm2835-rpi-zero-w.dts
20new file mode 100644
21index 0000000..7817054
22--- /dev/null
23+++ b/arch/arm/dts/bcm2835-rpi-zero-w.dts
24@@ -0,0 +1,26 @@
25+/dts-v1/;
26+#include "bcm2835.dtsi"
27+#include "bcm2835-rpi.dtsi"
28+#include "bcm283x-rpi-smsc9512.dtsi"
29+#include "bcm283x-rpi-usb-host.dtsi"
30+
31+/ {
32+ compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
33+ model = "Raspberry Pi Zero W";
34+
35+ leds {
36+ act {
37+ gpios = <&gpio 47 0>;
38+ };
39+ };
40+};
41+
42+&uart1 {
43+ pinctrl-names = "default";
44+ pinctrl-0 = <&uart1_gpio14>;
45+ status = "okay";
46+};
47+
48+&hdmi {
49+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
50+};
51diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
52index 69f7a46..a78239d 100644
53--- a/arch/arm/mach-bcm283x/Kconfig
54+++ b/arch/arm/mach-bcm283x/Kconfig
55@@ -44,6 +44,22 @@ config TARGET_RPI
56 This option creates a build targetting the ARM1176 ISA.
57 select BCM2835
58
59+config TARGET_RPI_0_W
60+ bool "Raspberry Pi Zero W"
61+ help
62+ Support for all ARM1176-/BCM2835-based Raspberry Pi variants, such as
63+ the RPi Zero model W.
64+
65+ This option assumes the VideoCore firmware is configured to use the
66+ mini UART (rather than PL011) for the serial console. This is the
67+ default on the RPi Zero W. To enable the UART console, the following
68+ non-default option must be present in config.txt: enable_uart=1.
69+ This is required for U-Boot to operate correctly, even if you only
70+ care about the HDMI/usbkbd console.
71+
72+ This option creates a build targetting the ARMv7/AArch32 ISA.
73+ select BCM2835
74+
75 config TARGET_RPI_2
76 bool "Raspberry Pi 2"
77 help
78diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
79index 530f149..3b7a54f 100644
80--- a/board/raspberrypi/rpi/rpi.c
81+++ b/board/raspberrypi/rpi/rpi.c
82@@ -105,6 +105,11 @@ static const struct rpi_model rpi_models_new_scheme[] = {
83 DTB_DIR "bcm2835-rpi-zero.dtb",
84 false,
85 },
86+ [0xC] = {
87+ "Zero W",
88+ DTB_DIR "bcm2835-rpi-zero-w.dtb",
89+ false,
90+ },
91 };
92
93 static const struct rpi_model rpi_models_old_scheme[] = {
94diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig
95new file mode 100644
96index 0000000..092f378
97--- /dev/null
98+++ b/configs/rpi_0_w_defconfig
99@@ -0,0 +1,28 @@
100+CONFIG_ARM=y
101+CONFIG_ARCH_BCM283X=y
102+CONFIG_TARGET_RPI_0_W=y
103+CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-zero-w"
104+CONFIG_DISTRO_DEFAULTS=y
105+CONFIG_OF_BOARD_SETUP=y
106+# CONFIG_DISPLAY_CPUINFO is not set
107+# CONFIG_DISPLAY_BOARDINFO is not set
108+CONFIG_SYS_PROMPT="U-Boot> "
109+# CONFIG_CMD_IMLS is not set
110+# CONFIG_CMD_FLASH is not set
111+CONFIG_CMD_MMC=y
112+CONFIG_CMD_USB=y
113+# CONFIG_CMD_FPGA is not set
114+CONFIG_CMD_GPIO=y
115+CONFIG_DM_MMC=y
116+CONFIG_MMC_SDHCI=y
117+CONFIG_MMC_SDHCI_BCM2835=y
118+CONFIG_DM_ETH=y
119+CONFIG_USB=y
120+CONFIG_DM_USB=y
121+CONFIG_USB_STORAGE=y
122+CONFIG_USB_KEYBOARD=y
123+CONFIG_DM_VIDEO=y
124+CONFIG_SYS_WHITE_ON_BLACK=y
125+CONFIG_CONSOLE_SCROLL_LINES=10
126+CONFIG_PHYS_TO_BUS=y
127+CONFIG_OF_LIBFDT_OVERLAY=y
128diff --git a/include/configs/rpi.h b/include/configs/rpi.h
129index c499b45..cab8661 100644
130--- a/include/configs/rpi.h
131+++ b/include/configs/rpi.h
132@@ -76,7 +76,7 @@
133 #endif
134
135 /* Console UART */
136-#ifdef CONFIG_BCM2837
137+#if defined (CONFIG_BCM2837) || defined(CONFIG_TARGET_RPI_0_W)
138 #define CONFIG_BCM283X_MU_SERIAL
139 #else
140 #define CONFIG_PL01X_SERIAL
141--
1422.1.4
143
diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend
index 3781666..9fd7304 100644
--- a/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -1 +1,7 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot:"
2
3SRC_URI_append_rpi = " \
4 file://0001-add-support-for-Raspberry-Pi-Zero-W.patch \
5"
6
1RDEPENDS_${PN}_append_rpi = " rpi-u-boot-scr" 7RDEPENDS_${PN}_append_rpi = " rpi-u-boot-scr"