Advertisement
Guest User

Untitled

a guest
Feb 19th, 2013
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 31.47 KB | None | 0 0
  1. --- /dev/null   2013-02-17 16:08:41.569847969 +0400
  2. +++ package/mac80211/patches/630-rt2x00-support-rt5350.patch    2013-02-16 17:57:44.474511176 +0400
  3. @@ -0,0 +1,438 @@
  4. +--- a/drivers/net/wireless/rt2x00/rt2800.h
  5. ++++ b/drivers/net/wireless/rt2x00/rt2800.h
  6. +@@ -69,6 +69,7 @@
  7. + #define RF3322                0x000c
  8. + #define RF3053                0x000d
  9. + #define RF3290                0x3290
  10. ++#define RF5350                0x5350
  11. + #define RF5360                0x5360
  12. + #define RF5370                0x5370
  13. + #define RF5372                0x5372
  14. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  15. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  16. +@@ -2138,6 +2138,15 @@
  17. +   if (rf->channel <= 14) {
  18. +       int idx = rf->channel-1;
  19. +
  20. ++      if (rt2x00_rt(rt2x00dev, RT5350)) {
  21. ++          static const char r59_non_bt[] = {0x0b, 0x0b,
  22. ++              0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
  23. ++              0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
  24. ++
  25. ++          rt2800_rfcsr_write(rt2x00dev, 59,
  26. ++                     r59_non_bt[idx]);
  27. ++      }
  28. ++
  29. +       if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) {
  30. +           if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  31. +               /* r55/r59 value array of channel 1~14 */
  32. +@@ -2219,6 +2228,7 @@
  33. +   case RF3322:
  34. +       rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info);
  35. +       break;
  36. ++  case RF5350:
  37. +   case RF5360:
  38. +   case RF5370:
  39. +   case RF5372:
  40. +@@ -2232,6 +2242,7 @@
  41. +
  42. +   if (rt2x00_rf(rt2x00dev, RF3290) ||
  43. +       rt2x00_rf(rt2x00dev, RF3322) ||
  44. ++      rt2x00_rf(rt2x00dev, RF5350) ||
  45. +       rt2x00_rf(rt2x00dev, RF5360) ||
  46. +       rt2x00_rf(rt2x00dev, RF5370) ||
  47. +       rt2x00_rf(rt2x00dev, RF5372) ||
  48. +@@ -2362,7 +2373,8 @@
  49. +   /*
  50. +    * Clear update flag
  51. +    */
  52. +-  if (rt2x00_rt(rt2x00dev, RT3352)) {
  53. ++  if (rt2x00_rt(rt2x00dev, RT3352) ||
  54. ++      rt2x00_rt(rt2x00dev, RT5350)) {
  55. +       rt2800_bbp_read(rt2x00dev, 49, &bbp);
  56. +       rt2x00_set_field8(&bbp, BBP49_UPDATE_FLAG, 0);
  57. +       rt2800_bbp_write(rt2x00dev, 49, bbp);
  58. +@@ -2801,6 +2813,7 @@
  59. +       rt2800_rfcsr_write(rt2x00dev, 7, rfcsr);
  60. +       break;
  61. +   case RF3290:
  62. ++  case RF5350:
  63. +   case RF5360:
  64. +   case RF5370:
  65. +   case RF5372:
  66. +@@ -3125,7 +3138,8 @@
  67. +   } else if (rt2x00_rt(rt2x00dev, RT3572)) {
  68. +       rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400);
  69. +       rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
  70. +-  } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  71. ++  } else if (rt2x00_rt(rt2x00dev, RT5350) ||
  72. ++         rt2x00_rt(rt2x00dev, RT5390) ||
  73. +          rt2x00_rt(rt2x00dev, RT5392)) {
  74. +       rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
  75. +       rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
  76. +@@ -3507,6 +3521,10 @@
  77. +       rt2800_bbp_write(rt2x00dev, 4, 0x50);
  78. +   }
  79. +
  80. ++  if (rt2x00_rt(rt2x00dev, RT5350)) {
  81. ++      rt2800_bbp_write(rt2x00dev, 4, 0x50);
  82. ++  }
  83. ++
  84. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  85. +       rt2x00_rt(rt2x00dev, RT5390) ||
  86. +       rt2x00_rt(rt2x00dev, RT5392)) {
  87. +@@ -3519,11 +3537,13 @@
  88. +       rt2x00_rt(rt2x00dev, RT3290) ||
  89. +       rt2x00_rt(rt2x00dev, RT3352) ||
  90. +       rt2x00_rt(rt2x00dev, RT3572) ||
  91. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  92. +       rt2x00_rt(rt2x00dev, RT5390) ||
  93. +       rt2x00_rt(rt2x00dev, RT5392))
  94. +       rt2800_bbp_write(rt2x00dev, 31, 0x08);
  95. +
  96. +-  if (rt2x00_rt(rt2x00dev, RT3352))
  97. ++  if (rt2x00_rt(rt2x00dev, RT3352) ||
  98. ++      rt2x00_rt(rt2x00dev, RT5350))
  99. +       rt2800_bbp_write(rt2x00dev, 47, 0x48);
  100. +
  101. +   rt2800_bbp_write(rt2x00dev, 65, 0x2c);
  102. +@@ -3531,6 +3551,7 @@
  103. +
  104. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  105. +       rt2x00_rt(rt2x00dev, RT3352) ||
  106. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  107. +       rt2x00_rt(rt2x00dev, RT5390) ||
  108. +       rt2x00_rt(rt2x00dev, RT5392))
  109. +       rt2800_bbp_write(rt2x00dev, 68, 0x0b);
  110. +@@ -3540,6 +3561,7 @@
  111. +       rt2800_bbp_write(rt2x00dev, 73, 0x12);
  112. +   } else if (rt2x00_rt(rt2x00dev, RT3290) ||
  113. +          rt2x00_rt(rt2x00dev, RT3352) ||
  114. ++         rt2x00_rt(rt2x00dev, RT5350) ||
  115. +          rt2x00_rt(rt2x00dev, RT5390) ||
  116. +          rt2x00_rt(rt2x00dev, RT5392)) {
  117. +       rt2800_bbp_write(rt2x00dev, 69, 0x12);
  118. +@@ -3576,7 +3598,8 @@
  119. +       rt2800_bbp_write(rt2x00dev, 79, 0x18);
  120. +       rt2800_bbp_write(rt2x00dev, 80, 0x09);
  121. +       rt2800_bbp_write(rt2x00dev, 81, 0x33);
  122. +-  } else if (rt2x00_rt(rt2x00dev, RT3352)) {
  123. ++  } else if (rt2x00_rt(rt2x00dev, RT3352) ||
  124. ++      rt2x00_rt(rt2x00dev, RT5350)) {
  125. +       rt2800_bbp_write(rt2x00dev, 78, 0x0e);
  126. +       rt2800_bbp_write(rt2x00dev, 80, 0x08);
  127. +       rt2800_bbp_write(rt2x00dev, 81, 0x37);
  128. +@@ -3586,6 +3609,7 @@
  129. +
  130. +   rt2800_bbp_write(rt2x00dev, 82, 0x62);
  131. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  132. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  133. +       rt2x00_rt(rt2x00dev, RT5390) ||
  134. +       rt2x00_rt(rt2x00dev, RT5392))
  135. +       rt2800_bbp_write(rt2x00dev, 83, 0x7a);
  136. +@@ -3595,6 +3619,7 @@
  137. +   if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860D))
  138. +       rt2800_bbp_write(rt2x00dev, 84, 0x19);
  139. +   else if (rt2x00_rt(rt2x00dev, RT3290) ||
  140. ++       rt2x00_rt(rt2x00dev, RT5350) ||
  141. +        rt2x00_rt(rt2x00dev, RT5390) ||
  142. +        rt2x00_rt(rt2x00dev, RT5392))
  143. +       rt2800_bbp_write(rt2x00dev, 84, 0x9a);
  144. +@@ -3603,6 +3628,7 @@
  145. +
  146. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  147. +       rt2x00_rt(rt2x00dev, RT3352) ||
  148. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  149. +       rt2x00_rt(rt2x00dev, RT5390) ||
  150. +       rt2x00_rt(rt2x00dev, RT5392))
  151. +       rt2800_bbp_write(rt2x00dev, 86, 0x38);
  152. +@@ -3617,6 +3643,7 @@
  153. +
  154. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  155. +       rt2x00_rt(rt2x00dev, RT3352) ||
  156. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  157. +       rt2x00_rt(rt2x00dev, RT5390) ||
  158. +       rt2x00_rt(rt2x00dev, RT5392))
  159. +       rt2800_bbp_write(rt2x00dev, 92, 0x02);
  160. +@@ -3635,6 +3662,7 @@
  161. +       rt2x00_rt(rt2x00dev, RT3290) ||
  162. +       rt2x00_rt(rt2x00dev, RT3352) ||
  163. +       rt2x00_rt(rt2x00dev, RT3572) ||
  164. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  165. +       rt2x00_rt(rt2x00dev, RT5390) ||
  166. +       rt2x00_rt(rt2x00dev, RT5392) ||
  167. +       rt2800_is_305x_soc(rt2x00dev))
  168. +@@ -3644,6 +3672,7 @@
  169. +
  170. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  171. +       rt2x00_rt(rt2x00dev, RT3352) ||
  172. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  173. +       rt2x00_rt(rt2x00dev, RT5390) ||
  174. +       rt2x00_rt(rt2x00dev, RT5392))
  175. +       rt2800_bbp_write(rt2x00dev, 104, 0x92);
  176. +@@ -3654,13 +3683,15 @@
  177. +       rt2800_bbp_write(rt2x00dev, 105, 0x1c);
  178. +   else if (rt2x00_rt(rt2x00dev, RT3352))
  179. +       rt2800_bbp_write(rt2x00dev, 105, 0x34);
  180. +-  else if (rt2x00_rt(rt2x00dev, RT5390) ||
  181. ++  else if (rt2x00_rt(rt2x00dev, RT5350) ||
  182. ++       rt2x00_rt(rt2x00dev, RT5390) ||
  183. +        rt2x00_rt(rt2x00dev, RT5392))
  184. +       rt2800_bbp_write(rt2x00dev, 105, 0x3c);
  185. +   else
  186. +       rt2800_bbp_write(rt2x00dev, 105, 0x05);
  187. +
  188. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  189. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  190. +       rt2x00_rt(rt2x00dev, RT5390))
  191. +       rt2800_bbp_write(rt2x00dev, 106, 0x03);
  192. +   else if (rt2x00_rt(rt2x00dev, RT3352))
  193. +@@ -3670,11 +3701,13 @@
  194. +   else
  195. +       rt2800_bbp_write(rt2x00dev, 106, 0x35);
  196. +
  197. +-  if (rt2x00_rt(rt2x00dev, RT3352))
  198. ++  if (rt2x00_rt(rt2x00dev, RT3352) ||
  199. ++      rt2x00_rt(rt2x00dev, RT5350))
  200. +       rt2800_bbp_write(rt2x00dev, 120, 0x50);
  201. +
  202. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  203. +       rt2x00_rt(rt2x00dev, RT3352) ||
  204. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  205. +       rt2x00_rt(rt2x00dev, RT5390) ||
  206. +       rt2x00_rt(rt2x00dev, RT5392))
  207. +       rt2800_bbp_write(rt2x00dev, 128, 0x12);
  208. +@@ -3684,13 +3717,15 @@
  209. +       rt2800_bbp_write(rt2x00dev, 135, 0xf6);
  210. +   }
  211. +
  212. +-  if (rt2x00_rt(rt2x00dev, RT3352))
  213. ++  if (rt2x00_rt(rt2x00dev, RT3352) ||
  214. ++      rt2x00_rt(rt2x00dev, RT5350))
  215. +       rt2800_bbp_write(rt2x00dev, 137, 0x0f);
  216. +
  217. +   if (rt2x00_rt(rt2x00dev, RT3071) ||
  218. +       rt2x00_rt(rt2x00dev, RT3090) ||
  219. +       rt2x00_rt(rt2x00dev, RT3390) ||
  220. +       rt2x00_rt(rt2x00dev, RT3572) ||
  221. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  222. +       rt2x00_rt(rt2x00dev, RT5390) ||
  223. +       rt2x00_rt(rt2x00dev, RT5392)) {
  224. +       rt2800_bbp_read(rt2x00dev, 138, &value);
  225. +@@ -3727,7 +3762,8 @@
  226. +       rt2800_bbp_write(rt2x00dev, 3, value);
  227. +   }
  228. +
  229. +-  if (rt2x00_rt(rt2x00dev, RT3352)) {
  230. ++  if (rt2x00_rt(rt2x00dev, RT3352) ||
  231. ++      rt2x00_rt(rt2x00dev, RT5350)) {
  232. +       rt2800_bbp_write(rt2x00dev, 163, 0xbd);
  233. +       /* Set ITxBF timeout to 0x9c40=1000msec */
  234. +       rt2800_bbp_write(rt2x00dev, 179, 0x02);
  235. +@@ -3749,6 +3785,14 @@
  236. +       rt2800_bbp_write(rt2x00dev, 148, 0xc8);
  237. +   }
  238. +
  239. ++  if (rt2x00_rt(rt2x00dev, RT5350)) {
  240. ++      rt2800_bbp_write(rt2x00dev, 150, 0x40); /* Antenna Software OFDM */
  241. ++      rt2800_bbp_write(rt2x00dev, 151, 0x30); /* Antenna Software CCK */
  242. ++      rt2800_bbp_write(rt2x00dev, 152, 0xa3);
  243. ++      rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
  244. ++  }
  245. ++
  246. ++
  247. +   if (rt2x00_rt(rt2x00dev, RT5390) ||
  248. +       rt2x00_rt(rt2x00dev, RT5392)) {
  249. +       int ant, div_mode;
  250. +@@ -4143,6 +4187,78 @@
  251. +   rt2800_rfcsr_write(rt2x00dev, 31, 0x10);
  252. + }
  253. +
  254. ++static void rt2800_init_rfcsr_5350(struct rt2x00_dev *rt2x00dev)
  255. ++{
  256. ++  struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
  257. ++
  258. ++  rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
  259. ++  rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
  260. ++  rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
  261. ++  rt2800_rfcsr_write(rt2x00dev, 3, 0x08);
  262. ++  rt2800_rfcsr_write(rt2x00dev, 4, 0x49);
  263. ++  rt2800_rfcsr_write(rt2x00dev, 5, 0x10);
  264. ++  rt2800_rfcsr_write(rt2x00dev, 6, 0xe0);
  265. ++  rt2800_rfcsr_write(rt2x00dev, 7, 0x00);
  266. ++  rt2800_rfcsr_write(rt2x00dev, 8, 0xf1);
  267. ++  rt2800_rfcsr_write(rt2x00dev, 9, 0x02);
  268. ++  rt2800_rfcsr_write(rt2x00dev, 10, 0x53);
  269. ++  rt2800_rfcsr_write(rt2x00dev, 11, 0x4a);
  270. ++  rt2800_rfcsr_write(rt2x00dev, 12, 0x46);
  271. ++  if(pdata && pdata->clk_is_20mhz)
  272. ++      rt2800_rfcsr_write(rt2x00dev, 13, 0x1f);/*if clk_is_20mhz - 0x1f else 0x9f*/
  273. ++  else
  274. ++      rt2800_rfcsr_write(rt2x00dev, 13, 0x9f);
  275. ++  rt2800_rfcsr_write(rt2x00dev, 14, 0x00);
  276. ++  rt2800_rfcsr_write(rt2x00dev, 15, 0x00);
  277. ++  rt2800_rfcsr_write(rt2x00dev, 16, 0xc0);
  278. ++  rt2800_rfcsr_write(rt2x00dev, 18, 0x03);
  279. ++  rt2800_rfcsr_write(rt2x00dev, 19, 0x00);
  280. ++  rt2800_rfcsr_write(rt2x00dev, 20, 0x00);
  281. ++  rt2800_rfcsr_write(rt2x00dev, 21, 0x00);
  282. ++  rt2800_rfcsr_write(rt2x00dev, 22, 0x20);
  283. ++  rt2800_rfcsr_write(rt2x00dev, 23, 0x00);
  284. ++  rt2800_rfcsr_write(rt2x00dev, 24, 0x00);
  285. ++  rt2800_rfcsr_write(rt2x00dev, 25, 0x80);
  286. ++  rt2800_rfcsr_write(rt2x00dev, 26, 0x00);
  287. ++  rt2800_rfcsr_write(rt2x00dev, 27, 0x03);
  288. ++  rt2800_rfcsr_write(rt2x00dev, 28, 0x00);
  289. ++  rt2800_rfcsr_write(rt2x00dev, 29, 0xd0);
  290. ++  rt2800_rfcsr_write(rt2x00dev, 30, 0x10);
  291. ++  rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
  292. ++  rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
  293. ++  rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
  294. ++  rt2800_rfcsr_write(rt2x00dev, 34, 0x07);
  295. ++  rt2800_rfcsr_write(rt2x00dev, 35, 0x12);
  296. ++  rt2800_rfcsr_write(rt2x00dev, 36, 0x00);
  297. ++  rt2800_rfcsr_write(rt2x00dev, 37, 0x08);
  298. ++  rt2800_rfcsr_write(rt2x00dev, 38, 0x85);
  299. ++  rt2800_rfcsr_write(rt2x00dev, 39, 0x1b);
  300. ++  rt2800_rfcsr_write(rt2x00dev, 40, 0x0b);
  301. ++  rt2800_rfcsr_write(rt2x00dev, 41, 0xbb);
  302. ++  rt2800_rfcsr_write(rt2x00dev, 42, 0xd5);
  303. ++  rt2800_rfcsr_write(rt2x00dev, 43, 0x9b);
  304. ++  rt2800_rfcsr_write(rt2x00dev, 44, 0x0c);
  305. ++  rt2800_rfcsr_write(rt2x00dev, 45, 0xa6);
  306. ++  rt2800_rfcsr_write(rt2x00dev, 46, 0x73);
  307. ++  rt2800_rfcsr_write(rt2x00dev, 47, 0x00);
  308. ++  rt2800_rfcsr_write(rt2x00dev, 48, 0x10);
  309. ++  rt2800_rfcsr_write(rt2x00dev, 49, 0x80);
  310. ++  rt2800_rfcsr_write(rt2x00dev, 50, 0x00);
  311. ++  rt2800_rfcsr_write(rt2x00dev, 51, 0x00);
  312. ++  rt2800_rfcsr_write(rt2x00dev, 52, 0x38);
  313. ++  rt2800_rfcsr_write(rt2x00dev, 53, 0x00);
  314. ++  rt2800_rfcsr_write(rt2x00dev, 54, 0x38);
  315. ++  rt2800_rfcsr_write(rt2x00dev, 55, 0x43);
  316. ++  rt2800_rfcsr_write(rt2x00dev, 56, 0x82);
  317. ++  rt2800_rfcsr_write(rt2x00dev, 57, 0x00);
  318. ++  rt2800_rfcsr_write(rt2x00dev, 58, 0x39);
  319. ++  rt2800_rfcsr_write(rt2x00dev, 59, 0x0b);
  320. ++  rt2800_rfcsr_write(rt2x00dev, 60, 0x45);
  321. ++  rt2800_rfcsr_write(rt2x00dev, 61, 0xd1);
  322. ++  rt2800_rfcsr_write(rt2x00dev, 62, 0x00);
  323. ++  rt2800_rfcsr_write(rt2x00dev, 63, 0x00);
  324. ++}
  325. ++
  326. + static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev)
  327. + {
  328. +   rt2800_rfcsr_write(rt2x00dev, 1, 0x0f);
  329. +@@ -4305,6 +4421,7 @@
  330. +       !rt2x00_rt(rt2x00dev, RT3352) &&
  331. +       !rt2x00_rt(rt2x00dev, RT3390) &&
  332. +       !rt2x00_rt(rt2x00dev, RT3572) &&
  333. ++      !rt2x00_rt(rt2x00dev, RT5350) &&
  334. +       !rt2x00_rt(rt2x00dev, RT5390) &&
  335. +       !rt2x00_rt(rt2x00dev, RT5392) &&
  336. +       !rt2800_is_305x_soc(rt2x00dev))
  337. +@@ -4315,6 +4432,8 @@
  338. +    */
  339. +
  340. +   if (rt2x00_rt(rt2x00dev, RT3290) ||
  341. ++      rt2x00_rt(rt2x00dev, RT3352) ||
  342. ++      rt2x00_rt(rt2x00dev, RT5350) ||
  343. +       rt2x00_rt(rt2x00dev, RT5390) ||
  344. +       rt2x00_rt(rt2x00dev, RT5392)) {
  345. +       rt2800_rfcsr_read(rt2x00dev, 2, &rfcsr);
  346. +@@ -4355,6 +4474,9 @@
  347. +   case RT3572:
  348. +       rt2800_init_rfcsr_3572(rt2x00dev);
  349. +       break;
  350. ++  case RT5350:
  351. ++      rt2800_init_rfcsr_5350(rt2x00dev);
  352. ++      break;
  353. +   case RT5390:
  354. +       rt2800_init_rfcsr_5390(rt2x00dev);
  355. +       break;
  356. +@@ -4751,6 +4873,12 @@
  357. +       if (rt2x00_get_field16(word, EEPROM_NIC_CONF0_RXPATH) > 2)
  358. +           rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RXPATH, 2);
  359. +       rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word);
  360. ++  } else if(rt2x00_rt(rt2x00dev, RT5350)) {
  361. ++      rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RXPATH, 1);
  362. ++      rt2x00_set_field16(&word, EEPROM_NIC_CONF0_TXPATH, 1);
  363. ++      rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF3320);
  364. ++      rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word);
  365. ++      EEPROM(rt2x00dev, "rt5350: Ant: 0x%04x\n", word);
  366. +   }
  367. +
  368. +   rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &word);
  369. +@@ -4875,6 +5003,8 @@
  370. +       rt2x00_get_field32(reg, MAC_CSR0_CHIPSET) == RT5390 ||
  371. +       rt2x00_get_field32(reg, MAC_CSR0_CHIPSET) == RT5392)
  372. +       rt2x00_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &value);
  373. ++  else if(rt2x00_get_field32(reg, MAC_CSR0_CHIPSET) == RT5350)
  374. ++      value = RF5350;
  375. +   else
  376. +       value = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
  377. +
  378. +@@ -4892,6 +5022,7 @@
  379. +   case RT3352:
  380. +   case RT3390:
  381. +   case RT3572:
  382. ++  case RT5350:
  383. +   case RT5390:
  384. +   case RT5392:
  385. +       break;
  386. +@@ -4913,6 +5044,7 @@
  387. +   case RF3290:
  388. +   case RF3320:
  389. +   case RF3322:
  390. ++  case RF5350:
  391. +   case RF5360:
  392. +   case RF5370:
  393. +   case RF5372:
  394. +@@ -5276,7 +5408,8 @@
  395. +          rt2x00_rf(rt2x00dev, RF5392)) {
  396. +       spec->num_channels = 14;
  397. +       spec->channels = rf_vals_3x;
  398. +-  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
  399. ++  } else if (rt2x00_rf(rt2x00dev, RF3322) ||
  400. ++         rt2x00_rf(rt2x00dev, RF5350)) {
  401. +       spec->num_channels = 14;
  402. +       if (spec->clk_is_20mhz)
  403. +           spec->channels = rf_vals_xtal20mhz_3x;
  404. +@@ -5365,6 +5498,7 @@
  405. +   case RF3290:
  406. +   case RF5360:
  407. +   case RF5370:
  408. ++  case RF5350:
  409. +   case RF5372:
  410. +   case RF5390:
  411. +   case RF5392:
  412. +--- a/drivers/net/wireless/rt2x00/rt2800pci.c
  413. ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  414. +@@ -171,7 +171,7 @@
  415. + #else
  416. + static inline int rt2800pci_read_eeprom_pci(struct rt2x00_dev *rt2x00dev)
  417. + {
  418. +-  return -EOPNOTSUPP;
  419. ++  return 0;
  420. + }
  421. +
  422. + static inline int rt2800pci_efuse_detect(struct rt2x00_dev *rt2x00dev)
  423. +@@ -181,7 +181,7 @@
  424. +
  425. + static inline int rt2800pci_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev)
  426. + {
  427. +-  return -EOPNOTSUPP;
  428. ++  return 0;
  429. + }
  430. + #endif /* CONFIG_PCI */
  431. +
  432. +--- a/drivers/net/wireless/rt2x00/rt2x00.h
  433. ++++ b/drivers/net/wireless/rt2x00/rt2x00.h
  434. +@@ -194,6 +194,7 @@
  435. + #define RT3572        0x3572
  436. + #define RT3593        0x3593
  437. + #define RT3883        0x3883  /* WSOC */
  438. ++#define RT5350        0x5350  /* WSOC 2.4GHz */
  439. + #define RT5390        0x5390  /* 2.4GHz */
  440. + #define RT5392        0x5392  /* 2.4GHz */
  441. +
  442. --- target/linux/ramips/base-files/etc/diag.sh  2013-01-23 17:39:44.590302116 +0400
  443. +++ target/linux/ramips/base-files/etc/diag.sh  2012-12-18 21:32:38.000000000 +0400
  444. @@ -36,7 +36,7 @@
  445.     argus-atp52b)
  446.         status_led="argus-atp52b:green:run"
  447.         ;;
  448. -   dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | dir-620-a1)
  449. +   dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | dir-620-a1 | dir-320-b1 | dir-620-d1)
  450.         status_led="d-link:green:status"
  451.         ;;
  452.     dir-645)
  453. --- target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom  2013-01-23 17:39:44.574302315 +0400
  454. +++ target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom  2012-12-18 21:21:54.000000000 +0400
  455. @@ -63,6 +63,8 @@
  456.     carambola | \
  457.     dir-615-h1 | \
  458.     dir-620-a1 | \
  459. +   dir-320-b1 | \
  460. +   dir-620-d1 | \
  461.     esr-9753 | \
  462.     fonera20n | \
  463.     rt-n13u | \
  464. --- target/linux/ramips/base-files/etc/uci-defaults/01_leds 2013-01-23 17:39:44.590302115 +0400
  465. +++ target/linux/ramips/base-files/etc/uci-defaults/01_leds 2013-01-08 22:36:10.000000000 +0400
  466. @@ -40,11 +40,18 @@
  467.         ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1"
  468.         set_wifi_led "rt2800pci-phy0::radio"
  469.         ;;
  470. +   dir-320-b1)
  471. +       set_usb_led "d-link:green:usb"
  472. +       set_wifi_led "rt2800pci-phy0::radio"
  473. +       ;;
  474.     dir-615-d|\
  475.     dir-615-h1)
  476.         ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0"
  477.         set_wifi_led "rt2800pci-phy0::radio"
  478.         ;;
  479. +   dir-620-d1)
  480. +       set_wifi_led "d-link:amber:status"
  481. +       ;;
  482.     esr-9753)
  483.         set_wifi_led "rt2800pci-phy0::radio"
  484.         ;;
  485. --- target/linux/ramips/base-files/etc/uci-defaults/02_network  2013-01-23 17:39:44.590302115 +0400
  486. +++ target/linux/ramips/base-files/etc/uci-defaults/02_network  2012-12-20 22:33:28.000000000 +0400
  487. @@ -173,6 +173,12 @@
  488.         lan_mac=$(mtd_get_mac_binary factory 40)
  489.         wan_mac=$(macaddr_add "$lan_mac" 1)
  490.         ;;
  491. +  
  492. +   dir-320-b1)
  493. +       lan_mac=$(ramips_get_mac_binary factory 1032)
  494. +       wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1)
  495. +       ;;
  496. +
  497.  
  498.     dir-300-b1 |\
  499.     dir-300-b2 |\
  500. @@ -181,6 +187,7 @@
  501.         wan_mac=$(macaddr_add "$lan_mac" 1)
  502.         ;;
  503.  
  504. +   dir-620-d1 |\
  505.     dir-620-a1)
  506.         lan_mac=$(mtd_get_mac_binary factory 4)
  507.         lan_mac=$(macaddr_setbit_la "$lan_mac")
  508.  
  509. --- target/linux/ramips/base-files/lib/preinit/06_set_iface_mac 2013-01-23 17:39:44.550302619 +0400
  510. +++ target/linux/ramips/base-files/lib/preinit/06_set_iface_mac 2012-12-20 22:31:32.000000000 +0400
  511. @@ -15,6 +15,7 @@
  512.     bc2 |\
  513.     broadway |\
  514.     dir-620-a1 |\
  515. +   dir-620-d1 |\
  516.     esr-9753 |\
  517.     freestation5 |\
  518.     nw718 |\
  519. @@ -25,6 +26,10 @@
  520.         mac=$(maccalc or "$mac" "02:00:00:00:00:00")
  521.         ifconfig eth0 hw ether $mac 2>/dev/null
  522.         ;;
  523. +   dir-320-b1)
  524. +       mac=$(ramips_get_mac_binary factory 1032)
  525. +       ifconfig eth0 hw ether $mac 2>/dev/null
  526. +       ;;
  527.     dir-300-b1 |\
  528.     dir-300-b2 |\
  529.     dir-600-b1)
  530. --- target/linux/ramips/base-files/lib/ramips.sh    2013-01-23 17:39:44.550302619 +0400
  531. +++ target/linux/ramips/base-files/lib/ramips.sh    2012-12-18 21:35:10.000000000 +0400
  532. @@ -92,6 +92,12 @@
  533.     *"DIR-615 H1")
  534.         name="dir-615-h1"
  535.         ;;
  536. +   *"DIR-320 B1")
  537. +       name="dir-320-b1"
  538. +       ;;
  539. +   *"DIR-620 D1")
  540. +       name="dir-620-d1"
  541. +       ;;
  542.     *"DIR-615 D")
  543.         name="dir-615-d"
  544.         ;;
  545. --- target/linux/ramips/base-files/lib/upgrade/platform.sh  2013-01-23 17:39:44.534302820 +0400
  546. +++ target/linux/ramips/base-files/lib/upgrade/platform.sh  2012-12-18 21:36:44.000000000 +0400
  547. @@ -27,6 +27,8 @@
  548.     dir-615-h1 | \
  549.     dir-615-d | \
  550.     dir-620-a1 | \
  551. +   dir-620-d1 | \
  552. +   dir-320-b1 | \
  553.     dap-1350 | \
  554.     esr-9753 | \
  555.     fonera20n | \
  556. --- target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h   2013-01-23 17:49:40.958804747 +0400
  557. +++ target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h   2013-01-23 17:52:17.124841476 +0400
  558. @@ -71,6 +71,7 @@
  559.     /* RT3352 based machines */
  560.     RAMIPS_MACH_ALL5002,        /* Allnet ALL5002 */
  561.     RAMIPS_MACH_DIR_615_H1,
  562. +   RAMIPS_MACH_DIR_620_D1,
  563.  
  564.     /* RT3662 based machines */
  565.     RAMIPS_MACH_DIR_645,        /* D-Link DIR-645 */
  566. @@ -82,4 +83,5 @@
  567.  
  568.     /* RT5350 based machines */
  569.     RAMIPS_MACH_AIR3GII,        /* AirLive Air3GII */
  570. +   RAMIPS_MACH_DIR_320_B1      /* D-Link DIR-320/NRU */
  571.  };
  572. --- target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c 2013-01-23 17:39:45.362292411 +0400
  573. +++ target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c 2012-12-23 11:13:26.000000000 +0400
  574. @@ -116,12 +116,23 @@
  575.  
  576.  static void rt305x_fe_reset(void)
  577.  {
  578. -   u32 reset_bits = RT305X_RESET_FE;
  579. +   u32 val;
  580.  
  581. -   if (soc_is_rt5350())
  582. -       reset_bits |= RT305X_RESET_ESW;
  583. -   rt305x_sysc_wr(reset_bits, SYSC_REG_RESET_CTRL);
  584. -   rt305x_sysc_wr(0, SYSC_REG_RESET_CTRL);
  585. +   val = rt305x_sysc_rr(SYSC_REG_RESET_CTRL);
  586. +
  587. +   if (soc_is_rt5350()) {
  588. +       val = val | RT305X_RESET_FE | RT305X_RESET_ESW;
  589. +   } else {
  590. +       val = val | RT305X_RESET_FE;
  591. +   }
  592. +       rt305x_sysc_wr(SYSC_REG_RESET_CTRL, val);
  593. +
  594. +   if (soc_is_rt5350()) {
  595. +       val = val & ~(RT305X_RESET_FE | RT305X_RESET_ESW);
  596. +   } else {
  597. +       val = val & ~(RT305X_RESET_FE);
  598. +   }
  599. +       rt305x_sysc_wr(SYSC_REG_RESET_CTRL, val);
  600.  }
  601.  
  602.  static struct resource rt305x_eth_resources[] = {
  603. --- target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig   2013-01-23 17:39:45.382292158 +0400
  604. +++ target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig   2012-12-18 21:14:38.000000000 +0400
  605. @@ -76,6 +76,16 @@
  606.     select RALINK_DEV_GPIO_BUTTONS
  607.     select RALINK_DEV_GPIO_LEDS
  608.  
  609. +config RT305X_MACH_DIR_320_B1
  610. +   bool "D-Link DIR-320 revB1 board support"
  611. +   select RALINK_DEV_GPIO_BUTTONS
  612. +   select RALINK_DEV_GPIO_LEDS
  613. +
  614. +config RT305X_MACH_DIR_620_D1
  615. +   bool "D-Link DIR-620 revD1 board support"
  616. +   select RALINK_DEV_GPIO_BUTTONS
  617. +   select RALINK_DEV_GPIO_LEDS
  618. +
  619.  config RT305X_MACH_DIR_615_H1
  620.     bool "D-Link DIR-615 H1 board support"
  621.     select RALINK_DEV_GPIO_BUTTONS
  622. --- target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-320-b1.c 1970-01-01 03:00:00.000000000 +0300
  623. +++ target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-320-b1.c 2012-12-23 11:14:08.000000000 +0400
  624. @@ -0,0 +1,104 @@
  625. +/*
  626. + *  D-Link DIR-320 B1
  627. + *
  628. + *  Copyright (C) 2012 Mikko Hissa <mikko.hissa@uta.fi>
  629. + *
  630. + *  This program is free software; you can redistribute it and/or modify it
  631. + *  under the terms of the GNU General Public License version 2 as published
  632. + *  by the Free Software Foundation.
  633. + */
  634. +
  635. +#include <linux/init.h>
  636. +#include <linux/platform_device.h>
  637. +#include <linux/spi/spi.h>
  638. +#include <linux/spi/flash.h>
  639. +#include <linux/mtd/mtd.h>
  640. +#include <linux/mtd/partitions.h>
  641. +#include <linux/mtd/physmap.h>
  642. +
  643. +#include <asm/mach-ralink/machine.h>
  644. +#include <asm/mach-ralink/dev-gpio-buttons.h>
  645. +#include <asm/mach-ralink/dev-gpio-leds.h>
  646. +#include <asm/mach-ralink/rt305x.h>
  647. +#include <asm/mach-ralink/rt305x_regs.h>
  648. +
  649. +#include "devices.h"
  650. +
  651. +#define DIR_320_B1_GPIO_LED_STATUS_GREEN 9
  652. +#define DIR_320_B1_GPIO_LED_WPS_GREEN  13
  653. +#define DIR_320_B1_GPIO_LED_USB_GREEN  14
  654. +
  655. +#define DIR_320_B1_GPIO_BUTTON_RESET   10
  656. +#define DIR_320_B1_GPIO_BUTTON_WPS 0
  657. +
  658. +#define DIR_320_B1_KEYS_POLL_INTERVAL  20
  659. +#define DIR_320_B1_KEYS_DEBOUNCE_INTERVAL (3 * DIR_320_B1_KEYS_POLL_INTERVAL)
  660. +
  661. +static struct gpio_led dir_320_b1_leds_gpio[] __initdata = {
  662. +   {
  663. +       .name       = "d-link:green:status",
  664. +       .gpio       = DIR_320_B1_GPIO_LED_STATUS_GREEN,
  665. +       .active_low = 1,
  666. +   }, {
  667. +       .name       = "d-link:green:usb",
  668. +       .gpio       = DIR_320_B1_GPIO_LED_USB_GREEN,
  669. +       .active_low = 1,
  670. +   }, {
  671. +       .name       = "d-link:green:wps",
  672. +       .gpio       = DIR_320_B1_GPIO_LED_WPS_GREEN,
  673. +       .active_low = 1,
  674. +   }
  675. +};
  676. +
  677. +static struct gpio_keys_button dir_320_b1_gpio_buttons[] __initdata = {
  678. +   {
  679. +       .desc       = "reset",
  680. +       .type       = EV_KEY,
  681. +       .code       = KEY_RESTART,
  682. +       .debounce_interval = DIR_320_B1_KEYS_DEBOUNCE_INTERVAL,
  683. +       .gpio       = DIR_320_B1_GPIO_BUTTON_RESET,
  684. +       .active_low = 1,
  685. +   }, {
  686. +       .desc       = "wps",
  687. +       .type       = EV_KEY,
  688. +       .code       = KEY_WPS_BUTTON,
  689. +       .debounce_interval = DIR_320_B1_KEYS_DEBOUNCE_INTERVAL,
  690. +       .gpio       = DIR_320_B1_GPIO_BUTTON_WPS,
  691. +       .active_low = 1,
  692. +   }
  693. +};
  694. +
  695. +const struct flash_platform_data dir320b1_flash = {
  696. +   .type       = "s25fl064k",
  697. +};
  698. +
  699. +struct spi_board_info dir320b1_spi_slave_info[] __initdata = {
  700. +   {
  701. +       .modalias   = "m25p80",
  702. +       .platform_data  = &dir320b1_flash,
  703. +       .irq        = -1,
  704. +       .max_speed_hz   = 10000000,
  705. +       .bus_num    = 0,
  706. +       .chip_select    = 0,
  707. +   },
  708. +};
  709. +
  710. +static void __init dir320b1_init(void)
  711. +{
  712. +   rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
  713. +   rt305x_register_spi(dir320b1_spi_slave_info,
  714. +               ARRAY_SIZE(dir320b1_spi_slave_info));
  715. +   rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
  716. +   rt305x_register_ethernet();
  717. +   ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_320_b1_leds_gpio),
  718. +                 dir_320_b1_leds_gpio);
  719. +   ramips_register_gpio_buttons(-1, DIR_320_B1_KEYS_POLL_INTERVAL,
  720. +                    ARRAY_SIZE(dir_320_b1_gpio_buttons),
  721. +                    dir_320_b1_gpio_buttons);
  722. +   rt305x_register_wifi();
  723. +   rt305x_register_wdt();
  724. +   rt305x_register_usb();
  725. +}
  726. +
  727. +MIPS_MACHINE(RAMIPS_MACH_DIR_320_B1, "DIR-320-B1", "D-Link DIR-320 B1",
  728. +        dir320b1_init);
  729. --- target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-620-d1.c 1970-01-01 03:00:00.000000000 +0300
  730. +++ target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-620-d1.c 2013-01-10 17:43:34.000000000 +0400
  731. @@ -0,0 +1,90 @@
  732. +/*
  733. + *  D-Link DIR-620 D1
  734. + *
  735. + *  Copyright (C) 2012 Mikko Hissa <mikko.hissa@uta.fi>
  736. + *
  737. + *  This program is free software; you can redistribute it and/or modify it
  738. + *  under the terms of the GNU General Public License version 2 as published
  739. + *  by the Free Software Foundation.
  740. + */
  741. +
  742. +#include <linux/init.h>
  743. +#include <linux/platform_device.h>
  744. +#include <linux/spi/spi.h>
  745. +#include <linux/spi/flash.h>
  746. +#include <linux/mtd/mtd.h>
  747. +#include <linux/mtd/partitions.h>
  748. +#include <linux/mtd/physmap.h>
  749. +
  750. +#include <asm/mach-ralink/machine.h>
  751. +#include <asm/mach-ralink/dev-gpio-buttons.h>
  752. +#include <asm/mach-ralink/dev-gpio-leds.h>
  753. +#include <asm/mach-ralink/rt305x.h>
  754. +#include <asm/mach-ralink/rt305x_regs.h>
  755. +
  756. +#include "devices.h"
  757. +
  758. +#define DIR_620_D1_GPIO_LED_STATUS_GREEN   9
  759. +#define DIR_620_D1_GPIO_LED_STATUS_AMBER   17
  760. +
  761. +#define DIR_620_D1_GPIO_BUTTON_RESET_WPS   7
  762. +
  763. +#define DIR_620_D1_KEYS_POLL_INTERVAL  20
  764. +#define DIR_620_D1_KEYS_DEBOUNCE_INTERVAL (3 * DIR_620_D1_KEYS_POLL_INTERVAL)
  765. +
  766. +static struct gpio_led dir_620_d1_leds_gpio[] __initdata = {
  767. +   {
  768. +       .name       = "d-link:green:status",
  769. +       .gpio       = DIR_620_D1_GPIO_LED_STATUS_GREEN,
  770. +   }, {
  771. +       .name       = "d-link:amber:status",
  772. +       .gpio       = DIR_620_D1_GPIO_LED_STATUS_AMBER,
  773. +       .active_low = 1,
  774. +   }
  775. +};
  776. +
  777. +static struct gpio_keys_button dir_620_d1_gpio_buttons[] __initdata = {
  778. +   {
  779. +       .desc       = "reset",
  780. +       .type       = EV_KEY,
  781. +       .code       = KEY_RESTART,
  782. +       .debounce_interval = DIR_620_D1_KEYS_DEBOUNCE_INTERVAL,
  783. +       .gpio       = DIR_620_D1_GPIO_BUTTON_RESET_WPS,
  784. +       .active_low = 1,
  785. +   }
  786. +};
  787. +
  788. +const struct flash_platform_data dir620d1_flash = {
  789. +   .type       = "mx25l6405d",
  790. +};
  791. +
  792. +struct spi_board_info dir620d1_spi_slave_info[] __initdata = {
  793. +   {
  794. +       .modalias   = "m25p80",
  795. +       .platform_data  = &dir620d1_flash,
  796. +       .irq        = -1,
  797. +       .max_speed_hz   = 10000000,
  798. +       .bus_num    = 0,
  799. +       .chip_select    = 0,
  800. +   },
  801. +};
  802. +
  803. +static void __init dir620d1_init(void)
  804. +{
  805. +   rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
  806. +   rt305x_register_spi(dir620d1_spi_slave_info,
  807. +               ARRAY_SIZE(dir620d1_spi_slave_info));
  808. +   rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
  809. +   rt305x_register_ethernet();
  810. +   ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_620_d1_leds_gpio),
  811. +                 dir_620_d1_leds_gpio);
  812. +   ramips_register_gpio_buttons(-1, DIR_620_D1_KEYS_POLL_INTERVAL,
  813. +                    ARRAY_SIZE(dir_620_d1_gpio_buttons),
  814. +                    dir_620_d1_gpio_buttons);
  815. +   rt305x_register_wifi();
  816. +   rt305x_register_wdt();
  817. +   rt305x_register_usb();
  818. +}
  819. +
  820. +MIPS_MACHINE(RAMIPS_MACH_DIR_620_D1, "DIR-620-D1", "D-Link DIR-620 D1",
  821. +        dir620d1_init);
  822. --- target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile  2013-01-23 17:39:45.370292310 +0400
  823. +++ target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile  2012-12-18 21:15:28.000000000 +0400
  824. @@ -19,6 +19,8 @@
  825.  obj-$(CONFIG_RT305X_MACH_BROADWAY) += mach-broadway.o
  826.  obj-$(CONFIG_RT305X_MACH_CARAMBOLA)    += mach-carambola.o
  827.  obj-$(CONFIG_RT305X_MACH_DIR_300_REVB) += mach-dir-300-revb.o
  828. +obj-$(CONFIG_RT305X_MACH_DIR_320_B1)   += mach-dir-320-b1.o
  829. +obj-$(CONFIG_RT305X_MACH_DIR_620_D1)   += mach-dir-620-d1.o
  830.  obj-$(CONFIG_RT305X_MACH_DIR_615_H1)   += mach-dir-615-h1.o
  831.  obj-$(CONFIG_RT305X_MACH_DAP_1350) += mach-dap-1350.o
  832.  obj-$(CONFIG_RT305X_MACH_ESR_9753) += mach-esr-9753.o
  833. --- target/linux/ramips/image/Makefile  2013-01-23 17:39:47.222269028 +0400
  834. +++ target/linux/ramips/image/Makefile  2012-12-18 21:19:02.000000000 +0400
  835. @@ -251,6 +251,30 @@
  836.     $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/phys,$(mtdlayout_dir620a1)),$(kernel_size_dir620a1),$(rootfs_size_dir620a1))
  837.  endef
  838.  
  839. +#########################################################################################
  840. +mtdlayout_dir320b1=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware)
  841. +kernel_size_dir320b1=917504
  842. +rootfs_size_dir320b1=7143424
  843. +define BuildFirmware/DIR320B1
  844. +   $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/spi,$(mtdlayout_dir320b1)),$(kernel_size_dir320b1),$(rootfs_size_dir320b1),DIR320B1)
  845. +endef
  846. +
  847. +define BuildFirmware/DIR320B1/initramfs
  848. +   $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/spi,$(mtdlayout_dir320b1)),$(kernel_size_dir320b1),$(rootfs_size_dir320b1))
  849. +endef
  850. +
  851. +mtdlayout_dir620d1=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware)
  852. +kernel_size_dir620d1=917504
  853. +rootfs_size_dir620d1=7143424
  854. +define BuildFirmware/DIR620D1
  855. +   $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/spi,$(mtdlayout_dir620d1)),$(kernel_size_dir620d1),$(rootfs_size_dir620d1),DIR620D1)
  856. +endef
  857. +
  858. +define BuildFirmware/DIR620D1/initramfs
  859. +   $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/spi,$(mtdlayout_dir620d1)),$(kernel_size_dir620d1),$(rootfs_size_dir620d1))
  860. +endef
  861. +#########################################################################################
  862. +
  863.  define BuildFirmware/Edimax
  864.     if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  865.         mkedimaximg -i $(call sysupname,$(1),$(2)) \
  866. @@ -501,6 +525,16 @@
  867.     $(call Image/Build/Template/$(fs_squash)/$(1),DAP1350,dap-1350,DAP-1350,RT3052-AP-DAP1350-3)
  868.  endef
  869.  
  870. +#########################################################################################
  871. +define Image/Build/Profile/DIR320B1
  872. +        $(call Image/Build/Template/$(fs_squash)/$(1),DIR320B1,dir-320-b1,DIR-320-B1)
  873. +endef
  874. +
  875. +define Image/Build/Profile/DIR620D1
  876. +        $(call Image/Build/Template/$(fs_squash)/$(1),DIR620D1,dir-620-d1,DIR-620-D1)
  877. +endef
  878. +#########################################################################################
  879. +
  880.  define Image/Build/Profile/ESR9753
  881.     $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,esr-9753,ESR-9753,ttyS1,57600,phys)
  882.  endef
  883. @@ -629,6 +663,10 @@
  884.     $(call Image/Build/Profile/DIR300B1,$(1))
  885.     $(call Image/Build/Profile/DIR615H1,$(1))
  886.     $(call Image/Build/Profile/DAP1350,$(1))
  887. +###################################################
  888. +   $(call Image/Build/Profile/DIR320B1,$(1))
  889. +   $(call Image/Build/Profile/DIR620D1,$(1))
  890. +###################################################
  891.     $(call Image/Build/Profile/ESR9753,$(1))
  892.     $(call Image/Build/Profile/F5D8235V2,$(1))
  893.     $(call Image/Build/Profile/RTN10PLUS,$(1))
  894. --- target/linux/ramips/rt305x/config-3.7   2013-01-23 17:39:44.522302970 +0400
  895. +++ target/linux/ramips/rt305x/config-3.7   2012-12-23 12:10:26.000000000 +0400
  896. @@ -101,7 +101,9 @@
  897.  CONFIG_RT305X_MACH_CARAMBOLA=y
  898.  CONFIG_RT305X_MACH_DAP_1350=y
  899.  CONFIG_RT305X_MACH_DIR_300_REVB=y
  900. +CONFIG_RT305X_MACH_DIR_320_B1=y
  901.  CONFIG_RT305X_MACH_DIR_615_H1=y
  902. +CONFIG_RT305X_MACH_DIR_620_D1=y
  903.  CONFIG_RT305X_MACH_ESR_9753=y
  904.  CONFIG_RT305X_MACH_F5D8235_V2=y
  905.  CONFIG_RT305X_MACH_FONERA20N=y
  906. --- /dev/null   2013-02-17 16:08:41.569847969 +0400
  907. +++ target/linux/ramips/rt305x/profiles/dir320b1.mk 2013-02-05 12:39:37.493462566 +0400
  908. @@ -0,0 +1,13 @@
  909. +define Profile/DIR320B1
  910. +   NAME:=D-Link DIR-320/NRU
  911. +   PACKAGES:=\
  912. +       kmod-usb-core kmod-usb-rt305x-dwc_otg \
  913. +       kmod-ledtrig-usbdev kmod-mppe kmod-rt2800-pci \
  914. +       kmod-usb2 kmod-usb-ohci kmod-ledtrig-netdev
  915. +endef
  916. +
  917. +define Profile/DIR320B1/Description
  918. +   Package set for DIR-320/NRU board
  919. +endef
  920. +
  921. +$(eval $(call Profile,DIR320B1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement