mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-24 00:30:16 +02:00
[lantiq] Add missing 3.3 patches
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31671 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
dcc5e22d87
commit
d0ba13b35e
13633
target/linux/lantiq/patches-3.3/100-falcon_bsp_header.patch
Normal file
13633
target/linux/lantiq/patches-3.3/100-falcon_bsp_header.patch
Normal file
File diff suppressed because it is too large
Load Diff
63
target/linux/lantiq/patches-3.3/101-sdk-compat.patch
Normal file
63
target/linux/lantiq/patches-3.3/101-sdk-compat.patch
Normal file
@ -0,0 +1,63 @@
|
||||
--- /dev/null
|
||||
+++ b/arch/mips/include/asm/mach-lantiq/falcon/sysctrl.h
|
||||
@@ -0,0 +1,60 @@
|
||||
+/*
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of
|
||||
+ * the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
+ * MA 02111-1307 USA
|
||||
+ *
|
||||
+ * Copyright (C) 2010 Thomas Langer, Lantiq Deutschland
|
||||
+ */
|
||||
+
|
||||
+#ifndef __FALCON_SYSCTRL_H
|
||||
+#define __FALCON_SYSCTRL_H
|
||||
+
|
||||
+#include <falcon/lantiq_soc.h>
|
||||
+
|
||||
+static inline void sys1_hw_activate(u32 mask)
|
||||
+{ ltq_sysctl_activate(SYSCTL_SYS1, mask); }
|
||||
+static inline void sys1_hw_deactivate(u32 mask)
|
||||
+{ ltq_sysctl_deactivate(SYSCTL_SYS1, mask); }
|
||||
+static inline void sys1_hw_clk_enable(u32 mask)
|
||||
+{ ltq_sysctl_clken(SYSCTL_SYS1, mask); }
|
||||
+static inline void sys1_hw_clk_disable(u32 mask)
|
||||
+{ ltq_sysctl_clkdis(SYSCTL_SYS1, mask); }
|
||||
+static inline void sys1_hw_activate_or_reboot(u32 mask)
|
||||
+{ ltq_sysctl_reboot(SYSCTL_SYS1, mask); }
|
||||
+
|
||||
+static inline void sys_eth_hw_activate(u32 mask)
|
||||
+{ ltq_sysctl_activate(SYSCTL_SYSETH, mask); }
|
||||
+static inline void sys_eth_hw_deactivate(u32 mask)
|
||||
+{ ltq_sysctl_deactivate(SYSCTL_SYSETH, mask); }
|
||||
+static inline void sys_eth_hw_clk_enable(u32 mask)
|
||||
+{ ltq_sysctl_clken(SYSCTL_SYSETH, mask); }
|
||||
+static inline void sys_eth_hw_clk_disable(u32 mask)
|
||||
+{ ltq_sysctl_clkdis(SYSCTL_SYSETH, mask); }
|
||||
+static inline void sys_eth_hw_activate_or_reboot(u32 mask)
|
||||
+{ ltq_sysctl_reboot(SYSCTL_SYSETH, mask); }
|
||||
+
|
||||
+static inline void sys_gpe_hw_activate(u32 mask)
|
||||
+{ ltq_sysctl_activate(SYSCTL_SYSGPE, mask); }
|
||||
+static inline void sys_gpe_hw_deactivate(u32 mask)
|
||||
+{ ltq_sysctl_deactivate(SYSCTL_SYSGPE, mask); }
|
||||
+static inline void sys_gpe_hw_clk_enable(u32 mask)
|
||||
+{ ltq_sysctl_clken(SYSCTL_SYSGPE, mask); }
|
||||
+static inline void sys_gpe_hw_clk_disable(u32 mask)
|
||||
+{ ltq_sysctl_clkdis(SYSCTL_SYSGPE, mask); }
|
||||
+static inline void sys_gpe_hw_activate_or_reboot(u32 mask)
|
||||
+{ ltq_sysctl_reboot(SYSCTL_SYSGPE, mask); }
|
||||
+static inline int sys_gpe_hw_is_activated(u32 mask)
|
||||
+{ return 1; }
|
||||
+
|
||||
+#endif /* __FALCON_SYSCTRL_H */
|
245
target/linux/lantiq/patches-3.3/201-owrt-mtd_split.patch
Normal file
245
target/linux/lantiq/patches-3.3/201-owrt-mtd_split.patch
Normal file
@ -0,0 +1,245 @@
|
||||
--- a/drivers/mtd/Kconfig
|
||||
+++ b/drivers/mtd/Kconfig
|
||||
@@ -31,6 +31,10 @@ config MTD_ROOTFS_SPLIT
|
||||
bool "Automatically split 'rootfs' partition for squashfs"
|
||||
default y
|
||||
|
||||
+config MTD_UIMAGE_SPLIT
|
||||
+ bool "Automatically split 'linux' partition into 'kernel' and 'rootfs'"
|
||||
+ default y
|
||||
+
|
||||
config MTD_REDBOOT_PARTS
|
||||
tristate "RedBoot partition table parsing"
|
||||
---help---
|
||||
--- a/drivers/mtd/mtdpart.c
|
||||
+++ b/drivers/mtd/mtdpart.c
|
||||
@@ -874,6 +874,169 @@ static int refresh_rootfs_split(struct m
|
||||
}
|
||||
#endif /* CONFIG_MTD_ROOTFS_SPLIT */
|
||||
|
||||
+
|
||||
+#ifdef CONFIG_MTD_UIMAGE_SPLIT
|
||||
+static unsigned long find_uimage_size(struct mtd_info *mtd,
|
||||
+ unsigned long offset)
|
||||
+{
|
||||
+#define UBOOT_MAGIC 0x56190527
|
||||
+ unsigned long magic = 0;
|
||||
+ unsigned long temp;
|
||||
+ size_t len;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mtd->read(mtd, offset, 4, &len, (void *)&magic);
|
||||
+ if (ret || len != sizeof(magic))
|
||||
+ return 0;
|
||||
+
|
||||
+ if (le32_to_cpu(magic) != UBOOT_MAGIC)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = mtd->read(mtd, offset + 12, 4, &len, (void *)&temp);
|
||||
+ if (ret || len != sizeof(temp))
|
||||
+ return 0;
|
||||
+
|
||||
+ return temp + 0x40;
|
||||
+}
|
||||
+
|
||||
+static unsigned long find_eva_size(struct mtd_info *mtd,
|
||||
+ unsigned long offset)
|
||||
+{
|
||||
+#define EVA_MAGIC 0xfeed1281
|
||||
+ unsigned long magic = 0;
|
||||
+ unsigned long temp;
|
||||
+ size_t len;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mtd->read(mtd, offset, 4, &len, (void *)&magic);
|
||||
+ if (ret || len != sizeof(magic))
|
||||
+ return 0;
|
||||
+
|
||||
+ if (le32_to_cpu(magic) != EVA_MAGIC)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = mtd->read(mtd, offset + 4, 4, &len, (void *)&temp);
|
||||
+ if (ret || len != sizeof(temp))
|
||||
+ return 0;
|
||||
+
|
||||
+ /* add eva header size */
|
||||
+ temp = le32_to_cpu(temp) + 0x18;
|
||||
+
|
||||
+ temp &= ~0xffff;
|
||||
+ temp += 0x10000;
|
||||
+ return temp;
|
||||
+}
|
||||
+
|
||||
+static int detect_squashfs_partition(struct mtd_info *mtd, unsigned long offset)
|
||||
+{
|
||||
+ unsigned long temp;
|
||||
+ size_t len;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mtd->read(mtd, offset, 4, &len, (void *)&temp);
|
||||
+ if (ret || len != sizeof(temp))
|
||||
+ return 0;
|
||||
+
|
||||
+
|
||||
+ return le32_to_cpu(temp) == SQUASHFS_MAGIC;
|
||||
+}
|
||||
+
|
||||
+static int detect_eva_squashfs_partition(struct mtd_info *mtd, unsigned long offset)
|
||||
+{
|
||||
+ unsigned long temp;
|
||||
+ size_t len;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mtd->read(mtd, offset, 4, &len, (void *)&temp);
|
||||
+ if (ret || len != sizeof(temp))
|
||||
+ return 0;
|
||||
+
|
||||
+ return be32_to_cpu(temp) == SQUASHFS_MAGIC;
|
||||
+}
|
||||
+
|
||||
+static unsigned long find_brnimage_size(struct mtd_info *mtd,
|
||||
+ unsigned long offset)
|
||||
+{
|
||||
+ unsigned long buf[4];
|
||||
+ // Assume at most 2MB of kernel image
|
||||
+ unsigned long end = offset + (2 << 20);
|
||||
+ unsigned long ptr = offset + 0x400 - 12;
|
||||
+ size_t len;
|
||||
+ int ret;
|
||||
+
|
||||
+ while (ptr < end) {
|
||||
+ long size_min = ptr - 0x400 - 12 - offset;
|
||||
+ long size_max = ptr + 12 - offset;
|
||||
+ ret = mtd->read(mtd, ptr, 16, &len, (void *)buf);
|
||||
+ if (ret || len != 16)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (le32_to_cpu(buf[0]) < size_min ||
|
||||
+ le32_to_cpu(buf[0]) > size_max) {
|
||||
+ ptr += 0x400;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (le32_to_cpu(buf[3]) == SQUASHFS_MAGIC)
|
||||
+ return ptr + 12 - offset;
|
||||
+
|
||||
+ ptr += 0x400;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int split_uimage(struct mtd_info *mtd,
|
||||
+ const struct mtd_partition *part)
|
||||
+{
|
||||
+ static struct mtd_partition split_partitions[] = {
|
||||
+ {
|
||||
+ .name = "kernel",
|
||||
+ .offset = 0x0,
|
||||
+ .size = 0x0,
|
||||
+ }, {
|
||||
+ .name = "rootfs",
|
||||
+ .offset = 0x0,
|
||||
+ .size = 0x0,
|
||||
+ },
|
||||
+ };
|
||||
+
|
||||
+ split_partitions[0].size = find_uimage_size(mtd, part->offset);
|
||||
+ if (!split_partitions[0].size) {
|
||||
+ split_partitions[0].size = find_eva_size(mtd, part->offset);
|
||||
+ if (!split_partitions[0].size) {
|
||||
+ split_partitions[0].size = find_brnimage_size(mtd, part->offset);
|
||||
+ if (!split_partitions[0].size) {
|
||||
+ printk(KERN_NOTICE "no uImage or brnImage or eva found in linux partition\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (detect_eva_squashfs_partition(mtd,
|
||||
+ part->offset
|
||||
+ + split_partitions[0].size)) {
|
||||
+ split_partitions[0].size += 0x100;
|
||||
+ pr_info("found eva dummy squashfs behind kernel\n");
|
||||
+ } else if (!detect_squashfs_partition(mtd,
|
||||
+ part->offset
|
||||
+ + split_partitions[0].size)) {
|
||||
+ split_partitions[0].size &= ~(mtd->erasesize - 1);
|
||||
+ split_partitions[0].size += mtd->erasesize;
|
||||
+ } else {
|
||||
+ pr_info("found squashfs behind kernel\n");
|
||||
+ }
|
||||
+
|
||||
+ split_partitions[0].offset = part->offset;
|
||||
+ split_partitions[1].offset = part->offset + split_partitions[0].size;
|
||||
+ split_partitions[1].size = part->size - split_partitions[0].size;
|
||||
+
|
||||
+ add_mtd_partitions(mtd, split_partitions, 2);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* This function, given a master MTD object and a partition table, creates
|
||||
* and registers slave MTD objects which are bound to the master according to
|
||||
@@ -890,7 +1053,7 @@ int add_mtd_partitions(struct mtd_info *
|
||||
struct mtd_part *slave;
|
||||
uint64_t cur_offset = 0;
|
||||
int i;
|
||||
-#ifdef CONFIG_MTD_ROOTFS_SPLIT
|
||||
+#if defined(CONFIG_MTD_ROOTFS_SPLIT) || defined(CONFIG_MTD_UIMAGE_SPLIT)
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
@@ -907,6 +1070,17 @@ int add_mtd_partitions(struct mtd_info *
|
||||
|
||||
add_mtd_device(&slave->mtd);
|
||||
|
||||
+#ifdef CONFIG_MTD_UIMAGE_SPLIT
|
||||
+ if (!strcmp(parts[i].name, "linux")) {
|
||||
+ ret = split_uimage(master, &parts[i]);
|
||||
+
|
||||
+ if (ret) {
|
||||
+ printk(KERN_WARNING
|
||||
+ "Can't split linux partition\n");
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
if (!strcmp(parts[i].name, "rootfs")) {
|
||||
#ifdef CONFIG_MTD_ROOTFS_ROOT_DEV
|
||||
if (ROOT_DEV == 0) {
|
||||
--- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
|
||||
+++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
|
||||
@@ -166,6 +166,7 @@ extern unsigned char ltq_boot_select(voi
|
||||
|
||||
extern __iomem void *ltq_ebu_membase;
|
||||
extern __iomem void *ltq_cgu_membase;
|
||||
+extern unsigned long ltq_brn_boot;
|
||||
|
||||
static inline int ltq_is_ase(void)
|
||||
{
|
||||
--- a/arch/mips/lantiq/setup.c
|
||||
+++ b/arch/mips/lantiq/setup.c
|
||||
@@ -18,6 +18,9 @@
|
||||
#include "devices.h"
|
||||
#include "prom.h"
|
||||
|
||||
+/* set to 1 if the bootloader is BRN-BOOT instead of u-boot */
|
||||
+unsigned long ltq_brn_boot = 0;
|
||||
+
|
||||
void __init plat_mem_setup(void)
|
||||
{
|
||||
/* assume 16M as default incase uboot fails to pass proper ramsize */
|
||||
@@ -38,6 +41,10 @@ void __init plat_mem_setup(void)
|
||||
if (strict_strtoul(e, 0, &memsize))
|
||||
pr_warn("bad memsize specified\n");
|
||||
}
|
||||
+ if (!strncmp(e, "BRN-BOOT", 8)){
|
||||
+ pr_info("Found BRN-BOOT instead of u-boot\n");
|
||||
+ ltq_brn_boot = 1;
|
||||
+ }
|
||||
envp++;
|
||||
}
|
||||
memsize *= 1024 * 1024;
|
60
target/linux/lantiq/patches-3.3/202-owrt-atm.patch
Normal file
60
target/linux/lantiq/patches-3.3/202-owrt-atm.patch
Normal file
@ -0,0 +1,60 @@
|
||||
--- a/arch/mips/lantiq/irq.c
|
||||
+++ b/arch/mips/lantiq/irq.c
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/sched.h>
|
||||
+#include <linux/module.h>
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/irq_cpu.h>
|
||||
@@ -111,6 +112,7 @@ void ltq_mask_and_ack_irq(struct irq_dat
|
||||
ltq_icu_w32(ltq_icu_r32(ier) & ~(1 << irq_nr), ier);
|
||||
ltq_icu_w32((1 << irq_nr), isr);
|
||||
}
|
||||
+EXPORT_SYMBOL(ltq_mask_and_ack_irq);
|
||||
|
||||
static void ltq_ack_irq(struct irq_data *d)
|
||||
{
|
||||
--- a/arch/mips/mm/cache.c
|
||||
+++ b/arch/mips/mm/cache.c
|
||||
@@ -57,6 +57,8 @@ void (*_dma_cache_wback)(unsigned long s
|
||||
void (*_dma_cache_inv)(unsigned long start, unsigned long size);
|
||||
|
||||
EXPORT_SYMBOL(_dma_cache_wback_inv);
|
||||
+EXPORT_SYMBOL(_dma_cache_wback);
|
||||
+EXPORT_SYMBOL(_dma_cache_inv);
|
||||
|
||||
#endif /* CONFIG_DMA_NONCOHERENT */
|
||||
|
||||
--- a/net/atm/proc.c
|
||||
+++ b/net/atm/proc.c
|
||||
@@ -154,7 +154,7 @@ static void *vcc_seq_next(struct seq_fil
|
||||
static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
|
||||
{
|
||||
static const char *const class_name[] = {
|
||||
- "off", "UBR", "CBR", "VBR", "ABR"};
|
||||
+ "off","UBR","CBR","NTR-VBR","ABR","ANY","RT-VBR","UBR+","GFR"};
|
||||
static const char *const aal_name[] = {
|
||||
"---", "1", "2", "3/4", /* 0- 3 */
|
||||
"???", "5", "???", "???", /* 4- 7 */
|
||||
--- a/net/atm/common.c
|
||||
+++ b/net/atm/common.c
|
||||
@@ -62,11 +62,17 @@ static void vcc_remove_socket(struct soc
|
||||
write_unlock_irq(&vcc_sklist_lock);
|
||||
}
|
||||
|
||||
+struct sk_buff* (*ifx_atm_alloc_tx)(struct atm_vcc *, unsigned int) = NULL;
|
||||
+EXPORT_SYMBOL(ifx_atm_alloc_tx);
|
||||
+
|
||||
static struct sk_buff *alloc_tx(struct atm_vcc *vcc, unsigned int size)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct sock *sk = sk_atm(vcc);
|
||||
|
||||
+ if (ifx_atm_alloc_tx != NULL)
|
||||
+ return ifx_atm_alloc_tx(vcc, size);
|
||||
+
|
||||
if (sk_wmem_alloc_get(sk) && !atm_may_send(vcc, size)) {
|
||||
pr_debug("Sorry: wmem_alloc = %d, size = %d, sndbuf = %d\n",
|
||||
sk_wmem_alloc_get(sk), size, sk->sk_sndbuf);
|
45
target/linux/lantiq/patches-3.3/203-owrt-cmdline.patch
Normal file
45
target/linux/lantiq/patches-3.3/203-owrt-cmdline.patch
Normal file
@ -0,0 +1,45 @@
|
||||
--- a/arch/mips/lantiq/prom.c
|
||||
+++ b/arch/mips/lantiq/prom.c
|
||||
@@ -43,6 +43,34 @@ void prom_free_prom_memory(void)
|
||||
{
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_IMAGE_CMDLINE_HACK
|
||||
+extern char __image_cmdline[];
|
||||
+
|
||||
+static void __init
|
||||
+prom_init_image_cmdline(void)
|
||||
+{
|
||||
+ char *p = __image_cmdline;
|
||||
+ int replace = 0;
|
||||
+
|
||||
+ if (*p == '-') {
|
||||
+ replace = 1;
|
||||
+ p++;
|
||||
+ }
|
||||
+
|
||||
+ if (*p == '\0')
|
||||
+ return;
|
||||
+
|
||||
+ if (replace) {
|
||||
+ strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline));
|
||||
+ } else {
|
||||
+ strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
|
||||
+ strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
|
||||
+ }
|
||||
+}
|
||||
+#else
|
||||
+static void __init prom_init_image_cmdline(void) { return; }
|
||||
+#endif
|
||||
+
|
||||
static void __init prom_init_cmdline(void)
|
||||
{
|
||||
int argc = fw_arg0;
|
||||
@@ -59,6 +87,7 @@ static void __init prom_init_cmdline(voi
|
||||
strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
|
||||
}
|
||||
}
|
||||
+ prom_init_image_cmdline();
|
||||
}
|
||||
|
||||
void __iomem *ltq_remap_resource(struct resource *res)
|
117
target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch
Normal file
117
target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch
Normal file
@ -0,0 +1,117 @@
|
||||
--- a/drivers/net/ethernet/davicom/dm9000.c
|
||||
+++ b/drivers/net/ethernet/davicom/dm9000.c
|
||||
@@ -19,6 +19,7 @@
|
||||
* Sascha Hauer <s.hauer@pengutronix.de>
|
||||
*/
|
||||
|
||||
+#define DEBUG
|
||||
#include <linux/module.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/netdevice.h>
|
||||
@@ -132,6 +133,8 @@ typedef struct board_info {
|
||||
struct delayed_work phy_poll;
|
||||
struct net_device *ndev;
|
||||
|
||||
+ struct delayed_work irq_poll; /* for use in irq polling mode */
|
||||
+
|
||||
spinlock_t lock;
|
||||
|
||||
struct mii_if_info mii;
|
||||
@@ -844,6 +847,8 @@ static void dm9000_timeout(struct net_de
|
||||
netif_stop_queue(dev);
|
||||
dm9000_reset(db);
|
||||
dm9000_init_dm9000(dev);
|
||||
+ dm9000_reset(db);
|
||||
+ dm9000_init_dm9000(dev);
|
||||
/* We can accept TX packets again */
|
||||
dev->trans_start = jiffies; /* prevent tx timeout */
|
||||
netif_wake_queue(dev);
|
||||
@@ -915,6 +920,12 @@ dm9000_start_xmit(struct sk_buff *skb, s
|
||||
/* free this SKB */
|
||||
dev_kfree_skb(skb);
|
||||
|
||||
+ /* directly poll afterwards */
|
||||
+ if (dev->irq == -1) {
|
||||
+ cancel_delayed_work(&db->irq_poll);
|
||||
+ schedule_delayed_work(&db->irq_poll, 1);
|
||||
+ }
|
||||
+
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
@@ -1156,6 +1167,18 @@ static void dm9000_poll_controller(struc
|
||||
}
|
||||
#endif
|
||||
|
||||
+static void dm9000_poll_irq(struct work_struct *w)
|
||||
+{
|
||||
+ struct delayed_work *dw = to_delayed_work(w);
|
||||
+ board_info_t *db = container_of(dw, board_info_t, irq_poll);
|
||||
+ struct net_device *ndev = db->ndev;
|
||||
+
|
||||
+ dm9000_interrupt(0, ndev);
|
||||
+
|
||||
+ if (netif_running(ndev))
|
||||
+ schedule_delayed_work(&db->irq_poll, HZ /100);
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Open the interface.
|
||||
* The interface is opened whenever "ifconfig" actives it.
|
||||
@@ -1169,14 +1192,15 @@ dm9000_open(struct net_device *dev)
|
||||
if (netif_msg_ifup(db))
|
||||
dev_dbg(db->dev, "enabling %s\n", dev->name);
|
||||
|
||||
- /* If there is no IRQ type specified, default to something that
|
||||
- * may work, and tell the user that this is a problem */
|
||||
+ if (dev->irq != -1) {
|
||||
+ /* If there is no IRQ type specified, default to something that
|
||||
+ * may work, and tell the user that this is a problem */
|
||||
|
||||
- if (irqflags == IRQF_TRIGGER_NONE)
|
||||
- dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
|
||||
-
|
||||
- irqflags |= IRQF_SHARED;
|
||||
+ if (irqflags == IRQF_TRIGGER_NONE)
|
||||
+ dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
|
||||
|
||||
+ irqflags |= IRQF_SHARED;
|
||||
+ }
|
||||
/* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
|
||||
iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
|
||||
mdelay(1); /* delay needs by DM9000B */
|
||||
@@ -1185,8 +1209,14 @@ dm9000_open(struct net_device *dev)
|
||||
dm9000_reset(db);
|
||||
dm9000_init_dm9000(dev);
|
||||
|
||||
- if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
|
||||
- return -EAGAIN;
|
||||
+ /* testing: init a second time */
|
||||
+ dm9000_reset(db);
|
||||
+ dm9000_init_dm9000(dev);
|
||||
+
|
||||
+ if (dev->irq != -1) {
|
||||
+ if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
|
||||
+ return -EAGAIN;
|
||||
+ }
|
||||
|
||||
/* Init driver variable */
|
||||
db->dbug_cnt = 0;
|
||||
@@ -1194,6 +1224,9 @@ dm9000_open(struct net_device *dev)
|
||||
mii_check_media(&db->mii, netif_msg_link(db), 1);
|
||||
netif_start_queue(dev);
|
||||
|
||||
+ if (dev->irq == -1)
|
||||
+ schedule_delayed_work(&db->irq_poll, HZ / 100);
|
||||
+
|
||||
dm9000_schedule_poll(db);
|
||||
|
||||
return 0;
|
||||
@@ -1391,6 +1424,7 @@ dm9000_probe(struct platform_device *pde
|
||||
mutex_init(&db->addr_lock);
|
||||
|
||||
INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work);
|
||||
+ INIT_DELAYED_WORK(&db->irq_poll, dm9000_poll_irq);
|
||||
|
||||
db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
50
target/linux/lantiq/patches-3.3/205-owrt-gpio-export.patch
Normal file
50
target/linux/lantiq/patches-3.3/205-owrt-gpio-export.patch
Normal file
@ -0,0 +1,50 @@
|
||||
--- a/drivers/gpio/gpiolib.c
|
||||
+++ b/drivers/gpio/gpiolib.c
|
||||
@@ -64,9 +64,9 @@ struct gpio_desc {
|
||||
#define GPIO_FLAGS_MASK ((1 << ID_SHIFT) - 1)
|
||||
#define GPIO_TRIGGER_MASK (BIT(FLAG_TRIG_FALL) | BIT(FLAG_TRIG_RISE))
|
||||
|
||||
-#ifdef CONFIG_DEBUG_FS
|
||||
+//#ifdef CONFIG_DEBUG_FS
|
||||
const char *label;
|
||||
-#endif
|
||||
+//#endif
|
||||
};
|
||||
static struct gpio_desc gpio_desc[ARCH_NR_GPIOS];
|
||||
|
||||
@@ -76,9 +76,9 @@ static DEFINE_IDR(dirent_idr);
|
||||
|
||||
static inline void desc_set_label(struct gpio_desc *d, const char *label)
|
||||
{
|
||||
-#ifdef CONFIG_DEBUG_FS
|
||||
+//#ifdef CONFIG_DEBUG_FS
|
||||
d->label = label;
|
||||
-#endif
|
||||
+//#endif
|
||||
}
|
||||
|
||||
/* Warn when drivers omit gpio_request() calls -- legal but ill-advised
|
||||
@@ -727,7 +727,6 @@ int gpio_export(unsigned gpio, bool dire
|
||||
|
||||
if (desc->chip->names && desc->chip->names[gpio - desc->chip->base])
|
||||
ioname = desc->chip->names[gpio - desc->chip->base];
|
||||
-
|
||||
if (status == 0) {
|
||||
struct device *dev;
|
||||
|
||||
@@ -1347,11 +1346,11 @@ const char *gpiochip_is_requested(struct
|
||||
return NULL;
|
||||
if (test_bit(FLAG_REQUESTED, &gpio_desc[gpio].flags) == 0)
|
||||
return NULL;
|
||||
-#ifdef CONFIG_DEBUG_FS
|
||||
+//#ifdef CONFIG_DEBUG_FS
|
||||
return gpio_desc[gpio].label;
|
||||
-#else
|
||||
- return "?";
|
||||
-#endif
|
||||
+//#else
|
||||
+// return "?";
|
||||
+//#endif
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gpiochip_is_requested);
|
||||
|
305
target/linux/lantiq/patches-3.3/206-machtypes.patch
Normal file
305
target/linux/lantiq/patches-3.3/206-machtypes.patch
Normal file
@ -0,0 +1,305 @@
|
||||
--- a/arch/mips/lantiq/machtypes.h
|
||||
+++ b/arch/mips/lantiq/machtypes.h
|
||||
@@ -20,6 +20,36 @@ enum lantiq_mach_type {
|
||||
LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */
|
||||
LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */
|
||||
LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */
|
||||
+ LANTIQ_MACH_EASY98020, /* EASY98020 Eval Board */
|
||||
+ LANTIQ_MACH_EASY98020_1LAN, /* EASY98020 Eval Board (1 LAN port) */
|
||||
+ LANTIQ_MACH_EASY98020_2LAN, /* EASY98020 Eval Board (2 LAN port) */
|
||||
+ LANTIQ_MACH_95C3AM1, /* 95C3AM1 Eval Board */
|
||||
+
|
||||
+ /* Arcadyan */
|
||||
+ LANTIQ_MACH_ARV3527P, /* Arcor easybox a401 */
|
||||
+ LANTIQ_MACH_ARV4510PW, /* Wippies Homebox */
|
||||
+ LANTIQ_MACH_ARV4518PW, /* Airties WAV-221, SMC-7908A-ISP */
|
||||
+ LANTIQ_MACH_ARV4519PW, /* Vodafone, Pirelli */
|
||||
+ LANTIQ_MACH_ARV4520PW, /* Airties WAV-281, Arcor EasyboxA800 */
|
||||
+ LANTIQ_MACH_ARV452CPW, /* Arcor EasyboxA801 */
|
||||
+ LANTIQ_MACH_ARV4525PW, /* Speedport W502V */
|
||||
+ LANTIQ_MACH_ARV7525PW, /* Speedport W303V */
|
||||
+ LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */
|
||||
+ LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */
|
||||
+ LANTIQ_MACH_ARV7518PW, /* ASTORIA */
|
||||
+
|
||||
+ /* Netgear */
|
||||
+ LANTIQ_MACH_DGN3500B, /* Netgear DGN3500 */
|
||||
+
|
||||
+ /* FRITZ!BOX */
|
||||
+ LANTIQ_MACH_FRITZ3370, /* FRITZ!BOX 3370 vdsl cpe */
|
||||
+ LANTIQ_MACH_FRITZ7320, /* FRITZ!BOX 7320 1&1 homeserver */
|
||||
+
|
||||
+ /* Gigaset */
|
||||
+ LANTIQ_MACH_GIGASX76X, /* Gigaset SX76x */
|
||||
+
|
||||
+ /* Buffalo */
|
||||
+ LANTIQ_MACH_WBMR, /* WBMR-HP-G300H */
|
||||
};
|
||||
|
||||
#endif
|
||||
--- a/arch/mips/lantiq/xway/Kconfig
|
||||
+++ b/arch/mips/lantiq/xway/Kconfig
|
||||
@@ -6,6 +6,30 @@ config LANTIQ_MACH_EASY50712
|
||||
bool "Easy50712 - Danube"
|
||||
default y
|
||||
|
||||
+config LANTIQ_MACH_ARV
|
||||
+ bool "ARV"
|
||||
+ default y
|
||||
+
|
||||
+config LANTIQ_MACH_NETGEAR
|
||||
+ bool "Netgear"
|
||||
+ default y
|
||||
+
|
||||
+config LANTIQ_MACH_GIGASX76X
|
||||
+ bool "GIGASX76X"
|
||||
+ default y
|
||||
+
|
||||
+config LANTIQ_MACH_WBMR
|
||||
+ bool "WBMR-HP-G300H"
|
||||
+ default y
|
||||
+
|
||||
+config LANTIQ_MACH_FRITZ_VR9
|
||||
+ bool "FRITZ3370"
|
||||
+ default y
|
||||
+
|
||||
+config LANTIQ_MACH_FRITZ_AR9
|
||||
+ bool "FRITZ7320"
|
||||
+ default y
|
||||
+
|
||||
endmenu
|
||||
|
||||
choice
|
||||
--- a/arch/mips/lantiq/xway/Makefile
|
||||
+++ b/arch/mips/lantiq/xway/Makefile
|
||||
@@ -2,3 +2,9 @@ obj-y := sysctrl.o reset.o gpio.o gpio_s
|
||||
|
||||
obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
|
||||
obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_ARV) += mach-arv.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_FRITZ_AR9) += mach-fritz_ar9.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_FRITZ_VR9) += mach-fritz_vr9.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_GIGASX76X) += mach-gigasx76x.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o
|
||||
--- a/arch/mips/lantiq/falcon/Kconfig
|
||||
+++ b/arch/mips/lantiq/falcon/Kconfig
|
||||
@@ -6,6 +6,14 @@ config LANTIQ_MACH_EASY98000
|
||||
bool "Easy98000"
|
||||
default y
|
||||
|
||||
+config LANTIQ_MACH_EASY98020
|
||||
+ bool "Easy98020"
|
||||
+ default y
|
||||
+
|
||||
+config LANTIQ_MACH_95C3AM1
|
||||
+ bool "95C3AM1"
|
||||
+ default y
|
||||
+
|
||||
endmenu
|
||||
|
||||
endif
|
||||
--- a/arch/mips/lantiq/falcon/Makefile
|
||||
+++ b/arch/mips/lantiq/falcon/Makefile
|
||||
@@ -1,2 +1,6 @@
|
||||
obj-y := prom.o reset.o sysctrl.o devices.o gpio.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_EASY98000) += addon-easy98000.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
|
||||
obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
|
||||
+obj-$(CONFIG_LANTIQ_MACH_95C3AM1) += mach-95C3AM1.o
|
||||
--- a/arch/mips/lantiq/falcon/mach-easy98000.c
|
||||
+++ b/arch/mips/lantiq/falcon/mach-easy98000.c
|
||||
@@ -1,23 +1,38 @@
|
||||
-/*
|
||||
- * 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.
|
||||
- *
|
||||
- * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
|
||||
- * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
|
||||
- */
|
||||
-
|
||||
+#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
+#include <linux/leds.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/gpio_buttons.h>
|
||||
+#include <linux/etherdevice.h>
|
||||
+#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
+#include <linux/mtd/physmap.h>
|
||||
+#include <linux/input.h>
|
||||
+#include <linux/interrupt.h>
|
||||
+#include <linux/dm9000.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/i2c-gpio.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/spi_gpio.h>
|
||||
#include <linux/spi/eeprom.h>
|
||||
+#include <falcon/lantiq_soc.h>
|
||||
|
||||
#include "../machtypes.h"
|
||||
|
||||
#include "devices.h"
|
||||
+#include "dev-leds-gpio.h"
|
||||
+
|
||||
+#define EASY98000_GPIO_LED_0 9
|
||||
+#define EASY98000_GPIO_LED_1 10
|
||||
+#define EASY98000_GPIO_LED_2 11
|
||||
+#define EASY98000_GPIO_LED_3 12
|
||||
+#define EASY98000_GPIO_LED_4 13
|
||||
+#define EASY98000_GPIO_LED_5 14
|
||||
|
||||
-static struct mtd_partition easy98000_nor_partitions[] = {
|
||||
+extern unsigned char ltq_ethaddr[6];
|
||||
+
|
||||
+static struct mtd_partition easy98000_nor_partitions[] =
|
||||
+{
|
||||
{
|
||||
.name = "uboot",
|
||||
.offset = 0x0,
|
||||
@@ -35,7 +50,7 @@ static struct mtd_partition easy98000_no
|
||||
},
|
||||
};
|
||||
|
||||
-struct physmap_flash_data easy98000_nor_flash_data = {
|
||||
+static struct physmap_flash_data easy98000_nor_flash_data = {
|
||||
.nr_parts = ARRAY_SIZE(easy98000_nor_partitions),
|
||||
.parts = easy98000_nor_partitions,
|
||||
};
|
||||
@@ -55,12 +70,105 @@ static struct spi_board_info easy98000_s
|
||||
.platform_data = &easy98000_spi_flash_platform_data
|
||||
};
|
||||
|
||||
+static struct gpio_led easy98000_leds_gpio[] __initdata = {
|
||||
+ {
|
||||
+ .name = "easy98000:green:0",
|
||||
+ .gpio = EASY98000_GPIO_LED_0,
|
||||
+ .active_low = 0,
|
||||
+ }, {
|
||||
+ .name = "easy98000:green:1",
|
||||
+ .gpio = EASY98000_GPIO_LED_1,
|
||||
+ .active_low = 0,
|
||||
+ }, {
|
||||
+ .name = "easy98000:green:2",
|
||||
+ .gpio = EASY98000_GPIO_LED_2,
|
||||
+ .active_low = 0,
|
||||
+ }, {
|
||||
+ .name = "easy98000:green:3",
|
||||
+ .gpio = EASY98000_GPIO_LED_3,
|
||||
+ .active_low = 0,
|
||||
+ }, {
|
||||
+ .name = "easy98000:green:4",
|
||||
+ .gpio = EASY98000_GPIO_LED_4,
|
||||
+ .active_low = 0,
|
||||
+ }, {
|
||||
+ .name = "easy98000:green:5",
|
||||
+ .gpio = EASY98000_GPIO_LED_5,
|
||||
+ .active_low = 0,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+#define CONFIG_DM9000_BASE 0x14000000
|
||||
+#define DM9000_IO (CONFIG_DM9000_BASE + 3)
|
||||
+#define DM9000_DATA (CONFIG_DM9000_BASE + 1)
|
||||
+
|
||||
+static struct dm9000_plat_data dm9000_plat_data = {
|
||||
+ .flags = DM9000_PLATF_8BITONLY,
|
||||
+ //.dev_addr = { }, /* possibility to provide an ethernet address for the chip */
|
||||
+};
|
||||
+
|
||||
+static struct resource dm9000_resources[] = {
|
||||
+ MEM_RES("dm9000_io", DM9000_IO, DM9000_IO),
|
||||
+ MEM_RES("dm9000_data", DM9000_DATA, DM9000_DATA),
|
||||
+ [2] = {
|
||||
+ /* with irq (210 -> gpio 110) the driver is very unreliable */
|
||||
+ .start = -1, /* use polling */
|
||||
+ .end = -1,
|
||||
+ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device dm9000_platform = {
|
||||
+ .name = "dm9000",
|
||||
+ .id = 0,
|
||||
+ .num_resources = ARRAY_SIZE(dm9000_resources),
|
||||
+ .resource = dm9000_resources,
|
||||
+ .dev = {
|
||||
+ .platform_data = (void *) &dm9000_plat_data,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+extern int easy98000_addon_has_dm9000(void);
|
||||
+static void __init register_davicom(void)
|
||||
+{
|
||||
+ if (!easy98000_addon_has_dm9000())
|
||||
+ return;
|
||||
+
|
||||
+ if (!is_valid_ether_addr(ltq_ethaddr))
|
||||
+ random_ether_addr(dm9000_plat_data.dev_addr);
|
||||
+ else {
|
||||
+ memcpy(dm9000_plat_data.dev_addr, ltq_ethaddr, 6);
|
||||
+ /* change to "Locally Administered Address" */
|
||||
+ dm9000_plat_data.dev_addr[0] |= 0x2;
|
||||
+ }
|
||||
+ platform_device_register(&dm9000_platform);
|
||||
+}
|
||||
+
|
||||
+static struct i2c_gpio_platform_data easy98000_i2c_gpio_data = {
|
||||
+ .sda_pin = 107,
|
||||
+ .scl_pin = 108,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device easy98000_i2c_gpio_device = {
|
||||
+ .name = "i2c-gpio",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &easy98000_i2c_gpio_data,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+void __init register_easy98000_cpld(void)
|
||||
+{
|
||||
+ platform_device_register_simple("easy98000_cpld_led", 0, NULL, 0);
|
||||
+ platform_device_register_simple("easy98000_addon", 0, NULL, 0);
|
||||
+}
|
||||
+
|
||||
/* setup gpio based spi bus/device for access to the eeprom on the board */
|
||||
-#define SPI_GPIO_MRST 102
|
||||
-#define SPI_GPIO_MTSR 103
|
||||
-#define SPI_GPIO_CLK 104
|
||||
-#define SPI_GPIO_CS0 105
|
||||
-#define SPI_GPIO_CS1 106
|
||||
+#define SPI_GPIO_MRST 102
|
||||
+#define SPI_GPIO_MTSR 103
|
||||
+#define SPI_GPIO_CLK 104
|
||||
+#define SPI_GPIO_CS0 105
|
||||
+#define SPI_GPIO_CS1 106
|
||||
#define SPI_GPIO_BUS_NUM 1
|
||||
|
||||
static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
|
||||
@@ -94,11 +202,22 @@ static struct spi_board_info easy98000_s
|
||||
};
|
||||
|
||||
static void __init
|
||||
-easy98000_init_common(void)
|
||||
+easy98000_spi_gpio_init(void)
|
||||
{
|
||||
spi_register_board_info(&easy98000_spi_gpio_devices, 1);
|
||||
platform_device_register(&easy98000_spi_gpio_device);
|
||||
+}
|
||||
+
|
||||
+static void __init
|
||||
+easy98000_init_common(void)
|
||||
+{
|
||||
falcon_register_i2c();
|
||||
+ platform_device_register(&easy98000_i2c_gpio_device);
|
||||
+ register_davicom();
|
||||
+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98000_leds_gpio),
|
||||
+ easy98000_leds_gpio);
|
||||
+ register_easy98000_cpld();
|
||||
+ easy98000_spi_gpio_init();
|
||||
}
|
||||
|
||||
static void __init
|
191
target/linux/lantiq/patches-3.3/207-devices.patch
Normal file
191
target/linux/lantiq/patches-3.3/207-devices.patch
Normal file
@ -0,0 +1,191 @@
|
||||
--- a/arch/mips/lantiq/devices.c
|
||||
+++ b/arch/mips/lantiq/devices.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/gpio.h>
|
||||
+#include <linux/dma-mapping.h>
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/irq.h>
|
||||
@@ -100,3 +101,20 @@ void __init ltq_register_pci(struct ltq_
|
||||
pr_err("kernel is compiled without PCI support\n");
|
||||
}
|
||||
#endif
|
||||
+
|
||||
+static unsigned int *cp1_base = 0;
|
||||
+unsigned int*
|
||||
+ltq_get_cp1_base(void)
|
||||
+{
|
||||
+ return cp1_base;
|
||||
+}
|
||||
+EXPORT_SYMBOL(ltq_get_cp1_base);
|
||||
+
|
||||
+void __init
|
||||
+ltq_register_tapi(void)
|
||||
+{
|
||||
+#define CP1_SIZE (1 << 20)
|
||||
+ dma_addr_t dma;
|
||||
+ cp1_base =
|
||||
+ (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
|
||||
+}
|
||||
--- a/arch/mips/lantiq/devices.h
|
||||
+++ b/arch/mips/lantiq/devices.h
|
||||
@@ -23,5 +23,6 @@ extern void ltq_register_nor(struct phys
|
||||
extern void ltq_register_wdt(void);
|
||||
extern void ltq_register_asc(int port);
|
||||
extern void ltq_register_pci(struct ltq_pci_data *data);
|
||||
+extern void ltq_register_tapi(void);
|
||||
|
||||
#endif
|
||||
--- a/arch/mips/lantiq/xway/Makefile
|
||||
+++ b/arch/mips/lantiq/xway/Makefile
|
||||
@@ -1,5 +1,8 @@
|
||||
obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o prom.o nand.o timer.o dev-ifxhcd.o
|
||||
|
||||
+obj-y += dev-dwc_otg.o
|
||||
+obj-$(CONFIG_PCI) += dev-wifi-rt2x00.o dev-wifi-athxk.o pci-ath-fixup.o
|
||||
+
|
||||
obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
|
||||
obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
|
||||
obj-$(CONFIG_LANTIQ_MACH_ARV) += mach-arv.o
|
||||
--- a/arch/mips/lantiq/xway/devices.c
|
||||
+++ b/arch/mips/lantiq/xway/devices.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/gpio.h>
|
||||
+#include <linux/spi/spi.h>
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/irq.h>
|
||||
@@ -119,3 +120,97 @@ ltq_register_vrx200(struct ltq_eth_data
|
||||
ltq_vrx200.dev.platform_data = eth;
|
||||
platform_device_register(<q_vrx200);
|
||||
}
|
||||
+
|
||||
+/* ebu */
|
||||
+static struct resource ltq_ebu_resource =
|
||||
+{
|
||||
+ .name = "gpio_ebu",
|
||||
+ .start = LTQ_EBU_GPIO_START,
|
||||
+ .end = LTQ_EBU_GPIO_START + LTQ_EBU_GPIO_SIZE - 1,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+};
|
||||
+
|
||||
+static struct platform_device ltq_ebu =
|
||||
+{
|
||||
+ .name = "ltq_ebu",
|
||||
+ .resource = <q_ebu_resource,
|
||||
+ .num_resources = 1,
|
||||
+};
|
||||
+
|
||||
+void __init
|
||||
+ltq_register_gpio_ebu(unsigned int value)
|
||||
+{
|
||||
+ ltq_ebu.dev.platform_data = (void*) value;
|
||||
+ platform_device_register(<q_ebu);
|
||||
+}
|
||||
+
|
||||
+/* gpio buttons */
|
||||
+static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data;
|
||||
+
|
||||
+static struct platform_device ltq_gpio_buttons_platform_device =
|
||||
+{
|
||||
+ .name = "gpio-buttons",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = (void *) <q_gpio_buttons_platform_data,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+void __init
|
||||
+ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt)
|
||||
+{
|
||||
+ ltq_gpio_buttons_platform_data.buttons = buttons;
|
||||
+ ltq_gpio_buttons_platform_data.nbuttons = cnt;
|
||||
+ platform_device_register(<q_gpio_buttons_platform_device);
|
||||
+}
|
||||
+
|
||||
+static struct resource ltq_spi_resources[] = {
|
||||
+ {
|
||||
+ .start = LTQ_SSC_BASE_ADDR,
|
||||
+ .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ },
|
||||
+ IRQ_RES(spi_tx, LTQ_SSC_TIR),
|
||||
+ IRQ_RES(spi_rx, LTQ_SSC_RIR),
|
||||
+ IRQ_RES(spi_err, LTQ_SSC_EIR),
|
||||
+};
|
||||
+
|
||||
+static struct resource ltq_spi_resources_ar9[] = {
|
||||
+ {
|
||||
+ .start = LTQ_SSC_BASE_ADDR,
|
||||
+ .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ },
|
||||
+ IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9),
|
||||
+ IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9),
|
||||
+ IRQ_RES(spi_err, LTQ_SSC_EIR),
|
||||
+};
|
||||
+
|
||||
+static struct resource ltq_spi_resources_ase[] = {
|
||||
+ {
|
||||
+ .start = LTQ_SSC_BASE_ADDR,
|
||||
+ .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ },
|
||||
+ IRQ_RES(spi_tx, LTQ_SSC_TIR_ASE),
|
||||
+ IRQ_RES(spi_rx, LTQ_SSC_RIR_ASE),
|
||||
+ IRQ_RES(spi_err, LTQ_SSC_EIR_ASE),
|
||||
+};
|
||||
+
|
||||
+static struct platform_device ltq_spi = {
|
||||
+ .name = "ltq_spi",
|
||||
+ .resource = ltq_spi_resources,
|
||||
+ .num_resources = ARRAY_SIZE(ltq_spi_resources),
|
||||
+};
|
||||
+
|
||||
+void __init ltq_register_spi(struct ltq_spi_platform_data *pdata,
|
||||
+ struct spi_board_info const *info, unsigned n)
|
||||
+{
|
||||
+ if (ltq_is_ar9())
|
||||
+ ltq_spi.resource = ltq_spi_resources_ar9;
|
||||
+ else if (ltq_is_ase())
|
||||
+ ltq_spi.resource = ltq_spi_resources_ase;
|
||||
+ spi_register_board_info(info, n);
|
||||
+ ltq_spi.dev.platform_data = pdata;
|
||||
+ platform_device_register(<q_spi);
|
||||
+}
|
||||
--- a/arch/mips/lantiq/xway/devices.h
|
||||
+++ b/arch/mips/lantiq/xway/devices.h
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "../devices.h"
|
||||
#include <linux/phy.h>
|
||||
+#include <linux/spi/spi.h>
|
||||
+#include <linux/gpio_buttons.h>
|
||||
|
||||
extern void ltq_register_gpio(void);
|
||||
extern void ltq_register_gpio_stp(void);
|
||||
@@ -18,5 +20,9 @@ extern void ltq_register_ase_asc(void);
|
||||
extern void ltq_register_etop(struct ltq_eth_data *eth);
|
||||
extern void xway_register_nand(struct mtd_partition *parts, int count);
|
||||
extern void ltq_register_vrx200(struct ltq_eth_data *eth);
|
||||
+extern void ltq_register_gpio_ebu(unsigned int value);
|
||||
+extern void ltq_register_spi(struct ltq_spi_platform_data *pdata,
|
||||
+ struct spi_board_info const *info, unsigned n);
|
||||
+extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt);
|
||||
|
||||
#endif
|
||||
--- a/arch/mips/lantiq/Makefile
|
||||
+++ b/arch/mips/lantiq/Makefile
|
||||
@@ -4,7 +4,7 @@
|
||||
# under the terms of the GNU General Public License version 2 as published
|
||||
# by the Free Software Foundation.
|
||||
|
||||
-obj-y := irq.o setup.o clk.o prom.o devices.o
|
||||
+obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o
|
||||
|
||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||
|
68
target/linux/lantiq/patches-3.3/208-fix-mach-easy98000.patch
Normal file
68
target/linux/lantiq/patches-3.3/208-fix-mach-easy98000.patch
Normal file
@ -0,0 +1,68 @@
|
||||
--- a/arch/mips/lantiq/falcon/mach-easy98000.c
|
||||
+++ b/arch/mips/lantiq/falcon/mach-easy98000.c
|
||||
@@ -17,10 +17,11 @@
|
||||
#include <linux/spi/eeprom.h>
|
||||
#include <falcon/lantiq_soc.h>
|
||||
|
||||
+#include <dev-gpio-leds.h>
|
||||
+
|
||||
#include "../machtypes.h"
|
||||
|
||||
#include "devices.h"
|
||||
-#include "dev-leds-gpio.h"
|
||||
|
||||
#define EASY98000_GPIO_LED_0 9
|
||||
#define EASY98000_GPIO_LED_1 10
|
||||
@@ -29,7 +30,16 @@
|
||||
#define EASY98000_GPIO_LED_4 13
|
||||
#define EASY98000_GPIO_LED_5 14
|
||||
|
||||
-extern unsigned char ltq_ethaddr[6];
|
||||
+static unsigned char ltq_ethaddr[6] = {0};
|
||||
+
|
||||
+static int __init falcon_set_ethaddr(char *str)
|
||||
+{
|
||||
+ sscanf(str, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
|
||||
+ <q_ethaddr[0], <q_ethaddr[1], <q_ethaddr[2],
|
||||
+ <q_ethaddr[3], <q_ethaddr[4], <q_ethaddr[5]);
|
||||
+ return 0;
|
||||
+}
|
||||
+__setup("ethaddr=", falcon_set_ethaddr);
|
||||
|
||||
static struct mtd_partition easy98000_nor_partitions[] =
|
||||
{
|
||||
@@ -70,7 +80,7 @@ static struct spi_board_info easy98000_s
|
||||
.platform_data = &easy98000_spi_flash_platform_data
|
||||
};
|
||||
|
||||
-static struct gpio_led easy98000_leds_gpio[] __initdata = {
|
||||
+static struct gpio_led easy98000_gpio_leds[] __initdata = {
|
||||
{
|
||||
.name = "easy98000:green:0",
|
||||
.gpio = EASY98000_GPIO_LED_0,
|
||||
@@ -104,12 +114,11 @@ static struct gpio_led easy98000_leds_gp
|
||||
|
||||
static struct dm9000_plat_data dm9000_plat_data = {
|
||||
.flags = DM9000_PLATF_8BITONLY,
|
||||
- //.dev_addr = { }, /* possibility to provide an ethernet address for the chip */
|
||||
};
|
||||
|
||||
static struct resource dm9000_resources[] = {
|
||||
- MEM_RES("dm9000_io", DM9000_IO, DM9000_IO),
|
||||
- MEM_RES("dm9000_data", DM9000_DATA, DM9000_DATA),
|
||||
+ MEM_RES("dm9000_io", DM9000_IO, 1),
|
||||
+ MEM_RES("dm9000_data", DM9000_DATA, 1),
|
||||
[2] = {
|
||||
/* with irq (210 -> gpio 110) the driver is very unreliable */
|
||||
.start = -1, /* use polling */
|
||||
@@ -214,8 +223,8 @@ easy98000_init_common(void)
|
||||
falcon_register_i2c();
|
||||
platform_device_register(&easy98000_i2c_gpio_device);
|
||||
register_davicom();
|
||||
- ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98000_leds_gpio),
|
||||
- easy98000_leds_gpio);
|
||||
+ ltq_add_device_gpio_leds(-1, ARRAY_SIZE(easy98000_gpio_leds),
|
||||
+ easy98000_gpio_leds);
|
||||
register_easy98000_cpld();
|
||||
easy98000_spi_gpio_init();
|
||||
}
|
15
target/linux/lantiq/patches-3.3/209-fritz_ram.patch
Normal file
15
target/linux/lantiq/patches-3.3/209-fritz_ram.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- a/arch/mips/lantiq/setup.c
|
||||
+++ b/arch/mips/lantiq/setup.c
|
||||
@@ -40,6 +40,12 @@ void __init plat_mem_setup(void)
|
||||
e += 8;
|
||||
if (strict_strtoul(e, 0, &memsize))
|
||||
pr_warn("bad memsize specified\n");
|
||||
+ } else if (!strcmp(e, "memsize")) {
|
||||
+ envp++;
|
||||
+ e = (char *)KSEG1ADDR(*envp);
|
||||
+ if (strict_strtoul(e, 0, &memsize))
|
||||
+ pr_warn("bad memsize specified\n");
|
||||
+ memsize /= 1024 * 1024;
|
||||
}
|
||||
if (!strncmp(e, "BRN-BOOT", 8)){
|
||||
pr_info("Found BRN-BOOT instead of u-boot\n");
|
Loading…
Reference in New Issue
Block a user