From f5cecc48752cf187c541f2b9a36e9524f4770d1b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 10 Oct 2012 11:43:50 +0000 Subject: [PATCH] ixp4xx, cns3xx: backport the latest round of fixes (as of r33684) SVN-Revision: 33685 --- package/ixp4xx-microcode/Makefile | 1 + package/ixp4xx-microcode/src/IxNpeMicrocode.h | 8 ++++-- package/kernel/modules/sound.mk | 19 ++++++++++++++ .../patches-3.3/300-laguna_support.patch | 25 ++++++++++++++++++- .../478-mtd-partial_eraseblock_unlock.patch | 18 +++++++++++++ target/linux/ixp4xx/config-3.3 | 1 + 6 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 target/linux/generic/patches-3.3/478-mtd-partial_eraseblock_unlock.patch diff --git a/package/ixp4xx-microcode/Makefile b/package/ixp4xx-microcode/Makefile index 9ed912758b..52b44f35f9 100644 --- a/package/ixp4xx-microcode/Makefile +++ b/package/ixp4xx-microcode/Makefile @@ -48,6 +48,7 @@ define Package/ixp4xx-microcode/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DIR) $(1)/usr/share/doc $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A-HSS $(1)/lib/firmware/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(1)/lib/firmware/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(1)/lib/firmware/ $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE.IPL $(1)/usr/share/doc/ diff --git a/package/ixp4xx-microcode/src/IxNpeMicrocode.h b/package/ixp4xx-microcode/src/IxNpeMicrocode.h index ffb22b2009..4a843db104 100644 --- a/package/ixp4xx-microcode/src/IxNpeMicrocode.h +++ b/package/ixp4xx-microcode/src/IxNpeMicrocode.h @@ -27,7 +27,7 @@ #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV // #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS // #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL -// #define IX_NPEDL_NPEIMAGE_NPEA_HSS_2_PORT +#define IX_NPEDL_NPEIMAGE_NPEA_HSS_2_PORT // #define IX_NPEDL_NPEIMAGE_NPEA_DMA // #define IX_NPEDL_NPEIMAGE_NPEA_ATM_MPHY_12_PORT // #define IX_NPEDL_NPEIMAGE_NPEA_HSS0_ATM_MPHY_1_PORT @@ -118,7 +118,11 @@ int main(int argc, char *argv[]) sprintf(filename, "NPE-%c.%08x", (field[0] & 0xf) + 'A', image->id); - sprintf(slnk, "NPE-%c", (field[0] & 0xf) + 'A'); + if (image->id == 0x00090000) + sprintf(slnk, "NPE-%c-HSS", (field[0] & 0xf) + 'A'); + else + sprintf(slnk, "NPE-%c", (field[0] & 0xf) + 'A'); + printf("Writing image: %s.NPE_%c Func: %2x Rev: %02x.%02x " "Size: %5d to: '%s'\n", names[field[0] >> 4], (field[0] & 0xf) + 'A', diff --git a/package/kernel/modules/sound.mk b/package/kernel/modules/sound.mk index f054d870cb..4ccdc8b806 100644 --- a/package/kernel/modules/sound.mk +++ b/package/kernel/modules/sound.mk @@ -182,3 +182,22 @@ define KernelPackage/sound-soc-ac97 endef $(eval $(call KernelPackage,sound-soc-ac97)) + + +define KernelPackage/sound-soc-gw_avila + TITLE:=Gateworks Avila SoC sound support + KCONFIG:= \ + CONFIG_SND_GW_AVILA_SOC \ + CONFIG_SND_GW_AVILA_SOC_PCM \ + CONFIG_SND_GW_AVILA_SOC_HSS + FILES:= \ + $(LINUX_DIR)/sound/soc/codecs/snd-soc-tlv320aic3x.ko \ + $(LINUX_DIR)/sound/soc/gw-avila/snd-soc-gw-avila.ko \ + $(LINUX_DIR)/sound/soc/gw-avila/snd-soc-gw-avila-pcm.ko \ + $(LINUX_DIR)/sound/soc/gw-avila/snd-soc-gw-avila-hss.ko + AUTOLOAD:=$(call AutoLoad,65,snd-soc-tlv320aic3x snd-soc-gw-avila snd-soc-gw-avila-pcm snd-soc-gw-avila-hss) + DEPENDS:=@TARGET_ixp4xx +kmod-sound-soc-core + $(call AddDepends/sound) +endef + +$(eval $(call KernelPackage,sound-soc-gw_avila)) 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 7fe970a4dd..b42606b508 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 0000000000..de4481a93a --- /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 3d90775c56..54a0ebbb4c 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 -- 2.30.2