* [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined
@ 2016-04-02 3:14 Stephen Warren
2016-04-02 3:14 ` [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config Stephen Warren
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Stephen Warren @ 2016-04-02 3:14 UTC (permalink / raw)
To: u-boot
There are ARM SoCs (such as the BCM2837) do not contain an ARM GIC. Fix
the ARMv8 CPU startup code to compile in this case.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
arch/arm/cpu/armv8/start.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
index 67b166c7fd46..dceedd7100ae 100644
--- a/arch/arm/cpu/armv8/start.S
+++ b/arch/arm/cpu/armv8/start.S
@@ -202,14 +202,14 @@ WEAK(lowlevel_init)
mov x29, lr /* Save LR */
#ifndef CONFIG_ARMV8_MULTIENTRY
+#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
/*
* For single-entry systems the lowlevel init is very simple.
*/
ldr x0, =GICD_BASE
bl gic_init_secure
-
+#endif
#else /* CONFIG_ARMV8_MULTIENTRY is set */
-
#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
branch_if_slave x0, 1f
ldr x0, =GICD_BASE
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config 2016-04-02 3:14 [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined Stephen Warren @ 2016-04-02 3:14 ` Stephen Warren 2016-04-02 13:26 ` Tom Rini 2016-04-12 2:28 ` [U-Boot] [U-Boot,2/2] " Tom Rini 2016-04-02 13:25 ` [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined Tom Rini 2016-04-12 2:28 ` [U-Boot] [U-Boot, " Tom Rini 2 siblings, 2 replies; 7+ messages in thread From: Stephen Warren @ 2016-04-02 3:14 UTC (permalink / raw) To: u-boot On all Pis so far, the VC FW provides a short stub to set up the ARM CPU before entering the kernel (a/k/a U-Boot for us). This feature is not currently supported by the VC FW when booting in 64-bit mode. However, this feature will likely appear in the near future, and this U-Boot port assumes that such a feature is in place. Without that feature, or a temporary workaround described below, U-Boot will not boot. Once the VC FW does provide the ARM stub, u-boot.bin built for rpi_3 can be used drectly as kernel7.img, in the same way as any other RPi port. The following config.txt is required: # Fix mini UART input frequency, and setup/enable up the UART. # Without this option, U-Boot will not boot, even if you don't care # about the serial console. This option will always be required for # all RPi3 use-cases, unless the PL011 UART is used, which is not # yet supported by rpi_3* builds of U-Boot. enable_uart=1 # Boot in AArch64 (64-bit) mode. # It is possible that a future VC FW will remove the need for this # option, instead auto-setting 32-/64-bit mode based on the "kernel" # filename present on the SD card. arm_control=0x200 Prior to the VC FW providing the ARM boot stub, you can use the following steps to build an equivalent stub into the U-Boot binary: git clone https://github.com/swarren/rpi-3-aarch64-demo.git \ ../rpi-3-aarch64-demo (cd ../rpi-3-aarch64-demo && ./build.sh) Build U-Boot for rpi_3 in the usual way cat ../rpi-3-aarch64-demo/armstub64.bin u-boot.bin > u-boot.bin.stubbed Use u-boot.bin.stubbed as kernel7.img on the Pi SD card. In this case, the following additional entries are required in config.txt: # Tell the FW to load the kernel image at address 0, the reset vector. kernel_old=1 Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> --- arch/arm/mach-bcm283x/Kconfig | 7 +++++++ board/raspberrypi/rpi/rpi.c | 25 +++++++++++++++++++++++++ board/raspberrypi/rpi_3/MAINTAINERS | 6 ++++++ board/raspberrypi/rpi_3/Makefile | 7 +++++++ configs/rpi_3_defconfig | 11 +++++++++++ include/configs/rpi-common.h | 3 +++ include/configs/rpi_3.h | 14 ++++++++++++++ 7 files changed, 73 insertions(+) create mode 100644 board/raspberrypi/rpi_3/MAINTAINERS create mode 100644 board/raspberrypi/rpi_3/Makefile create mode 100644 configs/rpi_3_defconfig create mode 100644 include/configs/rpi_3.h diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig index a4d291d29742..a1ad1a4e0fa8 100644 --- a/arch/arm/mach-bcm283x/Kconfig +++ b/arch/arm/mach-bcm283x/Kconfig @@ -70,12 +70,18 @@ config TARGET_RPI_3_32B select BCM2837 select CPU_V7 +config TARGET_RPI_3 + bool "Raspberry Pi 3 64-bit build" + select ARM64 + select BCM2837 + endchoice config SYS_BOARD default "rpi" if TARGET_RPI default "rpi_2" if TARGET_RPI_2 default "rpi_3_32b" if TARGET_RPI_3_32B + default "rpi_3" if TARGET_RPI_3 config SYS_VENDOR default "raspberrypi" @@ -87,5 +93,6 @@ config SYS_CONFIG_NAME default "rpi" if TARGET_RPI default "rpi_2" if TARGET_RPI_2 default "rpi_3_32b" if TARGET_RPI_3_32B + default "rpi_3" if TARGET_RPI_3 endmenu diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 20b5cf48f558..c45ddb14aa33 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -19,6 +19,9 @@ #include <asm/global_data.h> #include <dm/platform_data/serial_pl01x.h> #include <dm/platform_data/serial_bcm283x_mu.h> +#ifdef CONFIG_ARM64 +#include <asm/armv8/mmu.h> +#endif DECLARE_GLOBAL_DATA_PTR; @@ -228,6 +231,28 @@ static uint32_t rev_scheme; static uint32_t rev_type; static const struct rpi_model *model; +#ifdef CONFIG_ARM64 +static struct mm_region bcm2837_mem_map[] = { + { + .base = 0x00000000UL, + .size = 0x3f000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, { + .base = 0x3f000000UL, + .size = 0x01000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | + PTE_BLOCK_NON_SHARE | + PTE_BLOCK_PXN | PTE_BLOCK_UXN + }, { + /* List terminator */ + 0, + } +}; + +struct mm_region *mem_map = bcm2837_mem_map; +#endif + int dram_init(void) { ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_arm_mem, msg, 1); diff --git a/board/raspberrypi/rpi_3/MAINTAINERS b/board/raspberrypi/rpi_3/MAINTAINERS new file mode 100644 index 000000000000..26ecd99e16fa --- /dev/null +++ b/board/raspberrypi/rpi_3/MAINTAINERS @@ -0,0 +1,6 @@ +RPI_3_BOARD +M: Stephen Warren <swarren@wwwdotorg.org> +S: Maintained +F: board/raspberrypi/rpi_3/ +F: include/configs/rpi_3.h +F: configs/rpi_3_defconfig diff --git a/board/raspberrypi/rpi_3/Makefile b/board/raspberrypi/rpi_3/Makefile new file mode 100644 index 000000000000..78e287487cd4 --- /dev/null +++ b/board/raspberrypi/rpi_3/Makefile @@ -0,0 +1,7 @@ +# +# (C) Copyright 2012-2016 Stephen Warren <swarren@wwwdotorg.org> +# +# SPDX-License-Identifier: GPL-2.0 +# + +obj-y := ../rpi/rpi.o diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig new file mode 100644 index 000000000000..417836bf4af3 --- /dev/null +++ b/configs/rpi_3_defconfig @@ -0,0 +1,11 @@ +CONFIG_ARM=y +CONFIG_ARCH_BCM283X=y +CONFIG_TARGET_RPI_3=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_SYS_PROMPT="U-Boot> " +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +CONFIG_CMD_GPIO=y +CONFIG_PHYS_TO_BUS=y +CONFIG_OF_LIBFDT=y diff --git a/include/configs/rpi-common.h b/include/configs/rpi-common.h index 0f3ce4f4bf7c..9aca1ace2c0b 100644 --- a/include/configs/rpi-common.h +++ b/include/configs/rpi-common.h @@ -13,9 +13,12 @@ /* Architecture, CPU, etc.*/ #define CONFIG_ARCH_CPU_INIT +/* Use SoC timer for AArch32, but architected timer for AArch64 */ +#ifndef CONFIG_ARM64 #define CONFIG_SYS_TIMER_RATE 1000000 #define CONFIG_SYS_TIMER_COUNTER \ (&((struct bcm2835_timer_regs *)BCM2835_TIMER_PHYSADDR)->clo) +#endif /* * 2835 is a SKU in a series for which the 2708 is the first or primary SoC, diff --git a/include/configs/rpi_3.h b/include/configs/rpi_3.h new file mode 100644 index 000000000000..0dd9e7e40aa0 --- /dev/null +++ b/include/configs/rpi_3.h @@ -0,0 +1,14 @@ +/* + * (C) Copyright 2012-2016 Stephen Warren <swarren@wwwdotorg.org> + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_SYS_CACHELINE_SIZE 64 + +#include "rpi-common.h" + +#endif -- 2.7.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config 2016-04-02 3:14 ` [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config Stephen Warren @ 2016-04-02 13:26 ` Tom Rini 2016-04-03 3:33 ` Stephen Warren 2016-04-12 2:28 ` [U-Boot] [U-Boot,2/2] " Tom Rini 1 sibling, 1 reply; 7+ messages in thread From: Tom Rini @ 2016-04-02 13:26 UTC (permalink / raw) To: u-boot On Fri, Apr 01, 2016 at 09:14:15PM -0600, Stephen Warren wrote: > On all Pis so far, the VC FW provides a short stub to set up the ARM CPU > before entering the kernel (a/k/a U-Boot for us). This feature is not > currently supported by the VC FW when booting in 64-bit mode. However, > this feature will likely appear in the near future, and this U-Boot port > assumes that such a feature is in place. Without that feature, or a > temporary workaround described below, U-Boot will not boot. > > Once the VC FW does provide the ARM stub, u-boot.bin built for rpi_3 can > be used drectly as kernel7.img, in the same way as any other RPi port. The > following config.txt is required: > > # Fix mini UART input frequency, and setup/enable up the UART. > # Without this option, U-Boot will not boot, even if you don't care > # about the serial console. This option will always be required for > # all RPi3 use-cases, unless the PL011 UART is used, which is not > # yet supported by rpi_3* builds of U-Boot. > enable_uart=1 > # Boot in AArch64 (64-bit) mode. > # It is possible that a future VC FW will remove the need for this > # option, instead auto-setting 32-/64-bit mode based on the "kernel" > # filename present on the SD card. > arm_control=0x200 > > Prior to the VC FW providing the ARM boot stub, you can use the following > steps to build an equivalent stub into the U-Boot binary: > > git clone https://github.com/swarren/rpi-3-aarch64-demo.git \ > ../rpi-3-aarch64-demo > (cd ../rpi-3-aarch64-demo && ./build.sh) > Build U-Boot for rpi_3 in the usual way > cat ../rpi-3-aarch64-demo/armstub64.bin u-boot.bin > u-boot.bin.stubbed > Use u-boot.bin.stubbed as kernel7.img on the Pi SD card. > > In this case, the following additional entries are required in config.txt: > > # Tell the FW to load the kernel image at address 0, the reset vector. > kernel_old=1 > > Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> As our infrastructure stands today: Reviewed-by: Tom Rini <trini@konsulko.com> But would it be possible to clean things up and consolidate files? If CONFIG_SYS_CACHLINE_SIZE and CONFIG_SKIP_LOWLEVEL_INIT were in Kconfig it looks like everything could live in board/raspberrypi/rpi/ which it nearly does today. If it's hard, I'd be OK punting that to v2015.07. Or am I missing something? -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160402/8057b203/attachment.sig> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config 2016-04-02 13:26 ` Tom Rini @ 2016-04-03 3:33 ` Stephen Warren 0 siblings, 0 replies; 7+ messages in thread From: Stephen Warren @ 2016-04-03 3:33 UTC (permalink / raw) To: u-boot On 04/02/2016 07:26 AM, Tom Rini wrote: > On Fri, Apr 01, 2016 at 09:14:15PM -0600, Stephen Warren wrote: > >> On all Pis so far, the VC FW provides a short stub to set up the ARM CPU >> before entering the kernel (a/k/a U-Boot for us). This feature is not >> currently supported by the VC FW when booting in 64-bit mode. However, >> this feature will likely appear in the near future, and this U-Boot port >> assumes that such a feature is in place. Without that feature, or a >> temporary workaround described below, U-Boot will not boot. >> >> Once the VC FW does provide the ARM stub, u-boot.bin built for rpi_3 can >> be used drectly as kernel7.img, in the same way as any other RPi port. The >> following config.txt is required: >> >> # Fix mini UART input frequency, and setup/enable up the UART. >> # Without this option, U-Boot will not boot, even if you don't care >> # about the serial console. This option will always be required for >> # all RPi3 use-cases, unless the PL011 UART is used, which is not >> # yet supported by rpi_3* builds of U-Boot. >> enable_uart=1 >> # Boot in AArch64 (64-bit) mode. >> # It is possible that a future VC FW will remove the need for this >> # option, instead auto-setting 32-/64-bit mode based on the "kernel" >> # filename present on the SD card. >> arm_control=0x200 >> >> Prior to the VC FW providing the ARM boot stub, you can use the following >> steps to build an equivalent stub into the U-Boot binary: >> >> git clone https://github.com/swarren/rpi-3-aarch64-demo.git \ >> ../rpi-3-aarch64-demo >> (cd ../rpi-3-aarch64-demo && ./build.sh) >> Build U-Boot for rpi_3 in the usual way >> cat ../rpi-3-aarch64-demo/armstub64.bin u-boot.bin > u-boot.bin.stubbed >> Use u-boot.bin.stubbed as kernel7.img on the Pi SD card. >> >> In this case, the following additional entries are required in config.txt: >> >> # Tell the FW to load the kernel image at address 0, the reset vector. >> kernel_old=1 >> >> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> > > As our infrastructure stands today: > Reviewed-by: Tom Rini <trini@konsulko.com> > > But would it be possible to clean things up and consolidate files? If > CONFIG_SYS_CACHLINE_SIZE and CONFIG_SKIP_LOWLEVEL_INIT were in Kconfig > it looks like everything could live in board/raspberrypi/rpi/ which it > nearly does today. If it's hard, I'd be OK punting that to v2015.07. > Or am I missing something? It looks like there is a way to remove a lot of the duplicate board/ directories, and I can put a few ifdefs into the config header to combine them into just one. I'll send a patch soon. ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [U-Boot,2/2] ARM: add Raspberry Pi 3 64-bit config 2016-04-02 3:14 ` [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config Stephen Warren 2016-04-02 13:26 ` Tom Rini @ 2016-04-12 2:28 ` Tom Rini 1 sibling, 0 replies; 7+ messages in thread From: Tom Rini @ 2016-04-12 2:28 UTC (permalink / raw) To: u-boot On Fri, Apr 01, 2016 at 09:14:15PM -0600, Stephen Warren wrote: > On all Pis so far, the VC FW provides a short stub to set up the ARM CPU > before entering the kernel (a/k/a U-Boot for us). This feature is not > currently supported by the VC FW when booting in 64-bit mode. However, > this feature will likely appear in the near future, and this U-Boot port > assumes that such a feature is in place. Without that feature, or a > temporary workaround described below, U-Boot will not boot. > > Once the VC FW does provide the ARM stub, u-boot.bin built for rpi_3 can > be used drectly as kernel7.img, in the same way as any other RPi port. The > following config.txt is required: > > # Fix mini UART input frequency, and setup/enable up the UART. > # Without this option, U-Boot will not boot, even if you don't care > # about the serial console. This option will always be required for > # all RPi3 use-cases, unless the PL011 UART is used, which is not > # yet supported by rpi_3* builds of U-Boot. > enable_uart=1 > # Boot in AArch64 (64-bit) mode. > # It is possible that a future VC FW will remove the need for this > # option, instead auto-setting 32-/64-bit mode based on the "kernel" > # filename present on the SD card. > arm_control=0x200 > > Prior to the VC FW providing the ARM boot stub, you can use the following > steps to build an equivalent stub into the U-Boot binary: > > git clone https://github.com/swarren/rpi-3-aarch64-demo.git \ > ../rpi-3-aarch64-demo > (cd ../rpi-3-aarch64-demo && ./build.sh) > Build U-Boot for rpi_3 in the usual way > cat ../rpi-3-aarch64-demo/armstub64.bin u-boot.bin > u-boot.bin.stubbed > Use u-boot.bin.stubbed as kernel7.img on the Pi SD card. > > In this case, the following additional entries are required in config.txt: > > # Tell the FW to load the kernel image at address 0, the reset vector. > kernel_old=1 > > Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> > Reviewed-by: Tom Rini <trini@konsulko.com> Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160411/ef50ab08/attachment.sig> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined 2016-04-02 3:14 [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined Stephen Warren 2016-04-02 3:14 ` [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config Stephen Warren @ 2016-04-02 13:25 ` Tom Rini 2016-04-12 2:28 ` [U-Boot] [U-Boot, " Tom Rini 2 siblings, 0 replies; 7+ messages in thread From: Tom Rini @ 2016-04-02 13:25 UTC (permalink / raw) To: u-boot On Fri, Apr 01, 2016 at 09:14:14PM -0600, Stephen Warren wrote: > There are ARM SoCs (such as the BCM2837) do not contain an ARM GIC. Fix > the ARMv8 CPU startup code to compile in this case. > > Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Tom Rini <trini@konsulko.com> -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160402/01f5bfef/attachment.sig> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [U-Boot, 1/2] ARM: allow CONFIG_GICV* not to be defined 2016-04-02 3:14 [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined Stephen Warren 2016-04-02 3:14 ` [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config Stephen Warren 2016-04-02 13:25 ` [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined Tom Rini @ 2016-04-12 2:28 ` Tom Rini 2 siblings, 0 replies; 7+ messages in thread From: Tom Rini @ 2016-04-12 2:28 UTC (permalink / raw) To: u-boot On Fri, Apr 01, 2016 at 09:14:14PM -0600, Stephen Warren wrote: > There are ARM SoCs (such as the BCM2837) do not contain an ARM GIC. Fix > the ARMv8 CPU startup code to compile in this case. > > Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> > Reviewed-by: Tom Rini <trini@konsulko.com> Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160411/73509508/attachment.sig> ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-04-12 2:28 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-04-02 3:14 [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined Stephen Warren 2016-04-02 3:14 ` [U-Boot] [PATCH 2/2] ARM: add Raspberry Pi 3 64-bit config Stephen Warren 2016-04-02 13:26 ` Tom Rini 2016-04-03 3:33 ` Stephen Warren 2016-04-12 2:28 ` [U-Boot] [U-Boot,2/2] " Tom Rini 2016-04-02 13:25 ` [U-Boot] [PATCH 1/2] ARM: allow CONFIG_GICV* not to be defined Tom Rini 2016-04-12 2:28 ` [U-Boot] [U-Boot, " Tom Rini
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox