0300-mt7628_fixes.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. --- a/arch/mips/ralink/mt7620.c
  2. +++ b/arch/mips/ralink/mt7620.c
  3. @@ -101,28 +101,28 @@ static struct rt2880_pmx_group mt7620a_p
  4. };
  5. static struct rt2880_pmx_func pwm1_grp_mt7628[] = {
  6. - FUNC("sdxc", 3, 19, 1),
  7. + FUNC("sdxc d6", 3, 19, 1),
  8. FUNC("utif", 2, 19, 1),
  9. FUNC("gpio", 1, 19, 1),
  10. - FUNC("pwm", 0, 19, 1),
  11. + FUNC("pwm1", 0, 19, 1),
  12. };
  13. static struct rt2880_pmx_func pwm0_grp_mt7628[] = {
  14. - FUNC("sdxc", 3, 18, 1),
  15. + FUNC("sdxc d7", 3, 18, 1),
  16. FUNC("utif", 2, 18, 1),
  17. FUNC("gpio", 1, 18, 1),
  18. - FUNC("pwm", 0, 18, 1),
  19. + FUNC("pwm0", 0, 18, 1),
  20. };
  21. static struct rt2880_pmx_func uart2_grp_mt7628[] = {
  22. - FUNC("sdxc", 3, 20, 2),
  23. + FUNC("sdxc d5 d4", 3, 20, 2),
  24. FUNC("pwm", 2, 20, 2),
  25. FUNC("gpio", 1, 20, 2),
  26. FUNC("uart2", 0, 20, 2),
  27. };
  28. static struct rt2880_pmx_func uart1_grp_mt7628[] = {
  29. - FUNC("sdxc", 3, 45, 2),
  30. + FUNC("sw_r", 3, 45, 2),
  31. FUNC("pwm", 2, 45, 2),
  32. FUNC("gpio", 1, 45, 2),
  33. FUNC("uart1", 0, 45, 2),
  34. @@ -165,7 +165,7 @@ static struct rt2880_pmx_func spi_cs1_gr
  35. FUNC("-", 3, 6, 1),
  36. FUNC("refclk", 2, 6, 1),
  37. FUNC("gpio", 1, 6, 1),
  38. - FUNC("spi", 0, 6, 1),
  39. + FUNC("spi cs1", 0, 6, 1),
  40. };
  41. static struct rt2880_pmx_func spis_grp_mt7628[] = {
  42. @@ -182,27 +182,43 @@ static struct rt2880_pmx_func gpio_grp_m
  43. FUNC("gpio", 0, 11, 1),
  44. };
  45. -#define MT7628_GPIO_MODE_MASK 0x3
  46. -
  47. -#define MT7628_GPIO_MODE_PWM1 30
  48. -#define MT7628_GPIO_MODE_PWM0 28
  49. -#define MT7628_GPIO_MODE_UART2 26
  50. -#define MT7628_GPIO_MODE_UART1 24
  51. -#define MT7628_GPIO_MODE_I2C 20
  52. -#define MT7628_GPIO_MODE_REFCLK 18
  53. -#define MT7628_GPIO_MODE_PERST 16
  54. -#define MT7628_GPIO_MODE_WDT 14
  55. -#define MT7628_GPIO_MODE_SPI 12
  56. -#define MT7628_GPIO_MODE_SDMODE 10
  57. -#define MT7628_GPIO_MODE_UART0 8
  58. -#define MT7628_GPIO_MODE_I2S 6
  59. -#define MT7628_GPIO_MODE_CS1 4
  60. -#define MT7628_GPIO_MODE_SPIS 2
  61. -#define MT7628_GPIO_MODE_GPIO 0
  62. +static struct rt2880_pmx_func wled_kn_grp_mt7628[] = {
  63. + FUNC("rsvd", 3, 35, 1),
  64. + FUNC("rsvd", 2, 35, 1),
  65. + FUNC("gpio", 1, 35, 1),
  66. + FUNC("wled_kn", 0, 35, 1),
  67. +};
  68. +
  69. +static struct rt2880_pmx_func wled_an_grp_mt7628[] = {
  70. + FUNC("rsvd", 3, 35, 1),
  71. + FUNC("rsvd", 2, 35, 1),
  72. + FUNC("gpio", 1, 35, 1),
  73. + FUNC("wled_an", 0, 35, 1),
  74. +};
  75. +
  76. +#define MT7628_GPIO_MODE_MASK 0x3
  77. +
  78. +#define MT7628_GPIO_MODE_WLED_KN 48
  79. +#define MT7628_GPIO_MODE_WLED_AN 32
  80. +#define MT7628_GPIO_MODE_PWM1 30
  81. +#define MT7628_GPIO_MODE_PWM0 28
  82. +#define MT7628_GPIO_MODE_UART2 26
  83. +#define MT7628_GPIO_MODE_UART1 24
  84. +#define MT7628_GPIO_MODE_I2C 20
  85. +#define MT7628_GPIO_MODE_REFCLK 18
  86. +#define MT7628_GPIO_MODE_PERST 16
  87. +#define MT7628_GPIO_MODE_WDT 14
  88. +#define MT7628_GPIO_MODE_SPI 12
  89. +#define MT7628_GPIO_MODE_SDMODE 10
  90. +#define MT7628_GPIO_MODE_UART0 8
  91. +#define MT7628_GPIO_MODE_I2S 6
  92. +#define MT7628_GPIO_MODE_CS1 4
  93. +#define MT7628_GPIO_MODE_SPIS 2
  94. +#define MT7628_GPIO_MODE_GPIO 0
  95. static struct rt2880_pmx_group mt7628an_pinmux_data[] = {
  96. - GRP_G("pmw1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_PWM1),
  97. - GRP_G("pmw0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_PWM0),
  98. + GRP_G("pwm1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_PWM1),
  99. + GRP_G("pwm0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_PWM0),
  100. GRP_G("uart2", uart2_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_UART2),
  101. GRP_G("uart1", uart1_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_UART1),
  102. GRP_G("i2c", i2c_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_I2C),
  103. @@ -216,6 +232,8 @@ static struct rt2880_pmx_group mt7628an_
  104. GRP_G("spi cs1", spi_cs1_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_CS1),
  105. GRP_G("spis", spis_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_SPIS),
  106. GRP_G("gpio", gpio_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_GPIO),
  107. + GRP_G("wled_an", wled_an_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_WLED_AN),
  108. + GRP_G("wled_kn", wled_kn_grp_mt7628, MT7628_GPIO_MODE_MASK, 1, MT7628_GPIO_MODE_WLED_KN),
  109. { 0 }
  110. };
  111. @@ -532,7 +550,11 @@ void prom_soc_init(struct ralink_soc_inf
  112. (rev & CHIP_REV_ECO_MASK));
  113. cfg0 = __raw_readl(sysc + SYSC_REG_SYSTEM_CONFIG0);
  114. - dram_type = (cfg0 >> SYSCFG0_DRAM_TYPE_SHIFT) & SYSCFG0_DRAM_TYPE_MASK;
  115. +
  116. + if (ralink_soc == MT762X_SOC_MT7628AN)
  117. + dram_type = ((cfg0&0x00000001) == 0x00000001)?SYSCFG0_DRAM_TYPE_DDR1_MT7628:SYSCFG0_DRAM_TYPE_DDR2_MT7628;
  118. + else
  119. + dram_type = (cfg0 >> SYSCFG0_DRAM_TYPE_SHIFT) & SYSCFG0_DRAM_TYPE_MASK;
  120. soc_info->mem_base = MT7620_DRAM_BASE;
  121. if (ralink_soc == MT762X_SOC_MT7628AN)