All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/4] arm: mvebu: Allow DB-88F6820-GP to boot Linux
@ 2015-05-13 23:16 Kevin Smith
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 1/4] arm: mvebu: Disable L2 cache before enabling d-cache Kevin Smith
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kevin Smith @ 2015-05-13 23:16 UTC (permalink / raw)
  To: u-boot

Changes needed to allow the DB-88F6820-GP development board to successfully
boot a Linux kernel.

Changes in v2:
- Correct address written to CBAR to be the SCU address instead of
  the internal registers address


Kevin Smith (3):
  arm: mvebu: Update CBAR with SOC regs base
  mv-common.h: Include support for device trees
  db-88f6820-gp.h: Load data blobs into lower memory

Stefan Roese (1):
  arm: mvebu: Disable L2 cache before enabling d-cache

 arch/arm/mach-mvebu/cpu.c       | 15 +++++++++++++++
 include/configs/db-88f6820-gp.h |  5 +++++
 include/configs/mv-common.h     |  2 ++
 3 files changed, 22 insertions(+)

-- 
2.3.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 1/4] arm: mvebu: Disable L2 cache before enabling d-cache
  2015-05-13 23:16 [U-Boot] [PATCH v2 0/4] arm: mvebu: Allow DB-88F6820-GP to boot Linux Kevin Smith
@ 2015-05-13 23:17 ` Kevin Smith
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 2/4] arm: mvebu: Update CBAR with SOC regs base Kevin Smith
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Kevin Smith @ 2015-05-13 23:17 UTC (permalink / raw)
  To: u-boot

From: Stefan Roese <sr@denx.de>

L2 cache may still be enabled by the BootROM. We need to first disable
it before enabling d-cache support.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
---
 arch/arm/mach-mvebu/cpu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 04681fc..417fc35 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <netdev.h>
 #include <asm/io.h>
+#include <asm/pl310.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 
@@ -240,6 +241,13 @@ int cpu_eth_init(bd_t *bis)
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {
+	struct pl310_regs *const pl310 =
+		(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+	/* First disable L2 cache - may still be enable from BootROM */
+	if (mvebu_soc_family() == MVEBU_SOC_A38X)
+		clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+
 	/* Avoid problem with e.g. neta ethernet driver */
 	invalidate_dcache_all();
 
-- 
2.3.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 2/4] arm: mvebu: Update CBAR with SOC regs base
  2015-05-13 23:16 [U-Boot] [PATCH v2 0/4] arm: mvebu: Allow DB-88F6820-GP to boot Linux Kevin Smith
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 1/4] arm: mvebu: Disable L2 cache before enabling d-cache Kevin Smith
@ 2015-05-13 23:17 ` Kevin Smith
  2015-05-15  7:01   ` Stefan Roese
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 3/4] mv-common.h: Include support for device trees Kevin Smith
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 4/4] db-88f6820-gp.h: Load data blobs into lower memory Kevin Smith
  3 siblings, 1 reply; 8+ messages in thread
From: Kevin Smith @ 2015-05-13 23:17 UTC (permalink / raw)
  To: u-boot

SMP-enabled Linux kernels read the CBAR register in CP15 to find
the address of the SCU registers.  After remapping internal
registers, also update the CBAR so the kernel can find them.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
---
 arch/arm/mach-mvebu/cpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 417fc35..2970e07 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -161,10 +161,17 @@ static void update_sdram_window_sizes(void)
 }
 
 #ifdef CONFIG_ARCH_CPU_INIT
+static void set_cbar (u32 addr)
+{
+    asm ("mcr p15, 4, %0, c15, c0" : : "r" (addr));
+}
+
+
 int arch_cpu_init(void)
 {
 	/* Linux expects the internal registers to be at 0xf1000000 */
 	writel(SOC_REGS_PHY_BASE, INTREG_BASE_ADDR_REG);
+	set_cbar (SOC_REGS_PHY_BASE + 0xC000);
 
 	/*
 	 * We need to call mvebu_mbus_probe() before calling
-- 
2.3.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 3/4] mv-common.h: Include support for device trees
  2015-05-13 23:16 [U-Boot] [PATCH v2 0/4] arm: mvebu: Allow DB-88F6820-GP to boot Linux Kevin Smith
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 1/4] arm: mvebu: Disable L2 cache before enabling d-cache Kevin Smith
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 2/4] arm: mvebu: Update CBAR with SOC regs base Kevin Smith
@ 2015-05-13 23:17 ` Kevin Smith
  2015-05-15  7:02   ` Stefan Roese
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 4/4] db-88f6820-gp.h: Load data blobs into lower memory Kevin Smith
  3 siblings, 1 reply; 8+ messages in thread
From: Kevin Smith @ 2015-05-13 23:17 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
---
 include/configs/mv-common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
index 51436da..03518b0 100644
--- a/include/configs/mv-common.h
+++ b/include/configs/mv-common.h
@@ -59,6 +59,8 @@
 #define CONFIG_BOOTDELAY	3	/* default enable autoboot */
 #define CONFIG_PREBOOT
 
+#define CONFIG_OF_LIBFDT	1	/* Device tree support */
+
 /*
  * For booting Linux, the board info and command line data
  * have to be in the first 8 MB of memory, since this is
-- 
2.3.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 4/4] db-88f6820-gp.h: Load data blobs into lower memory
  2015-05-13 23:16 [U-Boot] [PATCH v2 0/4] arm: mvebu: Allow DB-88F6820-GP to boot Linux Kevin Smith
                   ` (2 preceding siblings ...)
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 3/4] mv-common.h: Include support for device trees Kevin Smith
@ 2015-05-13 23:17 ` Kevin Smith
  2015-05-15  7:03   ` Stefan Roese
  3 siblings, 1 reply; 8+ messages in thread
From: Kevin Smith @ 2015-05-13 23:17 UTC (permalink / raw)
  To: u-boot

By default on this platform, u-boot loads data into high memory
in the range of 0x7Fxxxxxx, which generates a data abort when the
kernel tries to read it.  Config the u-boot environment to load
the device tree and initrd image into lower memory to make them
accessible to the kernel.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
---
 include/configs/db-88f6820-gp.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
index 12a24ce..490d74e 100644
--- a/include/configs/db-88f6820-gp.h
+++ b/include/configs/db-88f6820-gp.h
@@ -63,6 +63,11 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET	/* don't print console @ startup */
 #define CONFIG_SYS_ALT_MEMTEST
 
+/* Keep device tree and initrd in lower memory so the kernel can access them */
+#define CONFIG_EXTRA_ENV_SETTINGS       \
+        "fdt_high=0x10000000\0"         \
+        "initrd_high=0x10000000\0"
+
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros
-- 
2.3.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 2/4] arm: mvebu: Update CBAR with SOC regs base
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 2/4] arm: mvebu: Update CBAR with SOC regs base Kevin Smith
@ 2015-05-15  7:01   ` Stefan Roese
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2015-05-15  7:01 UTC (permalink / raw)
  To: u-boot

On 14.05.2015 01:17, Kevin Smith wrote:
> SMP-enabled Linux kernels read the CBAR register in CP15 to find
> the address of the SCU registers.  After remapping internal
> registers, also update the CBAR so the kernel can find them.

Thanks Kevin. Only some coding style related comments below:

> Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
> ---
>   arch/arm/mach-mvebu/cpu.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
> index 417fc35..2970e07 100644
> --- a/arch/arm/mach-mvebu/cpu.c
> +++ b/arch/arm/mach-mvebu/cpu.c
> @@ -161,10 +161,17 @@ static void update_sdram_window_sizes(void)
>   }
>
>   #ifdef CONFIG_ARCH_CPU_INIT
> +static void set_cbar (u32 addr)
> +{
> +    asm ("mcr p15, 4, %0, c15, c0" : : "r" (addr));
> +}

Indentation with tabs please. And no space before the "(".

> +
> +
>   int arch_cpu_init(void)
>   {
>   	/* Linux expects the internal registers to be at 0xf1000000 */
>   	writel(SOC_REGS_PHY_BASE, INTREG_BASE_ADDR_REG);
> +	set_cbar (SOC_REGS_PHY_BASE + 0xC000);

No space before the "(" please. checkpatch should complain about these 
minor issues btw. So its always recommended to run it before sending the 
patches to the list.

Please send an updated version and add my

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 3/4] mv-common.h: Include support for device trees
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 3/4] mv-common.h: Include support for device trees Kevin Smith
@ 2015-05-15  7:02   ` Stefan Roese
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2015-05-15  7:02 UTC (permalink / raw)
  To: u-boot

On 14.05.2015 01:17, Kevin Smith wrote:
> Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
> ---
>   include/configs/mv-common.h | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
> index 51436da..03518b0 100644
> --- a/include/configs/mv-common.h
> +++ b/include/configs/mv-common.h
> @@ -59,6 +59,8 @@
>   #define CONFIG_BOOTDELAY	3	/* default enable autoboot */
>   #define CONFIG_PREBOOT
>
> +#define CONFIG_OF_LIBFDT	1	/* Device tree support */

To enable this option, no value is needed. So

#define CONFIG_OF_LIBFDT		/* Device tree support */

should do as well and is preferred.

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 4/4] db-88f6820-gp.h: Load data blobs into lower memory
  2015-05-13 23:17 ` [U-Boot] [PATCH v2 4/4] db-88f6820-gp.h: Load data blobs into lower memory Kevin Smith
@ 2015-05-15  7:03   ` Stefan Roese
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2015-05-15  7:03 UTC (permalink / raw)
  To: u-boot

On 14.05.2015 01:17, Kevin Smith wrote:
> By default on this platform, u-boot loads data into high memory
> in the range of 0x7Fxxxxxx, which generates a data abort when the
> kernel tries to read it.  Config the u-boot environment to load
> the device tree and initrd image into lower memory to make them
> accessible to the kernel.
>
> Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
> ---
>   include/configs/db-88f6820-gp.h | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
> index 12a24ce..490d74e 100644
> --- a/include/configs/db-88f6820-gp.h
> +++ b/include/configs/db-88f6820-gp.h
> @@ -63,6 +63,11 @@
>   #define CONFIG_SYS_CONSOLE_INFO_QUIET	/* don't print console @ startup */
>   #define CONFIG_SYS_ALT_MEMTEST
>
> +/* Keep device tree and initrd in lower memory so the kernel can access them */
> +#define CONFIG_EXTRA_ENV_SETTINGS       \
> +        "fdt_high=0x10000000\0"         \
> +        "initrd_high=0x10000000\0"

Indentation with tabs please.

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-15  7:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 23:16 [U-Boot] [PATCH v2 0/4] arm: mvebu: Allow DB-88F6820-GP to boot Linux Kevin Smith
2015-05-13 23:17 ` [U-Boot] [PATCH v2 1/4] arm: mvebu: Disable L2 cache before enabling d-cache Kevin Smith
2015-05-13 23:17 ` [U-Boot] [PATCH v2 2/4] arm: mvebu: Update CBAR with SOC regs base Kevin Smith
2015-05-15  7:01   ` Stefan Roese
2015-05-13 23:17 ` [U-Boot] [PATCH v2 3/4] mv-common.h: Include support for device trees Kevin Smith
2015-05-15  7:02   ` Stefan Roese
2015-05-13 23:17 ` [U-Boot] [PATCH v2 4/4] db-88f6820-gp.h: Load data blobs into lower memory Kevin Smith
2015-05-15  7:03   ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.