board_bcm963xx.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
  7. * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
  8. */
  9. #include <linux/init.h>
  10. #include <linux/kernel.h>
  11. #include <linux/string.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/ssb/ssb.h>
  14. #include <asm/addrspace.h>
  15. #include <bcm63xx_board.h>
  16. #include <bcm63xx_cpu.h>
  17. #include <bcm63xx_dev_uart.h>
  18. #include <bcm63xx_regs.h>
  19. #include <bcm63xx_io.h>
  20. #include <bcm63xx_nvram.h>
  21. #include <bcm63xx_dev_pci.h>
  22. #include <bcm63xx_dev_enet.h>
  23. #include <bcm63xx_dev_dsp.h>
  24. #include <bcm63xx_dev_flash.h>
  25. #include <bcm63xx_dev_pcmcia.h>
  26. #include <bcm63xx_dev_spi.h>
  27. #include <bcm63xx_dev_usb_usbd.h>
  28. #include <board_bcm963xx.h>
  29. #define PFX "board_bcm963xx: "
  30. static struct board_info board;
  31. /*
  32. * known 6328 boards
  33. */
  34. #ifdef CONFIG_BCM63XX_CPU_6328
  35. static struct board_info __initdata board_96328avng = {
  36. .name = "96328avng",
  37. .expected_cpu_id = 0x6328,
  38. .has_uart0 = 1,
  39. .has_pci = 1,
  40. .has_usbd = 0,
  41. .usbd = {
  42. .use_fullspeed = 0,
  43. .port_no = 0,
  44. },
  45. .leds = {
  46. {
  47. .name = "96328avng::ppp-fail",
  48. .gpio = 2,
  49. .active_low = 1,
  50. },
  51. {
  52. .name = "96328avng::power",
  53. .gpio = 4,
  54. .active_low = 1,
  55. .default_trigger = "default-on",
  56. },
  57. {
  58. .name = "96328avng::power-fail",
  59. .gpio = 8,
  60. .active_low = 1,
  61. },
  62. {
  63. .name = "96328avng::wps",
  64. .gpio = 9,
  65. .active_low = 1,
  66. },
  67. {
  68. .name = "96328avng::ppp",
  69. .gpio = 11,
  70. .active_low = 1,
  71. },
  72. },
  73. };
  74. #endif
  75. /*
  76. * known 6338 boards
  77. */
  78. #ifdef CONFIG_BCM63XX_CPU_6338
  79. static struct board_info __initdata board_96338gw = {
  80. .name = "96338GW",
  81. .expected_cpu_id = 0x6338,
  82. .has_uart0 = 1,
  83. .has_enet0 = 1,
  84. .enet0 = {
  85. .force_speed_100 = 1,
  86. .force_duplex_full = 1,
  87. },
  88. .has_ohci0 = 1,
  89. .leds = {
  90. {
  91. .name = "adsl",
  92. .gpio = 3,
  93. .active_low = 1,
  94. },
  95. {
  96. .name = "ses",
  97. .gpio = 5,
  98. .active_low = 1,
  99. },
  100. {
  101. .name = "ppp-fail",
  102. .gpio = 4,
  103. .active_low = 1,
  104. },
  105. {
  106. .name = "power",
  107. .gpio = 0,
  108. .active_low = 1,
  109. .default_trigger = "default-on",
  110. },
  111. {
  112. .name = "stop",
  113. .gpio = 1,
  114. .active_low = 1,
  115. }
  116. },
  117. };
  118. static struct board_info __initdata board_96338w = {
  119. .name = "96338W",
  120. .expected_cpu_id = 0x6338,
  121. .has_uart0 = 1,
  122. .has_enet0 = 1,
  123. .enet0 = {
  124. .force_speed_100 = 1,
  125. .force_duplex_full = 1,
  126. },
  127. .leds = {
  128. {
  129. .name = "adsl",
  130. .gpio = 3,
  131. .active_low = 1,
  132. },
  133. {
  134. .name = "ses",
  135. .gpio = 5,
  136. .active_low = 1,
  137. },
  138. {
  139. .name = "ppp-fail",
  140. .gpio = 4,
  141. .active_low = 1,
  142. },
  143. {
  144. .name = "power",
  145. .gpio = 0,
  146. .active_low = 1,
  147. .default_trigger = "default-on",
  148. },
  149. {
  150. .name = "stop",
  151. .gpio = 1,
  152. .active_low = 1,
  153. },
  154. },
  155. };
  156. #endif
  157. /*
  158. * known 6345 boards
  159. */
  160. #ifdef CONFIG_BCM63XX_CPU_6345
  161. static struct board_info __initdata board_96345gw2 = {
  162. .name = "96345GW2",
  163. .expected_cpu_id = 0x6345,
  164. .has_uart0 = 1,
  165. };
  166. #endif
  167. /*
  168. * known 6348 boards
  169. */
  170. #ifdef CONFIG_BCM63XX_CPU_6348
  171. static struct board_info __initdata board_96348r = {
  172. .name = "96348R",
  173. .expected_cpu_id = 0x6348,
  174. .has_uart0 = 1,
  175. .has_enet0 = 1,
  176. .has_pci = 1,
  177. .enet0 = {
  178. .has_phy = 1,
  179. .use_internal_phy = 1,
  180. },
  181. .leds = {
  182. {
  183. .name = "adsl-fail",
  184. .gpio = 2,
  185. .active_low = 1,
  186. },
  187. {
  188. .name = "ppp",
  189. .gpio = 3,
  190. .active_low = 1,
  191. },
  192. {
  193. .name = "ppp-fail",
  194. .gpio = 4,
  195. .active_low = 1,
  196. },
  197. {
  198. .name = "power",
  199. .gpio = 0,
  200. .active_low = 1,
  201. .default_trigger = "default-on",
  202. },
  203. {
  204. .name = "stop",
  205. .gpio = 1,
  206. .active_low = 1,
  207. },
  208. },
  209. };
  210. static struct board_info __initdata board_96348gw_10 = {
  211. .name = "96348GW-10",
  212. .expected_cpu_id = 0x6348,
  213. .has_uart0 = 1,
  214. .has_enet0 = 1,
  215. .has_enet1 = 1,
  216. .has_pci = 1,
  217. .enet0 = {
  218. .has_phy = 1,
  219. .use_internal_phy = 1,
  220. },
  221. .enet1 = {
  222. .force_speed_100 = 1,
  223. .force_duplex_full = 1,
  224. },
  225. .has_ohci0 = 1,
  226. .has_pccard = 1,
  227. .has_ehci0 = 1,
  228. .has_dsp = 1,
  229. .dsp = {
  230. .gpio_rst = 6,
  231. .gpio_int = 34,
  232. .cs = 2,
  233. .ext_irq = 2,
  234. },
  235. .leds = {
  236. {
  237. .name = "adsl-fail",
  238. .gpio = 2,
  239. .active_low = 1,
  240. },
  241. {
  242. .name = "ppp",
  243. .gpio = 3,
  244. .active_low = 1,
  245. },
  246. {
  247. .name = "ppp-fail",
  248. .gpio = 4,
  249. .active_low = 1,
  250. },
  251. {
  252. .name = "power",
  253. .gpio = 0,
  254. .active_low = 1,
  255. .default_trigger = "default-on",
  256. },
  257. {
  258. .name = "stop",
  259. .gpio = 1,
  260. .active_low = 1,
  261. },
  262. },
  263. };
  264. static struct board_info __initdata board_96348gw_11 = {
  265. .name = "96348GW-11",
  266. .expected_cpu_id = 0x6348,
  267. .has_uart0 = 1,
  268. .has_enet0 = 1,
  269. .has_enet1 = 1,
  270. .has_pci = 1,
  271. .enet0 = {
  272. .has_phy = 1,
  273. .use_internal_phy = 1,
  274. },
  275. .enet1 = {
  276. .force_speed_100 = 1,
  277. .force_duplex_full = 1,
  278. },
  279. .has_ohci0 = 1,
  280. .has_pccard = 1,
  281. .has_ehci0 = 1,
  282. .leds = {
  283. {
  284. .name = "adsl-fail",
  285. .gpio = 2,
  286. .active_low = 1,
  287. },
  288. {
  289. .name = "ppp",
  290. .gpio = 3,
  291. .active_low = 1,
  292. },
  293. {
  294. .name = "ppp-fail",
  295. .gpio = 4,
  296. .active_low = 1,
  297. },
  298. {
  299. .name = "power",
  300. .gpio = 0,
  301. .active_low = 1,
  302. .default_trigger = "default-on",
  303. },
  304. {
  305. .name = "stop",
  306. .gpio = 1,
  307. .active_low = 1,
  308. },
  309. },
  310. };
  311. static struct board_info __initdata board_96348gw = {
  312. .name = "96348GW",
  313. .expected_cpu_id = 0x6348,
  314. .has_uart0 = 1,
  315. .has_enet0 = 1,
  316. .has_enet1 = 1,
  317. .has_pci = 1,
  318. .enet0 = {
  319. .has_phy = 1,
  320. .use_internal_phy = 1,
  321. },
  322. .enet1 = {
  323. .force_speed_100 = 1,
  324. .force_duplex_full = 1,
  325. },
  326. .has_ohci0 = 1,
  327. .has_dsp = 1,
  328. .dsp = {
  329. .gpio_rst = 6,
  330. .gpio_int = 34,
  331. .ext_irq = 2,
  332. .cs = 2,
  333. },
  334. .leds = {
  335. {
  336. .name = "adsl-fail",
  337. .gpio = 2,
  338. .active_low = 1,
  339. },
  340. {
  341. .name = "ppp",
  342. .gpio = 3,
  343. .active_low = 1,
  344. },
  345. {
  346. .name = "ppp-fail",
  347. .gpio = 4,
  348. .active_low = 1,
  349. },
  350. {
  351. .name = "power",
  352. .gpio = 0,
  353. .active_low = 1,
  354. .default_trigger = "default-on",
  355. },
  356. {
  357. .name = "stop",
  358. .gpio = 1,
  359. .active_low = 1,
  360. },
  361. },
  362. };
  363. static struct board_info __initdata board_FAST2404 = {
  364. .name = "F@ST2404",
  365. .expected_cpu_id = 0x6348,
  366. .has_uart0 = 1,
  367. .has_enet0 = 1,
  368. .has_enet1 = 1,
  369. .has_pci = 1,
  370. .enet0 = {
  371. .has_phy = 1,
  372. .use_internal_phy = 1,
  373. },
  374. .enet1 = {
  375. .force_speed_100 = 1,
  376. .force_duplex_full = 1,
  377. },
  378. .has_ohci0 = 1,
  379. .has_pccard = 1,
  380. .has_ehci0 = 1,
  381. };
  382. static struct board_info __initdata board_rta1025w_16 = {
  383. .name = "RTA1025W_16",
  384. .expected_cpu_id = 0x6348,
  385. .has_enet0 = 1,
  386. .has_enet1 = 1,
  387. .has_pci = 1,
  388. .enet0 = {
  389. .has_phy = 1,
  390. .use_internal_phy = 1,
  391. },
  392. .enet1 = {
  393. .force_speed_100 = 1,
  394. .force_duplex_full = 1,
  395. },
  396. };
  397. static struct board_info __initdata board_DV201AMR = {
  398. .name = "DV201AMR",
  399. .expected_cpu_id = 0x6348,
  400. .has_uart0 = 1,
  401. .has_pci = 1,
  402. .has_ohci0 = 1,
  403. .has_enet0 = 1,
  404. .has_enet1 = 1,
  405. .enet0 = {
  406. .has_phy = 1,
  407. .use_internal_phy = 1,
  408. },
  409. .enet1 = {
  410. .force_speed_100 = 1,
  411. .force_duplex_full = 1,
  412. },
  413. };
  414. static struct board_info __initdata board_96348gw_a = {
  415. .name = "96348GW-A",
  416. .expected_cpu_id = 0x6348,
  417. .has_uart0 = 1,
  418. .has_enet0 = 1,
  419. .has_enet1 = 1,
  420. .has_pci = 1,
  421. .enet0 = {
  422. .has_phy = 1,
  423. .use_internal_phy = 1,
  424. },
  425. .enet1 = {
  426. .force_speed_100 = 1,
  427. .force_duplex_full = 1,
  428. },
  429. .has_ohci0 = 1,
  430. };
  431. #endif
  432. /*
  433. * known 6358 boards
  434. */
  435. #ifdef CONFIG_BCM63XX_CPU_6358
  436. static struct board_info __initdata board_96358vw = {
  437. .name = "96358VW",
  438. .expected_cpu_id = 0x6358,
  439. .has_uart0 = 1,
  440. .has_enet0 = 1,
  441. .has_enet1 = 1,
  442. .has_pci = 1,
  443. .enet0 = {
  444. .has_phy = 1,
  445. .use_internal_phy = 1,
  446. },
  447. .enet1 = {
  448. .force_speed_100 = 1,
  449. .force_duplex_full = 1,
  450. },
  451. .has_ohci0 = 1,
  452. .has_pccard = 1,
  453. .has_ehci0 = 1,
  454. .leds = {
  455. {
  456. .name = "adsl-fail",
  457. .gpio = 15,
  458. .active_low = 1,
  459. },
  460. {
  461. .name = "ppp",
  462. .gpio = 22,
  463. .active_low = 1,
  464. },
  465. {
  466. .name = "ppp-fail",
  467. .gpio = 23,
  468. .active_low = 1,
  469. },
  470. {
  471. .name = "power",
  472. .gpio = 4,
  473. .default_trigger = "default-on",
  474. },
  475. {
  476. .name = "stop",
  477. .gpio = 5,
  478. },
  479. },
  480. };
  481. static struct board_info __initdata board_96358vw2 = {
  482. .name = "96358VW2",
  483. .expected_cpu_id = 0x6358,
  484. .has_uart0 = 1,
  485. .has_enet0 = 1,
  486. .has_enet1 = 1,
  487. .has_pci = 1,
  488. .enet0 = {
  489. .has_phy = 1,
  490. .use_internal_phy = 1,
  491. },
  492. .enet1 = {
  493. .force_speed_100 = 1,
  494. .force_duplex_full = 1,
  495. },
  496. .has_ohci0 = 1,
  497. .has_pccard = 1,
  498. .has_ehci0 = 1,
  499. .leds = {
  500. {
  501. .name = "adsl",
  502. .gpio = 22,
  503. .active_low = 1,
  504. },
  505. {
  506. .name = "ppp-fail",
  507. .gpio = 23,
  508. },
  509. {
  510. .name = "power",
  511. .gpio = 5,
  512. .active_low = 1,
  513. .default_trigger = "default-on",
  514. },
  515. {
  516. .name = "stop",
  517. .gpio = 4,
  518. .active_low = 1,
  519. },
  520. },
  521. };
  522. static struct board_info __initdata board_AGPFS0 = {
  523. .name = "AGPF-S0",
  524. .expected_cpu_id = 0x6358,
  525. .has_uart0 = 1,
  526. .has_enet0 = 1,
  527. .has_enet1 = 1,
  528. .has_pci = 1,
  529. .enet0 = {
  530. .has_phy = 1,
  531. .use_internal_phy = 1,
  532. },
  533. .enet1 = {
  534. .force_speed_100 = 1,
  535. .force_duplex_full = 1,
  536. },
  537. .has_ohci0 = 1,
  538. .has_ehci0 = 1,
  539. };
  540. static struct board_info __initdata board_DWVS0 = {
  541. .name = "DWV-S0",
  542. .expected_cpu_id = 0x6358,
  543. .has_enet0 = 1,
  544. .has_enet1 = 1,
  545. .has_pci = 1,
  546. .enet0 = {
  547. .has_phy = 1,
  548. .use_internal_phy = 1,
  549. },
  550. .enet1 = {
  551. .force_speed_100 = 1,
  552. .force_duplex_full = 1,
  553. },
  554. .has_ohci0 = 1,
  555. };
  556. #endif
  557. /*
  558. * all boards
  559. */
  560. static const struct board_info __initconst *bcm963xx_boards[] = {
  561. #ifdef CONFIG_BCM63XX_CPU_6328
  562. &board_96328avng,
  563. #endif
  564. #ifdef CONFIG_BCM63XX_CPU_6338
  565. &board_96338gw,
  566. &board_96338w,
  567. #endif
  568. #ifdef CONFIG_BCM63XX_CPU_6345
  569. &board_96345gw2,
  570. #endif
  571. #ifdef CONFIG_BCM63XX_CPU_6348
  572. &board_96348r,
  573. &board_96348gw,
  574. &board_96348gw_10,
  575. &board_96348gw_11,
  576. &board_FAST2404,
  577. &board_DV201AMR,
  578. &board_96348gw_a,
  579. &board_rta1025w_16,
  580. #endif
  581. #ifdef CONFIG_BCM63XX_CPU_6358
  582. &board_96358vw,
  583. &board_96358vw2,
  584. &board_AGPFS0,
  585. &board_DWVS0,
  586. #endif
  587. };
  588. /*
  589. * Register a sane SPROMv2 to make the on-board
  590. * bcm4318 WLAN work
  591. */
  592. #ifdef CONFIG_SSB_PCIHOST
  593. static struct ssb_sprom bcm63xx_sprom = {
  594. .revision = 0x02,
  595. .board_rev = 0x17,
  596. .country_code = 0x0,
  597. .ant_available_bg = 0x3,
  598. .pa0b0 = 0x15ae,
  599. .pa0b1 = 0xfa85,
  600. .pa0b2 = 0xfe8d,
  601. .pa1b0 = 0xffff,
  602. .pa1b1 = 0xffff,
  603. .pa1b2 = 0xffff,
  604. .gpio0 = 0xff,
  605. .gpio1 = 0xff,
  606. .gpio2 = 0xff,
  607. .gpio3 = 0xff,
  608. .maxpwr_bg = 0x004c,
  609. .itssi_bg = 0x00,
  610. .boardflags_lo = 0x2848,
  611. .boardflags_hi = 0x0000,
  612. };
  613. int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
  614. {
  615. if (bus->bustype == SSB_BUSTYPE_PCI) {
  616. memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom));
  617. return 0;
  618. } else {
  619. printk(KERN_ERR PFX "unable to fill SPROM for given bustype.\n");
  620. return -EINVAL;
  621. }
  622. }
  623. #endif
  624. /*
  625. * return board name for /proc/cpuinfo
  626. */
  627. const char *board_get_name(void)
  628. {
  629. return board.name;
  630. }
  631. /*
  632. * early init callback, read nvram data from flash and checksum it
  633. */
  634. void __init board_prom_init(void)
  635. {
  636. unsigned int i;
  637. u8 *boot_addr, *cfe;
  638. char cfe_version[32];
  639. char *board_name;
  640. u32 val;
  641. /* read base address of boot chip select (0)
  642. * 6328 does not have MPI but boots from a fixed address
  643. */
  644. if (BCMCPU_IS_6328())
  645. val = 0x18000000;
  646. else {
  647. val = bcm_mpi_readl(MPI_CSBASE_REG(0));
  648. val &= MPI_CSBASE_BASE_MASK;
  649. }
  650. boot_addr = (u8 *)KSEG1ADDR(val);
  651. /* dump cfe version */
  652. cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
  653. if (!memcmp(cfe, "cfe-v", 5))
  654. snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u",
  655. cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]);
  656. else
  657. strcpy(cfe_version, "unknown");
  658. printk(KERN_INFO PFX "CFE version: %s\n", cfe_version);
  659. bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET);
  660. board_name = bcm63xx_nvram_get_name();
  661. /* find board by name */
  662. for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
  663. if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
  664. continue;
  665. /* copy, board desc array is marked initdata */
  666. memcpy(&board, bcm963xx_boards[i], sizeof(board));
  667. break;
  668. }
  669. /* bail out if board is not found, will complain later */
  670. if (!board.name[0]) {
  671. char name[17];
  672. memcpy(name, board_name, 16);
  673. name[16] = 0;
  674. printk(KERN_ERR PFX "unknown bcm963xx board: %s\n",
  675. name);
  676. return;
  677. }
  678. /* setup pin multiplexing depending on board enabled device,
  679. * this has to be done this early since PCI init is done
  680. * inside arch_initcall */
  681. val = 0;
  682. #ifdef CONFIG_PCI
  683. if (board.has_pci) {
  684. bcm63xx_pci_enabled = 1;
  685. if (BCMCPU_IS_6348())
  686. val |= GPIO_MODE_6348_G2_PCI;
  687. }
  688. #endif
  689. if (board.has_pccard) {
  690. if (BCMCPU_IS_6348())
  691. val |= GPIO_MODE_6348_G1_MII_PCCARD;
  692. }
  693. if (board.has_enet0 && !board.enet0.use_internal_phy) {
  694. if (BCMCPU_IS_6348())
  695. val |= GPIO_MODE_6348_G3_EXT_MII |
  696. GPIO_MODE_6348_G0_EXT_MII;
  697. }
  698. if (board.has_enet1 && !board.enet1.use_internal_phy) {
  699. if (BCMCPU_IS_6348())
  700. val |= GPIO_MODE_6348_G3_EXT_MII |
  701. GPIO_MODE_6348_G0_EXT_MII;
  702. }
  703. bcm_gpio_writel(val, GPIO_MODE_REG);
  704. }
  705. /*
  706. * second stage init callback, good time to panic if we couldn't
  707. * identify on which board we're running since early printk is working
  708. */
  709. void __init board_setup(void)
  710. {
  711. if (!board.name[0])
  712. panic("unable to detect bcm963xx board");
  713. printk(KERN_INFO PFX "board name: %s\n", board.name);
  714. /* make sure we're running on expected cpu */
  715. if (bcm63xx_get_cpu_id() != board.expected_cpu_id)
  716. panic("unexpected CPU for bcm963xx board");
  717. }
  718. static struct gpio_led_platform_data bcm63xx_led_data;
  719. static struct platform_device bcm63xx_gpio_leds = {
  720. .name = "leds-gpio",
  721. .id = 0,
  722. .dev.platform_data = &bcm63xx_led_data,
  723. };
  724. /*
  725. * third stage init callback, register all board devices.
  726. */
  727. int __init board_register_devices(void)
  728. {
  729. if (board.has_uart0)
  730. bcm63xx_uart_register(0);
  731. if (board.has_uart1)
  732. bcm63xx_uart_register(1);
  733. if (board.has_pccard)
  734. bcm63xx_pcmcia_register();
  735. if (board.has_enet0 &&
  736. !bcm63xx_nvram_get_mac_address(board.enet0.mac_addr))
  737. bcm63xx_enet_register(0, &board.enet0);
  738. if (board.has_enet1 &&
  739. !bcm63xx_nvram_get_mac_address(board.enet1.mac_addr))
  740. bcm63xx_enet_register(1, &board.enet1);
  741. if (board.has_usbd)
  742. bcm63xx_usbd_register(&board.usbd);
  743. if (board.has_dsp)
  744. bcm63xx_dsp_register(&board.dsp);
  745. /* Generate MAC address for WLAN and register our SPROM,
  746. * do this after registering enet devices
  747. */
  748. #ifdef CONFIG_SSB_PCIHOST
  749. if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) {
  750. memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
  751. memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
  752. if (ssb_arch_register_fallback_sprom(
  753. &bcm63xx_get_fallback_sprom) < 0)
  754. pr_err(PFX "failed to register fallback SPROM\n");
  755. }
  756. #endif
  757. bcm63xx_spi_register();
  758. bcm63xx_flash_register();
  759. bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
  760. bcm63xx_led_data.leds = board.leds;
  761. platform_device_register(&bcm63xx_gpio_leds);
  762. return 0;
  763. }