11 #include <linux/kernel.h>
12 #include <linux/string.h>
15 #include <asm/addrspace.h>
30 #define PFX "board_bcm963xx: "
33 static unsigned int mac_addr_used;
39 #ifdef CONFIG_BCM63XX_CPU_6328
42 .expected_cpu_id = 0x6328,
55 .name =
"96328avng::ppp-fail",
60 .name =
"96328avng::power",
63 .default_trigger =
"default-on",
66 .name =
"96328avng::power-fail",
71 .name =
"96328avng::wps",
76 .name =
"96328avng::ppp",
87 #ifdef CONFIG_BCM63XX_CPU_6338
90 .expected_cpu_id = 0x6338,
96 .force_duplex_full = 1,
121 .default_trigger =
"default-on",
133 .expected_cpu_id = 0x6338,
138 .force_speed_100 = 1,
139 .force_duplex_full = 1,
162 .default_trigger =
"default-on",
176 #ifdef CONFIG_BCM63XX_CPU_6345
179 .expected_cpu_id = 0x6345,
188 #ifdef CONFIG_BCM63XX_CPU_6348
191 .expected_cpu_id = 0x6348,
199 .use_internal_phy = 1,
222 .default_trigger =
"default-on",
234 .name =
"96348GW-10",
235 .expected_cpu_id = 0x6348,
244 .use_internal_phy = 1,
247 .force_speed_100 = 1,
248 .force_duplex_full = 1,
283 .default_trigger =
"default-on",
294 .name =
"96348GW-11",
295 .expected_cpu_id = 0x6348,
304 .use_internal_phy = 1,
308 .force_speed_100 = 1,
309 .force_duplex_full = 1,
337 .default_trigger =
"default-on",
349 .expected_cpu_id = 0x6348,
358 .use_internal_phy = 1,
361 .force_speed_100 = 1,
362 .force_duplex_full = 1,
395 .default_trigger =
"default-on",
407 .expected_cpu_id = 0x6348,
416 .use_internal_phy = 1,
420 .force_speed_100 = 1,
421 .force_duplex_full = 1,
430 .name =
"RTA1025W_16",
431 .expected_cpu_id = 0x6348,
439 .use_internal_phy = 1,
442 .force_speed_100 = 1,
443 .force_duplex_full = 1,
450 .expected_cpu_id = 0x6348,
460 .use_internal_phy = 1,
463 .force_speed_100 = 1,
464 .force_duplex_full = 1,
470 .expected_cpu_id = 0x6348,
479 .use_internal_phy = 1,
482 .force_speed_100 = 1,
483 .force_duplex_full = 1,
493 #ifdef CONFIG_BCM63XX_CPU_6358
496 .expected_cpu_id = 0x6358,
505 .use_internal_phy = 1,
509 .force_speed_100 = 1,
510 .force_duplex_full = 1,
537 .default_trigger =
"default-on",
548 .expected_cpu_id = 0x6358,
557 .use_internal_phy = 1,
561 .force_speed_100 = 1,
562 .force_duplex_full = 1,
584 .default_trigger =
"default-on",
596 .expected_cpu_id = 0x6358,
605 .use_internal_phy = 1,
609 .force_speed_100 = 1,
610 .force_duplex_full = 1,
619 .expected_cpu_id = 0x6358,
627 .use_internal_phy = 1,
631 .force_speed_100 = 1,
632 .force_duplex_full = 1,
643 #ifdef CONFIG_BCM63XX_CPU_6328
646 #ifdef CONFIG_BCM63XX_CPU_6338
650 #ifdef CONFIG_BCM63XX_CPU_6345
653 #ifdef CONFIG_BCM63XX_CPU_6348
664 #ifdef CONFIG_BCM63XX_CPU_6358
676 #ifdef CONFIG_SSB_PCIHOST
677 static struct ssb_sprom bcm63xx_sprom = {
681 .ant_available_bg = 0x3,
694 .boardflags_lo = 0x2848,
695 .boardflags_hi = 0x0000,
721 static int board_get_mac_address(
u8 *
mac)
726 if (mac_addr_used >=
nvram.mac_addr_count) {
733 count = mac_addr_used;
760 unsigned int check_len,
i;
761 u8 *boot_addr, *cfe, *
p;
762 char cfe_version[32];
778 if (!
memcmp(cfe,
"cfe-v", 5))
779 snprintf(cfe_version,
sizeof(cfe_version),
"%u.%u.%u-%u.%u",
780 cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]);
782 strcpy(cfe_version,
"unknown");
792 check_len =
sizeof(
nvram);
803 for (i = 0; i <
ARRAY_SIZE(bcm963xx_boards); i++) {
835 if (
board.has_pccard) {
840 if (
board.has_enet0 && !
board.enet0.use_internal_phy) {
846 if (
board.has_enet1 && !
board.enet1.use_internal_phy) {
862 panic(
"unable to detect bcm963xx board");
866 if (bcm63xx_get_cpu_id() !=
board.expected_cpu_id)
867 panic(
"unexpected CPU for bcm963xx board");
875 .dev.platform_data = &bcm63xx_led_data,
889 if (
board.has_pccard)
892 if (
board.has_enet0 &&
893 !board_get_mac_address(
board.enet0.mac_addr))
896 if (
board.has_enet1 &&
897 !board_get_mac_address(
board.enet1.mac_addr))
909 #ifdef CONFIG_SSB_PCIHOST
910 if (!board_get_mac_address(bcm63xx_sprom.
il0mac)) {
914 &bcm63xx_get_fallback_sprom) < 0)
915 pr_err(
PFX "failed to register fallback SPROM\n");
924 bcm63xx_led_data.leds =
board.leds;