From 3caf621121b5bafc61251cf659e15492e61897a7 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 10 Oct 2012 11:43:50 +0000 Subject: ixp4xx, cns3xx: backport the latest round of fixes (as of r33684) git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33685 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../cns3xxx/patches-3.3/300-laguna_support.patch | 25 +++++++++++++++++++++- .../478-mtd-partial_eraseblock_unlock.patch | 18 ++++++++++++++++ target/linux/ixp4xx/config-3.3 | 1 + 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 target/linux/generic/patches-3.3/478-mtd-partial_eraseblock_unlock.patch (limited to 'target/linux') diff --git a/target/linux/cns3xxx/patches-3.3/300-laguna_support.patch b/target/linux/cns3xxx/patches-3.3/300-laguna_support.patch index 7fe970a4d..b42606b50 100644 --- a/target/linux/cns3xxx/patches-3.3/300-laguna_support.patch +++ b/target/linux/cns3xxx/patches-3.3/300-laguna_support.patch @@ -563,7 +563,7 @@ + +static struct resource laguna_watchdog_resources[] = { + [0] = { -+ .start = CNS3XXX_TC11MP_TWD_BASE, ++ .start = CNS3XXX_TC11MP_TWD_BASE + 0x100, // CPU0 watchdog + .end = CNS3XXX_TC11MP_TWD_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, @@ -963,3 +963,26 @@ obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o +--- a/arch/arm/mach-cns3xxx/devices.c ++++ b/arch/arm/mach-cns3xxx/devices.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include "core.h" + #include "devices.h" + +@@ -102,7 +103,11 @@ void __init cns3xxx_sdhci_init(void) + u32 gpioa_pins = __raw_readl(gpioa); + + /* MMC/SD pins share with GPIOA */ +- gpioa_pins |= 0x1fff0004; ++ if (machine_is_gw2388()) { ++ gpioa_pins |= 0x1fff0000; ++ } else { ++ gpioa_pins |= 0x1fff0004; ++ } + __raw_writel(gpioa_pins, gpioa); + + cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO)); diff --git a/target/linux/generic/patches-3.3/478-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/patches-3.3/478-mtd-partial_eraseblock_unlock.patch new file mode 100644 index 000000000..de4481a93 --- /dev/null +++ b/target/linux/generic/patches-3.3/478-mtd-partial_eraseblock_unlock.patch @@ -0,0 +1,18 @@ +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -356,7 +356,14 @@ static int part_unlock(struct mtd_info * + struct mtd_part *part = PART(mtd); + if ((len + ofs) > mtd->size) + return -EINVAL; +- return mtd_unlock(part->master, ofs + part->offset, len); ++ ++ ofs += part->offset; ++ if (mtd->flags & MTD_ERASE_PARTIAL) { ++ /* round up len to next erasesize and round down offset to prev block */ ++ len = (mtd_div_by_eb(len, part->master) + 1) * part->master->erasesize; ++ ofs &= ~(part->master->erasesize - 1); ++ } ++ return mtd_unlock(part->master, ofs, len); + } + + static int part_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) diff --git a/target/linux/ixp4xx/config-3.3 b/target/linux/ixp4xx/config-3.3 index 3d90775c5..54a0ebbb4 100644 --- a/target/linux/ixp4xx/config-3.3 +++ b/target/linux/ixp4xx/config-3.3 @@ -24,6 +24,7 @@ CONFIG_ARM_PATCH_PHYS_VIRT=y CONFIG_BCMA_POSSIBLE=y CONFIG_BOUNCE=y # CONFIG_CACHE_L2X0 is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CLKSRC_MMIO=y CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200" CONFIG_CMDLINE_FROM_BOOTLOADER=y -- cgit v1.2.3