Skip to contentSkip to conversation

Add support for AM43xx Starter Kit

PATCH Superseded Felipe Balbi 2 participants 8 messages Jun 10, 2014 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add support for AM43xx Starter Kit

Hi,

patches were tested on AM43xx SK on top of v2014.07-rc3.

Felipe Balbi (5):
board: ti: am43xx: print unsupported board name
cpu: armv7: am33x: ddr: write emif ref_ctrl_shadow register
board: ti: am43xx: add support for AM43xx Starter Kit
board: ti: am43xx: add AM437x SK PHY Address
board: ti: am43xx: enable QSPI and Gbit Ethernet on AM437x SK

 arch/arm/cpu/armv7/am33xx/ddr.c |  1 +
 board/ti/am43xx/board.c         | 79 +++++++++++++++++++++++++++++++++++++++--
 board/ti/am43xx/board.h         |  5 +++
 board/ti/am43xx/mux.c           |  3 ++
 include/configs/am43xx_evm.h    |  2 ++
 5 files changed, 88 insertions(+), 2 deletions(-)
Signature · 1 line
2.0.0.rc1
#1 lore raw

PATCH 1/5 board: ti: am43xx: print unsupported board name

when porting u-boot to a new am43xx board, it helps to know the name of the current unsupported board so we don't have to hunt for design documents to figure out what's written in the EEPROM.

---
 board/ti/am43xx/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/ti/am43xx/board.c +1 -1
index 71af1ae..6197076 100644
@@ -260,7 +260,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
 	else if (board_is_gpevm())
 		return &gp_evm_dpll_ddr;
 
-	puts(" Board not supported\n");
+	printf(" Board '%s' not supported\n", am43xx_board_name);
 	return NULL;
 }
 
Signature · 1 line
2.0.0.rc1
#2 lore raw

PATCH 2/5 cpu: armv7: am33x: ddr: write emif ref_ctrl_shadow register

In reply to Felipe Balbi
---
 arch/arm/cpu/armv7/am33xx/ddr.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/cpu/armv7/am33xx/ddr.c +1 -0
index 9a625c4..bbe9d1a 100644
@@ -95,6 +95,7 @@ void config_sdram_emif4d5(const struct emif_regs *regs, int nr)
 	       &emif_reg[nr]->emif_rd_wr_exec_thresh);
 
 	writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
+	writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
 	writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
 	writel(regs->sdram_config, &cstat->secure_emif_sdram_config);
 
Signature · 1 line
2.0.0.rc1
#3 lore raw

PATCH 3/5 board: ti: am43xx: add support for AM43xx Starter Kit

In reply to Felipe Balbi

AM43xx Starter Kit is a new board based on AM437x line of SoCs. Being a low-cost EVM and small size EVM are intended to provide an entry level development platform on a full fledged Hardware System.

---
 board/ti/am43xx/board.c      | 72 +++++++++++++++++++++++++++++++++++++++++++-
 board/ti/am43xx/board.h      |  5 +++
 include/configs/am43xx_evm.h |  2 ++
 3 files changed, 78 insertions(+), 1 deletion(-)
board/ti/am43xx/board.c +71 -1
index 6197076..b184c20 100644
@@ -217,6 +217,28 @@ const struct emif_regs ddr3_emif_regs_400Mhz = {
 	.emif_rd_wr_exec_thresh		= 0x00000405
 };
 
+static const struct emif_regs ddr3_sk_emif_regs_400Mhz = {
+	.sdram_config			= 0x638413b2,
+	.sdram_config2			= 0x00000000,
+	.ref_ctrl			= 0x00000c30,
+	.sdram_tim1			= 0xeaaad4db,
+	.sdram_tim2			= 0x266b7fda,
+	.sdram_tim3			= 0x107f8678,
+	.read_idle_ctrl			= 0x00050000,
+	.zq_config			= 0x50074be4,
+	.temp_alert_config		= 0x0,
+	.emif_ddr_phy_ctlr_1		= 0x0e084007,
+	.emif_ddr_ext_phy_ctrl_1	= 0x08020080,
+	.emif_ddr_ext_phy_ctrl_2	= 0x00700070,
+	.emif_ddr_ext_phy_ctrl_3	= 0x00700070,
+	.emif_ddr_ext_phy_ctrl_4	= 0x00700070,
+	.emif_ddr_ext_phy_ctrl_5	= 0x00700070,
+	.emif_rd_wr_lvl_rmp_win		= 0x0,
+	.emif_rd_wr_lvl_rmp_ctl		= 0x0,
+	.emif_rd_wr_lvl_ctl		= 0x0,
+	.emif_rd_wr_exec_thresh		= 0x00000405
+};
+
 const u32 ext_phy_ctrl_const_base_ddr3[] = {
 	0x00400040,
 	0x00350035,
@@ -240,6 +262,48 @@ const u32 ext_phy_ctrl_const_base_ddr3[] = {
 	0x08102040
 };
 
+static const u32 ext_phy_ctrl_const_base_ddr3_sk[] = {
+	/* first 5 are taken care by emif_regs */
+	0x00700070,
+
+	0x00350035,
+	0x00350035,
+	0x00350035,
+	0x00350035,
+	0x00350035,
+
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+
+	0x00150015,
+	0x00150015,
+	0x00150015,
+	0x00150015,
+	0x00150015,
+
+	0x00800080,
+	0x00800080,
+
+	0x40000000,
+
+	0x08102040,
+
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+};
+
 void emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size)
 {
 	if (board_is_eposevm()) {
@@ -248,6 +312,9 @@ void emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size)
 	} else if (board_is_gpevm()) {
 		*regs = ext_phy_ctrl_const_base_ddr3;
 		*size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3);
+	} else if (board_is_sk()) {
+		*regs = ext_phy_ctrl_const_base_ddr3_sk;
+		*size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3_sk);
 	}
 
 	return;
@@ -257,7 +324,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
 {
 	if (board_is_eposevm())
 		return &epos_evm_dpll_ddr;
-	else if (board_is_gpevm())
+	else if (board_is_gpevm() || board_is_sk())
 		return &gp_evm_dpll_ddr;
 
 	printf(" Board '%s' not supported\n", am43xx_board_name);
@@ -410,6 +477,9 @@ void sdram_init(void)
 		enable_vtt_regulator();
 		config_ddr(0, &ioregs_ddr3, NULL, NULL,
 			   &ddr3_emif_regs_400Mhz, 0);
+	} else if (board_is_sk()) {
+		config_ddr(400, &ioregs_ddr3, NULL, NULL,
+			   &ddr3_sk_emif_regs_400Mhz, 0);
 	}
 }
 #endif
board/ti/am43xx/board.h +5 -0
index 091162e..017047d 100644
@@ -47,6 +47,11 @@ static inline int board_is_gpevm(void)
 	return !strncmp(am43xx_board_name, "AM43__GP", HDR_NAME_LEN);
 }
 
+static inline int board_is_sk(void)
+{
+	return !strncmp(am43xx_board_name, "AM43__SK", HDR_NAME_LEN);
+}
+
 void enable_uart0_pin_mux(void);
 void enable_board_pin_mux(void);
 void enable_i2c0_pin_mux(void);
include/configs/am43xx_evm.h +2 -0
index 823cba6..974ce98 100644
@@ -226,6 +226,8 @@
 			"setenv fdtfile am43x-epos-evm.dtb; fi; " \
 		"if test $board_name = AM43__GP; then " \
 			"setenv fdtfile am437x-gp-evm.dtb; fi; " \
+		"if test $board_name = AM43__SK; then " \
+			"setenv fdtfile am437x-sk-evm.dtb; fi; " \
 		"if test $fdtfile = undefined; then " \
 			"echo WARNING: Could not determine device tree; fi; \0"
 
Signature · 1 line
2.0.0.rc1
#4 lore raw

PATCH 4/5 board: ti: am43xx: add AM437x SK PHY Address

In reply to Felipe Balbi

pass correct PHY Address when running on SK
so that we have working ethernet with this board
too.

---
 board/ti/am43xx/board.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
board/ti/am43xx/board.c +13 -8
index b184c20..054a452 100644
@@ -227,16 +227,16 @@ static const struct emif_regs ddr3_sk_emif_regs_400Mhz = {
 	.read_idle_ctrl			= 0x00050000,
 	.zq_config			= 0x50074be4,
 	.temp_alert_config		= 0x0,
-	.emif_ddr_phy_ctlr_1		= 0x0e084007,
+	.emif_ddr_phy_ctlr_1		= 0x0e084008,
 	.emif_ddr_ext_phy_ctrl_1	= 0x08020080,
-	.emif_ddr_ext_phy_ctrl_2	= 0x00700070,
-	.emif_ddr_ext_phy_ctrl_3	= 0x00700070,
-	.emif_ddr_ext_phy_ctrl_4	= 0x00700070,
-	.emif_ddr_ext_phy_ctrl_5	= 0x00700070,
+	.emif_ddr_ext_phy_ctrl_2	= 0x89,
+	.emif_ddr_ext_phy_ctrl_3	= 0x90,
+	.emif_ddr_ext_phy_ctrl_4	= 0x8e,
+	.emif_ddr_ext_phy_ctrl_5	= 0x8d,
 	.emif_rd_wr_lvl_rmp_win		= 0x0,
-	.emif_rd_wr_lvl_rmp_ctl		= 0x0,
-	.emif_rd_wr_lvl_ctl		= 0x0,
-	.emif_rd_wr_exec_thresh		= 0x00000405
+	.emif_rd_wr_lvl_rmp_ctl		= 0x00000000,
+	.emif_rd_wr_lvl_ctl		= 0x00000000,
+	.emif_rd_wr_exec_thresh		= 0x00000000,
 };
 
 const u32 ext_phy_ctrl_const_base_ddr3[] = {
@@ -594,6 +594,11 @@ int board_eth_init(bd_t *bis)
 		writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
 		cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
 		cpsw_slaves[0].phy_addr = 16;
+	} else if (board_is_sk()) {
+		writel(RGMII_MODE_ENABLE, &cdev->miisel);
+		cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII;
+		cpsw_slaves[0].phy_addr = 4;
+		cpsw_slaves[1].phy_addr = 5;
 	} else {
 		writel(RGMII_MODE_ENABLE, &cdev->miisel);
 		cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII;
Signature · 1 line
2.0.0.rc1
#5 lore raw

PATCH 4/5 board: ti: am43xx: add AM437x SK PHY Address

Hi Felipe,

board/ti/am43xx/board.c static const struct emif_regs

Quoted 15 lines · Felipe Balbi

pass correct PHY Address when running on SK
so that we have working ethernet with this board
too.

---
 board/ti/am43xx/board.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
board/ti/am43xx/board.c +0 -0
index b184c20..054a452 100644
@@ -227,16 +227,16 @@ static const struct emif_regs

ddr3_sk_emif_regs_400Mhz = {

Quoted 12 lines
board/ti/am43xx/board.c +3 -5
        .read_idle_ctrl                 = 0x00050000,
        .zq_config                      = 0x50074be4,
        .temp_alert_config              = 0x0,
-       .emif_ddr_phy_ctlr_1            = 0x0e084007,
+       .emif_ddr_phy_ctlr_1            = 0x0e084008,
        .emif_ddr_ext_phy_ctrl_1        = 0x08020080,
-       .emif_ddr_ext_phy_ctrl_2        = 0x00700070,
-       .emif_ddr_ext_phy_ctrl_3        = 0x00700070,
-       .emif_ddr_ext_phy_ctrl_4        = 0x00700070,
-       .emif_ddr_ext_phy_ctrl_5        = 0x00700070,
+       .emif_ddr_ext_phy_ctrl_2        = 0x89,
+       .emif_ddr_ext_phy_ctrl_3        = 0x90,

board/ti/am43xx/board.c static const struct emif_regs ddr3_sk_emif_regs_400Mhz = { · line 240

Quoted 10 lines
board/ti/am43xx/board.c +5 -3
+       .emif_ddr_ext_phy_ctrl_4        = 0x8e,
+       .emif_ddr_ext_phy_ctrl_5        = 0x8d,
        .emif_rd_wr_lvl_rmp_win         = 0x0,
-       .emif_rd_wr_lvl_rmp_ctl         = 0x0,
-       .emif_rd_wr_lvl_ctl             = 0x0,
-       .emif_rd_wr_exec_thresh         = 0x00000405
+       .emif_rd_wr_lvl_rmp_ctl         = 0x00000000,
+       .emif_rd_wr_lvl_ctl             = 0x00000000,
+       .emif_rd_wr_exec_thresh         = 0x00000000,
 };

Merge this hunk with the previous patch in the series?

#6 lore raw

PATCH 4/5 board: ti: am43xx: add AM437x SK PHY Address

Hi,

Quoted 42 lines · Vaibhav Bedia

Hi Felipe,

board/ti/am43xx/board.c static const struct emif_regs

Quoted 15 lines · Felipe Balbi

pass correct PHY Address when running on SK
so that we have working ethernet with this board
too.

---
 board/ti/am43xx/board.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
board/ti/am43xx/board.c +0 -0
index b184c20..054a452 100644
@@ -227,16 +227,16 @@ static const struct emif_regs

ddr3_sk_emif_regs_400Mhz = {

Quoted 12 lines
board/ti/am43xx/board.c +3 -5
        .read_idle_ctrl                 = 0x00050000,
        .zq_config                      = 0x50074be4,
        .temp_alert_config              = 0x0,
-       .emif_ddr_phy_ctlr_1            = 0x0e084007,
+       .emif_ddr_phy_ctlr_1            = 0x0e084008,
        .emif_ddr_ext_phy_ctrl_1        = 0x08020080,
-       .emif_ddr_ext_phy_ctrl_2        = 0x00700070,
-       .emif_ddr_ext_phy_ctrl_3        = 0x00700070,
-       .emif_ddr_ext_phy_ctrl_4        = 0x00700070,
-       .emif_ddr_ext_phy_ctrl_5        = 0x00700070,
+       .emif_ddr_ext_phy_ctrl_2        = 0x89,
+       .emif_ddr_ext_phy_ctrl_3        = 0x90,

board/ti/am43xx/board.c static const struct emif_regs ddr3_sk_emif_regs_400Mhz = { · line 240

Quoted 10 lines
board/ti/am43xx/board.c +5 -3
+       .emif_ddr_ext_phy_ctrl_4        = 0x8e,
+       .emif_ddr_ext_phy_ctrl_5        = 0x8d,
        .emif_rd_wr_lvl_rmp_win         = 0x0,
-       .emif_rd_wr_lvl_rmp_ctl         = 0x0,
-       .emif_rd_wr_lvl_ctl             = 0x0,
-       .emif_rd_wr_exec_thresh         = 0x00000405
+       .emif_rd_wr_lvl_rmp_ctl         = 0x00000000,
+       .emif_rd_wr_lvl_ctl             = 0x00000000,
+       .emif_rd_wr_exec_thresh         = 0x00000000,
 };
Quoted 1 line

Merge this hunk with the previous patch in the series?

oops :-) bad rebase, I guess.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140610/91514b7c/attachment.pgp>
#7 lore raw

PATCH 5/5 board: ti: am43xx: enable QSPI and Gbit Ethernet on AM437x SK

In reply to Felipe Balbi

AM437x Starter Kit has a qspi flash and gbit ethernet support. By muxing those signals, we can use those interfaces from u-boot.

---
 board/ti/am43xx/mux.c | 3 +++
 1 file changed, 3 insertions(+)
board/ti/am43xx/mux.c +3 -0
index 77c53d2..50967e1 100644
@@ -97,6 +97,9 @@ void enable_board_pin_mux(void)
 	if (board_is_gpevm()) {
 		configure_module_pin_mux(gpio5_7_pin_mux);
 		configure_module_pin_mux(rgmii1_pin_mux);
+	} else if (board_is_sk()) {
+		configure_module_pin_mux(rgmii1_pin_mux);
+		configure_module_pin_mux(qspi_pin_mux);
 	} else if (board_is_eposevm()) {
 		configure_module_pin_mux(rmii1_pin_mux);
 		configure_module_pin_mux(qspi_pin_mux);
Signature · 1 line
2.0.0.rc1