Skip to contentSkip to conversation

drivers: net: cpsw: add support to have phy address from cpsw platform data

PATCH New Tom Rini 2 participants 20 messages Feb 18, 2014 – Mar 4, 2014

Subsystems (2)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/10 drivers: net: cpsw: add support to have phy address from cpsw platform data

From: Mugunthan V N <[email protected]>

Some platforms like AM437x have different EVMs with different phy addresses, so this patch adds support for passing phy address via cpsw plaform data. Also renamed phy_id to phy_addr so better understanding of the code.

[trini: Update am335x_igep0033 pcm051_rev3 pcm051_rev1 cm_t335 boards]
---
 board/compulab/cm_t335/cm_t335.c  |    2 +-
 board/isee/igep0033/board.c       |    2 +-
 board/phytec/pcm051/board.c       |    4 ++--
 board/siemens/dxr2/board.c        |    2 +-
 board/siemens/pxm2/board.c        |    4 ++--
 board/siemens/rut/board.c         |    4 ++--
 board/ti/am335x/board.c           |    4 ++--
 board/ti/dra7xx/evm.c             |    4 ++--
 board/ti/ti814x/evm.c             |    4 ++--
 drivers/net/cpsw.c                |    4 ++--
 include/configs/am335x_evm.h      |    1 -
 include/configs/am335x_igep0033.h |    1 -
 include/configs/cm_t335.h         |    1 -
 include/configs/dra7xx_evm.h      |    1 -
 include/configs/dxr2.h            |    1 -
 include/configs/pcm051.h          |    1 -
 include/configs/pxm2.h            |    1 -
 include/configs/rut.h             |    1 -
 include/configs/ti814x_evm.h      |    1 -
 include/cpsw.h                    |    2 +-
 20 files changed, 18 insertions(+), 27 deletions(-)
board/compulab/cm_t335/cm_t335.c +1 -1
index 01019e8..9583149 100644
@@ -47,7 +47,7 @@ static void cpsw_control(int enabled)
 static struct cpsw_slave_data cpsw_slave = {
 	.slave_reg_ofs	= 0x208,
 	.sliver_reg_ofs	= 0xd80,
-	.phy_id		= 0,
+	.phy_addr	= 0,
 	.phy_if		= PHY_INTERFACE_MODE_RGMII,
 };
 
board/isee/igep0033/board.c +1 -1
index 089a835..9f8fcf2 100644
@@ -116,7 +116,7 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x208,
 		.sliver_reg_ofs	= 0xd80,
-		.phy_id		= 0,
+		.phy_addr	= 0,
 		.phy_if		= PHY_INTERFACE_MODE_RMII,
 	},
 };
board/phytec/pcm051/board.c +2 -2
index 7e5e07f..1071662 100644
@@ -176,13 +176,13 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x208,
 		.sliver_reg_ofs	= 0xd80,
-		.phy_id		= 0,
+		.phy_addr	= 0,
 		.phy_if		= PHY_INTERFACE_MODE_RGMII,
 	},
 	{
 		.slave_reg_ofs	= 0x308,
 		.sliver_reg_ofs	= 0xdc0,
-		.phy_id		= 1,
+		.phy_addr	= 1,
 		.phy_if		= PHY_INTERFACE_MODE_RGMII,
 	},
 };
board/siemens/dxr2/board.c +1 -1
index 6c316fa..9b8f538 100644
@@ -198,7 +198,7 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x208,
 		.sliver_reg_ofs	= 0xd80,
-		.phy_id		= 0,
+		.phy_addr	= 0,
 		.phy_if		= PHY_INTERFACE_MODE_MII,
 	},
 };
board/siemens/pxm2/board.c +2 -2
index ef3d6cc..98083d5 100644
@@ -181,13 +181,13 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x208,
 		.sliver_reg_ofs	= 0xd80,
-		.phy_id		= 0,
+		.phy_addr	= 0,
 		.phy_if		= PHY_INTERFACE_MODE_RMII,
 	},
 	{
 		.slave_reg_ofs	= 0x308,
 		.sliver_reg_ofs	= 0xdc0,
-		.phy_id		= 1,
+		.phy_addr	= 1,
 		.phy_if		= PHY_INTERFACE_MODE_RMII,
 	},
 };
board/siemens/rut/board.c +2 -2
index 25ab54d..e0ada3f 100644
@@ -143,13 +143,13 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x208,
 		.sliver_reg_ofs	= 0xd80,
-		.phy_id		= 1,
+		.phy_addr	= 1,
 		.phy_if		= PHY_INTERFACE_MODE_RMII,
 	},
 	{
 		.slave_reg_ofs	= 0x308,
 		.sliver_reg_ofs	= 0xdc0,
-		.phy_id		= 0,
+		.phy_addr	= 0,
 		.phy_if		= PHY_INTERFACE_MODE_RMII,
 	},
 };
board/ti/am335x/board.c +2 -2
index 5721768..862f966 100644
@@ -544,12 +544,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x208,
 		.sliver_reg_ofs	= 0xd80,
-		.phy_id		= 0,
+		.phy_addr	= 0,
 	},
 	{
 		.slave_reg_ofs	= 0x308,
 		.sliver_reg_ofs	= 0xdc0,
-		.phy_id		= 1,
+		.phy_addr	= 1,
 	},
 };
 
board/ti/dra7xx/evm.c +2 -2
index 1b60b8f..9d72d2e 100644
@@ -148,12 +148,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x208,
 		.sliver_reg_ofs	= 0xd80,
-		.phy_id		= 0,
+		.phy_addr	= 2,
 	},
 	{
 		.slave_reg_ofs	= 0x308,
 		.sliver_reg_ofs	= 0xdc0,
-		.phy_id		= 1,
+		.phy_addr	= 3,
 	},
 };
 
board/ti/ti814x/evm.c +2 -2
index 140ad71..54b3dfb 100644
@@ -132,12 +132,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 	{
 		.slave_reg_ofs	= 0x50,
 		.sliver_reg_ofs	= 0x700,
-		.phy_id		= 1,
+		.phy_addr	= 1,
 	},
 	{
 		.slave_reg_ofs	= 0x90,
 		.sliver_reg_ofs	= 0x740,
-		.phy_id		= 0,
+		.phy_addr	= 0,
 	},
 };
 
drivers/net/cpsw.c +2 -2
index 50167aa..dd6c26a 100644
@@ -656,7 +656,7 @@ static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv)
 
 	cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << slave_port);
 
-	priv->phy_mask |= 1 << slave->data->phy_id;
+	priv->phy_mask |= 1 << slave->data->phy_addr;
 }
 
 static struct cpdma_desc *cpdma_desc_alloc(struct cpsw_priv *priv)
@@ -948,7 +948,7 @@ static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave)
 			SUPPORTED_1000baseT_Full);
 
 	phydev = phy_connect(priv->bus,
-			CONFIG_PHY_ADDR,
+			slave->data->phy_addr,
 			dev,
 			slave->data->phy_if);
 
include/configs/am335x_evm.h +0 -1
index 73a9adb..c92e6ae 100644
@@ -385,7 +385,6 @@
 /* Network. */
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
-#define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_SMSC
 
 /* NAND support */
include/configs/am335x_igep0033.h +0 -1
index 115d1b3..e72ee05 100644
@@ -181,7 +181,6 @@
 #define CONFIG_NET_RETRY_COUNT         10
 #define CONFIG_NET_MULTI
 #define CONFIG_PHYLIB
-#define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_SMSC
 
 /* NAND support */
include/configs/cm_t335.h +0 -1
index 56e9a8e..26b615b 100644
@@ -114,7 +114,6 @@
 /* Network. */
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
-#define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_ATHEROS
 
 /* NAND support */
include/configs/dra7xx_evm.h +0 -1
index 86574c8..72c30c2 100644
@@ -51,7 +51,6 @@
 #define CONFIG_MII			/* Required in net/eth.c */
 #define CONFIG_PHY_GIGE			/* per-board part of CPSW */
 #define CONFIG_PHYLIB
-#define CONFIG_PHY_ADDR			2
 
 /* SPI */
 #undef	CONFIG_OMAP3_SPI
include/configs/dxr2.h +0 -1
index 1e42f5c..e95d74c 100644
@@ -49,7 +49,6 @@
 
 #undef CONFIG_MII
 #undef CONFIG_PHY_GIGE
-#define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_SMSC
 
 #define CONFIG_FACTORYSET
include/configs/pcm051.h +0 -1
index 6f41ee7..9af3efd 100644
@@ -297,7 +297,6 @@
 #define CONFIG_NET_MULTI
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
-#define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_SMSC
 
 #endif	/* ! __CONFIG_PCM051_H */
include/configs/pxm2.h +0 -1
index 7722f7b..6276d43 100644
@@ -44,7 +44,6 @@
 #undef CONFIG_SPL_NET_VCI_STRING
 #undef CONFIG_SPL_ETH_SUPPORT
 
-#define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_ATHEROS
 
 #define CONFIG_FACTORYSET
include/configs/rut.h +0 -1
index d4519f9..6bddede 100644
@@ -41,7 +41,6 @@
 #undef CONFIG_SPL_NET_VCI_STRING
 #undef CONFIG_SPL_ETH_SUPPORT
 
-#define CONFIG_PHY_ADDR			1
 #define CONFIG_PHY_NATSEMI
 
 #define CONFIG_FACTORYSET
include/configs/ti814x_evm.h +0 -1
index ba16b1c..b51400c 100644
@@ -233,7 +233,6 @@
 #define CONFIG_NET_MULTI
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
-#define CONFIG_PHY_ADDR			1
 #define CONFIG_PHY_ET1011C
 #define CONFIG_PHY_ET1011C_TX_CLK_FIX
 
include/cpsw.h +1 -1
index 743cb96..a73843d 100644
@@ -19,7 +19,7 @@
 struct cpsw_slave_data {
 	u32		slave_reg_ofs;
 	u32		sliver_reg_ofs;
-	int		phy_id;
+	int		phy_addr;
 	int		phy_if;
 };
 
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 2/10 ARM: AM43xx: clocks: Enable CPGMAC clock control

From: Mugunthan V N <[email protected]>

Enable CPGMAC clock control for AM43xx to use ethernet in U-Boot

---
 arch/arm/cpu/armv7/am33xx/clock_am43xx.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/cpu/armv7/am33xx/clock_am43xx.c +1 -0
index 440cf8b..f0ef366 100644
@@ -97,6 +97,7 @@ void enable_basic_clocks(void)
 		&cmper->gpio4clkctrl,
 		&cmper->gpio5clkctrl,
 		&cmper->i2c1clkctrl,
+		&cmper->cpgmac0clkctrl,
 		&cmper->emiffwclkctrl,
 		&cmper->emifclkctrl,
 		&cmper->otfaemifclkctrl,
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/10 ARM: AM43xx: clocks: Enable CPGMAC clock control

Quoted 5 lines · Tom Rini

From: Mugunthan V N <[email protected]>

Enable CPGMAC clock control for AM43xx to use ethernet in 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/20140304/18835800/attachment.pgp>
author
#3 lore raw

PATCH 3/10 ARM: AM43xx: Add CPSW support to AM43xx EPOS and GP EVM

In reply to Tom Rini

From: Mugunthan V N <[email protected]>

Adding support for CPSW to AM43xx EPOS nad GP EVM which is connected to RMII and RGMII phy respectively and enable cpsw in config.

---
 board/ti/am43xx/board.c      |  100 ++++++++++++++++++++++++++++++++++++++++++
 board/ti/am43xx/mux.c        |   41 ++++++++++++++++-
 include/configs/am43xx_evm.h |   20 +++++++++
 3 files changed, 160 insertions(+), 1 deletion(-)
board/ti/am43xx/board.c +100 -0
index 95fd137..0c9f0ef 100644
@@ -19,9 +19,15 @@
 #include <asm/arch/gpio.h>
 #include <asm/emif.h>
 #include "board.h"
+#include <miiphy.h>
+#include <cpsw.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifndef CONFIG_SPL_BUILD
+static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+#endif
+
 /*
  * Read header information from EEPROM into global structure.
  */
@@ -402,3 +408,97 @@ int board_late_init(void)
 	return 0;
 }
 #endif
+
+#ifdef CONFIG_DRIVER_TI_CPSW
+
+static void cpsw_control(int enabled)
+{
+	/* Additional controls can be added here */
+	return;
+}
+
+static struct cpsw_slave_data cpsw_slaves[] = {
+	{
+		.slave_reg_ofs	= 0x208,
+		.sliver_reg_ofs	= 0xd80,
+		.phy_addr	= 16,
+	},
+	{
+		.slave_reg_ofs	= 0x308,
+		.sliver_reg_ofs	= 0xdc0,
+		.phy_addr	= 1,
+	},
+};
+
+static struct cpsw_platform_data cpsw_data = {
+	.mdio_base		= CPSW_MDIO_BASE,
+	.cpsw_base		= CPSW_BASE,
+	.mdio_div		= 0xff,
+	.channels		= 8,
+	.cpdma_reg_ofs		= 0x800,
+	.slaves			= 1,
+	.slave_data		= cpsw_slaves,
+	.ale_reg_ofs		= 0xd00,
+	.ale_entries		= 1024,
+	.host_port_reg_ofs	= 0x108,
+	.hw_stats_reg_ofs	= 0x900,
+	.bd_ram_ofs		= 0x2000,
+	.mac_control		= (1 << 5),
+	.control		= cpsw_control,
+	.host_port_num		= 0,
+	.version		= CPSW_CTRL_VERSION_2,
+};
+
+int board_eth_init(bd_t *bis)
+{
+	int rv;
+	uint8_t mac_addr[6];
+	uint32_t mac_hi, mac_lo;
+
+	/* try reading mac address from efuse */
+	mac_lo = readl(&cdev->macid0l);
+	mac_hi = readl(&cdev->macid0h);
+	mac_addr[0] = mac_hi & 0xFF;
+	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
+	mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
+	mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
+	mac_addr[4] = mac_lo & 0xFF;
+	mac_addr[5] = (mac_lo & 0xFF00) >> 8;
+
+	if (!getenv("ethaddr")) {
+		puts("<ethaddr> not set. Validating first E-fuse MAC\n");
+		if (is_valid_ether_addr(mac_addr))
+			eth_setenv_enetaddr("ethaddr", mac_addr);
+	}
+
+	mac_lo = readl(&cdev->macid1l);
+	mac_hi = readl(&cdev->macid1h);
+	mac_addr[0] = mac_hi & 0xFF;
+	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
+	mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
+	mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
+	mac_addr[4] = mac_lo & 0xFF;
+	mac_addr[5] = (mac_lo & 0xFF00) >> 8;
+
+	if (!getenv("eth1addr")) {
+		if (is_valid_ether_addr(mac_addr))
+			eth_setenv_enetaddr("eth1addr", mac_addr);
+	}
+
+	if (board_is_eposevm()) {
+		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 {
+		writel(RGMII_MODE_ENABLE, &cdev->miisel);
+		cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII;
+		cpsw_slaves[0].phy_addr = 0;
+	}
+
+	rv = cpsw_register(&cpsw_data);
+	if (rv < 0)
+		printf("Error %d registering CPSW switch\n", rv);
+
+	return rv;
+}
+#endif
board/ti/am43xx/mux.c +40 -1

55 lines not on this page · raw message

include/configs/am43xx_evm.h +20 -0
index d3c4756..4476af5 100644
@@ -175,5 +175,25 @@
 	"run mmcboot;" \
 	"run usbboot;"
 
+/* CPSW Ethernet */
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_MII
+#define CONFIG_DRIVER_TI_CPSW
+#define CONFIG_MII
+#define CONFIG_BOOTP_DEFAULT
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_NET_RETRY_COUNT		10
+#define CONFIG_NET_MULTI
+#define CONFIG_PHY_GIGE
+#define CONFIG_PHYLIB
+#define CONFIG_SYS_RX_ETH_BUFFER	64
+#define CONFIG_PHY_ADDR			16
+
 #endif
 #endif	/* __CONFIG_AM43XX_EVM_H */
Signature · 1 line
1.7.9.5
author
#4 lore raw

PATCH 3/10 ARM: AM43xx: Add CPSW support to AM43xx EPOS and GP EVM

Quoted 7 lines · Tom Rini

From: Mugunthan V N <[email protected]>

Adding support for CPSW to AM43xx EPOS nad GP EVM which is connected to RMII and RGMII phy respectively and enable cpsw in config.

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/20140304/7829afca/attachment.pgp>
author
#5 lore raw

PATCH 4/10 ARM: AM335x: add support for reading cpsw 2nd mac address from efuse

In reply to Tom Rini

From: Mugunthan V N <[email protected]>

Adding support for reading cpsw 2nd mac address from efuse and pass it to kernel via dtb which will be used in dual emac mode of cpsw. Also adding mii command support to am335x common config.

---
 board/ti/am335x/board.c            |   15 +++++++++++++++
 include/configs/ti_am335x_common.h |    1 +
 2 files changed, 16 insertions(+)
board/ti/am335x/board.c +15 -0
index 862f966..7609a18 100644
@@ -602,6 +602,21 @@ int board_eth_init(bd_t *bis)
 	}
 
 #ifdef CONFIG_DRIVER_TI_CPSW
+
+	mac_lo = readl(&cdev->macid1l);
+	mac_hi = readl(&cdev->macid1h);
+	mac_addr[0] = mac_hi & 0xFF;
+	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
+	mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
+	mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
+	mac_addr[4] = mac_lo & 0xFF;
+	mac_addr[5] = (mac_lo & 0xFF00) >> 8;
+
+	if (!getenv("eth1addr")) {
+		if (is_valid_ether_addr(mac_addr))
+			eth_setenv_enetaddr("eth1addr", mac_addr);
+	}
+
 	if (read_eeprom(&header) < 0)
 		puts("Could not get board ID.\n");
 
include/configs/ti_am335x_common.h +1 -0
index 91f97dd..b59c7fe 100644
@@ -31,6 +31,7 @@
 /* Network defines. */
 #define CONFIG_CMD_NET			/* 'bootp' and 'tftp' */
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_MII
 #define CONFIG_BOOTP_DNS		/* Configurable parts of CMD_DHCP */
 #define CONFIG_BOOTP_DNS2
 #define CONFIG_BOOTP_SEND_HOSTNAME
Signature · 1 line
1.7.9.5
author
#6 lore raw

PATCH 4/10 ARM: AM335x: add support for reading cpsw 2nd mac address from efuse

Quoted 8 lines · Tom Rini

From: Mugunthan V N <[email protected]>

Adding support for reading cpsw 2nd mac address from efuse and pass it to kernel via dtb which will be used in dual emac mode of cpsw. Also adding mii command support to am335x common config.

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/20140304/899ab58c/attachment.pgp>
author
#7 lore raw

PATCH 5/10 ARM: DRA7xx: add support for reading cpsw 2nd mac from efuse

In reply to Tom Rini

From: Mugunthan V N <[email protected]>

Adding support for reading cpsw 2nd mac address from efuse and pass it to kernel via dtb which will be used in dual emac mode of cpsw. Also correct the bit masking of mac id read from the efuse.

---
 board/ti/dra7xx/evm.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
board/ti/dra7xx/evm.c +15 -0
index 9d72d2e..fd29624 100644
@@ -215,6 +215,21 @@ int board_eth_init(bd_t *bis)
 		if (is_valid_ether_addr(mac_addr))
 			eth_setenv_enetaddr("ethaddr", mac_addr);
 	}
+
+	mac_lo = readl((*ctrl)->control_core_mac_id_1_lo);
+	mac_hi = readl((*ctrl)->control_core_mac_id_1_hi);
+	mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
+	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
+	mac_addr[2] = mac_hi & 0xFF;
+	mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
+	mac_addr[4] = (mac_lo & 0xFF00) >> 8;
+	mac_addr[5] = mac_lo & 0xFF;
+
+	if (!getenv("eth1addr")) {
+		if (is_valid_ether_addr(mac_addr))
+			eth_setenv_enetaddr("eth1addr", mac_addr);
+	}
+
 	ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33);
 	ctrl_val |= 0x22;
 	writel(ctrl_val, (*ctrl)->control_core_control_io1);
Signature · 1 line
1.7.9.5
author
#8 lore raw

PATCH 5/10 ARM: DRA7xx: add support for reading cpsw 2nd mac from efuse

Quoted 8 lines · Tom Rini

From: Mugunthan V N <[email protected]>

Adding support for reading cpsw 2nd mac address from efuse and pass it to kernel via dtb which will be used in dual emac mode of cpsw. Also correct the bit masking of mac id read from the efuse.

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/20140304/23601278/attachment.pgp>
author
#9 lore raw

PATCH 6/10 ARM: AM4372: Update EMIF registers for DDR3

In reply to Tom Rini

From: Lokesh Vutla <[email protected]>

Updating EMIF_PHY_CTRL and adding EMIF_READ_WRITE_EXECUTION_THRESHOLD registers.
In EMIF_PHY_CTRL:
Updating [4:0]READ_LATENCY to 8, because at higher frequencies like 400MHz the read latency expected will be CL+3 as per tests from HW folks.
Clearing [19]PHY_DIS_CALIB_RST bit as this is used onl for debug purpose. With out this resume is not working(Still waiting for PHY team to come back for better explanation).

---
 board/ti/am43xx/board.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/ti/am43xx/board.c +1 -1
index 0c9f0ef..7a28063 100644
@@ -206,7 +206,7 @@ const struct emif_regs ddr3_emif_regs_400Mhz = {
 	.read_idle_ctrl			= 0x00050000,
 	.zq_config			= 0x50074BE4,
 	.temp_alert_config		= 0x0,
-	.emif_ddr_phy_ctlr_1		= 0x0E084008,
+	.emif_ddr_phy_ctlr_1		= 0x0E004008,
 	.emif_ddr_ext_phy_ctrl_1	= 0x08020080,
 	.emif_ddr_ext_phy_ctrl_2	= 0x00400040,
 	.emif_ddr_ext_phy_ctrl_3	= 0x00400040,
Signature · 1 line
1.7.9.5
author
#10 lore raw

PATCH 6/10 ARM: AM4372: Update EMIF registers for DDR3

Quoted 12 lines · Tom Rini

From: Lokesh Vutla <[email protected]>

Updating EMIF_PHY_CTRL and adding EMIF_READ_WRITE_EXECUTION_THRESHOLD registers.
In EMIF_PHY_CTRL:
Updating [4:0]READ_LATENCY to 8, because at higher frequencies like 400MHz the read latency expected will be CL+3 as per tests from HW folks.
Clearing [19]PHY_DIS_CALIB_RST bit as this is used onl for debug purpose. With out this resume is not working(Still waiting for PHY team to come back for better explanation).

Quoted 1 line

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/20140304/b0670d58/attachment.pgp>
author
#11 lore raw

PATCH 7/10 ARM: AM43xx: Add Ethernet boot support to SPL

In reply to Tom Rini

From: Mugunthan V N <[email protected]>

Add Ethernet Boot support to SPL

---
 board/ti/am43xx/board.c      |    2 --
 include/configs/am43xx_evm.h |   10 ++++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
board/ti/am43xx/board.c +0 -2
index 7a28063..d744977 100644
@@ -24,9 +24,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_SPL_BUILD
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
-#endif
 
 /*
  * Read header information from EEPROM into global structure.
include/configs/am43xx_evm.h +8 -2
index 4476af5..dd70d39 100644
@@ -175,6 +175,8 @@
 	"run mmcboot;" \
 	"run usbboot;"
 
+#endif
+
 /* CPSW Ethernet */
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
@@ -192,8 +194,12 @@
 #define CONFIG_NET_MULTI
 #define CONFIG_PHY_GIGE
 #define CONFIG_PHYLIB
+
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_SPL_NET_VCI_STRING	"AM43xx U-Boot SPL"
+
+#define CONFIG_SPL_ETH_SUPPORT
+#define CONFIG_SPL_NET_SUPPORT
 #define CONFIG_SYS_RX_ETH_BUFFER	64
-#define CONFIG_PHY_ADDR			16
 
-#endif
 #endif	/* __CONFIG_AM43XX_EVM_H */
Signature · 1 line
1.7.9.5
author
#12 lore raw

PATCH 7/10 ARM: AM43xx: Add Ethernet boot support to SPL

Quoted 6 lines · Tom Rini

From: Mugunthan V N <[email protected]>

Add Ethernet Boot support to SPL

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/20140304/666a34fa/attachment.pgp>
author
#13 lore raw

PATCH 8/10 ARM: AM43xx: EMIF: configure self-refresh entry delay

In reply to Tom Rini

From: Dave Gerlach <[email protected]>

Per a suggestion from the hardware team, program the emif_pwr_mgmt_ctrl and emif_pwr_mgmt_ctrl_shdw registers within the EMIF to hold the desired delay in cycles that the EMIF waits without an access to enter self-refresh, in this case 8192 cycles. With this, code desiring to enter self refresh only has to toggle one bit to enable it.

---
 arch/arm/cpu/armv7/am33xx/ddr.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/am33xx/ddr.c +2 -2
index d05e666..4173a10 100644
@@ -80,8 +80,8 @@ static void configure_mr(int nr, u32 cs)
  */
 void config_sdram_emif4d5(const struct emif_regs *regs, int nr)
 {
-	writel(0x0, &emif_reg[nr]->emif_pwr_mgmt_ctrl);
-	writel(0x0, &emif_reg[nr]->emif_pwr_mgmt_ctrl_shdw);
+	writel(0xA0, &emif_reg[nr]->emif_pwr_mgmt_ctrl);
+	writel(0xA0, &emif_reg[nr]->emif_pwr_mgmt_ctrl_shdw);
 	writel(0x1, &emif_reg[nr]->emif_iodft_tlgc);
 	writel(regs->zq_config, &emif_reg[nr]->emif_zq_config);
 
Signature · 1 line
1.7.9.5
author
#14 lore raw

PATCH 8/10 ARM: AM43xx: EMIF: configure self-refresh entry delay

Quoted 9 lines · Tom Rini

From: Dave Gerlach <[email protected]>

Per a suggestion from the hardware team, program the emif_pwr_mgmt_ctrl and emif_pwr_mgmt_ctrl_shdw registers within the EMIF to hold the desired delay in cycles that the EMIF waits without an access to enter self-refresh, in this case 8192 cycles. With this, code desiring to enter self refresh only has to toggle one bit to enable it.

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/20140304/243b28f1/attachment.pgp>
author
#15 lore raw

PATCH 9/10 ARM: AM43xx: Write sdram_config to secure_emif_sdram_config

In reply to Tom Rini

From: Dave Gerlach <[email protected]>

The register secure_emif_sdram_config in control module is copied to the EMIF sdram_config register when it is coming out of DeepSleep0 in order to ensure that the EMIF comes up for the correct type of DDR. Without this, resume can hang from within the kernel.

---
 arch/arm/cpu/armv7/am33xx/ddr.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/cpu/armv7/am33xx/ddr.c +1 -0
index 4173a10..9a625c4 100644
@@ -96,6 +96,7 @@ void config_sdram_emif4d5(const struct emif_regs *regs, int nr)
 
 	writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
 	writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
+	writel(regs->sdram_config, &cstat->secure_emif_sdram_config);
 
 	if (emif_sdram_type() == EMIF_SDRAM_TYPE_LPDDR2) {
 		configure_mr(nr, 0);
Signature · 1 line
1.7.9.5
author
#16 lore raw

PATCH 9/10 ARM: AM43xx: Write sdram_config to secure_emif_sdram_config

Quoted 8 lines · Tom Rini

From: Dave Gerlach <[email protected]>

The register secure_emif_sdram_config in control module is copied to the EMIF sdram_config register when it is coming out of DeepSleep0 in order to ensure that the EMIF comes up for the correct type of DDR. Without this, resume can hang from within the kernel.

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/20140304/c8e548fe/attachment.pgp>
author
#17 lore raw

PATCH 10/10 ARM: AM43xx: Change DDR3 Reset Value

In reply to Tom Rini

From: Dave Gerlach <[email protected]>

The bit DDR3_RST_DEF_VAL inside CTRL_DDR_IO represents the default value of the ddr reset value for DDR3 before the EMIF takes over. We must have this bit set high so that on exit from DeepSleep0 within the kernel the reset line has the proper value.

---
 arch/arm/cpu/armv7/am33xx/emif4.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/am33xx/emif4.c +1 -1
index d28fceb..3e39752 100644
@@ -113,7 +113,7 @@ void config_ddr(unsigned int pll, const struct ctrl_ioregs *ioregs,
 	writel(readl(&cm_device->cm_dll_ctrl) & ~0x1, &cm_device->cm_dll_ctrl);
 	while ((readl(&cm_device->cm_dll_ctrl) && CM_DLL_READYST) == 0)
 		;
-	writel(0x0, &ddrctrl->ddrioctrl);
+	writel(0x80000000, &ddrctrl->ddrioctrl);
 
 	config_io_ctrl(ioregs);
 
Signature · 1 line
1.7.9.5
author
#18 lore raw

PATCH 10/10 ARM: AM43xx: Change DDR3 Reset Value

Quoted 8 lines · Tom Rini

From: Dave Gerlach <[email protected]>

The bit DDR3_RST_DEF_VAL inside CTRL_DDR_IO represents the default value of the ddr reset value for DDR3 before the EMIF takes over. We must have this bit set high so that on exit from DeepSleep0 within the kernel the reset line has the proper value.

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/20140304/e1bbdcfe/attachment.pgp>
#19 lore raw

PATCH 1/10 drivers: net: cpsw: add support to have phy address from cpsw platform data

In reply to Tom Rini
Quoted 11 lines · Tom Rini

From: Mugunthan V N <[email protected]>

Some platforms like AM437x have different EVMs with different phy addresses, so this patch adds support for passing phy address via cpsw plaform data. Also renamed phy_id to phy_addr so better understanding of the code.

[trini: Update BuR am335x_igep0033 pcm051_rev3 pcm051_rev1 cm_t335 pengwyn boards]

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

Hannes, can you check the BuR boards please? I'm fairly sure I did the conversion correctly here.

Signature · 1 line
Tom