Skip to contentSkip to conversation

Generalize Keystone2 code for other SoC types

PATCH New Ivan Khoronzhuk 2 participants 12 messages Jul 9, 2014 – Jul 26, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover Generalize Keystone2 code for other SoC types

In order to be able to correctly add another Keysotne2 SoC type we need to make some preparation changes to the sources. So generalize Keystone2 code for other SoC types, in particular for Keystone 2 Edison (k2e) SoC. It's needed to add support for Keystone2 k2e_evm evaluation board, so add some preparation in board files too.

Based on "Optimize keystone2 code for other SoC types" series.
http://www.mail-archive.com/u-boot at lists.denx.de/msg141989.html

Hao Zhang (3):
ARM: keystone2: move K2HK board files to common KS2 board directory
configs: k2hk_evm: config: add common EVM configuration header
keystone: ddr3: move K2HK DDR3 configuration to a common file

Ivan Khoronzhuk (2):
k2hk: use common KS2_ prefix for all hardware definitions
ARM: keystone: clock: move K2HK SoC dependent code in separate file

Murali Karicheri (1):
keystone2: add env option to do unitrd dt fixup

 arch/arm/cpu/armv7/keystone/Makefile               |   1 +
 arch/arm/cpu/armv7/keystone/clock-k2hk.c           | 113 +++++++
 arch/arm/cpu/armv7/keystone/clock.c                | 152 ++-------
 arch/arm/cpu/armv7/keystone/ddr3.c                 |   8 +-
 arch/arm/cpu/armv7/keystone/init.c                 |   4 +-
 arch/arm/cpu/armv7/keystone/keystone.c             |   2 +-
 arch/arm/cpu/armv7/keystone/msmc.c                 |   2 +-
 arch/arm/include/asm/arch-keystone/clock-k2hk.h    |  23 +-
 arch/arm/include/asm/arch-keystone/clock.h         |  28 ++
 arch/arm/include/asm/arch-keystone/clock_defs.h    |   2 +-
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h | 202 ++++++------
 arch/arm/include/asm/arch-keystone/hardware.h      |   4 +-
 board/ti/k2hk_evm/Makefile                         |   9 -
 board/ti/k2hk_evm/ddr3.c                           | 349 ---------------------
 board/ti/ks2_evm/Makefile                          |  11 +
 board/ti/{k2hk_evm/README => ks2_evm/README_K2HK}  |   0
 board/ti/{k2hk_evm => ks2_evm}/board.c             | 139 +++-----
 board/ti/ks2_evm/board.h                           |  19 ++
 board/ti/ks2_evm/board_k2hk.c                      |  81 +++++
 board/ti/ks2_evm/ddr3_cfg.c                        | 130 ++++++++
 board/ti/ks2_evm/ddr3_cfg.h                        |  21 ++
 board/ti/ks2_evm/ddr3_k2hk.c                       |  84 +++++
 boards.cfg                                         |   2 +-
 include/configs/k2hk_evm.h                         | 257 +--------------
 include/configs/ks2_evm.h                          | 275 ++++++++++++++++
 25 files changed, 952 insertions(+), 966 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2hk.c
 delete mode 100644 board/ti/k2hk_evm/Makefile
 delete mode 100644 board/ti/k2hk_evm/ddr3.c
 create mode 100644 board/ti/ks2_evm/Makefile
 rename board/ti/{k2hk_evm/README => ks2_evm/README_K2HK} (100%)
 rename board/ti/{k2hk_evm => ks2_evm}/board.c (68%)
 create mode 100644 board/ti/ks2_evm/board.h
 create mode 100644 board/ti/ks2_evm/board_k2hk.c
 create mode 100644 board/ti/ks2_evm/ddr3_cfg.c
 create mode 100644 board/ti/ks2_evm/ddr3_cfg.h
 create mode 100644 board/ti/ks2_evm/ddr3_k2hk.c
 create mode 100644 include/configs/ks2_evm.h
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/6 k2hk: use common KS2_ prefix for all hardware definitions

Use KS2_ prefix in all definitions, for that replace K2HK_ prefix and add KS2_ prefix where it's needed. It requires to change names also in places where they're used. Align lines and remove redundant definitions in kardware-k2hk.h at the same time.

Using common KS2_ prefix helps resolve redundant redefinitions and adds opportunity to use KS2_ definition across a project not thinking about what SoC should be used. It's more convenient and we don't need to worry about the SoC type in common files, hardware.h will think about that. The hardware.h decides definitions of what SoC to use.

---
 arch/arm/cpu/armv7/keystone/clock.c                |  24 +--
 arch/arm/cpu/armv7/keystone/ddr3.c                 |   8 +-
 arch/arm/cpu/armv7/keystone/init.c                 |   4 +-
 arch/arm/cpu/armv7/keystone/keystone.c             |   2 +-
 arch/arm/cpu/armv7/keystone/msmc.c                 |   2 +-
 arch/arm/include/asm/arch-keystone/clock-k2hk.h    |   2 +-
 arch/arm/include/asm/arch-keystone/clock_defs.h    |   2 +-
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h | 202 ++++++++++-----------
 arch/arm/include/asm/arch-keystone/hardware.h      |   4 +-
 board/ti/k2hk_evm/ddr3.c                           |  24 +--
 include/configs/k2hk_evm.h                         |  12 +-
 11 files changed, 138 insertions(+), 148 deletions(-)
arch/arm/cpu/armv7/keystone/clock.c +12 -12
index bfa4c9d..f905fdc 100644
@@ -29,11 +29,11 @@ struct pll_regs {
 };
 
 static const struct pll_regs pll_regs[] = {
-	[CORE_PLL]	= { K2HK_MAINPLLCTL0, K2HK_MAINPLLCTL1},
-	[PASS_PLL]	= { K2HK_PASSPLLCTL0, K2HK_PASSPLLCTL1},
-	[TETRIS_PLL]	= { K2HK_ARMPLLCTL0,  K2HK_ARMPLLCTL1},
-	[DDR3A_PLL]	= { K2HK_DDR3APLLCTL0, K2HK_DDR3APLLCTL1},
-	[DDR3B_PLL]	= { K2HK_DDR3BPLLCTL0, K2HK_DDR3BPLLCTL1},
+	[CORE_PLL]	= { KS2_MAINPLLCTL0, KS2_MAINPLLCTL1},
+	[PASS_PLL]	= { KS2_PASSPLLCTL0, KS2_PASSPLLCTL1},
+	[TETRIS_PLL]	= { KS2_ARMPLLCTL0,  KS2_ARMPLLCTL1},
+	[DDR3A_PLL]	= { KS2_DDR3APLLCTL0, KS2_DDR3APLLCTL1},
+	[DDR3B_PLL]	= { KS2_DDR3BPLLCTL0, KS2_DDR3BPLLCTL1},
 };
 
 /* Fout = Fref * NF(mult) / NR(prediv) / OD */
@@ -47,7 +47,7 @@ static unsigned long pll_freq_get(int pll)
 		ret = external_clk[sys_clk];
 		if (pllctl_reg_read(pll, ctl) & PLLCTL_PLLEN) {
 			/* PLL mode */
-			tmp = __raw_readl(K2HK_MAINPLLCTL0);
+			tmp = __raw_readl(KS2_MAINPLLCTL0);
 			prediv = (tmp & PLL_DIV_MASK) + 1;
 			mult = (((tmp & PLLM_MULT_HI_SMASK) >> 6) |
 				(pllctl_reg_read(pll, mult) &
@@ -61,19 +61,19 @@ static unsigned long pll_freq_get(int pll)
 		switch (pll) {
 		case PASS_PLL:
 			ret = external_clk[pa_clk];
-			reg = K2HK_PASSPLLCTL0;
+			reg = KS2_PASSPLLCTL0;
 			break;
 		case TETRIS_PLL:
 			ret = external_clk[tetris_clk];
-			reg = K2HK_ARMPLLCTL0;
+			reg = KS2_ARMPLLCTL0;
 			break;
 		case DDR3A_PLL:
 			ret = external_clk[ddr3a_clk];
-			reg = K2HK_DDR3APLLCTL0;
+			reg = KS2_DDR3APLLCTL0;
 			break;
 		case DDR3B_PLL:
 			ret = external_clk[ddr3b_clk];
-			reg = K2HK_DDR3BPLLCTL0;
+			reg = KS2_DDR3BPLLCTL0;
 			break;
 		default:
 			return 0;
@@ -214,7 +214,7 @@ void init_pll(const struct pll_init_data *data)
 		 * Set CHIPMISCCTL1[13] = 0 (enable glitchfree bypass)
 		 * only applicable for Kepler
 		 */
-		clrbits_le32(K2HK_MISC_CTRL, ARM_PLL_EN);
+		clrbits_le32(KS2_MISC_CTRL, KS2_ARM_PLL_EN);
 		/* 2 In PLLCTL1, write PLLRST = 1 (PLL is reset) */
 		setbits_le32(pll_regs[data->pll].reg1 ,
 			     PLL_PLLRST | PLLCTL_ENSAT);
@@ -255,7 +255,7 @@ void init_pll(const struct pll_init_data *data)
 		 * 9 Set CHIPMISCCTL1[13] = 1 (disable glitchfree bypass)
 		 * only applicable for Kepler
 		 */
-		setbits_le32(K2HK_MISC_CTRL, ARM_PLL_EN);
+		setbits_le32(KS2_MISC_CTRL, KS2_ARM_PLL_EN);
 	} else {
 		setbits_le32(pll_regs[data->pll].reg1, PLLCTL_ENSAT);
 		/*
arch/arm/cpu/armv7/keystone/ddr3.c +4 -4
index b711b81..2391e79 100644
@@ -74,15 +74,15 @@ void ddr3_reset_ddrphy(void)
 	u32 tmp;
 
 	/* Assert DDR3A  PHY reset */
-	tmp = readl(K2HK_DDR3APLLCTL1);
+	tmp = readl(KS2_DDR3APLLCTL1);
 	tmp |= KS2_DDR3_PLLCTRL_PHY_RESET;
-	writel(tmp, K2HK_DDR3APLLCTL1);
+	writel(tmp, KS2_DDR3APLLCTL1);
 
 	/* wait 10us to catch the reset */
 	udelay(10);
 
 	/* Release DDR3A PHY reset */
-	tmp = readl(K2HK_DDR3APLLCTL1);
+	tmp = readl(KS2_DDR3APLLCTL1);
 	tmp &= ~KS2_DDR3_PLLCTRL_PHY_RESET;
-	__raw_writel(tmp, K2HK_DDR3APLLCTL1);
+	__raw_writel(tmp, KS2_DDR3APLLCTL1);
 }
arch/arm/cpu/armv7/keystone/init.c +2 -2
index 4df5ae1..f4c293a 100644
@@ -15,8 +15,8 @@
 
 void chip_configuration_unlock(void)
 {
-	__raw_writel(KEYSTONE_KICK0_MAGIC, KEYSTONE_KICK0);
-	__raw_writel(KEYSTONE_KICK1_MAGIC, KEYSTONE_KICK1);
+	__raw_writel(KS2_KICK0_MAGIC, KS2_KICK0);
+	__raw_writel(KS2_KICK1_MAGIC, KS2_KICK1);
 }
 
 int arch_cpu_init(void)
arch/arm/cpu/armv7/keystone/keystone.c +1 -1
index 1c8c038..11a9357 100644
@@ -23,7 +23,7 @@ int cpu_to_bus(u32 *ptr, u32 length)
 {
 	u32 i;
 
-	if (!(readl(K2HK_DEVSTAT) & 0x1))
+	if (!(readl(KS2_DEVSTAT) & 0x1))
 		for (i = 0; i < length; i++, ptr++)
 			*ptr = cpu_to_be32(*ptr);
 
arch/arm/cpu/armv7/keystone/msmc.c +1 -1
index f3f1621..af858fa 100644
@@ -58,7 +58,7 @@ struct msms_regs {
 
 void share_all_segments(int priv_id)
 {
-	struct msms_regs *msmc = (struct msms_regs *)K2HK_MSMC_CTRL_BASE;
+	struct msms_regs *msmc = (struct msms_regs *)KS2_MSMC_CTRL_BASE;
 	int j;
 
 	for (j = 0; j < 8; j++) {
arch/arm/include/asm/arch-keystone/clock-k2hk.h +1 -1
index 6a69a8d..ed1225c 100644
@@ -56,7 +56,7 @@ enum clk_e {
 	sys_clk3_clk
 };
 
-#define K2HK_CLK1_6 sys_clk0_6_clk
+#define KS2_CLK1_6 sys_clk0_6_clk
 
 /* PLL identifiers */
 enum pll_type_e {
arch/arm/include/asm/arch-keystone/clock_defs.h +1 -1
index b251aff..e545341 100644
@@ -50,7 +50,7 @@ struct pllctl_regs {
 };
 
 static struct pllctl_regs *pllctl_regs[] = {
-	(struct pllctl_regs *)(CLOCK_BASE + 0x100)
+	(struct pllctl_regs *)(KS2_CLOCK_BASE + 0x100)
 };
 
 #define pllctl_reg(pll, reg)            (&(pllctl_regs[pll]->reg))
arch/arm/include/asm/arch-keystone/hardware-k2hk.h +96 -106

230 lines not on this page · raw message

arch/arm/include/asm/arch-keystone/hardware.h +2 -2
index 0dcc31a..133edad 100644
@@ -105,7 +105,7 @@ typedef volatile unsigned int   *dv_reg_p;
 #ifndef __ASSEMBLY__
 static inline int cpu_is_k2hk(void)
 {
-	unsigned int jtag_id	= __raw_readl(JTAG_ID_REG);
+	unsigned int jtag_id	= __raw_readl(KS2_JTAG_ID_REG);
 	unsigned int part_no	= (jtag_id >> 12) & 0xffff;
 
 	return (part_no == 0xb981) ? 1 : 0;
@@ -113,7 +113,7 @@ static inline int cpu_is_k2hk(void)
 
 static inline int cpu_revision(void)
 {
-	unsigned int jtag_id	= __raw_readl(JTAG_ID_REG);
+	unsigned int jtag_id	= __raw_readl(KS2_JTAG_ID_REG);
 	unsigned int rev	= (jtag_id >> 28) & 0xf;
 
 	return rev;
board/ti/k2hk_evm/ddr3.c +12 -12
index b604266..31e9c31 100644
@@ -299,20 +299,20 @@ void ddr3_init(void)
 				/* PG 2.0 */
 				/* Reset DDR3A PHY after PLL enabled */
 				ddr3_reset_ddrphy();
-				ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+				ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC,
 						 &ddr3phy_1600_64A_pg2);
 			} else {
 				/* PG 1.1 */
-				ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+				ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC,
 						 &ddr3phy_1600_64A);
 			}
 
-			ddr3_init_ddremif(K2HK_DDR3A_EMIF_CTRL_BASE,
+			ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE,
 					  &ddr3_1600_64);
 			printf("DRAM:  Capacity 8 GiB (includes reported below)\n");
 		} else {
-			ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC, &ddr3phy_1600_32);
-			ddr3_init_ddremif(K2HK_DDR3A_EMIF_CTRL_BASE,
+			ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC, &ddr3phy_1600_32);
+			ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE,
 					  &ddr3_1600_32);
 			printf("DRAM:  Capacity 4 GiB (includes reported below)\n");
 		}
@@ -323,18 +323,18 @@ void ddr3_init(void)
 				/* PG 2.0 */
 				/* Reset DDR3A PHY after PLL enabled */
 				ddr3_reset_ddrphy();
-				ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+				ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC,
 						 &ddr3phy_1333_64A_pg2);
 			} else {
 				/* PG 1.1 */
-				ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+				ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC,
 						 &ddr3phy_1333_64A);
 			}
-			ddr3_init_ddremif(K2HK_DDR3A_EMIF_CTRL_BASE,
+			ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE,
 					  &ddr3_1333_64);
 		} else {
-			ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC, &ddr3phy_1333_32);
-			ddr3_init_ddremif(K2HK_DDR3A_EMIF_CTRL_BASE,
+			ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC, &ddr3phy_1333_32);
+			ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE,
 					  &ddr3_1333_32);
 		}
 	} else {
@@ -344,6 +344,6 @@ void ddr3_init(void)
 	}
 
 	init_pll(&ddr3b_333);
-	ddr3_init_ddrphy(K2HK_DDR3B_DDRPHYC, &ddr3phy_1333_64);
-	ddr3_init_ddremif(K2HK_DDR3B_EMIF_CTRL_BASE, &ddr3_1333_64);
+	ddr3_init_ddrphy(KS2_DDR3B_DDRPHYC, &ddr3phy_1333_64);
+	ddr3_init_ddremif(KS2_DDR3B_EMIF_CTRL_BASE, &ddr3_1333_64);
 }
include/configs/k2hk_evm.h +6 -6
index 63e0249..bacf3bc 100644
@@ -73,7 +73,7 @@
 #define CONFIG_SYS_NS16550_REG_SIZE     -4
 #define CONFIG_SYS_NS16550_COM1         KS2_UART0_BASE
 #define CONFIG_SYS_NS16550_COM2         KS2_UART1_BASE
-#define CONFIG_SYS_NS16550_CLK          clk_get_rate(K2HK_CLK1_6)
+#define CONFIG_SYS_NS16550_CLK          clk_get_rate(KS2_CLK1_6)
 #define CONFIG_CONS_INDEX               1
 #define CONFIG_BAUDRATE                 115200
 
@@ -83,16 +83,16 @@
 #define CONFIG_SPI_FLASH_STMICRO
 #define CONFIG_DAVINCI_SPI
 #define CONFIG_SYS_SPI0
-#define CONFIG_SYS_SPI_BASE             K2HK_SPI_BASE
+#define CONFIG_SYS_SPI_BASE             KS2_SPI_BASE
 #define CONFIG_SYS_SPI0_NUM_CS          4
 #define CONFIG_SYS_SPI1
-#define CONFIG_SYS_SPI1_BASE            K2HK_SPI1_BASE
+#define CONFIG_SYS_SPI1_BASE            KS2_SPI1_BASE
 #define CONFIG_SYS_SPI1_NUM_CS          4
 #define CONFIG_SYS_SPI2
 #define CONFIG_SYS_SPI2_NUM_CS          4
-#define CONFIG_SYS_SPI2_BASE            K2HK_SPI2_BASE
+#define CONFIG_SYS_SPI2_BASE            KS2_SPI2_BASE
 #define CONFIG_CMD_SPI
-#define CONFIG_SYS_SPI_CLK              clk_get_rate(K2HK_LPSC_EMIF25_SPI)
+#define CONFIG_SYS_SPI_CLK              clk_get_rate(KS2_LPSC_EMIF25_SPI)
 #define CONFIG_SF_DEFAULT_SPEED         30000000
 #define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
 
@@ -264,6 +264,6 @@
 /* we may include files below only after all above definitions */
 #include <asm/arch/hardware.h>
 #include <asm/arch/clock.h>
-#define CONFIG_SYS_HZ_CLOCK             clk_get_rate(K2HK_CLK1_6)
+#define CONFIG_SYS_HZ_CLOCK             clk_get_rate(KS2_CLK1_6)
 
 #endif /* __CONFIG_K2HK_EVM_H */
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/6 k2hk: use common KS2_ prefix for all hardware definitions

Quoted 5 lines · Ivan

Use KS2_ prefix in all definitions, for that replace K2HK_ prefix and add KS2_ prefix where it's needed. It requires to change names also in places where they're used. Align lines and remove redundant definitions in kardware-k2hk.h at the same time.

Quoted 8 lines

Using common KS2_ prefix helps resolve redundant redefinitions and adds opportunity to use KS2_ definition across a project not thinking about what SoC should be used. It's more convenient and we don't need to worry about the SoC type in common files, hardware.h will think about that. The hardware.h decides definitions of what SoC to use.

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140725/601269e2/attachment.pgp>
#3 lore raw

PATCH 2/6 keystone2: add env option to do unitrd dt fixup

In reply to Ivan Khoronzhuk

From: Murali Karicheri <[email protected]>

With latest v3.13 kernel, unitrd dt fixup is not needed. However for older kernel versions such as v3.8/v3.10, it is needed. So to work with both, add a u-boot env variable that can be set to do dt fixup for older kernels.

---
 board/ti/k2hk_evm/board.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
board/ti/k2hk_evm/board.c +5 -1
index 3333eb0..646ecb3 100644
@@ -157,11 +157,14 @@ void ft_board_setup(void *blob, bd_t *bd)
 	u64 size[2];
 	char name[32], *env, *endp;
 	int lpae, nodeoffset;
+	int unitrd_fixup = 0;
 	u32 ddr3a_size;
 	int nbanks;
 
 	env = getenv("mem_lpae");
 	lpae = env && simple_strtol(env, NULL, 0);
+	env = getenv("uinitrd_fixup");
+	unitrd_fixup = env && simple_strtol(env, NULL, 0);
 
 	ddr3a_size = 0;
 	if (lpae) {
@@ -204,10 +207,11 @@ void ft_board_setup(void *blob, bd_t *bd)
 	fdt_fixup_memory_banks(blob, start, size, nbanks);
 
 	/* Fix up the initrd */
-	if (lpae) {
+	if (lpae && unitrd_fixup) {
 		u64 initrd_start, initrd_end;
 		u32 *prop1, *prop2;
 		int err;
+
 		nodeoffset = fdt_path_offset(blob, "/chosen");
 		if (nodeoffset >= 0) {
 			prop1 = (u32 *)fdt_getprop(blob, nodeoffset,
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 3/6 ARM: keystone2: move K2HK board files to common KS2 board directory

In reply to Ivan Khoronzhuk

From: Hao Zhang <[email protected]>

This patch moves K2HK board directory to a common Keystone II board directory. The Board related common functions are moved to a common keystone board file.

---
 board/ti/{k2hk_evm => ks2_evm}/Makefile           |   7 +-
 board/ti/{k2hk_evm/README => ks2_evm/README_K2HK} |   0
 board/ti/{k2hk_evm => ks2_evm}/board.c            | 135 ++++++----------------
 board/ti/ks2_evm/board.h                          |  19 +++
 board/ti/ks2_evm/board_k2hk.c                     |  81 +++++++++++++
 board/ti/{k2hk_evm/ddr3.c => ks2_evm/ddr3_k2hk.c} |   0
 boards.cfg                                        |   2 +-
 include/configs/k2hk_evm.h                        |   1 +
 8 files changed, 142 insertions(+), 103 deletions(-)
 rename board/ti/{k2hk_evm => ks2_evm}/Makefile (50%)
 rename board/ti/{k2hk_evm/README => ks2_evm/README_K2HK} (100%)
 rename board/ti/{k2hk_evm => ks2_evm}/board.c (69%)
 create mode 100644 board/ti/ks2_evm/board.h
 create mode 100644 board/ti/ks2_evm/board_k2hk.c
 rename board/ti/{k2hk_evm/ddr3.c => ks2_evm/ddr3_k2hk.c} (100%)
board/ti/ks2_evm/Makefile renamed from board/ti/k2hk_evm/Makefile +4 -3
similarity index 50%
rename from board/ti/k2hk_evm/Makefile
rename to board/ti/ks2_evm/Makefile
index 3645f2f..58d77dc 100644
@@ -1,9 +1,10 @@
 #
-# K2HK-EVM: board Makefile
+# KS2-EVM: board Makefile
 # (C) Copyright 2012-2014
 #     Texas Instruments Incorporated, <www.ti.com>
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y	+= board.o
-obj-y	+= ddr3.o
+obj-y += board.o
+obj-$(CONFIG_K2HK_EVM) += board_k2hk.o
+obj-$(CONFIG_K2HK_EVM) += ddr3_k2hk.o
board/ti/ks2_evm/README_K2HK renamed from board/ti/k2hk_evm/README +0 -0
similarity index 100%
rename from board/ti/k2hk_evm/README
rename to board/ti/ks2_evm/README_K2HK
board/ti/ks2_evm/board.c renamed from board/ti/k2hk_evm/board.c +36 -99

222 lines not on this page · raw message

board/ti/ks2_evm/board.h new file +19 -0
new file mode 100644
index 0000000..d91ef73
@@ -0,0 +1,19 @@
+/*
+ * K2HK EVM : Board common header
+ *
+ * (C) Copyright 2014
+ *     Texas Instruments Incorporated, <www.ti.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _KS2_BOARD
+#define _KS2_BOARD
+
+#include <asm/arch/emac_defs.h>
+
+extern struct eth_priv_t eth_priv_cfg[];
+
+int get_num_eth_ports(void);
+
+#endif
board/ti/ks2_evm/board_k2hk.c new file +81 -0

81 lines not on this page · raw message

board/ti/ks2_evm/ddr3_k2hk.c renamed from board/ti/k2hk_evm/ddr3.c +0 -0
similarity index 100%
rename from board/ti/k2hk_evm/ddr3.c
rename to board/ti/ks2_evm/ddr3_k2hk.c
boards.cfg +1 -1
index 5a85fad..e08ccae 100644
@@ -298,7 +298,7 @@ Active  arm         armv7          exynos      samsung         trats
 Active  arm         armv7          exynos      samsung         trats2              trats2                                -                                                                                                                                 Piotr Wilczek <[email protected]>
 Active  arm         armv7          exynos      samsung         universal_c210      s5pc210_universal                     -                                                                                                                                 Przemyslaw Marczak <[email protected]>
 Active  arm         armv7          highbank    -               highbank            highbank                              -                                                                                                                                 Rob Herring <[email protected]>
-Active  arm         armv7          keystone    ti              k2hk_evm            k2hk_evm                              -                                                                                                                                 Vitaly Andrianov <[email protected]>
+Active  arm         armv7          keystone    ti              ks2_evm             k2hk_evm                              -                                                                                                                                 Vitaly Andrianov <[email protected]>
 Active  arm         armv7          mx5         denx            m53evk              m53evk                                m53evk:IMX_CONFIG=board/denx/m53evk/imximage.cfg                                                                                  Marek Vasut <[email protected]>
 Active  arm         armv7          mx5         esg             ima3-mx53           ima3-mx53                             ima3-mx53:IMX_CONFIG=board/esg/ima3-mx53/imximage.cfg                                                                             -
 Active  arm         armv7          mx5         freescale       mx51evk             mx51evk                               mx51evk:IMX_CONFIG=board/freescale/mx51evk/imximage.cfg                                                                           Stefano Babic <[email protected]>
include/configs/k2hk_evm.h +1 -0
index bacf3bc..f727882 100644
@@ -258,6 +258,7 @@
 #define CONFIG_OF_BOARD_SETUP
 #define CONFIG_SYS_BARGSIZE             1024
 #define CONFIG_SYS_LOAD_ADDR            (CONFIG_SYS_SDRAM_BASE + 0x08000000)
+#define CONFIG_LINUX_BOOT_PARAM_ADDR	(CONFIG_SYS_SDRAM_BASE + 0x100)
 
 #define CONFIG_SUPPORT_RAW_INITRD
 
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH 3/6 ARM: keystone2: move K2HK board files to common KS2 board directory

Quoted 9 lines · Ivan

From: Hao Zhang <[email protected]>

This patch moves K2HK board directory to a common Keystone II board directory. The Board related common functions are moved to a common keystone board file.

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140725/0f0817b0/attachment.pgp>
#6 lore raw

PATCH 4/6 ARM: keystone: clock: move K2HK SoC dependent code in separate file

In reply to Ivan Khoronzhuk

This patch in general spit SoC type clock dependent code and general clock code. Before adding keystone II Edison k2e SoC which has slightly different dpll set, move k2hk dependent clock code to separate clock-k2hk.c file.

---
 arch/arm/cpu/armv7/keystone/Makefile            |   1 +
 arch/arm/cpu/armv7/keystone/clock-k2hk.c        | 113 ++++++++++++++++++
 arch/arm/cpu/armv7/keystone/clock.c             | 148 ++++--------------------
 arch/arm/include/asm/arch-keystone/clock-k2hk.h |  21 ----
 arch/arm/include/asm/arch-keystone/clock.h      |  28 +++++
 5 files changed, 166 insertions(+), 145 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2hk.c
arch/arm/cpu/armv7/keystone/Makefile +1 -0
index 64e42a6..74c5160 100644
@@ -8,6 +8,7 @@
 obj-y	+= init.o
 obj-y	+= psc.o
 obj-y	+= clock.o
+obj-$(CONFIG_SOC_K2HK) += clock-k2hk.o
 obj-y	+= cmd_clock.o
 obj-y	+= cmd_mon.o
 obj-$(CONFIG_DRIVER_TI_KEYSTONE_NET) += keystone_nav.o
arch/arm/cpu/armv7/keystone/clock-k2hk.c new file +113 -0

113 lines not on this page · raw message

arch/arm/cpu/armv7/keystone/clock.c +24 -124

250 lines not on this page · raw message

arch/arm/include/asm/arch-keystone/clock-k2hk.h +0 -21
index ed1225c..784a0be 100644
@@ -10,10 +10,6 @@
 #ifndef __ASM_ARCH_CLOCK_K2HK_H
 #define __ASM_ARCH_CLOCK_K2HK_H
 
-#include <asm/arch/hardware.h>
-
-#ifndef __ASSEMBLY__
-
 enum ext_clk_e {
 	sys_clk,
 	alt_core_clk,
@@ -66,15 +62,6 @@ enum pll_type_e {
 	DDR3A_PLL,
 	DDR3B_PLL,
 };
-#define MAIN_PLL CORE_PLL
-
-/* PLL configuration data */
-struct pll_init_data {
-	int pll;
-	int pll_m;		/* PLL Multiplier */
-	int pll_d;		/* PLL divider */
-	int pll_od;		/* PLL output divider    */
-};
 
 #define CORE_PLL_799    {CORE_PLL,	13,	1,	2}
 #define CORE_PLL_983    {CORE_PLL,	16,	1,	2}
@@ -98,12 +85,4 @@ struct pll_init_data {
 #define DDR3_PLL_800(x)	{DDR3##x##_PLL,	16,	1,	2}
 #define DDR3_PLL_333(x)	{DDR3##x##_PLL,	20,	1,	6}
 
-void init_plls(int num_pll, struct pll_init_data *config);
-void init_pll(const struct pll_init_data *data);
-unsigned long clk_get_rate(unsigned int clk);
-unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
-int clk_set_rate(unsigned int clk, unsigned long hz);
-
-#endif
-
 #endif
arch/arm/include/asm/arch-keystone/clock.h +28 -0
index 324501b..c7da352 100644
@@ -10,8 +10,36 @@
 #ifndef __ASM_ARCH_CLOCK_H
 #define __ASM_ARCH_CLOCK_H
 
+#ifndef __ASSEMBLY__
+
 #ifdef CONFIG_SOC_K2HK
 #include <asm/arch/clock-k2hk.h>
 #endif
 
+#define MAIN_PLL CORE_PLL
+
+#include <asm/types.h>
+
+struct keystone_pll_regs {
+	u32 reg0;
+	u32 reg1;
+};
+
+/* PLL configuration data */
+struct pll_init_data {
+	int pll;
+	int pll_m;		/* PLL Multiplier */
+	int pll_d;		/* PLL divider */
+	int pll_od;		/* PLL output divider */
+};
+
+extern const struct keystone_pll_regs keystone_pll_regs[];
+
+void init_plls(int num_pll, struct pll_init_data *config);
+void init_pll(const struct pll_init_data *data);
+unsigned long clk_get_rate(unsigned int clk);
+unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
+int clk_set_rate(unsigned int clk, unsigned long hz);
+
+#endif
 #endif
Signature · 1 line
1.8.3.2
#7 lore raw

PATCH 4/6 ARM: keystone: clock: move K2HK SoC dependent code in separate file

Quoted 7 lines · Ivan

This patch in general spit SoC type clock dependent code and general clock code. Before adding keystone II Edison k2e SoC which has slightly different dpll set, move k2hk dependent clock code to separate clock-k2hk.c file.

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140725/51debc52/attachment.pgp>
#8 lore raw

PATCH 5/6 configs: k2hk_evm: config: add common EVM configuration header

In reply to Ivan Khoronzhuk

From: Hao Zhang <[email protected]>

This patch adds a common config header file for all the Keystone II EVM platforms. It combines a lot of general definitions in one file. The common header included in the EVM should be specific configuration header.

---
 include/configs/k2hk_evm.h | 258 +++---------------------------------------
 include/configs/ks2_evm.h  | 275 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 289 insertions(+), 244 deletions(-)
 create mode 100644 include/configs/ks2_evm.h
include/configs/k2hk_evm.h +14 -244
index f727882..8aa616d 100644
@@ -14,257 +14,27 @@
 #define CONFIG_SOC_K2HK
 #define CONFIG_K2HK_EVM
 
-/* U-Boot Build Configuration */
-#define CONFIG_SKIP_LOWLEVEL_INIT       /* U-Boot is a 2nd stage loader */
-#define CONFIG_SYS_NO_FLASH             /* that is, no *NOR* flash */
-#define CONFIG_SYS_CONSOLE_INFO_QUIET
-#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_SYS_THUMB_BUILD
-
-/* SoC Configuration */
-#define CONFIG_ARMV7
-#define CONFIG_ARCH_CPU_INIT
-#define CONFIG_SYS_ARCH_TIMER
-#define CONFIG_SYS_HZ                   1000
-#define CONFIG_SYS_TEXT_BASE            0x0c001000
-#define CONFIG_SPL_TARGET               "u-boot-spi.gph"
-#define CONFIG_SYS_DCACHE_OFF
-
-/* Memory Configuration */
-#define CONFIG_NR_DRAM_BANKS            2
-#define CONFIG_SYS_SDRAM_BASE           0x80000000
-#define CONFIG_SYS_LPAE_SDRAM_BASE      0x800000000
-#define CONFIG_MAX_RAM_BANK_SIZE        (2 << 30)       /* 2GB */
-#define CONFIG_STACKSIZE                (512 << 10)     /* 512 KiB */
-#define CONFIG_SYS_MALLOC_LEN           (4 << 20)       /* 4 MiB */
-#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_TEXT_BASE - \
-					 GENERATED_GBL_DATA_SIZE)
-
-/* SPL SPI Loader Configuration */
-#define CONFIG_SPL_TEXT_BASE            0x0c200000
-#define CONFIG_SPL_PAD_TO               65536
-#define CONFIG_SPL_MAX_SIZE             (CONFIG_SPL_PAD_TO - 8)
-#define CONFIG_SPL_BSS_START_ADDR       (CONFIG_SPL_TEXT_BASE + \
-					 CONFIG_SPL_MAX_SIZE)
-#define CONFIG_SPL_BSS_MAX_SIZE         (32 * 1024)
-#define CONFIG_SYS_SPL_MALLOC_START     (CONFIG_SPL_BSS_START_ADDR + \
-					 CONFIG_SPL_BSS_MAX_SIZE)
-#define CONFIG_SYS_SPL_MALLOC_SIZE      (32 * 1024)
-#define CONFIG_SPL_STACK_SIZE           (8 * 1024)
-#define CONFIG_SPL_STACK                (CONFIG_SYS_SPL_MALLOC_START + \
-					 CONFIG_SYS_SPL_MALLOC_SIZE + \
-					 CONFIG_SPL_STACK_SIZE - 4)
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-#define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_SPI_FLASH_SUPPORT
-#define CONFIG_SPL_SPI_SUPPORT
-#define CONFIG_SPL_BOARD_INIT
-#define CONFIG_SPL_SPI_LOAD
-#define CONFIG_SPL_SPI_BUS              0
-#define CONFIG_SPL_SPI_CS               0
-#define CONFIG_SYS_SPI_U_BOOT_OFFS      CONFIG_SPL_PAD_TO
-#define CONFIG_SPL_FRAMEWORK
-
-/* UART Configuration */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_MEM32
-#define CONFIG_SYS_NS16550_REG_SIZE     -4
-#define CONFIG_SYS_NS16550_COM1         KS2_UART0_BASE
-#define CONFIG_SYS_NS16550_COM2         KS2_UART1_BASE
-#define CONFIG_SYS_NS16550_CLK          clk_get_rate(KS2_CLK1_6)
-#define CONFIG_CONS_INDEX               1
-#define CONFIG_BAUDRATE                 115200
-
-/* SPI Configuration */
-#define CONFIG_SPI
-#define CONFIG_SPI_FLASH
-#define CONFIG_SPI_FLASH_STMICRO
-#define CONFIG_DAVINCI_SPI
-#define CONFIG_SYS_SPI0
-#define CONFIG_SYS_SPI_BASE             KS2_SPI_BASE
-#define CONFIG_SYS_SPI0_NUM_CS          4
-#define CONFIG_SYS_SPI1
-#define CONFIG_SYS_SPI1_BASE            KS2_SPI1_BASE
-#define CONFIG_SYS_SPI1_NUM_CS          4
-#define CONFIG_SYS_SPI2
-#define CONFIG_SYS_SPI2_NUM_CS          4
-#define CONFIG_SYS_SPI2_BASE            KS2_SPI2_BASE
-#define CONFIG_CMD_SPI
-#define CONFIG_SYS_SPI_CLK              clk_get_rate(KS2_LPSC_EMIF25_SPI)
-#define CONFIG_SF_DEFAULT_SPEED         30000000
-#define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
+/* U-Boot general configuration */
+#define CONFIG_SYS_PROMPT               "K2HK EVM # "
 
-/* I2C Configuration */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_DAVINCI
-#define CONFIG_SYS_DAVINCI_I2C_SPEED    100000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE    0x10 /* SMBus host address */
-#define CONFIG_SYS_DAVINCI_I2C_SPEED1   100000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE1   0x10 /* SMBus host address */
-#define CONFIG_SYS_DAVINCI_I2C_SPEED2   100000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE2   0x10 /* SMBus host address */
-#define I2C_BUS_MAX                     3
+#define KS2_ARGS_UBI   "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
+		       "root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,2048\0"
 
-/* EEPROM definitions */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         2
-#define CONFIG_SYS_I2C_EEPROM_ADDR             0x50
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      6
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  20
-#define CONFIG_ENV_EEPROM_IS_ON_I2C
+#define KS2_FDT_NAME   "name_fdt=k2hk-evm.dtb\0"
+#define KS2_ADDR_MON   "addr_mon=0x0c5f0000\0"
+#define KS2_NAME_MON   "name_mon=skern-k2hk-evm.bin\0"
+#define NAME_UBOOT     "name_uboot=u-boot-spi-k2hk-evm.gph\0"
+#define NAME_UBI       "name_ubi=k2hk-evm-ubifs.ubi\0"
 
-/* Network Configuration */
-#define CONFIG_DRIVER_TI_KEYSTONE_NET
-#define CONFIG_MII
-#define CONFIG_BOOTP_DEFAULT
-#define CONFIG_BOOTP_DNS
-#define CONFIG_BOOTP_DNS2
-#define CONFIG_BOOTP_SEND_HOSTNAME
-#define CONFIG_NET_RETRY_COUNT                 32
-#define CONFIG_NET_MULTI
-#define CONFIG_GET_LINK_STATUS_ATTEMPTS        5
-#define CONFIG_SYS_SGMII_REFCLK_MHZ            312
-#define CONFIG_SYS_SGMII_LINERATE_MHZ          1250
-#define CONFIG_SYS_SGMII_RATESCALE             2
+#include <configs/ks2_evm.h>
 
-/* AEMIF */
-#define CONFIG_TI_AEMIF
-#define CONFIG_AEMIF_CNTRL_BASE		       KS2_AEMIF_CNTRL_BASE
+/* SPL SPI Loader Configuration */
+#define CONFIG_SPL_TEXT_BASE		0x0c200000
 
 /* NAND Configuration */
-#define CONFIG_NAND_DAVINCI
-#define CONFIG_KEYSTONE_RBL_NAND
-#define CONFIG_KEYSTONE_NAND_MAX_RBL_SIZE	CONFIG_ENV_OFFSET
-#define CONFIG_SYS_NAND_CS                     2
-#define CONFIG_SYS_NAND_USE_FLASH_BBT
-#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
 #define CONFIG_SYS_NAND_PAGE_2K
-#define CONFIG_SYS_NAND_MASK_CLE		0x4000
-#define CONFIG_SYS_NAND_MASK_ALE		0x2000
-
-#define CONFIG_SYS_NAND_LARGEPAGE
-#define CONFIG_SYS_NAND_BASE_LIST       { 0x30000000, }
-#define CONFIG_SYS_MAX_NAND_DEVICE      1
-#define CONFIG_SYS_NAND_MAX_CHIPS       1
-#define CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
-#define CONFIG_ENV_SIZE                 (256 << 10)  /* 256 KiB */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET               0x100000
-#define CONFIG_MTD_PARTITIONS
-#define CONFIG_MTD_DEVICE
-#define CONFIG_RBTREE
-#define CONFIG_LZO
-#define MTDIDS_DEFAULT			"nand0=davinci_nand.0"
-#define MTDPARTS_DEFAULT                "mtdparts=davinci_nand.0:" \
-					"1024k(bootloader)ro,512k(params)ro," \
-					"-(ubifs)"
-/* U-Boot command configuration */
-#include <config_cmd_default.h>
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_SAVES
-#define CONFIG_CMD_MTDPARTS
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_UBI
-#define CONFIG_CMD_UBIFS
-#define CONFIG_CMD_SF
-#define CONFIG_CMD_EEPROM
-
-/* U-Boot general configuration */
-#define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_SYS_PROMPT               "K2HK EVM # "
-#define CONFIG_SYS_CBSIZE               1024
-#define CONFIG_SYS_PBSIZE		2048
-#define CONFIG_SYS_MAXARGS              16
-#define CONFIG_SYS_HUSH_PARSER
-#define CONFIG_SYS_LONGHELP
-#define CONFIG_CRC32_VERIFY
-#define CONFIG_MX_CYCLIC
-#define CONFIG_CMDLINE_EDITING
-#define CONFIG_VERSION_VARIABLE
-#define CONFIG_TIMESTAMP
 
-#define CONFIG_BOOTDELAY                3
-#define CONFIG_BOOTFILE                 "uImage"
-#define CONFIG_EXTRA_ENV_SETTINGS					\
-	"boot=ramfs\0"							\
-	"tftp_root=/\0"							\
-	"nfs_root=/export\0"						\
-	"mem_lpae=1\0"							\
-	"mem_reserve=512M\0"						\
-	"addr_fdt=0x87000000\0"						\
-	"addr_kern=0x88000000\0"					\
-	"addr_mon=0x0c5f0000\0"						\
-	"addr_uboot=0x87000000\0"					\
-	"addr_fs=0x82000000\0"						\
-	"addr_ubi=0x82000000\0"						\
-	"fdt_high=0xffffffff\0"						\
-	"name_fdt=uImage-k2hk-evm.dtb\0"				\
-	"name_fs=arago-console-image.cpio.gz\0"				\
-	"name_kern=uImage-keystone-evm.bin\0"				\
-	"name_mon=skern-keystone-evm.bin\0"				\
-	"name_uboot=u-boot-spi-keystone-evm.gph\0"			\
-	"name_ubi=keystone-evm-ubifs.ubi\0"				\
-	"run_mon=mon_install ${addr_mon}\0"				\
-	"run_kern=bootm ${addr_kern} - ${addr_fdt}\0"			\
-	"init_net=run args_all args_net\0"				\
-	"init_ubi=run args_all args_ubi; "				\
-		"ubi part ubifs; ubifsmount boot\0"			\
-	"get_fdt_net=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}\0"	\
-	"get_fdt_ubi=ubifsload ${addr_fdt} ${name_fdt}\0"		\
-	"get_kern_net=dhcp ${addr_kern} ${tftp_root}/${name_kern}\0"	\
-	"get_kern_ubi=ubifsload ${addr_kern} ${name_kern}\0"		\
-	"get_mon_net=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0"	\
-	"get_mon_ubi=ubifsload ${addr_mon} ${name_mon}\0"		\
-	"get_uboot_net=dhcp ${addr_uboot} ${tftp_root}/${name_uboot}\0"	\
-	"burn_uboot_spi=sf probe; sf erase 0 0x100000; "		\
-		"sf write ${addr_uboot} 0 ${filesize}\0"		\
-	"burn_uboot_nand=nand erase 0 0x100000; "			\
-		"nand write ${addr_uboot} 0 ${filesize}\0"		\
-	"args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1\0"	\
-	"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "	\
-		"root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,2048\0"	\
-	"args_net=setenv bootargs ${bootargs} rootfstype=nfs "		\
-		"root=/dev/nfs rw nfsroot=${serverip}:${nfs_root},"	\
-		"${nfs_options} ip=dhcp\0"				\
-	"nfs_options=v3,tcp,rsize=4096,wsize=4096\0"			\
-	"get_fdt_ramfs=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}\0"	\
-	"get_kern_ramfs=dhcp ${addr_kern} ${tftp_root}/${name_kern}\0"	\
-	"get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0"	\
-	"get_fs_ramfs=dhcp ${addr_fs} ${tftp_root}/${name_fs}\0"	\
-	"get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}\0"	\
-	"burn_ubi=nand erase.part ubifs; "				\
-		"nand write ${addr_ubi} ubifs ${filesize}\0"		\
-	"init_ramfs=run args_all args_ramfs get_fs_ramfs\0"		\
-	"args_ramfs=setenv bootargs ${bootargs} earlyprintk "		\
-		"rdinit=/sbin/init rw root=/dev/ram0 "			\
-		"initrd=0x802000000,9M\0"				\
-	"no_post=1\0"							\
-	"mtdparts=mtdparts=davinci_nand.0:"				\
-		"1024k(bootloader)ro,512k(params)ro,522752k(ubifs)\0"
-#define CONFIG_BOOTCOMMAND						\
-	"run init_${boot} get_fdt_${boot} get_mon_${boot} "		\
-		"get_kern_${boot} run_mon run_kern"
-#define CONFIG_BOOTARGS							\
-
-/* Linux interfacing */
-#define CONFIG_CMDLINE_TAG
-#define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_OF_LIBFDT                1
-#define CONFIG_OF_BOARD_SETUP
-#define CONFIG_SYS_BARGSIZE             1024
-#define CONFIG_SYS_LOAD_ADDR            (CONFIG_SYS_SDRAM_BASE + 0x08000000)
-#define CONFIG_LINUX_BOOT_PARAM_ADDR	(CONFIG_SYS_SDRAM_BASE + 0x100)
-
-#define CONFIG_SUPPORT_RAW_INITRD
-
-/* we may include files below only after all above definitions */
-#include <asm/arch/hardware.h>
-#include <asm/arch/clock.h>
-#define CONFIG_SYS_HZ_CLOCK             clk_get_rate(KS2_CLK1_6)
+/* Network */
+#define CONFIG_DRIVER_TI_KEYSTONE_NET
 
 #endif /* __CONFIG_K2HK_EVM_H */
include/configs/ks2_evm.h new file +275 -0

275 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#9 lore raw

PATCH 5/6 configs: k2hk_evm: config: add common EVM configuration header

Quoted 10 lines · Ivan

From: Hao Zhang <[email protected]>

This patch adds a common config header file for all the Keystone II EVM platforms. It combines a lot of general definitions in one file. The common header included in the EVM should be specific configuration header.

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140725/3129d333/attachment.pgp>
#10 lore raw

PATCH 6/6 keystone: ddr3: move K2HK DDR3 configuration to a common file

In reply to Ivan Khoronzhuk

From: Hao Zhang <[email protected]>

It's convenient to hold configurations for DDR3 PHY and EMIF in separate common place. This patch moves K2HK DDR3 PHY and EMIF configuration data with different rates and memory size to a common ddr3_cfg.c file.

---
 board/ti/ks2_evm/Makefile    |   1 +
 board/ti/ks2_evm/ddr3_cfg.c  | 130 ++++++++++++++++++
 board/ti/ks2_evm/ddr3_cfg.h  |  21 +++
 board/ti/ks2_evm/ddr3_k2hk.c | 305 +++----------------------------------------
 4 files changed, 172 insertions(+), 285 deletions(-)
 create mode 100644 board/ti/ks2_evm/ddr3_cfg.c
 create mode 100644 board/ti/ks2_evm/ddr3_cfg.h
board/ti/ks2_evm/Makefile +1 -0
index 58d77dc..774a7d5 100644
@@ -6,5 +6,6 @@
 #
 
 obj-y += board.o
+obj-y += ddr3_cfg.o
 obj-$(CONFIG_K2HK_EVM) += board_k2hk.o
 obj-$(CONFIG_K2HK_EVM) += ddr3_k2hk.o
board/ti/ks2_evm/ddr3_cfg.c new file +130 -0

130 lines not on this page · raw message

board/ti/ks2_evm/ddr3_cfg.h new file +21 -0
new file mode 100644
index 0000000..d14bac3
@@ -0,0 +1,21 @@
+/*
+ * Keystone2: DDR3 configuration
+ *
+ * (C) Copyright 2012-2014
+ *     Texas Instruments Incorporated, <www.ti.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __DDR3_CFG_H
+#define __DDR3_CFG_H
+
+extern struct ddr3_phy_config ddr3phy_1600_8g;
+extern struct ddr3_emif_config ddr3_1600_8g;
+
+extern struct ddr3_phy_config ddr3phy_1333_2g;
+extern struct ddr3_emif_config ddr3_1333_2g;
+
+int ddr3_get_dimm_params(char *dimm_name);
+
+#endif /* __DDR3_CFG_H */
board/ti/ks2_evm/ddr3_k2hk.c +20 -285

355 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#11 lore raw

PATCH 6/6 keystone: ddr3: move K2HK DDR3 configuration to a common file

Quoted 10 lines · Ivan

From: Hao Zhang <[email protected]>

It's convenient to hold configurations for DDR3 PHY and EMIF in separate common place. This patch moves K2HK DDR3 PHY and EMIF configuration data with different rates and memory size to a common ddr3_cfg.c file.

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140725/5f415e5d/attachment.pgp>