aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <ffainelli@freebox.fr>2010-03-23 05:30:08 -0400
committerRalf Baechle <ralf@linux-mips.org>2010-04-12 12:26:20 -0400
commit5e3644a95db11e2e582ae3765ffad6e0cce5376e (patch)
treefb2b262cbdb5d2f1c2d4e0a8d378e923ee4663ed
parent5808184f1b2fe06ef8a54a2b7fb1596d58098acf (diff)
MIPS: BCM63xx: Fix build failure in board_bcm963xx.c
Since 2083e8327aeeaf818b0e4522a9d2539835c60423, the SPROM is now registered in the board_prom_init callback, but it references variables and functions which are declared below. Move the variables and functions above board_prom_init. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> To: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/1077/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c140
1 files changed, 70 insertions, 70 deletions
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 5addb9c6fb0b..8dba8cfb752f 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -619,6 +619,76 @@ static const struct board_info __initdata *bcm963xx_boards[] = {
619}; 619};
620 620
621/* 621/*
622 * Register a sane SPROMv2 to make the on-board
623 * bcm4318 WLAN work
624 */
625#ifdef CONFIG_SSB_PCIHOST
626static struct ssb_sprom bcm63xx_sprom = {
627 .revision = 0x02,
628 .board_rev = 0x17,
629 .country_code = 0x0,
630 .ant_available_bg = 0x3,
631 .pa0b0 = 0x15ae,
632 .pa0b1 = 0xfa85,
633 .pa0b2 = 0xfe8d,
634 .pa1b0 = 0xffff,
635 .pa1b1 = 0xffff,
636 .pa1b2 = 0xffff,
637 .gpio0 = 0xff,
638 .gpio1 = 0xff,
639 .gpio2 = 0xff,
640 .gpio3 = 0xff,
641 .maxpwr_bg = 0x004c,
642 .itssi_bg = 0x00,
643 .boardflags_lo = 0x2848,
644 .boardflags_hi = 0x0000,
645};
646#endif
647
648/*
649 * return board name for /proc/cpuinfo
650 */
651const char *board_get_name(void)
652{
653 return board.name;
654}
655
656/*
657 * register & return a new board mac address
658 */
659static int board_get_mac_address(u8 *mac)
660{
661 u8 *p;
662 int count;
663
664 if (mac_addr_used >= nvram.mac_addr_count) {
665 printk(KERN_ERR PFX "not enough mac address\n");
666 return -ENODEV;
667 }
668
669 memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
670 p = mac + ETH_ALEN - 1;
671 count = mac_addr_used;
672
673 while (count--) {
674 do {
675 (*p)++;
676 if (*p != 0)
677 break;
678 p--;
679 } while (p != mac);
680 }
681
682 if (p == mac) {
683 printk(KERN_ERR PFX "unable to fetch mac address\n");
684 return -ENODEV;
685 }
686
687 mac_addr_used++;
688 return 0;
689}
690
691/*
622 * early init callback, read nvram data from flash and checksum it 692 * early init callback, read nvram data from flash and checksum it
623 */ 693 */
624void __init board_prom_init(void) 694void __init board_prom_init(void)
@@ -744,49 +814,6 @@ void __init board_setup(void)
744 panic("unexpected CPU for bcm963xx board"); 814 panic("unexpected CPU for bcm963xx board");
745} 815}
746 816
747/*
748 * return board name for /proc/cpuinfo
749 */
750const char *board_get_name(void)
751{
752 return board.name;
753}
754
755/*
756 * register & return a new board mac address
757 */
758static int board_get_mac_address(u8 *mac)
759{
760 u8 *p;
761 int count;
762
763 if (mac_addr_used >= nvram.mac_addr_count) {
764 printk(KERN_ERR PFX "not enough mac address\n");
765 return -ENODEV;
766 }
767
768 memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
769 p = mac + ETH_ALEN - 1;
770 count = mac_addr_used;
771
772 while (count--) {
773 do {
774 (*p)++;
775 if (*p != 0)
776 break;
777 p--;
778 } while (p != mac);
779 }
780
781 if (p == mac) {
782 printk(KERN_ERR PFX "unable to fetch mac address\n");
783 return -ENODEV;
784 }
785
786 mac_addr_used++;
787 return 0;
788}
789
790static struct mtd_partition mtd_partitions[] = { 817static struct mtd_partition mtd_partitions[] = {
791 { 818 {
792 .name = "cfe", 819 .name = "cfe",
@@ -818,33 +845,6 @@ static struct platform_device mtd_dev = {
818 }, 845 },
819}; 846};
820 847
821/*
822 * Register a sane SPROMv2 to make the on-board
823 * bcm4318 WLAN work
824 */
825#ifdef CONFIG_SSB_PCIHOST
826static struct ssb_sprom bcm63xx_sprom = {
827 .revision = 0x02,
828 .board_rev = 0x17,
829 .country_code = 0x0,
830 .ant_available_bg = 0x3,
831 .pa0b0 = 0x15ae,
832 .pa0b1 = 0xfa85,
833 .pa0b2 = 0xfe8d,
834 .pa1b0 = 0xffff,
835 .pa1b1 = 0xffff,
836 .pa1b2 = 0xffff,
837 .gpio0 = 0xff,
838 .gpio1 = 0xff,
839 .gpio2 = 0xff,
840 .gpio3 = 0xff,
841 .maxpwr_bg = 0x004c,
842 .itssi_bg = 0x00,
843 .boardflags_lo = 0x2848,
844 .boardflags_hi = 0x0000,
845};
846#endif
847
848static struct gpio_led_platform_data bcm63xx_led_data; 848static struct gpio_led_platform_data bcm63xx_led_data;
849 849
850static struct platform_device bcm63xx_gpio_leds = { 850static struct platform_device bcm63xx_gpio_leds = {