From 36a1feebdd02075b332088cb50045f65f695d630 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Thu, 18 Oct 2007 07:40:01 +0000 Subject: [PATCH] add ids for Edimax BR-6104Wg boards SVN-Revision: 9342 --- .../files/arch/mips/adm5120/boards/edimax.c | 38 +++++++++++++++---- .../adm5120/files/arch/mips/adm5120/prom.c | 1 + .../adm5120/image/lzma-loader/src/config.h | 5 +++ target/linux/adm5120/image/router_le.mk | 16 ++++++++ .../adm5120/patches-2.6.23/001-adm5120.patch | 5 ++- tools/firmware-utils/src/csysimg.h | 11 +++--- tools/firmware-utils/src/mkcsysimg.c | 1 + 7 files changed, 62 insertions(+), 15 deletions(-) diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c index 6b7e7e696a..e53e836137 100644 --- a/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c +++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c @@ -30,9 +30,14 @@ #include #include +#include #include -static struct mtd_partition br6104k_partitions[] = { +static struct adm5120_pci_irq br61xx_pci_irqs[] __initdata = { + PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0), +}; + +static struct mtd_partition br61xx_partitions[] = { { .name = "admboot", .offset = 0, @@ -54,31 +59,48 @@ static struct platform_device *br6104k_devices[] __initdata = { &adm5120_hcd_device, }; -static void __init br6104k_setup(void) { +static struct platform_device *br61x4wg_devices[] __initdata = { + &adm5120_flash0_device, +}; + +static void __init br61xx_setup(void) { /* setup data for flash0 device */ - adm5120_flash0_data.nr_parts = ARRAY_SIZE(br6104k_partitions); - adm5120_flash0_data.parts = br6104k_partitions; + adm5120_flash0_data.nr_parts = ARRAY_SIZE(br61xx_partitions); + adm5120_flash0_data.parts = br61xx_partitions; /* TODO: setup mac addresses, if possible */ } -unsigned char br6104k_vlans[6] = { +unsigned char br61xx_vlans[6] = { 0x41, 0x42, 0x44, 0x48, 0x50, 0x00 }; static struct adm5120_board br6104k_board __initdata = { .mach_type = MACH_ADM5120_BR6104K, - .name = "Edimax BR-6104K", - .board_setup = br6104k_setup, + .name = "Edimax BR-6104K/6104KP", + .board_setup = br61xx_setup, .eth_num_ports = 5, - .eth_vlans = br6104k_vlans, + .eth_vlans = br61xx_vlans, .num_devices = ARRAY_SIZE(br6104k_devices), .devices = br6104k_devices, }; +static struct adm5120_board br61x4wg_board __initdata = { + .mach_type = MACH_ADM5120_BR61x4WG, + .name = "Edimax BR-6104WG/6114WG", + .board_setup = br61xx_setup, + .eth_num_ports = 5, + .eth_vlans = br61xx_vlans, + .num_devices = ARRAY_SIZE(br61x4wg_devices), + .devices = br61x4wg_devices, + .pci_nr_irqs = ARRAY_SIZE(br61xx_pci_irqs), + .pci_irq_map = br61xx_pci_irqs, +}; + static int __init register_boards(void) { adm5120_board_register(&br6104k_board); + adm5120_board_register(&br61x4wg_board); return 0; } diff --git a/target/linux/adm5120/files/arch/mips/adm5120/prom.c b/target/linux/adm5120/files/arch/mips/adm5120/prom.c index 2f6fb918c0..786668b8d0 100644 --- a/target/linux/adm5120/files/arch/mips/adm5120/prom.c +++ b/target/linux/adm5120/files/arch/mips/adm5120/prom.c @@ -62,6 +62,7 @@ static struct board_desc common_boards[] __initdata = { /* Edimax boards */ DEFBOARD("BR-6104K", MACH_ADM5120_BR6104K), DEFBOARD("BR-6104KP", MACH_ADM5120_BR6104K), + DEFBOARD("BR-6104WG", MACH_ADM5120_BR61x4WG), /* Infineon boards */ DEFBOARD("EASY 5120P-ATA", MACH_ADM5120_EASY5120PATA), DEFBOARD("EASY 5120-RT", MACH_ADM5120_EASY5120RT), diff --git a/target/linux/adm5120/image/lzma-loader/src/config.h b/target/linux/adm5120/image/lzma-loader/src/config.h index 310189c6d6..74ae9afa20 100644 --- a/target/linux/adm5120/image/lzma-loader/src/config.h +++ b/target/linux/adm5120/image/lzma-loader/src/config.h @@ -69,6 +69,11 @@ # define CONFIG_FLASH_SIZE FLASH_2M #endif +#if defined(CONFIG_BOARD_BR6104WG) +# define CONFIG_BOARD_NAME "BR-6104WG" +# define CONFIG_FLASH_SIZE FLASH_2M +#endif + /* * Infineon boards */ diff --git a/target/linux/adm5120/image/router_le.mk b/target/linux/adm5120/image/router_le.mk index f910971599..ec7673f6e3 100644 --- a/target/linux/adm5120/image/router_le.mk +++ b/target/linux/adm5120/image/router_le.mk @@ -203,6 +203,21 @@ define Image/Build/Board/BR6104K/Initramfs $(call Image/Build/LZMAKernel/Admboot,br-6104k,gz) endef +# +# Edimax BR-6104WG +# +define Image/Build/Board/BR6104WG + $(call Image/Build/Edimax,$(1),br-6104wg) +endef + +define Image/Build/Board/BR6104WG/squashfs + $(call Image/Build/Board/BR6104WG,squashfs) +endef + +define Image/Build/Board/BR6104WG/Initramfs + $(call Image/Build/LZMAKernel/Admboot,br-6104wg,gz) +endef + # # Infineon EASY 83000 # @@ -254,6 +269,7 @@ endef define Image/Build/Group/Edimax $(call Image/Build/Board/BR6104K/$(1)) + $(call Image/Build/Board/BR6104WG/$(1)) endef define Image/Build/Group/Infineon diff --git a/target/linux/adm5120/patches-2.6.23/001-adm5120.patch b/target/linux/adm5120/patches-2.6.23/001-adm5120.patch index b197b3f657..c8586eb91b 100644 --- a/target/linux/adm5120/patches-2.6.23/001-adm5120.patch +++ b/target/linux/adm5120/patches-2.6.23/001-adm5120.patch @@ -54,7 +54,7 @@ Index: linux-2.6.23/include/asm-mips/bootinfo.h =================================================================== --- linux-2.6.23.orig/include/asm-mips/bootinfo.h +++ linux-2.6.23/include/asm-mips/bootinfo.h -@@ -208,6 +208,58 @@ +@@ -208,6 +208,59 @@ #define MACH_GROUP_WINDRIVER 28 /* Windriver boards */ #define MACH_WRPPMC 1 @@ -107,8 +107,9 @@ Index: linux-2.6.23/include/asm-mips/bootinfo.h +#define MACH_ADM5120_EASY5120RT 43 /* Infineon EASY 5120-RT */ +#define MACH_ADM5120_EASY5120WVOIP 44 /* Infineon EASY 5120-WVoIP */ +#define MACH_ADM5120_EASY83000 45 /* Infineon EASY-83000 */ -+#define MACH_ADM5120_BR6104K 46 /* Edimax BR-6104K */ ++#define MACH_ADM5120_BR6104K 46 /* Edimax BR-6104K/BR-6104KP */ +#define MACH_ADM5120_RB_192 47 /* Mikrotik RouterBOARD 192 */ ++#define MACH_ADM5120_BR61x4WG 48 /* Edimax BR-6104Wg/BR-6114WG */ + #define CL_SIZE COMMAND_LINE_SIZE diff --git a/tools/firmware-utils/src/csysimg.h b/tools/firmware-utils/src/csysimg.h index 807c867132..740a7b8910 100644 --- a/tools/firmware-utils/src/csysimg.h +++ b/tools/firmware-utils/src/csysimg.h @@ -3,7 +3,7 @@ * * Copyright (C) 2007 Gabor Juhos * - * This program was based on the code found in various Linux + * This program was based on the code found in various Linux * source tarballs released by Edimax for it's devices. * Original author: David Hsu * @@ -33,18 +33,19 @@ #define ADM_BOOT_SIG "\x00\x60\x1A\x40" -/* +/* * Generic signatures */ #define SIG_CSYS "CSYS" #define SIG_CONF "HS\x00\x00" #define SIG_BOOT_RTL "\x00\x00\x40\x21" -/* +/* * Web page signatures */ #define SIG_BR6104K "WB4K" #define SIG_BR6104KP "WBKP" +#define SIG_BR6104Wg "WBGW" #define SIG_BR6104IPC "WBIP" #define SIG_BR6114WG SIG_BR6104IPC #define SIG_BR6524K "2-K-" @@ -66,8 +67,8 @@ #define SIG_XRT401D SIG_BR6104K #define SIG_XRT402D SIG_BR6524K -/* - * CSYS image file header +/* + * CSYS image file header */ struct csys_header { unsigned char sig[SIG_LEN]; diff --git a/tools/firmware-utils/src/mkcsysimg.c b/tools/firmware-utils/src/mkcsysimg.c index a1f9b742d8..7df27c48eb 100644 --- a/tools/firmware-utils/src/mkcsysimg.c +++ b/tools/firmware-utils/src/mkcsysimg.c @@ -152,6 +152,7 @@ static struct board_info boards[] = { /* The original Edimax products */ BOARD_ADM("BR-6104K", "Edimax BR-6104K", 2, SIG_BR6104K), BOARD_ADM("BR-6104KP", "Edimax BR-6104KP", 2, SIG_BR6104KP), + BOARD_ADM("BR-6104Wg", "Edimax BR-6104Wg", 2, SIG_BR6104Wg), BOARD_ADM("BR-6114WG", "Edimax BR-6114WG", 2, SIG_BR6114WG), BOARD_ADM("BR-6524K", "Edimax BR-6524K", 2, SIG_BR6524K), BOARD_ADM("BR-6524KP", "Edimax BR-6524KP", 2, SIG_BR6524KP), -- 2.30.2