keystone2: add network support for K2L SoC and EVM
Subsystems (2)
cover keystone2: add network support for K2L SoC and EVM
These patches add network support for Keystone2 Lamar SoC boards.
Based on u-boot-ti/master
Hao Zhang (1):
board: k2l_evm: add network support
Ivan Khoronzhuk (3):
ARM: keystone2: keysonte_nav: add support for K2L SoC
net: keystone_serdes: add keystone K2L SoC support
net: keystone_net: add Keystone2 K2L SoC support
arch/arm/include/asm/arch-keystone/hardware-k2e.h | 2 -- arch/arm/include/asm/arch-keystone/hardware-k2hk.h | 2 -- arch/arm/include/asm/arch-keystone/hardware-k2l.h | 7 ++++ arch/arm/include/asm/arch-keystone/hardware.h | 4 +++ board/ti/ks2_evm/board_k2l.c | 40 +++++++++++++++++++++- drivers/net/keystone_net.c | 7 ++-- include/configs/k2e_evm.h | 6 ---- include/configs/k2hk_evm.h | 6 ---- include/configs/k2l_evm.h | 5 +++ include/configs/ks2_evm.h | 6 ++++ 10 files changed, 66 insertions(+), 19 deletions(-)
Signature · 1 line
1.8.3.2
PATCH 1/4 ARM: keystone2: keysonte_nav: add support for K2L SoC
The Keystone2 Lamar SoC uses the same keystone navigator. Move queue numbers to common hardware file, as all Keystone2 SoCs have the same ones.
--- arch/arm/include/asm/arch-keystone/hardware-k2e.h | 2 -- arch/arm/include/asm/arch-keystone/hardware-k2hk.h | 2 -- arch/arm/include/asm/arch-keystone/hardware.h | 4 ++++ 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/include/asm/arch-keystone/hardware-k2e.h +0 -2
@@ -57,8 +57,6 @@#define KS2_NETCP_PDMA_SCHED_BASE 0x24186100#define KS2_NETCP_PDMA_RX_FLOW_BASE 0x24189000#define KS2_NETCP_PDMA_RX_FLOW_NUM 96 -#define KS2_NETCP_PDMA_RX_FREE_QUEUE 4001 -#define KS2_NETCP_PDMA_RX_RCV_QUEUE 4002#define KS2_NETCP_PDMA_TX_SND_QUEUE 896/* NETCP */
arch/arm/include/asm/arch-keystone/hardware-k2hk.h +0 -2
@@ -98,8 +98,6 @@#define KS2_NETCP_PDMA_SCHED_BASE 0x02004c00#define KS2_NETCP_PDMA_RX_FLOW_BASE 0x02005000#define KS2_NETCP_PDMA_RX_FLOW_NUM 32 -#define KS2_NETCP_PDMA_RX_FREE_QUEUE 4001 -#define KS2_NETCP_PDMA_RX_RCV_QUEUE 4002#define KS2_NETCP_PDMA_TX_SND_QUEUE 648/* NETCP */
arch/arm/include/asm/arch-keystone/hardware.h +4 -0
@@ -122,6 +122,10 @@ typedef volatile unsigned int *dv_reg_p;#define KS2_EDMA_QEESR 0x108c#define KS2_EDMA_PARAM_1 (x) (0x4020 + (4 * x)) +/* NETCP pktdma */ +#define KS2_NETCP_PDMA_RX_FREE_QUEUE 4001 +#define KS2_NETCP_PDMA_RX_RCV_QUEUE 4002 +/* Chip Interrupt Controller */ #define KS2_CIC2_BASE 0x02608000
Signature · 1 line
1.8.3.2
PATCH 1/4 ARM: keystone2: keysonte_nav: add support for K2L SoC
Quoted 6 lines · Ivan
The Keystone2 Lamar SoC uses the same keystone navigator. Move queue numbers to common hardware file, as all Keystone2 SoCs have the same ones.
Acked-by Murali Karicheri <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/b5f8092a/attachment.pgp>
PATCH 2/4 net: keystone_serdes: add keystone K2L SoC support
In reply to Ivan KhoronzhukKeystone2 Lamar SoC uses the same keystone SerDes driver. All Keystone2 EVM boards currently use SerDes driver, so move CONFIG_TI_KEYSTONE_SERDES to common configuration file.
--- arch/arm/include/asm/arch-keystone/hardware-k2l.h | 4 ++++ drivers/net/keystone_net.c | 2 +- include/configs/k2e_evm.h | 3 --- include/configs/k2hk_evm.h | 3 --- include/configs/ks2_evm.h | 3 +++ 5 files changed, 8 insertions(+), 7 deletions(-)
arch/arm/include/asm/arch-keystone/hardware-k2l.h +4 -0
@@ -84,6 +84,10 @@/* OSR memory size */ #define KS2_OSR_SIZE 0x100000 +/* SGMII SerDes */ +#define KS2_SGMII_SERDES2_BASE 0x02320000 +#define KS2_LANES_PER_SGMII_SERDES 2 +/* Number of DSP cores */ #define KS2_NUM_DSPS 4
drivers/net/keystone_net.c +1 -1
@@ -582,7 +582,7 @@ static void keystone2_net_serdes_setup(void) &ks2_serdes_sgmii_156p25mhz, CONFIG_KSNET_SERDES_LANES_PER_SGMII); -#ifdef CONFIG_SOC_K2E +#if defined(CONFIG_SOC_K2E ) || defined(CONFIG_SOC_K2L )ks2_serdes_init (CONFIG_KSNET_SERDES_SGMII2_BASE , &ks2_serdes_sgmii_156p25mhz,CONFIG_KSNET_SERDES_LANES_PER_SGMII );
include/configs/k2e_evm.h +0 -3
@@ -42,7 +42,4 @@#define CONFIG_KSNET_CPSW_NUM_PORTS 9#define CONFIG_KSNET_MDIO_PHY_CONFIG_ENABLE -/* SerDes */ -#define CONFIG_TI_KEYSTONE_SERDES -#endif /* __CONFIG_K2E_EVM_H */
include/configs/k2hk_evm.h +0 -3
@@ -41,7 +41,4 @@#define CONFIG_KSNET_NETCP_V1_0 #define CONFIG_KSNET_CPSW_NUM_PORTS 5 -/* SerDes */ -#define CONFIG_TI_KEYSTONE_SERDES -#endif /* __CONFIG_K2HK_EVM_H */
include/configs/ks2_evm.h +3 -0
@@ -141,6 +141,9 @@#define CONFIG_KSNET_SERDES_SGMII2_BASE KS2_SGMII_SERDES2_BASE#define CONFIG_KSNET_SERDES_LANES_PER_SGMII KS2_LANES_PER_SGMII_SERDES +/* SerDes */ +#define CONFIG_TI_KEYSTONE_SERDES +/* AEMIF */ #define CONFIG_TI_AEMIF #define CONFIG_AEMIF_CNTRL_BASE KS2_AEMIF_CNTRL_BASE
Signature · 1 line
1.8.3.2
PATCH 2/4 net: keystone_serdes: add keystone K2L SoC support
Quoted 6 lines · Ivan
Keystone2 Lamar SoC uses the same keystone SerDes driver. All Keystone2 EVM boards currently use SerDes driver, so move
CONFIG_TI_KEYSTONE_SERDESto common configuration file.Acked-by Murali Karicheri <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/1685edeb/attachment.pgp>
PATCH 3/4 net: keystone_net: add Keystone2 K2L SoC support
In reply to Ivan KhoronzhukThe Keystone2 Lamar SoC uses the same keystone net driver. This patch adds opportunity to use it by K2L SoCs.
--- arch/arm/include/asm/arch-keystone/hardware-k2l.h | 3 +++ drivers/net/keystone_net.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-keystone/hardware-k2l.h +3 -0
@@ -102,4 +102,7 @@#define KS2_NETCP_PDMA_RX_FLOW_NUM 96#define KS2_NETCP_PDMA_TX_SND_QUEUE 896 +/* NETCP */ +#define KS2_NETCP_BASE 0x26000000 +#endif /* __ASM_ARCH_HARDWARE_K2L_H */
drivers/net/keystone_net.c +4 -1
@@ -315,7 +315,7 @@ int mac_sl_config(u_int16_t port, struct mac_sl_cfg *cfg)writel (cfg->max_rx_len,DEVICE_EMACSL_BASE (port) +CPGMACSL_REG_MAXLEN );writel (cfg->ctl,DEVICE_EMACSL_BASE (port) +CPGMACSL_REG_CTL ); -#ifdef CONFIG_K2E_EVM +#if defined(CONFIG_SOC_K2E ) || defined(CONFIG_SOC_K2L )/* Map RX packet flow priority to 0 */ writel (0 ,DEVICE_EMACSL_BASE (port) +CPGMACSL_REG_RX_PRI_MAP );#endif
@@ -400,6 +400,9 @@ static int keystone2_eth_open(struct eth_device *dev, bd_t *bis)keystone2_net_serdes_setup (); +if (sys_has_mdio) +keystone2_mdio_reset (mdio_bus); +keystone_sgmii_config (phy_dev, eth_priv->slave_port -1 , eth_priv->sgmii_link_type);
Signature · 1 line
1.8.3.2
PATCH 3/4 net: keystone_net: add Keystone2 K2L SoC support
Quoted 5 lines · Ivan
The Keystone2 Lamar SoC uses the same keystone net driver. This patch adds opportunity to use it by K2L SoCs.
Acked-by Murali Karicheri <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/04b31521/attachment.pgp>
PATCH 4/4 board: k2l_evm: add network support
In reply to Ivan KhoronzhukFrom: Hao Zhang <[email protected]>
This patch adds network support code and enables keystone_net driver usage for k2l_evm evaluation board.
--- board/ti/ks2_evm/board_k2l.c | 40 +++++++++++++++++++++++++++++++++++++++- include/configs/k2e_evm.h | 3 --- include/configs/k2hk_evm.h | 3 --- include/configs/k2l_evm.h | 5 +++++ include/configs/ks2_evm.h | 3 +++ 5 files changed, 47 insertions(+), 7 deletions(-)
board/ti/ks2_evm/board_k2l.c +39 -1
@@ -10,7 +10,7 @@#include <common.h> #include <asm/arch/ddr3.h> #include <asm/arch/hardware.h> -#include <asm/ti-common/ti-aemif.h> +#include <asm/ti-common/keystone_net.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -42,6 +42,44 @@ static struct pll_init_data tetris_pll_config[] = {static struct pll_init_data pa_pll_config =PASS_PLL_983 ; +#ifdef CONFIG_DRIVER_TI_KEYSTONE_NET +struct eth_priv_t eth_priv_cfg[] = { + { + .int_name ="K2L_EMAC" , + .rx_flow =0 , + .phy_addr =0 , + .slave_port =1 , + .sgmii_link_type =SGMII_LINK_MAC_PHY , + }, + { + .int_name ="K2L_EMAC1" , + .rx_flow =8 , + .phy_addr =1 , + .slave_port =2 , + .sgmii_link_type =SGMII_LINK_MAC_PHY , + }, + { + .int_name ="K2L_EMAC2" , + .rx_flow =16 , + .phy_addr =2 , + .slave_port =3 , + .sgmii_link_type =SGMII_LINK_MAC_MAC_FORCED , + }, + { + .int_name ="K2L_EMAC3" , + .rx_flow =32 , + .phy_addr =3 , + .slave_port =4 , + .sgmii_link_type =SGMII_LINK_MAC_MAC_FORCED , + }, +}; + +int get_num_eth_ports (void ) +{ +return sizeof (eth_priv_cfg) /sizeof (struct eth_priv_t ); +} +#endif +#ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f (void ) {
include/configs/k2e_evm.h +0 -3
@@ -35,9 +35,6 @@#define CONFIG_SYS_NAND_PAGE_2K /* Network */ -#define CONFIG_DRIVER_TI_KEYSTONE_NET -#define CONFIG_TI_KSNAV -#define CONFIG_KSNAV_PKTDMA_NETCP #define CONFIG_KSNET_NETCP_V1_5 #define CONFIG_KSNET_CPSW_NUM_PORTS 9#define CONFIG_KSNET_MDIO_PHY_CONFIG_ENABLE
include/configs/k2hk_evm.h +0 -3
@@ -35,9 +35,6 @@#define CONFIG_SYS_NAND_PAGE_2K /* Network */ -#define CONFIG_DRIVER_TI_KEYSTONE_NET -#define CONFIG_TI_KSNAV -#define CONFIG_KSNAV_PKTDMA_NETCP #define CONFIG_KSNET_NETCP_V1_0 #define CONFIG_KSNET_CPSW_NUM_PORTS 5
include/configs/k2l_evm.h +5 -0
@@ -34,4 +34,9 @@/* NAND Configuration */ #define CONFIG_SYS_NAND_PAGE_4K +/* Network */ +#define CONFIG_KSNET_NETCP_V1_5 +#define CONFIG_KSNET_CPSW_NUM_PORTS 5 +#define CONFIG_KSNET_MDIO_PHY_CONFIG_ENABLE +#endif /* __CONFIG_K2L_EVM_H */
include/configs/ks2_evm.h +3 -0
@@ -106,6 +106,7 @@#define CONFIG_SYS_SGMII_RATESCALE 2/* Keyston Navigator Configuration */ +#define CONFIG_TI_KSNAV #define CONFIG_KSNAV_QM_BASE_ADDRESS KS2_QM_BASE_ADDRESS#define CONFIG_KSNAV_QM_CONF_BASE KS2_QM_CONF_BASE#define CONFIG_KSNAV_QM_DESC_SETUP_BASE KS2_QM_DESC_SETUP_BASE
@@ -122,6 +123,7 @@#define CONFIG_KSNAV_QM_QPOOL_NUM KS2_QM_QPOOL_NUM/* NETCP pktdma */ +#define CONFIG_KSNAV_PKTDMA_NETCP #define CONFIG_KSNAV_NETCP_PDMA_CTRL_BASE KS2_NETCP_PDMA_CTRL_BASE#define CONFIG_KSNAV_NETCP_PDMA_TX_BASE KS2_NETCP_PDMA_TX_BASE#define CONFIG_KSNAV_NETCP_PDMA_TX_CH_NUM KS2_NETCP_PDMA_TX_CH_NUM
@@ -135,6 +137,7 @@#define CONFIG_KSNAV_NETCP_PDMA_TX_SND_QUEUE KS2_NETCP_PDMA_TX_SND_QUEUE/* Keystone net */ +#define CONFIG_DRIVER_TI_KEYSTONE_NET #define CONFIG_KSNET_MAC_ID_BASE KS2_MAC_ID_BASE_ADDR#define CONFIG_KSNET_NETCP_BASE KS2_NETCP_BASE#define CONFIG_KSNET_SERDES_SGMII_BASE KS2_SGMII_SERDES_BASE
Signature · 1 line
1.8.3.2
PATCH 4/4 board: k2l_evm: add network support
Quoted 8 lines · Ivan
From: Hao Zhang <[email protected]>
This patch adds network support code and enables
keystone_netdriver usage fork2l_evmevaluation board.Acked-by Murali Karicheri <[email protected]>Signed-off-by Hao Zhang <[email protected]>Signed-off-by Ivan Khoronzhuk <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/0f344bc9/attachment.pgp>