add support for the AMCC Taishan, mark it as broken until we fix the combined layout
[openwrt-10.03/.git] / target / linux / amcc-2.6 / patches / 100-taishan_emac.patch
1 diff -Nur linux-2.6.21/drivers/net/ibm_emac/ibm_emac_phy.c linux-2.6.21-owrt/drivers/net/ibm_emac/ibm_emac_phy.c
2 --- linux-2.6.21/drivers/net/ibm_emac/ibm_emac_phy.c    2007-04-27 23:49:26.000000000 +0200
3 +++ linux-2.6.21-owrt/drivers/net/ibm_emac/ibm_emac_phy.c       2007-05-28 16:27:15.000000000 +0200
4 @@ -299,11 +299,50 @@
5         .ops            = &cis8201_phy_ops
6  };
7  
8 +#if defined(CONFIG_TAISHAN)
9 +static int et1011c_init(struct mii_phy *phy)
10 +{
11 +       u16 reg_short;
12 +
13 +       reg_short = (u16)(phy_read(phy,0x16));
14 +       reg_short &= ~(0x7);
15 +       reg_short |= 0x6;       /* RGMII Trace Delay*/  
16 +       phy_write(phy, 0x16, reg_short);
17 +                       
18 +       reg_short = (u16)(phy_read(phy, 0x17));
19 +       reg_short &= ~(0x40);
20 +       phy_write(phy, 0x17, reg_short);
21 +       
22 +       phy_write(phy,0x1c,0x74f0);
23 +       return 0;
24 +}
25 +       
26 +static struct mii_phy_ops et1011c_phy_ops = {
27 +       .init           = et1011c_init,
28 +       .setup_aneg     = genmii_setup_aneg,
29 +       .setup_forced   = genmii_setup_forced,
30 +       .poll_link      = genmii_poll_link,
31 +       .read_link      = genmii_read_link
32 +};
33 +
34 +static struct mii_phy_def et1011c_phy_def = {
35 +       .phy_id         = 0x0282f000,
36 +       .phy_id_mask    = 0x0fffff00,
37 +       .name           = "ET1011C Gigabit Ethernet",
38 +       .ops            = &et1011c_phy_ops
39 +};
40 +
41 +static struct mii_phy_def *mii_phy_table[] = {
42 +       &et1011c_phy_def,
43 +       NULL
44 +};
45 +#else
46  static struct mii_phy_def *mii_phy_table[] = {
47         &cis8201_phy_def,
48         &genmii_phy_def,
49         NULL
50  };
51 +#endif
52  
53  int mii_phy_probe(struct mii_phy *phy, int address)
54  {
55 diff -Nur linux-2.6.21/drivers/net/ibm_emac/ibm_emac_zmii.c linux-2.6.21-owrt/drivers/net/ibm_emac/ibm_emac_zmii.c
56 --- linux-2.6.21/drivers/net/ibm_emac/ibm_emac_zmii.c   2007-04-27 23:49:26.000000000 +0200
57 +++ linux-2.6.21-owrt/drivers/net/ibm_emac/ibm_emac_zmii.c      2007-05-28 16:26:48.000000000 +0200
58 @@ -170,6 +170,13 @@
59         struct ocp_func_emac_data *emacdata = dev->def->additions;
60  
61         if (emacdata->zmii_idx >= 0) {
62 +#if defined(CONFIG_TAISHAN)
63 +               /* don't attach emac0 and emac1 */
64 +               if( dev->def->index < 2 ) 
65 +               {
66 +                       return -ENODEV;
67 +               }
68 +#endif         
69                 dev->zmii_input = emacdata->zmii_mux;
70                 dev->zmii_dev =
71                     ocp_find_device(OCP_VENDOR_IBM, OCP_FUNC_ZMII,