From 0229c9330d2b34141f77584de417136d5c8088fc Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Mon, 18 Mar 2019 13:54:37 +0530 Subject: board: ti: am335x: Add platdata for cpsw in SPL The SPL image overflows when cpsw dt nodes are added and SPL_OF_CONTROL is enabled. Use static platdata instead to save space. Signed-off-by: Faiz Abbas --- board/ti/am335x/board.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'board/ti') diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index d67f94ad47b..b811fb088b7 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -875,6 +875,55 @@ int board_late_init(void) } #endif +/* CPSW platdata */ +#if !CONFIG_IS_ENABLED(OF_CONTROL) +struct cpsw_slave_data slave_data[] = { + { + .slave_reg_ofs = CPSW_SLAVE0_OFFSET, + .sliver_reg_ofs = CPSW_SLIVER0_OFFSET, + .phy_addr = 0, + }, + { + .slave_reg_ofs = CPSW_SLAVE1_OFFSET, + .sliver_reg_ofs = CPSW_SLIVER1_OFFSET, + .phy_addr = 1, + }, +}; + +struct cpsw_platform_data am335_eth_data = { + .cpsw_base = CPSW_BASE, + .version = CPSW_CTRL_VERSION_2, + .bd_ram_ofs = CPSW_BD_OFFSET, + .ale_reg_ofs = CPSW_ALE_OFFSET, + .cpdma_reg_ofs = CPSW_CPDMA_OFFSET, + .mdio_div = CPSW_MDIO_DIV, + .host_port_reg_ofs = CPSW_HOST_PORT_OFFSET, + .channels = 8, + .slaves = 2, + .slave_data = slave_data, + .ale_entries = 1024, + .bd_ram_ofs = 0x2000, + .mac_control = 0x20, + .active_slave = 0, + .mdio_base = 0x4a101000, + .gmii_sel = 0x44e10650, + .phy_sel_compat = "ti,am3352-cpsw-phy-sel", + .syscon_addr = 0x44e10630, + .macid_sel_compat = "cpsw,am33xx", +}; + +struct eth_pdata cpsw_pdata = { + .iobase = 0x4a100000, + .phy_interface = 0, + .priv_pdata = &am335_eth_data, +}; + +U_BOOT_DEVICE(am335x_eth) = { + .name = "eth_cpsw", + .platdata = &cpsw_pdata, +}; +#endif + #ifndef CONFIG_DM_ETH #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ -- cgit v1.2.3