Commit 78b33121 authored by Kumar Gala's avatar Kumar Gala Committed by Linus Torvalds

[PATCH] ppc32: Update MPC834x platform to work with new phylib

MPC834x uses the gianfar network driver which now uses the new phylib.  We
need to update the platform code to create a gianfar platform MDIO bus and
pass the right intializations to the gianfar driver to make things work
again.
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 143dcec2
This diff is collapsed.
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
#include <syslib/ppc83xx_setup.h> #include <syslib/ppc83xx_setup.h>
static const char *GFAR_PHY_0 = "phy0:0";
static const char *GFAR_PHY_1 = "phy0:1";
#ifndef CONFIG_PCI #ifndef CONFIG_PCI
unsigned long isa_io_base = 0; unsigned long isa_io_base = 0;
unsigned long isa_mem_base = 0; unsigned long isa_mem_base = 0;
...@@ -97,6 +100,7 @@ mpc834x_sys_setup_arch(void) ...@@ -97,6 +100,7 @@ mpc834x_sys_setup_arch(void)
bd_t *binfo = (bd_t *) __res; bd_t *binfo = (bd_t *) __res;
unsigned int freq; unsigned int freq;
struct gianfar_platform_data *pdata; struct gianfar_platform_data *pdata;
struct gianfar_mdio_data *mdata;
/* get the core frequency */ /* get the core frequency */
freq = binfo->bi_intfreq; freq = binfo->bi_intfreq;
...@@ -111,24 +115,27 @@ mpc834x_sys_setup_arch(void) ...@@ -111,24 +115,27 @@ mpc834x_sys_setup_arch(void)
#endif #endif
mpc83xx_early_serial_map(); mpc83xx_early_serial_map();
/* setup the board related info for the MDIO bus */
mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC83xx_MDIO);
mdata->irq[0] = MPC83xx_IRQ_EXT1;
mdata->irq[1] = MPC83xx_IRQ_EXT2;
mdata->irq[2] = -1;
mdata->irq[31] = -1;
mdata->paddr += binfo->bi_immr_base;
/* setup the board related information for the enet controllers */ /* setup the board related information for the enet controllers */
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1); pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1);
if (pdata) { if (pdata) {
pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
pdata->interruptPHY = MPC83xx_IRQ_EXT1; pdata->bus_id = GFAR_PHY_0;
pdata->phyid = 0;
/* fixup phy address */
pdata->phy_reg_addr += binfo->bi_immr_base;
memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
} }
pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2); pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2);
if (pdata) { if (pdata) {
pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
pdata->interruptPHY = MPC83xx_IRQ_EXT2; pdata->bus_id = GFAR_PHY_1;
pdata->phyid = 1;
/* fixup phy address */
pdata->phy_reg_addr += binfo->bi_immr_base;
memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
} }
......
...@@ -27,18 +27,20 @@ ...@@ -27,18 +27,20 @@
* what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
*/ */
struct gianfar_mdio_data mpc83xx_mdio_pdata = {
.paddr = 0x24520,
};
static struct gianfar_platform_data mpc83xx_tsec1_pdata = { static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
.device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
FSL_GIANFAR_DEV_HAS_MULTI_INTR, FSL_GIANFAR_DEV_HAS_MULTI_INTR,
.phy_reg_addr = 0x24000,
}; };
static struct gianfar_platform_data mpc83xx_tsec2_pdata = { static struct gianfar_platform_data mpc83xx_tsec2_pdata = {
.device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
FSL_GIANFAR_DEV_HAS_MULTI_INTR, FSL_GIANFAR_DEV_HAS_MULTI_INTR,
.phy_reg_addr = 0x24000,
}; };
static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = { static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
...@@ -220,6 +222,12 @@ struct platform_device ppc_sys_platform_devices[] = { ...@@ -220,6 +222,12 @@ struct platform_device ppc_sys_platform_devices[] = {
}, },
}, },
}, },
[MPC83xx_MDIO] = {
.name = "fsl-gianfar_mdio",
.id = 0,
.dev.platform_data = &mpc83xx_mdio_pdata,
.num_resources = 0,
},
}; };
static int __init mach_mpc83xx_fixup(struct platform_device *pdev) static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
......
...@@ -24,72 +24,72 @@ struct ppc_sys_spec ppc_sys_specs[] = { ...@@ -24,72 +24,72 @@ struct ppc_sys_spec ppc_sys_specs[] = {
.ppc_sys_name = "8349E", .ppc_sys_name = "8349E",
.mask = 0xFFFF0000, .mask = 0xFFFF0000,
.value = 0x80500000, .value = 0x80500000,
.num_devices = 8, .num_devices = 9,
.device_list = (enum ppc_sys_devices[]) .device_list = (enum ppc_sys_devices[])
{ {
MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
MPC83xx_USB2_DR, MPC83xx_USB2_MPH MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
}, },
}, },
{ {
.ppc_sys_name = "8349", .ppc_sys_name = "8349",
.mask = 0xFFFF0000, .mask = 0xFFFF0000,
.value = 0x80510000, .value = 0x80510000,
.num_devices = 7, .num_devices = 8,
.device_list = (enum ppc_sys_devices[]) .device_list = (enum ppc_sys_devices[])
{ {
MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_IIC2, MPC83xx_DUART,
MPC83xx_USB2_DR, MPC83xx_USB2_MPH MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
}, },
}, },
{ {
.ppc_sys_name = "8347E", .ppc_sys_name = "8347E",
.mask = 0xFFFF0000, .mask = 0xFFFF0000,
.value = 0x80520000, .value = 0x80520000,
.num_devices = 8, .num_devices = 9,
.device_list = (enum ppc_sys_devices[]) .device_list = (enum ppc_sys_devices[])
{ {
MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
MPC83xx_USB2_DR, MPC83xx_USB2_MPH MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
}, },
}, },
{ {
.ppc_sys_name = "8347", .ppc_sys_name = "8347",
.mask = 0xFFFF0000, .mask = 0xFFFF0000,
.value = 0x80530000, .value = 0x80530000,
.num_devices = 7, .num_devices = 8,
.device_list = (enum ppc_sys_devices[]) .device_list = (enum ppc_sys_devices[])
{ {
MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_IIC2, MPC83xx_DUART,
MPC83xx_USB2_DR, MPC83xx_USB2_MPH MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
}, },
}, },
{ {
.ppc_sys_name = "8343E", .ppc_sys_name = "8343E",
.mask = 0xFFFF0000, .mask = 0xFFFF0000,
.value = 0x80540000, .value = 0x80540000,
.num_devices = 7, .num_devices = 8,
.device_list = (enum ppc_sys_devices[]) .device_list = (enum ppc_sys_devices[])
{ {
MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
MPC83xx_USB2_DR, MPC83xx_USB2_DR, MPC83xx_MDIO
}, },
}, },
{ {
.ppc_sys_name = "8343", .ppc_sys_name = "8343",
.mask = 0xFFFF0000, .mask = 0xFFFF0000,
.value = 0x80550000, .value = 0x80550000,
.num_devices = 6, .num_devices = 7,
.device_list = (enum ppc_sys_devices[]) .device_list = (enum ppc_sys_devices[])
{ {
MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_IIC2, MPC83xx_DUART,
MPC83xx_USB2_DR, MPC83xx_USB2_DR, MPC83xx_MDIO
}, },
}, },
{ /* default match */ { /* default match */
......
...@@ -107,6 +107,7 @@ enum ppc_sys_devices { ...@@ -107,6 +107,7 @@ enum ppc_sys_devices {
MPC83xx_SEC2, MPC83xx_SEC2,
MPC83xx_USB2_DR, MPC83xx_USB2_DR,
MPC83xx_USB2_MPH, MPC83xx_USB2_MPH,
MPC83xx_MDIO,
}; };
#endif /* CONFIG_83xx */ #endif /* CONFIG_83xx */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment