platform.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  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 const char *ar7_probe_types[] = { "ar7part", NULL };
  182. static struct physmap_flash_data physmap_flash_data = {
  183. .width = 2,
  184. .part_probe_types = ar7_probe_types,
  185. };
  186. static struct platform_device physmap_flash = {
  187. .name = "physmap-flash",
  188. .dev = {
  189. .platform_data = &physmap_flash_data,
  190. },
  191. .resource = &physmap_flash_resource,
  192. .num_resources = 1,
  193. };
  194. /*****************************************************************************
  195. * Ethernet
  196. ****************************************************************************/
  197. static struct resource cpmac_low_res[] = {
  198. {
  199. .name = "regs",
  200. .flags = IORESOURCE_MEM,
  201. .start = AR7_REGS_MAC0,
  202. .end = AR7_REGS_MAC0 + 0x7ff,
  203. },
  204. {
  205. .name = "irq",
  206. .flags = IORESOURCE_IRQ,
  207. .start = 27,
  208. .end = 27,
  209. },
  210. };
  211. static struct resource cpmac_high_res[] = {
  212. {
  213. .name = "regs",
  214. .flags = IORESOURCE_MEM,
  215. .start = AR7_REGS_MAC1,
  216. .end = AR7_REGS_MAC1 + 0x7ff,
  217. },
  218. {
  219. .name = "irq",
  220. .flags = IORESOURCE_IRQ,
  221. .start = 41,
  222. .end = 41,
  223. },
  224. };
  225. static struct fixed_phy_status fixed_phy_status __initdata = {
  226. .link = 1,
  227. .speed = 100,
  228. .duplex = 1,
  229. };
  230. static struct plat_cpmac_data cpmac_low_data = {
  231. .reset_bit = 17,
  232. .power_bit = 20,
  233. .phy_mask = 0x80000000,
  234. };
  235. static struct plat_cpmac_data cpmac_high_data = {
  236. .reset_bit = 21,
  237. .power_bit = 22,
  238. .phy_mask = 0x7fffffff,
  239. };
  240. static u64 cpmac_dma_mask = DMA_BIT_MASK(32);
  241. static struct platform_device cpmac_low = {
  242. .id = 0,
  243. .name = "cpmac",
  244. .dev = {
  245. .dma_mask = &cpmac_dma_mask,
  246. .coherent_dma_mask = DMA_BIT_MASK(32),
  247. .platform_data = &cpmac_low_data,
  248. },
  249. .resource = cpmac_low_res,
  250. .num_resources = ARRAY_SIZE(cpmac_low_res),
  251. };
  252. static struct platform_device cpmac_high = {
  253. .id = 1,
  254. .name = "cpmac",
  255. .dev = {
  256. .dma_mask = &cpmac_dma_mask,
  257. .coherent_dma_mask = DMA_BIT_MASK(32),
  258. .platform_data = &cpmac_high_data,
  259. },
  260. .resource = cpmac_high_res,
  261. .num_resources = ARRAY_SIZE(cpmac_high_res),
  262. };
  263. static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
  264. {
  265. char name[5], *mac;
  266. sprintf(name, "mac%c", 'a' + instance);
  267. mac = prom_getenv(name);
  268. if (!mac && instance) {
  269. sprintf(name, "mac%c", 'a');
  270. mac = prom_getenv(name);
  271. }
  272. if (mac) {
  273. if (!mac_pton(mac, dev_addr)) {
  274. pr_warn("cannot parse mac address, using random address\n");
  275. eth_random_addr(dev_addr);
  276. }
  277. } else
  278. eth_random_addr(dev_addr);
  279. }
  280. /*****************************************************************************
  281. * USB
  282. ****************************************************************************/
  283. static struct resource usb_res[] = {
  284. {
  285. .name = "regs",
  286. .flags = IORESOURCE_MEM,
  287. .start = AR7_REGS_USB,
  288. .end = AR7_REGS_USB + 0xff,
  289. },
  290. {
  291. .name = "irq",
  292. .flags = IORESOURCE_IRQ,
  293. .start = 32,
  294. .end = 32,
  295. },
  296. {
  297. .name = "mem",
  298. .flags = IORESOURCE_MEM,
  299. .start = 0x03400000,
  300. .end = 0x03401fff,
  301. },
  302. };
  303. static struct platform_device ar7_udc = {
  304. .name = "ar7_udc",
  305. .resource = usb_res,
  306. .num_resources = ARRAY_SIZE(usb_res),
  307. };
  308. /*****************************************************************************
  309. * LEDs
  310. ****************************************************************************/
  311. static struct gpio_led default_leds[] = {
  312. {
  313. .name = "status",
  314. .gpio = 8,
  315. .active_low = 1,
  316. },
  317. };
  318. static struct gpio_led titan_leds[] = {
  319. { .name = "status", .gpio = 8, .active_low = 1, },
  320. { .name = "wifi", .gpio = 13, .active_low = 1, },
  321. };
  322. static struct gpio_led dsl502t_leds[] = {
  323. {
  324. .name = "status",
  325. .gpio = 9,
  326. .active_low = 1,
  327. },
  328. {
  329. .name = "ethernet",
  330. .gpio = 7,
  331. .active_low = 1,
  332. },
  333. {
  334. .name = "usb",
  335. .gpio = 12,
  336. .active_low = 1,
  337. },
  338. };
  339. static struct gpio_led dg834g_leds[] = {
  340. {
  341. .name = "ppp",
  342. .gpio = 6,
  343. .active_low = 1,
  344. },
  345. {
  346. .name = "status",
  347. .gpio = 7,
  348. .active_low = 1,
  349. },
  350. {
  351. .name = "adsl",
  352. .gpio = 8,
  353. .active_low = 1,
  354. },
  355. {
  356. .name = "wifi",
  357. .gpio = 12,
  358. .active_low = 1,
  359. },
  360. {
  361. .name = "power",
  362. .gpio = 14,
  363. .active_low = 1,
  364. .default_trigger = "default-on",
  365. },
  366. };
  367. static struct gpio_led fb_sl_leds[] = {
  368. {
  369. .name = "1",
  370. .gpio = 7,
  371. },
  372. {
  373. .name = "2",
  374. .gpio = 13,
  375. .active_low = 1,
  376. },
  377. {
  378. .name = "3",
  379. .gpio = 10,
  380. .active_low = 1,
  381. },
  382. {
  383. .name = "4",
  384. .gpio = 12,
  385. .active_low = 1,
  386. },
  387. {
  388. .name = "5",
  389. .gpio = 9,
  390. .active_low = 1,
  391. },
  392. };
  393. static struct gpio_led fb_fon_leds[] = {
  394. {
  395. .name = "1",
  396. .gpio = 8,
  397. },
  398. {
  399. .name = "2",
  400. .gpio = 3,
  401. .active_low = 1,
  402. },
  403. {
  404. .name = "3",
  405. .gpio = 5,
  406. },
  407. {
  408. .name = "4",
  409. .gpio = 4,
  410. .active_low = 1,
  411. },
  412. {
  413. .name = "5",
  414. .gpio = 11,
  415. .active_low = 1,
  416. },
  417. };
  418. static struct gpio_led gt701_leds[] = {
  419. {
  420. .name = "inet:green",
  421. .gpio = 13,
  422. .active_low = 1,
  423. },
  424. {
  425. .name = "usb",
  426. .gpio = 12,
  427. .active_low = 1,
  428. },
  429. {
  430. .name = "inet:red",
  431. .gpio = 9,
  432. .active_low = 1,
  433. },
  434. {
  435. .name = "power:red",
  436. .gpio = 7,
  437. .active_low = 1,
  438. },
  439. {
  440. .name = "power:green",
  441. .gpio = 8,
  442. .active_low = 1,
  443. .default_trigger = "default-on",
  444. },
  445. {
  446. .name = "ethernet",
  447. .gpio = 10,
  448. .active_low = 1,
  449. },
  450. };
  451. static struct gpio_led_platform_data ar7_led_data;
  452. static struct platform_device ar7_gpio_leds = {
  453. .name = "leds-gpio",
  454. .dev = {
  455. .platform_data = &ar7_led_data,
  456. }
  457. };
  458. static void __init detect_leds(void)
  459. {
  460. char *prid, *usb_prod;
  461. /* Default LEDs */
  462. ar7_led_data.num_leds = ARRAY_SIZE(default_leds);
  463. ar7_led_data.leds = default_leds;
  464. /* FIXME: the whole thing is unreliable */
  465. prid = prom_getenv("ProductID");
  466. usb_prod = prom_getenv("usb_prod");
  467. /* If we can't get the product id from PROM, use the default LEDs */
  468. if (!prid)
  469. return;
  470. if (strstr(prid, "Fritz_Box_FON")) {
  471. ar7_led_data.num_leds = ARRAY_SIZE(fb_fon_leds);
  472. ar7_led_data.leds = fb_fon_leds;
  473. } else if (strstr(prid, "Fritz_Box_")) {
  474. ar7_led_data.num_leds = ARRAY_SIZE(fb_sl_leds);
  475. ar7_led_data.leds = fb_sl_leds;
  476. } else if ((!strcmp(prid, "AR7RD") || !strcmp(prid, "AR7DB"))
  477. && usb_prod != NULL && strstr(usb_prod, "DSL-502T")) {
  478. ar7_led_data.num_leds = ARRAY_SIZE(dsl502t_leds);
  479. ar7_led_data.leds = dsl502t_leds;
  480. } else if (strstr(prid, "DG834")) {
  481. ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
  482. ar7_led_data.leds = dg834g_leds;
  483. } else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) {
  484. ar7_led_data.num_leds = ARRAY_SIZE(titan_leds);
  485. ar7_led_data.leds = titan_leds;
  486. } else if (strstr(prid, "GT701")) {
  487. ar7_led_data.num_leds = ARRAY_SIZE(gt701_leds);
  488. ar7_led_data.leds = gt701_leds;
  489. }
  490. }
  491. /*****************************************************************************
  492. * Watchdog
  493. ****************************************************************************/
  494. static struct resource ar7_wdt_res = {
  495. .name = "regs",
  496. .flags = IORESOURCE_MEM,
  497. .start = -1, /* Filled at runtime */
  498. .end = -1, /* Filled at runtime */
  499. };
  500. static struct platform_device ar7_wdt = {
  501. .name = "ar7_wdt",
  502. .resource = &ar7_wdt_res,
  503. .num_resources = 1,
  504. };
  505. /*****************************************************************************
  506. * Init
  507. ****************************************************************************/
  508. static int __init ar7_register_uarts(void)
  509. {
  510. #ifdef CONFIG_SERIAL_8250
  511. static struct uart_port uart_port __initdata;
  512. struct clk *bus_clk;
  513. int res;
  514. memset(&uart_port, 0, sizeof(struct uart_port));
  515. bus_clk = clk_get(NULL, "bus");
  516. if (IS_ERR(bus_clk))
  517. panic("unable to get bus clk");
  518. uart_port.type = PORT_AR7;
  519. uart_port.uartclk = clk_get_rate(bus_clk) / 2;
  520. uart_port.iotype = UPIO_MEM32;
  521. uart_port.regshift = 2;
  522. uart_port.line = 0;
  523. uart_port.irq = AR7_IRQ_UART0;
  524. uart_port.mapbase = AR7_REGS_UART0;
  525. uart_port.membase = ioremap(uart_port.mapbase, 256);
  526. res = early_serial_setup(&uart_port);
  527. if (res)
  528. return res;
  529. /* Only TNETD73xx have a second serial port */
  530. if (ar7_has_second_uart()) {
  531. uart_port.line = 1;
  532. uart_port.irq = AR7_IRQ_UART1;
  533. uart_port.mapbase = UR8_REGS_UART1;
  534. uart_port.membase = ioremap(uart_port.mapbase, 256);
  535. res = early_serial_setup(&uart_port);
  536. if (res)
  537. return res;
  538. }
  539. #endif
  540. return 0;
  541. }
  542. static void __init titan_fixup_devices(void)
  543. {
  544. /* Set vlynq0 data */
  545. vlynq_low_data.reset_bit = 15;
  546. vlynq_low_data.gpio_bit = 14;
  547. /* Set vlynq1 data */
  548. vlynq_high_data.reset_bit = 16;
  549. vlynq_high_data.gpio_bit = 7;
  550. /* Set vlynq0 resources */
  551. vlynq_low_res[0].start = TITAN_REGS_VLYNQ0;
  552. vlynq_low_res[0].end = TITAN_REGS_VLYNQ0 + 0xff;
  553. vlynq_low_res[1].start = 33;
  554. vlynq_low_res[1].end = 33;
  555. vlynq_low_res[2].start = 0x0c000000;
  556. vlynq_low_res[2].end = 0x0fffffff;
  557. vlynq_low_res[3].start = 80;
  558. vlynq_low_res[3].end = 111;
  559. /* Set vlynq1 resources */
  560. vlynq_high_res[0].start = TITAN_REGS_VLYNQ1;
  561. vlynq_high_res[0].end = TITAN_REGS_VLYNQ1 + 0xff;
  562. vlynq_high_res[1].start = 34;
  563. vlynq_high_res[1].end = 34;
  564. vlynq_high_res[2].start = 0x40000000;
  565. vlynq_high_res[2].end = 0x43ffffff;
  566. vlynq_high_res[3].start = 112;
  567. vlynq_high_res[3].end = 143;
  568. /* Set cpmac0 data */
  569. cpmac_low_data.phy_mask = 0x40000000;
  570. /* Set cpmac1 data */
  571. cpmac_high_data.phy_mask = 0x80000000;
  572. /* Set cpmac0 resources */
  573. cpmac_low_res[0].start = TITAN_REGS_MAC0;
  574. cpmac_low_res[0].end = TITAN_REGS_MAC0 + 0x7ff;
  575. /* Set cpmac1 resources */
  576. cpmac_high_res[0].start = TITAN_REGS_MAC1;
  577. cpmac_high_res[0].end = TITAN_REGS_MAC1 + 0x7ff;
  578. }
  579. static int __init ar7_register_devices(void)
  580. {
  581. void __iomem *bootcr;
  582. u32 val;
  583. int res;
  584. res = ar7_register_uarts();
  585. if (res)
  586. pr_err("unable to setup uart(s): %d\n", res);
  587. res = platform_device_register(&physmap_flash);
  588. if (res)
  589. pr_warn("unable to register physmap-flash: %d\n", res);
  590. if (ar7_is_titan())
  591. titan_fixup_devices();
  592. ar7_device_disable(vlynq_low_data.reset_bit);
  593. res = platform_device_register(&vlynq_low);
  594. if (res)
  595. pr_warn("unable to register vlynq-low: %d\n", res);
  596. if (ar7_has_high_vlynq()) {
  597. ar7_device_disable(vlynq_high_data.reset_bit);
  598. res = platform_device_register(&vlynq_high);
  599. if (res)
  600. pr_warn("unable to register vlynq-high: %d\n", res);
  601. }
  602. if (ar7_has_high_cpmac()) {
  603. res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
  604. if (!res) {
  605. cpmac_get_mac(1, cpmac_high_data.dev_addr);
  606. res = platform_device_register(&cpmac_high);
  607. if (res)
  608. pr_warn("unable to register cpmac-high: %d\n",
  609. res);
  610. } else
  611. pr_warn("unable to add cpmac-high phy: %d\n", res);
  612. } else
  613. cpmac_low_data.phy_mask = 0xffffffff;
  614. res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
  615. if (!res) {
  616. cpmac_get_mac(0, cpmac_low_data.dev_addr);
  617. res = platform_device_register(&cpmac_low);
  618. if (res)
  619. pr_warn("unable to register cpmac-low: %d\n", res);
  620. } else
  621. pr_warn("unable to add cpmac-low phy: %d\n", res);
  622. detect_leds();
  623. res = platform_device_register(&ar7_gpio_leds);
  624. if (res)
  625. pr_warn("unable to register leds: %d\n", res);
  626. res = platform_device_register(&ar7_udc);
  627. if (res)
  628. pr_warn("unable to register usb slave: %d\n", res);
  629. /* Register watchdog only if enabled in hardware */
  630. bootcr = ioremap_nocache(AR7_REGS_DCL, 4);
  631. val = readl(bootcr);
  632. iounmap(bootcr);
  633. if (val & AR7_WDT_HW_ENA) {
  634. if (ar7_has_high_vlynq())
  635. ar7_wdt_res.start = UR8_REGS_WDT;
  636. else
  637. ar7_wdt_res.start = AR7_REGS_WDT;
  638. ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
  639. res = platform_device_register(&ar7_wdt);
  640. if (res)
  641. pr_warn("unable to register watchdog: %d\n", res);
  642. }
  643. return 0;
  644. }
  645. device_initcall(ar7_register_devices);