600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. @@ -1588,6 +1588,20 @@
  14. #define TX_PWR_CFG_9_STBC7_CH2 FIELD32(0x00000f00)
  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. @@ -4982,6 +4982,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, RT5592)) {
  48. @@ -5012,9 +5018,11 @@ static int rt2800_init_registers(struct
  49. rt2800_register_read(rt2x00dev, MAX_LEN_CFG, &reg);
  50. rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE);
  51. - if (rt2x00_rt_rev_gte(rt2x00dev, RT2872, REV_RT2872E) ||
  52. - rt2x00_rt(rt2x00dev, RT2883) ||
  53. - rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070E))
  54. + if (rt2x00_rt(rt2x00dev, RT3883))
  55. + rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 3);
  56. + else if (rt2x00_rt_rev_gte(rt2x00dev, RT2872, REV_RT2872E) ||
  57. + rt2x00_rt(rt2x00dev, RT2883) ||
  58. + rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070E))
  59. rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 2);
  60. else
  61. rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 1);
  62. @@ -5167,6 +5175,11 @@ static int rt2800_init_registers(struct
  63. reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002;
  64. rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg);
  65. + if (rt2x00_rt(rt2x00dev, RT3883)) {
  66. + rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_0, 0x12111008);
  67. + rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_1, 0x16151413);
  68. + }
  69. +
  70. rt2800_register_read(rt2x00dev, TX_RTS_CFG, &reg);
  71. rt2x00_set_field32(&reg, TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT, 32);
  72. rt2x00_set_field32(&reg, TX_RTS_CFG_RTS_THRES,