b43: LCN-PHY: add init tables
They were taken from MMIO dump with few RegExps and vim.
---
Magic RegExps were:
:%s/phy_write(0x0455) <- \([0-9a-fA-Fx]*\)\n\(phy_write(0x0456) <- [0-9a-fA-Fx]*\nphy_write(0x0456) <- [0-9a-fA-Fx]*\)/\rstatic const u16 b43_lcntab_\1[] = {\r\2/ :%s/phy_write(0x0455) <- \([0-9a-fA-Fx]*\)\n\(phy_write(0x0457) <- [0-9a-fA-Fx]*\nphy_write(0x0456) <- [0-9a-fA-Fx]*\)/\rstatic const u32 b43_lcntab_\1[] = {\r\2/
:%s/phy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)/\t\1, \2, \3, \4, \5, \6,/ :%s/phy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)/\t\1, \2, \3, \4, \5,/ :%s/phy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)/\t\1, \2, \3, \4,/
:%s/phy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)/\t\1, \2, \3,/
:%s/phy_write(0x0456) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- \([0-9a-fA-Fx]*\)/\t\1, \2,/
:%s/phy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)\nphy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)\nphy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)\nphy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)/\t\1\2, \3\4, \5\6, \7\8,/ :%s/phy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)\nphy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)\nphy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)/\t\1\2, \3\4, \5\6,/
:%s/phy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)\nphy_write(0x0457) <- \([0-9a-fA-Fx]*\)\nphy_write(0x0456) <- 0x\([0-9a-fA-F]*\)/\t\1\2, \3\4,/
:%s/^b43_lcntab_0x\([0-9a-fA-F]*\)_0x\([0-9a-fA-F]*\)/lcntab_upload(dev, B43_lcnTABx(0x\1, 0x\2), b43_lcntab_0x\1_0x\2);/ :%s/^b43_lcntab_0x\([0-9a-fA-F]*\)/lcntab_upload(dev, B43_lcnTABx(0x\1, 0), b43_lcntab_0x\1);/
The rest was adjusted manually.
--- drivers/net/wireless/b43/phy_lcn.h | 3 + drivers/net/wireless/b43/tables_phy_lcn.c | 432 +++++++++++++++++++++++++++++ drivers/net/wireless/b43/tables_phy_lcn.h | 16 + 3 files changed, 451 insertions(+), 0 deletions(-)
drivers/net/wireless/b43/phy_lcn.h +3 -0
@@ -8,6 +8,9 @@#define B43_PHY_LCN_AFE_CTL2 B43_PHY_OFDM(0x03C)#define B43_PHY_LCN_RF_CTL1 B43_PHY_OFDM(0x04C)#define B43_PHY_LCN_RF_CTL2 B43_PHY_OFDM(0x04D) +#define B43_PHY_LCN_TABLE_ADDR B43_PHY_OFDM(0x055)/* Table address */ +#define B43_PHY_LCN_TABLE_DATALO B43_PHY_OFDM(0x056)/* Table data low */ +#define B43_PHY_LCN_TABLE_DATAHI B43_PHY_OFDM(0x057)/* Table data high */ #define B43_PHY_LCN_RF_CTL3 B43_PHY_OFDM(0x0B0)#define B43_PHY_LCN_RF_CTL4 B43_PHY_OFDM(0x0B1)#define B43_PHY_LCN_RF_CTL5 B43_PHY_OFDM(0x0B7)
drivers/net/wireless/b43/tables_phy_lcn.c +432 -0
442 lines not on this page · raw message
drivers/net/wireless/b43/tables_phy_lcn.h +16 -0
@@ -1,6 +1,22 @@#ifndef B43_TABLES_PHY_LCN_H_ #define B43_TABLES_PHY_LCN_H_ +/* The LCN-PHY tables. */ +#define B43_LCNTAB_TYPEMASK 0xF0000000 +#define B43_LCNTAB_8BIT 0x10000000 +#define B43_LCNTAB_16BIT 0x20000000 +#define B43_LCNTAB_32BIT 0x30000000 +#define B43_LCNTAB8 (table, offset) (((table) << 10) | (offset) | B43_LCNTAB_8BIT) +#define B43_LCNTAB16 (table, offset) (((table) << 10) | (offset) | B43_LCNTAB_16BIT) +#define B43_LCNTAB32 (table, offset) (((table) << 10) | (offset) | B43_LCNTAB_32BIT) + +u32 b43_lcntab_read (struct b43_wldev *dev,u32 offset); +void b43_lcntab_read_bulk (struct b43_wldev *dev,u32 offset, +unsigned int nr_elements,void *_data); +void b43_lcntab_write (struct b43_wldev *dev,u32 offset,u32 value); +void b43_lcntab_write_bulk (struct b43_wldev *dev,u32 offset, +unsigned int nr_elements,const void *_data); +void b43_phy_lcn_tables_init (struct b43_wldev *dev);#endif /* B43_TABLES_PHY_LCN_H_ */
Signature · 1 line
1.7.3.4