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