Add netcp networking support on K2G ICE EVM
Subsystems (4)
v3 cover Add netcp networking support on K2G ICE EVM
This patch series add networking capability to K2G ICE EVM based on netcp driver. Networking function has been tested using the latest master branch from u-boot repo. Following boot mode has been tested for networking.
Net boot (tftp images over ethernet interface and boot kernel)
log at https://pastebin.ubuntu.com/p/b3nyCXPhWc/
MMC boot: (load images from boot folder of rootfs and boot kernel)
log at https://pastebin.ubuntu.com/p/FWycmKd9KB/
Used Linux upstream linux kernel version 4.19.9 for the tests.
Please review and apply if this looks good.
Thanks
Revision history:
v3: Addressed comment to use KConfig for enable TI PHY driver and also
netcp driver comment to use proper function as in cpsw driver. Rebased to latest on master branch.
v2: Collected Reviewed-by for patch 1 and 2. Rebased to latest
on master
Murali Karicheri (7):
ARM: k2g-ice: Add pinmux support for rgmii interface
ARM: k2g-gp-evm: update to rgmii pinmux configuration
net: netcp: add support for phy with rgmii ids
ARM: k2g: add a workaround to reset the phy
ARM: dts: k2g-evm: remove unused phy-mode property from phy node
k2g: config enable ti phy dp83867 for k2g
ARM: dts: k2g-ice: add dt node for netcp
arch/arm/dts/keystone-k2g-evm.dts | 1 - arch/arm/dts/keystone-k2g-ice.dts | 35 +++++++++++++ .../mach-keystone/include/mach/hardware-k2g.h | 3 ++ arch/arm/mach-keystone/include/mach/mux-k2g.h | 5 ++ board/ti/ks2_evm/board_k2g.c | 15 ++++++ board/ti/ks2_evm/mux-k2g.h | 51 +++++++++++++------ configs/k2g_evm_defconfig | 1 + drivers/net/ti/keystone_net.c | 22 +++++++- 8 files changed, 116 insertions(+), 17 deletions(-)
Signature · 1 line
2.17.0
PATCH v3 1/7 ARM: k2g-ice: Add pinmux support for rgmii interface
This add pinmux configuration for rgmii interface so that network driver can be supported on K2G ICE boards. The pinmux configurations for this are generated using the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default
As this required some BUFFER_CLASS definitions, same is re-used from the linux defnitions in include/dt-bindings/pinctrl/keystone.h
--- arch/arm/mach-keystone/include/mach/mux-k2g.h | 5 +++++ board/ti/ks2_evm/mux-k2g.h | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+)
arch/arm/mach-keystone/include/mach/mux-k2g.h +5 -0
@@ -27,6 +27,11 @@#define PIN_PTU (1 << 17)/* pull up */ #define PIN_PTD (0 << 17)/* pull down */ +#define BUFFER_CLASS_B (0 << 19) +#define BUFFER_CLASS_C (1 << 19) +#define BUFFER_CLASS_D (2 << 19) +#define BUFFER_CLASS_E (3 << 19) +#define MODE (m) ((m) & 0x7)#define MAX_PIN_N 260
board/ti/ks2_evm/mux-k2g.h +19 -0
@@ -346,6 +346,25 @@ struct pin_cfg k2g_ice_evm_pin_cfg[] = { { 133, MODE(0) }, /* SOC_QSPI_D2 */ { 134, MODE(0) }, /* SOC_QSPI_D3 */ { 135, MODE(0) }, /* SOC_QSPI_CSN0 */ + +/* EMAC */ + { 79, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD1 */ + { 78, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD2 */ + { 77, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD3 */ + { 80, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD0 */ + { 94, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD0 */ + { 93, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD1 */ + { 92, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD2 */ + { 91, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD3 */ + { 85, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXC */ + { 95, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXCTL */ + { 72, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXC */ + { 81, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXCTL */ + +/* MDIO */ + { 99, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_CLK */ + { 98, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_DATA */ + { MAX_PIN_N, } };
Signature · 1 line
2.17.0
PATCH v3 1/7 ARM: k2g-ice: Add pinmux support for rgmii interface
Quoted 44 lines · Murali Karicheri
This add pinmux configuration for rgmii interface so that network driver can be supported on K2G ICE boards. The pinmux configurations for this are generated using the pinmux tool at
https://dev.ti.com/pinmux/app.html#/defaultAs this required some
BUFFER_CLASSdefinitions, same is re-used from the linux defnitions ininclude/dt-bindings/pinctrl/keystone.hSigned-off-by Murali Karicheri <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>--- arch/arm/mach-keystone/include/mach/mux-k2g.h | 5 +++++ board/ti/ks2_evm/mux-k2g.h | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+)arch/arm/mach-keystone/include/mach/mux-k2g.h +5
-0@@ -27,6 +27,11 @@#define PIN_PTU (1 << 17)/* pull up */ #define PIN_PTD (0 << 17)/* pull down */ +#define BUFFER_CLASS_B (0 << 19) +#define BUFFER_CLASS_C (1 << 19) +#define BUFFER_CLASS_D (2 << 19) +#define BUFFER_CLASS_E (3 << 19) +#define MODE (m) ((m) & 0x7)#define MAX_PIN_N 260board/ti/ks2_evm/mux-k2g.h +4
-0@@ -346,6 +346,25 @@ struct pin_cfg k2g_ice_evm_pin_cfg[] = { { 133, MODE(0) }, /* SOC_QSPI_D2 */ { 134, MODE(0) }, /* SOC_QSPI_D3 */ { 135, MODE(0) }, /* SOC_QSPI_CSN0 */ + +/* EMAC */ + { 79, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD1 */ + { 78, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD2 */
board/ti/ks2_evm/mux-k2g.h struct pin_cfg k2g_ice_evm_pin_cfg[] = { · line 362
Quoted 10 lines
board/ti/ks2_evm/mux-k2g.h +10
-0+ { 77, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD3 */ + { 80, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD0 */ + { 94, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD0 */ + { 93, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD1 */ + { 92, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD2 */ + { 91, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD3 */ + { 85, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXC */ + { 95, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXCTL */ + { 72, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXC */ + { 81, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXCTL */
Actually... please sort these by pin number.
Thanks,
-Joe
Quoted 15 lines
board/ti/ks2_evm/mux-k2g.h +5
-1+ +/* MDIO */ + { 99, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_CLK */ + { 98, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_DATA */ + { MAX_PIN_N, } }; --2.17.0
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH v3 1/7 ARM: k2g-ice: Add pinmux support for rgmii interface
In reply to Murali KaricheriQuoted 11 lines · Murali Karicheri
This add pinmux configuration for rgmii interface so that network driver can be supported on K2G ICE boards. The pinmux configurations for this are generated using the pinmux tool at
https://dev.ti.com/pinmux/app.html#/defaultAs this required some
BUFFER_CLASSdefinitions, same is re-used from the linux defnitions ininclude/dt-bindings/pinctrl/keystone.hSigned-off-by Murali Karicheri <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>
PATCH v3 1/7 ARM: k2g-ice: Add pinmux support for rgmii interface
In reply to Murali KaricheriQuoted 11 lines · Murali Karicheri
This add pinmux configuration for rgmii interface so that network driver can be supported on K2G ICE boards. The pinmux configurations for this are generated using the pinmux tool at
https://dev.ti.com/pinmux/app.html#/defaultAs this required some
BUFFER_CLASSdefinitions, same is re-used from the linux defnitions ininclude/dt-bindings/pinctrl/keystone.hSigned-off-by Murali Karicheri <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190412/d429aa2e/attachment.sig>
PATCH v3 2/7 ARM: k2g-gp-evm: update to rgmii pinmux configuration
In reply to Murali KaricheriThis patch updates pinmux configuration for K2G GP EVM based on data generated by the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default
--- board/ti/ks2_evm/mux-k2g.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-)
board/ti/ks2_evm/mux-k2g.h +17 -15
@@ -125,21 +125,23 @@ struct pin_cfg k2g_evm_pin_cfg[] = { { 70, MODE(0) }, /* SOC_MMC1_SDWP */ { 71, MODE(0) }, /* MMC1POW TP124 */ -/* RGMII */ - { 72, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXCLK */ - { 77, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD3 */ - { 78, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD2 */ - { 79, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD1 */ - { 80, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD0 */ - { 81, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXCTL */ - { 85, MODE(1) }, /* SOC_RGMII_TXCLK */ - { 91, MODE(1) }, /* SOC_RGMII_TXD3 */ - { 92, MODE(1) }, /* SOC_RGMII_TXD2 */ - { 93, MODE(1) }, /* SOC_RGMII_TXD1 */ - { 94, MODE(1) }, /* SOC_RGMII_TXD0 */ - { 95, MODE(1) }, /* SOC_RGMII_TXCTL */ - { 98, MODE(0) }, /* SOC_MDIO_DATA */ - { 99, MODE(0) }, /* SOC_MDIO_CLK */ +/* EMAC */ + { 79, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD1 */ + { 78, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD2 */ + { 77, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD3 */ + { 80, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD0 */ + { 94, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD0 */ + { 93, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD1 */ + { 92, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD2 */ + { 91, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD3 */ + { 85, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXC */ + { 95, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXCTL */ + { 72, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXC */ + { 81, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXCTL */ + +/* MDIO */ + { 99, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_CLK */ + { 98, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_DATA *//* PWM */ { 73, MODE(4) }, /* SOC_EHRPWM3A */
Signature · 1 line
2.17.0
PATCH v3 2/7 ARM: k2g-gp-evm: update to rgmii pinmux configuration
Quoted 36 lines · Murali Karicheri
This patch updates pinmux configuration for K2G GP EVM based on data generated by the pinmux tool at
https://dev.ti.com/pinmux/app.html#/defaultSigned-off-by Murali Karicheri <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>--- board/ti/ks2_evm/mux-k2g.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-)board/ti/ks2_evm/mux-k2g.h +2
-15@@ -125,21 +125,23 @@ struct pin_cfg k2g_evm_pin_cfg[] = { { 70, MODE(0) }, /* SOC_MMC1_SDWP */ { 71, MODE(0) }, /* MMC1POW TP124 */ -/* RGMII */ - { 72, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXCLK */ - { 77, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD3 */ - { 78, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD2 */ - { 79, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD1 */ - { 80, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXD0 */ - { 81, MODE(1) | PIN_IEN }, /* SOC_RGMII_RXCTL */ - { 85, MODE(1) }, /* SOC_RGMII_TXCLK */ - { 91, MODE(1) }, /* SOC_RGMII_TXD3 */ - { 92, MODE(1) }, /* SOC_RGMII_TXD2 */ - { 93, MODE(1) }, /* SOC_RGMII_TXD1 */ - { 94, MODE(1) }, /* SOC_RGMII_TXD0 */ - { 95, MODE(1) }, /* SOC_RGMII_TXCTL */ - { 98, MODE(0) }, /* SOC_MDIO_DATA */ - { 99, MODE(0) }, /* SOC_MDIO_CLK */ +/* EMAC */ + { 79, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD1 */
board/ti/ks2_evm/mux-k2g.h struct pin_cfg k2g_evm_pin_cfg[] = { · line 139
Quoted 10 lines
board/ti/ks2_evm/mux-k2g.h +10
-0+ { 78, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD2 */ + { 77, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD3 */ + { 80, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXD0 */ + { 94, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD0 */ + { 93, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD1 */ + { 92, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD2 */ + { 91, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXD3 */ + { 85, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXC */ + { 95, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_TXCTL */ + { 72, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXC */
Please sort by pin number.
Quoted 15 lines
board/ti/ks2_evm/mux-k2g.h +5
-1+ { 81, BUFFER_CLASS_D | PIN_PDIS | MODE(1) }, /* RGMII_RXCTL */ + +/* MDIO */ + { 99, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_CLK */ + { 98, BUFFER_CLASS_B | PIN_PDIS | MODE(0) }, /* MDIO_DATA *//* PWM */ { 73, MODE(4) }, /* SOC_EHRPWM3A */ --2.17.0
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH v3 2/7 ARM: k2g-gp-evm: update to rgmii pinmux configuration
In reply to Murali KaricheriQuoted 6 lines · Murali Karicheri
This patch updates pinmux configuration for K2G GP EVM based on data generated by the pinmux tool at
https://dev.ti.com/pinmux/app.html#/defaultSigned-off-by Murali Karicheri <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190412/70b5e776/attachment.sig>
PATCH v3 3/7 net: netcp: add support for phy with rgmii ids
In reply to Murali KaricheriEnhance the netcp driver to support phys that can be configured for internal delay (rgmii-id, rgmii-rxid, rgmii-txid)
--- drivers/net/ti/keystone_net.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/net/ti/keystone_net.c +21 -1
@@ -88,6 +88,7 @@ struct ks2_eth_priv {struct mii_dev *mdio_bus;int phy_addr;phy_interface_t phy_if; +int phy_of_handle;int sgmii_link_type;void *mdio_base;struct rx_buff_desc net_rx_buffs;
@@ -588,6 +589,10 @@ static int ks2_eth_probe(struct udevice *dev)if (priv->has_mdio) { priv->phydev =phy_connect (priv->mdio_bus, priv->phy_addr, dev, priv->phy_if); +#ifdef CONFIG_DM_ETH +if (priv->phy_of_handle) + priv->phydev->node =offset_to_ofnode (priv->phy_of_handle); +#endif phy_config (priv->phydev); }
@@ -679,6 +684,7 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,int phy;int dma_count;u32 dma_channel[8 ]; +const char *phy_mode; priv->slave_port =fdtdec_get_int (fdt, slave,"slave-port" ,-1 ); priv->net_rx_buffs.rx_flow = priv->slave_port *8 ;
@@ -700,7 +706,9 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave, priv->link_type =fdtdec_get_int (fdt, slave,"link-interface" ,-1 ); phy =fdtdec_lookup_phandle (fdt, slave,"phy-handle" ); +if (phy >=0 ) { + priv->phy_of_handle = phy; priv->phy_addr =fdtdec_get_int (fdt, phy,"reg" ,-1 ); mdio =fdt_parent_offset (fdt, phy);
@@ -717,7 +725,19 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave, priv->sgmii_link_type =SGMII_LINK_MAC_PHY ; priv->has_mdio = true; }else if (priv->link_type ==LINK_TYPE_RGMII_LINK_MAC_PHY ) { - priv->phy_if =PHY_INTERFACE_MODE_RGMII ; + phy_mode =fdt_getprop (fdt, slave,"phy-mode" ,NULL ); +if (phy_mode) { + priv->phy_if =phy_get_interface_by_name (phy_mode); +if (priv->phy_if !=PHY_INTERFACE_MODE_RGMII && + priv->phy_if !=PHY_INTERFACE_MODE_RGMII_ID && + priv->phy_if !=PHY_INTERFACE_MODE_RGMII_RXID && + priv->phy_if !=PHY_INTERFACE_MODE_RGMII_TXID ) { +pr_err ("invalid phy-mode\n" ); +return -EINVAL ; + } + }else { + priv->phy_if =PHY_INTERFACE_MODE_RGMII ; + } pdata->phy_interface = priv->phy_if; priv->has_mdio = true; }
Signature · 1 line
2.17.0
PATCH v3 3/7 net: netcp: add support for phy with rgmii ids
Quoted 5 lines · Murali Karicheri
Enhance the netcp driver to support phys that can be configured for internal delay (rgmii-id, rgmii-rxid, rgmii-txid)
Signed-off-by Murali Karicheri <[email protected]>
PATCH v3 3/7 net: netcp: add support for phy with rgmii ids
In reply to Murali KaricheriQuoted 5 lines · Murali Karicheri
Enhance the netcp driver to support phys that can be configured for internal delay (rgmii-id, rgmii-rxid, rgmii-txid)
Signed-off-by Murali Karicheri <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190412/325c6de9/attachment.sig>
PATCH v3 4/7 ARM: k2g: add a workaround to reset the phy
In reply to Murali KaricheriThis patch adds a workaround to reset the phy one time during boot using GPIO0 pin 10 to make sure, the Phy latches the configuration from the input pins correctly.
--- .../arm/mach-keystone/include/mach/hardware-k2g.h | 3 +++ board/ti/ks2_evm/board_k2g.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+)
arch/arm/mach-keystone/include/mach/hardware-k2g.h +3 -0
@@ -69,9 +69,12 @@#define K2G_GPIO0_BASE 0X02603000#define K2G_GPIO1_BASE 0X0260a000 +#define K2G_GPIO0_BANK0_BASE K2G_GPIO0_BASE + 0x10#define K2G_GPIO1_BANK2_BASE K2G_GPIO1_BASE + 0x38#define K2G_GPIO_DIR_OFFSET 0x0 +#define K2G_GPIO_OUTDATA_OFFSET 0x4#define K2G_GPIO_SETDATA_OFFSET 0x8 +#define K2G_GPIO_CLRDATA_OFFSET 0xC/* BOOTCFG RESETMUX8 */ #define KS2_RSTMUX8 (KS2_DEVICE_STATE_CTRL_BASE + 0x328)
board/ti/ks2_evm/board_k2g.c +15 -0
@@ -315,6 +315,21 @@ int embedded_dtb_select(void) BIT(9));setbits_le32 (K2G_GPIO1_BANK2_BASE +K2G_GPIO_SETDATA_OFFSET ,BIT (9 )); + }else if (board_is_k2g_ice ()) { +/* GBE Phy workaround. For Phy to latch the input +* configuration, a GPIO reset is asserted at the +* Phy reset pin to latch configuration correctly after SoC +* reset. GPIO0 Pin 10 (Ball AA20) is used for this on ICE +* board. Just do a low to high transition. +*/ +clrbits_le32 (K2G_GPIO0_BANK0_BASE +K2G_GPIO_DIR_OFFSET , +BIT (10 )); +setbits_le32 (K2G_GPIO0_BANK0_BASE +K2G_GPIO_CLRDATA_OFFSET , +BIT (10 )); +/* Delay just to get a transition to high */ +udelay (100 ); +setbits_le32 (K2G_GPIO0_BANK0_BASE +K2G_GPIO_SETDATA_OFFSET , +BIT (10 )); }return 0 ;
Signature · 1 line
2.17.0
PATCH v3 4/7 ARM: k2g: add a workaround to reset the phy
Quoted 6 lines · Murali Karicheri
This patch adds a workaround to reset the phy one time during boot using GPIO0 pin 10 to make sure, the Phy latches the configuration from the input pins correctly.
Signed-off-by Murali Karicheri <[email protected]>
PATCH v3 4/7 ARM: k2g: add a workaround to reset the phy
In reply to Murali KaricheriQuoted 6 lines · Murali Karicheri
This patch adds a workaround to reset the phy one time during boot using GPIO0 pin 10 to make sure, the Phy latches the configuration from the input pins correctly.
Signed-off-by Murali Karicheri <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190412/c0c17b69/attachment.sig>
PATCH v3 5/7 ARM: dts: k2g-evm: remove unused phy-mode property from phy node
In reply to Murali KaricheriThis patch removes the unused phy-mode property from the phy dt node. On K2G, currently link-interface determines if phy is used or not and is already set to use rgmii. So this is not needed. Besides phy-mode should be added to slave interface configuration of the cpsw driver, not in the phy node.
--- arch/arm/dts/keystone-k2g-evm.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm/dts/keystone-k2g-evm.dts +0 -1
@@ -29,7 +29,6 @@ status = "okay"; ethphy0: ethernet-phy at 0 { reg = <0>; - phy-mode = "rgmii-id"; }; };
Signature · 1 line
2.17.0
PATCH v3 5/7 ARM: dts: k2g-evm: remove unused phy-mode property from phy node
Quoted 8 lines · Murali Karicheri
This patch removes the unused phy-mode property from the phy dt node. On K2G, currently link-interface determines if phy is used or not and is already set to use rgmii. So this is not needed. Besides phy-mode should be added to slave interface configuration of the cpsw driver, not in the phy node.
Signed-off-by Murali Karicheri <[email protected]>
PATCH v3 5/7 ARM: dts: k2g-evm: remove unused phy-mode property from phy node
In reply to Murali KaricheriQuoted 8 lines · Murali Karicheri
This patch removes the unused phy-mode property from the phy dt node. On K2G, currently link-interface determines if phy is used or not and is already set to use rgmii. So this is not needed. Besides phy-mode should be added to slave interface configuration of the cpsw driver, not in the phy node.
Signed-off-by Murali Karicheri <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190412/7d06314e/attachment.sig>
PATCH v3 6/7 k2g: config enable ti phy dp83867 for k2g
In reply to Murali KaricheriEnable ti phy dp83867 for k2g
--- configs/k2g_evm_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/k2g_evm_defconfig +1 -0
@@ -70,3 +70,4 @@ CONFIG_USB_DWC3_GENERIC=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_FUNCTION_SDP=y +CONFIG_PHY_TI=y
Signature · 1 line
2.17.0
PATCH v3 6/7 k2g: config enable ti phy dp83867 for k2g
Quoted 3 lines · Murali Karicheri
Enable ti phy dp83867 for k2g
Signed-off-by Murali Karicheri <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190221/5cbb6db8/attachment.sig>
PATCH v3 6/7 k2g: config enable ti phy dp83867 for k2g
In reply to Murali KaricheriQuoted 4 lines · Murali Karicheri
Enable ti phy dp83867 for k2g
Signed-off-by Murali Karicheri <[email protected]>
PATCH v3 6/7 k2g: config enable ti phy dp83867 for k2g
In reply to Murali KaricheriQuoted 5 lines · Murali Karicheri
Enable ti phy dp83867 for k2g
Signed-off-by Murali Karicheri <[email protected]>Reviewed-by Tom Rini <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190412/46f123b1/attachment.sig>
PATCH v3 7/7 ARM: dts: k2g-ice: add dt node for netcp
In reply to Murali KaricheriThis patch adds dt node for DP83867 phy used on K2G ICE board and also enable netcp device nodes for the board.
EVM hardware spec recommends to add 0.25 nsec delay in the tx direction and 2.25 nsec delay in the rx direction for internal delay in the clock path to be on the safer side.
The board straps RX_DV/RX_CTRL pin of on board DP83867 phy in mode
1. Unfortunately, the phy data manual disallows this. Add ti,dp83867-rxctrl-strap-quirk in the phy node to allow software to enable workaround suggested for this incorrect strap setting. This ensures proper operation of this PHY.
The dts bindings are kept in sync with that from 4.14.y linux kernel. This required the pinmux device related bindings to be commented out to allow for compilation.
--- arch/arm/dts/keystone-k2g-ice.dts | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm/dts/keystone-k2g-ice.dts +35 -0
@@ -7,6 +7,7 @@ /dts-v1/; #include "keystone-k2g.dtsi" +#include <dt-bindings/net/ti-dp83867.h> / { compatible = "ti,k2g-ice", "ti,k2g", "ti,keystone";
@@ -81,3 +82,37 @@ }; }; }; + +&qmss { + status = "okay"; +}; + +&knav_dmas { + status = "okay"; +}; + +&netcp { + pinctrl-names = "default"; + //pinctrl-0 = <&emac_pins>; + status = "okay"; +}; + +&mdio { + pinctrl-names = "default"; + //pinctrl-0 = <&mdio_pins>; + status = "okay"; + ethphy0: ethernet-phy at 0 { + reg = <0>; + ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>; + ti,tx-internal-delay = <DP83867_RGMIIDCTL_250_PS>; + ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_8_B_NIB>; + ti,min-output-impedance; + ti,dp83867-rxctrl-strap-quirk; + }; +}; + +&gbe0 { + phy-handle = <ðphy0>; + phy-mode = "rgmii-id"; + status = "okay"; +};
Signature · 1 line
2.17.0
PATCH v3 7/7 ARM: dts: k2g-ice: add dt node for netcp
Quoted 14 lines · Murali Karicheri
This patch adds dt node for DP83867 phy used on K2G ICE board and also enable netcp device nodes for the board.
EVM hardware spec recommends to add 0.25 nsec delay in the tx direction and 2.25 nsec delay in the rx direction for internal delay in the clock path to be on the safer side.
The board straps RX_DV/RX_CTRL pin of on board DP83867 phy in mode
1. Unfortunately, the phy data manual disallows this. Add ti,dp83867-rxctrl-strap-quirk in the phy node to allow software to enable workaround suggested for this incorrect strap setting. This ensures proper operation of this PHY.
Quoted 5 lines
The dts bindings are kept in sync with that from 4.14.y linux kernel. This required the pinmux device related bindings to be commented out to allow for compilation.
Signed-off-by Murali Karicheri <[email protected]>
PATCH v3 7/7 ARM: dts: k2g-ice: add dt node for netcp
In reply to Murali KaricheriQuoted 13 lines · Murali Karicheri
This patch adds dt node for DP83867 phy used on K2G ICE board and also enable netcp device nodes for the board.
EVM hardware spec recommends to add 0.25 nsec delay in the tx direction and 2.25 nsec delay in the rx direction for internal delay in the clock path to be on the safer side.
The board straps RX_DV/RX_CTRL pin of on board DP83867 phy in mode
1. Unfortunately, the phy data manual disallows this. Add ti,dp83867-rxctrl-strap-quirk in the phy node to allow software to enable workaround suggested for this incorrect strap setting. This ensures proper operation of this PHY.
Quoted 6 lines
The dts bindings are kept in sync with that from 4.14.y linux kernel. This required the pinmux device related bindings to be commented out to allow for compilation.
Signed-off-by Murali Karicheri <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190412/fc27b75f/attachment.sig>
v3 cover Add netcp networking support on K2G ICE EVM
In reply to Murali KaricheriHello Maintainer,
Quoted 34 lines · Murali Karicheri
This patch series add networking capability to K2G ICE EVM based on netcp driver. Networking function has been tested using the latest master branch from u-boot repo. Following boot mode has been tested for networking.
Net boot (tftp images over ethernet interface and boot kernel)
log at https://pastebin.ubuntu.com/p/b3nyCXPhWc/
MMC boot: (load images from boot folder of rootfs and boot kernel)
log at https://pastebin.ubuntu.com/p/FWycmKd9KB/Used Linux upstream linux kernel version 4.19.9 for the tests.
Please review and apply if this looks good.
Thanks
Revision history:
v3: Addressed comment to use KConfig for enable TI PHY driver and also
netcp driver comment to use proper function as in cpsw driver. Rebased to latest on master branch.
v2: Collected Reviewed-by for patch 1 and 2. Rebased to latest
on masterMurali Karicheri (7):
ARM: k2g-ice: Add pinmux support for rgmii interface
ARM: k2g-gp-evm: update to rgmii pinmux configuration
net: netcp: add support for phy with rgmii ids
ARM: k2g: add a workaround to reset the phy
ARM: dts: k2g-evm: remove unused phy-mode property from phy node
k2g: config enable ti phy dp83867 for k2g
ARM: dts: k2g-ice: add dt node for netcp
Quoted 10 lines
arch/arm/dts/keystone-k2g-evm.dts | 1 - arch/arm/dts/keystone-k2g-ice.dts | 35 +++++++++++++ .../mach-keystone/include/mach/hardware-k2g.h | 3 ++ arch/arm/mach-keystone/include/mach/mux-k2g.h | 5 ++ board/ti/ks2_evm/board_k2g.c | 15 ++++++ board/ti/ks2_evm/mux-k2g.h | 51 +++++++++++++------ configs/k2g_evm_defconfig | 1 + drivers/net/ti/keystone_net.c | 22 +++++++- 8 files changed, 116 insertions(+), 17 deletions(-)
Could you please merge this to master at the earliest if there are no more comments?
Thanks
Murali