Skip to contentSkip to conversation

Add support for AM43xx Starter Kit

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

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for AM43xx Starter Kit

Hi,

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

Changes since v1:
- fix a bad rebase pointed to by Vaibhav.

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 v2 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
#3 lore raw

PATCH v2 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
#5 lore raw

PATCH v2 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..6379cef 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		= 0x0e084008,
+	.emif_ddr_ext_phy_ctrl_1	= 0x08020080,
+	.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		= 0x00000000,
+	.emif_rd_wr_lvl_ctl		= 0x00000000,
+	.emif_rd_wr_exec_thresh		= 0x00000000,
+};
+
 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
#7 lore raw

PATCH v2 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 | 5 +++++
 1 file changed, 5 insertions(+)
board/ti/am43xx/board.c +5 -0
index 6379cef..054a452 100644
@@ -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
#9 lore raw

PATCH v2 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
#11 lore raw

v2 cover Add support for AM43xx Starter Kit

In reply to Felipe Balbi

Hi,

Quoted 7 lines · Felipe Balbi

Hi,

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

Changes since v1:
- fix a bad rebase pointed to by Vaibhav.

Quoted 6 lines

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

ping on this series. Do you need anything else from me ?

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/20140616/36f99822/attachment.pgp>
#2 lore raw

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

In reply to Felipe Balbi
Quoted 6 lines · Felipe Balbi

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.

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/20140619/c63f816a/attachment.pgp>
#4 lore raw

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

In reply to Felipe Balbi
Quoted 1 line · Felipe Balbi

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/20140619/ada6cd94/attachment.pgp>
#6 lore raw

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

In reply to Felipe Balbi
Quoted 7 lines · 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.

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/20140619/0bbc723a/attachment.pgp>
#8 lore raw

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

In reply to Felipe Balbi
Quoted 5 lines · Felipe Balbi

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

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/20140619/31978bb7/attachment.pgp>
#10 lore raw

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

In reply to Felipe Balbi
Quoted 5 lines · 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.

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/20140619/b9ed4da9/attachment.pgp>