add support for generic eb214a, thanks cezary (#7027)
authorFlorian Fainelli <florian@openwrt.org>
Sun, 18 Jul 2010 10:29:58 +0000 (10:29 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sun, 18 Jul 2010 10:29:58 +0000 (10:29 +0000)
SVN-Revision: 22275

17 files changed:
target/linux/adm5120/base-files/lib/adm5120.sh
target/linux/adm5120/files/arch/mips/adm5120/Kconfig
target/linux/adm5120/files/arch/mips/adm5120/common/prom.c
target/linux/adm5120/files/arch/mips/adm5120/generic/Makefile [new file with mode: 0644]
target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c [new file with mode: 0644]
target/linux/adm5120/files/arch/mips/include/asm/mach-adm5120/adm5120_info.h
target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c
target/linux/adm5120/image/router_le.mk
target/linux/adm5120/patches-2.6.32/001-adm5120.patch
target/linux/adm5120/patches-2.6.33/001-adm5120.patch
target/linux/adm5120/patches-2.6.34/001-adm5120.patch
target/linux/adm5120/patches-2.6.35/001-adm5120.patch
target/linux/adm5120/router_le/config-2.6.32
target/linux/adm5120/router_le/config-2.6.33
target/linux/adm5120/router_le/config-2.6.34
target/linux/adm5120/router_le/config-2.6.35
target/linux/adm5120/router_le/profiles/010-Generic.mk

index 06e2aac2dd9e0144e24e9ea4c1109352bda82cda..496fc06f372c18bc70e399f2b232bab345f20af1 100755 (executable)
@@ -41,6 +41,10 @@ adm5120_detect() {
                status_led="power"
                sys_mtd_part="trx"
                ;;
+       "EB-214A"*)
+               status_led="power"
+               sys_mtd_part="firmware"
+               ;;
        *)
                ;;
        esac
index 7f8378db50c16e277542891206a8c33dd7929403..2be9f901af746082824366b6417fdd92a69e5f4a 100644 (file)
@@ -37,6 +37,13 @@ config ADM5120_MACH_WP54
        select ADM5120_OEM_COMPEX
        default y
 
+config ADM5120_MACH_EB_214A
+       bool "EB-214A support"
+       depends on CPU_LITTLE_ENDIAN
+       select ADM5120_SOC_BGA
+       select ADM5120_OEM_GENERIC
+       default y
+
 config ADM5120_MACH_BR_6104K
        bool "Edimax BR-6104K support"
        depends on CPU_LITTLE_ENDIAN
@@ -165,6 +172,9 @@ config ADM5120_OEM_COMPEX
 config ADM5120_OEM_EDIMAX
        def_bool n
 
+config ADM5120_OEM_GENERIC
+       def_bool n
+
 config ADM5120_OEM_INFINEON
        def_bool n
 
index 81ba365a0ee5ae07b582439f1ccb7db57bb182d3..8506366ab181c4b4a0aac04862aa1a3290ac4686 100644 (file)
@@ -68,6 +68,8 @@ static struct board_desc common_boards[] __initdata = {
        DEFBOARD("OSBRiDGE 5GXi",       MACH_ADM5120_5GXI),
        /* Motorola boards */
        DEFBOARD("Powerline MU Gateway",MACH_ADM5120_PMUGW),
+       /* Generic EB-214A */
+       DEFBOARD("ADM5120",     MACH_ADM5120_EB_214A),
 };
 
 static unsigned long __init find_machtype_byname(char *name)
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/generic/Makefile b/target/linux/adm5120/files/arch/mips/adm5120/generic/Makefile
new file mode 100644 (file)
index 0000000..0c032e3
--- /dev/null
@@ -0,0 +1 @@
+obj-$(CONFIG_ADM5120_MACH_EB_214A)     += eb-214a.o
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c b/target/linux/adm5120/files/arch/mips/adm5120/generic/eb-214a.c
new file mode 100644 (file)
index 0000000..4ebe413
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ *  EB-214A board support
+ *
+ *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2010 Cezary Jackiewicz <cezary@eko.one.pl>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ */
+
+#include <asm/addrspace.h>
+#include <asm/byteorder.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/gpio.h>
+#include <linux/irq.h>
+#include <linux/etherdevice.h>
+
+#include <asm/mips_machine.h>
+
+#include <asm/mach-adm5120/adm5120_info.h>
+#include <asm/mach-adm5120/adm5120_platform.h>
+#include <asm/mach-adm5120/adm5120_defs.h>
+
+
+#define EB214A_GPIO_DEV_MASK   0
+#define EB214A_CONFIG_OFFSET   0x4000
+
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition eb214a_partitions[] = {
+       {
+               .name   = "bootloader",
+               .offset = 0,
+               .size   = 32*1024,
+               .mask_flags = MTD_WRITEABLE,
+       } , {
+               .name   = "config",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = 32*1024,
+       } , {
+               .name   = "firmware",
+               .offset = MTDPART_OFS_APPEND,
+               .size   = MTDPART_SIZ_FULL,
+       }
+};
+#endif /* CONFIG_MTD_PARTITIONS */
+
+static struct adm5120_pci_irq eb214a_pci_irqs[] __initdata = {
+       PCIIRQ(4, 0, 1, ADM5120_IRQ_PCI0),
+       PCIIRQ(4, 1, 2, ADM5120_IRQ_PCI0),
+       PCIIRQ(4, 2, 3, ADM5120_IRQ_PCI0),
+};
+
+static struct gpio_led eb214a_gpio_leds[] __initdata = {
+       GPIO_LED_INV(ADM5120_GPIO_PIN7, "power",        NULL),
+       GPIO_LED_INV(ADM5120_GPIO_P0L0, "lan",          NULL),
+       GPIO_LED_INV(ADM5120_GPIO_P4L0, "usb1",         NULL),
+       GPIO_LED_INV(ADM5120_GPIO_P4L1, "usb2",         NULL),
+       GPIO_LED_INV(ADM5120_GPIO_P4L2, "usb3",         NULL),
+       GPIO_LED_INV(ADM5120_GPIO_P3L0, "usb4",         NULL),
+};
+
+static struct gpio_button eb214a_gpio_buttons[] __initdata = {
+       {
+               .desc           = "reset",
+               .type           = EV_KEY,
+               .code           = BTN_0,
+               .threshold      = 5,
+               .gpio           = ADM5120_GPIO_PIN1,
+       }
+};
+
+static u8 eb214a_vlans[6] __initdata = {
+       0x41, 0x42, 0x44, 0x48, 0x50, 0x00
+};
+
+static void __init eb214a_mac_setup(void)
+{
+       u8 mac_base[6];
+       u8 *cfg;
+       int i;
+
+       cfg = (u8 *) KSEG1ADDR(ADM5120_SRAM0_BASE + EB214A_CONFIG_OFFSET);
+       for (i = 0; i < 6; i++)
+               mac_base[i] = cfg[i];
+
+       if (!is_valid_ether_addr(mac_base))
+               random_ether_addr(mac_base);
+
+       adm5120_setup_eth_macs(mac_base);
+}
+
+static void __init eb214a_setup(void)
+{
+#ifdef CONFIG_MTD_PARTITIONS
+       adm5120_flash0_data.nr_parts = ARRAY_SIZE(eb214a_partitions);
+       adm5120_flash0_data.parts = eb214a_partitions;
+#endif /* CONFIG_MTD_PARTITIONS */
+       adm5120_add_device_flash(0);
+
+       adm5120_add_device_gpio(EB214A_GPIO_DEV_MASK);
+
+       adm5120_add_device_uart(0);
+       //adm5120_add_device_uart(1);
+
+       adm5120_add_device_switch(5, eb214a_vlans);
+
+       eb214a_mac_setup();
+
+       adm5120_add_device_gpio_buttons(ARRAY_SIZE(eb214a_gpio_buttons),
+                                       eb214a_gpio_buttons);
+
+       adm5120_add_device_gpio_leds(ARRAY_SIZE(eb214a_gpio_leds),
+                                       eb214a_gpio_leds);
+
+       adm5120_pci_set_irq_map(ARRAY_SIZE(eb214a_pci_irqs),
+                                       eb214a_pci_irqs);
+//     adm5120_add_device_usb();
+}
+
+MIPS_MACHINE(MACH_ADM5120_EB_214A, "EB-214A", "Generic EB-214A", eb214a_setup);
index a72a9927fb91cb4ef186104922a01f2318a2caf3..9e72c1b1a1ff6304a00bfcb3c4dfb44a7e7aedfa 100644 (file)
@@ -84,6 +84,7 @@ enum {
        MACH_ADM5120_WP54,              /* Compex WP54G/WP54AG/WPP54G/WPP54AG */
        MACH_ADM5120_WP54G_WRT,         /* Compex WP54G-WRT */
        MACH_ADM5120_WP54Gv1C,          /* Compex WP54G version 1C */
+       MACH_ADM5120_EB_214A,           /* Generic EB-214A */
 };
 
 /*
index bde3e3208293920e0bbeca57f8e03bea76561d07..0bef8048ff0769bbae5178e46a0adef139f0443b 100644 (file)
@@ -201,7 +201,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
                goto out;
        }
 
-       if (slot < 1 || slot > 3) {
+       if (slot < 1 || slot > 4) {
                printk(KERN_ALERT "PCI: slot number %u is not supported\n",
                        slot);
                goto out;
index 96ad2210620b4c827cd5ec224160554604dc6c10..7c4bf1d81b18b343b3236ee521fcd64d7cf19b66 100644 (file)
@@ -209,6 +209,14 @@ define Image/Build/Template/Infineon/Initramfs
        $(call Image/Build/LZMAKernel/Admboot,$(1),gz)
 endef
 
+#
+# Generic EB-214A
+#
+define Image/Build/Template/Edimax/Initramfs
+       $(call Image/Build/LZMAKernel/Admboot,eb-214a,bin)
+endef
+
+
 #
 # Mikrotik RouterBOARD 1xx
 #
@@ -381,6 +389,7 @@ define Image/Build/Profile/Generic
        $(call Image/Build/Profile/BR6104KP,$(1))
        $(call Image/Build/Profile/BR6104WG,$(1))
        $(call Image/Build/Profile/BR6114WG,$(1))
+       $(call Image/Build/Profile/EB214A,$(1))
        # Infineon
        $(call Image/Build/Profile/EASY83000,$(1))
        $(call Image/Build/Profile/EASY5120RT,$(1))
index c05afcba1c7fce4a89bb5bf3f9d5b060c67135a8..b0a375c5665ac173a40438ad359881632ec2e98a 100644 (file)
@@ -32,7 +32,7 @@
  source "arch/mips/bcm63xx/Kconfig"
 --- a/arch/mips/Makefile
 +++ b/arch/mips/Makefile
-@@ -193,6 +193,22 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
+@@ -193,6 +193,23 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
  load-$(CONFIG_MACH_JAZZ)      += 0xffffffff80080000
  
  #
@@ -43,6 +43,7 @@
 +core-$(CONFIG_ADM5120_OEM_CELLVISION) += arch/mips/adm5120/cellvision/
 +core-$(CONFIG_ADM5120_OEM_COMPEX)     += arch/mips/adm5120/compex/
 +core-$(CONFIG_ADM5120_OEM_EDIMAX)     += arch/mips/adm5120/edimax/
++core-$(CONFIG_ADM5120_OEM_GENERIC)    += arch/mips/adm5120/generic/
 +core-$(CONFIG_ADM5120_OEM_INFINEON)   += arch/mips/adm5120/infineon/
 +core-$(CONFIG_ADM5120_OEM_MIKROTIK)   += arch/mips/adm5120/mikrotik/
 +core-$(CONFIG_ADM5120_OEM_MOTOROLA)   += arch/mips/adm5120/motorola/
index 7dbefced59270b7d53e1061d8df4e62ba86442ed..077656091627d683b8ab49ef23b40347c3c32c7e 100644 (file)
@@ -32,7 +32,7 @@
  source "arch/mips/jazz/Kconfig"
 --- a/arch/mips/Makefile
 +++ b/arch/mips/Makefile
-@@ -205,6 +205,22 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
+@@ -205,6 +205,23 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
  load-$(CONFIG_MACH_JAZZ)      += 0xffffffff80080000
  
  #
@@ -43,6 +43,7 @@
 +core-$(CONFIG_ADM5120_OEM_CELLVISION) += arch/mips/adm5120/cellvision/
 +core-$(CONFIG_ADM5120_OEM_COMPEX)     += arch/mips/adm5120/compex/
 +core-$(CONFIG_ADM5120_OEM_EDIMAX)     += arch/mips/adm5120/edimax/
++core-$(CONFIG_ADM5120_OEM_GENERIC)    += arch/mips/adm5120/generic/
 +core-$(CONFIG_ADM5120_OEM_INFINEON)   += arch/mips/adm5120/infineon/
 +core-$(CONFIG_ADM5120_OEM_MIKROTIK)   += arch/mips/adm5120/mikrotik/
 +core-$(CONFIG_ADM5120_OEM_MOTOROLA)   += arch/mips/adm5120/motorola/
index e165b046851ca97514d362435b9cd71327dc3e78..c6eec1e23f427b4c58585cb2e16acc07c68ccb66 100644 (file)
@@ -32,7 +32,7 @@
  source "arch/mips/jazz/Kconfig"
 --- a/arch/mips/Makefile
 +++ b/arch/mips/Makefile
-@@ -214,6 +214,22 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
+@@ -214,6 +214,23 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
  load-$(CONFIG_MACH_JAZZ)      += 0xffffffff80080000
  
  #
@@ -43,6 +43,7 @@
 +core-$(CONFIG_ADM5120_OEM_CELLVISION) += arch/mips/adm5120/cellvision/
 +core-$(CONFIG_ADM5120_OEM_COMPEX)     += arch/mips/adm5120/compex/
 +core-$(CONFIG_ADM5120_OEM_EDIMAX)     += arch/mips/adm5120/edimax/
++core-$(CONFIG_ADM5120_OEM_GENERIC)    += arch/mips/adm5120/generic/
 +core-$(CONFIG_ADM5120_OEM_INFINEON)   += arch/mips/adm5120/infineon/
 +core-$(CONFIG_ADM5120_OEM_MIKROTIK)   += arch/mips/adm5120/mikrotik/
 +core-$(CONFIG_ADM5120_OEM_MOTOROLA)   += arch/mips/adm5120/motorola/
index e165b046851ca97514d362435b9cd71327dc3e78..c6eec1e23f427b4c58585cb2e16acc07c68ccb66 100644 (file)
@@ -32,7 +32,7 @@
  source "arch/mips/jazz/Kconfig"
 --- a/arch/mips/Makefile
 +++ b/arch/mips/Makefile
-@@ -214,6 +214,22 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
+@@ -214,6 +214,23 @@ cflags-$(CONFIG_MACH_JAZZ)        += -I$(srctre
  load-$(CONFIG_MACH_JAZZ)      += 0xffffffff80080000
  
  #
@@ -43,6 +43,7 @@
 +core-$(CONFIG_ADM5120_OEM_CELLVISION) += arch/mips/adm5120/cellvision/
 +core-$(CONFIG_ADM5120_OEM_COMPEX)     += arch/mips/adm5120/compex/
 +core-$(CONFIG_ADM5120_OEM_EDIMAX)     += arch/mips/adm5120/edimax/
++core-$(CONFIG_ADM5120_OEM_GENERIC)    += arch/mips/adm5120/generic/
 +core-$(CONFIG_ADM5120_OEM_INFINEON)   += arch/mips/adm5120/infineon/
 +core-$(CONFIG_ADM5120_OEM_MIKROTIK)   += arch/mips/adm5120/mikrotik/
 +core-$(CONFIG_ADM5120_OEM_MOTOROLA)   += arch/mips/adm5120/motorola/
index c576af67e6c9de6ba759dd3b7166cb0880b2f83d..ae31d822280c7c8800f9f879a606964f39a29771 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_ADM5120_MACH_EASY5120P_ATA=y
 CONFIG_ADM5120_MACH_EASY5120_RT=y
 CONFIG_ADM5120_MACH_EASY5120_WVOIP=y
 CONFIG_ADM5120_MACH_EASY83000=y
+CONFIG_ADM5120_MACH_EB_214A=y
 CONFIG_ADM5120_MACH_NFS_101=y
 CONFIG_ADM5120_MACH_NP27G=y
 CONFIG_ADM5120_MACH_NP28G=y
@@ -25,6 +26,7 @@ CONFIG_ADM5120_MACH_WP54=y
 CONFIG_ADM5120_OEM_CELLVISION=y
 CONFIG_ADM5120_OEM_COMPEX=y
 CONFIG_ADM5120_OEM_EDIMAX=y
+CONFIG_ADM5120_OEM_GENERIC=y
 CONFIG_ADM5120_OEM_INFINEON=y
 CONFIG_ADM5120_OEM_MIKROTIK=y
 CONFIG_ADM5120_OEM_MOTOROLA=y
index d623beaac8ff4c2e7c055985e8d16c1ee5aa9f53..a3bd00416e931213c27529422420fae65824fc77 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_ADM5120_MACH_EASY5120P_ATA=y
 CONFIG_ADM5120_MACH_EASY5120_RT=y
 CONFIG_ADM5120_MACH_EASY5120_WVOIP=y
 CONFIG_ADM5120_MACH_EASY83000=y
+CONFIG_ADM5120_MACH_EB_214A=y
 CONFIG_ADM5120_MACH_NFS_101=y
 CONFIG_ADM5120_MACH_NP27G=y
 CONFIG_ADM5120_MACH_NP28G=y
@@ -25,6 +26,7 @@ CONFIG_ADM5120_MACH_WP54=y
 CONFIG_ADM5120_OEM_CELLVISION=y
 CONFIG_ADM5120_OEM_COMPEX=y
 CONFIG_ADM5120_OEM_EDIMAX=y
+CONFIG_ADM5120_OEM_GENERIC=y
 CONFIG_ADM5120_OEM_INFINEON=y
 CONFIG_ADM5120_OEM_MIKROTIK=y
 CONFIG_ADM5120_OEM_MOTOROLA=y
index b5e2d429176363f69159714bda197c4a3342601d..06df687bb9ae1b68cca8214725defb57e9e9b416 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_ADM5120_MACH_EASY5120P_ATA=y
 CONFIG_ADM5120_MACH_EASY5120_RT=y
 CONFIG_ADM5120_MACH_EASY5120_WVOIP=y
 CONFIG_ADM5120_MACH_EASY83000=y
+CONFIG_ADM5120_MACH_EB_214A=y
 CONFIG_ADM5120_MACH_NFS_101=y
 CONFIG_ADM5120_MACH_NP27G=y
 CONFIG_ADM5120_MACH_NP28G=y
@@ -25,6 +26,7 @@ CONFIG_ADM5120_MACH_WP54=y
 CONFIG_ADM5120_OEM_CELLVISION=y
 CONFIG_ADM5120_OEM_COMPEX=y
 CONFIG_ADM5120_OEM_EDIMAX=y
+CONFIG_ADM5120_OEM_GENERIC=y
 CONFIG_ADM5120_OEM_INFINEON=y
 CONFIG_ADM5120_OEM_MIKROTIK=y
 CONFIG_ADM5120_OEM_MOTOROLA=y
index a966e0aeec532a558bf1bb12399eee2d5528a882..7d566c034537de7fc00be17c5b3fe5e8e35ae547 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_ADM5120_MACH_EASY5120P_ATA=y
 CONFIG_ADM5120_MACH_EASY5120_RT=y
 CONFIG_ADM5120_MACH_EASY5120_WVOIP=y
 CONFIG_ADM5120_MACH_EASY83000=y
+CONFIG_ADM5120_MACH_EB_214A=y
 CONFIG_ADM5120_MACH_NFS_101=y
 CONFIG_ADM5120_MACH_NP27G=y
 CONFIG_ADM5120_MACH_NP28G=y
@@ -25,6 +26,7 @@ CONFIG_ADM5120_MACH_WP54=y
 CONFIG_ADM5120_OEM_CELLVISION=y
 CONFIG_ADM5120_OEM_COMPEX=y
 CONFIG_ADM5120_OEM_EDIMAX=y
+CONFIG_ADM5120_OEM_GENERIC=y
 CONFIG_ADM5120_OEM_INFINEON=y
 CONFIG_ADM5120_OEM_MIKROTIK=y
 CONFIG_ADM5120_OEM_MOTOROLA=y
index 1d477319da7f4198dc8f5e21e7059dd7980010c0..6c3e5f30eb9ed1e43b2e7e39c6c39356fb983ca4 100644 (file)
@@ -13,5 +13,16 @@ endef
 define Profile/Generic/Description
        Generic package set compatible with most boards.
 endef
+
+define Profile/EB-214A
+       NAME:=Generic EB-214A
+       PACKAGES:=-wpad-mini -admswconfig -kmod-usb-adm5120 -kmod-ledtrig-adm5120-switch -dnsmasq kmod-usb-uhci kmod-usb2
+endef
+
+define Profile/EB-214A/Description
+       Package set optimized for generic EB-214A boards.
+endef
+
 $(eval $(call Profile,Generic))
+$(eval $(call Profile,EB-214A))