board_bcm963xx.c 15 KB

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