1 From 0daf361ea799fba0af5a232036d0f06cea85ad24 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sat, 21 Jun 2014 12:47:49 +0200
4 Subject: [PATCH 42/44] MIPS: BCM63XX: allow building support for more than one
7 Use the arguments passed to the kernel to detect being booted with
8 CFE as the indicator for bcm963xx board support, allowing the
9 non presence of CFE_EPTSEAL to assume a different board type.
11 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
13 arch/mips/bcm63xx/boards/Kconfig | 7 +++----
14 arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +-
15 arch/mips/bcm63xx/boards/board_common.c | 13 +++++++++++++
16 arch/mips/bcm63xx/boards/board_common.h | 6 ++++++
17 4 files changed, 23 insertions(+), 5 deletions(-)
19 --- a/arch/mips/bcm63xx/boards/Kconfig
20 +++ b/arch/mips/bcm63xx/boards/Kconfig
22 # SPDX-License-Identifier: GPL-2.0
24 - prompt "Board support"
27 - default BOARD_BCM963XX
30 bool "Generic Broadcom 963xx boards"
36 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
37 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
38 @@ -686,7 +686,7 @@ static const struct board_info __initcon
40 * early init callback, read nvram data from flash and checksum it
42 -void __init board_prom_init(void)
43 +void __init board_bcm963xx_init(void)
47 --- a/arch/mips/bcm63xx/boards/board_common.c
48 +++ b/arch/mips/bcm63xx/boards/board_common.c
50 #include <linux/platform_device.h>
51 #include <linux/ssb/ssb.h>
52 #include <asm/addrspace.h>
53 +#include <asm/bootinfo.h>
54 +#include <asm/fw/cfe/cfe_api.h>
55 #include <bcm63xx_board.h>
56 #include <bcm63xx_cpu.h>
57 #include <bcm63xx_dev_uart.h>
59 #include <bcm63xx_dev_usb_usbd.h>
60 #include <board_bcm963xx.h>
62 +#include "board_common.h"
66 static struct board_info board;
67 @@ -80,6 +84,15 @@ const char *board_get_name(void)
71 +void __init board_prom_init(void)
73 + /* detect bootloader */
74 + if (fw_arg3 == CFE_EPTSEAL)
75 + board_bcm963xx_init();
77 + panic("unsupported bootloader detected");
80 static int (*board_get_mac_address)(u8 mac[ETH_ALEN]);
83 --- a/arch/mips/bcm63xx/boards/board_common.h
84 +++ b/arch/mips/bcm63xx/boards/board_common.h
86 void board_early_setup(const struct board_info *board,
87 int (*get_mac_address)(u8 mac[ETH_ALEN]));
89 +#if defined(CONFIG_BOARD_BCM963XX)
90 +void board_bcm963xx_init(void);
92 +static inline void board_bcm963xx_init(void) { }
95 #endif /* __BOARD_COMMON_H */