board_bcm963xx.c 15 KB

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