summaryrefslogtreecommitdiff
path: root/target/linux/rb532/patches-2.6.30
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-04 14:35:30 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-04 14:35:30 +0000
commit18d905d52ddd7be753fca9246685bb8522edad47 (patch)
tree1efa92b18b8f39c00b0cfb9e591e62b77ae52c2d /target/linux/rb532/patches-2.6.30
parentcea4b5f1bcdcc8189cc0200b7d2f12a605a20150 (diff)
[rb532] add support for 2.6.32
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19520 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/rb532/patches-2.6.30')
-rw-r--r--target/linux/rb532/patches-2.6.30/001-cmdline_hack.patch20
-rw-r--r--target/linux/rb532/patches-2.6.30/002-rb532_nand_fixup.patch48
-rw-r--r--target/linux/rb532/patches-2.6.30/100-check_media.patch51
3 files changed, 119 insertions, 0 deletions
diff --git a/target/linux/rb532/patches-2.6.30/001-cmdline_hack.patch b/target/linux/rb532/patches-2.6.30/001-cmdline_hack.patch
new file mode 100644
index 0000000000..246e502b77
--- /dev/null
+++ b/target/linux/rb532/patches-2.6.30/001-cmdline_hack.patch
@@ -0,0 +1,20 @@
+--- a/arch/mips/rb532/prom.c
++++ b/arch/mips/rb532/prom.c
+@@ -67,6 +67,7 @@ static inline unsigned long tag2ul(char
+ return simple_strtoul(num, 0, 10);
+ }
+
++extern char __image_cmdline[];
+ void __init prom_setup_cmdline(void)
+ {
+ char cmd_line[CL_SIZE];
+@@ -109,6 +110,9 @@ void __init prom_setup_cmdline(void)
+ }
+ *(cp++) = ' ';
+
++ strcpy(cp,(__image_cmdline));
++ cp += strlen(__image_cmdline);
++
+ i = strlen(arcs_cmdline);
+ if (i > 0) {
+ *(cp++) = ' ';
diff --git a/target/linux/rb532/patches-2.6.30/002-rb532_nand_fixup.patch b/target/linux/rb532/patches-2.6.30/002-rb532_nand_fixup.patch
new file mode 100644
index 0000000000..82c191295f
--- /dev/null
+++ b/target/linux/rb532/patches-2.6.30/002-rb532_nand_fixup.patch
@@ -0,0 +1,48 @@
+--- a/arch/mips/rb532/devices.c
++++ b/arch/mips/rb532/devices.c
+@@ -140,6 +140,19 @@ static struct platform_device cf_slot0 =
+ };
+
+ /* Resources and device for NAND */
++
++/*
++ * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
++ * will not be able to find the kernel that we load. So set the oobinfo
++ * when creating the partitions
++ */
++static struct nand_ecclayout rb532_nand_ecclayout = {
++ .eccbytes = 6,
++ .eccpos = { 8, 9, 10, 13, 14, 15 },
++ .oobavail = 9,
++ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
++};
++
+ static int rb532_dev_ready(struct mtd_info *mtd)
+ {
+ return gpio_get_value(GPIO_RDY);
+@@ -281,6 +294,16 @@ static void __init parse_mac_addr(char *
+ /* NAND definitions */
+ #define NAND_CHIP_DELAY 25
+
++static int rb532_nand_fixup(struct mtd_info *mtd)
++{
++ struct nand_chip *chip = mtd->priv;
++
++ if (mtd->writesize == 512)
++ chip->ecc.layout = &rb532_nand_ecclayout;
++
++ return 0;
++}
++
+ static void __init rb532_nand_setup(void)
+ {
+ switch (mips_machtype) {
+@@ -300,6 +323,8 @@ static void __init rb532_nand_setup(void
+ rb532_nand_data.chip.partitions = rb532_partition_info;
+ rb532_nand_data.chip.chip_delay = NAND_CHIP_DELAY;
+ rb532_nand_data.chip.options = NAND_NO_AUTOINCR;
++
++ rb532_nand_data.chip.chip_fixup = &rb532_nand_fixup;
+ }
+
+
diff --git a/target/linux/rb532/patches-2.6.30/100-check_media.patch b/target/linux/rb532/patches-2.6.30/100-check_media.patch
new file mode 100644
index 0000000000..66e731dac1
--- /dev/null
+++ b/target/linux/rb532/patches-2.6.30/100-check_media.patch
@@ -0,0 +1,51 @@
+--- a/drivers/net/korina.c
++++ b/drivers/net/korina.c
+@@ -133,6 +133,7 @@ struct korina_private {
+ int dma_halt_cnt;
+ int dma_run_cnt;
+ struct napi_struct napi;
++ struct timer_list media_check_timer;
+ struct mii_if_info mii_if;
+ struct net_device *dev;
+ int phy_addr;
+@@ -664,6 +665,15 @@ static void korina_check_media(struct ne
+ &lp->eth_regs->ethmac2);
+ }
+
++static void korina_poll_media(unsigned long data)
++{
++ struct net_device *dev = (struct net_device *) data;
++ struct korina_private *lp = netdev_priv(dev);
++
++ korina_check_media(dev, 0);
++ mod_timer(&lp->media_check_timer, jiffies + HZ);
++}
++
+ static void korina_set_carrier(struct mii_if_info *mii)
+ {
+ if (mii->force_media) {
+@@ -1034,6 +1044,7 @@ static int korina_open(struct net_device
+ dev->name, lp->und_irq);
+ goto err_free_ovr_irq;
+ }
++ mod_timer(&lp->media_check_timer, jiffies + 1);
+ out:
+ return ret;
+
+@@ -1053,6 +1064,8 @@ static int korina_close(struct net_devic
+ struct korina_private *lp = netdev_priv(dev);
+ u32 tmp;
+
++ del_timer(&lp->media_check_timer);
++
+ /* Disable interrupts */
+ disable_irq(lp->rx_irq);
+ disable_irq(lp->tx_irq);
+@@ -1176,6 +1189,7 @@ static int korina_probe(struct platform_
+ ": cannot register net device %d\n", rc);
+ goto probe_err_register;
+ }
++ setup_timer(&lp->media_check_timer, korina_poll_media, (unsigned long) dev);
+ out:
+ return rc;
+