board_bcm963xx.c 15 KB

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