Skip to contentSkip to conversation

ot1200: add basic SPL support

U-Boot New Christian Gmeiner 2 participants 10 messages Jan 19, 2015 – Jan 22, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

This patch series add basic SPL support for the ot1200. In future patches this support will gets extended to support different memory configurations.

#1 lore raw

PATCH 1/7 ot1200: select SUPPORT_SPL

---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index 5eb1d03..5734405 100644
@@ -663,6 +663,7 @@ config TARGET_TQMA6
 config TARGET_OT1200
 	bool "Bachmann OT1200"
 	select CPU_V7
+	select SUPPORT_SPL
 
 config OMAP34XX
 	bool "OMAP34XX SoC"
Signature · 1 line
2.1.0
#2 lore raw

PATCH 1/7 ot1200: select SUPPORT_SPL

Quoted 11 lines · Christian Gmeiner
---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +0 -0
index 5eb1d03..5734405 100644

arch/arm/Kconfig config TARGET_TQMA6 · line 669

Quoted 7 lines
arch/arm/Kconfig +1 -0
@@ -663,6 +663,7 @@ config TARGET_TQMA6
 config TARGET_OT1200
 	bool "Bachmann OT1200"
 	select CPU_V7
+	select SUPPORT_SPL
 
 config OMAP34XX
 	bool "OMAP34XX SoC"

Whole series merged into u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 2/7 ot1200: make use of imx_ddr_size(..)

In reply to Christian Gmeiner

To support different ddr3 memory sizes we should start using imx_ddr_size(..) instead of the define PHYS_SDRAM_SIZE.

---
 board/bachmann/ot1200/ot1200.c | 3 ++-
 include/configs/ot1200.h       | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)
board/bachmann/ot1200/ot1200.c +2 -1
index 93f3d65..039e858 100644
@@ -16,6 +16,7 @@
 #include <asm/imx-common/mxc_i2c.h>
 #include <asm/imx-common/boot_mode.h>
 #include <asm/arch/crm_regs.h>
+#include <asm/arch/sys_proto.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <netdev.h>
@@ -46,7 +47,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
+	gd->ram_size = imx_ddr_size();
 
 	return 0;
 }
include/configs/ot1200.h +0 -1
index 255c933..97ee664 100644
@@ -159,7 +159,6 @@
 /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS           1
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
-#define PHYS_SDRAM_SIZE                (1u * 1024 * 1024 * 1024)
 
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
Signature · 1 line
2.1.0
#4 lore raw

PATCH 3/7 ot1200: move ccgr and gpr init to c functions

In reply to Christian Gmeiner

We need this way for SPL boot.

---
 board/bachmann/ot1200/mx6q_4x_mt41j128.cfg | 14 --------------
 board/bachmann/ot1200/ot1200.c             | 28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 14 deletions(-)
board/bachmann/ot1200/mx6q_4x_mt41j128.cfg +0 -14
index bb6c60b..c25f99d 100644
@@ -142,20 +142,6 @@ DATA 4 0x021b48b8 0x00000800
 DATA 4 0x021b001c 0x00000000
 DATA 4 0x021b0404 0x00011006
 
-/* set the default clock gate to save power */
-DATA 4 0x020c4068 0x00C03F3F
-DATA 4 0x020c406c 0x0030FC03
-DATA 4 0x020c4070 0x0FFFC000
-DATA 4 0x020c4074 0x3FF00000
-DATA 4 0x020c4078 0x00FFF300
-DATA 4 0x020c407c 0x0F0000C3
-DATA 4 0x020c4080 0x000003FF
-
-/* enable AXI cache for VDOA/VPU/IPU */
-DATA 4 0x020e0010 0xF00000CF
-/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
-DATA 4 0x020e0018 0x007F007F
-DATA 4 0x020e001c 0x007F007F
 
 /*
  * Setup CCM_CCOSR register as follows:
board/bachmann/ot1200/ot1200.c +28 -0
index 039e858..6b6c1a3 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/iomux.h>
@@ -119,8 +120,35 @@ static void setup_iomux_features(void)
 		ARRAY_SIZE(feature_pads));
 }
 
+static void ccgr_init(void)
+{
+	struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+	writel(0x00C03F3F, &ccm->CCGR0);
+	writel(0x0030FC03, &ccm->CCGR1);
+	writel(0x0FFFC000, &ccm->CCGR2);
+	writel(0x3FF00000, &ccm->CCGR3);
+	writel(0x00FFF300, &ccm->CCGR4);
+	writel(0x0F0000C3, &ccm->CCGR5);
+	writel(0x000003FF, &ccm->CCGR6);
+}
+
+static void gpr_init(void)
+{
+	struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
+
+	/* enable AXI cache for VDOA/VPU/IPU */
+	writel(0xF00000CF, &iomux->gpr[4]);
+	/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
+	writel(0x007F007F, &iomux->gpr[6]);
+	writel(0x007F007F, &iomux->gpr[7]);
+}
+
 int board_early_init_f(void)
 {
+	ccgr_init();
+	gpr_init();
+
 	setup_iomux_uart();
 	setup_iomux_spi();
 	setup_iomux_features();
Signature · 1 line
2.1.0
#5 lore raw

PATCH 4/7 ot1200: enable spi clock directly in ccgr_init(..)

In reply to Christian Gmeiner
---
 board/bachmann/ot1200/ot1200.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
board/bachmann/ot1200/ot1200.c +1 -4
index 6b6c1a3..e434ed9 100644
@@ -125,7 +125,7 @@ static void ccgr_init(void)
 	struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
 
 	writel(0x00C03F3F, &ccm->CCGR0);
-	writel(0x0030FC03, &ccm->CCGR1);
+	writel(0x0030FC33, &ccm->CCGR1);
 	writel(0x0FFFC000, &ccm->CCGR2);
 	writel(0x3FF00000, &ccm->CCGR3);
 	writel(0x00FFF300, &ccm->CCGR4);
@@ -319,9 +319,6 @@ int board_init(void)
 
 	leds_on();
 
-	/* enable ecspi3 clocks */
-	enable_cspi_clock(1, 2);
-
 #ifdef CONFIG_CMD_SATA
 	setup_sata();
 #endif
Signature · 1 line
2.1.0
#6 lore raw

PATCH 5/7 ot1200: add SPL configuration

In reply to Christian Gmeiner

We will only support loading u-boot.img from SPI flash stored at the offset of 64k.

---
 include/configs/ot1200.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/ot1200.h +10 -0
index 97ee664..c061e93 100644
@@ -108,6 +108,16 @@
 #endif
 
 
+/* SPL */
+#ifdef CONFIG_SPL
+#include "imx6_spl.h"
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     (64 * 1024)
+#define CONFIG_SPL_SPI_LOAD
+#endif
+
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_MII
Signature · 1 line
2.1.0
#7 lore raw

PATCH 6/7 ot1200: add basic SPL support

In reply to Christian Gmeiner

Currently we only support the Micron MT41K128M16JT-125 ddr3 chip.

---
 board/bachmann/ot1200/Makefile     |   4 +
 board/bachmann/ot1200/ot1200_spl.c | 162 +++++++++++++++++++++++++++++++++++++
 2 files changed, 166 insertions(+)
 create mode 100644 board/bachmann/ot1200/ot1200_spl.c
board/bachmann/ot1200/Makefile +4 -0
index 1bd42e8..9e50bfe 100644
@@ -6,4 +6,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
+ifdef CONFIG_SPL_BUILD
+obj-y  := ot1200.o ot1200_spl.o
+else
 obj-y  := ot1200.o
+endif
board/bachmann/ot1200/ot1200_spl.c new file +162 -0

162 lines not on this page · raw message

Signature · 1 line
2.1.0
#8 lore raw

PATCH 7/7 ot1200: add ot1200_spl_defconfig file

In reply to Christian Gmeiner
---
 configs/ot1200_spl_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 configs/ot1200_spl_defconfig
configs/ot1200_spl_defconfig new file +4 -0
new file mode 100644
index 0000000..74ebf85
@@ -0,0 +1,4 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q"
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_OT1200=y
\ No newline at end of file
Signature · 1 line
2.1.0
#9 lore raw

PATCH 7/7 ot1200: add ot1200_spl_defconfig file

Hi Christian,

Quoted 13 lines · Christian Gmeiner
---
 configs/ot1200_spl_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 configs/ot1200_spl_defconfig
configs/ot1200_spl_defconfig new file +0 -0
new file mode 100644
index 0000000..74ebf85

configs/ot1200_spl_defconfig line 4

Quoted 5 lines
configs/ot1200_spl_defconfig new file +4 -0
@@ -0,0 +1,4 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q"
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_OT1200=y
\ No newline at end of file

The series looks ok to me - ready to be merged.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================