adm8668: add support for 3.3
authorGabor Juhos <juhosg@openwrt.org>
Wed, 25 Apr 2012 18:53:49 +0000 (18:53 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Wed, 25 Apr 2012 18:53:49 +0000 (18:53 +0000)
SVN-Revision: 31480

target/linux/adm8668/config-3.3 [new file with mode: 0644]
target/linux/adm8668/patches-3.3/001-adm8668_arch.patch [new file with mode: 0644]
target/linux/adm8668/patches-3.3/002-adm8668_uart.patch [new file with mode: 0644]
target/linux/adm8668/patches-3.3/003-adm8668_nor_map.patch [new file with mode: 0644]
target/linux/adm8668/patches-3.3/a01-adm8668-irq-code-fixes.patch [new file with mode: 0644]
target/linux/adm8668/patches-3.3/a02-adm8668-network-driver-fixes.patch [new file with mode: 0644]
target/linux/adm8668/patches-3.3/a03-adm8668-flash-map-fix.patch [new file with mode: 0644]

diff --git a/target/linux/adm8668/config-3.3 b/target/linux/adm8668/config-3.3
new file mode 100644 (file)
index 0000000..c4c9664
--- /dev/null
@@ -0,0 +1,86 @@
+CONFIG_ADM8668=y
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_BCMA_POSSIBLE=y
+CONFIG_CEVT_R4K=y
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CSRC_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_EEPROM_93CX6=m
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+# CONFIG_GENERIC_CPU_DEVICES is not set
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_WORK=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HW_HAS_PCI=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_FORCED_THREADING=y
+# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set
+CONFIG_MIPS=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+# CONFIG_MIPS_MACHINE is not set
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MLX4_CORE is not set
+CONFIG_MTD_ADM8668_NOR=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NO_EXCEPT_FILL=y
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PERF_USE_VMALLOC=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_SCSI_DMA is not set
+CONFIG_SERIAL_ADM8668=y
+CONFIG_SERIAL_ADM8668_CONSOLE=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_XZ_DEC=y
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/adm8668/patches-3.3/001-adm8668_arch.patch b/target/linux/adm8668/patches-3.3/001-adm8668_arch.patch
new file mode 100644 (file)
index 0000000..c00188c
--- /dev/null
@@ -0,0 +1,39 @@
+--- a/arch/mips/Kbuild.platforms
++++ b/arch/mips/Kbuild.platforms
+@@ -30,6 +30,7 @@ platforms += sni
+ platforms += txx9
+ platforms += vr41xx
+ platforms += wrppmc
++platforms += adm8668
+ # include the platform specific files
+ include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -105,6 +105,26 @@ config BCM47XX
+       help
+        Support for BCM47XX based boards
++config ADM8668
++      bool "WildPass ADM8668"
++      select SYS_HAS_CPU_MIPS32_R1
++      select BOOT_RAW
++      select NO_EXCEPT_FILL
++      select IRQ_CPU
++      select CEVT_R4K
++      select CSRC_R4K
++      select HW_HAS_PCI
++      select PCI
++      select SYS_SUPPORTS_LITTLE_ENDIAN
++      select SYS_SUPPORTS_32BIT_KERNEL
++      select DMA_NONCOHERENT
++      select SWAP_IO_SPACE
++      select SERIAL_ADM8668
++      select SERIAL_ADM8668_CONSOLE
++      help
++              ADM8668 board support by neutronscott
++              Scott Nicholas <neutronscott@scottn.us>
++
+ config BCM63XX
+       bool "Broadcom BCM63XX based boards"
+       select CEVT_R4K
diff --git a/target/linux/adm8668/patches-3.3/002-adm8668_uart.patch b/target/linux/adm8668/patches-3.3/002-adm8668_uart.patch
new file mode 100644 (file)
index 0000000..ed55cbb
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/drivers/tty/serial/Kconfig
++++ b/drivers/tty/serial/Kconfig
+@@ -1192,6 +1192,25 @@ config SERIAL_BCM63XX_CONSOLE
+         If you have enabled the serial port on the bcm63xx CPU
+         you can make it the console by answering Y to this option.
++config SERIAL_ADM8668
++      tristate "ADM8668 serial port support"
++      select SERIAL_CORE
++      depends on ADM8668
++      help
++        If you have an adm8668 CPU, you can enable its onboard
++        serial port by enabling this options.
++
++          To compile this driver as a module, choose M here: the
++          module will be called adm8668_uart.
++
++config SERIAL_ADM8668_CONSOLE
++      bool "Console on adm8668 serial port"
++      depends on SERIAL_ADM8668=y
++      select SERIAL_CORE_CONSOLE
++      help
++        If you have enabled the serial port on the adm8668 CPU
++        you can make it the console by answering Y to this option.
++
+ config SERIAL_GRLIB_GAISLER_APBUART
+       tristate "GRLIB APBUART serial support"
+       depends on OF && SPARC
+--- a/include/linux/serial_core.h
++++ b/include/linux/serial_core.h
+@@ -211,6 +211,9 @@
+ #define PORT_AR933X   99
++/* ADM8668 UART */
++#define       PORT_ADM8668    100
++
+ #ifdef __KERNEL__
+ #include <linux/compiler.h>
diff --git a/target/linux/adm8668/patches-3.3/003-adm8668_nor_map.patch b/target/linux/adm8668/patches-3.3/003-adm8668_nor_map.patch
new file mode 100644 (file)
index 0000000..eca9bc4
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/drivers/mtd/maps/Kconfig
++++ b/drivers/mtd/maps/Kconfig
+@@ -96,6 +96,12 @@ config MSP_FLASH_MAP_LIMIT
+       default "0x02000000"
+       depends on MSP_FLASH_MAP_LIMIT_32M
++config MTD_ADM8668_NOR
++      tristate "ADM8668 NOR mapping"
++      depends on ADM8668 && MTD_CFI
++      help
++        mapping driver for ADM8668 NOR
++
+ config MTD_SUN_UFLASH
+       tristate "Sun Microsystems userflash support"
+       depends on SPARC && MTD_CFI && PCI
+--- a/drivers/mtd/maps/Makefile
++++ b/drivers/mtd/maps/Makefile
+@@ -7,6 +7,7 @@ obj-$(CONFIG_MTD)              += map_funcs.o
+ endif
+ # Chip mappings
++obj-$(CONFIG_MTD_ADM8668_NOR) += adm8668.o
+ obj-$(CONFIG_MTD_CDB89712)    += cdb89712.o
+ obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o
+ obj-$(CONFIG_MTD_DC21285)     += dc21285.o
diff --git a/target/linux/adm8668/patches-3.3/a01-adm8668-irq-code-fixes.patch b/target/linux/adm8668/patches-3.3/a01-adm8668-irq-code-fixes.patch
new file mode 100644 (file)
index 0000000..79f5596
--- /dev/null
@@ -0,0 +1,129 @@
+--- a/arch/mips/adm8668/irq.c
++++ b/arch/mips/adm8668/irq.c
+@@ -20,28 +20,7 @@
+ #include <asm/irq.h>
+ #include <adm8668.h>
+-
+-void enable_adm8668_irq(unsigned int irq);
+-void disable_adm8668_irq(unsigned int irq);
+-void adm8668_irq_cascade(void);
+-
+-void plat_irq_dispatch(void)
+-{
+-      unsigned int pending;
+-
+-      pending = read_c0_cause() & read_c0_status() & ST0_IM;
+-
+-      /* timer interrupt, that we renumbered */
+-      if (pending & STATUSF_IP7)
+-              do_IRQ(MIPS_CPU_IRQ_BASE + 7);
+-      if (pending & STATUSF_IP2)
+-              adm8668_irq_cascade();
+-}
+-
+-/*
+- * System irq dispatch
+- */
+-void adm8668_irq_cascade()
++static void adm8668_irq_cascade(void)
+ {
+       int i;
+       unsigned long intsrc;
+@@ -53,49 +32,53 @@ void adm8668_irq_cascade()
+ }
+ /*
+- * irq enable
++ * System irq dispatch
+  */
+-static __inline void _irq_enable(int irql)
++void plat_irq_dispatch(void)
+ {
+-      ADM8668_INTC_REG(IRQ_ENABLE_REG) = (1 << irql);
+-}
++      unsigned int pending;
++      pending = read_c0_cause() & read_c0_status() & ST0_IM;
+-/*
+- * irq disable
+- */
+-static __inline void _irq_disable(int irql)
+-{
+-      ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irql);
++      /* timer interrupt, that we renumbered */
++      if (pending & STATUSF_IP7)
++              do_IRQ(MIPS_CPU_IRQ_BASE + 7);
++      if (pending & STATUSF_IP2)
++              adm8668_irq_cascade();
+ }
+-
+ /*
+  * enable 8668 irq
+  */
+-void enable_adm8668_irq(unsigned int irq)
++static void enable_adm8668_irq(struct irq_data *d)
+ {
++      int irq = d->irq;
++
+       if ((irq < 0) || (irq > NR_IRQS))
+               return;
+-      _irq_enable(irq);
++      ADM8668_INTC_REG(IRQ_ENABLE_REG) = (1 << irq);
+ }
+ /*
+  * disable 8668 irq
+  */
+-void disable_adm8668_irq(unsigned int irq)
++static void disable_adm8668_irq(struct irq_data *d)
+ {
++      int irq = d->irq;
++
+       if ((irq < 0) || (irq > NR_IRQS))
+               return;
+-      _irq_disable(irq);
++      ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irq);
+ }
+-static inline void ack_adm8668_irq(unsigned int irq_nr)
++static void ack_adm8668_irq(struct irq_data *d)
+ {
+-      ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irq_nr);
++      int irq = d->irq;
++
++      ADM8668_INTC_REG(IRQ_DISABLE_REG) = (1 << irq);
+ }
+ /*
+@@ -104,20 +87,20 @@ static inline void ack_adm8668_irq(unsig
+ static struct irq_chip adm8668_irq_type = {
+       .name = "adm8668",
+-      .ack = ack_adm8668_irq,
+-      .mask = disable_adm8668_irq,
+-      .unmask = enable_adm8668_irq
++      .irq_ack = ack_adm8668_irq,
++      .irq_mask = disable_adm8668_irq,
++      .irq_unmask = enable_adm8668_irq
+ };
+ /*
+  * irq init
+  */
+-void __init init_adm8668_irqs(void)
++static void __init init_adm8668_irqs(void)
+ {
+       int i;
+       for (i = 0; i <= INT_LVL_MAX; i++)
+-              set_irq_chip_and_handler(i, &adm8668_irq_type,
++              irq_set_chip_and_handler(i, &adm8668_irq_type,
+                       handle_level_irq);
+       /* hw0 is where our interrupts are uh.. interrupted at. */
diff --git a/target/linux/adm8668/patches-3.3/a02-adm8668-network-driver-fixes.patch b/target/linux/adm8668/patches-3.3/a02-adm8668-network-driver-fixes.patch
new file mode 100644 (file)
index 0000000..4768b37
--- /dev/null
@@ -0,0 +1,51 @@
+--- a/arch/mips/adm8668/net_core.c
++++ b/arch/mips/adm8668/net_core.c
+@@ -133,7 +133,7 @@ tulip_open(struct net_device *dev)
+       tulip_init_ring (dev);
+-      retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev);
++      retval = request_irq(dev->irq, tulip_interrupt, 0, dev->name, dev);
+       if (retval)
+               goto free_ring;
+@@ -469,7 +469,7 @@ static const struct net_device_ops tulip
+       .ndo_tx_timeout         = tulip_tx_timeout,
+       .ndo_stop               = tulip_close,
+       .ndo_get_stats          = tulip_get_stats,
+-      .ndo_set_multicast_list = set_rx_mode,
++      .ndo_set_rx_mode        = set_rx_mode,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+@@ -509,6 +509,7 @@ static int __devinit adm8668net_probe(st
+       tp->dev = dev;
+       tp->base_addr = ioaddr;
+       tp->csr0 = csr0;
++      tp->pdev = pdev;
+       tp->rx_ring = dma_alloc_coherent(&pdev->dev,
+                               sizeof(struct tulip_rx_desc) * RX_RING_SIZE +
+                               sizeof(struct tulip_tx_desc) * TX_RING_SIZE,
+--- a/arch/mips/adm8668/net.h
++++ b/arch/mips/adm8668/net.h
+@@ -12,6 +12,7 @@
+ #define __NET_TULIP_H__
+ #include <linux/module.h>
++#include <linux/export.h>
+ #include <linux/slab.h>
+ #include <linux/init.h>
+ #include <linux/mii.h>
+@@ -25,10 +26,10 @@
+ #include <linux/delay.h>
+ #include <linux/etherdevice.h>
+ #include <linux/platform_device.h>
++#include <linux/io.h>
++#include <linux/interrupt.h>
+ #include <asm/unaligned.h>
+ #include <asm/uaccess.h>
+-#include <asm/io.h>
+-#include <asm/irq.h>
+ /* undefine, or define to various debugging levels (>4 == obscene levels) */
+ #define TULIP_DEBUG 1
diff --git a/target/linux/adm8668/patches-3.3/a03-adm8668-flash-map-fix.patch b/target/linux/adm8668/patches-3.3/a03-adm8668-flash-map-fix.patch
new file mode 100644 (file)
index 0000000..6d820c9
--- /dev/null
@@ -0,0 +1,81 @@
+--- a/drivers/mtd/maps/adm8668.c
++++ b/drivers/mtd/maps/adm8668.c
+@@ -47,9 +47,7 @@
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/map.h>
+ #include <linux/slab.h>
+-#ifdef CONFIG_MTD_PARTITIONS
+ #include <linux/mtd/partitions.h>
+-#endif
+ #include <linux/crc32.h>
+ #include <linux/magic.h>
+ #include <asm/io.h>
+@@ -94,8 +92,6 @@ struct map_info adm8668_map = {
+       bankwidth: BANKWIDTH,
+ };
+-#ifdef CONFIG_MTD_PARTITIONS
+-
+ /*
+  * Copied from mtdblock.c
+  *
+@@ -238,7 +234,12 @@ init_mtd_partitions(struct mtd_info *mtd
+               return NR_PARTS;
+       if (be32_to_cpu(uhdr.ih_size) != (linux_len - sizeof(uhdr))) {
+-              unsigned char *block, *data = (unsigned char *)(WINDOW_ADDR | (adm8668_parts[PART_LINUX].offset + sizeof(struct uboot_header)) | 0xA0000000);
++              unsigned char *block, *data;
++              unsigned int offset;
++
++              offset = adm8668_parts[PART_LINUX].offset +
++                       sizeof(struct uboot_header);
++              data = (unsigned char *)(WINDOW_ADDR | 0xA0000000 | offset);
+               printk(KERN_NOTICE "Updating U-boot image:\n");
+               printk(KERN_NOTICE "  old: [size: %8d crc32: 0x%08x]\n",
+@@ -279,16 +280,11 @@ init_mtd_partitions(struct mtd_info *mtd
+       return NR_PARTS;
+ }
+-#endif
+-
+-
+ int __init init_adm8668_map(void)
+ {
+-#ifdef CONFIG_MTD_PARTITIONS
+       int nr_parts, ret;
+-#endif
+-      adm8668_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
++      adm8668_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
+       if (!adm8668_map.virt) {
+               printk(KERN_ERR "Failed to ioremap\n");
+@@ -304,14 +300,12 @@ int __init init_adm8668_map(void)
+       adm8668_mtd->owner = THIS_MODULE;
+-#ifdef CONFIG_MTD_PARTITIONS
+       nr_parts = init_mtd_partitions(adm8668_mtd, adm8668_mtd->size);
+-      ret = add_mtd_partitions(adm8668_mtd, adm8668_parts, nr_parts);
++      ret = mtd_device_register(adm8668_mtd, adm8668_parts, nr_parts);
+       if (ret) {
+-              printk(KERN_ERR "Flash: add_mtd_partitions failed\n");
++              printk(KERN_ERR "Flash: mtd_device_register failed\n");
+               goto fail;
+       }
+-#endif
+       return 0;
+@@ -326,9 +320,7 @@ int __init init_adm8668_map(void)
+ void __exit cleanup_adm8668_map(void)
+ {
+-#ifdef CONFIG_MTD_PARTITIONS
+-      del_mtd_partitions(adm8668_mtd);
+-#endif
++      mtd_device_unregister(adm8668_mtd);
+       map_destroy(adm8668_mtd);
+       iounmap((void *) adm8668_map.virt);
+       adm8668_map.virt = 0;