summaryrefslogtreecommitdiff
path: root/target/linux/adm5120/files-2.6.26
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-08-09 07:08:40 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-08-09 07:08:40 +0000
commit0be07086760251a53e98254244429d13ae573a16 (patch)
treec632996a6c41bbe284d7197c095c27f800c9636d /target/linux/adm5120/files-2.6.26
parent14a3ac5c63493a7f6dd110f101c0368a50eef669 (diff)
downloadmtk-20170518-0be07086760251a53e98254244429d13ae573a16.zip
mtk-20170518-0be07086760251a53e98254244429d13ae573a16.tar.gz
mtk-20170518-0be07086760251a53e98254244429d13ae573a16.tar.bz2
split support of Cellvision boards
SVN-Revision: 12255
Diffstat (limited to 'target/linux/adm5120/files-2.6.26')
-rw-r--r--target/linux/adm5120/files-2.6.26/arch/mips/adm5120/Kconfig9
-rw-r--r--target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/Makefile5
-rw-r--r--target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cas-771.c36
-rw-r--r--target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.c79
-rw-r--r--target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h26
-rw-r--r--target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/nfs-101.c24
6 files changed, 119 insertions, 60 deletions
diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/Kconfig b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/Kconfig
index cb7739a..1c4a91a 100644
--- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/Kconfig
+++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/Kconfig
@@ -3,7 +3,14 @@ if ADM5120
menu "ADM5120 Board selection"
config ADM5120_MACH_CAS_771
- bool "Cellvision CAS-771 support"
+ bool "Cellvision CAS-771/771W support"
+ depends on CPU_LITTLE_ENDIAN
+ select ADM5120_SOC_BGA
+ select ADM5120_OEM_CELLVISION
+ default y
+
+config ADM5120_MACH_NFS_101
+ bool "Cellvision NFS-101U/101WU support"
depends on CPU_LITTLE_ENDIAN
select ADM5120_SOC_BGA
select ADM5120_OEM_CELLVISION
diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/Makefile b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/Makefile
index 189951e..a949fc9 100644
--- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/Makefile
+++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/Makefile
@@ -1 +1,4 @@
-obj-y += cellvision.o \ No newline at end of file
+obj-y += cellvision.o
+
+obj-$(CONFIG_ADM5120_MACH_CAS_771) += cas-771.o
+obj-$(CONFIG_ADM5120_MACH_NFS_101) += nfs-101.o
diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cas-771.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cas-771.c
new file mode 100644
index 0000000..26995bb
--- /dev/null
+++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cas-771.c
@@ -0,0 +1,36 @@
+/*
+ * Cellvision/SparkLAN CAS-771/771W support
+ *
+ * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * 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 "cellvision.h"
+
+static struct adm5120_pci_irq cas771_pci_irqs[] __initdata = {
+ PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
+ PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI1),
+ PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2)
+};
+
+static struct gpio_led cas771_gpio_leds[] __initdata = {
+ GPIO_LED_STD(ADM5120_GPIO_PIN0, "cam_flash", NULL),
+ /* GPIO PIN3 is the reset */
+ GPIO_LED_STD(ADM5120_GPIO_PIN6, "access", NULL),
+ GPIO_LED_STD(ADM5120_GPIO_P0L1, "status", NULL),
+ GPIO_LED_STD(ADM5120_GPIO_P0L2, "diag", NULL),
+};
+
+static void __init cas771_setup(void)
+{
+ cas7xx_setup();
+ adm5120_add_device_gpio_leds(ARRAY_SIZE(cas771_gpio_leds),
+ cas771_gpio_leds);
+ adm5120_pci_set_irq_map(ARRAY_SIZE(cas771_pci_irqs), cas771_pci_irqs);
+}
+
+ADM5120_BOARD(MACH_ADM5120_CAS771, "Cellvision CAS-771/771W", cas771_setup);
diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.c
index f58a8fe..2b90ce1 100644
--- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.c
+++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.c
@@ -9,16 +9,7 @@
*
*/
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/gpio.h>
-
-#include <asm/bootinfo.h>
-
-#include <asm/mach-adm5120/adm5120_info.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
+#include "cellvision.h"
#define CELLVISION_GPIO_FLASH_A20 ADM5120_GPIO_PIN5
#define CELLVISION_GPIO_DEV_MASK (1 << CELLVISION_GPIO_FLASH_A20)
@@ -71,20 +62,6 @@ static struct mtd_partition cas7xx_partitions[] = {
};
#endif /* CONFIG_MTD_PARTITIONS */
-static struct adm5120_pci_irq cas771_pci_irqs[] __initdata = {
- PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
- PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI1),
- PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2)
-};
-
-static struct gpio_led cas771_gpio_leds[] __initdata = {
- GPIO_LED_STD(ADM5120_GPIO_PIN0, "cam_flash", NULL),
- /* GPIO PIN3 is the reset */
- GPIO_LED_STD(ADM5120_GPIO_PIN6, "access", NULL),
- GPIO_LED_STD(ADM5120_GPIO_P0L1, "status", NULL),
- GPIO_LED_STD(ADM5120_GPIO_P0L2, "diag", NULL),
-};
-
static void switch_bank_gpio5(unsigned bank)
{
switch (bank) {
@@ -97,7 +74,7 @@ static void switch_bank_gpio5(unsigned bank)
}
}
-static void __init cellvision_generic_setup(void)
+static void __init cellvision_flash_setup(void)
{
/* setup flash A20 line */
gpio_request(CELLVISION_GPIO_FLASH_A20, NULL);
@@ -107,59 +84,45 @@ static void __init cellvision_generic_setup(void)
adm5120_add_device_flash(0);
}
-static void __init cas6xx_setup(void)
+void __init cas6xx_flash_setup(void)
{
#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions);
adm5120_flash0_data.parts = cas6xx_partitions;
#endif /* CONFIG_MTD_PARTITIONS */
- cellvision_generic_setup();
- adm5120_add_device_switch(1, NULL);
+ cellvision_flash_setup();
}
-ADM5120_BOARD(MACH_ADM5120_CAS630, "Cellvision CAS-630/630W", cas6xx_setup);
-ADM5120_BOARD(MACH_ADM5120_CAS670, "Cellvision CAS-670/670W", cas6xx_setup);
-
-static void __init cas7xx_setup(void)
+void __init cas7xx_flash_setup(void)
{
#ifdef CONFIG_MTD_PARTITIONS
adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas7xx_partitions);
adm5120_flash0_data.parts = cas7xx_partitions;
#endif /* CONFIG_MTD_PARTITIONS */
- adm5120_add_device_switch(1, NULL);
+ cellvision_flash_setup();
}
-ADM5120_BOARD(MACH_ADM5120_CAS700, "Cellvision CAS-700/700W", cas7xx_setup);
-ADM5120_BOARD(MACH_ADM5120_CAS790, "Cellvision CAS-790", cas7xx_setup);
-ADM5120_BOARD(MACH_ADM5120_CAS861, "Cellvision CAS-861/861W", cas7xx_setup);
-
-static void __init cas771_setup(void)
+#if 0
+void __init cas6xx_setup(void)
{
- cas7xx_setup();
- adm5120_add_device_gpio_leds(ARRAY_SIZE(cas771_gpio_leds),
- cas771_gpio_leds);
- adm5120_pci_set_irq_map(ARRAY_SIZE(cas771_pci_irqs), cas771_pci_irqs);
+ cas6xx_flash_setup();
+ adm5120_add_device_switch(1, NULL);
}
-ADM5120_BOARD(MACH_ADM5120_CAS771, "Cellvision CAS-771/771W", cas771_setup);
-
-static u8 nfs_vlans[6] __initdata = { /* TODO: not tested */
- 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
-};
+ADM5120_BOARD(MACH_ADM5120_CAS630, "Cellvision CAS-630/630W", cas6xx_setup);
+ADM5120_BOARD(MACH_ADM5120_CAS670, "Cellvision CAS-670/670W", cas6xx_setup);
+#endif
-static void __init nfs_setup(void)
+void __init cas7xx_setup(void)
{
-#ifdef CONFIG_MTD_PARTITIONS
- adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions);
- adm5120_flash0_data.parts = cas6xx_partitions;
-#endif /* CONFIG_MTD_PARTITIONS */
-
- cellvision_generic_setup();
- adm5120_add_device_switch(5, nfs_vlans);
-
- /* TODO: add PCI IRQ map */
+ cas7xx_flash_setup();
+ adm5120_add_device_switch(1, NULL);
}
-ADM5120_BOARD(MACH_ADM5120_NFS101U, "Cellvision NFS-101U/101WU", nfs_setup);
+#if 0
+ADM5120_BOARD(MACH_ADM5120_CAS700, "Cellvision CAS-700/700W", cas7xx_setup);
+ADM5120_BOARD(MACH_ADM5120_CAS790, "Cellvision CAS-790", cas7xx_setup);
+ADM5120_BOARD(MACH_ADM5120_CAS861, "Cellvision CAS-861/861W", cas7xx_setup);
+#endif
diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h
new file mode 100644
index 0000000..c7c6a1e
--- /dev/null
+++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h
@@ -0,0 +1,26 @@
+/*
+ * Cellvision/SparkLAN boards
+ *
+ * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * 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 <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/gpio.h>
+
+#include <asm/bootinfo.h>
+
+#include <asm/mach-adm5120/adm5120_info.h>
+#include <asm/mach-adm5120/adm5120_board.h>
+#include <asm/mach-adm5120/adm5120_platform.h>
+#include <asm/mach-adm5120/adm5120_irq.h>
+
+extern void cas6xx_flash_setup(void) __init;
+extern void cas7xx_flash_setup(void) __init;
+extern void cas6xx_setup(void) __init;
+extern void cas7xx_setup(void) __init;
diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/nfs-101.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/nfs-101.c
new file mode 100644
index 0000000..efd4e57
--- /dev/null
+++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/nfs-101.c
@@ -0,0 +1,24 @@
+/*
+ * Cellvision/SparkLAN NFS-101U/WU support
+ *
+ * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * 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 "cellvision.h"
+
+static u8 nfs101_vlans[6] __initdata = { /* TODO: not tested */
+ 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
+};
+
+static void __init nfs101_setup(void)
+{
+ cas6xx_flash_setup();
+ adm5120_add_device_switch(5, nfs101_vlans);
+}
+
+ADM5120_BOARD(MACH_ADM5120_NFS101U, "Cellvision NFS-101U/101WU", nfs101_setup);