kernel: support bgmac on BCM47094
[15.05/openwrt.git] / target / linux / generic / patches-3.18 / 773-bgmac-add-srab-switch.patch
index b883d73..5597313 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  #include <bcm47xx_nvram.h>
  
  static const struct bcma_device_id bgmac_bcma_tbl[] = {
  #include <bcm47xx_nvram.h>
  
  static const struct bcma_device_id bgmac_bcma_tbl[] = {
-@@ -1538,6 +1539,17 @@ static void bgmac_mii_unregister(struct
+@@ -1544,6 +1545,17 @@ static void bgmac_mii_unregister(struct
        mdiobus_free(mii_bus);
  }
  
        mdiobus_free(mii_bus);
  }
  
@@ -30,13 +30,11 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  /**************************************************
   * BCMA bus ops
   **************************************************/
  /**************************************************
   * BCMA bus ops
   **************************************************/
-@@ -1664,6 +1676,16 @@ static int bgmac_probe(struct bcma_devic
+@@ -1668,6 +1680,14 @@ static int bgmac_probe(struct bcma_devic
        net_dev->hw_features = net_dev->features;
        net_dev->vlan_features = net_dev->features;
  
        net_dev->hw_features = net_dev->features;
        net_dev->vlan_features = net_dev->features;
  
-+      if ((ci->id == BCMA_CHIP_ID_BCM4707 ||
-+           ci->id == BCMA_CHIP_ID_BCM53018) &&
-+          !bgmac_b53_pdata.regs) {
++      if (bgmac_is_bcm4707_family(bgmac) && !bgmac_b53_pdata.regs) {
 +              bgmac_b53_pdata.regs = ioremap_nocache(0x18007000, 0x1000);
 +
 +              err = platform_device_register(&bgmac_b53_dev);
 +              bgmac_b53_pdata.regs = ioremap_nocache(0x18007000, 0x1000);
 +
 +              err = platform_device_register(&bgmac_b53_dev);
@@ -47,7 +45,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
        err = register_netdev(bgmac->net_dev);
        if (err) {
                bgmac_err(bgmac, "Cannot register net device\n");
        err = register_netdev(bgmac->net_dev);
        if (err) {
                bgmac_err(bgmac, "Cannot register net device\n");
-@@ -1690,6 +1712,10 @@ static void bgmac_remove(struct bcma_dev
+@@ -1694,6 +1714,10 @@ static void bgmac_remove(struct bcma_dev
  {
        struct bgmac *bgmac = bcma_get_drvdata(core);
  
  {
        struct bgmac *bgmac = bcma_get_drvdata(core);