1 --- a/arch/mips/bcm63xx/boards/Kconfig
2 +++ b/arch/mips/bcm63xx/boards/Kconfig
3 @@ -7,4 +7,9 @@ config BOARD_BCM963XX
4 bool "Generic Broadcom 963xx boards"
8 + bool "Inventel Livebox(es) boards"
10 + Boards using RedBoot.
13 --- a/arch/mips/bcm63xx/boards/Makefile
14 +++ b/arch/mips/bcm63xx/boards/Makefile
16 obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
17 +obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o
19 +++ b/arch/mips/bcm63xx/boards/board_livebox.c
22 + * This file is subject to the terms and conditions of the GNU General Public
23 + * License. See the file "COPYING" in the main directory of this archive
26 + * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
29 +#include <linux/init.h>
30 +#include <linux/kernel.h>
31 +#include <linux/string.h>
32 +#include <linux/platform_device.h>
33 +#include <linux/mtd/mtd.h>
34 +#include <linux/mtd/partitions.h>
35 +#include <linux/mtd/physmap.h>
36 +#include <asm/addrspace.h>
37 +#include <bcm63xx_board.h>
38 +#include <bcm63xx_cpu.h>
39 +#include <bcm63xx_regs.h>
40 +#include <bcm63xx_io.h>
41 +#include <bcm63xx_board.h>
42 +#include <bcm63xx_dev_pci.h>
43 +#include <bcm63xx_dev_uart.h>
44 +#include <bcm63xx_dev_enet.h>
45 +#include <bcm63xx_dev_pcmcia.h>
46 +#include <bcm63xx_dev_usb_ohci.h>
47 +#include <bcm63xx_dev_usb_ehci.h>
48 +#include <board_bcm963xx.h>
50 +#define PFX "board_livebox: "
52 +static unsigned int mac_addr_used = 0;
53 +static struct board_info board;
58 +#ifdef CONFIG_BCM63XX_CPU_6348
59 +static struct board_info __initdata board_livebox = {
61 + .expected_cpu_id = 0x6348,
68 + .use_internal_phy = 1,
76 +static const struct board_info __initdata *bcm963xx_boards[] = {
77 +#ifdef CONFIG_BCM63XX_CPU_6348
83 + * early init callback
85 +void __init board_prom_init(void)
89 + /* read base address of boot chip select (0) */
90 + val = bcm_mpi_readl(MPI_CSBASE_REG(0));
91 + val &= MPI_CSBASE_BASE_MASK;
93 + /* assume board is a Livebox */
94 + memcpy(&board, bcm963xx_boards[0], sizeof(board));
96 + /* setup pin multiplexing depending on board enabled device,
97 + * this has to be done this early since PCI init is done
98 + * inside arch_initcall */
101 + if (board.has_pci) {
102 + bcm63xx_pci_enabled = 1;
103 + if (BCMCPU_IS_6348())
104 + val |= GPIO_MODE_6348_G2_PCI;
107 + if (board.has_pccard) {
108 + if (BCMCPU_IS_6348())
109 + val |= GPIO_MODE_6348_G1_MII_PCCARD;
112 + if (board.has_enet0 && !board.enet0.use_internal_phy) {
113 + if (BCMCPU_IS_6348())
114 + val |= GPIO_MODE_6348_G3_EXT_MII |
115 + GPIO_MODE_6348_G0_EXT_MII;
118 + if (board.has_enet1 && !board.enet1.use_internal_phy) {
119 + if (BCMCPU_IS_6348())
120 + val |= GPIO_MODE_6348_G3_EXT_MII |
121 + GPIO_MODE_6348_G0_EXT_MII;
124 + bcm_gpio_writel(val, GPIO_MODE_REG);
128 + * second stage init callback, good time to panic if we couldn't
129 + * identify on which board we're running since early printk is working
131 +void __init board_setup(void)
133 + if (!board.name[0])
134 + panic("unable to detect bcm963xx board");
135 + printk(KERN_INFO PFX "board name: %s\n", board.name);
137 + /* make sure we're running on expected cpu */
138 + if (bcm63xx_get_cpu_id() != board.expected_cpu_id)
139 + panic("unexpected CPU for bcm963xx board");
143 + * return board name for /proc/cpuinfo
145 +const char *board_get_name(void)
151 + * register & return a new board mac address
153 +static int board_get_mac_address(u8 *mac)
155 + /* Not yet implemented */
160 + * third stage init callback, register all board devices.
162 +int __init board_register_devices(void)
166 + bcm63xx_uart_register();
168 + if (board.has_pccard)
169 + bcm63xx_pcmcia_register();
171 + if (board.has_enet0 &&
172 + !board_get_mac_address(board.enet0.mac_addr))
173 + bcm63xx_enet_register(0, &board.enet0);
175 + if (board.has_enet1 &&
176 + !board_get_mac_address(board.enet1.mac_addr))
177 + bcm63xx_enet_register(1, &board.enet1);
179 + if (board.has_ohci0)
180 + bcm63xx_ohci_register();
182 + if (board.has_ehci0)
183 + bcm63xx_ehci_register();
186 + /* read base address of boot chip select (0) */
187 + val = bcm_mpi_readl(MPI_CSBASE_REG(0));
188 + val &= MPI_CSBASE_BASE_MASK;