diff options
author | Andrei Gherzan <andrei@gherzan.ro> | 2019-07-18 13:30:32 +0100 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.ro> | 2019-07-20 21:56:21 +0100 |
commit | b76252c98520b79e012495f8022f238f66c20b05 (patch) | |
tree | eebc69ea073659cf0c12b287b1deeeca01af286b | |
parent | 290c152a22d8a65e87aa5198aeda4558231470b9 (diff) | |
download | meta-raspberrypi-b76252c98520b79e012495f8022f238f66c20b05.tar.gz |
u-boot: Replace custom fork by patches (warrior backport)
The upstream branch might suffer rebases due to effort of pushing the
patches upstream. To avoid issues, let's have here the patches we need
for RPi 4 support.
These patches are backported on the u-boot version in warrior.
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
9 files changed, 509 insertions, 4 deletions
diff --git a/recipes-bsp/u-boot/u-boot-2019.01/0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch b/recipes-bsp/u-boot/u-boot-2019.01/0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch new file mode 100644 index 0000000..23129ea --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2019.01/0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch | |||
@@ -0,0 +1,104 @@ | |||
1 | From e8eb46a49317750bc6033b505cb5c07b4e06c9ee Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei@balena.io> | ||
3 | Date: Wed, 17 Jul 2019 15:32:11 +0100 | ||
4 | Subject: [PATCH 1/7] configs: rpi4: Add defconfigs for rpi4 (32/64) | ||
5 | |||
6 | This defines a minimum defconfig for each of the two Raspberry Pi 4 | ||
7 | variants. One notable difference is that we don't have a embedded dt for | ||
8 | this board given that the fw supplies us with one which we can reuse. | ||
9 | Furthermore, the ram size is not queryable through mbox interface as the | ||
10 | maximum reported size is 1G. The fw patches the dt with the right | ||
11 | memory configuration and uboot uses it as it is. We avoid u-boot | ||
12 | touching this configuration by making sure CONFIG_ARCH_FIXUP_FDT_MEMORY | ||
13 | is deactivated. | ||
14 | |||
15 | Signed-off-by: Andrei Gherzan <andrei@balena.io> | ||
16 | Upstream-status: Pending | ||
17 | --- | ||
18 | configs/rpi_4_32b_defconfig | 33 +++++++++++++++++++++++++++++++++ | ||
19 | configs/rpi_4_defconfig | 33 +++++++++++++++++++++++++++++++++ | ||
20 | 2 files changed, 66 insertions(+) | ||
21 | create mode 100644 configs/rpi_4_32b_defconfig | ||
22 | create mode 100644 configs/rpi_4_defconfig | ||
23 | |||
24 | diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig | ||
25 | new file mode 100644 | ||
26 | index 0000000000..a31a617a5f | ||
27 | --- /dev/null | ||
28 | +++ b/configs/rpi_4_32b_defconfig | ||
29 | @@ -0,0 +1,33 @@ | ||
30 | +CONFIG_ARM=y | ||
31 | +CONFIG_ARCH_BCM283X=y | ||
32 | +CONFIG_SYS_TEXT_BASE=0x00008000 | ||
33 | +CONFIG_TARGET_RPI_4_32B=y | ||
34 | +CONFIG_SYS_MALLOC_F_LEN=0x2000 | ||
35 | +CONFIG_DISTRO_DEFAULTS=y | ||
36 | +CONFIG_NR_DRAM_BANKS=1 | ||
37 | +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set | ||
38 | +CONFIG_OF_BOARD=y | ||
39 | +CONFIG_OF_BOARD_SETUP=y | ||
40 | +CONFIG_MISC_INIT_R=y | ||
41 | +# CONFIG_DISPLAY_CPUINFO is not set | ||
42 | +# CONFIG_DISPLAY_BOARDINFO is not set | ||
43 | +CONFIG_SYS_PROMPT="U-Boot> " | ||
44 | +# CONFIG_CMD_FLASH is not set | ||
45 | +CONFIG_CMD_GPIO=y | ||
46 | +CONFIG_CMD_MMC=y | ||
47 | +CONFIG_CMD_FS_UUID=y | ||
48 | +CONFIG_ENV_FAT_INTERFACE="mmc" | ||
49 | +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" | ||
50 | +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y | ||
51 | +CONFIG_DM_KEYBOARD=y | ||
52 | +CONFIG_DM_MMC=y | ||
53 | +CONFIG_MMC_SDHCI=y | ||
54 | +CONFIG_MMC_SDHCI_BCM2835=y | ||
55 | +CONFIG_PINCTRL=y | ||
56 | +# CONFIG_PINCTRL_GENERIC is not set | ||
57 | +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set | ||
58 | +CONFIG_DM_VIDEO=y | ||
59 | +CONFIG_SYS_WHITE_ON_BLACK=y | ||
60 | +CONFIG_CONSOLE_SCROLL_LINES=10 | ||
61 | +CONFIG_PHYS_TO_BUS=y | ||
62 | +CONFIG_OF_LIBFDT_OVERLAY=y | ||
63 | diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig | ||
64 | new file mode 100644 | ||
65 | index 0000000000..da8c960a2a | ||
66 | --- /dev/null | ||
67 | +++ b/configs/rpi_4_defconfig | ||
68 | @@ -0,0 +1,33 @@ | ||
69 | +CONFIG_ARM=y | ||
70 | +CONFIG_ARCH_BCM283X=y | ||
71 | +CONFIG_SYS_TEXT_BASE=0x00080000 | ||
72 | +CONFIG_TARGET_RPI_4=y | ||
73 | +CONFIG_SYS_MALLOC_F_LEN=0x2000 | ||
74 | +CONFIG_DISTRO_DEFAULTS=y | ||
75 | +CONFIG_NR_DRAM_BANKS=1 | ||
76 | +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set | ||
77 | +CONFIG_OF_BOARD=y | ||
78 | +CONFIG_OF_BOARD_SETUP=y | ||
79 | +CONFIG_MISC_INIT_R=y | ||
80 | +# CONFIG_DISPLAY_CPUINFO is not set | ||
81 | +# CONFIG_DISPLAY_BOARDINFO is not set | ||
82 | +CONFIG_SYS_PROMPT="U-Boot> " | ||
83 | +# CONFIG_CMD_FLASH is not set | ||
84 | +CONFIG_CMD_GPIO=y | ||
85 | +CONFIG_CMD_MMC=y | ||
86 | +CONFIG_CMD_FS_UUID=y | ||
87 | +CONFIG_ENV_FAT_INTERFACE="mmc" | ||
88 | +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" | ||
89 | +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y | ||
90 | +CONFIG_DM_KEYBOARD=y | ||
91 | +CONFIG_DM_MMC=y | ||
92 | +CONFIG_MMC_SDHCI=y | ||
93 | +CONFIG_MMC_SDHCI_BCM2835=y | ||
94 | +CONFIG_PINCTRL=y | ||
95 | +# CONFIG_PINCTRL_GENERIC is not set | ||
96 | +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set | ||
97 | +CONFIG_DM_VIDEO=y | ||
98 | +CONFIG_SYS_WHITE_ON_BLACK=y | ||
99 | +CONFIG_CONSOLE_SCROLL_LINES=10 | ||
100 | +CONFIG_PHYS_TO_BUS=y | ||
101 | +CONFIG_OF_LIBFDT_OVERLAY=y | ||
102 | -- | ||
103 | 2.22.0 | ||
104 | |||
diff --git a/recipes-bsp/u-boot/u-boot-2019.01/0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch b/recipes-bsp/u-boot/u-boot-2019.01/0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch new file mode 100644 index 0000000..53da0ff --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2019.01/0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch | |||
@@ -0,0 +1,105 @@ | |||
1 | From 960fd526d0ce4d54fe40cfbdbc215a54c18c7100 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matthias Brugger <mbrugger@suse.com> | ||
3 | Date: Fri, 12 Jul 2019 18:20:53 +0200 | ||
4 | Subject: [PATCH 2/7] ARM: bcm283x: Add BCM283x_BASE define | ||
5 | |||
6 | Devices of bcm283x have different base address, depending if they are on | ||
7 | bcm2835 or bcm2836/7. Use BCM283x_BASE depending on the SoC you want to | ||
8 | build and only add the offset in the header files. | ||
9 | |||
10 | Signed-off-by: Matthias Brugger <mbrugger@suse.com> | ||
11 | Signed-off-by: Andrei Gherzan <andrei@balena.io> | ||
12 | Upstream-status: Pending | ||
13 | --- | ||
14 | arch/arm/mach-bcm283x/Kconfig | 5 +++++ | ||
15 | arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +----- | ||
16 | arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +----- | ||
17 | arch/arm/mach-bcm283x/include/mach/timer.h | 6 +----- | ||
18 | arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +----- | ||
19 | 5 files changed, 9 insertions(+), 20 deletions(-) | ||
20 | |||
21 | diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig | ||
22 | index 821caedbf7..d702f17f4b 100644 | ||
23 | --- a/arch/arm/mach-bcm283x/Kconfig | ||
24 | +++ b/arch/arm/mach-bcm283x/Kconfig | ||
25 | @@ -141,4 +141,9 @@ config SYS_SOC | ||
26 | config SYS_CONFIG_NAME | ||
27 | default "rpi" | ||
28 | |||
29 | +config BCM283x_BASE | ||
30 | + hex | ||
31 | + default "0x20000000" if BCM2835 | ||
32 | + default "0x3f000000" if BCM2836 || BCM2837 | ||
33 | + | ||
34 | endmenu | ||
35 | diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h | ||
36 | index 2776a396c7..81cd5780e4 100644 | ||
37 | --- a/arch/arm/mach-bcm283x/include/mach/mbox.h | ||
38 | +++ b/arch/arm/mach-bcm283x/include/mach/mbox.h | ||
39 | @@ -37,11 +37,7 @@ | ||
40 | |||
41 | /* Raw mailbox HW */ | ||
42 | |||
43 | -#ifndef CONFIG_BCM2835 | ||
44 | -#define BCM2835_MBOX_PHYSADDR 0x3f00b880 | ||
45 | -#else | ||
46 | -#define BCM2835_MBOX_PHYSADDR 0x2000b880 | ||
47 | -#endif | ||
48 | +#define BCM2835_MBOX_PHYSADDR (CONFIG_BCM283x_BASE + 0x0000b880) | ||
49 | |||
50 | struct bcm2835_mbox_regs { | ||
51 | u32 read; | ||
52 | diff --git a/arch/arm/mach-bcm283x/include/mach/sdhci.h b/arch/arm/mach-bcm283x/include/mach/sdhci.h | ||
53 | index 5cb6ec3340..b443c379d8 100644 | ||
54 | --- a/arch/arm/mach-bcm283x/include/mach/sdhci.h | ||
55 | +++ b/arch/arm/mach-bcm283x/include/mach/sdhci.h | ||
56 | @@ -6,11 +6,7 @@ | ||
57 | #ifndef _BCM2835_SDHCI_H_ | ||
58 | #define _BCM2835_SDHCI_H_ | ||
59 | |||
60 | -#ifndef CONFIG_BCM2835 | ||
61 | -#define BCM2835_SDHCI_BASE 0x3f300000 | ||
62 | -#else | ||
63 | -#define BCM2835_SDHCI_BASE 0x20300000 | ||
64 | -#endif | ||
65 | +#define BCM2835_SDHCI_BASE (CONFIG_BCM283x_BASE + 0x00300000) | ||
66 | |||
67 | int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq); | ||
68 | |||
69 | diff --git a/arch/arm/mach-bcm283x/include/mach/timer.h b/arch/arm/mach-bcm283x/include/mach/timer.h | ||
70 | index 56b0c356bb..014355e759 100644 | ||
71 | --- a/arch/arm/mach-bcm283x/include/mach/timer.h | ||
72 | +++ b/arch/arm/mach-bcm283x/include/mach/timer.h | ||
73 | @@ -6,11 +6,7 @@ | ||
74 | #ifndef _BCM2835_TIMER_H | ||
75 | #define _BCM2835_TIMER_H | ||
76 | |||
77 | -#ifndef CONFIG_BCM2835 | ||
78 | -#define BCM2835_TIMER_PHYSADDR 0x3f003000 | ||
79 | -#else | ||
80 | -#define BCM2835_TIMER_PHYSADDR 0x20003000 | ||
81 | -#endif | ||
82 | +#define BCM2835_TIMER_PHYSADDR (CONFIG_BCM283x_BASE + 0x00003000) | ||
83 | |||
84 | #define BCM2835_TIMER_CS_M3 (1 << 3) | ||
85 | #define BCM2835_TIMER_CS_M2 (1 << 2) | ||
86 | diff --git a/arch/arm/mach-bcm283x/include/mach/wdog.h b/arch/arm/mach-bcm283x/include/mach/wdog.h | ||
87 | index 99c88e5df7..00b5e06c3a 100644 | ||
88 | --- a/arch/arm/mach-bcm283x/include/mach/wdog.h | ||
89 | +++ b/arch/arm/mach-bcm283x/include/mach/wdog.h | ||
90 | @@ -6,11 +6,7 @@ | ||
91 | #ifndef _BCM2835_WDOG_H | ||
92 | #define _BCM2835_WDOG_H | ||
93 | |||
94 | -#ifndef CONFIG_BCM2835 | ||
95 | -#define BCM2835_WDOG_PHYSADDR 0x3f100000 | ||
96 | -#else | ||
97 | -#define BCM2835_WDOG_PHYSADDR 0x20100000 | ||
98 | -#endif | ||
99 | +#define BCM2835_WDOG_PHYSADDR (CONFIG_BCM283x_BASE + 0x00100000) | ||
100 | |||
101 | struct bcm2835_wdog_regs { | ||
102 | u32 unknown0[7]; | ||
103 | -- | ||
104 | 2.22.0 | ||
105 | |||
diff --git a/recipes-bsp/u-boot/u-boot-2019.01/0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch b/recipes-bsp/u-boot/u-boot-2019.01/0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch new file mode 100644 index 0000000..28c151a --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2019.01/0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch | |||
@@ -0,0 +1,108 @@ | |||
1 | From 83f8a3a98ea268873e45a1b3868b2f5bdcc3b5f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei@balena.io> | ||
3 | Date: Wed, 17 Jul 2019 15:33:01 +0100 | ||
4 | Subject: [PATCH 3/7] arm: mach-bcm283x: Define configs for RaspberryPi 4 | ||
5 | |||
6 | Define two target configs for Raspberry Pi 4 (32 and 64bit) and the | ||
7 | corresponding BCM2838* configs. | ||
8 | |||
9 | Be aware of the current limitation in firmware which requires an | ||
10 | explicit configuration to force the arm in 64bit mode when the | ||
11 | respective target is used. | ||
12 | |||
13 | Signed-off-by: Andrei Gherzan <andrei@balena.io> | ||
14 | Signed-off-by: Matthias Brugger <mbrugger@suse.com> | ||
15 | Upstream-status: Pending | ||
16 | --- | ||
17 | arch/arm/mach-bcm283x/Kconfig | 62 +++++++++++++++++++++++++++++++++++ | ||
18 | 1 file changed, 62 insertions(+) | ||
19 | |||
20 | diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig | ||
21 | index d702f17f4b..a3311500fa 100644 | ||
22 | --- a/arch/arm/mach-bcm283x/Kconfig | ||
23 | +++ b/arch/arm/mach-bcm283x/Kconfig | ||
24 | @@ -26,6 +26,23 @@ config BCM2837_64B | ||
25 | select BCM2837 | ||
26 | select ARM64 | ||
27 | |||
28 | +config BCM2838 | ||
29 | + bool "Broadcom BCM2838 SoC support" | ||
30 | + depends on ARCH_BCM283X | ||
31 | + | ||
32 | +config BCM2838_32B | ||
33 | + bool "Broadcom BCM2838 SoC 32-bit support" | ||
34 | + depends on ARCH_BCM283X | ||
35 | + select BCM2838 | ||
36 | + select ARMV7_LPAE | ||
37 | + select CPU_V7A | ||
38 | + | ||
39 | +config BCM2838_64B | ||
40 | + bool "Broadcom BCM2838 SoC 64-bit support" | ||
41 | + depends on ARCH_BCM283X | ||
42 | + select BCM2838 | ||
43 | + select ARM64 | ||
44 | + | ||
45 | menu "Broadcom BCM283X family" | ||
46 | depends on ARCH_BCM283X | ||
47 | |||
48 | @@ -127,6 +144,50 @@ config TARGET_RPI_3 | ||
49 | This option creates a build targetting the ARMv8/AArch64 ISA. | ||
50 | select BCM2837_64B | ||
51 | |||
52 | +config TARGET_RPI_4_32B | ||
53 | + bool "Raspberry Pi 4 32-bit build" | ||
54 | + help | ||
55 | + Support for all BCM2838-based Raspberry Pi variants, such as | ||
56 | + the RPi 4 model B, in AArch32 (32-bit) mode. | ||
57 | + | ||
58 | + This option assumes the VideoCore firmware is configured to use the | ||
59 | + mini UART (rather than PL011) for the serial console. This is the | ||
60 | + default on the RPi 4. To enable the UART console, the following non- | ||
61 | + default option must be present in config.txt: enable_uart=1. This is | ||
62 | + required for U-Boot to operate correctly, even if you only care | ||
63 | + about the HDMI/usbkbd console. | ||
64 | + | ||
65 | + Due to hardware incompatibilities, this can't be used with | ||
66 | + BCM283/5/6/7. | ||
67 | + | ||
68 | + This option creates a build targeting the ARMv7/AArch32 ISA. | ||
69 | + select BCM2838_32B | ||
70 | + | ||
71 | +config TARGET_RPI_4 | ||
72 | + bool "Raspberry Pi 4 64-bit build" | ||
73 | + help | ||
74 | + Support for all BCM2838-based Raspberry Pi variants, such as | ||
75 | + the RPi 4 model B, in AArch64 (64-bit) mode. | ||
76 | + | ||
77 | + This option assumes the VideoCore firmware is configured to use the | ||
78 | + mini UART (rather than PL011) for the serial console. This is the | ||
79 | + default on the RPi 4. To enable the UART console, the following non- | ||
80 | + default option must be present in config.txt: enable_uart=1. This is | ||
81 | + required for U-Boot to operate correctly, even if you only care | ||
82 | + about the HDMI/usbkbd console. | ||
83 | + | ||
84 | + Due to hardware incompatibilities, this can't be used with | ||
85 | + BCM283/5/6/7. | ||
86 | + | ||
87 | + Also, due to a bug in firmware, switching to 64bit mode doesn't | ||
88 | + happen automatically based on the kernel's image filename. See | ||
89 | + https://github.com/raspberrypi/firmware/issues/1193 for more details. | ||
90 | + Until that is resolved, the configuration (config.txt) needs to | ||
91 | + explicitly set: arm_64bit=1. | ||
92 | + | ||
93 | + This option creates a build targeting the ARMv8/AArch64 ISA. | ||
94 | + select BCM2838_64B | ||
95 | + | ||
96 | endchoice | ||
97 | |||
98 | config SYS_BOARD | ||
99 | @@ -145,5 +206,6 @@ config BCM283x_BASE | ||
100 | hex | ||
101 | default "0x20000000" if BCM2835 | ||
102 | default "0x3f000000" if BCM2836 || BCM2837 | ||
103 | + default "0xfe000000" if BCM2838 | ||
104 | |||
105 | endmenu | ||
106 | -- | ||
107 | 2.22.0 | ||
108 | |||
diff --git a/recipes-bsp/u-boot/u-boot-2019.01/0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch b/recipes-bsp/u-boot/u-boot-2019.01/0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch new file mode 100644 index 0000000..36e97fd --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2019.01/0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From c1f29f486b08ab6d90fe2c191157274f6dea0443 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei@balena.io> | ||
3 | Date: Wed, 17 Jul 2019 15:34:18 +0100 | ||
4 | Subject: [PATCH 4/7] rpi: Add entry for Raspberry Pi 4 model B | ||
5 | |||
6 | The Raspebrry Pi 4 uses the new revision code scheme as documented by | ||
7 | the foundation. This change adds an entry for this board as well. | ||
8 | |||
9 | Signed-off-by: Andrei Gherzan <andrei@balena.io> | ||
10 | Upstream-status: Pending | ||
11 | --- | ||
12 | board/raspberrypi/rpi/rpi.c | 5 +++++ | ||
13 | 1 file changed, 5 insertions(+) | ||
14 | |||
15 | diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c | ||
16 | index 153a1fdcb7..5510ea25c1 100644 | ||
17 | --- a/board/raspberrypi/rpi/rpi.c | ||
18 | +++ b/board/raspberrypi/rpi/rpi.c | ||
19 | @@ -143,6 +143,11 @@ static const struct rpi_model rpi_models_new_scheme[] = { | ||
20 | DTB_DIR "bcm2837-rpi-3-a-plus.dtb", | ||
21 | false, | ||
22 | }, | ||
23 | + [0x11] = { | ||
24 | + "4 Model B", | ||
25 | + DTB_DIR "bcm2838-rpi-4-b.dtb", | ||
26 | + true, | ||
27 | + }, | ||
28 | }; | ||
29 | |||
30 | static const struct rpi_model rpi_models_old_scheme[] = { | ||
31 | -- | ||
32 | 2.22.0 | ||
33 | |||
diff --git a/recipes-bsp/u-boot/u-boot-2019.01/0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch b/recipes-bsp/u-boot/u-boot-2019.01/0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch new file mode 100644 index 0000000..8db9a8a --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2019.01/0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 8251fd2c39a40886e521ecfc115ef975b5956fd5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei@balena.io> | ||
3 | Date: Fri, 12 Jul 2019 11:26:10 +0100 | ||
4 | Subject: [PATCH 5/7] arm: bcm283x: Include definition for additional emmc | ||
5 | clock | ||
6 | |||
7 | This clock has a different mbox ID so have this included in the relevant | ||
8 | header file. | ||
9 | |||
10 | Signed-off-by: Andrei Gherzan <andrei@balena.io> | ||
11 | Upstream-status: Pending | ||
12 | --- | ||
13 | arch/arm/mach-bcm283x/include/mach/mbox.h | 1 + | ||
14 | 1 file changed, 1 insertion(+) | ||
15 | |||
16 | diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h | ||
17 | index 81cd5780e4..36d2621408 100644 | ||
18 | --- a/arch/arm/mach-bcm283x/include/mach/mbox.h | ||
19 | +++ b/arch/arm/mach-bcm283x/include/mach/mbox.h | ||
20 | @@ -230,6 +230,7 @@ struct bcm2835_mbox_tag_set_power_state { | ||
21 | #define BCM2835_MBOX_CLOCK_ID_SDRAM 8 | ||
22 | #define BCM2835_MBOX_CLOCK_ID_PIXEL 9 | ||
23 | #define BCM2835_MBOX_CLOCK_ID_PWM 10 | ||
24 | +#define BCM2835_MBOX_CLOCK_ID_EMMC2 12 | ||
25 | |||
26 | struct bcm2835_mbox_tag_get_clock_rate { | ||
27 | struct bcm2835_mbox_tag_hdr tag_hdr; | ||
28 | -- | ||
29 | 2.22.0 | ||
30 | |||
diff --git a/recipes-bsp/u-boot/u-boot-2019.01/0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch b/recipes-bsp/u-boot/u-boot-2019.01/0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch new file mode 100644 index 0000000..9649a05 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2019.01/0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From e789ab00b2e03b810571de6226c5e1e009d9036b Mon Sep 17 00:00:00 2001 | ||
2 | From: Matthias Brugger <mbrugger@suse.com> | ||
3 | Date: Wed, 10 Jul 2019 13:24:36 +0200 | ||
4 | Subject: [PATCH 6/7] mmc: bcm2835_sdhci: Add support for bcm2711 device | ||
5 | |||
6 | The bcm2711 has two emmc controller. The difference is the clocks | ||
7 | they use. Add support for the second emmc contoller. | ||
8 | |||
9 | Signed-off-by: Matthias Brugger <mbrugger@suse.com> | ||
10 | Signed-off-by: Andrei Gherzan <andrei@balena.io> | ||
11 | Upstream-status: Pending | ||
12 | --- | ||
13 | drivers/mmc/bcm2835_sdhci.c | 12 ++++++++++-- | ||
14 | 1 file changed, 10 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c | ||
17 | index 08bddd410e..e68dec3be7 100644 | ||
18 | --- a/drivers/mmc/bcm2835_sdhci.c | ||
19 | +++ b/drivers/mmc/bcm2835_sdhci.c | ||
20 | @@ -178,12 +178,13 @@ static int bcm2835_sdhci_probe(struct udevice *dev) | ||
21 | fdt_addr_t base; | ||
22 | int emmc_freq; | ||
23 | int ret; | ||
24 | + int clock_id = (int)dev_get_driver_data(dev); | ||
25 | |||
26 | base = devfdt_get_addr(dev); | ||
27 | if (base == FDT_ADDR_T_NONE) | ||
28 | return -EINVAL; | ||
29 | |||
30 | - ret = bcm2835_get_mmc_clock(BCM2835_MBOX_CLOCK_ID_EMMC); | ||
31 | + ret = bcm2835_get_mmc_clock(clock_id); | ||
32 | if (ret < 0) { | ||
33 | debug("%s: Failed to set MMC clock (err=%d)\n", __func__, ret); | ||
34 | return ret; | ||
35 | @@ -228,7 +229,14 @@ static int bcm2835_sdhci_probe(struct udevice *dev) | ||
36 | } | ||
37 | |||
38 | static const struct udevice_id bcm2835_sdhci_match[] = { | ||
39 | - { .compatible = "brcm,bcm2835-sdhci" }, | ||
40 | + { | ||
41 | + .compatible = "brcm,bcm2835-sdhci", | ||
42 | + .data = BCM2835_MBOX_CLOCK_ID_EMMC | ||
43 | + }, | ||
44 | + { | ||
45 | + .compatible = "brcm,bcm2711-emmc2", | ||
46 | + .data = BCM2835_MBOX_CLOCK_ID_EMMC2 | ||
47 | + }, | ||
48 | { /* sentinel */ } | ||
49 | }; | ||
50 | |||
51 | -- | ||
52 | 2.22.0 | ||
53 | |||
diff --git a/recipes-bsp/u-boot/u-boot-2019.01/0007-rpi-Add-memory-map-for-bcm2838.patch b/recipes-bsp/u-boot/u-boot-2019.01/0007-rpi-Add-memory-map-for-bcm2838.patch new file mode 100644 index 0000000..8ddf66f --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-2019.01/0007-rpi-Add-memory-map-for-bcm2838.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From cfb82f8e75438979565617d323eb2c2849e486ce Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei@balena.io> | ||
3 | Date: Fri, 12 Jul 2019 14:27:31 +0100 | ||
4 | Subject: [PATCH 7/7] rpi: Add memory map for bcm2838 | ||
5 | |||
6 | Define the memory map for the BCM2838 based on the dt configuration | ||
7 | available in the Raspberry Pi kernel fork. | ||
8 | |||
9 | Signed-off-by: Andrei Gherzan <andrei@balena.io> | ||
10 | Upstream-status: Pending | ||
11 | --- | ||
12 | board/raspberrypi/rpi/rpi.c | 27 ++++++++++++++++++++++++--- | ||
13 | 1 file changed, 24 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c | ||
16 | index 5510ea25c1..9dac64b920 100644 | ||
17 | --- a/board/raspberrypi/rpi/rpi.c | ||
18 | +++ b/board/raspberrypi/rpi/rpi.c | ||
19 | @@ -244,7 +244,8 @@ static uint32_t rev_type; | ||
20 | static const struct rpi_model *model; | ||
21 | |||
22 | #ifdef CONFIG_ARM64 | ||
23 | -static struct mm_region bcm2837_mem_map[] = { | ||
24 | +#ifndef CONFIG_BCM2838 | ||
25 | +static struct mm_region bcm283x_mem_map[] = { | ||
26 | { | ||
27 | .virt = 0x00000000UL, | ||
28 | .phys = 0x00000000UL, | ||
29 | @@ -263,8 +264,28 @@ static struct mm_region bcm2837_mem_map[] = { | ||
30 | 0, | ||
31 | } | ||
32 | }; | ||
33 | - | ||
34 | -struct mm_region *mem_map = bcm2837_mem_map; | ||
35 | +#else | ||
36 | +static struct mm_region bcm283x_mem_map[] = { | ||
37 | + { | ||
38 | + .virt = 0x00000000UL, | ||
39 | + .phys = 0x00000000UL, | ||
40 | + .size = 0xfe000000UL, | ||
41 | + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | | ||
42 | + PTE_BLOCK_INNER_SHARE | ||
43 | + }, { | ||
44 | + .virt = 0xfe000000UL, | ||
45 | + .phys = 0xfe000000UL, | ||
46 | + .size = 0x01800000UL, | ||
47 | + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | | ||
48 | + PTE_BLOCK_NON_SHARE | | ||
49 | + PTE_BLOCK_PXN | PTE_BLOCK_UXN | ||
50 | + }, { | ||
51 | + /* List terminator */ | ||
52 | + 0, | ||
53 | + } | ||
54 | +}; | ||
55 | +#endif | ||
56 | +struct mm_region *mem_map = bcm283x_mem_map; | ||
57 | #endif | ||
58 | |||
59 | int dram_init(void) | ||
60 | -- | ||
61 | 2.22.0 | ||
62 | |||
diff --git a/recipes-bsp/u-boot/u-boot_2019.01.bbappend b/recipes-bsp/u-boot/u-boot_2019.01.bbappend new file mode 100644 index 0000000..6dedb16 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot_2019.01.bbappend | |||
@@ -0,0 +1,14 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" | ||
2 | UBOOT_RPI4_SUPPORT_PATCHES = " \ | ||
3 | file://0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch \ | ||
4 | file://0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch \ | ||
5 | file://0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch \ | ||
6 | file://0004-rpi-Add-rpi_model-entry-for-RaspberryPi-4.patch \ | ||
7 | file://0005-dt-bindings-Define-BCM2838_CLOCK_EMMC2-needed-for-Ra.patch \ | ||
8 | file://0006-arm-bcm283x-Include-definition-for-additional-emmc-c.patch \ | ||
9 | file://0007-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch \ | ||
10 | file://0008-rpi-Add-memory-map-for-bcm2838.patch \ | ||
11 | file://0009-bcm283x-mbox-Correctly-wait-for-space-to-send.patch \ | ||
12 | " | ||
13 | |||
14 | SRC_URI_append_raspberrypi4 = "${UBOOT_RPI4_SUPPORT_PATCHES}" | ||
diff --git a/recipes-bsp/u-boot/u-boot_2019.07.bbappend b/recipes-bsp/u-boot/u-boot_2019.07.bbappend deleted file mode 100644 index 6dfcc2c..0000000 --- a/recipes-bsp/u-boot/u-boot_2019.07.bbappend +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | SRC_URI_raspberrypi4 = "git://github.com/balena-os/u-boot;branch=ag/rpi4" | ||
2 | SRCREV_raspberrypi4 = "62b6e39a53c56a9085aeab1b47b5cc6020fcdb6f" | ||
3 | SRC_URI_raspberrypi4-64 = "git://github.com/balena-os/u-boot;branch=ag/rpi4" | ||
4 | SRCREV_raspberrypi4-64 = "62b6e39a53c56a9085aeab1b47b5cc6020fcdb6f" | ||