platform.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. /*
  2. * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
  3. * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #include <linux/init.h>
  20. #include <linux/types.h>
  21. #include <linux/module.h>
  22. #include <linux/delay.h>
  23. #include <linux/dma-mapping.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/mtd/physmap.h>
  26. #include <linux/serial.h>
  27. #include <linux/serial_8250.h>
  28. #include <linux/ioport.h>
  29. #include <linux/io.h>
  30. #include <linux/vlynq.h>
  31. #include <linux/leds.h>
  32. #include <linux/string.h>
  33. #include <linux/etherdevice.h>
  34. #include <linux/phy.h>
  35. #include <linux/phy_fixed.h>
  36. #include <linux/gpio.h>
  37. #include <linux/clk.h>
  38. #include <asm/addrspace.h>
  39. #include <asm/mach-ar7/ar7.h>
  40. #include <asm/mach-ar7/gpio.h>
  41. #include <asm/mach-ar7/prom.h>
  42. /*****************************************************************************
  43. * VLYNQ Bus
  44. ****************************************************************************/
  45. struct plat_vlynq_data {
  46. struct plat_vlynq_ops ops;
  47. int gpio_bit;
  48. int reset_bit;
  49. };
  50. static int vlynq_on(struct vlynq_device *dev)
  51. {
  52. int ret;
  53. struct plat_vlynq_data *pdata = dev->dev.platform_data;
  54. ret = gpio_request(pdata->gpio_bit, "vlynq");
  55. if (ret)
  56. goto out;
  57. ar7_device_reset(pdata->reset_bit);
  58. ret = ar7_gpio_disable(pdata->gpio_bit);
  59. if (ret)
  60. goto out_enabled;
  61. ret = ar7_gpio_enable(pdata->gpio_bit);
  62. if (ret)
  63. goto out_enabled;
  64. ret = gpio_direction_output(pdata->gpio_bit, 0);
  65. if (ret)
  66. goto out_gpio_enabled;
  67. msleep(50);
  68. gpio_set_value(pdata->gpio_bit, 1);
  69. msleep(50);
  70. return 0;
  71. out_gpio_enabled:
  72. ar7_gpio_disable(pdata->gpio_bit);
  73. out_enabled:
  74. ar7_device_disable(pdata->reset_bit);
  75. gpio_free(pdata->gpio_bit);
  76. out:
  77. return ret;
  78. }
  79. static void vlynq_off(struct vlynq_device *dev)
  80. {
  81. struct plat_vlynq_data *pdata = dev->dev.platform_data;
  82. ar7_gpio_disable(pdata->gpio_bit);
  83. gpio_free(pdata->gpio_bit);
  84. ar7_device_disable(pdata->reset_bit);
  85. }
  86. static struct resource vlynq_low_res[] = {
  87. {
  88. .name = "regs",
  89. .flags = IORESOURCE_MEM,
  90. .start = AR7_REGS_VLYNQ0,
  91. .end = AR7_REGS_VLYNQ0 + 0xff,
  92. },
  93. {
  94. .name = "irq",
  95. .flags = IORESOURCE_IRQ,
  96. .start = 29,
  97. .end = 29,
  98. },
  99. {
  100. .name = "mem",
  101. .flags = IORESOURCE_MEM,
  102. .start = 0x04000000,
  103. .end = 0x04ffffff,
  104. },
  105. {
  106. .name = "devirq",
  107. .flags = IORESOURCE_IRQ,
  108. .start = 80,
  109. .end = 111,
  110. },
  111. };
  112. static struct resource vlynq_high_res[] = {
  113. {
  114. .name = "regs",
  115. .flags = IORESOURCE_MEM,
  116. .start = AR7_REGS_VLYNQ1,
  117. .end = AR7_REGS_VLYNQ1 + 0xff,
  118. },
  119. {
  120. .name = "irq",
  121. .flags = IORESOURCE_IRQ,
  122. .start = 33,
  123. .end = 33,
  124. },
  125. {
  126. .name = "mem",
  127. .flags = IORESOURCE_MEM,
  128. .start = 0x0c000000,
  129. .end = 0x0cffffff,
  130. },
  131. {
  132. .name = "devirq",
  133. .flags = IORESOURCE_IRQ,
  134. .start = 112,
  135. .end = 143,
  136. },
  137. };
  138. static struct plat_vlynq_data vlynq_low_data = {
  139. .ops = {
  140. .on = vlynq_on,
  141. .off = vlynq_off,
  142. },
  143. .reset_bit = 20,
  144. .gpio_bit = 18,
  145. };
  146. static struct plat_vlynq_data vlynq_high_data = {
  147. .ops = {
  148. .on = vlynq_on,
  149. .off = vlynq_off,
  150. },
  151. .reset_bit = 16,
  152. .gpio_bit = 19,
  153. };
  154. static struct platform_device vlynq_low = {
  155. .id = 0,
  156. .name = "vlynq",
  157. .dev = {
  158. .platform_data = &vlynq_low_data,
  159. },
  160. .resource = vlynq_low_res,
  161. .num_resources = ARRAY_SIZE(vlynq_low_res),
  162. };
  163. static struct platform_device vlynq_high = {
  164. .id = 1,
  165. .name = "vlynq",
  166. .dev = {
  167. .platform_data = &vlynq_high_data,
  168. },
  169. .resource = vlynq_high_res,
  170. .num_resources = ARRAY_SIZE(vlynq_high_res),
  171. };
  172. /*****************************************************************************
  173. * Flash
  174. ****************************************************************************/
  175. static struct resource physmap_flash_resource = {
  176. .name = "mem",
  177. .flags = IORESOURCE_MEM,
  178. .start = 0x10000000,
  179. .end = 0x107fffff,
  180. };
  181. static struct physmap_flash_data physmap_flash_data = {
  182. .width = 2,
  183. };
  184. static struct platform_device physmap_flash = {
  185. .name = "physmap-flash",
  186. .dev = {
  187. .platform_data = &physmap_flash_data,
  188. },
  189. .resource = &physmap_flash_resource,
  190. .num_resources = 1,
  191. };
  192. /*****************************************************************************
  193. * Ethernet
  194. ****************************************************************************/
  195. static struct resource cpmac_low_res[] = {
  196. {
  197. .name = "regs",
  198. .flags = IORESOURCE_MEM,
  199. .start = AR7_REGS_MAC0,
  200. .end = AR7_REGS_MAC0 + 0x7ff,
  201. },
  202. {
  203. .name = "irq",
  204. .flags = IORESOURCE_IRQ,
  205. .start = 27,
  206. .end = 27,
  207. },
  208. };
  209. static struct resource cpmac_high_res[] = {
  210. {
  211. .name = "regs",
  212. .flags = IORESOURCE_MEM,
  213. .start = AR7_REGS_MAC1,
  214. .end = AR7_REGS_MAC1 + 0x7ff,
  215. },
  216. {
  217. .name = "irq",
  218. .flags = IORESOURCE_IRQ,
  219. .start = 41,
  220. .end = 41,
  221. },
  222. };
  223. static struct fixed_phy_status fixed_phy_status __initdata = {
  224. .link = 1,
  225. .speed = 100,
  226. .duplex = 1,
  227. };
  228. static struct plat_cpmac_data cpmac_low_data = {
  229. .reset_bit = 17,
  230. .power_bit = 20,
  231. .phy_mask = 0x80000000,
  232. };
  233. static struct plat_cpmac_data cpmac_high_data = {
  234. .reset_bit = 21,
  235. .power_bit = 22,
  236. .phy_mask = 0x7fffffff,
  237. };
  238. static u64 cpmac_dma_mask = DMA_BIT_MASK(32);
  239. static struct platform_device cpmac_low = {
  240. .id = 0,
  241. .name = "cpmac",
  242. .dev = {
  243. .dma_mask = &cpmac_dma_mask,
  244. .coherent_dma_mask = DMA_BIT_MASK(32),
  245. .platform_data = &cpmac_low_data,
  246. },
  247. .resource = cpmac_low_res,
  248. .num_resources = ARRAY_SIZE(cpmac_low_res),
  249. };
  250. static struct platform_device cpmac_high = {
  251. .id = 1,
  252. .name = "cpmac",
  253. .dev = {
  254. .dma_mask = &cpmac_dma_mask,
  255. .coherent_dma_mask = DMA_BIT_MASK(32),
  256. .platform_data = &cpmac_high_data,
  257. },
  258. .resource = cpmac_high_res,
  259. .num_resources = ARRAY_SIZE(cpmac_high_res),
  260. };
  261. static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
  262. {
  263. char name[5], *mac;
  264. sprintf(name, "mac%c", 'a' + instance);
  265. mac = prom_getenv(name);
  266. if (!mac && instance) {
  267. sprintf(name, "mac%c", 'a');
  268. mac = prom_getenv(name);
  269. }
  270. if (mac) {
  271. if (sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
  272. &dev_addr[0], &dev_addr[1],
  273. &dev_addr[2], &dev_addr[3],
  274. &dev_addr[4], &dev_addr[5]) != 6) {
  275. pr_warning("cannot parse mac address, "
  276. "using random address\n");
  277. random_ether_addr(dev_addr);
  278. }
  279. } else
  280. random_ether_addr(dev_addr);
  281. }
  282. /*****************************************************************************
  283. * USB
  284. ****************************************************************************/
  285. static struct resource usb_res[] = {
  286. {
  287. .name = "regs",
  288. .flags = IORESOURCE_MEM,
  289. .start = AR7_REGS_USB,
  290. .end = AR7_REGS_USB + 0xff,
  291. },
  292. {
  293. .name = "irq",
  294. .flags = IORESOURCE_IRQ,
  295. .start = 32,
  296. .end = 32,
  297. },
  298. {
  299. .name = "mem",
  300. .flags = IORESOURCE_MEM,
  301. .start = 0x03400000,
  302. .end = 0x03401fff,
  303. },
  304. };
  305. static struct platform_device ar7_udc = {
  306. .name = "ar7_udc",
  307. .resource = usb_res,
  308. .num_resources = ARRAY_SIZE(usb_res),
  309. };
  310. /*****************************************************************************
  311. * LEDs
  312. ****************************************************************************/
  313. static struct gpio_led default_leds[] = {
  314. {
  315. .name = "status",
  316. .gpio = 8,
  317. .active_low = 1,
  318. },
  319. };
  320. static struct gpio_led titan_leds[] = {
  321. { .name = "status", .gpio = 8, .active_low = 1, },
  322. { .name = "wifi", .gpio = 13, .active_low = 1, },
  323. };
  324. static struct gpio_led dsl502t_leds[] = {
  325. {
  326. .name = "status",
  327. .gpio = 9,
  328. .active_low = 1,
  329. },
  330. {
  331. .name = "ethernet",
  332. .gpio = 7,
  333. .active_low = 1,
  334. },
  335. {
  336. .name = "usb",
  337. .gpio = 12,
  338. .active_low = 1,
  339. },
  340. };
  341. static struct gpio_led dg834g_leds[] = {
  342. {
  343. .name = "ppp",
  344. .gpio = 6,
  345. .active_low = 1,
  346. },
  347. {
  348. .name = "status",
  349. .gpio = 7,
  350. .active_low = 1,
  351. },
  352. {
  353. .name = "adsl",
  354. .gpio = 8,
  355. .active_low = 1,
  356. },
  357. {
  358. .name = "wifi",
  359. .gpio = 12,
  360. .active_low = 1,
  361. },
  362. {
  363. .name = "power",
  364. .gpio = 14,
  365. .active_low = 1,
  366. .default_trigger = "default-on",
  367. },
  368. };
  369. static struct gpio_led fb_sl_leds[] = {
  370. {
  371. .name = "1",
  372. .gpio = 7,
  373. },
  374. {
  375. .name = "2",
  376. .gpio = 13,
  377. .active_low = 1,
  378. },
  379. {
  380. .name = "3",
  381. .gpio = 10,
  382. .active_low = 1,
  383. },
  384. {
  385. .name = "4",
  386. .gpio = 12,
  387. .active_low = 1,
  388. },
  389. {
  390. .name = "5",
  391. .gpio = 9,
  392. .active_low = 1,
  393. },
  394. };
  395. static struct gpio_led fb_fon_leds[] = {
  396. {
  397. .name = "1",
  398. .gpio = 8,
  399. },
  400. {
  401. .name = "2",
  402. .gpio = 3,
  403. .active_low = 1,
  404. },
  405. {
  406. .name = "3",
  407. .gpio = 5,
  408. },
  409. {
  410. .name = "4",
  411. .gpio = 4,
  412. .active_low = 1,
  413. },
  414. {
  415. .name = "5",
  416. .gpio = 11,
  417. .active_low = 1,
  418. },
  419. };
  420. static struct gpio_led gt701_leds[] = {
  421. {
  422. .name = "inet:green",
  423. .gpio = 13,
  424. .active_low = 1,
  425. },
  426. {
  427. .name = "usb",
  428. .gpio = 12,
  429. .active_low = 1,
  430. },
  431. {
  432. .name = "inet:red",
  433. .gpio = 9,
  434. .active_low = 1,
  435. },
  436. {
  437. .name = "power:red",
  438. .gpio = 7,
  439. .active_low = 1,
  440. },
  441. {
  442. .name = "power:green",
  443. .gpio = 8,
  444. .active_low = 1,
  445. .default_trigger = "default-on",
  446. },
  447. {
  448. .name = "ethernet",
  449. .gpio = 10,
  450. .active_low = 1,
  451. },
  452. };
  453. static struct gpio_led_platform_data ar7_led_data;
  454. static struct platform_device ar7_gpio_leds = {
  455. .name = "leds-gpio",
  456. .dev = {
  457. .platform_data = &ar7_led_data,
  458. }
  459. };
  460. static void __init detect_leds(void)
  461. {
  462. char *prid, *usb_prod;
  463. /* Default LEDs */
  464. ar7_led_data.num_leds = ARRAY_SIZE(default_leds);
  465. ar7_led_data.leds = default_leds;
  466. /* FIXME: the whole thing is unreliable */
  467. prid = prom_getenv("ProductID");
  468. usb_prod = prom_getenv("usb_prod");
  469. /* If we can't get the product id from PROM, use the default LEDs */
  470. if (!prid)
  471. return;
  472. if (strstr(prid, "Fritz_Box_FON")) {
  473. ar7_led_data.num_leds = ARRAY_SIZE(fb_fon_leds);
  474. ar7_led_data.leds = fb_fon_leds;
  475. } else if (strstr(prid, "Fritz_Box_")) {
  476. ar7_led_data.num_leds = ARRAY_SIZE(fb_sl_leds);
  477. ar7_led_data.leds = fb_sl_leds;
  478. } else if ((!strcmp(prid, "AR7RD") || !strcmp(prid, "AR7DB"))
  479. && usb_prod != NULL && strstr(usb_prod, "DSL-502T")) {
  480. ar7_led_data.num_leds = ARRAY_SIZE(dsl502t_leds);
  481. ar7_led_data.leds = dsl502t_leds;
  482. } else if (strstr(prid, "DG834")) {
  483. ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
  484. ar7_led_data.leds = dg834g_leds;
  485. } else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) {
  486. ar7_led_data.num_leds = ARRAY_SIZE(titan_leds);
  487. ar7_led_data.leds = titan_leds;
  488. } else if (strstr(prid, "GT701")) {
  489. ar7_led_data.num_leds = ARRAY_SIZE(gt701_leds);
  490. ar7_led_data.leds = gt701_leds;
  491. }
  492. }
  493. /*****************************************************************************
  494. * Watchdog
  495. ****************************************************************************/
  496. static struct resource ar7_wdt_res = {
  497. .name = "regs",
  498. .flags = IORESOURCE_MEM,
  499. .start = -1, /* Filled at runtime */
  500. .end = -1, /* Filled at runtime */
  501. };
  502. static struct platform_device ar7_wdt = {
  503. .name = "ar7_wdt",
  504. .resource = &ar7_wdt_res,
  505. .num_resources = 1,
  506. };
  507. /*****************************************************************************
  508. * Init
  509. ****************************************************************************/
  510. static int __init ar7_register_uarts(void)
  511. {
  512. #ifdef CONFIG_SERIAL_8250
  513. static struct uart_port uart_port __initdata;
  514. struct clk *bus_clk;
  515. int res;
  516. memset(&uart_port, 0, sizeof(struct uart_port));
  517. bus_clk = clk_get(NULL, "bus");
  518. if (IS_ERR(bus_clk))
  519. panic("unable to get bus clk");
  520. uart_port.type = PORT_AR7;
  521. uart_port.uartclk = clk_get_rate(bus_clk) / 2;
  522. uart_port.iotype = UPIO_MEM32;
  523. uart_port.regshift = 2;
  524. uart_port.line = 0;
  525. uart_port.irq = AR7_IRQ_UART0;
  526. uart_port.mapbase = AR7_REGS_UART0;
  527. uart_port.membase = ioremap(uart_port.mapbase, 256);
  528. res = early_serial_setup(&uart_port);
  529. if (res)
  530. return res;
  531. /* Only TNETD73xx have a second serial port */
  532. if (ar7_has_second_uart()) {
  533. uart_port.line = 1;
  534. uart_port.irq = AR7_IRQ_UART1;
  535. uart_port.mapbase = UR8_REGS_UART1;
  536. uart_port.membase = ioremap(uart_port.mapbase, 256);
  537. res = early_serial_setup(&uart_port);
  538. if (res)
  539. return res;
  540. }
  541. #endif
  542. return 0;
  543. }
  544. static void __init titan_fixup_devices(void)
  545. {
  546. /* Set vlynq0 data */
  547. vlynq_low_data.reset_bit = 15;
  548. vlynq_low_data.gpio_bit = 14;
  549. /* Set vlynq1 data */
  550. vlynq_high_data.reset_bit = 16;
  551. vlynq_high_data.gpio_bit = 7;
  552. /* Set vlynq0 resources */
  553. vlynq_low_res[0].start = TITAN_REGS_VLYNQ0;
  554. vlynq_low_res[0].end = TITAN_REGS_VLYNQ0 + 0xff;
  555. vlynq_low_res[1].start = 33;
  556. vlynq_low_res[1].end = 33;
  557. vlynq_low_res[2].start = 0x0c000000;
  558. vlynq_low_res[2].end = 0x0fffffff;
  559. vlynq_low_res[3].start = 80;
  560. vlynq_low_res[3].end = 111;
  561. /* Set vlynq1 resources */
  562. vlynq_high_res[0].start = TITAN_REGS_VLYNQ1;
  563. vlynq_high_res[0].end = TITAN_REGS_VLYNQ1 + 0xff;
  564. vlynq_high_res[1].start = 34;
  565. vlynq_high_res[1].end = 34;
  566. vlynq_high_res[2].start = 0x40000000;
  567. vlynq_high_res[2].end = 0x43ffffff;
  568. vlynq_high_res[3].start = 112;
  569. vlynq_high_res[3].end = 143;
  570. /* Set cpmac0 data */
  571. cpmac_low_data.phy_mask = 0x40000000;
  572. /* Set cpmac1 data */
  573. cpmac_high_data.phy_mask = 0x80000000;
  574. /* Set cpmac0 resources */
  575. cpmac_low_res[0].start = TITAN_REGS_MAC0;
  576. cpmac_low_res[0].end = TITAN_REGS_MAC0 + 0x7ff;
  577. /* Set cpmac1 resources */
  578. cpmac_high_res[0].start = TITAN_REGS_MAC1;
  579. cpmac_high_res[0].end = TITAN_REGS_MAC1 + 0x7ff;
  580. }
  581. static int __init ar7_register_devices(void)
  582. {
  583. void __iomem *bootcr;
  584. u32 val;
  585. int res;
  586. res = ar7_register_uarts();
  587. if (res)
  588. pr_err("unable to setup uart(s): %d\n", res);
  589. res = platform_device_register(&physmap_flash);
  590. if (res)
  591. pr_warning("unable to register physmap-flash: %d\n", res);
  592. if (ar7_is_titan())
  593. titan_fixup_devices();
  594. ar7_device_disable(vlynq_low_data.reset_bit);
  595. res = platform_device_register(&vlynq_low);
  596. if (res)
  597. pr_warning("unable to register vlynq-low: %d\n", res);
  598. if (ar7_has_high_vlynq()) {
  599. ar7_device_disable(vlynq_high_data.reset_bit);
  600. res = platform_device_register(&vlynq_high);
  601. if (res)
  602. pr_warning("unable to register vlynq-high: %d\n", res);
  603. }
  604. if (ar7_has_high_cpmac()) {
  605. res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
  606. if (!res) {
  607. cpmac_get_mac(1, cpmac_high_data.dev_addr);
  608. res = platform_device_register(&cpmac_high);
  609. if (res)
  610. pr_warning("unable to register cpmac-high: %d\n", res);
  611. } else
  612. pr_warning("unable to add cpmac-high phy: %d\n", res);
  613. } else
  614. cpmac_low_data.phy_mask = 0xffffffff;
  615. res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
  616. if (!res) {
  617. cpmac_get_mac(0, cpmac_low_data.dev_addr);
  618. res = platform_device_register(&cpmac_low);
  619. if (res)
  620. pr_warning("unable to register cpmac-low: %d\n", res);
  621. } else
  622. pr_warning("unable to add cpmac-low phy: %d\n", res);
  623. detect_leds();
  624. res = platform_device_register(&ar7_gpio_leds);
  625. if (res)
  626. pr_warning("unable to register leds: %d\n", res);
  627. res = platform_device_register(&ar7_udc);
  628. if (res)
  629. pr_warning("unable to register usb slave: %d\n", res);
  630. /* Register watchdog only if enabled in hardware */
  631. bootcr = ioremap_nocache(AR7_REGS_DCL, 4);
  632. val = readl(bootcr);
  633. iounmap(bootcr);
  634. if (val & AR7_WDT_HW_ENA) {
  635. if (ar7_has_high_vlynq())
  636. ar7_wdt_res.start = UR8_REGS_WDT;
  637. else
  638. ar7_wdt_res.start = AR7_REGS_WDT;
  639. ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
  640. res = platform_device_register(&ar7_wdt);
  641. if (res)
  642. pr_warning("unable to register watchdog: %d\n", res);
  643. }
  644. return 0;
  645. }
  646. device_initcall(ar7_register_devices);