aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/target.mk15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/target.mk b/include/target.mk
index f8c2375917..3401f849a5 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -63,8 +63,8 @@ ifndef Profile
define Profile
$(eval $(call Profile/Default))
$(eval $(call Profile/$(1)))
- $(eval $(call shexport,Profile/$(1)/Config))
- $(eval $(call shexport,Profile/$(1)/Description))
+ dumpinfo : $(call shexport,Profile/$(1)/Config)
+ dumpinfo : $(call shexport,Profile/$(1)/Description)
DUMPINFO += \
echo "Target-Profile: $(1)"; \
echo "Target-Profile-Name: $(NAME)"; \
@@ -73,10 +73,10 @@ define Profile
echo "Target-Profile-Kconfig: yes"; \
fi; \
echo "Target-Profile-Config: "; \
- $(SH_FUNC) getvar "$(call shvar,Profile/$(1)/Config)"; \
+ echo "$$$$$$$$$(call shvar,Profile/$(1)/Config)"; \
echo "@@"; \
echo "Target-Profile-Description:"; \
- $(SH_FUNC) getvar "$(call shvar,Profile/$(1)/Description)"; \
+ echo "$$$$$$$$$(call shvar,Profile/$(1)/Description)"; \
echo "@@"; \
echo;
ifeq ($(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(if $(SUBTARGET),$(SUBTARGET)_))$(1)),y)
@@ -104,8 +104,6 @@ else
endif
endif
-$(eval $(call shexport,Target/Description))
-
ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
include $(INCLUDE_DIR)/kernel-version.mk
endif
@@ -259,6 +257,7 @@ endif
define BuildTargets/DumpCurrent
.PHONY: dumpinfo
+ dumpinfo : export DESCRIPTION=$$(Target/Description)
dumpinfo:
@echo 'Target: $(TARGETID)'; \
echo 'Target-Board: $(BOARD)'; \
@@ -273,9 +272,9 @@ define BuildTargets/DumpCurrent
echo 'Linux-Version: $(LINUX_VERSION)'; \
echo 'Linux-Release: $(LINUX_RELEASE)'; \
echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
- $(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; ))
+ $(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; )) \
echo 'Target-Description:'; \
- $(SH_FUNC) getvar $(call shvar,Target/Description); \
+ echo "$$$$DESCRIPTION"; \
echo '@@'; \
echo 'Default-Packages: $(DEFAULT_PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES))'; \
$(DUMPINFO)
n126'>126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
From 7e6b22225e16fbb22dbf7f2113d8c6d65333818c Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jogo@openwrt.org>
Date: Sun, 9 Mar 2014 04:55:52 +0100
Subject: [PATCH 44/44] MIPS: BCM63XX: add inventel Livebox support

---
 arch/mips/bcm63xx/boards/Kconfig         |   6 +
 arch/mips/bcm63xx/boards/Makefile        |   1 +
 arch/mips/bcm63xx/boards/board_common.c  |   2 +-
 arch/mips/bcm63xx/boards/board_common.h  |   6 +
 arch/mips/bcm63xx/boards/board_livebox.c | 193 +++++++++++++++++++++++++++++++
 5 files changed, 207 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/bcm63xx/boards/board_livebox.c

--- a/arch/mips/bcm63xx/boards/Kconfig
+++ b/arch/mips/bcm63xx/boards/Kconfig
@@ -12,4 +12,10 @@ config BOARD_BCM963XX
 	default y
        help
 
+config BOARD_LIVEBOX
+	bool "Inventel Livebox(es) boards"
+	select SSB
+	help
+	  Inventel Livebox boards using the RedBoot bootloader.
+
 endmenu
--- a/arch/mips/bcm63xx/boards/Makefile
+++ b/arch/mips/bcm63xx/boards/Makefile
@@ -1,2 +1,3 @@
 obj-y					+= board_common.o
 obj-$(CONFIG_BOARD_BCM963XX)		+= board_bcm963xx.o
+obj-$(CONFIG_BOARD_LIVEBOX)		+= board_livebox.o
--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -61,7 +61,7 @@ void __init board_prom_init(void)
 	if (fw_arg3 == CFE_EPTSEAL)
 		board_bcm963xx_init();
 	else
-		panic("unsupported bootloader detected");
+		board_livebox_init();
 }
 
 static int (*board_get_mac_address)(u8 mac[ETH_ALEN]);
--- a/arch/mips/bcm63xx/boards/board_common.h
+++ b/arch/mips/bcm63xx/boards/board_common.h
@@ -24,4 +24,10 @@ static inline void board_of_device_prese
 }
 #endif
 
+#if defined(CONFIG_BOARD_LIVEBOX)
+void board_livebox_init(void);
+#else
+static inline void board_livebox_init(void) { }
+#endif
+
 #endif /* __BOARD_COMMON_H */
--- /dev/null
+++ b/arch/mips/bcm63xx/boards/board_livebox.c
@@ -0,0 +1,200 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/input.h>
+#include <asm/addrspace.h>
+#include <bcm63xx_board.h>
+#include <bcm63xx_cpu.h>
+#include <bcm63xx_regs.h>
+#include <bcm63xx_io.h>
+#include <bcm63xx_dev_flash.h>
+#include <board_bcm963xx.h>
+
+#include "board_common.h"
+
+#define PFX	"board_livebox: "
+
+#define LIVEBOX_KEYS_POLL_INTERVAL	20
+#define LIVEBOX_KEYS_DEBOUNCE_INTERVAL	(LIVEBOX_KEYS_POLL_INTERVAL * 3)
+
+static unsigned int mac_addr_used = 0;
+
+/*
+ * known 6348 boards
+ */
+#ifdef CONFIG_BCM63XX_CPU_6348
+static struct board_info __initdata board_livebox_blue5g = {
+	.name				= "Livebox-blue-5g",
+	.expected_cpu_id		= 0x6348,
+
+	.has_uart0			= 1,
+	.has_enet0			= 1,
+	.has_enet1			= 1,
+	.has_pci			= 1,
+
+	.enet0 = {
+		.has_phy		= 1,
+		.use_internal_phy	= 1,
+	},
+
+	.enet1 = {
+		  .has_phy		= 1,
+		  .phy_id 		= 31,
+	},
+
+	.ephy_reset_gpio		= 6,
+	.ephy_reset_gpio_flags		= GPIOF_INIT_HIGH,
+
+	.has_ohci0			= 1,
+	.has_pccard			= 1,
+
+	.has_dsp			= 0, /*TODO some Liveboxes have dsp*/
+	.dsp = {
+		.gpio_rst		= 6,
+		.gpio_int		= 35,
+		.cs			= 2,
+		.ext_irq		= 2,
+	},
+
+	.leds = {
+		{
+			.name		= "Livebox-blue-5g:red:adsl-fail",
+			.gpio		= 0,
+			.active_low	= 0,
+			.default_trigger = "default-on",
+		},
+		{
+			.name		= "Livebox-blue-5g:red:adsl",
+			.gpio		= 1,
+		},
+		{
+			.name		= "Livebox-blue-5g:red:traffic",
+			.gpio		= 2,
+		},
+		{
+			.name		= "Livebox-blue-5g:red:phone",
+			.gpio		= 3,
+		},
+		{
+			.name		= "Livebox-blue-5g:red:wifi",
+			.gpio		= 4,
+		},
+	},
+
+	.buttons = {
+		{
+			.desc		= "BTN_1",
+			.gpio		= 36,
+			.active_low	= 1,
+			.type		= EV_KEY,
+			.code		= BTN_1,
+			.debounce_interval = LIVEBOX_KEYS_DEBOUNCE_INTERVAL,
+		},
+		{
+			.desc		= "BTN_2",
+			.gpio		= 7,
+			.active_low	= 1,
+			.type		= EV_KEY,
+			.code		= BTN_2,
+			.debounce_interval = LIVEBOX_KEYS_DEBOUNCE_INTERVAL,
+		},
+
+	},
+
+	.ephy_reset_gpio		= 6,
+	.ephy_reset_gpio_flags		= GPIOF_INIT_HIGH,
+};
+#endif
+
+/*
+ * all boards
+ */
+static const struct board_info __initdata *bcm963xx_boards[] = {
+#ifdef CONFIG_BCM63XX_CPU_6348
+	&board_livebox_blue5g
+#endif
+};
+
+/*
+ * register & return a new board mac address
+ */
+static int livebox_get_mac_address(u8 *mac)
+{
+	u8 *p;
+	int count;
+
+	memcpy(mac, (u8 *)0xBEBFF377, ETH_ALEN);
+
+	p = mac + ETH_ALEN - 1;
+	count = mac_addr_used;
+
+	while (count--) {
+		do {
+			(*p)++;
+			if (*p != 0)
+				break;
+			p--;
+		} while (p != mac);
+	}
+
+	if (p == mac) {
+		printk(KERN_ERR PFX "unable to fetch mac address\n");
+		return -ENODEV;
+	}
+        mac_addr_used++;
+
+	return 0;
+}
+
+/*
+ * early init callback
+ */
+#define LIVEBOX_GPIO_DETECT_MASK	0x000000ff
+#define LIVEBOX_BOOT_ADDR		0x1e400000
+
+#define LIVEBOX_HW_BLUE5G_9		0x90
+
+void __init board_livebox_init(void)
+{
+	u32 val;
+	u8 hw_version;
+	const struct board_info *board;
+
+	/* Get hardware version */
+	val = bcm_gpio_readl(GPIO_CTL_LO_REG);
+	val &= ~LIVEBOX_GPIO_DETECT_MASK;
+	bcm_gpio_writel(val, GPIO_CTL_LO_REG);
+
+	hw_version = bcm_gpio_readl(GPIO_DATA_LO_REG) & LIVEBOX_GPIO_DETECT_MASK;
+	switch (hw_version) {
+	case LIVEBOX_HW_BLUE5G_9:
+		printk(KERN_INFO PFX "Livebox BLUE5G.9\n");
+		board = bcm963xx_boards[0];
+		break;
+	default:
+		printk(KERN_INFO PFX "Unknown livebox version: %02x\n", hw_version);
+		/* use default livebox configuration */
+		board = bcm963xx_boards[0];
+		break;
+	}
+
+	/* use default livebox configuration */
+	board_early_setup(board, livebox_get_mac_address);
+
+	/* read base address of boot chip select (0) */
+	val = bcm_mpi_readl(MPI_CSBASE_REG(0));
+	val &= MPI_CSBASE_BASE_MASK;
+	if (val != LIVEBOX_BOOT_ADDR) {
+		printk(KERN_NOTICE PFX "flash address is: 0x%08x, forcing to: 0x%08x\n",
+			val, LIVEBOX_BOOT_ADDR);
+		bcm63xx_flash_force_phys_base_address(LIVEBOX_BOOT_ADDR, 0x1ebfffff);
+	}
+}