diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2013-11-09 19:27:27 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2013-11-09 19:27:27 +0000 |
commit | a7735a2d91b7e676f48d2d014cc905215653a6e3 (patch) | |
tree | 59575830378cae53e1fe7633de002140f717926c /target/linux/generic/files/drivers/net/phy/adm6996.h | |
parent | 966c6933610949e88cd9d8359184607b41af26ca (diff) | |
download | master-187ad058-a7735a2d91b7e676f48d2d014cc905215653a6e3.tar.gz master-187ad058-a7735a2d91b7e676f48d2d014cc905215653a6e3.tar.bz2 master-187ad058-a7735a2d91b7e676f48d2d014cc905215653a6e3.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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38698 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/adm6996.h')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/adm6996.h | 8 |
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 |