board_bcm963xx.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  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_DV201AMR = {
  331. .name = "DV201AMR",
  332. .expected_cpu_id = 0x6348,
  333. .has_pci = 1,
  334. .has_ohci0 = 1,
  335. .has_enet0 = 1,
  336. .has_enet1 = 1,
  337. .enet0 = {
  338. .has_phy = 1,
  339. .use_internal_phy = 1,
  340. },
  341. .enet1 = {
  342. .force_speed_100 = 1,
  343. .force_duplex_full = 1,
  344. },
  345. };
  346. static struct board_info __initdata board_96348gw_a = {
  347. .name = "96348GW-A",
  348. .expected_cpu_id = 0x6348,
  349. .has_enet0 = 1,
  350. .has_enet1 = 1,
  351. .has_pci = 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. .has_ohci0 = 1,
  361. };
  362. #endif
  363. /*
  364. * known 6358 boards
  365. */
  366. #ifdef CONFIG_BCM63XX_CPU_6358
  367. static struct board_info __initdata board_96358vw = {
  368. .name = "96358VW",
  369. .expected_cpu_id = 0x6358,
  370. .has_enet0 = 1,
  371. .has_enet1 = 1,
  372. .has_pci = 1,
  373. .enet0 = {
  374. .has_phy = 1,
  375. .use_internal_phy = 1,
  376. },
  377. .enet1 = {
  378. .force_speed_100 = 1,
  379. .force_duplex_full = 1,
  380. },
  381. .has_ohci0 = 1,
  382. .has_pccard = 1,
  383. .has_ehci0 = 1,
  384. .leds = {
  385. {
  386. .name = "adsl-fail",
  387. .gpio = 15,
  388. .active_low = 1,
  389. },
  390. {
  391. .name = "ppp",
  392. .gpio = 22,
  393. .active_low = 1,
  394. },
  395. {
  396. .name = "ppp-fail",
  397. .gpio = 23,
  398. .active_low = 1,
  399. },
  400. {
  401. .name = "power",
  402. .gpio = 4,
  403. .default_trigger = "default-on",
  404. },
  405. {
  406. .name = "stop",
  407. .gpio = 5,
  408. },
  409. },
  410. };
  411. static struct board_info __initdata board_96358vw2 = {
  412. .name = "96358VW2",
  413. .expected_cpu_id = 0x6358,
  414. .has_enet0 = 1,
  415. .has_enet1 = 1,
  416. .has_pci = 1,
  417. .enet0 = {
  418. .has_phy = 1,
  419. .use_internal_phy = 1,
  420. },
  421. .enet1 = {
  422. .force_speed_100 = 1,
  423. .force_duplex_full = 1,
  424. },
  425. .has_ohci0 = 1,
  426. .has_pccard = 1,
  427. .has_ehci0 = 1,
  428. .leds = {
  429. {
  430. .name = "adsl",
  431. .gpio = 22,
  432. .active_low = 1,
  433. },
  434. {
  435. .name = "ppp-fail",
  436. .gpio = 23,
  437. },
  438. {
  439. .name = "power",
  440. .gpio = 5,
  441. .active_low = 1,
  442. .default_trigger = "default-on",
  443. },
  444. {
  445. .name = "stop",
  446. .gpio = 4,
  447. .active_low = 1,
  448. },
  449. },
  450. };
  451. static struct board_info __initdata board_AGPFS0 = {
  452. .name = "AGPF-S0",
  453. .expected_cpu_id = 0x6358,
  454. .has_enet0 = 1,
  455. .has_enet1 = 1,
  456. .has_pci = 1,
  457. .enet0 = {
  458. .has_phy = 1,
  459. .use_internal_phy = 1,
  460. },
  461. .enet1 = {
  462. .force_speed_100 = 1,
  463. .force_duplex_full = 1,
  464. },
  465. .has_ohci0 = 1,
  466. .has_ehci0 = 1,
  467. };
  468. #endif
  469. /*
  470. * all boards
  471. */
  472. static const struct board_info __initdata *bcm963xx_boards[] = {
  473. #ifdef CONFIG_BCM63XX_CPU_6338
  474. &board_96338gw,
  475. &board_96338w,
  476. #endif
  477. #ifdef CONFIG_BCM63XX_CPU_6345
  478. &board_96345gw2,
  479. #endif
  480. #ifdef CONFIG_BCM63XX_CPU_6348
  481. &board_96348r,
  482. &board_96348gw,
  483. &board_96348gw_10,
  484. &board_96348gw_11,
  485. &board_FAST2404,
  486. &board_DV201AMR,
  487. &board_96348gw_a,
  488. #endif
  489. #ifdef CONFIG_BCM63XX_CPU_6358
  490. &board_96358vw,
  491. &board_96358vw2,
  492. &board_AGPFS0,
  493. #endif
  494. };
  495. /*
  496. * early init callback, read nvram data from flash and checksum it
  497. */
  498. void __init board_prom_init(void)
  499. {
  500. unsigned int check_len, i;
  501. u8 *boot_addr, *cfe, *p;
  502. char cfe_version[32];
  503. u32 val;
  504. /* read base address of boot chip select (0)
  505. * 6345 does not have MPI but boots from standard
  506. * MIPS Flash address */
  507. if (BCMCPU_IS_6345())
  508. val = 0x1fc00000;
  509. else {
  510. val = bcm_mpi_readl(MPI_CSBASE_REG(0));
  511. val &= MPI_CSBASE_BASE_MASK;
  512. }
  513. boot_addr = (u8 *)KSEG1ADDR(val);
  514. /* dump cfe version */
  515. cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
  516. if (!memcmp(cfe, "cfe-v", 5))
  517. snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u",
  518. cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]);
  519. else
  520. strcpy(cfe_version, "unknown");
  521. printk(KERN_INFO PFX "CFE version: %s\n", cfe_version);
  522. /* extract nvram data */
  523. memcpy(&nvram, boot_addr + BCM963XX_NVRAM_OFFSET, sizeof(nvram));
  524. /* check checksum before using data */
  525. if (nvram.version <= 4)
  526. check_len = offsetof(struct bcm963xx_nvram, checksum_old);
  527. else
  528. check_len = sizeof(nvram);
  529. val = 0;
  530. p = (u8 *)&nvram;
  531. while (check_len--)
  532. val += *p;
  533. if (val) {
  534. printk(KERN_ERR PFX "invalid nvram checksum\n");
  535. return;
  536. }
  537. /* find board by name */
  538. for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
  539. if (strncmp(nvram.name, bcm963xx_boards[i]->name,
  540. sizeof(nvram.name)))
  541. continue;
  542. /* copy, board desc array is marked initdata */
  543. memcpy(&board, bcm963xx_boards[i], sizeof(board));
  544. break;
  545. }
  546. /* bail out if board is not found, will complain later */
  547. if (!board.name[0]) {
  548. char name[17];
  549. memcpy(name, nvram.name, 16);
  550. name[16] = 0;
  551. printk(KERN_ERR PFX "unknown bcm963xx board: %s\n",
  552. name);
  553. return;
  554. }
  555. /* setup pin multiplexing depending on board enabled device,
  556. * this has to be done this early since PCI init is done
  557. * inside arch_initcall */
  558. val = 0;
  559. #ifdef CONFIG_PCI
  560. if (board.has_pci) {
  561. bcm63xx_pci_enabled = 1;
  562. if (BCMCPU_IS_6348())
  563. val |= GPIO_MODE_6348_G2_PCI;
  564. }
  565. #endif
  566. if (board.has_pccard) {
  567. if (BCMCPU_IS_6348())
  568. val |= GPIO_MODE_6348_G1_MII_PCCARD;
  569. }
  570. if (board.has_enet0 && !board.enet0.use_internal_phy) {
  571. if (BCMCPU_IS_6348())
  572. val |= GPIO_MODE_6348_G3_EXT_MII |
  573. GPIO_MODE_6348_G0_EXT_MII;
  574. }
  575. if (board.has_enet1 && !board.enet1.use_internal_phy) {
  576. if (BCMCPU_IS_6348())
  577. val |= GPIO_MODE_6348_G3_EXT_MII |
  578. GPIO_MODE_6348_G0_EXT_MII;
  579. }
  580. bcm_gpio_writel(val, GPIO_MODE_REG);
  581. }
  582. /*
  583. * second stage init callback, good time to panic if we couldn't
  584. * identify on which board we're running since early printk is working
  585. */
  586. void __init board_setup(void)
  587. {
  588. if (!board.name[0])
  589. panic("unable to detect bcm963xx board");
  590. printk(KERN_INFO PFX "board name: %s\n", board.name);
  591. /* make sure we're running on expected cpu */
  592. if (bcm63xx_get_cpu_id() != board.expected_cpu_id)
  593. panic("unexpected CPU for bcm963xx board");
  594. }
  595. /*
  596. * return board name for /proc/cpuinfo
  597. */
  598. const char *board_get_name(void)
  599. {
  600. return board.name;
  601. }
  602. /*
  603. * register & return a new board mac address
  604. */
  605. static int board_get_mac_address(u8 *mac)
  606. {
  607. u8 *p;
  608. int count;
  609. if (mac_addr_used >= nvram.mac_addr_count) {
  610. printk(KERN_ERR PFX "not enough mac address\n");
  611. return -ENODEV;
  612. }
  613. memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
  614. p = mac + ETH_ALEN - 1;
  615. count = mac_addr_used;
  616. while (count--) {
  617. do {
  618. (*p)++;
  619. if (*p != 0)
  620. break;
  621. p--;
  622. } while (p != mac);
  623. }
  624. if (p == mac) {
  625. printk(KERN_ERR PFX "unable to fetch mac address\n");
  626. return -ENODEV;
  627. }
  628. mac_addr_used++;
  629. return 0;
  630. }
  631. static struct mtd_partition mtd_partitions[] = {
  632. {
  633. .name = "cfe",
  634. .offset = 0x0,
  635. .size = 0x40000,
  636. }
  637. };
  638. static struct physmap_flash_data flash_data = {
  639. .width = 2,
  640. .nr_parts = ARRAY_SIZE(mtd_partitions),
  641. .parts = mtd_partitions,
  642. };
  643. static struct resource mtd_resources[] = {
  644. {
  645. .start = 0, /* filled at runtime */
  646. .end = 0, /* filled at runtime */
  647. .flags = IORESOURCE_MEM,
  648. }
  649. };
  650. static struct platform_device mtd_dev = {
  651. .name = "physmap-flash",
  652. .resource = mtd_resources,
  653. .num_resources = ARRAY_SIZE(mtd_resources),
  654. .dev = {
  655. .platform_data = &flash_data,
  656. },
  657. };
  658. /*
  659. * Register a sane SPROMv2 to make the on-board
  660. * bcm4318 WLAN work
  661. */
  662. #ifdef CONFIG_SSB_PCIHOST
  663. static struct ssb_sprom bcm63xx_sprom = {
  664. .revision = 0x02,
  665. .board_rev = 0x17,
  666. .country_code = 0x0,
  667. .ant_available_bg = 0x3,
  668. .pa0b0 = 0x15ae,
  669. .pa0b1 = 0xfa85,
  670. .pa0b2 = 0xfe8d,
  671. .pa1b0 = 0xffff,
  672. .pa1b1 = 0xffff,
  673. .pa1b2 = 0xffff,
  674. .gpio0 = 0xff,
  675. .gpio1 = 0xff,
  676. .gpio2 = 0xff,
  677. .gpio3 = 0xff,
  678. .maxpwr_bg = 0x004c,
  679. .itssi_bg = 0x00,
  680. .boardflags_lo = 0x2848,
  681. .boardflags_hi = 0x0000,
  682. };
  683. #endif
  684. static struct gpio_led_platform_data bcm63xx_led_data;
  685. static struct platform_device bcm63xx_gpio_leds = {
  686. .name = "leds-gpio",
  687. .id = 0,
  688. .dev.platform_data = &bcm63xx_led_data,
  689. };
  690. /*
  691. * third stage init callback, register all board devices.
  692. */
  693. int __init board_register_devices(void)
  694. {
  695. u32 val;
  696. if (board.has_pccard)
  697. bcm63xx_pcmcia_register();
  698. if (board.has_enet0 &&
  699. !board_get_mac_address(board.enet0.mac_addr))
  700. bcm63xx_enet_register(0, &board.enet0);
  701. if (board.has_enet1 &&
  702. !board_get_mac_address(board.enet1.mac_addr))
  703. bcm63xx_enet_register(1, &board.enet1);
  704. if (board.has_dsp)
  705. bcm63xx_dsp_register(&board.dsp);
  706. /* Generate MAC address for WLAN and
  707. * register our SPROM */
  708. #ifdef CONFIG_SSB_PCIHOST
  709. if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
  710. memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
  711. memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
  712. if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
  713. printk(KERN_ERR "failed to register fallback SPROM\n");
  714. }
  715. #endif
  716. /* read base address of boot chip select (0) */
  717. if (BCMCPU_IS_6345())
  718. val = 0x1fc00000;
  719. else {
  720. val = bcm_mpi_readl(MPI_CSBASE_REG(0));
  721. val &= MPI_CSBASE_BASE_MASK;
  722. }
  723. mtd_resources[0].start = val;
  724. mtd_resources[0].end = 0x1FFFFFFF;
  725. platform_device_register(&mtd_dev);
  726. bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
  727. bcm63xx_led_data.leds = board.leds;
  728. platform_device_register(&bcm63xx_gpio_leds);
  729. return 0;
  730. }