aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/adm6996.h
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-11-09 19:27:27 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2013-11-09 19:27:27 +0000
commit7a82667372af7eb372133fd6bb0e3322c8c02df1 (patch)
treec5abe17c0a150f119deb3f624de5eb081a260e77 /target/linux/generic/files/drivers/net/phy/adm6996.h
parente75584e2898d34ff319a5ac55bef2dd469321d8f (diff)
downloadupstream-7a82667372af7eb372133fd6bb0e3322c8c02df1.tar.gz
upstream-7a82667372af7eb372133fd6bb0e3322c8c02df1.tar.bz2
upstream-7a82667372af7eb372133fd6bb0e3322c8c02df1.zip
kernel: adm6996: add support for ADM6996L and GPIO interface
This patch makes it possible to use adm6996.c on first generation BCM47XX devices with ADM switches. The GPIO bit banging protocol implementation was copied from the old switch driver and adapted to this driver and changed to the mainline kernel GPIO interface. The ADM6996L is different from the ADM6996M which is supported, for both specs are available in the Internet. This was tested on a WRT54GS version 1.0, thank you Dirk Neukirchen for the device. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 38698
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/adm6996.h')
-rw-r--r--target/linux/generic/files/drivers/net/phy/adm6996.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/adm6996.h b/target/linux/generic/files/drivers/net/phy/adm6996.h
index 6922dfcbbd..b30eceafdd 100644
--- a/target/linux/generic/files/drivers/net/phy/adm6996.h
+++ b/target/linux/generic/files/drivers/net/phy/adm6996.h
@@ -46,6 +46,7 @@ enum admreg {
ADM_EEPROM_EXT_BASE = 0x40,
#define ADM_VLAN_FILT_L(n) (ADM_EEPROM_EXT_BASE + 2 * (n))
#define ADM_VLAN_FILT_H(n) (ADM_EEPROM_EXT_BASE + 1 + 2 * (n))
+#define ADM_VLAN_MAP(n) (ADM_EEPROM_BASE + 0x13 + n)
ADM_COUNTER_BASE = 0xa0,
ADM_SIG0 = ADM_COUNTER_BASE + 0,
ADM_SIG1 = ADM_COUNTER_BASE + 1,
@@ -132,7 +133,8 @@ enum {
};
/* Tag Based VLAN in ADM_SYSC3 */
-#define ADM_TBV (1 << 5)
+#define ADM_MAC_CLONE BIT(4)
+#define ADM_TBV BIT(5)
static const u8 adm_portcfg[] = {
[0] = ADM_P0_CFG,
@@ -152,6 +154,10 @@ static const u8 adm_portcfg[] = {
#define ADM_VLAN_FILT_VALID (1 << 15)
#define ADM_VLAN_FILT_VID(n) (((n) & 0xfff) << 0)
+/* Convert ports to a form for ADM6996L VLAN map */
+#define ADM_VLAN_FILT(ports) ((ports & 0x01) | ((ports & 0x02) << 1) | \
+ ((ports & 0x04) << 2) | ((ports & 0x08) << 3) | \
+ ((ports & 0x10) << 3) | ((ports & 0x20) << 3))
/*
* Split the register address in phy id and register