mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v4 10/11] ARM: rpi: add raspberry pi 3 support
Date: Thu,  1 Nov 2018 10:18:45 +0100	[thread overview]
Message-ID: <20181101091846.10882-10-l.stach@pengutronix.de> (raw)
In-Reply-To: <20181101091846.10882-1-l.stach@pengutronix.de>

This adds basic support at the same feature level as the other
supported raspberry pi boards.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Roland Hieber <r.hieber@pengutronix.de>
---
 arch/arm/boards/raspberry-pi/lowlevel.c | 14 ++++++++++++--
 arch/arm/configs/rpi_defconfig          |  2 ++
 arch/arm/dts/Makefile                   |  1 +
 arch/arm/dts/bcm2837-rpi-3.dts          | 16 ++++++++++++++++
 arch/arm/mach-bcm283x/Kconfig           |  6 ++++++
 arch/arm/mach-bcm283x/core.c            |  1 +
 images/Makefile.bcm283x                 |  4 ++++
 7 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/bcm2837-rpi-3.dts

diff --git a/arch/arm/boards/raspberry-pi/lowlevel.c b/arch/arm/boards/raspberry-pi/lowlevel.c
index cbc6caa4b9ed..34c9350920e9 100644
--- a/arch/arm/boards/raspberry-pi/lowlevel.c
+++ b/arch/arm/boards/raspberry-pi/lowlevel.c
@@ -1,7 +1,7 @@
+#include <asm/barebox-arm.h>
+#include <asm/cache.h>
 #include <common.h>
 #include <linux/sizes.h>
-#include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
 #include <mach/platform.h>
 
 extern char __dtb_bcm2835_rpi_start[];
@@ -23,3 +23,13 @@ ENTRY_FUNCTION(start_raspberry_pi2, r0, r1, r2)
 
 	barebox_arm_entry(BCM2835_SDRAM_BASE, SZ_512M, fdt);
 }
+
+extern char __dtb_bcm2837_rpi_3_start[];
+ENTRY_FUNCTION(start_raspberry_pi3, r0, r1, r2)
+{
+	void *fdt = __dtb_bcm2837_rpi_3_start + get_runtime_offset();
+
+	arm_cpu_lowlevel_init();
+
+	barebox_arm_entry(BCM2835_SDRAM_BASE, SZ_512M, fdt);
+}
diff --git a/arch/arm/configs/rpi_defconfig b/arch/arm/configs/rpi_defconfig
index f3aef4290425..cd88b4ac751c 100644
--- a/arch/arm/configs/rpi_defconfig
+++ b/arch/arm/configs/rpi_defconfig
@@ -1,9 +1,11 @@
 CONFIG_ARCH_BCM283X=y
 CONFIG_MACH_RPI=y
 CONFIG_MACH_RPI2=y
+CONFIG_MACH_RPI3=y
 CONFIG_AEABI=y
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
 CONFIG_ARM_UNWIND=y
+CONFIG_IMAGE_COMPRESSION_NONE=y
 CONFIG_MMU=y
 CONFIG_MALLOC_TLSF=y
 CONFIG_KALLSYMS=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 1caeca35b484..4e063902c635 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -71,6 +71,7 @@ pbl-dtb-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += rk3288-phycore-som.dtb.o
 pbl-dtb-$(CONFIG_MACH_REALQ7) += imx6q-dmo-edmqmx6.dtb.o
 pbl-dtb-$(CONFIG_MACH_RPI) += bcm2835-rpi.dtb.o
 pbl-dtb-$(CONFIG_MACH_RPI2) += bcm2836-rpi-2.dtb.o
+pbl-dtb-$(CONFIG_MACH_RPI3) += bcm2837-rpi-3.dtb.o
 pbl-dtb-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o
 pbl-dtb-$(CONFIG_MACH_SABRESD) += imx6q-sabresd.dtb.o
 pbl-dtb-$(CONFIG_MACH_FREESCALE_IMX6SX_SABRESDB) += imx6sx-sdb.dtb.o
diff --git a/arch/arm/dts/bcm2837-rpi-3.dts b/arch/arm/dts/bcm2837-rpi-3.dts
new file mode 100644
index 000000000000..d6ffc369122c
--- /dev/null
+++ b/arch/arm/dts/bcm2837-rpi-3.dts
@@ -0,0 +1,16 @@
+#include <arm64/broadcom/bcm2837-rpi-3-b.dts>
+
+/ {
+	chosen {
+		stdout-path = &uart0;
+	};
+
+	memory {
+		reg = <0x0 0x0>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+	/delete-node/ bluetooth;
+};
diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index 1457f114ccaa..af2f88c47acb 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -19,6 +19,12 @@ config MACH_RPI2
 	select CPU_V7
 	select MACH_RPI_COMMON
 
+config MACH_RPI3
+	bool "RaspberryPi 3 (BCM2837/CORTEX-A53)"
+	select CPU_V7
+	select MACH_RPI_COMMON
+	select ARM_SECURE_MONITOR
+
 endmenu
 
 config MACH_RPI_DEBUG_UART_BASE
diff --git a/arch/arm/mach-bcm283x/core.c b/arch/arm/mach-bcm283x/core.c
index fddcb0d1a1d4..26f0996b1cb8 100644
--- a/arch/arm/mach-bcm283x/core.c
+++ b/arch/arm/mach-bcm283x/core.c
@@ -41,6 +41,7 @@ static int bcm2835_clk_init(void)
 	clk = clk_fixed("uart0-pl0110", 3 * 1000 * 1000);
 	clk_register_clkdev(clk, NULL, "uart0-pl0110");
 	clk_register_clkdev(clk, NULL, "20201000.serial");
+	clk_register_clkdev(clk, NULL, "3f201000.serial");
 
 	clk = clk_fixed("bcm2835-cs", 1 * 1000 * 1000);
 	clk_register_clkdev(clk, NULL, "bcm2835-cs");
diff --git a/images/Makefile.bcm283x b/images/Makefile.bcm283x
index d59ef043f05c..d14e648926ac 100644
--- a/images/Makefile.bcm283x
+++ b/images/Makefile.bcm283x
@@ -9,3 +9,7 @@ image-$(CONFIG_MACH_RPI) += barebox-raspberry-pi-1.img
 pblx-$(CONFIG_MACH_RPI2) += start_raspberry_pi2
 FILE_barebox-raspberry-pi-2.img = start_raspberry_pi2.pblx
 image-$(CONFIG_MACH_RPI2) += barebox-raspberry-pi-2.img
+
+pblx-$(CONFIG_MACH_RPI3) += start_raspberry_pi3
+FILE_barebox-raspberry-pi-3.img = start_raspberry_pi3.pblx
+image-$(CONFIG_MACH_RPI3) += barebox-raspberry-pi-3.img
\ No newline at end of file
-- 
2.19.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-11-01  9:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01  9:18 [PATCH v4 01/11] ARM: pass architecture flag for SMCC also to PBL compilation unit Lucas Stach
2018-11-01  9:18 ` [PATCH v4 02/11] ARM: import opcode helpers from Linux kernel Lucas Stach
2018-11-01  9:18 ` [PATCH v4 03/11] ARM: safely switch from HYP to SVC mode if required Lucas Stach
2018-11-01  9:18 ` [PATCH v4 04/11] ARM: allow secure monitor code to be built without PSCI Lucas Stach
2018-11-02 22:27   ` Sam Ravnborg
2018-11-03  0:04     ` Andrey Smirnov
2018-11-03  7:56       ` Sam Ravnborg
2018-11-01  9:18 ` [PATCH v4 05/11] ARM: add file for HYP mode related setup Lucas Stach
2018-11-01  9:18 ` [PATCH v4 06/11] ARM: don't try to install secure monitor when entered in HYP mode Lucas Stach
2018-11-01  9:18 ` [PATCH v4 07/11] ARM: default to starting kernel in HYP mode when entered in HYP Lucas Stach
2018-11-01  9:18 ` [PATCH v4 08/11] ARM: install HYP vectors at PBL and Barebox entry Lucas Stach
2018-11-01  9:18 ` [PATCH v4 09/11] ARM: rpi: add revision IDs for Pi 3 Model B and Pi Zero Lucas Stach
2018-11-01 18:35   ` Lucas Stach
2018-11-02  6:26     ` Sascha Hauer
2018-11-01  9:18 ` Lucas Stach [this message]
2018-11-01  9:18 ` [PATCH v4 11/11] ARM: rpi: autosize malloc area Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181101091846.10882-10-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox