]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/isee/igep0033/board.c
drivers: net: cpsw: add support to have phy address from cpsw platform data
[karo-tx-uboot.git] / board / isee / igep0033 / board.c
index a24c22b1ad44fe737e222e745036ced8ff8bf3bb..9f8fcf2c1cfcc29eaede937af3f4690bb8c7c8c7 100644 (file)
@@ -27,9 +27,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* MII mode defines */
-#define RMII_MODE_ENABLE       0x4D
-
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
 #ifdef CONFIG_SPL_BUILD
@@ -38,20 +35,16 @@ static const struct ddr_data ddr3_data = {
        .datawdsratio0 = K4B2G1646EBIH9_WR_DQS,
        .datafwsratio0 = K4B2G1646EBIH9_PHY_FIFO_WE,
        .datawrsratio0 = K4B2G1646EBIH9_PHY_WR_DATA,
-       .datadldiff0 = PHY_DLL_LOCK_DIFF,
 };
 
 static const struct cmd_control ddr3_cmd_ctrl_data = {
        .cmd0csratio = K4B2G1646EBIH9_RATIO,
-       .cmd0dldiff = K4B2G1646EBIH9_DLL_LOCK_DIFF,
        .cmd0iclkout = K4B2G1646EBIH9_INVERT_CLKOUT,
 
        .cmd1csratio = K4B2G1646EBIH9_RATIO,
-       .cmd1dldiff = K4B2G1646EBIH9_DLL_LOCK_DIFF,
        .cmd1iclkout = K4B2G1646EBIH9_INVERT_CLKOUT,
 
        .cmd2csratio = K4B2G1646EBIH9_RATIO,
-       .cmd2dldiff = K4B2G1646EBIH9_DLL_LOCK_DIFF,
        .cmd2iclkout = K4B2G1646EBIH9_INVERT_CLKOUT,
 };
 
@@ -67,7 +60,7 @@ static struct emif_regs ddr3_emif_reg_data = {
 
 #define OSC    (V_OSCK/1000000)
 const struct dpll_params dpll_ddr = {
-               303, OSC-1, 1, -1, -1, -1, -1};
+               400, OSC-1, 1, -1, -1, -1, -1};
 
 const struct dpll_params *get_dpll_ddr_params(void)
 {
@@ -84,9 +77,17 @@ void set_mux_conf_regs(void)
        enable_board_pin_mux();
 }
 
+const struct ctrl_ioregs ioregs = {
+       .cm0ioctl               = K4B2G1646EBIH9_IOCTRL_VALUE,
+       .cm1ioctl               = K4B2G1646EBIH9_IOCTRL_VALUE,
+       .cm2ioctl               = K4B2G1646EBIH9_IOCTRL_VALUE,
+       .dt0ioctl               = K4B2G1646EBIH9_IOCTRL_VALUE,
+       .dt1ioctl               = K4B2G1646EBIH9_IOCTRL_VALUE,
+};
+
 void sdram_init(void)
 {
-       config_ddr(303, K4B2G1646EBIH9_IOCTRL_VALUE, &ddr3_data,
+       config_ddr(400, &ioregs, &ddr3_data,
                   &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
 }
 #endif
@@ -115,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,
        },
 };
@@ -132,6 +133,7 @@ static struct cpsw_platform_data cpsw_data = {
        .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,
@@ -158,7 +160,8 @@ int board_eth_init(bd_t *bis)
                        eth_setenv_enetaddr("ethaddr", mac_addr);
        }
 
-       writel(RMII_MODE_ENABLE, &cdev->miisel);
+       writel((GMII1_SEL_RMII | RMII1_IO_CLK_EN),
+              &cdev->miisel);
 
        rv = cpsw_register(&cpsw_data);
        if (rv < 0)
@@ -169,4 +172,3 @@ int board_eth_init(bd_t *bis)
        return ret;
 }
 #endif
-