Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame^] | 1 | From c03f551cab8fe38de8f0e1781f0e2e339419b003 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 8e69914a83..09a5b42bbb 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 targeting 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 | |