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