summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-03-09 21:57:11 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-03-09 21:57:11 +0000
commit04909ca614cb2b52dafe1f558743108d62a6db65 (patch)
treeb143c90e6ff29d857d80e2f14b5217de81250cfe /package
parentea601ebe33ab09c4e1c61adb4e6c46866edc749e (diff)
downloadmtk-20170518-04909ca614cb2b52dafe1f558743108d62a6db65.zip
mtk-20170518-04909ca614cb2b52dafe1f558743108d62a6db65.tar.gz
mtk-20170518-04909ca614cb2b52dafe1f558743108d62a6db65.tar.bz2
allow kmod-switch to be used on brcm63xx (#4599)
SVN-Revision: 14825
Diffstat (limited to 'package')
-rw-r--r--package/switch/Makefile2
-rw-r--r--package/switch/src/gpio.h10
-rw-r--r--package/switch/src/switch-robo.c6
3 files changed, 14 insertions, 4 deletions
diff --git a/package/switch/Makefile b/package/switch/Makefile
index 43a4ee2..01e2314 100644
--- a/package/switch/Makefile
+++ b/package/switch/Makefile
@@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/switch
SUBMENU:=Other modules
- DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx
+ DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx||TARGET_brcm63xx
TITLE:=Switch drivers
FILES:= \
$(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \
diff --git a/package/switch/src/gpio.h b/package/switch/src/gpio.h
index f4fadfc..e541cda 100644
--- a/package/switch/src/gpio.h
+++ b/package/switch/src/gpio.h
@@ -11,7 +11,15 @@
#ifdef BROADCOM
#include "gpio-bcm947xx.h"
#else
-#error "Unsupported configuration."
+#warning "Unsupported configuration."
+
+#define gpio_in() (-1U)
+#define gpio_out(mask, value) (-1U)
+#define gpio_outen(mask, value) (-1U)
+#define gpio_control(mask, value) (-1U)
+#define gpio_intmask(mask, value) (-1U)
+#define gpio_intpolarity(mask, value) (-1U)
+
#endif
#endif /* __GPIO_H */
diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c
index 779b89f..5733d50 100644
--- a/package/switch/src/switch-robo.c
+++ b/package/switch/src/switch-robo.c
@@ -41,6 +41,7 @@
#define ROBO_PHY_ADDR 0x1E /* robo switch phy address */
#define ROBO_PHY_ADDR_TG3 0x01 /* Tigon3 PHY address */
+#define ROBO_PHY_ADDR_BCM63XX 0x00 /* BCM63XX PHY address */
/* MII registers */
#define REG_MII_PAGE 0x10 /* MII Page register */
@@ -318,13 +319,14 @@ static int robo_probe(char *devname)
/* got phy address check for robo address */
struct mii_ioctl_data *mii = (struct mii_ioctl_data *) &robo.ifr.ifr_data;
if ((mii->phy_id != ROBO_PHY_ADDR) &&
+ (mii->phy_id != ROBO_PHY_ADDR_BCM63XX) &&
(mii->phy_id != ROBO_PHY_ADDR_TG3)) {
printk("Invalid phy address (%d)\n", mii->phy_id);
return 1;
}
robo.use_et = 0;
/* The robo has a fixed PHY address that is different from the
- * Tigon3 PHY address. */
+ * Tigon3 and BCM63xx PHY address. */
robo.phy_addr = ROBO_PHY_ADDR;
}
@@ -332,7 +334,7 @@ static int robo_probe(char *devname)
(mdio_read(robo.phy_addr, 0x3) << 16);
if (phyid == 0xffffffff || phyid == 0x55210022) {
- printk("No Robo switch in managed mode found\n");
+ printk("No Robo switch in managed mode found, phy_id = 0x%08x\n", phyid);
return 1;
}