All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support
@ 2015-12-14 11:58 Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 02/14] arm: mvebu: db-mv784mp-gp: Enable common file-system support Stefan Roese
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Enable the newly introduced SATA driver for the Marvell AXP with DMA
support instead of the PIO-only IDE driver. This increases the
transfer speed. And is also more in-line with the Armada 38x
ports, which also use a SATA driver (AHCI) and the "sata" U-Boot
commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 include/configs/db-mv784mp-gp.h | 34 +++++++---------------------------
 1 file changed, 7 insertions(+), 27 deletions(-)

diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index 886f313..65e78b8 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Stefan Roese <sr@denx.de>
+ * Copyright (C) 2014-2015 Stefan Roese <sr@denx.de>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -30,10 +30,10 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_I2C
-#define CONFIG_CMD_IDE
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
+#define CONFIG_CMD_SATA
 #define CONFIG_CMD_SF
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_TFTPPUT
@@ -67,32 +67,12 @@
 #define CONFIG_SYS_ALT_MEMTEST
 
 /* SATA support */
-#ifdef CONFIG_CMD_IDE
-#define __io
-#define CONFIG_IDE_PREINIT
-#define CONFIG_MVSATA_IDE
-
-/* Needs byte-swapping for ATA data register */
-#define CONFIG_IDE_SWAP_IO
-
-#define CONFIG_SYS_ATA_REG_OFFSET	0x0100 /* Offset for register access */
-#define CONFIG_SYS_ATA_DATA_OFFSET	0x0100 /* Offset for data I/O */
-#define CONFIG_SYS_ATA_ALT_OFFSET	0x0100
-
-/* Each 8-bit ATA register is aligned to a 4-bytes address */
-#define CONFIG_SYS_ATA_STRIDE		4
-
-/* CONFIG_CMD_IDE requires some #defines for ATA registers */
-#define CONFIG_SYS_IDE_MAXBUS		2
-#define CONFIG_SYS_IDE_MAXDEVICE	CONFIG_SYS_IDE_MAXBUS
-
-/* ATA registers base is at SATA controller base */
-#define CONFIG_SYS_ATA_BASE_ADDR	MVEBU_AXP_SATA_BASE
-#define CONFIG_SYS_ATA_IDE0_OFFSET	0x2000
-#define CONFIG_SYS_ATA_IDE1_OFFSET	0x4000
-
+#define CONFIG_SYS_SATA_MAX_DEVICE	2
+#define CONFIG_SATA_MV
+#define CONFIG_LIBATA
+#define CONFIG_LBA48
+#define CONFIG_EFI_PARTITION
 #define CONFIG_DOS_PARTITION
-#endif /* CONFIG_CMD_IDE */
 
 /* PCIe support */
 #ifndef CONFIG_SPL_BUILD
-- 
2.6.4

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

* [U-Boot] [PATCH 02/14] arm: mvebu: db-mv784mp-gp: Enable common file-system support
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 03/14] arm: mvebu: db-mv784mp-gp: Enable cache command Stefan Roese
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

This patch adds the common FS options to the Marvell AXP eval board. This
includes EXT2, EXT4, FAT and VFAT. And of course the generic FS commands.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 include/configs/db-mv784mp-gp.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index 65e78b8..3fb0cfb 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -29,6 +29,10 @@
 #define CONFIG_SYS_NO_FLASH		/* Declare no flash (NOR/SPI) */
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ENV
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_PCI
@@ -74,6 +78,9 @@
 #define CONFIG_EFI_PARTITION
 #define CONFIG_DOS_PARTITION
 
+/* Additional FS support/configuration */
+#define CONFIG_SUPPORT_VFAT
+
 /* PCIe support */
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_PCI
-- 
2.6.4

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

* [U-Boot] [PATCH 03/14] arm: mvebu: db-mv784mp-gp: Enable cache command
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 02/14] arm: mvebu: db-mv784mp-gp: Enable common file-system support Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 04/14] arm: mvebu: Enable L2 cache on Armada XP Stefan Roese
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Th cache command can be useful sometimes. So lets enable it on the
AXP eval board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 include/configs/db-mv784mp-gp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index 3fb0cfb..e988f02 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -27,6 +27,7 @@
  * Commands configuration
  */
 #define CONFIG_SYS_NO_FLASH		/* Declare no flash (NOR/SPI) */
+#define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_EXT2
-- 
2.6.4

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

* [U-Boot] [PATCH 04/14] arm: mvebu: Enable L2 cache on Armada XP
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 02/14] arm: mvebu: db-mv784mp-gp: Enable common file-system support Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 03/14] arm: mvebu: db-mv784mp-gp: Enable cache command Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 05/14] arm: mvebu: Add v7_outer_cache_disable function for AXP & A38x Stefan Roese
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Until now, the L2 cache was never enabled again in U-Boot. To get
even better performance (bootup time), lets enable the L2 cache
in U-Boot. This code was taken from the Linux kernel.

A performance gain was measured on the DB-MV784MP-GP board by testing
with tftpboot and sata commands.

This patch also cleans up the L2 cache related code. And makes sure that
the L2 cache is only disabled once.

Please note that A38x still runs with L2 cache disabled. And needs
to be enabled for this SoC in a separate patch if needed or desired.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 arch/arm/mach-mvebu/cpu.c | 34 +++++++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 751dabc..74087e2 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -389,20 +389,36 @@ void scsi_init(void)
 }
 #endif
 
-#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();
 
 	/* Enable D-cache. I-cache is already enabled in start.S */
 	dcache_enable();
 }
-#endif
+
+void v7_outer_cache_enable(void)
+{
+	struct pl310_regs *const pl310 =
+		(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+	/* The L2 cache is already disabled at this point */
+
+	if (mvebu_soc_family() == MVEBU_SOC_AXP) {
+		u32 u;
+
+		/*
+		 * For Aurora cache in no outer mode, enable via the CP15
+		 * coprocessor broadcasting of cache commands to L2.
+		 */
+		asm volatile("mrc p15, 1, %0, c15, c2, 0" : "=r" (u));
+		u |= BIT(8);		/* Set the FW bit */
+		asm volatile("mcr p15, 1, %0, c15, c2, 0" : : "r" (u));
+
+		isb();
+
+		/* Enable the L2 cache */
+		setbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+	}
+}
-- 
2.6.4

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

* [U-Boot] [PATCH 05/14] arm: mvebu: Add v7_outer_cache_disable function for AXP & A38x
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (2 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 04/14] arm: mvebu: Enable L2 cache on Armada XP Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 06/14] arm: mvebu: Don't call arch_cpu_init() from SPL at all Stefan Roese
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Add functionality to correctly disable the L2 cache on the Armada XP
and 38x platforms.

Without this, booting into Linux on ClearFog (A38x) results in a hangup
without any output on the serial console at all. Even with earlyprintk
enabled.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 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 74087e2..fd56c99 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -422,3 +422,11 @@ void v7_outer_cache_enable(void)
 		setbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 	}
 }
+
+void v7_outer_cache_disable(void)
+{
+	struct pl310_regs *const pl310 =
+		(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+}
-- 
2.6.4

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

* [U-Boot] [PATCH 06/14] arm: mvebu: Don't call arch_cpu_init() from SPL at all
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (3 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 05/14] arm: mvebu: Add v7_outer_cache_disable function for AXP & A38x Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 07/14] arm: mvebu: Remove SYS_MALLOC_CLEAR_ON_INIT from DB-MV784MP-GP AXP board Stefan Roese
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

This patch removes the call to arch_cpu_init() in the SPL U-Boot version.
As SPL does not need all the configuration done in this function. And
also does not need the reconfiguration of the internal register
address to 0xf1000000. This will be done by the main U-Boot later on.

This also fixes a problem with the timer not beeing initialized on AXP,
as needed for the mdelay in the setup_usb_phys(). This will now only
be called once in main U-Boot.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 arch/arm/mach-mvebu/cpu.c              |  7 +++----
 arch/arm/mach-mvebu/include/mach/soc.h |  9 +++++----
 arch/arm/mach-mvebu/spl.c              | 13 -------------
 3 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index fd56c99..071b13b 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -220,9 +220,11 @@ static void setup_usb_phys(void)
 	}
 }
 
+/*
+ * This function is not called from the SPL U-Boot version
+ */
 int arch_cpu_init(void)
 {
-#if !defined(CONFIG_SPL_BUILD)
 	struct pl310_regs *const pl310 =
 		(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
 
@@ -233,13 +235,11 @@ int arch_cpu_init(void)
 	 * still locked to cache.
 	 */
 	mmu_disable();
-#endif
 
 	/* 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);
 
-#if !defined(CONFIG_SPL_BUILD)
 	/*
 	 * From this stage on, the SoC detection is working. As we have
 	 * configured the internal register base to the value used
@@ -253,7 +253,6 @@ int arch_cpu_init(void)
 	icache_disable();
 	dcache_disable();
 	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
-#endif
 
 	/*
 	 * We need to call mvebu_mbus_probe() before calling
diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
index 2be8cba..b78da25 100644
--- a/arch/arm/mach-mvebu/include/mach/soc.h
+++ b/arch/arm/mach-mvebu/include/mach/soc.h
@@ -33,10 +33,11 @@
 #define INTREG_BASE_ADDR_REG	(INTREG_BASE + 0x20080)
 #if defined(CONFIG_SPL_BUILD)
 /*
- * On A38x switching the regs base address without running from
- * SDRAM doesn't seem to work. So let the SPL still use the
- * default base address and switch to the new address in the
- * main u-boot later.
+ * The SPL U-Boot version still runs with the default
+ * address for the internal registers, configured by
+ * the BootROM. Only the main U-Boot version uses the
+ * new internal register base address, that also is
+ * required for the Linux kernel.
  */
 #define SOC_REGS_PHY_BASE	0xd0000000
 #else
diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
index 4eeef2d..832df0a 100644
--- a/arch/arm/mach-mvebu/spl.c
+++ b/arch/arm/mach-mvebu/spl.c
@@ -36,19 +36,6 @@ void board_init_f(ulong dummy)
 {
 	int ret;
 
-#ifndef CONFIG_MVEBU_BOOTROM_UARTBOOT
-	/*
-	 * Only call arch_cpu_init() when not returning to the
-	 * Marvell BootROM, which is done when booting via
-	 * the xmodem protocol (kwboot tool). Otherwise the
-	 * internal register will get remapped and the BootROM
-	 * can't continue to run correctly.
-	 */
-
-	/* Linux expects the internal registers to be at 0xf1000000 */
-	arch_cpu_init();
-#endif
-
 	/*
 	 * Pin muxing needs to be done before UART output, since
 	 * on A38x the UART pins need some re-muxing for output
-- 
2.6.4

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

* [U-Boot] [PATCH 07/14] arm: mvebu: Remove SYS_MALLOC_CLEAR_ON_INIT from DB-MV784MP-GP AXP board
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (4 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 06/14] arm: mvebu: Don't call arch_cpu_init() from SPL at all Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 08/14] arm: mvebu: Don't disable cache at startup on Armada XP at all Stefan Roese
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

By removing CONFIG_SYS_MALLOC_CLEAR_ON_INIT, the bootup time is a bit
faster.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 configs/db-mv784mp-gp_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/db-mv784mp-gp_defconfig b/configs/db-mv784mp-gp_defconfig
index d8c667a..6dda2ae 100644
--- a/configs/db-mv784mp-gp_defconfig
+++ b/configs/db-mv784mp-gp_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_DB_MV784MP_GP=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-xp-gp"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
-- 
2.6.4

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

* [U-Boot] [PATCH 08/14] arm: mvebu: Don't disable cache at startup on Armada XP at all
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (5 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 07/14] arm: mvebu: Remove SYS_MALLOC_CLEAR_ON_INIT from DB-MV784MP-GP AXP board Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 09/14] arm: mvebu: Simplify code in setup_usb_phys() a bit Stefan Roese
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

This patch leaces the cache configuration untouched for the AXP in the
setup done by the BootROM. Resulting in the cache still being enabled
at the startup of U-Boot. This leads to a slightly faster boot to the
U-Boot prompt (or Linux of course).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 arch/arm/mach-mvebu/cpu.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 071b13b..6c11609 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -246,13 +246,15 @@ int arch_cpu_init(void)
 	 * in the macros / defines in the U-Boot header (soc.h).
 	 */
 
-	/*
-	 * To fully release / unlock this area from cache, we need
-	 * to flush all caches and disable the L2 cache.
-	 */
-	icache_disable();
-	dcache_disable();
-	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+	if (mvebu_soc_family() == MVEBU_SOC_A38X) {
+		/*
+		 * To fully release / unlock this area from cache, we need
+		 * to flush all caches and disable the L2 cache.
+		 */
+		icache_disable();
+		dcache_disable();
+		clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+	}
 
 	/*
 	 * We need to call mvebu_mbus_probe() before calling
@@ -399,14 +401,13 @@ void enable_caches(void)
 
 void v7_outer_cache_enable(void)
 {
-	struct pl310_regs *const pl310 =
-		(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
-
-	/* The L2 cache is already disabled at this point */
-
 	if (mvebu_soc_family() == MVEBU_SOC_AXP) {
+		struct pl310_regs *const pl310 =
+			(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
 		u32 u;
 
+		/* The L2 cache is already disabled at this point */
+
 		/*
 		 * For Aurora cache in no outer mode, enable via the CP15
 		 * coprocessor broadcasting of cache commands to L2.
-- 
2.6.4

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

* [U-Boot] [PATCH 09/14] arm: mvebu: Simplify code in setup_usb_phys() a bit
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (6 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 08/14] arm: mvebu: Don't disable cache at startup on Armada XP at all Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 10/14] arm: mvebu: Don't use 0 as board ID as its used for the custom boards Stefan Roese
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Use the clrbits() / setbits() functions instead of clrsetbits() when
bit are only cleared or set.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 arch/arm/mach-mvebu/cpu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 6c11609..570966a 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -199,10 +199,10 @@ static void setup_usb_phys(void)
 	clrsetbits_le32(MV_USB_PHY_PLL_REG(1), 0x3ff, 0x605);
 
 	/* Power up PLL and PHY channel */
-	clrsetbits_le32(MV_USB_PHY_PLL_REG(2), 0, BIT(9));
+	setbits_le32(MV_USB_PHY_PLL_REG(2), BIT(9));
 
 	/* Assert VCOCAL_START */
-	clrsetbits_le32(MV_USB_PHY_PLL_REG(1), 0, BIT(21));
+	setbits_le32(MV_USB_PHY_PLL_REG(1), BIT(21));
 
 	mdelay(1);
 
@@ -211,12 +211,12 @@ static void setup_usb_phys(void)
 	 */
 
 	for (dev = 0; dev < 3; dev++) {
-		clrsetbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 3), 0, BIT(15));
+		setbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 3), BIT(15));
 
 		/* Assert REG_RCAL_START in channel REG 1 */
-		clrsetbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), 0, BIT(12));
+		setbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), BIT(12));
 		udelay(40);
-		clrsetbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), BIT(12), 0);
+		clrbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), BIT(12));
 	}
 }
 
-- 
2.6.4

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

* [U-Boot] [PATCH 10/14] arm: mvebu: Don't use 0 as board ID as its used for the custom boards
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (7 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 09/14] arm: mvebu: Simplify code in setup_usb_phys() a bit Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 11/14] arm: mvebu: Add support for MV78260 Stefan Roese
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Using board ID 0 is reserved for the non-Marvell "custom" boards. So
move the board ID's to reflect this.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Phil Sutter <phil@nwl.cc>
---
 arch/arm/mach-mvebu/serdes/axp/board_env_spec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/serdes/axp/board_env_spec.h b/arch/arm/mach-mvebu/serdes/axp/board_env_spec.h
index 36e0ed8..f00f327 100644
--- a/arch/arm/mach-mvebu/serdes/axp/board_env_spec.h
+++ b/arch/arm/mach-mvebu/serdes/axp/board_env_spec.h
@@ -32,7 +32,7 @@
 #define BOARD_ID_BASE			0x0
 
 /* New board ID numbers */
-#define DB_88F78XX0_BP_ID		(BOARD_ID_BASE)
+#define DB_88F78XX0_BP_ID		(BOARD_ID_BASE + 1)
 #define RD_78460_SERVER_ID		(DB_88F78XX0_BP_ID + 1)
 #define DB_78X60_PCAC_ID		(RD_78460_SERVER_ID + 1)
 #define FPGA_88F78XX0_ID		(DB_78X60_PCAC_ID + 1)
-- 
2.6.4

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

* [U-Boot] [PATCH 11/14] arm: mvebu: Add support for MV78260
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (8 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 10/14] arm: mvebu: Don't use 0 as board ID as its used for the custom boards Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 12/14] arm: mvebu: Make ECC support configurable on Armada XP Stefan Roese
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

This patch adds support for the dual core Armada XP variant, the
MV78260. It has some minor differences to the 4-core MV78460,
e.g. only 12 serdes lanes.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Phil Sutter <phil@nwl.cc>
---
 arch/arm/mach-mvebu/cpu.c                          |  5 +++-
 arch/arm/mach-mvebu/include/mach/soc.h             |  1 +
 .../arm/mach-mvebu/serdes/axp/high_speed_env_lib.c | 28 ++++++++++++++++++----
 3 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 570966a..1095f69 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -50,7 +50,7 @@ int mvebu_soc_family(void)
 {
 	u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff;
 
-	if (devid == SOC_MV78460_ID)
+	if ((devid == SOC_MV78260_ID) || (devid == SOC_MV78460_ID))
 		return MVEBU_SOC_AXP;
 
 	if (devid == SOC_88F6810_ID || devid == SOC_88F6820_ID ||
@@ -69,6 +69,9 @@ int print_cpuinfo(void)
 	puts("SoC:   ");
 
 	switch (devid) {
+	case SOC_MV78260_ID:
+		puts("MV78260-");
+		break;
 	case SOC_MV78460_ID:
 		puts("MV78460-");
 		break;
diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
index b78da25..5d4ad30 100644
--- a/arch/arm/mach-mvebu/include/mach/soc.h
+++ b/arch/arm/mach-mvebu/include/mach/soc.h
@@ -11,6 +11,7 @@
 #ifndef _MVEBU_SOC_H
 #define _MVEBU_SOC_H
 
+#define SOC_MV78260_ID		0x7826
 #define SOC_MV78460_ID		0x7846
 #define SOC_88F6810_ID		0x6810
 #define SOC_88F6820_ID		0x6820
diff --git a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
index 702273a..9762971 100644
--- a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
+++ b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
@@ -190,8 +190,15 @@ __weak MV_BIN_SERDES_CFG *board_serdes_cfg_get(u8 pex_mode)
 
 u16 ctrl_model_get(void)
 {
-	/* Right now only MV78460 supported */
+	/*
+	 * SoC version can't be autodetected. So we need to rely on a define
+	 * from the config system here.
+	 */
+#ifdef CONFIG_MV78260
+	return MV_78260_DEV_ID;
+#else
 	return MV_78460_DEV_ID;
+#endif
 }
 
 u32 get_line_cfg(u32 line_num, MV_BIN_SERDES_CFG *info)
@@ -202,6 +209,18 @@ u32 get_line_cfg(u32 line_num, MV_BIN_SERDES_CFG *info)
 		return (info->line8_15 >> ((line_num - 8) << 2)) & 0xF;
 }
 
+static int serdes_max_lines_get(void)
+{
+	switch (ctrl_model_get()) {
+	case MV_78260_DEV_ID:
+		return 12;
+	case MV_78460_DEV_ID:
+		return 16;
+	}
+
+	return 0;
+}
+
 int serdes_phy_config(void)
 {
 	int status = MV_OK;
@@ -226,10 +245,9 @@ int serdes_phy_config(void)
 	u32 pex_if_num;
 
 	/*
-	 * TODO:
-	 * Right now we only support the MV78460 with 16 serdes lines
+	 * Get max. serdes lines count
 	 */
-	max_serdes_lines = 16;
+	max_serdes_lines = serdes_max_lines_get();
 	if (max_serdes_lines == 0)
 		return MV_OK;
 
@@ -253,6 +271,8 @@ int serdes_phy_config(void)
 		if ((u8) MV_ERROR == (u8) satr11)
 			return MV_ERROR;
 		break;
+	default:
+		satr11 = 0;
 	}
 
 	board_modules_scan();
-- 
2.6.4

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

* [U-Boot] [PATCH 12/14] arm: mvebu: Make ECC support configurable on Armada XP
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (9 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 11/14] arm: mvebu: Add support for MV78260 Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 13/14] arm: mvebu: Don't include "netdev.h" in cpu.c Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 14/14] arm: mvebu: Make serdes setup on Armada XP less noisy Stefan Roese
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Currently, ECC support is enabled for all Armada XP boards. So the
DDR3 driver tries to configure the controller with ECC support, even
on boards without ECC. This patch makes this ECC optional which now
can be configured on a board-per-board basis.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Phil Sutter <phil@nwl.cc>
---
 drivers/ddr/marvell/axp/ddr3_axp.h        | 3 +++
 drivers/ddr/marvell/axp/ddr3_axp_config.h | 5 +++++
 include/configs/db-mv784mp-gp.h           | 1 +
 include/configs/maxbcm.h                  | 1 +
 4 files changed, 10 insertions(+)

diff --git a/drivers/ddr/marvell/axp/ddr3_axp.h b/drivers/ddr/marvell/axp/ddr3_axp.h
index d9e33f7..75d315a 100644
--- a/drivers/ddr/marvell/axp/ddr3_axp.h
+++ b/drivers/ddr/marvell/axp/ddr3_axp.h
@@ -33,7 +33,10 @@
 #define SAR1_CPU_CORE_MASK		0x00000018
 #define SAR1_CPU_CORE_OFFSET		3
 
+/* Only enable ECC if the board selects it */
+#ifdef CONFIG_BOARD_ECC_SUPPORT
 #define ECC_SUPPORT
+#endif
 #define NEW_FABRIC_TWSI_ADDR		0x4E
 #ifdef CONFIG_DB_784MP_GP
 #define BUS_WIDTH_ECC_TWSI_ADDR		0x4E
diff --git a/drivers/ddr/marvell/axp/ddr3_axp_config.h b/drivers/ddr/marvell/axp/ddr3_axp_config.h
index a672044..25c34fb 100644
--- a/drivers/ddr/marvell/axp/ddr3_axp_config.h
+++ b/drivers/ddr/marvell/axp/ddr3_axp_config.h
@@ -44,7 +44,12 @@
  * DDR3_TRAINING_DEBUG - Debug prints of internal code
  */
 #define DDR_TARGET_FABRIC			5
+/* Only enable ECC if the board selects it */
+#ifdef CONFIG_BOARD_ECC_SUPPORT
 #define DRAM_ECC				1
+#else
+#define DRAM_ECC				0
+#endif
 
 #ifdef MV_DDR_32BIT
 #define BUS_WIDTH                               32
diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index e988f02..c354e6f 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -146,5 +146,6 @@
 /* Enable DDR support in SPL (DDR3 training from Marvell bin_hdr) */
 #define CONFIG_SYS_MVEBU_DDR_AXP
 #define CONFIG_SPD_EEPROM		0x4e
+#define CONFIG_BOARD_ECC_SUPPORT	/* this board supports ECC */
 
 #endif /* _CONFIG_DB_MV7846MP_GP_H */
diff --git a/include/configs/maxbcm.h b/include/configs/maxbcm.h
index 49e83c0..23e5526 100644
--- a/include/configs/maxbcm.h
+++ b/include/configs/maxbcm.h
@@ -108,5 +108,6 @@
 /* Enable DDR support in SPL (DDR3 training from Marvell bin_hdr) */
 #define CONFIG_SYS_MVEBU_DDR_AXP
 #define CONFIG_DDR_FIXED_SIZE		(1 << 20)	/* 1GiB */
+#define CONFIG_BOARD_ECC_SUPPORT	/* this board supports ECC */
 
 #endif /* _CONFIG_DB_MV7846MP_GP_H */
-- 
2.6.4

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

* [U-Boot] [PATCH 13/14] arm: mvebu: Don't include "netdev.h" in cpu.c
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (10 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 12/14] arm: mvebu: Make ECC support configurable on Armada XP Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  2015-12-14 11:58 ` [U-Boot] [PATCH 14/14] arm: mvebu: Make serdes setup on Armada XP less noisy Stefan Roese
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

This is not needed any more since the switch to DM / DTS network
initialization on MVEBU. Lets remove it, as it otherwise leads
to compilation warning when CONFIG_NET is not enabled.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 arch/arm/mach-mvebu/cpu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 1095f69..c9b9c77 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -5,7 +5,6 @@
  */
 
 #include <common.h>
-#include <netdev.h>
 #include <ahci.h>
 #include <linux/mbus.h>
 #include <asm/io.h>
-- 
2.6.4

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

* [U-Boot] [PATCH 14/14] arm: mvebu: Make serdes setup on Armada XP less noisy
  2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
                   ` (11 preceding siblings ...)
  2015-12-14 11:58 ` [U-Boot] [PATCH 13/14] arm: mvebu: Don't include "netdev.h" in cpu.c Stefan Roese
@ 2015-12-14 11:58 ` Stefan Roese
  12 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2015-12-14 11:58 UTC (permalink / raw)
  To: u-boot

Change some of the PEX configuration output lines from always output to
only ouput upon specific debug enabling.

This changes the SPL output from:

U-Boot SPL 2016.01-rc2-00037-g9353a7f (Dec 10 2015 - 10:27:42)
High speed PHY - Version: 2.1.5 (COM-PHY-V20)
Update Device ID PEX0782611ab
Update Device ID PEX1782611ab
Update Device ID PEX2782611ab
Update Device ID PEX3782611ab
Update Device ID PEX8782611ab
Update PEX Device ID 0x78260
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver 5.7.4
DDR3 Training Sequence - Ended Successfully

to:

U-Boot SPL 2016.01-rc2-00037-g9353a7f-dirty (Dec 10 2015 - 10:32:04)
High speed PHY - Version: 2.1.5 (COM-PHY-V20)
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver 5.7.4
DDR3 Training Sequence - Ended Successfully

Resulting in a little faster bootup time.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
index 9762971..bfa7f13 100644
--- a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
+++ b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
@@ -1376,19 +1376,19 @@ int serdes_phy_config(void)
 						 pex_if, PEX_DEVICE_AND_VENDOR_ID));
 			devId &= 0xFFFF;
 			devId |= ((ctrl_mode << 16) & 0xffff0000);
-			DEBUG_INIT_S("Update Device ID PEX");
-			DEBUG_INIT_D(pex_if, 1);
-			DEBUG_INIT_D(devId, 8);
-			DEBUG_INIT_S("\n");
+			DEBUG_INIT_FULL_S("Update Device ID PEX");
+			DEBUG_INIT_FULL_D(pex_if, 1);
+			DEBUG_INIT_FULL_D(devId, 8);
+			DEBUG_INIT_FULL_S("\n");
 			reg_write(PEX_CFG_DIRECT_ACCESS
 				  (pex_if, PEX_DEVICE_AND_VENDOR_ID), devId);
 			if ((pex_if < 8) &&
 			    (info->pex_mode[pex_unit] == PEX_BUS_MODE_X4))
 				pex_if += 3;
 		}
-		DEBUG_INIT_S("Update PEX Device ID 0x");
-		DEBUG_INIT_D(ctrl_mode, 4);
-		DEBUG_INIT_S("0\n");
+		DEBUG_INIT_FULL_S("Update PEX Device ID 0x");
+		DEBUG_INIT_FULL_D(ctrl_mode, 4);
+		DEBUG_INIT_FULL_S("0\n");
 	}
 	tmp = reg_read(PEX_DBG_STATUS_REG(0));
 	DEBUG_RD_REG(PEX_DBG_STATUS_REG(0), tmp);
-- 
2.6.4

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

end of thread, other threads:[~2015-12-14 11:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14 11:58 [U-Boot] [PATCH 01/14] arm: mvebu: db-mv784mp-gp: Switch from IDE to SATA support Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 02/14] arm: mvebu: db-mv784mp-gp: Enable common file-system support Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 03/14] arm: mvebu: db-mv784mp-gp: Enable cache command Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 04/14] arm: mvebu: Enable L2 cache on Armada XP Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 05/14] arm: mvebu: Add v7_outer_cache_disable function for AXP & A38x Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 06/14] arm: mvebu: Don't call arch_cpu_init() from SPL at all Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 07/14] arm: mvebu: Remove SYS_MALLOC_CLEAR_ON_INIT from DB-MV784MP-GP AXP board Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 08/14] arm: mvebu: Don't disable cache at startup on Armada XP at all Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 09/14] arm: mvebu: Simplify code in setup_usb_phys() a bit Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 10/14] arm: mvebu: Don't use 0 as board ID as its used for the custom boards Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 11/14] arm: mvebu: Add support for MV78260 Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 12/14] arm: mvebu: Make ECC support configurable on Armada XP Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 13/14] arm: mvebu: Don't include "netdev.h" in cpu.c Stefan Roese
2015-12-14 11:58 ` [U-Boot] [PATCH 14/14] arm: mvebu: Make serdes setup on Armada XP less noisy 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.