600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From 0094872a5e8e4664c6ea1b2dfa487063d39ae363 Mon Sep 17 00:00:00 2001
  2. From: Gabor Juhos <juhosg@openwrt.org>
  3. Date: Sun, 24 Mar 2013 19:26:26 +0100
  4. Subject: [PATCH] rt2x00: rt2800lib: add MAC register initialization for
  5. RT3883
  6. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  7. ---
  8. drivers/net/wireless/ralink/rt2x00/rt2800.h | 14 ++++++++++++++
  9. drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 19 ++++++++++++++++---
  10. 2 files changed, 30 insertions(+), 3 deletions(-)
  11. --- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
  12. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
  13. @@ -1727,6 +1727,20 @@
  14. #define TX_PWR_CFG_9B_STBC_MCS7 FIELD32(0x000000ff)
  15. /*
  16. + * TX_TXBF_CFG:
  17. + */
  18. +#define TX_TXBF_CFG_0 0x138c
  19. +#define TX_TXBF_CFG_1 0x13a4
  20. +#define TX_TXBF_CFG_2 0x13a8
  21. +#define TX_TXBF_CFG_3 0x13ac
  22. +
  23. +/*
  24. + * TX_FBK_CFG_3S:
  25. + */
  26. +#define TX_FBK_CFG_3S_0 0x13c4
  27. +#define TX_FBK_CFG_3S_1 0x13c8
  28. +
  29. +/*
  30. * RX_FILTER_CFG: RX configuration register.
  31. */
  32. #define RX_FILTER_CFG 0x1400
  33. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  34. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  35. @@ -5485,6 +5485,12 @@ static int rt2800_init_registers(struct
  36. rt2800_register_write(rt2x00dev, TX_SW_CFG2,
  37. 0x00000000);
  38. }
  39. + } else if (rt2x00_rt(rt2x00dev, RT3883)) {
  40. + rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000402);
  41. + rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000);
  42. + rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00040000);
  43. + rt2800_register_write(rt2x00dev, TX_TXBF_CFG_0, 0x8000fc21);
  44. + rt2800_register_write(rt2x00dev, TX_TXBF_CFG_3, 0x00009c40);
  45. } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  46. rt2x00_rt(rt2x00dev, RT5392) ||
  47. rt2x00_rt(rt2x00dev, RT6352)) {
  48. @@ -5698,6 +5704,11 @@ static int rt2800_init_registers(struct
  49. reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002;
  50. rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg);
  51. + if (rt2x00_rt(rt2x00dev, RT3883)) {
  52. + rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_0, 0x12111008);
  53. + rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_1, 0x16151413);
  54. + }
  55. +
  56. rt2800_register_read(rt2x00dev, TX_RTS_CFG, &reg);
  57. rt2x00_set_field32(&reg, TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT, 7);
  58. rt2x00_set_field32(&reg, TX_RTS_CFG_RTS_THRES,