1 Index: linux-2.6.32.9/arch/mips/bcm63xx/boards/Kconfig
2 ===================================================================
3 --- linux-2.6.32.9.orig/arch/mips/bcm63xx/boards/Kconfig 2010-02-28 19:03:38.000000000 +0100
4 +++ linux-2.6.32.9/arch/mips/bcm63xx/boards/Kconfig 2010-02-28 19:04:38.000000000 +0100
10 + bool "Inventel Livebox(es) boards"
13 + Inventel Livebox boards using the RedBoot bootloader.
16 Index: linux-2.6.32.9/arch/mips/bcm63xx/boards/Makefile
17 ===================================================================
18 --- linux-2.6.32.9.orig/arch/mips/bcm63xx/boards/Makefile 2010-02-28 19:03:45.000000000 +0100
19 +++ linux-2.6.32.9/arch/mips/bcm63xx/boards/Makefile 2010-02-28 19:04:54.000000000 +0100
21 obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
22 +obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o
24 EXTRA_CFLAGS += -Werror
25 Index: linux-2.6.32.9/arch/mips/bcm63xx/boards/board_livebox.c
26 ===================================================================
27 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
28 +++ linux-2.6.32.9/arch/mips/bcm63xx/boards/board_livebox.c 2010-02-28 19:05:16.000000000 +0100
31 + * This file is subject to the terms and conditions of the GNU General Public
32 + * License. See the file "COPYING" in the main directory of this archive
35 + * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
38 +#include <linux/init.h>
39 +#include <linux/kernel.h>
40 +#include <linux/string.h>
41 +#include <linux/platform_device.h>
42 +#include <linux/mtd/mtd.h>
43 +#include <linux/mtd/partitions.h>
44 +#include <linux/mtd/physmap.h>
45 +#include <asm/addrspace.h>
46 +#include <bcm63xx_board.h>
47 +#include <bcm63xx_cpu.h>
48 +#include <bcm63xx_regs.h>
49 +#include <bcm63xx_io.h>
50 +#include <bcm63xx_board.h>
51 +#include <bcm63xx_dev_pci.h>
52 +#include <bcm63xx_dev_uart.h>
53 +#include <bcm63xx_dev_wdt.h>
54 +#include <bcm63xx_dev_enet.h>
55 +#include <bcm63xx_dev_pcmcia.h>
56 +#include <bcm63xx_dev_usb_ohci.h>
57 +#include <bcm63xx_dev_usb_ehci.h>
58 +#include <board_bcm963xx.h>
60 +#define PFX "board_livebox: "
62 +static unsigned int mac_addr_used = 0;
63 +static struct board_info board;
68 +#ifdef CONFIG_BCM63XX_CPU_6348
69 +static struct board_info __initdata board_livebox = {
71 + .expected_cpu_id = 0x6348,
79 + .use_internal_phy = 1,
83 + .force_speed_100 = 1,
84 + .force_duplex_full = 1,
96 +static const struct board_info __initdata *bcm963xx_boards[] = {
97 +#ifdef CONFIG_BCM63XX_CPU_6348
103 + * early init callback
105 +void __init board_prom_init(void)
109 + /* read base address of boot chip select (0) */
110 + val = bcm_mpi_readl(MPI_CSBASE_REG(0));
111 + val &= MPI_CSBASE_BASE_MASK;
113 + /* assume board is a Livebox */
114 + memcpy(&board, bcm963xx_boards[0], sizeof(board));
116 + /* setup pin multiplexing depending on board enabled device,
117 + * this has to be done this early since PCI init is done
118 + * inside arch_initcall */
121 + if (board.has_pci) {
122 + bcm63xx_pci_enabled = 1;
123 + if (BCMCPU_IS_6348())
124 + val |= GPIO_MODE_6348_G2_PCI;
127 + if (board.has_pccard) {
128 + if (BCMCPU_IS_6348())
129 + val |= GPIO_MODE_6348_G1_MII_PCCARD;
132 + if (board.has_enet0 && !board.enet0.use_internal_phy) {
133 + if (BCMCPU_IS_6348())
134 + val |= GPIO_MODE_6348_G3_EXT_MII |
135 + GPIO_MODE_6348_G0_EXT_MII;
138 + if (board.has_enet1 && !board.enet1.use_internal_phy) {
139 + if (BCMCPU_IS_6348())
140 + val |= GPIO_MODE_6348_G3_EXT_MII |
141 + GPIO_MODE_6348_G0_EXT_MII;
144 + bcm_gpio_writel(val, GPIO_MODE_REG);
148 + * second stage init callback, good time to panic if we couldn't
149 + * identify on which board we're running since early printk is working
151 +void __init board_setup(void)
153 + if (!board.name[0])
154 + panic("unable to detect bcm963xx board");
155 + printk(KERN_INFO PFX "board name: %s\n", board.name);
157 + /* make sure we're running on expected cpu */
158 + if (bcm63xx_get_cpu_id() != board.expected_cpu_id)
159 + panic("unexpected CPU for bcm963xx board");
163 + * return board name for /proc/cpuinfo
165 +const char *board_get_name(void)
171 + * register & return a new board mac address
174 +static int board_get_mac_address(u8 *mac)
176 + u8 default_mac[ETH_ALEN] = {0x00, 0x07, 0x3A, 0x00, 0x00, 0x00};
180 + memcpy(mac, default_mac, ETH_ALEN);
182 + p = mac + ETH_ALEN - 1;
183 + count = mac_addr_used;
191 + } while (p != mac);
195 + printk(KERN_ERR PFX "unable to fetch mac address\n");
203 +static struct resource mtd_resources[] = {
205 + .start = 0, /* filled at runtime */
206 + .end = 0, /* filled at runtime */
207 + .flags = IORESOURCE_MEM,
211 +static struct platform_device mtd_dev = {
212 + .name = "bcm963xx-flash",
213 + .resource = mtd_resources,
214 + .num_resources = ARRAY_SIZE(mtd_resources),
219 + * third stage init callback, register all board devices.
221 +int __init board_register_devices(void)
225 + bcm63xx_uart_register();
226 + bcm63xx_wdt_register();
228 + if (board.has_pccard)
229 + bcm63xx_pcmcia_register();
231 + if (board.has_enet0 &&
232 + !board_get_mac_address(board.enet0.mac_addr))
233 + bcm63xx_enet_register(0, &board.enet0);
235 + if (board.has_enet1 &&
236 + !board_get_mac_address(board.enet1.mac_addr))
237 + bcm63xx_enet_register(1, &board.enet1);
239 + if (board.has_ohci0)
240 + bcm63xx_ohci_register();
242 + if (board.has_ehci0)
243 + bcm63xx_ehci_register();
246 + /* read base address of boot chip select (0) */
247 + val = bcm_mpi_readl(MPI_CSBASE_REG(0));
248 + val &= MPI_CSBASE_BASE_MASK;
249 + mtd_resources[0].start = val;
250 + mtd_resources[0].end = 0x1FFFFFFF;
252 + platform_device_register(&mtd_dev);