From 0f36a13e5c4170b01d9dcb56c418a27151d163ba Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 17 Mar 2010 16:03:08 +0000 Subject: [PATCH 01/64] sdk: fix up paths for $(ARCH_SUFFIX) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20254 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/sdk/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sdk/Makefile b/target/sdk/Makefile index e171d831d..0d4bfcd6e 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -29,7 +29,7 @@ all: compile $(BIN_DIR)/$(SDK_NAME).tar.bz2: clean mkdir -p $(SDK_BUILD_DIR)/dl $(SDK_BUILD_DIR)/package $(CP) $(INCLUDE_DIR) $(SCRIPT_DIR) $(TOPDIR)/docs $(SDK_BUILD_DIR)/ - $(TAR) -cf - -C $(TOPDIR) $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") --exclude="staging_dir/$(ARCH)" staging_dir/host staging_dir/target-$(ARCH)_$(LIBC)-$(LIBCV) staging_dir/toolchain-$(ARCH)_gcc-$(GCCV)_$(LIBC)-$(LIBCV) | \ + $(TAR) -cf - -C $(TOPDIR) $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") --exclude="staging_dir/$(ARCH)" staging_dir/host staging_dir/target-$(ARCH)$(ARCH_SUFFIX)_$(LIBC)-$(LIBCV) staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV) | \ $(TAR) -xf - -C $(SDK_BUILD_DIR) mkdir -p $(SDK_BUILD_DIR)/target/linux $(CP) $(GENERIC_PLATFORM_DIR) $(PLATFORM_DIR) $(SDK_BUILD_DIR)/target/linux/ From d8be9cda891ffc54c6f8aef69b54c34ea79c20e2 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 17 Mar 2010 20:21:49 +0000 Subject: [PATCH 02/64] [kernel] add missing configuration symbols git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20255 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/generic-2.6/config-2.6.32 | 1 + target/linux/generic-2.6/config-2.6.33 | 1 + target/linux/generic-2.6/config-2.6.34 | 1 + 3 files changed, 3 insertions(+) diff --git a/target/linux/generic-2.6/config-2.6.32 b/target/linux/generic-2.6/config-2.6.32 index 0a7d109b7..5dff3ffed 100644 --- a/target/linux/generic-2.6/config-2.6.32 +++ b/target/linux/generic-2.6/config-2.6.32 @@ -1736,6 +1736,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_PRINTK=y # CONFIG_PRISM2_USB is not set # CONFIG_PRISM54 is not set +# CONFIG_PROBE_INITRD_HEADER is not set CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_PROC_PAGE_MONITOR is not set diff --git a/target/linux/generic-2.6/config-2.6.33 b/target/linux/generic-2.6/config-2.6.33 index c8e1e91b7..82c3e3258 100644 --- a/target/linux/generic-2.6/config-2.6.33 +++ b/target/linux/generic-2.6/config-2.6.33 @@ -1755,6 +1755,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_PRINTK=y # CONFIG_PRISM2_USB is not set # CONFIG_PRISM54 is not set +# CONFIG_PROBE_INITRD_HEADER is not set CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_PROC_PAGE_MONITOR is not set diff --git a/target/linux/generic-2.6/config-2.6.34 b/target/linux/generic-2.6/config-2.6.34 index c686c4814..b985bc5f3 100644 --- a/target/linux/generic-2.6/config-2.6.34 +++ b/target/linux/generic-2.6/config-2.6.34 @@ -1755,6 +1755,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_PRINTK=y # CONFIG_PRISM2_USB is not set # CONFIG_PRISM54 is not set +# CONFIG_PROBE_INITRD_HEADER is not set CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_PROC_PAGE_MONITOR is not set From 6dcce3b481dfb5e86a9324d69d4238a8b5a8c49a Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 17 Mar 2010 20:21:53 +0000 Subject: [PATCH 03/64] [malta] include wpad-mini and mac80211_hwsim by default git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20256 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/malta/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile index 69fae6aa5..17b1790e8 100644 --- a/target/linux/malta/Makefile +++ b/target/linux/malta/Makefile @@ -16,6 +16,8 @@ LINUX_VERSION:=2.6.32.8 include $(INCLUDE_DIR)/target.mk +DEFAULT_PACKAGES += wpad-mini kmod-mac80211-hwsim + define Target/Description Build firmware images for MTI Malta CoreLV boards. endef From 3243b6b119e16268bfb619ad6e5d0e497aecb7a9 Mon Sep 17 00:00:00 2001 From: thepeople Date: Thu, 18 Mar 2010 01:39:02 +0000 Subject: [PATCH 04/64] remove +1 as it isn't needed since 16619 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20259 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/dnsmasq/files/dnsmasq.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init index d796f2269..3509d9473 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -263,7 +263,7 @@ dhcp_add() { leasetime="${leasetime:-12h}" start="$(dhcp_calc "${start:-100}")" - limit="$((${limit:-150} + 1))" + limit="$(${limit:-150})" eval "$(ipcalc.sh $ipaddr $netmask $start $limit)" if [ "$dynamicdhcp" = "0" ]; then END="static"; fi append args "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}" From 10548008244fa1a7b13c623ec18c5e73a83dc83a Mon Sep 17 00:00:00 2001 From: thepeople Date: Thu, 18 Mar 2010 03:46:41 +0000 Subject: [PATCH 05/64] allow ping git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20261 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/firewall/files/firewall.config | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/firewall/files/firewall.config b/package/firewall/files/firewall.config index 50a92f71e..b4aa4595d 100644 --- a/package/firewall/files/firewall.config +++ b/package/firewall/files/firewall.config @@ -30,6 +30,13 @@ config rule option dest_port 68 option target ACCEPT +#Allow ping +config rule + option src wan + option proto icmp + option icmp_type echo-request + option target ACCEPT + # include a file with users custom iptables rules config include option path /etc/firewall.user From 907087e56e1bb5f276e245e858e787447b44e96c Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 09:20:43 +0000 Subject: [PATCH 06/64] [ifxmips] Calculate PCI BARMASK11 register value dynamicly, signed off by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20262 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c b/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c index e50cb3bdc..64f37d556 100644 --- a/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c +++ b/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c @@ -89,6 +89,17 @@ pcibios_plat_dev_init(struct pci_dev *dev) return 0; } +static u32 calc_bar11mask(void) +{ + u32 mem, bar11mask; + + /* BAR11MASK value depends on available memory on system. */ + mem = num_physpages * PAGE_SIZE; + bar11mask = (0x0ffffff0 & ~((1 << (fls(mem) -1)) -1)) | 8; + + return bar11mask; +} + static void __init ifxmips_pci_startup(void) { @@ -138,7 +149,7 @@ ifxmips_pci_startup(void) ifxmips_w32(0x19800000, PCI_CR_FCI_ADDR_MAP6); ifxmips_w32(0x19c00000, PCI_CR_FCI_ADDR_MAP7); ifxmips_w32(0x1ae00000, PCI_CR_FCI_ADDR_MAP11hg); - ifxmips_w32(0x0e000008, PCI_CR_BAR11MASK); + ifxmips_w32(calc_bar11mask(), PCI_CR_BAR11MASK); ifxmips_w32(0, PCI_CR_PCI_ADDR_MAP11); ifxmips_w32(0, PCI_CS_BASE_ADDR1); #ifdef CONFIG_SWAP_IO_SPACE From 49c88191580513a8ae0e3c7e0ddcbc877ccd78c6 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 18 Mar 2010 10:45:14 +0000 Subject: [PATCH 07/64] [package] madwifi: remove redundant conditional dep, atheros has PCI support git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20263 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/madwifi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/madwifi/Makefile b/package/madwifi/Makefile index 3bd60f17d..4c8415a6b 100644 --- a/package/madwifi/Makefile +++ b/package/madwifi/Makefile @@ -162,7 +162,7 @@ define KernelPackage/madwifi TITLE:=Driver for Atheros wireless chipsets URL:=http://madwifi-project.org/ MAINTAINER:=Felix Fietkau - DEPENDS:=+wireless-tools @LINUX_2_6 @PCI_SUPPORT||TARGET_atheros @(!(TARGET_avr32||TARGET_cobalt||TARGET_ep93xx||TARGET_etrax||TARGET_octeon||TARGET_pxcab||TARGET_sibyte)||BROKEN) + DEPENDS:=+wireless-tools @LINUX_2_6 @PCI_SUPPORT @(!(TARGET_avr32||TARGET_cobalt||TARGET_ep93xx||TARGET_etrax||TARGET_octeon||TARGET_pxcab||TARGET_sibyte)||BROKEN) FILES:=$(MADWIFI_FILES) AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD)) endef From 044148567bf569ece113605dabad577a32f70914 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 10:56:00 +0000 Subject: [PATCH 08/64] [ifxmips] Make it possible for boards to disable PCI REQ signals in the PCI controller, signed off by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20264 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ifxmips/files/arch/mips/ifxmips/board.c | 4 ++++ target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c index 7d77e9ce6..6a17f60bd 100644 --- a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c +++ b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c @@ -55,6 +55,7 @@ enum { }; extern int ifxmips_pci_external_clock; +extern int ifxmips_pci_req_mask; static unsigned int chiprev; static int cmdline_mac; @@ -70,6 +71,7 @@ struct ifxmips_board { struct gpio_led *ifxmips_leds; struct gpio_led *gpio_leds; int pci_external_clock; + int pci_req_mask; int num_devs; }; @@ -392,6 +394,8 @@ int __init ifxmips_init_devices(void) ifxmips_gpio_dev.resource = &board->gpiodev_resource; if (board->pci_external_clock) ifxmips_pci_external_clock = 1; + if (board->pci_req_mask) + ifxmips_pci_req_mask = board->pci_req_mask; printk(KERN_INFO "using board definition %s\n", board->name); return platform_add_devices(board->devs, board->num_devs); } diff --git a/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c b/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c index 64f37d556..6ff765e85 100644 --- a/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c +++ b/target/linux/ifxmips/files/arch/mips/pci/pci-ifxmips.c @@ -54,6 +54,10 @@ static struct pci_controller ifxmips_pci_controller = u32 ifxmips_pci_mapped_cfg; int ifxmips_pci_external_clock = 0; +/* Since the PCI REQ pins can be reused for other functionality, make it possible + to exclude those from interpretation by the PCI controller */ +int ifxmips_pci_req_mask = 0xf; + static int __init ifxmips_pci_set_external_clk(char *str) { @@ -126,7 +130,7 @@ ifxmips_pci_startup(void) /* enable external 2 PCI masters */ temp_buffer = ifxmips_r32(PCI_CR_PC_ARB); - temp_buffer &= (~(0xf << 16)); + temp_buffer &= (~(ifxmips_pci_req_mask << 16)); /* enable internal arbiter */ temp_buffer |= (1 << INTERNAL_ARB_ENABLE_BIT); /* enable internal PCI master reqest */ From 80d12ff0fec120c0bb8daffe3ebc25d7d287e455 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 10:56:28 +0000 Subject: [PATCH 09/64] [ifxmips] we have a maximum of 32 gpios git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20265 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ifxmips/files/arch/mips/include/asm/mach-ifxmips/gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/gpio.h b/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/gpio.h index 6f05e38ea..4176bfd80 100644 --- a/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/gpio.h +++ b/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/gpio.h @@ -99,7 +99,7 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) static inline int gpio_is_valid(int number) { - return ((unsigned)number) < 16; + return ((unsigned)number) < 32; } #endif From a072224e495d8af791e4558223e756c248286f76 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 11:17:42 +0000 Subject: [PATCH 10/64] [br2684ctl] Allow UCI configuration of ATM QOS parameters per interface, signed off by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20266 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/br2684ctl/files/br2684ctl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/br2684ctl/files/br2684ctl b/package/br2684ctl/files/br2684ctl index 739baabdd..cff667014 100755 --- a/package/br2684ctl/files/br2684ctl +++ b/package/br2684ctl/files/br2684ctl @@ -15,6 +15,7 @@ start_daemon() { config_get vci "$cfg" vci config_get encaps "$cfg" encaps config_get payload "$cfg" payload + config_get qos "$cfg" qos case "$encaps" in 1|vc) encaps=1;; *) encaps=0;; @@ -23,7 +24,8 @@ start_daemon() { 0|routed) payload=0;; *) payload=1;; esac - br2684ctl -b -c "$unit" -e "$encaps" -p "$payload" -a "${atmdev:+$atmdev.}${vpi:-8}.${vci:-35}" + [ "$qos" ] && qos="-q $qos" + br2684ctl -b -c "$unit" -e "$encaps" -p "$payload" $qos -a "${atmdev:+$atmdev.}${vpi:-8}.${vci:-35}" } start() { From 483038127e16b848fe9ccc7e11831ee81d7aef21 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 11:20:35 +0000 Subject: [PATCH 11/64] [ifxmips] Also build jffs2 images with 128k eraseblock size, signed off by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20267 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ifxmips/image/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/linux/ifxmips/image/Makefile b/target/linux/ifxmips/image/Makefile index 15e0bc5dc..ac887c4e4 100644 --- a/target/linux/ifxmips/image/Makefile +++ b/target/linux/ifxmips/image/Makefile @@ -27,6 +27,11 @@ define Image/Build/jffs2-64k cat $(KDIR)/uImage.$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/openwrt-$(BOARD)-$(1).image endef +define Image/Build/jffs2-128k + dd if=$(KDIR)/uImage of=$(KDIR)/uImage.$(1) bs=128k conv=sync + cat $(KDIR)/uImage.$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/openwrt-$(BOARD)-$(1).image +endef + define Image/Build $(call Image/Build/$(1),$(1)) endef From 76d5263125179621e8c7b816d58159f2b4e6c1e9 Mon Sep 17 00:00:00 2001 From: markus Date: Thu, 18 Mar 2010 12:20:36 +0000 Subject: [PATCH 12/64] added feature "pcmcia" git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20268 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/brcm47xx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/brcm47xx/Makefile b/target/linux/brcm47xx/Makefile index 66663035a..0d59b363e 100644 --- a/target/linux/brcm47xx/Makefile +++ b/target/linux/brcm47xx/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk ARCH:=mipsel BOARD:=brcm47xx BOARDNAME:=Broadcom BCM947xx/953xx -FEATURES:=squashfs usb +FEATURES:=squashfs usb pcmcia LINUX_VERSION:=2.6.32.9 From b9806dcf4166089f995765f41c7771ac487d784e Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 13:01:32 +0000 Subject: [PATCH 13/64] adds misisng include in ifxmips dsl driver compat layer git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20269 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches/200-mei_compat.patch | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/package/ifxmips-dsl-api/patches/200-mei_compat.patch b/package/ifxmips-dsl-api/patches/200-mei_compat.patch index ae2d59350..58a1081cc 100644 --- a/package/ifxmips-dsl-api/patches/200-mei_compat.patch +++ b/package/ifxmips-dsl-api/patches/200-mei_compat.patch @@ -1,12 +1,13 @@ Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c =================================================================== --- drv_dsl_cpe_api-3.24.4.4.orig/src/mei/ifxmips_mei.c 2009-10-31 23:30:20.000000000 +0100 -+++ drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c 2009-11-01 04:41:58.000000000 +0100 -@@ -41,18 +41,19 @@ ++++ drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c 2010-01-24 14:21:32.000000000 +0100 +@@ -41,18 +41,20 @@ #include #include #include +#include ++#include #include #include -#include @@ -29,7 +30,7 @@ Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c #define IFXMIPS_RCU_RST_REQ_ARC_JTAG IFX_RCU_RST_REQ_ARC_JTAG #define IFXMIPS_RCU_RST_REQ_DFE IFX_RCU_RST_REQ_DFE #define IFXMIPS_RCU_RST_REQ_AFE IFX_RCU_RST_REQ_AFE -@@ -76,7 +77,7 @@ +@@ -76,7 +78,7 @@ #define ifxmips_r32(reg) __raw_readl(reg) #define ifxmips_w32(val, reg) __raw_writel(val, reg) #define ifxmips_w32_mask(clear, set, reg) ifxmips_w32((ifxmips_r32(reg) & ~clear) | set, reg) @@ -38,7 +39,7 @@ Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c #define IFX_MEI_EMSG(fmt, args...) printk(KERN_ERR "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) #define IFX_MEI_DMSG(fmt, args...) printk(KERN_INFO "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) -@@ -173,7 +174,8 @@ +@@ -173,7 +175,8 @@ extern void ifxmips_mask_and_ack_irq(unsigned int irq_nr); #define MEI_MASK_AND_ACK_IRQ ifxmips_mask_and_ack_irq @@ -48,7 +49,7 @@ Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c static struct file_operations bsp_mei_operations = { owner:THIS_MODULE, -@@ -2294,10 +2296,10 @@ +@@ -2294,10 +2297,10 @@ IFX_MEI_EMSG ("request_irq %d failed!\n", pDev->nIrq[IFX_DFEIR]); return -1; } @@ -61,7 +62,7 @@ Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c // IFX_MEI_DMSG("Device %d initialized. IER %#x\n", num, bsp_get_irq_ier(pDev->nIrq[IFX_DYING_GASP])); return 0; } -@@ -2922,6 +2924,7 @@ +@@ -2922,6 +2925,7 @@ IFX_MEI_ModuleInit (void) { int i = 0; @@ -69,7 +70,7 @@ Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c printk ("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision); -@@ -2935,14 +2938,15 @@ +@@ -2935,14 +2939,15 @@ IFX_MEI_InitProcFS (i); #endif } @@ -87,7 +88,7 @@ Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c return 0; } -@@ -2996,3 +3000,5 @@ +@@ -2996,3 +3001,5 @@ module_init (IFX_MEI_ModuleInit); module_exit (IFX_MEI_ModuleExit); From 1904ac098832d12ab50f968801bada360b5acdcf Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 13:02:29 +0000 Subject: [PATCH 14/64] [ifxmips-dsl-api] Add option to disable debug output of DSL drivers signed of by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20270 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/ifxmips-dsl-api/Config.in | 5 + package/ifxmips-dsl-api/Makefile | 9 +- .../patches/400-debug-output.patch | 287 ++++++++++++++++++ 3 files changed, 299 insertions(+), 2 deletions(-) create mode 100644 package/ifxmips-dsl-api/patches/400-debug-output.patch diff --git a/package/ifxmips-dsl-api/Config.in b/package/ifxmips-dsl-api/Config.in index a1c3cd4f0..277d96ebf 100644 --- a/package/ifxmips-dsl-api/Config.in +++ b/package/ifxmips-dsl-api/Config.in @@ -16,3 +16,8 @@ config IFXMIPS_ANNEX_B Annex-B endchoice + +config IFXMIPS_DSL_DEBUG + bool "ifxmips-dsl debugging" + help + Say Y, if you need ifxmips-dsl to display debug messages. diff --git a/package/ifxmips-dsl-api/Makefile b/package/ifxmips-dsl-api/Makefile index 992c241e1..fdb07214b 100644 --- a/package/ifxmips-dsl-api/Makefile +++ b/package/ifxmips-dsl-api/Makefile @@ -81,8 +81,6 @@ CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \ --with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \ --enable-danube \ --enable-add-drv-cflags="-DMODULE" \ - --enable-debug=yes \ - --enable-debug-prints=yes \ --disable-dsl-delt-static \ --disable-adsl-led \ --enable-dsl-ceoc \ @@ -103,6 +101,13 @@ CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \ EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0 +ifeq ($(CONFIG_IFXMIPS_DSL_DEBUG),y) +CONFIGURE_ARGS += \ + --enable-debug=yes \ + --enable-debug-prints=yes +EXTRA_CFLAGS += -DDEBUG +endif + define Build/Prepare $(PKG_UNPACK) $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/mei/ diff --git a/package/ifxmips-dsl-api/patches/400-debug-output.patch b/package/ifxmips-dsl-api/patches/400-debug-output.patch new file mode 100644 index 000000000..d3b05b1b2 --- /dev/null +++ b/package/ifxmips-dsl-api/patches/400-debug-output.patch @@ -0,0 +1,287 @@ +--- drv_dsl_cpe_api-3.24.4.4.orig/src/mei/ifxmips_mei.c 2010-03-14 02:59:49.000000000 +0100 ++++ drv_dsl_cpe_api-3.24.4.4/src/mei//ifxmips_mei.c 2010-03-14 03:02:13.000000000 +0100 +@@ -78,8 +78,8 @@ + #define ifxmips_w32(val, reg) __raw_writel(val, reg) + #define ifxmips_w32_mask(clear, set, reg) ifxmips_w32((ifxmips_r32(reg) & ~clear) | set, reg) + */ +-#define IFX_MEI_EMSG(fmt, args...) printk(KERN_ERR "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) +-#define IFX_MEI_DMSG(fmt, args...) printk(KERN_INFO "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) ++#define IFX_MEI_EMSG(fmt, args...) pr_err("[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) ++#define IFX_MEI_DMSG(fmt, args...) pr_debug("[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) + + #ifdef CONFIG_IFXMIPS_MEI_FW_LOOPBACK + //#define DFE_MEM_TEST +@@ -1300,7 +1300,7 @@ IFX_MEI_RunAdslModem (DSL_DEV_Device_t * + IFX_MEI_EMSG (">>> malloc fail for codeswap buff!!! <<<\n"); + return DSL_DEV_MEI_ERR_FAILURE; + } +- printk("allocate %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff); ++ IFX_MEI_DMSG("allocate %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff); + } + + DSL_DEV_PRIVATE(pDev)->img_hdr = +@@ -1475,7 +1475,7 @@ IFX_MEI_DFEMemoryFree (DSL_DEV_Device_t + } + + if(mei_arc_swap_buff != NULL){ +- printk("free %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff); ++ IFX_MEI_DMSG("free %dKB swap buff memory at: 0x%p\n", ksize(mei_arc_swap_buff)/1024, mei_arc_swap_buff); + kfree(mei_arc_swap_buff); + mei_arc_swap_buff=NULL; + } +@@ -1495,7 +1495,7 @@ IFX_MEI_DFEMemoryAlloc (DSL_DEV_Device_t + // DSL_DEV_PRIVATE(pDev)->adsl_mem_info; + int allocate_size = SDRAM_SEGMENT_SIZE; + +- printk(KERN_INFO "[%s %d]: image_size = %ld\n", __func__, __LINE__, size); ++ IFX_MEI_DMSG("image_size = %ld\n", size); + // Alloc Swap Pages + for (idx = 0; size > 0 && idx < MAX_BAR_REGISTERS; idx++) { + // skip bar15 for XDATA usage. +@@ -1595,7 +1595,7 @@ DSL_BSP_FWDownload (DSL_DEV_Device_t * p + ssize_t retval = -ENOMEM; + int idx = 0; + +- printk("\n%s\n", __func__); ++ IFX_MEI_DMSG("\n"); + + if (*loff == 0) { + if (size < sizeof (img_hdr_tmp)) { +@@ -1647,7 +1647,7 @@ DSL_BSP_FWDownload (DSL_DEV_Device_t * p + goto error; + } + adsl_mem_info[XDATA_REGISTER].type = FREE_RELOAD; +- printk(KERN_INFO "[%s %d] -> IFX_MEI_BarUpdate()\n", __func__, __LINE__); ++ IFX_MEI_DMSG("-> IFX_MEI_BarUpdate()\n"); + IFX_MEI_BarUpdate (pDev, (DSL_DEV_PRIVATE(pDev)->nBar)); + } + else if (DSL_DEV_PRIVATE(pDev)-> image_size == 0) { +@@ -1926,7 +1926,7 @@ static void + WriteMbox (u32 * mboxarray, u32 size) + { + IFX_MEI_DebugWrite (&dsl_devices[0], IMBOX_BASE, mboxarray, size); +- printk ("write to %X\n", IMBOX_BASE); ++ IFX_MEI_DMSG("write to %X\n", IMBOX_BASE); + IFX_MEI_LongWordWriteOffset (&dsl_devices[0], (u32) ME_ME2ARC_INT, MEI_TO_ARC_MSGAV); + } + +@@ -1935,7 +1935,7 @@ static void + ReadMbox (u32 * mboxarray, u32 size) + { + IFX_MEI_DebugRead (&dsl_devices[0], OMBOX_BASE, mboxarray, size); +- printk ("read from %X\n", OMBOX_BASE); ++ IFX_MEI_DMSG("read from %X\n", OMBOX_BASE); + } + + static void +@@ -1965,7 +1965,7 @@ arc_code_page_download (uint32_t arc_cod + { + int count; + +- printk ("try to download pages,size=%d\n", arc_code_length); ++ IFX_MEI_DMSG("try to download pages,size=%d\n", arc_code_length); + IFX_MEI_ControlModeSet (&dsl_devices[0], MEI_MASTER_MODE); + IFX_MEI_HaltArc (&dsl_devices[0]); + IFX_MEI_LongWordWriteOffset (&dsl_devices[0], (u32) ME_DX_AD, 0); +@@ -2004,21 +2004,21 @@ dfe_loopback_irq_handler (DSL_DEV_Device + memset (&rd_mbox[0], 0, 10 * 4); + ReadMbox (&rd_mbox[0], 6); + if (rd_mbox[0] == 0x0) { +- printk ("Get ARC_ACK\n"); ++ FX_MEI_DMSG("Get ARC_ACK\n"); + got_int = 1; + } + else if (rd_mbox[0] == 0x5) { +- printk ("Get ARC_BUSY\n"); ++ IFX_MEI_DMSG("Get ARC_BUSY\n"); + got_int = 2; + } + else if (rd_mbox[0] == 0x3) { +- printk ("Get ARC_EDONE\n"); ++ IFX_MEI_DMSG("Get ARC_EDONE\n"); + if (rd_mbox[1] == 0x0) { + got_int = 3; +- printk ("Get E_MEMTEST\n"); ++ IFX_MEI_DMSG("Get E_MEMTEST\n"); + if (rd_mbox[2] != 0x1) { + got_int = 4; +- printk ("Get Result %X\n", rd_mbox[2]); ++ IFX_MEI_DMSG("Get Result %X\n", rd_mbox[2]); + } + } + } +@@ -2036,21 +2036,21 @@ wait_mem_test_result (void) + uint32_t mbox[5]; + mbox[0] = 0; + +- printk ("Waiting Starting\n"); ++ IFX_MEI_DMSG("Waiting Starting\n"); + while (mbox[0] == 0) { + ReadMbox (&mbox[0], 5); + } +- printk ("Try to get mem test result.\n"); ++ IFX_MEI_DMSG("Try to get mem test result.\n"); + ReadMbox (&mbox[0], 5); + if (mbox[0] == 0xA) { +- printk ("Success.\n"); ++ IFX_MEI_DMSG("Success.\n"); + } + else if (mbox[0] == 0xA) { +- printk ("Fail,address %X,except data %X,receive data %X\n", ++ IFX_MEI_EMSG("Fail,address %X,except data %X,receive data %X\n", + mbox[1], mbox[2], mbox[3]); + } + else { +- printk ("Fail\n"); ++ IFX_MEI_EMSG("Fail\n"); + } + } + +@@ -2066,7 +2066,7 @@ arc_ping_testing (DSL_DEV_Device_t *pDev + rd_mbox[i] = 0; + } + +- printk ("send ping msg\n"); ++ FX_MEI_DMSG("send ping msg\n"); + wr_mbox[0] = MEI_PING; + WriteMbox (&wr_mbox[0], 10); + +@@ -2074,7 +2074,7 @@ arc_ping_testing (DSL_DEV_Device_t *pDev + MEI_WAIT (100); + } + +- printk ("send start event\n"); ++ IFX_MEI_DMSG("send start event\n"); + got_int = 0; + + wr_mbox[0] = 0x4; +@@ -2093,14 +2093,14 @@ arc_ping_testing (DSL_DEV_Device_t *pDev + IFX_MEI_LongWordWriteOffset (&dsl_devices[0], + (u32) ME_ME2ARC_INT, + MEI_TO_ARC_MSGAV); +- printk ("sleeping\n"); ++ IFX_MEI_DMSG("sleeping\n"); + while (1) { + if (got_int > 0) { + + if (got_int > 3) +- printk ("got_int >>>> 3\n"); ++ IFX_MEI_DMSG("got_int >>>> 3\n"); + else +- printk ("got int = %d\n", got_int); ++ IFX_MEI_DMSG("got int = %d\n", got_int); + got_int = 0; + //schedule(); + DSL_ENABLE_IRQ (pDev->nIrq[IFX_DFEIR]); +@@ -2151,7 +2151,7 @@ DFE_Loopback_Test (void) + DSL_DEV_PRIVATE(pDev)->adsl_mem_info[idx].type = FREE_RELOAD; + IFX_MEI_WRITE_REGISTER_L ((((uint32_t) DSL_DEV_PRIVATE(pDev)->adsl_mem_info[idx].address) & 0x0fffffff), + IFXMIPS_MEI_BASE_ADDR + ME_XMEM_BAR_BASE + idx * 4); +- printk ("bar%d(%X)=%X\n", idx, ++ IFX_MEI_DMSG("bar%d(%X)=%X\n", idx, + IFXMIPS_MEI_BASE_ADDR + ME_XMEM_BAR_BASE + + idx * 4, (((uint32_t) + ((ifx_mei_device_private_t *) +@@ -2168,20 +2168,20 @@ DFE_Loopback_Test (void) + return DSL_DEV_MEI_ERR_FAILURE; + } + //WriteARCreg(AUX_IC_CTRL,2); +- printk(KERN_INFO "[%s %s %d]: Setting MEI_MASTER_MODE..\n", __FILE__, __func__, __LINE__); ++ IFX_MEI_DMSG("Setting MEI_MASTER_MODE..\n"); + IFX_MEI_ControlModeSet (pDev, MEI_MASTER_MODE); + #define AUX_IC_CTRL 0x11 + _IFX_MEI_DBGLongWordWrite (pDev, MEI_DEBUG_DEC_AUX_MASK, + AUX_IC_CTRL, 2); +- printk(KERN_INFO "[%s %s %d]: Setting JTAG_MASTER_MODE..\n", __FILE__, __func__, __LINE__); ++ IFX_MEI_DMSG("Setting JTAG_MASTER_MODE..\n"); + IFX_MEI_ControlModeSet (pDev, JTAG_MASTER_MODE); + +- printk(KERN_INFO "[%s %s %d]: Halting ARC...\n", __FILE__, __func__, __LINE__); ++ IFX_MEI_DMSG("Halting ARC...\n"); + IFX_MEI_HaltArc (&dsl_devices[0]); + + #ifdef DFE_PING_TEST + +- printk ("ping test image size=%d\n", sizeof (arc_ahb_access_code)); ++ IFX_MEI_DMSG("ping test image size=%d\n", sizeof (arc_ahb_access_code)); + memcpy ((u8 *) (DSL_DEV_PRIVATE(pDev)-> + adsl_mem_info[0].address + 0x1004), + &arc_ahb_access_code[0], sizeof (arc_ahb_access_code)); +@@ -2189,13 +2189,13 @@ DFE_Loopback_Test (void) + + #endif //DFE_PING_TEST + +- printk ("ARC ping test code download complete\n"); ++ IFX_MEI_DMSG("ARC ping test code download complete\n"); + #endif //defined( DFE_PING_TEST )|| defined( DFE_ATM_LOOPBACK) + #ifdef DFE_MEM_TEST + IFX_MEI_LongWordWriteOffset (&dsl_devices[0], (u32) ME_ARC2ME_MASK, MSGAV_EN); + + arc_code_page_download (1537, &code_array[0]); +- printk ("ARC mem test code download complete\n"); ++ IFX_MEI_DMSG("ARC mem test code download complete\n"); + #endif //DFE_MEM_TEST + #ifdef DFE_ATM_LOOPBACK + arc_debug_data = 0xf; +@@ -2214,7 +2214,7 @@ DFE_Loopback_Test (void) + IFX_MEI_DebugWrite (&dsl_devices[0], 0x32010, &arc_debug_data, 1); + #endif //DFE_ATM_LOOPBACK + IFX_MEI_IRQEnable (pDev); +- printk(KERN_INFO "[%s %s %d]: run ARC...\n", __FILE__, __func__, __LINE__); ++ IFX_MEI_DMSG("run ARC...\n"); + IFX_MEI_RunArc (&dsl_devices[0]); + + #ifdef DFE_PING_TEST +@@ -2525,7 +2525,7 @@ IFX_MEI_Ioctls (DSL_DEV_Device_t * pDev, + break; + + case DSL_FIO_BSP_DSL_START: +- printk("\n%s: DSL_FIO_BSP_DSL_START\n",__func__); ++ IFX_MEI_DMSG("DSL_FIO_BSP_DSL_START\n"); + if ((meierr = IFX_MEI_RunAdslModem (pDev)) != DSL_DEV_MEI_ERR_SUCCESS) { + IFX_MEI_EMSG ("IFX_MEI_RunAdslModem() error..."); + meierr = DSL_DEV_MEI_ERR_FAILURE; +@@ -2926,11 +2926,11 @@ IFX_MEI_ModuleInit (void) + int i = 0; + static struct class *dsl_class; + +- printk ("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision); ++ pr_info("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision); + + for (i = 0; i < BSP_MAX_DEVICES; i++) { + if (IFX_MEI_InitDevice (i) != 0) { +- printk ("%s: Init device fail!\n", __FUNCTION__); ++ IFX_MEI_EMSG("Init device fail!\n"); + return -EIO; + } + IFX_MEI_InitDevNode (i); +@@ -2942,7 +2942,7 @@ IFX_MEI_ModuleInit (void) + dsl_bsp_event_callback[i].function = NULL; + + #ifdef CONFIG_IFXMIPS_MEI_FW_LOOPBACK +- printk(KERN_INFO "[%s %s %d]: Start loopback test...\n", __FILE__, __func__, __LINE__); ++ IFX_MEI_DMSG("Start loopback test...\n"); + DFE_Loopback_Test (); + #endif + dsl_class = class_create(THIS_MODULE, "ifx_mei"); +--- drv_dsl_cpe_api-3.24.4.4.orig/src/mei/ifxmips_atm_core.c 2010-03-13 16:42:49.000000000 +0100 ++++ drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_atm_core.c 2010-03-14 03:39:05.000000000 +0100 +@@ -2336,7 +2335,7 @@ static int atm_showtime_enter(struct por + IFX_REG_W32(0x0F, UTP_CFG); + #endif + +- printk("enter showtime, cell rate: 0 - %d, 1 - %d, xdata addr: 0x%08x\n", g_atm_priv_data.port[0].tx_max_cell_rate, g_atm_priv_data.port[1].tx_max_cell_rate, (unsigned int)g_xdata_addr); ++ pr_debug("enter showtime, cell rate: 0 - %d, 1 - %d, xdata addr: 0x%08x\n", g_atm_priv_data.port[0].tx_max_cell_rate, g_atm_priv_data.port[1].tx_max_cell_rate, (unsigned int)g_xdata_addr); + + return IFX_SUCCESS; + } +@@ -2352,7 +2351,7 @@ static int atm_showtime_exit(void) + // TODO: ReTX clean state + g_xdata_addr = NULL; + +- printk("leave showtime\n"); ++ pr_debug("leave showtime\n"); + + return IFX_SUCCESS; + } + From 2b070b217add4afdbc9e480526767cab6cbcbe93 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 13:53:22 +0000 Subject: [PATCH 15/64] [ifxmips] fixes board detection, signed off by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20271 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ifxmips/files/arch/mips/ifxmips/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c index 6a17f60bd..0f084a81b 100644 --- a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c +++ b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c @@ -337,9 +337,10 @@ struct ifxmips_board *ifxmips_find_board(void) int __init ifxmips_init_devices(void) { - struct ifxmips_board *board = ifxmips_find_board(); + struct ifxmips_board *board; chiprev = (ifxmips_r32(IFXMIPS_MPS_CHIPID) & 0x0FFFFFFF); + board = ifxmips_find_board(); ifxmips_brn = ifxmips_find_brn_block(); if (!cmdline_mac) From e241bb13613a6761fb1ea3eb676f9bc2669c341f Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 13:54:22 +0000 Subject: [PATCH 16/64] [ifxmips] make mtd handel 128k sectors properly, based on patch by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20272 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ifxmips/patches-2.6.30/140-mtd.patch | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/target/linux/ifxmips/patches-2.6.30/140-mtd.patch b/target/linux/ifxmips/patches-2.6.30/140-mtd.patch index 797a11cff..294d97335 100644 --- a/target/linux/ifxmips/patches-2.6.30/140-mtd.patch +++ b/target/linux/ifxmips/patches-2.6.30/140-mtd.patch @@ -1,17 +1,17 @@ -Index: linux-2.6.30.8/drivers/mtd/maps/Makefile +Index: linux-2.6.30.10/drivers/mtd/maps/Makefile =================================================================== ---- linux-2.6.30.8.orig/drivers/mtd/maps/Makefile 2009-09-24 17:28:02.000000000 +0200 -+++ linux-2.6.30.8/drivers/mtd/maps/Makefile 2009-10-19 21:31:32.000000000 +0200 +--- linux-2.6.30.10.orig/drivers/mtd/maps/Makefile 2010-03-18 14:27:04.000000000 +0100 ++++ linux-2.6.30.10/drivers/mtd/maps/Makefile 2010-03-18 14:27:07.000000000 +0100 @@ -62,3 +62,4 @@ obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o obj-$(CONFIG_MTD_VMU) += vmu-flash.o +obj-$(CONFIG_MTD_IFXMIPS) += ifxmips.o -Index: linux-2.6.30.8/drivers/mtd/maps/ifxmips.c +Index: linux-2.6.30.10/drivers/mtd/maps/ifxmips.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.30.8/drivers/mtd/maps/ifxmips.c 2009-10-19 21:40:44.000000000 +0200 -@@ -0,0 +1,277 @@ ++++ linux-2.6.30.10/drivers/mtd/maps/ifxmips.c 2010-03-18 14:27:17.000000000 +0100 +@@ -0,0 +1,281 @@ +/* + * 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 @@ -116,11 +116,11 @@ Index: linux-2.6.30.8/drivers/mtd/maps/ifxmips.c + { + .name = "uboot_env", + .offset = 0x00020000, -+ .size = 0x00010000, ++ .size = 0x0, + }, + { + .name = "kernel", -+ .offset = 0x00030000, ++ .offset = 0x0, + .size = 0x0, + }, + { @@ -222,6 +222,10 @@ Index: linux-2.6.30.8/drivers/mtd/maps/ifxmips.c + rootfs_part = i; + } + } else { ++ /* if the flash is 64k sectors, the kernel will reside at 0xb0030000 ++ if the flash is 128k sectors, the kernel will reside at 0xb0040000 */ ++ ifxmips_partitions[1].size = ifxmips_mtd->erasesize; ++ ifxmips_partitions[2].offset = ifxmips_partitions[1].offset + ifxmips_mtd->erasesize; + parts = &ifxmips_partitions[0]; + } + @@ -232,8 +236,8 @@ Index: linux-2.6.30.8/drivers/mtd/maps/ifxmips.c + if (detect_squashfs_partition(parts[kernel_part].offset + uimage_size)) { + printk(KERN_INFO "ifxmips_mtd: found a squashfs following the uImage\n"); + } else { -+ uimage_size &= ~0xffff; -+ uimage_size += 0x10000; ++ uimage_size &= ~(ifxmips_mtd->erasesize -1); ++ uimage_size += ifxmips_mtd->erasesize; + } + + parts[kernel_part].size = uimage_size; From f373d541984214287c9ec67732c9e5cc2ef3ebc1 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 18 Mar 2010 13:55:14 +0000 Subject: [PATCH 17/64] [ifxmips] Bugfix: do not call request_irq() with interrupts disabled, signed off by Ithamar R. Adema git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20273 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ifxmips/patches-2.6.30/120-serial.patch | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/target/linux/ifxmips/patches-2.6.30/120-serial.patch b/target/linux/ifxmips/patches-2.6.30/120-serial.patch index 8aa9dbbe4..1169378e4 100644 --- a/target/linux/ifxmips/patches-2.6.30/120-serial.patch +++ b/target/linux/ifxmips/patches-2.6.30/120-serial.patch @@ -1,7 +1,7 @@ -Index: linux-2.6.30.8/drivers/serial/Kconfig +Index: linux-2.6.30.10/drivers/serial/Kconfig =================================================================== ---- linux-2.6.30.8.orig/drivers/serial/Kconfig 2009-09-24 17:28:02.000000000 +0200 -+++ linux-2.6.30.8/drivers/serial/Kconfig 2009-10-19 21:31:32.000000000 +0200 +--- linux-2.6.30.10.orig/drivers/serial/Kconfig 2009-12-04 07:00:07.000000000 +0100 ++++ linux-2.6.30.10/drivers/serial/Kconfig 2010-03-18 12:24:20.000000000 +0100 @@ -1365,6 +1365,14 @@ help Support for Console on the NWP serial ports. @@ -17,20 +17,20 @@ Index: linux-2.6.30.8/drivers/serial/Kconfig config SERIAL_QE tristate "Freescale QUICC Engine serial port support" depends on QUICC_ENGINE -Index: linux-2.6.30.8/drivers/serial/Makefile +Index: linux-2.6.30.10/drivers/serial/Makefile =================================================================== ---- linux-2.6.30.8.orig/drivers/serial/Makefile 2009-09-24 17:28:02.000000000 +0200 -+++ linux-2.6.30.8/drivers/serial/Makefile 2009-10-19 21:31:32.000000000 +0200 +--- linux-2.6.30.10.orig/drivers/serial/Makefile 2009-12-04 07:00:07.000000000 +0100 ++++ linux-2.6.30.10/drivers/serial/Makefile 2010-03-18 12:24:20.000000000 +0100 @@ -77,3 +77,4 @@ obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o obj-$(CONFIG_SERIAL_QE) += ucc_uart.o +obj-$(CONFIG_SERIAL_IFXMIPS) += ifxmips_asc.o -Index: linux-2.6.30.8/drivers/serial/ifxmips_asc.c +Index: linux-2.6.30.10/drivers/serial/ifxmips_asc.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.30.8/drivers/serial/ifxmips_asc.c 2009-10-19 21:41:27.000000000 +0200 -@@ -0,0 +1,561 @@ ++++ linux-2.6.30.10/drivers/serial/ifxmips_asc.c 2010-03-18 14:04:58.000000000 +0100 +@@ -0,0 +1,555 @@ +/* + * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + * @@ -258,7 +258,6 @@ Index: linux-2.6.30.8/drivers/serial/ifxmips_asc.c + +static int ifxmipsasc_startup(struct uart_port *port) +{ -+ unsigned long flags; + int retval; + + port->uartclk = ifxmips_get_fpi_hz(); @@ -271,8 +270,6 @@ Index: linux-2.6.30.8/drivers/serial/ifxmips_asc.c + wmb(); + ifxmips_w32(ifxmips_r32(port->membase + IFXMIPS_ASC_CON) | ASCCON_M_8ASYNC | ASCCON_FEN | ASCCON_TOEN | ASCCON_ROEN, port->membase + IFXMIPS_ASC_CON); + -+ local_irq_save(flags); -+ + retval = request_irq(port->irq, ifxmipsasc_tx_int, IRQF_DISABLED, "asc_tx", port); + if (retval) { + printk(KERN_ERR "failed to request ifxmipsasc_tx_int\n"); @@ -292,15 +289,12 @@ Index: linux-2.6.30.8/drivers/serial/ifxmips_asc.c + } + + ifxmips_w32(ASC_IRNREN_RX_BUF | ASC_IRNREN_TX_BUF | ASC_IRNREN_ERR | ASC_IRNREN_TX, port->membase + IFXMIPS_ASC_IRNREN); -+ -+ local_irq_restore(flags); + return 0; + +err2: + free_irq(port->irq + 2, port); +err1: + free_irq(port->irq, port); -+ local_irq_restore(flags); + return retval; +} + From 427106969218dfcd76e1f4669089e94066a9b514 Mon Sep 17 00:00:00 2001 From: mirko Date: Thu, 18 Mar 2010 14:32:48 +0000 Subject: [PATCH 18/64] do not use font for target lb60 by default as it's unreadable git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20274 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/xburst/qi_lb60/config-2.6.32 | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/xburst/qi_lb60/config-2.6.32 b/target/linux/xburst/qi_lb60/config-2.6.32 index 427b92b6b..d052f128c 100644 --- a/target/linux/xburst/qi_lb60/config-2.6.32 +++ b/target/linux/xburst/qi_lb60/config-2.6.32 @@ -2,7 +2,6 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BATTERY_JZ4740=y CONFIG_CHARGER_GPIO=y CONFIG_FB_JZ4740=y -CONFIG_FONT_MINI_4x6=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_JZ4740_ADC=y CONFIG_JZ4740_QI_LB60=y From 78b9f1dc6f4fa478cf607ba04868e354af758f0b Mon Sep 17 00:00:00 2001 From: thepeople Date: Thu, 18 Mar 2010 15:50:05 +0000 Subject: [PATCH 19/64] fix limit git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20275 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/dnsmasq/files/dnsmasq.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init index 3509d9473..1b6dee426 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -263,7 +263,7 @@ dhcp_add() { leasetime="${leasetime:-12h}" start="$(dhcp_calc "${start:-100}")" - limit="$(${limit:-150})" + limit="${limit:-150}" eval "$(ipcalc.sh $ipaddr $netmask $start $limit)" if [ "$dynamicdhcp" = "0" ]; then END="static"; fi append args "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}" From 2dce9940125a9280f8706abc3a39927d6ac9decd Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:18:36 +0000 Subject: [PATCH 20/64] ar71xx: fix ar724x_pci_wr{,_nf} helpers git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20277 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h index e9e68f16d..1a1ec4ba1 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h @@ -363,6 +363,7 @@ static inline void ar724x_pci_wr(unsigned reg, u32 val) base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); __raw_writel(val, base + reg); + (void) __raw_readl(base + reg); iounmap(base); } @@ -371,6 +372,7 @@ static inline void ar724x_pci_wr_nf(unsigned reg, u32 val) void __iomem *base; base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); + __raw_writel(val, base + reg); iounmap(base); } From 4a8b61e3bef37970bf1f7be0cd8d0358b81e4a07 Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:18:41 +0000 Subject: [PATCH 21/64] ar71xx: remove unnecessary includes from setup.c git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20278 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ar71xx/files/arch/mips/ar71xx/setup.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c b/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c index 1d9feda67..10e45af73 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c @@ -13,7 +13,6 @@ #include #include -#include #include #include @@ -22,7 +21,6 @@ #include #include -#include #include "machtype.h" #include "devices.h" From c7a42847a528aafefb2bcef158f44bcf3e60eeed Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:18:46 +0000 Subject: [PATCH 22/64] ar71xx: merge AR71XX_IRQ_CPU_{PCI,WMAC} into AR71XX_IRQ_CPU_IP2 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20279 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/ar71xx/files/arch/mips/ar71xx/dev-ar913x-wmac.c | 4 ++-- target/linux/ar71xx/files/arch/mips/ar71xx/irq.c | 6 +++--- .../ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ar913x-wmac.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ar913x-wmac.c index 67eaa833b..024d29044 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ar913x-wmac.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ar913x-wmac.c @@ -31,8 +31,8 @@ static struct resource ar913x_wmac_resources[] = { .end = AR91XX_WMAC_BASE + AR91XX_WMAC_SIZE - 1, .flags = IORESOURCE_MEM, }, { - .start = AR71XX_CPU_IRQ_WMAC, - .end = AR71XX_CPU_IRQ_WMAC, + .start = AR71XX_CPU_IRQ_IP2, + .end = AR71XX_CPU_IRQ_IP2, .flags = IORESOURCE_IRQ, }, }; diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c index 3a91e00aa..25d643d03 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c @@ -95,7 +95,7 @@ static void __init ar71xx_pci_irq_init(void) handle_level_irq); } - setup_irq(AR71XX_CPU_IRQ_PCI, &ar71xx_pci_irqaction); + setup_irq(AR71XX_CPU_IRQ_IP2, &ar71xx_pci_irqaction); } static void ar724x_pci_irq_dispatch(void) @@ -179,7 +179,7 @@ static void __init ar724x_pci_irq_init(void) handle_level_irq); } - setup_irq(AR71XX_CPU_IRQ_PCI, &ar724x_pci_irqaction); + setup_irq(AR71XX_CPU_IRQ_IP2, &ar724x_pci_irqaction); } #else static inline void ar71xx_pci_irq_init(void) {}; @@ -368,7 +368,7 @@ static void __init ar71xx_misc_irq_init(void) static void ar913x_wmac_irq_dispatch(void) { - do_IRQ(AR71XX_CPU_IRQ_WMAC); + do_IRQ(AR71XX_CPU_IRQ_IP2); } asmlinkage void plat_irq_dispatch(void) diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h index 1a1ec4ba1..8ac5598ce 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h @@ -79,8 +79,7 @@ #define AR71XX_PCI_IRQ_BASE 48 #define AR71XX_PCI_IRQ_COUNT 8 -#define AR71XX_CPU_IRQ_PCI (AR71XX_CPU_IRQ_BASE + 2) -#define AR71XX_CPU_IRQ_WMAC (AR71XX_CPU_IRQ_BASE + 2) +#define AR71XX_CPU_IRQ_IP2 (AR71XX_CPU_IRQ_BASE + 2) #define AR71XX_CPU_IRQ_USB (AR71XX_CPU_IRQ_BASE + 3) #define AR71XX_CPU_IRQ_GE0 (AR71XX_CPU_IRQ_BASE + 4) #define AR71XX_CPU_IRQ_GE1 (AR71XX_CPU_IRQ_BASE + 5) From d93b1aab254ae60ec67a91bc5b4a60147fcf4849 Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:18:50 +0000 Subject: [PATCH 23/64] ar71xx: use set_irq_chained_handler for the PCI IRQs git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20280 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/ar71xx/files/arch/mips/ar71xx/irq.c | 49 +++++-------------- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c index 25d643d03..d5d9a6806 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c @@ -1,7 +1,7 @@ /* * Atheros AR71xx SoC specific interrupt handling * - * Copyright (C) 2008-2009 Gabor Juhos + * Copyright (C) 2008-2010 Gabor Juhos * Copyright (C) 2008 Imre Kaloz * * Parts of this file are based on Atheros' 2.6.15 BSP @@ -21,10 +21,8 @@ #include -static void (* ar71xx_ip2_irq_handler)(void) = spurious_interrupt; - #ifdef CONFIG_PCI -static void ar71xx_pci_irq_dispatch(void) +static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc) { u32 pending; @@ -32,16 +30,16 @@ static void ar71xx_pci_irq_dispatch(void) ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); if (pending & PCI_INT_DEV0) - do_IRQ(AR71XX_PCI_IRQ_DEV0); + generic_handle_irq(AR71XX_PCI_IRQ_DEV0); else if (pending & PCI_INT_DEV1) - do_IRQ(AR71XX_PCI_IRQ_DEV1); + generic_handle_irq(AR71XX_PCI_IRQ_DEV1); else if (pending & PCI_INT_DEV2) - do_IRQ(AR71XX_PCI_IRQ_DEV2); + generic_handle_irq(AR71XX_PCI_IRQ_DEV2); else if (pending & PCI_INT_CORE) - do_IRQ(AR71XX_PCI_IRQ_CORE); + generic_handle_irq(AR71XX_PCI_IRQ_CORE); else spurious_interrupt(); @@ -74,17 +72,10 @@ static struct irq_chip ar71xx_pci_irq_chip = { .mask_ack = ar71xx_pci_irq_mask, }; -static struct irqaction ar71xx_pci_irqaction = { - .handler = no_action, - .name = "cascade [AR71XX PCI]", -}; - static void __init ar71xx_pci_irq_init(void) { int i; - ar71xx_ip2_irq_handler = ar71xx_pci_irq_dispatch; - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, 0); ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_STATUS, 0); @@ -95,10 +86,10 @@ static void __init ar71xx_pci_irq_init(void) handle_level_irq); } - setup_irq(AR71XX_CPU_IRQ_IP2, &ar71xx_pci_irqaction); + set_irq_chained_handler(AR71XX_CPU_IRQ_IP2, ar71xx_pci_irq_handler); } -static void ar724x_pci_irq_dispatch(void) +static void ar724x_pci_irq_handler(unsigned int irq, struct irq_desc *desc) { u32 pending; @@ -106,7 +97,7 @@ static void ar724x_pci_irq_dispatch(void) ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); if (pending & AR724X_PCI_INT_DEV0) - do_IRQ(AR71XX_PCI_IRQ_DEV0); + generic_handle_irq(AR71XX_PCI_IRQ_DEV0); else spurious_interrupt(); @@ -151,11 +142,6 @@ static struct irq_chip ar724x_pci_irq_chip = { .mask_ack = ar724x_pci_irq_mask, }; -static struct irqaction ar724x_pci_irqaction = { - .handler = no_action, - .name = "cascade [AR724X PCI]", -}; - static void __init ar724x_pci_irq_init(void) { u32 t; @@ -167,8 +153,6 @@ static void __init ar724x_pci_irq_init(void) return; } - ar71xx_ip2_irq_handler = ar724x_pci_irq_dispatch; - ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, 0); ar724x_pci_wr(AR724X_PCI_REG_INT_STATUS, 0); @@ -179,7 +163,7 @@ static void __init ar724x_pci_irq_init(void) handle_level_irq); } - setup_irq(AR71XX_CPU_IRQ_IP2, &ar724x_pci_irqaction); + set_irq_chained_handler(AR71XX_CPU_IRQ_IP2, ar724x_pci_irq_handler); } #else static inline void ar71xx_pci_irq_init(void) {}; @@ -366,11 +350,6 @@ static void __init ar71xx_misc_irq_init(void) setup_irq(AR71XX_CPU_IRQ_MISC, &ar71xx_misc_irqaction); } -static void ar913x_wmac_irq_dispatch(void) -{ - do_IRQ(AR71XX_CPU_IRQ_IP2); -} - asmlinkage void plat_irq_dispatch(void) { unsigned long pending; @@ -381,7 +360,7 @@ asmlinkage void plat_irq_dispatch(void) do_IRQ(AR71XX_CPU_IRQ_TIMER); else if (pending & STATUSF_IP2) - ar71xx_ip2_irq_handler(); + do_IRQ(AR71XX_CPU_IRQ_IP2); else if (pending & STATUSF_IP4) do_IRQ(AR71XX_CPU_IRQ_GE0); @@ -416,12 +395,8 @@ void __init arch_init_irq(void) case AR71XX_SOC_AR7240: ar724x_pci_irq_init(); break; - case AR71XX_SOC_AR9130: - case AR71XX_SOC_AR9132: - ar71xx_ip2_irq_handler = ar913x_wmac_irq_dispatch; - break; default: - BUG(); + break; } ar71xx_gpio_irq_init(); From 76d9192b8d573fe02b4a708bbb6d4a200562b85a Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:18:54 +0000 Subject: [PATCH 24/64] ar71xx: move PCI intterupt handling code to pci-ar7{1xx,24x}.c git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20281 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/ar71xx/files/arch/mips/ar71xx/irq.c | 162 ------------------ .../ar71xx/files/arch/mips/pci/pci-ar71xx.c | 69 ++++++++ .../ar71xx/files/arch/mips/pci/pci-ar724x.c | 81 ++++++++- 3 files changed, 149 insertions(+), 163 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c index d5d9a6806..2ad652f27 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c @@ -21,155 +21,6 @@ #include -#ifdef CONFIG_PCI -static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc) -{ - u32 pending; - - pending = ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_STATUS) & - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); - - if (pending & PCI_INT_DEV0) - generic_handle_irq(AR71XX_PCI_IRQ_DEV0); - - else if (pending & PCI_INT_DEV1) - generic_handle_irq(AR71XX_PCI_IRQ_DEV1); - - else if (pending & PCI_INT_DEV2) - generic_handle_irq(AR71XX_PCI_IRQ_DEV2); - - else if (pending & PCI_INT_CORE) - generic_handle_irq(AR71XX_PCI_IRQ_CORE); - - else - spurious_interrupt(); -} - -static void ar71xx_pci_irq_unmask(unsigned int irq) -{ - irq -= AR71XX_PCI_IRQ_BASE; - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) | (1 << irq)); - - /* flush write */ - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); -} - -static void ar71xx_pci_irq_mask(unsigned int irq) -{ - irq -= AR71XX_PCI_IRQ_BASE; - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) & ~(1 << irq)); - - /* flush write */ - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); -} - -static struct irq_chip ar71xx_pci_irq_chip = { - .name = "AR71XX PCI ", - .mask = ar71xx_pci_irq_mask, - .unmask = ar71xx_pci_irq_unmask, - .mask_ack = ar71xx_pci_irq_mask, -}; - -static void __init ar71xx_pci_irq_init(void) -{ - int i; - - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, 0); - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_STATUS, 0); - - for (i = AR71XX_PCI_IRQ_BASE; - i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) { - irq_desc[i].status = IRQ_DISABLED; - set_irq_chip_and_handler(i, &ar71xx_pci_irq_chip, - handle_level_irq); - } - - set_irq_chained_handler(AR71XX_CPU_IRQ_IP2, ar71xx_pci_irq_handler); -} - -static void ar724x_pci_irq_handler(unsigned int irq, struct irq_desc *desc) -{ - u32 pending; - - pending = ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS) & - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); - - if (pending & AR724X_PCI_INT_DEV0) - generic_handle_irq(AR71XX_PCI_IRQ_DEV0); - - else - spurious_interrupt(); -} - -static void ar724x_pci_irq_unmask(unsigned int irq) -{ - switch (irq) { - case AR71XX_PCI_IRQ_DEV0: - irq -= AR71XX_PCI_IRQ_BASE; - ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK) | - AR724X_PCI_INT_DEV0); - /* flush write */ - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); - } -} - -static void ar724x_pci_irq_mask(unsigned int irq) -{ - switch (irq) { - case AR71XX_PCI_IRQ_DEV0: - irq -= AR71XX_PCI_IRQ_BASE; - ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK) & - ~AR724X_PCI_INT_DEV0); - /* flush write */ - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); - - ar724x_pci_wr(AR724X_PCI_REG_INT_STATUS, - ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS) | - AR724X_PCI_INT_DEV0); - /* flush write */ - ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS); - } -} - -static struct irq_chip ar724x_pci_irq_chip = { - .name = "AR724X PCI ", - .mask = ar724x_pci_irq_mask, - .unmask = ar724x_pci_irq_unmask, - .mask_ack = ar724x_pci_irq_mask, -}; - -static void __init ar724x_pci_irq_init(void) -{ - u32 t; - int i; - - t = ar71xx_reset_rr(AR724X_RESET_REG_RESET_MODULE); - if (t & (AR724X_RESET_PCIE | AR724X_RESET_PCIE_PHY | - AR724X_RESET_PCIE_PHY_SERIAL)) { - return; - } - - ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, 0); - ar724x_pci_wr(AR724X_PCI_REG_INT_STATUS, 0); - - for (i = AR71XX_PCI_IRQ_BASE; - i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) { - irq_desc[i].status = IRQ_DISABLED; - set_irq_chip_and_handler(i, &ar724x_pci_irq_chip, - handle_level_irq); - } - - set_irq_chained_handler(AR71XX_CPU_IRQ_IP2, ar724x_pci_irq_handler); -} -#else -static inline void ar71xx_pci_irq_init(void) {}; -static inline void ar724x_pci_irq_init(void) {}; -#endif /* CONFIG_PCI */ - static void ar71xx_gpio_irq_dispatch(void) { u32 pending; @@ -386,18 +237,5 @@ void __init arch_init_irq(void) cp0_perfcount_irq = AR71XX_MISC_IRQ_PERFC; - switch (ar71xx_soc) { - case AR71XX_SOC_AR7130: - case AR71XX_SOC_AR7141: - case AR71XX_SOC_AR7161: - ar71xx_pci_irq_init(); - break; - case AR71XX_SOC_AR7240: - ar724x_pci_irq_init(); - break; - default: - break; - } - ar71xx_gpio_irq_init(); } diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c index b2d36caa0..ac94da986 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -300,6 +301,73 @@ static struct pci_controller ar71xx_pci_controller = { .io_resource = &ar71xx_pci_io_resource, }; +static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc) +{ + u32 pending; + + pending = ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_STATUS) & + ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); + + if (pending & PCI_INT_DEV0) + generic_handle_irq(AR71XX_PCI_IRQ_DEV0); + + else if (pending & PCI_INT_DEV1) + generic_handle_irq(AR71XX_PCI_IRQ_DEV1); + + else if (pending & PCI_INT_DEV2) + generic_handle_irq(AR71XX_PCI_IRQ_DEV2); + + else if (pending & PCI_INT_CORE) + generic_handle_irq(AR71XX_PCI_IRQ_CORE); + + else + spurious_interrupt(); +} + +static void ar71xx_pci_irq_unmask(unsigned int irq) +{ + irq -= AR71XX_PCI_IRQ_BASE; + ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, + ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) | (1 << irq)); + + /* flush write */ + ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); +} + +static void ar71xx_pci_irq_mask(unsigned int irq) +{ + irq -= AR71XX_PCI_IRQ_BASE; + ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, + ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) & ~(1 << irq)); + + /* flush write */ + ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); +} + +static struct irq_chip ar71xx_pci_irq_chip = { + .name = "AR71XX PCI ", + .mask = ar71xx_pci_irq_mask, + .unmask = ar71xx_pci_irq_unmask, + .mask_ack = ar71xx_pci_irq_mask, +}; + +static void __init ar71xx_pci_irq_init(void) +{ + int i; + + ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, 0); + ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_STATUS, 0); + + for (i = AR71XX_PCI_IRQ_BASE; + i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) { + irq_desc[i].status = IRQ_DISABLED; + set_irq_chip_and_handler(i, &ar71xx_pci_irq_chip, + handle_level_irq); + } + + set_irq_chained_handler(AR71XX_CPU_IRQ_IP2, ar71xx_pci_irq_handler); +} + int __init ar71xx_pcibios_init(void) { ar71xx_device_stop(RESET_MODULE_PCI_BUS | RESET_MODULE_PCI_CORE); @@ -326,6 +394,7 @@ int __init ar71xx_pcibios_init(void) (void)ar71xx_pci_be_handler(1); ar71xx_pci_fixup_enable = 1; + ar71xx_pci_irq_init(); register_pci_controller(&ar71xx_pci_controller); return 0; diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c index 5fcfc8738..617d1eb8b 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c @@ -1,7 +1,7 @@ /* * Atheros AR724x PCI host controller driver * - * Copyright (C) 2009 Gabor Juhos + * Copyright (C) 2009-2010 Gabor Juhos * * Parts of this file are based on Atheros' 2.6.15 BSP * @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -246,6 +247,83 @@ static int __init ar724x_pci_setup(void) return 0; } +static void ar724x_pci_irq_handler(unsigned int irq, struct irq_desc *desc) +{ + u32 pending; + + pending = ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS) & + ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); + + if (pending & AR724X_PCI_INT_DEV0) + generic_handle_irq(AR71XX_PCI_IRQ_DEV0); + + else + spurious_interrupt(); +} + +static void ar724x_pci_irq_unmask(unsigned int irq) +{ + switch (irq) { + case AR71XX_PCI_IRQ_DEV0: + irq -= AR71XX_PCI_IRQ_BASE; + ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, + ar724x_pci_rr(AR724X_PCI_REG_INT_MASK) | + AR724X_PCI_INT_DEV0); + /* flush write */ + ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); + } +} + +static void ar724x_pci_irq_mask(unsigned int irq) +{ + switch (irq) { + case AR71XX_PCI_IRQ_DEV0: + irq -= AR71XX_PCI_IRQ_BASE; + ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, + ar724x_pci_rr(AR724X_PCI_REG_INT_MASK) & + ~AR724X_PCI_INT_DEV0); + /* flush write */ + ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); + + ar724x_pci_wr(AR724X_PCI_REG_INT_STATUS, + ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS) | + AR724X_PCI_INT_DEV0); + /* flush write */ + ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS); + } +} + +static struct irq_chip ar724x_pci_irq_chip = { + .name = "AR724X PCI ", + .mask = ar724x_pci_irq_mask, + .unmask = ar724x_pci_irq_unmask, + .mask_ack = ar724x_pci_irq_mask, +}; + +static void __init ar724x_pci_irq_init(void) +{ + u32 t; + int i; + + t = ar71xx_reset_rr(AR724X_RESET_REG_RESET_MODULE); + if (t & (AR724X_RESET_PCIE | AR724X_RESET_PCIE_PHY | + AR724X_RESET_PCIE_PHY_SERIAL)) { + return; + } + + ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, 0); + ar724x_pci_wr(AR724X_PCI_REG_INT_STATUS, 0); + + for (i = AR71XX_PCI_IRQ_BASE; + i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) { + irq_desc[i].status = IRQ_DISABLED; + set_irq_chip_and_handler(i, &ar724x_pci_irq_chip, + handle_level_irq); + } + + set_irq_chained_handler(AR71XX_CPU_IRQ_IP2, ar724x_pci_irq_handler); +} + int __init ar724x_pcibios_init(void) { int ret; @@ -262,6 +340,7 @@ int __init ar724x_pcibios_init(void) return ret; ar724x_pci_fixup_enable = 1; + ar724x_pci_irq_init(); register_pci_controller(&ar724x_pci_controller); return 0; From 87d726d0f1edcc452a12c0022d6a35939b0dcadc Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:18:58 +0000 Subject: [PATCH 25/64] ar71xx: move ar724x_pci_* helpers to ar724x-pci.c git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20282 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../mips/include/asm/mach-ar71xx/ar71xx.h | 30 ------------------- .../ar71xx/files/arch/mips/pci/pci-ar724x.c | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h index 8ac5598ce..31d2fd8e4 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h @@ -356,36 +356,6 @@ void ar71xx_ddr_flush(u32 reg); #define AR724X_PCI_INT_DEV0 BIT(14) -static inline void ar724x_pci_wr(unsigned reg, u32 val) -{ - void __iomem *base; - - base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); - __raw_writel(val, base + reg); - (void) __raw_readl(base + reg); - iounmap(base); -} - -static inline void ar724x_pci_wr_nf(unsigned reg, u32 val) -{ - void __iomem *base; - - base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); - __raw_writel(val, base + reg); - iounmap(base); -} - -static inline u32 ar724x_pci_rr(unsigned reg) -{ - void __iomem *base; - u32 ret; - - base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); - ret = __raw_readl(base + reg); - iounmap(base); - return ret; -} - /* * RESET block */ diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c index 617d1eb8b..9d37561aa 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c @@ -34,6 +34,36 @@ static int ar724x_pci_fixup_enable; static DEFINE_SPINLOCK(ar724x_pci_lock); +static inline void ar724x_pci_wr(unsigned reg, u32 val) +{ + void __iomem *base; + + base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); + __raw_writel(val, base + reg); + (void) __raw_readl(base + reg); + iounmap(base); +} + +static inline void ar724x_pci_wr_nf(unsigned reg, u32 val) +{ + void __iomem *base; + + base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); + __raw_writel(val, base + reg); + iounmap(base); +} + +static inline u32 ar724x_pci_rr(unsigned reg) +{ + void __iomem *base; + u32 ret; + + base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); + ret = __raw_readl(base + reg); + iounmap(base); + return ret; +} + static void ar724x_pci_read(void __iomem *base, int where, int size, u32 *value) { unsigned long flags; From 3079a4d84dc08f172a79eb38cf29146c0c82ba46 Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:19:03 +0000 Subject: [PATCH 26/64] ar71xx: add error handling to ar724x_pcibios_init git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20283 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/ar71xx/files/arch/mips/pci/pci-ar724x.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c index 9d37561aa..251bf6d39 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c @@ -356,22 +356,33 @@ static void __init ar724x_pci_irq_init(void) int __init ar724x_pcibios_init(void) { - int ret; + int ret = -ENOMEM; ar724x_pci_localcfg_base = ioremap_nocache(AR724X_PCI_CRP_BASE, AR724X_PCI_CRP_SIZE); + if (ar724x_pci_localcfg_base == NULL) + goto err; ar724x_pci_devcfg_base = ioremap_nocache(AR724X_PCI_CFG_BASE, AR724X_PCI_CFG_SIZE); + if (ar724x_pci_devcfg_base == NULL) + goto err_unmap_localcfg; ar724x_pci_reset(); ret = ar724x_pci_setup(); if (ret) - return ret; + goto err_unmap_devcfg; ar724x_pci_fixup_enable = 1; ar724x_pci_irq_init(); register_pci_controller(&ar724x_pci_controller); return 0; + + err_unmap_devcfg: + iounmap(ar724x_pci_devcfg_base); + err_unmap_localcfg: + iounmap(ar724x_pci_localcfg_base); + err: + return ret; } From a95e8602caad2e0fa7000656bcbf8204e558dd25 Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:19:07 +0000 Subject: [PATCH 27/64] ar71xx: introduce global ar724x_pci_ctrl_base variable git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20284 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ar71xx/files/arch/mips/pci/pci-ar724x.c | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c index 251bf6d39..30b34dc7e 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c @@ -30,38 +30,25 @@ static void __iomem *ar724x_pci_localcfg_base; static void __iomem *ar724x_pci_devcfg_base; +static void __iomem *ar724x_pci_ctrl_base; static int ar724x_pci_fixup_enable; static DEFINE_SPINLOCK(ar724x_pci_lock); static inline void ar724x_pci_wr(unsigned reg, u32 val) { - void __iomem *base; - - base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); - __raw_writel(val, base + reg); - (void) __raw_readl(base + reg); - iounmap(base); + __raw_writel(val, ar724x_pci_ctrl_base + reg); + (void) __raw_readl(ar724x_pci_ctrl_base + reg); } static inline void ar724x_pci_wr_nf(unsigned reg, u32 val) { - void __iomem *base; - - base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); - __raw_writel(val, base + reg); - iounmap(base); + __raw_writel(val, ar724x_pci_ctrl_base + reg); } static inline u32 ar724x_pci_rr(unsigned reg) { - void __iomem *base; - u32 ret; - - base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE); - ret = __raw_readl(base + reg); - iounmap(base); - return ret; + return __raw_readl(ar724x_pci_ctrl_base + reg); } static void ar724x_pci_read(void __iomem *base, int where, int size, u32 *value) @@ -368,10 +355,15 @@ int __init ar724x_pcibios_init(void) if (ar724x_pci_devcfg_base == NULL) goto err_unmap_localcfg; + ar724x_pci_ctrl_base = ioremap_nocache(AR724X_PCI_CTRL_BASE, + AR724X_PCI_CTRL_SIZE); + if (ar724x_pci_ctrl_base == NULL) + goto err_unmap_devcfg; + ar724x_pci_reset(); ret = ar724x_pci_setup(); if (ret) - goto err_unmap_devcfg; + goto err_unmap_ctrl; ar724x_pci_fixup_enable = 1; ar724x_pci_irq_init(); @@ -379,7 +371,9 @@ int __init ar724x_pcibios_init(void) return 0; - err_unmap_devcfg: + err_unmap_ctrl: + iounmap(ar724x_pci_ctrl_base); + err_unmap_devcfg: iounmap(ar724x_pci_devcfg_base); err_unmap_localcfg: iounmap(ar724x_pci_localcfg_base); From b8bc300bd3c49b2f57b0fbee704cbac46ce9b897 Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:19:10 +0000 Subject: [PATCH 28/64] ar71xx: optimize register access in ar724x_pci.c git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20285 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ar71xx/files/arch/mips/pci/pci-ar724x.c | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c index 30b34dc7e..fd5221607 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c @@ -35,22 +35,6 @@ static int ar724x_pci_fixup_enable; static DEFINE_SPINLOCK(ar724x_pci_lock); -static inline void ar724x_pci_wr(unsigned reg, u32 val) -{ - __raw_writel(val, ar724x_pci_ctrl_base + reg); - (void) __raw_readl(ar724x_pci_ctrl_base + reg); -} - -static inline void ar724x_pci_wr_nf(unsigned reg, u32 val) -{ - __raw_writel(val, ar724x_pci_ctrl_base + reg); -} - -static inline u32 ar724x_pci_rr(unsigned reg) -{ - return __raw_readl(ar724x_pci_ctrl_base + reg); -} - static void ar724x_pci_read(void __iomem *base, int where, int size, u32 *value) { unsigned long flags; @@ -233,6 +217,7 @@ static void __init ar724x_pci_reset(void) static int __init ar724x_pci_setup(void) { + void __iomem *base = ar724x_pci_ctrl_base; u32 t; /* setup COMMAND register */ @@ -243,19 +228,21 @@ static int __init ar724x_pci_setup(void) ar724x_pci_write(ar724x_pci_localcfg_base, 0x20, 4, 0x1ff01000); ar724x_pci_write(ar724x_pci_localcfg_base, 0x24, 4, 0x1ff01000); - t = ar724x_pci_rr(AR724X_PCI_REG_RESET); + t = __raw_readl(base + AR724X_PCI_REG_RESET); if (t != 0x7) { udelay(100000); - ar724x_pci_wr_nf(AR724X_PCI_REG_RESET, 0); + __raw_writel(0, base + AR724X_PCI_REG_RESET); udelay(100); - ar724x_pci_wr_nf(AR724X_PCI_REG_RESET, 4); + __raw_writel(4, base + AR724X_PCI_REG_RESET); udelay(100000); } - ar724x_pci_wr(AR724X_PCI_REG_APP, AR724X_PCI_APP_LTSSM_ENABLE); + __raw_writel(AR724X_PCI_APP_LTSSM_ENABLE, base + AR724X_PCI_REG_APP); + /* flush write */ + (void) __raw_readl(base + AR724X_PCI_REG_APP); udelay(1000); - t = ar724x_pci_rr(AR724X_PCI_REG_APP); + t = __raw_readl(base + AR724X_PCI_REG_APP); if ((t & AR724X_PCI_APP_LTSSM_ENABLE) == 0x0) { printk(KERN_WARNING "PCI: no PCIe module found\n"); return -ENODEV; @@ -266,10 +253,11 @@ static int __init ar724x_pci_setup(void) static void ar724x_pci_irq_handler(unsigned int irq, struct irq_desc *desc) { + void __iomem *base = ar724x_pci_ctrl_base; u32 pending; - pending = ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS) & - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); + pending = __raw_readl(base + AR724X_PCI_REG_INT_STATUS) & + __raw_readl(base + AR724X_PCI_REG_INT_MASK); if (pending & AR724X_PCI_INT_DEV0) generic_handle_irq(AR71XX_PCI_IRQ_DEV0); @@ -280,33 +268,43 @@ static void ar724x_pci_irq_handler(unsigned int irq, struct irq_desc *desc) static void ar724x_pci_irq_unmask(unsigned int irq) { + void __iomem *base = ar724x_pci_ctrl_base; + u32 t; + switch (irq) { case AR71XX_PCI_IRQ_DEV0: irq -= AR71XX_PCI_IRQ_BASE; - ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK) | - AR724X_PCI_INT_DEV0); + + t = __raw_readl(base + AR724X_PCI_REG_INT_MASK); + __raw_writel(t | AR724X_PCI_INT_DEV0, + base + AR724X_PCI_REG_INT_MASK); /* flush write */ - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); + (void) __raw_readl(base + AR724X_PCI_REG_INT_MASK); } } static void ar724x_pci_irq_mask(unsigned int irq) { + void __iomem *base = ar724x_pci_ctrl_base; + u32 t; + switch (irq) { case AR71XX_PCI_IRQ_DEV0: irq -= AR71XX_PCI_IRQ_BASE; - ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK) & - ~AR724X_PCI_INT_DEV0); - /* flush write */ - ar724x_pci_rr(AR724X_PCI_REG_INT_MASK); - ar724x_pci_wr(AR724X_PCI_REG_INT_STATUS, - ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS) | - AR724X_PCI_INT_DEV0); + t = __raw_readl(base + AR724X_PCI_REG_INT_MASK); + __raw_writel(t & ~AR724X_PCI_INT_DEV0, + base + AR724X_PCI_REG_INT_MASK); + /* flush write */ - ar724x_pci_rr(AR724X_PCI_REG_INT_STATUS); + (void) __raw_readl(base + AR724X_PCI_REG_INT_MASK); + + t = __raw_readl(base + AR724X_PCI_REG_INT_STATUS); + __raw_writel(t | AR724X_PCI_INT_DEV0, + base + AR724X_PCI_REG_INT_STATUS); + + /* flush write */ + (void) __raw_readl(base + AR724X_PCI_REG_INT_STATUS); } } @@ -319,6 +317,7 @@ static struct irq_chip ar724x_pci_irq_chip = { static void __init ar724x_pci_irq_init(void) { + void __iomem *base = ar724x_pci_ctrl_base; u32 t; int i; @@ -328,8 +327,8 @@ static void __init ar724x_pci_irq_init(void) return; } - ar724x_pci_wr(AR724X_PCI_REG_INT_MASK, 0); - ar724x_pci_wr(AR724X_PCI_REG_INT_STATUS, 0); + __raw_writel(0, base + AR724X_PCI_REG_INT_MASK); + __raw_writel(0, base + AR724X_PCI_REG_INT_STATUS); for (i = AR71XX_PCI_IRQ_BASE; i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) { From 38acf445a96660123ad745ff5ff346bfd2f9fc3c Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:19:13 +0000 Subject: [PATCH 29/64] ar71xx: optimize register access in irq.c git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20286 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/ar71xx/files/arch/mips/ar71xx/irq.c | 69 ++++++++++++------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c index 2ad652f27..352548c4e 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/irq.c @@ -23,10 +23,11 @@ static void ar71xx_gpio_irq_dispatch(void) { + void __iomem *base = ar71xx_gpio_base; u32 pending; - pending = ar71xx_gpio_rr(GPIO_REG_INT_PENDING) - & ar71xx_gpio_rr(GPIO_REG_INT_ENABLE); + pending = __raw_readl(base + GPIO_REG_INT_PENDING) & + __raw_readl(base + GPIO_REG_INT_ENABLE); if (pending) do_IRQ(AR71XX_GPIO_IRQ_BASE + fls(pending) - 1); @@ -36,22 +37,30 @@ static void ar71xx_gpio_irq_dispatch(void) static void ar71xx_gpio_irq_unmask(unsigned int irq) { + void __iomem *base = ar71xx_gpio_base; + u32 t; + irq -= AR71XX_GPIO_IRQ_BASE; - ar71xx_gpio_wr(GPIO_REG_INT_ENABLE, - ar71xx_gpio_rr(GPIO_REG_INT_ENABLE) | (1 << irq)); + + t = __raw_readl(base + GPIO_REG_INT_ENABLE); + __raw_writel(t | (1 << irq), base + GPIO_REG_INT_ENABLE); /* flush write */ - ar71xx_gpio_rr(GPIO_REG_INT_ENABLE); + (void) __raw_readl(base + GPIO_REG_INT_ENABLE); } static void ar71xx_gpio_irq_mask(unsigned int irq) { + void __iomem *base = ar71xx_gpio_base; + u32 t; + irq -= AR71XX_GPIO_IRQ_BASE; - ar71xx_gpio_wr(GPIO_REG_INT_ENABLE, - ar71xx_gpio_rr(GPIO_REG_INT_ENABLE) & ~(1 << irq)); + + t = __raw_readl(base + GPIO_REG_INT_ENABLE); + __raw_writel(t & ~(1 << irq), base + GPIO_REG_INT_ENABLE); /* flush write */ - ar71xx_gpio_rr(GPIO_REG_INT_ENABLE); + (void) __raw_readl(base + GPIO_REG_INT_ENABLE); } #if 0 @@ -82,16 +91,17 @@ static struct irqaction ar71xx_gpio_irqaction = { static void __init ar71xx_gpio_irq_init(void) { + void __iomem *base = ar71xx_gpio_base; int i; - ar71xx_gpio_wr(GPIO_REG_INT_ENABLE, 0); - ar71xx_gpio_wr(GPIO_REG_INT_PENDING, 0); + __raw_writel(0, base + GPIO_REG_INT_ENABLE); + __raw_writel(0, base + GPIO_REG_INT_PENDING); /* setup type of all GPIO interrupts to level sensitive */ - ar71xx_gpio_wr(GPIO_REG_INT_TYPE, GPIO_INT_ALL); + __raw_writel(GPIO_INT_ALL, base + GPIO_REG_INT_TYPE); /* setup polarity of all GPIO interrupts to active high */ - ar71xx_gpio_wr(GPIO_REG_INT_POLARITY, GPIO_INT_ALL); + __raw_writel(GPIO_INT_ALL, base + GPIO_REG_INT_POLARITY); for (i = AR71XX_GPIO_IRQ_BASE; i < AR71XX_GPIO_IRQ_BASE + AR71XX_GPIO_IRQ_COUNT; i++) { @@ -140,32 +150,44 @@ static void ar71xx_misc_irq_dispatch(void) static void ar71xx_misc_irq_unmask(unsigned int irq) { + void __iomem *base = ar71xx_reset_base; + u32 t; + irq -= AR71XX_MISC_IRQ_BASE; - ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, - ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE) | (1 << irq)); + + t = __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE); + __raw_writel(t | (1 << irq), base + AR71XX_RESET_REG_MISC_INT_ENABLE); /* flush write */ - ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE); + (void) __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE); } static void ar71xx_misc_irq_mask(unsigned int irq) { + void __iomem *base = ar71xx_reset_base; + u32 t; + irq -= AR71XX_MISC_IRQ_BASE; - ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, - ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE) & ~(1 << irq)); + + t = __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE); + __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_MISC_INT_ENABLE); /* flush write */ - ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE); + (void) __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE); } static void ar724x_misc_irq_ack(unsigned int irq) { + void __iomem *base = ar71xx_reset_base; + u32 t; + irq -= AR71XX_MISC_IRQ_BASE; - ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_STATUS, - ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_STATUS) & ~(1 << irq)); + + t = __raw_readl(base + AR71XX_RESET_REG_MISC_INT_STATUS); + __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_MISC_INT_STATUS); /* flush write */ - ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_STATUS); + (void) __raw_readl(base + AR71XX_RESET_REG_MISC_INT_STATUS); } static struct irq_chip ar71xx_misc_irq_chip = { @@ -181,10 +203,11 @@ static struct irqaction ar71xx_misc_irqaction = { static void __init ar71xx_misc_irq_init(void) { + void __iomem *base = ar71xx_reset_base; int i; - ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, 0); - ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_STATUS, 0); + __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_ENABLE); + __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_STATUS); if (ar71xx_soc == AR71XX_SOC_AR7240) ar71xx_misc_irq_chip.ack = ar724x_misc_irq_ack; From dc4e55fa64197a3ff073227ee49027a4c9a7db4e Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:19:16 +0000 Subject: [PATCH 30/64] ar71xx: optimize register access in ar71xx_pci.c git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20287 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ar71xx/files/arch/mips/pci/pci-ar71xx.c | 94 ++++++++++--------- 1 file changed, 50 insertions(+), 44 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c index ac94da986..88eb917a5 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c @@ -1,7 +1,7 @@ /* * Atheros AR71xx PCI host controller driver * - * Copyright (C) 2008-2009 Gabor Juhos + * Copyright (C) 2008-2010 Gabor Juhos * Copyright (C) 2008 Imre Kaloz * * Parts of this file are based on Atheros' 2.6.15 BSP @@ -46,16 +46,6 @@ static inline void ar71xx_pci_delay(void) mdelay(AR71XX_PCI_DELAY); } -static inline u32 ar71xx_pcicfg_rr(unsigned int reg) -{ - return __raw_readl(ar71xx_pcicfg_base + reg); -} - -static inline void ar71xx_pcicfg_wr(unsigned int reg, u32 val) -{ - __raw_writel(val, ar71xx_pcicfg_base + reg); -} - /* Byte lane enable bits */ static u8 ble_table[4][4] = { {0x0, 0xf, 0xf, 0xf}, @@ -94,26 +84,27 @@ static inline u32 ar71xx_pci_bus_addr(struct pci_bus *bus, unsigned int devfn, int ar71xx_pci_be_handler(int is_fixup) { + void __iomem *base = ar71xx_pcicfg_base; u32 pci_err; u32 ahb_err; - pci_err = ar71xx_pcicfg_rr(PCI_REG_PCI_ERR) & 3; + pci_err = __raw_readl(base + PCI_REG_PCI_ERR) & 3; if (pci_err) { if (!is_fixup) printk(KERN_ALERT "PCI error %d at PCI addr 0x%x\n", pci_err, - ar71xx_pcicfg_rr(PCI_REG_PCI_ERR_ADDR)); + __raw_readl(base + PCI_REG_PCI_ERR_ADDR)); - ar71xx_pcicfg_wr(PCI_REG_PCI_ERR, pci_err); + __raw_writel(pci_err, base + PCI_REG_PCI_ERR); } - ahb_err = ar71xx_pcicfg_rr(PCI_REG_AHB_ERR) & 1; + ahb_err = __raw_readl(base + PCI_REG_AHB_ERR) & 1; if (ahb_err) { if (!is_fixup) printk(KERN_ALERT "AHB error at AHB address 0x%x\n", - ar71xx_pcicfg_rr(PCI_REG_AHB_ERR_ADDR)); + __raw_readl(base + PCI_REG_AHB_ERR_ADDR)); - ar71xx_pcicfg_wr(PCI_REG_AHB_ERR, ahb_err); + __raw_writel(ahb_err, base + PCI_REG_AHB_ERR); } return ((ahb_err | pci_err) ? 1 : 0); @@ -122,6 +113,7 @@ int ar71xx_pci_be_handler(int is_fixup) static inline int ar71xx_pci_set_cfgaddr(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 cmd) { + void __iomem *base = ar71xx_pcicfg_base; u32 addr; addr = ar71xx_pci_bus_addr(bus, devfn, where); @@ -130,9 +122,9 @@ static inline int ar71xx_pci_set_cfgaddr(struct pci_bus *bus, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, addr); - ar71xx_pcicfg_wr(PCI_REG_CFG_AD, addr); - ar71xx_pcicfg_wr(PCI_REG_CFG_CBE, - cmd | ar71xx_pci_get_ble(where, size, 0)); + __raw_writel(addr, base + PCI_REG_CFG_AD); + __raw_writel(cmd | ar71xx_pci_get_ble(where, size, 0), + base + PCI_REG_CFG_CBE); return ar71xx_pci_be_handler(1); } @@ -140,6 +132,7 @@ static inline int ar71xx_pci_set_cfgaddr(struct pci_bus *bus, static int ar71xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) { + void __iomem *base = ar71xx_pcicfg_base; static u32 mask[8] = {0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0}; unsigned long flags; u32 data; @@ -157,8 +150,8 @@ static int ar71xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, t = PCI_CRP_CMD_READ | (where & ~3); - ar71xx_pcicfg_wr(PCI_REG_CRP_AD_CBE, t); - data = ar71xx_pcicfg_rr(PCI_REG_CRP_RDDATA); + __raw_writel(t, base + PCI_REG_CRP_AD_CBE); + data = __raw_readl(base + PCI_REG_CRP_RDDATA); DBG("PCI: rd local cfg, ad_cbe:%08x, data:%08x\n", t, data); @@ -169,7 +162,7 @@ static int ar71xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, PCI_CFG_CMD_READ); if (err == 0) { - data = ar71xx_pcicfg_rr(PCI_REG_CFG_RDDATA); + data = __raw_readl(base + PCI_REG_CFG_RDDATA); } else { ret = PCIBIOS_DEVICE_NOT_FOUND; data = ~0; @@ -189,6 +182,7 @@ static int ar71xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, static int ar71xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { + void __iomem *base = ar71xx_pcicfg_base; unsigned long flags; int ret; @@ -208,8 +202,8 @@ static int ar71xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, DBG("PCI: wr local cfg, ad_cbe:%08x, value:%08x\n", t, value); - ar71xx_pcicfg_wr(PCI_REG_CRP_AD_CBE, t); - ar71xx_pcicfg_wr(PCI_REG_CRP_WRDATA, value); + __raw_writel(t, base + PCI_REG_CRP_AD_CBE); + __raw_writel(value, base + PCI_REG_CRP_WRDATA); } else { int err; @@ -217,7 +211,7 @@ static int ar71xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, PCI_CFG_CMD_WRITE); if (err == 0) - ar71xx_pcicfg_wr(PCI_REG_CFG_WRDATA, value); + __raw_writel(value, base + PCI_REG_CFG_WRDATA); else ret = PCIBIOS_DEVICE_NOT_FOUND; } @@ -303,10 +297,11 @@ static struct pci_controller ar71xx_pci_controller = { static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc) { + void __iomem *base = ar71xx_reset_base; u32 pending; - pending = ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_STATUS) & - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); + pending = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_STATUS) & + __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); if (pending & PCI_INT_DEV0) generic_handle_irq(AR71XX_PCI_IRQ_DEV0); @@ -326,22 +321,30 @@ static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc) static void ar71xx_pci_irq_unmask(unsigned int irq) { + void __iomem *base = ar71xx_reset_base; + u32 t; + irq -= AR71XX_PCI_IRQ_BASE; - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) | (1 << irq)); + + t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); + __raw_writel(t | (1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE); /* flush write */ - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); + (void) __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); } static void ar71xx_pci_irq_mask(unsigned int irq) { + void __iomem *base = ar71xx_reset_base; + u32 t; + irq -= AR71XX_PCI_IRQ_BASE; - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) & ~(1 << irq)); + + t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); + __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE); /* flush write */ - ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE); + (void) __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE); } static struct irq_chip ar71xx_pci_irq_chip = { @@ -353,10 +356,11 @@ static struct irq_chip ar71xx_pci_irq_chip = { static void __init ar71xx_pci_irq_init(void) { + void __iomem *base = ar71xx_reset_base; int i; - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, 0); - ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_STATUS, 0); + __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_ENABLE); + __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_STATUS); for (i = AR71XX_PCI_IRQ_BASE; i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) { @@ -370,6 +374,8 @@ static void __init ar71xx_pci_irq_init(void) int __init ar71xx_pcibios_init(void) { + void __iomem *ddr_base = ar71xx_ddr_base; + ar71xx_device_stop(RESET_MODULE_PCI_BUS | RESET_MODULE_PCI_CORE); ar71xx_pci_delay(); @@ -379,14 +385,14 @@ int __init ar71xx_pcibios_init(void) ar71xx_pcicfg_base = ioremap_nocache(AR71XX_PCI_CFG_BASE, AR71XX_PCI_CFG_SIZE); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN0, PCI_WIN0_OFFS); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN1, PCI_WIN1_OFFS); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN2, PCI_WIN2_OFFS); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN3, PCI_WIN3_OFFS); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN4, PCI_WIN4_OFFS); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN5, PCI_WIN5_OFFS); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN6, PCI_WIN6_OFFS); - ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN7, PCI_WIN7_OFFS); + __raw_writel(PCI_WIN0_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN0); + __raw_writel(PCI_WIN1_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN1); + __raw_writel(PCI_WIN2_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN2); + __raw_writel(PCI_WIN3_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN3); + __raw_writel(PCI_WIN4_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN4); + __raw_writel(PCI_WIN5_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN5); + __raw_writel(PCI_WIN6_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN6); + __raw_writel(PCI_WIN7_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN7); ar71xx_pci_delay(); From b1704a799d743388d45be6aef04ec57909aa73c4 Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:19:19 +0000 Subject: [PATCH 31/64] ar71xx: check returned value of ioremap in ar71xx_pcibios_setup git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20288 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c index 88eb917a5..7d0eee9db 100644 --- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c +++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar71xx.c @@ -384,6 +384,8 @@ int __init ar71xx_pcibios_init(void) ar71xx_pcicfg_base = ioremap_nocache(AR71XX_PCI_CFG_BASE, AR71XX_PCI_CFG_SIZE); + if (ar71xx_pcicfg_base == NULL) + return -ENOMEM; __raw_writel(PCI_WIN0_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN0); __raw_writel(PCI_WIN1_OFFS, ddr_base + AR71XX_DDR_REG_PCI_WIN1); From 56f1be7e5c2c5851404fee9a74d9a04e7e975b00 Mon Sep 17 00:00:00 2001 From: juhosg Date: Thu, 18 Mar 2010 19:19:21 +0000 Subject: [PATCH 32/64] base-files: show boot state on intramfs images git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20289 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/generic-2.6/base-files/init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/linux/generic-2.6/base-files/init b/target/linux/generic-2.6/base-files/init index a3387eb10..9e8ba7c5e 100755 --- a/target/linux/generic-2.6/base-files/init +++ b/target/linux/generic-2.6/base-files/init @@ -5,6 +5,9 @@ INITRAMFS=1 . /etc/preinit +set_state init +echo "- init -" + # if we have no root parameter, just go to running from ramfs [ -z $rootfs ] && { export NOMOUNT="No Root" @@ -76,3 +79,5 @@ mount -o move /sys /mnt/sys mount none /tmp -t tmpfs killall -q hotplug2 exec switch_root -c /dev/console /mnt /sbin/init + +set_state done From ffb6292494f71f587c1fbf9c411a654f1c5e641b Mon Sep 17 00:00:00 2001 From: jow Date: Thu, 18 Mar 2010 21:10:56 +0000 Subject: [PATCH 33/64] [scripts] remote-gdb: * use sysroot instead of solib search paths * don't query arch if there's only one choice git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20290 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/remote-gdb | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/scripts/remote-gdb b/scripts/remote-gdb index 9701b31c1..60efb9703 100755 --- a/scripts/remote-gdb +++ b/scripts/remote-gdb @@ -33,13 +33,20 @@ if( opendir SD, "$Bin/../staging_dir" ) } } - # Query arch - do { - print("Target? > "); - chomp($tid = ); - } while( !defined($tid) || $tid !~ /^\d+$/ || $tid < 1 || $tid > @arches ); + if( @arches > 1 ) + { + # Query arch + do { + print("Target? > "); + chomp($tid = ); + } while( !defined($tid) || $tid !~ /^\d+$/ || $tid < 1 || $tid > @arches ); - ($arch, $libc) = @{$arches[$tid-1]}; + ($arch, $libc) = @{$arches[$tid-1]}; + } + else + { + ($arch, $libc) = @{$arches[0]}; + } } closedir SD; @@ -47,18 +54,14 @@ if( opendir SD, "$Bin/../staging_dir" ) # Find gdb my ($gdb) = glob("$Bin/../build_dir/toolchain-${arch}_*_${libc}/gdb-*/gdb/gdb"); - if( -x $gdb ) + if( defined($gdb) && -x $gdb ) { my ( $fh, $fp ) = tempfile(); - # Find library paths - my $libdirs = join ':', ( - glob("$Bin/../staging_dir/target-${arch}_${libc}/root-*/{,usr/}lib/"), - glob("$Bin/../staging_dir/target-${arch}_${libc}/{,usr/}lib/"), - glob("$Bin/../staging_dir/toolchain-${arch}_*_${libc}/lib/") - ); + # Find sysroot + my ($sysroot) = glob("$Bin/../staging_dir/target-${arch}_${libc}/root-*/"); - print $fh "set solib-search-path $libdirs\n"; + print $fh "set sysroot $sysroot\n" if $sysroot; print $fh "target remote $ARGV[0]\n"; system($gdb, '-x', $fp, $ARGV[1]); From f87759a667c77a1afbe1393d2de60666c0337e37 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 18 Mar 2010 23:35:12 +0000 Subject: [PATCH 34/64] [tools] fix file creation mode, thanks rtz git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20293 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- tools/firmware-utils/src/airlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/firmware-utils/src/airlink.c b/tools/firmware-utils/src/airlink.c index 63bd51835..560a58df5 100644 --- a/tools/firmware-utils/src/airlink.c +++ b/tools/firmware-utils/src/airlink.c @@ -110,7 +110,7 @@ int generate_image(char *kname, char *fsname, char *fname, int EHDR) uchar *bk, *bs; int fkd, ffd, fsd; fkd = open(kname, O_RDONLY); - ffd = creat(fname, 0x644); + ffd = creat(fname, 0644); if ((fkd < 0) || (ffd < 0)) return -1; if (fsname) { From d6a7552aad4537d1dc32c5e92c5159d7211372c2 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 18 Mar 2010 23:35:21 +0000 Subject: [PATCH 35/64] [rdc] rework board detection Rework board detection, separate board specific code into its own file. As a result we also change the way rdc images are generated. Support for board which required binary tools, like AMIT are dropped. Patch by Bernhard Loos. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20294 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/pad_image | 100 ++++++ target/linux/rdc/Makefile | 2 +- target/linux/rdc/ar525w/config-2.6.30 | 8 - target/linux/rdc/bifferboard/config-2.6.30 | 8 - .../arch/x86/include/asm/rdc_boards.h | 36 +++ .../arch/x86/mach-rdc321x/Makefile | 2 +- .../arch/x86/mach-rdc321x/boards/ar525w.c | 243 +++++++++++++++ .../x86/mach-rdc321x/boards/bifferboard.c | 82 +++++ .../arch/x86/mach-rdc321x/boards/r8610.c | 65 ++++ .../arch/x86/mach-rdc321x/boards/sitecom.c | 111 +++++++ .../arch/x86/mach-rdc321x/platform.c | 285 ++++-------------- target/linux/rdc/image/Makefile | 60 +--- target/linux/rdc/image/mkimg_sitecom.pl | 6 - .../012-export_erase_write.patch | 28 ++ target/linux/rdc/r8610/config-2.6.30 | 3 - 15 files changed, 734 insertions(+), 305 deletions(-) create mode 100755 scripts/pad_image create mode 100644 target/linux/rdc/files-2.6.30/arch/x86/include/asm/rdc_boards.h create mode 100644 target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/ar525w.c create mode 100644 target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/bifferboard.c create mode 100644 target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/r8610.c create mode 100644 target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/sitecom.c create mode 100644 target/linux/rdc/patches-2.6.30/012-export_erase_write.patch diff --git a/scripts/pad_image b/scripts/pad_image new file mode 100755 index 000000000..14f149907 --- /dev/null +++ b/scripts/pad_image @@ -0,0 +1,100 @@ +#!/bin/bash + +function usage { + echo "Usage: prepare_image image_type kernel_image rootfs_image header_size" + echo "Padd root and kernel image to the correct size and append the jffs2 start marker as needed" + exit 1 +} + +function pad_file { + echo "Padding $1 to size $2" + dd if=$1 of=$1.paddingtempfile bs=$2 count=1 conv=sync &> /dev/null + mv $1.paddingtempfile $1 +} + +#filesize filestart padding +function calc_pad { + [ $((($1 + $2) & ($3 - 1))) == 0 ] && { + echo $1 + return 0 + } + echo $(((($1 + $2) | ($3 - 1)) + 1 - $2)) +} + +function prep_squash { + echo "kernel_size: $kernel_size" + echo "header_size: $header_size" + kernel_pad_size=$(calc_pad $kernel_size $header_size 32) + kernel_end=$(($header_size + $kernel_pad_size)) + pad_file $kernel_image $kernel_pad_size + + #4k + rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 4096) + pad_file $rootfs_image $rootfs_pad_size + echo -ne '\xde\xad\xc0\xde' >> $rootfs_image + + #8k + rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 8192) + [ $rootfs_pad_size == rootfs_old_padsize ] || { + pad_file $rootfs_image $rootfs_pad_size + rootfs_old_padsize=$rootfs_pad_size + echo -ne '\xde\xad\xc0\xde' >> $rootfs_image + } + + #64k + rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 65536) + [ $rootfs_pad_size == rootfs_old_padsize ] || { + pad_file $rootfs_image $rootfs_pad_size + rootfs_old_padsize=$rootfs_pad_size + echo -ne '\xde\xad\xc0\xde' >> $rootfs_image + } + + #128k + rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 131072) + [ $rootfs_pad_size == rootfs_old_padsize ] || { + pad_file $rootfs_image $rootfs_pad_size + rootfs_old_padsize=$rootfs_pad_size + echo -ne '\xde\xad\xc0\xde' >> $rootfs_image + } + +} + +function prep_jffs2 { + kernel_pad_size=$(calc_pad $kernel_size $header_size $1) + pad_file $kernel_image $kernel_pad_size +} + +image_type=$1 +kernel_image=$2 +rootfs_image=$3 +header_size=$4 + +if [ -z "$image_type" ] || [ -z "$rootfs_image" ] || [ -z "$kernel_image" ] || [ -z "$header_size" ]; then + usage +fi + +if [ ! -e "$rootfs_image" ] || [ -z "$kernel_image" ]; then + echo "input file not found" + exit 1 +fi + +kernel_size=$(stat -c "%s" "$kernel_image") +rootfs_size=$(stat -c "%s" "$rootfs_image") + +if [ $kernel_size == 0 ] || [ $rootfs_size == 0 ]; then + echo "kernel or rootfs empty" + exit 1 +fi + +case $image_type in + squashfs ) + prep_squash ;; + jffs2-64k ) + prep_jffs2 65536 ;; + jffs2-128k ) + prep_jffs2 131072 ;; + * ) + echo "Unknown image type" + exit 1 ;; +esac + diff --git a/target/linux/rdc/Makefile b/target/linux/rdc/Makefile index b65101167..2144ec71f 100644 --- a/target/linux/rdc/Makefile +++ b/target/linux/rdc/Makefile @@ -11,7 +11,7 @@ BOARD:=rdc BOARDNAME:=RDC 321x FEATURES:=squashfs jffs2 pci usb pcmcia CFLAGS:=-Os -pipe -march=i486 -funit-at-a-time -SUBTARGETS:=amit ar525w r8610 dir-450 sitecom bifferboard +SUBTARGETS:=ar525w r8610 sitecom bifferboard LINUX_VERSION:=2.6.30.10 diff --git a/target/linux/rdc/ar525w/config-2.6.30 b/target/linux/rdc/ar525w/config-2.6.30 index 109f9e064..e69de29bb 100644 --- a/target/linux/rdc/ar525w/config-2.6.30 +++ b/target/linux/rdc/ar525w/config-2.6.30 @@ -1,8 +0,0 @@ -# CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_R8610 is not set -CONFIG_MTD_RDC3210_ALLOW_JFFS2=y -CONFIG_MTD_RDC3210_BUSWIDTH=2 -# CONFIG_MTD_RDC3210_FACTORY_PRESENT is not set -CONFIG_MTD_RDC3210_SIZE=0x400000 -# CONFIG_MTD_RDC3210_STATIC_MAP is not set -CONFIG_MTD_RDC3210=y diff --git a/target/linux/rdc/bifferboard/config-2.6.30 b/target/linux/rdc/bifferboard/config-2.6.30 index c97dcdaac..e69de29bb 100644 --- a/target/linux/rdc/bifferboard/config-2.6.30 +++ b/target/linux/rdc/bifferboard/config-2.6.30 @@ -1,8 +0,0 @@ -CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2" -# CONFIG_MTD_PHYSMAP is not set -CONFIG_MTD_RDC3210_ALLOW_JFFS2=y -CONFIG_MTD_RDC3210_BUSWIDTH=2 -# CONFIG_MTD_RDC3210_FACTORY_PRESENT is not set -CONFIG_MTD_RDC3210_SIZE=0x800000 -# CONFIG_MTD_RDC3210_STATIC_MAP is not set -CONFIG_MTD_RDC3210=y diff --git a/target/linux/rdc/files-2.6.30/arch/x86/include/asm/rdc_boards.h b/target/linux/rdc/files-2.6.30/arch/x86/include/asm/rdc_boards.h new file mode 100644 index 000000000..4f8ef377d --- /dev/null +++ b/target/linux/rdc/files-2.6.30/arch/x86/include/asm/rdc_boards.h @@ -0,0 +1,36 @@ +/* + * RDC321x boards + * + * Copyright (C) 2007-2009 OpenWrt.org + * Copyright (C) 2007 Florian Fainelli + * Copyright (C) 2008-2009 Daniel Gimpelevich + * + * 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef _RDC_BOARDS_H__ +#define _RDC_BOARDS_H__ + +#include +#include + +struct rdc_platform_data { + struct gpio_led_platform_data led_data; + struct gpio_buttons_platform_data button_data; +}; + +#endif diff --git a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/Makefile b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/Makefile index 21d887923..13d0b3183 100644 --- a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/Makefile +++ b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/Makefile @@ -1,5 +1,5 @@ # # Makefile for the RDC321x specific parts of the kernel # -obj-$(CONFIG_X86_RDC321X) := gpio.o platform.o pci.o reboot.o +obj-$(CONFIG_X86_RDC321X) := gpio.o platform.o pci.o reboot.o boards/sitecom.o boards/ar525w.o boards/bifferboard.o boards/r8610.o diff --git a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/ar525w.c b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/ar525w.c new file mode 100644 index 000000000..041a3ba34 --- /dev/null +++ b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/ar525w.c @@ -0,0 +1,243 @@ +/* + * ar525w RDC321x platform devices + * + * Copyright (C) 2007-2009 OpenWrt.org + * Copyright (C) 2007 Florian Fainelli + * Copyright (C) 2008-2009 Daniel Gimpelevich + * + * 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include +#include +#include +#include +#include + +#include + +struct image_header { + char magic[4]; /* ASICII: GMTK */ + u32 checksum; /* CRC32 */ + u32 version; /* x.x.x.x */ + u32 kernelsz; /* The size of the kernel image */ + u32 imagesz; /* The length of this image file ( kernel + romfs + this header) */ + u32 pid; /* Product ID */ + u32 fastcksum; /* Partial CRC32 on (First(256), medium(256), last(512)) */ + u32 reserved; +}; + +static struct gpio_led ar525w_leds[] = { + { .name = "rdc321x:dmz", .gpio = 1, .active_low = 1}, +}; +static struct gpio_button ar525w_btns[] = { + { + .gpio = 6, + .code = BTN_0, + .desc = "Reset", + .active_low = 1, + } +}; + +static u32 __initdata crctab[257] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + 0 +}; + +static u32 __init crc32(u8 * buf, u32 len) +{ + register int i; + u32 sum; + register u32 s0; + s0 = ~0; + for (i = 0; i < len; i++) { + s0 = (s0 >> 8) ^ crctab[(u8) (s0 & 0xFF) ^ buf[i]]; + } + sum = ~s0; + return sum; +} + +static int __init fixup_ar525w_header(struct mtd_info *master, struct image_header *header) +{ + char *buffer; + int res; + u32 bufferlength = header->kernelsz + sizeof(struct image_header); + u32 len; + char crcbuf[0x400]; + + printk(KERN_INFO "Fixing up AR525W header, old image size: %u, new image size: %u\n", + header->imagesz, bufferlength); + + buffer = vmalloc(bufferlength); + if (!buffer) { + printk(KERN_ERR "Can't allocate %u bytes\n", bufferlength); + return -ENOMEM; + } + + res = master->read(master, 0x0, bufferlength, &len, buffer); + if (res || len != bufferlength) + goto out; + + header = (struct image_header *) buffer; + header->imagesz = bufferlength; + header->checksum = 0; + header->fastcksum = 0; + + memcpy(crcbuf, buffer, 0x100); + memcpy(crcbuf + 0x100, buffer + (bufferlength >> 1) - ((bufferlength & 0x6) >> 1), 0x100); + memcpy(crcbuf + 0x200, buffer + bufferlength - 0x200, 0x200); + + header->fastcksum = crc32(crcbuf, sizeof(crcbuf)); + header->checksum = crc32(buffer, bufferlength); + + if (master->unlock) + master->unlock(master, 0, master->erasesize); + res = erase_write (master, 0, master->erasesize, buffer); + if (res) + printk(KERN_ERR "Can't rewrite image header\n"); + +out: + vfree(buffer); + return res; +} + +static int __init parse_ar525w_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long plat_data) +{ + struct image_header header; + int res; + size_t len; + struct mtd_partition *rdc_flash_parts; + struct rdc_platform_data *pdata = (struct rdc_platform_data *) plat_data; + + if (master->size != 0x400000) //4MB + return -ENOSYS; + + res = master->read(master, 0x0, sizeof(header), &len, (char *)&header); + if (res) + return res; + + if (strncmp(header.magic, "GMTK", 4)) + return -ENOSYS; + + if (header.kernelsz > 0x400000 || header.kernelsz < master->erasesize) { + printk(KERN_ERR "AR525W image header found, but seems corrupt, kernel size %u\n", header.kernelsz); + return -EINVAL; + } + + if (header.kernelsz + sizeof(header) != header.imagesz) { + res = fixup_ar525w_header(master, &header); + if (res) + return res; + } + + rdc_flash_parts = kzalloc(sizeof(struct mtd_partition) * 3, GFP_KERNEL); + + rdc_flash_parts[0].name = "firmware"; + rdc_flash_parts[0].offset = 0x0; + rdc_flash_parts[0].size = 0x3E0000; + rdc_flash_parts[1].name = "rootfs"; + rdc_flash_parts[1].offset = header.kernelsz + sizeof(header); + rdc_flash_parts[1].size = rdc_flash_parts[0].size - rdc_flash_parts[1].offset; + rdc_flash_parts[2].name = "bootloader"; + rdc_flash_parts[2].offset = 0x3E0000; + rdc_flash_parts[2].size = 0x20000; + + *pparts = rdc_flash_parts; + + pdata->led_data.num_leds = ARRAY_SIZE(ar525w_leds); + pdata->led_data.leds = ar525w_leds; + pdata->button_data.nbuttons = ARRAY_SIZE(ar525w_btns); + pdata->button_data.buttons = ar525w_btns; + + return 3; +} + +static struct mtd_part_parser __initdata ar525w_parser = { + .owner = THIS_MODULE, + .parse_fn = parse_ar525w_partitions, + .name = "AR525W", +}; + +static int __init ar525w_setup(void) +{ + return register_mtd_parser(&ar525w_parser); +} + +arch_initcall(ar525w_setup); diff --git a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/bifferboard.c b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/bifferboard.c new file mode 100644 index 000000000..076459e69 --- /dev/null +++ b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/bifferboard.c @@ -0,0 +1,82 @@ +/* + * Bifferboard RDC321x platform devices + * + * Copyright (C) 2010 bifferos@yahoo.co.uk + * + * 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include +#include +#include + +#include + +static int __init parse_bifferboard_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long plat_data) +{ + int res; + size_t len; + struct mtd_partition *rdc_flash_parts; + u32 kernel_len; + u16 tmp; + + if (master->size == 0x100000) + kernel_len = master->size - 0x10000; + else { + res = master->read(master, 0x4000 + 1036, 2, &len, (char *) &tmp); + if (res) + return res; + kernel_len = tmp * master->erasesize; + } + + rdc_flash_parts = kzalloc(sizeof(struct mtd_partition) * 4, GFP_KERNEL); + + *pparts = rdc_flash_parts; + + rdc_flash_parts[0].name = "biffboot"; + rdc_flash_parts[0].offset = master->size - 0x10000; + rdc_flash_parts[0].size = 0x10000; + rdc_flash_parts[0].mask_flags = MTD_WRITEABLE; + rdc_flash_parts[1].name = "firmware"; + rdc_flash_parts[1].offset = 0; + rdc_flash_parts[1].size = rdc_flash_parts[0].offset; + rdc_flash_parts[2].name = "kernel"; + rdc_flash_parts[2].offset = 0x00000000; + rdc_flash_parts[2].size = kernel_len; + + if (master->size == 0x100000) + return 2; + + rdc_flash_parts[3].name = "rootfs"; + rdc_flash_parts[3].offset = MTDPART_OFS_APPEND; + rdc_flash_parts[3].size = rdc_flash_parts[1].size - rdc_flash_parts[2].size; + + return 4; +} + +struct mtd_part_parser __initdata bifferboard_parser = { + .owner = THIS_MODULE, + .parse_fn = parse_bifferboard_partitions, + .name = "Bifferboard", +}; + +static int __init bifferboard_setup(void) +{ + return register_mtd_parser(&bifferboard_parser); +} + +arch_initcall(bifferboard_setup); diff --git a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/r8610.c b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/r8610.c new file mode 100644 index 000000000..d10afa3d4 --- /dev/null +++ b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/r8610.c @@ -0,0 +1,65 @@ +/* + * R8610 RDC321x platform devices + * + * Copyright (C) 2009, Florian Fainelli + * + * 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include +#include +#include + +#include + +static int __init parse_r8610_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long plat_data) +{ + struct mtd_partition *rdc_flash_parts; + + rdc_flash_parts = kzalloc(sizeof(struct mtd_partition) * 4, GFP_KERNEL); + + *pparts = rdc_flash_parts; + + rdc_flash_parts[0].name = "kernel"; + rdc_flash_parts[0].size = 0x001f0000; + rdc_flash_parts[0].offset = 0; + rdc_flash_parts[1].name = "config"; + rdc_flash_parts[1].size = 0x10000; + rdc_flash_parts[1].offset = MTDPART_OFS_APPEND; + rdc_flash_parts[2].name = "rootfs"; + rdc_flash_parts[2].size = 0x1E0000; + rdc_flash_parts[2].offset = MTDPART_OFS_APPEND; + rdc_flash_parts[3].name = "redboot"; + rdc_flash_parts[3].size = 0x20000; + rdc_flash_parts[3].offset = MTDPART_OFS_APPEND; + rdc_flash_parts[3].mask_flags = MTD_WRITEABLE; + + return 4; +} + +struct mtd_part_parser __initdata r8610_parser = { + .owner = THIS_MODULE, + .parse_fn = parse_r8610_partitions, + .name = "R8610", +}; + +static int __init r8610_setup(void) +{ + return register_mtd_parser(&r8610_parser); +} + +arch_initcall(r8610_setup); diff --git a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/sitecom.c b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/sitecom.c new file mode 100644 index 000000000..11f34f8d2 --- /dev/null +++ b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/sitecom.c @@ -0,0 +1,111 @@ +/* + * Sitecom RDC321x platform devices + * + * Copyright (C) 2007-2009 OpenWrt.org + * Copyright (C) 2007 Florian Fainelli + * Copyright (C) 2008-2009 Daniel Gimpelevich + * + * 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include +#include +#include + +#include + +struct image_header { + char magic[4]; + u32 kernel_length; + u32 ramdisk_length; + char magic2[4]; + u32 kernel_length2; +}; + +static struct gpio_led sitecom_leds[] = { + { .name = "rdc321x:power", .gpio = 15, .active_low = 1}, + { .name = "rdc321x:usb0", .gpio = 0, .active_low = 1}, + { .name = "rdc321x:usb1", .gpio = 1, .active_low = 1}, +}; + +static struct gpio_button sitecom_btns[] = { + { + .gpio = 6, + .code = BTN_0, + .desc = "Reset", + .active_low = 1, + } +}; + +static int __init parse_sitecom_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long plat_data) +{ + struct image_header header; + int res; + size_t len; + struct mtd_partition *rdc_flash_parts; + struct rdc_platform_data *pdata = (struct rdc_platform_data *) plat_data; + + if (master->size != 0x400000) //4MB + return -ENOSYS; + + res = master->read(master, 0x8000, sizeof(header), &len, (char *)&header); + if (res) + return res; + + if (strncmp(header.magic, "CSYS", 4) || strncmp(header.magic2, "WRRM", 4)) + return -ENOSYS; + + rdc_flash_parts = kzalloc(sizeof(struct mtd_partition) * 5, GFP_KERNEL); + + rdc_flash_parts[0].name = "firmware"; + rdc_flash_parts[0].offset = 0x8000; + rdc_flash_parts[0].size = 0x3F0000; + rdc_flash_parts[1].name = "config"; + rdc_flash_parts[1].offset = 0; + rdc_flash_parts[1].size = 0x8000; + rdc_flash_parts[2].name = "kernel"; + rdc_flash_parts[2].offset = 0x8014; + rdc_flash_parts[2].size = header.kernel_length; + rdc_flash_parts[3].name = "rootfs"; + rdc_flash_parts[3].offset = 0x8014 + header.kernel_length; + rdc_flash_parts[3].size = 0x3F0000 - rdc_flash_parts[3].offset; + rdc_flash_parts[4].name = "bootloader"; + rdc_flash_parts[4].offset = 0x3F0000; + rdc_flash_parts[4].size = 0x10000; + + *pparts = rdc_flash_parts; + + pdata->led_data.num_leds = ARRAY_SIZE(sitecom_leds); + pdata->led_data.leds = sitecom_leds; + pdata->button_data.nbuttons = ARRAY_SIZE(sitecom_btns); + pdata->button_data.buttons = sitecom_btns; + + return 5; +} + +struct mtd_part_parser __initdata sitecom_parser = { + .owner = THIS_MODULE, + .parse_fn = parse_sitecom_partitions, + .name = "Sitecom", +}; + +static int __init sitecom_setup(void) +{ + return register_mtd_parser(&sitecom_parser); +} + +arch_initcall(sitecom_setup); diff --git a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/platform.c b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/platform.c index 3b3de774e..f655458bc 100644 --- a/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/platform.c +++ b/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/platform.c @@ -23,267 +23,98 @@ */ #include -#include -#include -#include +//#include +//#include +//#include #include -#include -#include -#include -#include +//#include +//#include #include #include #include #include -/* Flash */ -#ifdef CONFIG_MTD_R8610 -#define CONFIG_MTD_RDC3210 1 -#elif defined CONFIG_MTD_RDC3210 -static struct resource rdc_flash_resource[] = { - [0] = { - .start = (u32)-CONFIG_MTD_RDC3210_SIZE, - .end = (u32)-1, - .flags = IORESOURCE_MEM, - }, -}; +#include -static struct platform_device rdc_flash_device = { - .name = "rdc321x-flash", - .id = -1, - .num_resources = ARRAY_SIZE(rdc_flash_resource), - .resource = rdc_flash_resource, -}; -#else -static struct mtd_partition rdc_flash_parts[15]; - -static struct resource rdc_flash_resource = { - .end = (u32)-1, - .flags = IORESOURCE_MEM, -}; - -static struct physmap_flash_data rdc_flash_data = { - .parts = rdc_flash_parts, -}; - -static struct platform_device rdc_flash_device = { - .name = "physmap-flash", - .id = -1, - .resource = &rdc_flash_resource, - .num_resources = 1, - .dev.platform_data = &rdc_flash_data, -}; -#endif +static struct rdc_platform_data rdcplat_data; /* LEDS */ -static struct gpio_led default_leds[] = { - { .name = "rdc321x:dmz", .gpio = 1, .active_low = 1}, -}; - -static struct gpio_led sitecom_leds[] = { - { .name = "rdc321x:power", .gpio = 15, .active_low = 1}, - { .name = "rdc321x:usb0", .gpio = 0, .active_low = 1}, - { .name = "rdc321x:usb1", .gpio = 1, .active_low = 1}, -}; - -static struct gpio_led_platform_data rdc321x_led_data = { - .num_leds = ARRAY_SIZE(default_leds), - .leds = default_leds, -}; - static struct platform_device rdc321x_leds = { .name = "leds-gpio", .id = -1, .dev = { - .platform_data = &rdc321x_led_data, + .platform_data = &rdcplat_data.led_data, } }; /* Button */ -static struct gpio_button rdc321x_gpio_btn[] = { - { - .gpio = 6, - .code = BTN_0, - .desc = "Reset", - .active_low = 1, - } -}; - -static struct gpio_buttons_platform_data rdc321x_gpio_btn_data = { - .buttons = rdc321x_gpio_btn, - .nbuttons = ARRAY_SIZE(rdc321x_gpio_btn), -}; - -static struct platform_device rdc321x_button = { +static struct platform_device rdc321x_buttons = { .name = "gpio-buttons", .id = -1, .dev = { - .platform_data = &rdc321x_gpio_btn_data, + .platform_data = &rdcplat_data.button_data, } }; - -static struct platform_device *rdc321x_devs[] = { - &rdc_flash_device, + +static __initdata struct platform_device *rdc321x_devs[] = { &rdc321x_leds, - &rdc321x_button, + &rdc321x_buttons, }; -static int probe_flash_start(struct map_info *the_map) -{ - struct mtd_info *res; +const char *__initdata boards[] = { + "Sitecom", + "AR525W", + "Bifferboard", + "R8610", + 0 +}; - the_map->virt = ioremap(the_map->phys, the_map->size); - if (the_map->virt == NULL) - return 1; - for (the_map->bankwidth = 32; the_map->bankwidth; the_map->bankwidth - >>= 1) { - res = do_map_probe("cfi_probe", the_map); - if (res == NULL) - res = do_map_probe("jedec_probe", the_map); - if (res != NULL) - break; - } - iounmap(the_map->virt); - if (res != NULL) - the_map->phys = (u32)-(s32)(the_map->size = res->size); - return res == NULL; -} +static struct map_info rdc_map_info = { + .name = "rdc_flash", + .size = 0x800000, //8MB + .phys = 0xFF800000, //(u32) -rdc_map_info.size; + .bankwidth = 2 +}; static int __init rdc_board_setup(void) { -#ifndef CONFIG_MTD_RDC3210 - struct map_info rdc_map_info; - u32 the_header[8]; - - ROOT_DEV = 0; - rdc_map_info.name = rdc_flash_device.name; - rdc_map_info.size = 0x800000; //8MB - rdc_map_info.phys = (u32) -rdc_map_info.size; - rdc_map_info.bankwidth = 2; - rdc_map_info.set_vpp = NULL; + struct mtd_partition *partitions; + int count, res; + struct mtd_info *mtdinfo; + simple_map_init(&rdc_map_info); - while (probe_flash_start(&rdc_map_info)) { - if (rdc_map_info.size /= 2 < 0x100000) //1MB - panic("Could not find start of flash!"); + + while (true) { + rdc_map_info.virt = ioremap(rdc_map_info.phys, rdc_map_info.size); + if (rdc_map_info.virt == NULL) + continue; + + mtdinfo = do_map_probe("cfi_probe", &rdc_map_info); + if (mtdinfo == NULL) + mtdinfo = do_map_probe("jedec_probe", &rdc_map_info); + if (mtdinfo != NULL) + break; + + iounmap(rdc_map_info.virt); + if ((rdc_map_info.size >>= 1) < 0x100000) //1MB + panic("RDC321x: Could not find start of flash!"); rdc_map_info.phys = (u32) -rdc_map_info.size; } - rdc_flash_resource.start = rdc_map_info.phys; - rdc_flash_data.width = rdc_map_info.bankwidth; - rdc_map_info.virt = ioremap_nocache(rdc_map_info.phys, 0x10); - if (rdc_map_info.virt == NULL) - panic("Could not ioremap to read device magic!"); - the_header[0] = ((u32 *)rdc_map_info.virt)[0]; - the_header[1] = ((u32 *)rdc_map_info.virt)[1]; - the_header[2] = ((u32 *)rdc_map_info.virt)[2]; - the_header[3] = ((u32 *)rdc_map_info.virt)[3]; - iounmap(rdc_map_info.virt); - rdc_map_info.virt = ioremap_nocache(rdc_map_info.phys + 0x8000, 0x10); - if (rdc_map_info.virt == NULL) - panic("Could not ioremap to read device magic!"); - the_header[4] = ((u32 *)rdc_map_info.virt)[0]; - the_header[5] = ((u32 *)rdc_map_info.virt)[1]; - the_header[6] = ((u32 *)rdc_map_info.virt)[2]; - the_header[7] = ((u32 *)rdc_map_info.virt)[3]; - iounmap(rdc_map_info.virt); - if (!memcmp(the_header, "GMTK", 4)) { /* Gemtek */ - /* TODO */ - } else if (!memcmp(the_header + 4, "CSYS", 4)) { /* Sitecom */ - rdc_flash_parts[0].name = "system"; - rdc_flash_parts[0].offset = 0; - rdc_flash_parts[0].size = rdc_map_info.size - 0x10000; - rdc_flash_parts[1].name = "config"; - rdc_flash_parts[1].offset = 0; - rdc_flash_parts[1].size = 0x8000; - rdc_flash_parts[2].name = "magic"; - rdc_flash_parts[2].offset = 0x8000; - rdc_flash_parts[2].size = 0x14; - rdc_flash_parts[3].name = "kernel"; - rdc_flash_parts[3].offset = 0x8014; - rdc_flash_parts[3].size = the_header[5]; - rdc_flash_parts[4].name = "rootfs"; - rdc_flash_parts[4].offset = 0x8014 + the_header[5]; - rdc_flash_parts[4].size = rdc_flash_parts[0].size - rdc_flash_parts[4].offset; - rdc_flash_parts[5].name = "bootloader"; - rdc_flash_parts[5].offset = rdc_flash_parts[0].size; - rdc_flash_parts[5].size = 0x10000; - rdc_flash_data.nr_parts = 6; - - rdc321x_led_data.num_leds = ARRAY_SIZE(sitecom_leds); - rdc321x_led_data.leds = sitecom_leds; - } else if (!memcmp(((u8 *)the_header) + 14, "Li", 2)) { /* AMIT */ - rdc_flash_parts[0].name = "kernel_parthdr"; - rdc_flash_parts[0].offset = 0; - rdc_flash_parts[0].size = 0x10; - rdc_flash_parts[1].name = "kernel"; - rdc_flash_parts[1].offset = 0x10; - rdc_flash_parts[1].size = 0xffff0; - rdc_flash_parts[2].name = "rootfs_parthdr"; - rdc_flash_parts[2].offset = 0x100000; - rdc_flash_parts[2].size = 0x10; - rdc_flash_parts[3].name = "rootfs"; - rdc_flash_parts[3].offset = 0x100010; - rdc_flash_parts[3].size = rdc_map_info.size - 0x160010; - rdc_flash_parts[4].name = "config_parthdr"; - rdc_flash_parts[4].offset = rdc_map_info.size - 0x60000; - rdc_flash_parts[4].size = 0x10; - rdc_flash_parts[5].name = "config"; - rdc_flash_parts[5].offset = rdc_map_info.size - 0x5fff0; - rdc_flash_parts[5].size = 0xfff0; - rdc_flash_parts[6].name = "recoveryfs_parthdr"; - rdc_flash_parts[6].offset = rdc_map_info.size - 0x50000; - rdc_flash_parts[6].size = 0x10; - rdc_flash_parts[7].name = "recoveryfs"; - rdc_flash_parts[7].offset = rdc_map_info.size - 0x4fff0; - rdc_flash_parts[7].size = 0x3fff0; - rdc_flash_parts[8].name = "recovery_parthdr"; - rdc_flash_parts[8].offset = rdc_map_info.size - 0x10000; - rdc_flash_parts[8].size = 0x10; - rdc_flash_parts[9].name = "recovery"; - rdc_flash_parts[9].offset = rdc_map_info.size - 0xfff0; - rdc_flash_parts[9].size = 0x7ff0; - rdc_flash_parts[10].name = "productinfo_parthdr"; - rdc_flash_parts[10].offset = rdc_map_info.size - 0x8000; - rdc_flash_parts[10].size = 0x10; - rdc_flash_parts[11].name = "productinfo"; - rdc_flash_parts[11].offset = rdc_map_info.size - 0x7ff0; - rdc_flash_parts[11].size = 0x1ff0; - rdc_flash_parts[12].name = "bootloader_parthdr"; - rdc_flash_parts[12].offset = rdc_map_info.size - 0x6000; - rdc_flash_parts[12].size = 0x10; - rdc_flash_parts[13].name = "bootloader"; - rdc_flash_parts[13].offset = rdc_map_info.size - 0x5ff0; - rdc_flash_parts[13].size = 0x5ff0; - rdc_flash_parts[14].name = "everything"; - rdc_flash_parts[14].offset = 0; - rdc_flash_parts[14].size = rdc_map_info.size; - rdc_flash_data.nr_parts = 15; - } else { /* ZyXEL */ - rdc_flash_parts[0].name = "kernel"; - rdc_flash_parts[0].offset = 0; - rdc_flash_parts[0].size = 0x100000; - rdc_flash_parts[1].name = "rootfs"; - rdc_flash_parts[1].offset = 0x100000; - rdc_flash_parts[1].size = rdc_map_info.size - 0x140000; - rdc_flash_parts[2].name = "linux"; - rdc_flash_parts[2].offset = 0; - rdc_flash_parts[2].size = rdc_map_info.size - 0x40000; - rdc_flash_parts[3].name = "config"; - rdc_flash_parts[3].offset = rdc_map_info.size - 0x40000; - rdc_flash_parts[3].size = 0x10000; - rdc_flash_parts[4].name = "productinfo"; - rdc_flash_parts[4].offset = rdc_map_info.size - 0x30000; - rdc_flash_parts[4].size = 0x10000; - rdc_flash_parts[5].name = "bootloader"; - rdc_flash_parts[5].offset = rdc_map_info.size - 0x20000; - rdc_flash_parts[5].size = 0x20000; - rdc_flash_data.nr_parts = 6; + + count = parse_mtd_partitions(mtdinfo, boards, &partitions, (unsigned long) &rdcplat_data); + + if (count <= 0) { + panic("RDC321x: can't identify board type"); + return -ENOSYS; } -#endif + + ROOT_DEV = 0; + res = add_mtd_partitions(mtdinfo, partitions, count); + if (res) + return res; + return platform_add_devices(rdc321x_devs, ARRAY_SIZE(rdc321x_devs)); + } -#ifdef CONFIG_MTD_RDC3210 -arch_initcall(rdc_board_setup); -#else late_initcall(rdc_board_setup); -#endif diff --git a/target/linux/rdc/image/Makefile b/target/linux/rdc/image/Makefile index 9b4c13508..59d59b4a7 100644 --- a/target/linux/rdc/image/Makefile +++ b/target/linux/rdc/image/Makefile @@ -26,62 +26,20 @@ define Image/Prepare/squashfs endef define Image/Build/ar525w - touch $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2).img - touch $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2)-web.img - dd if=$(KDIR)/root.$(1) of=$(KDIR)/root.tmp $(call trxalign/$(1)) conv=sync - mv $(KDIR)/root.tmp $(KDIR)/root.$(1) - $(STAGING_DIR_HOST)/bin/airlink -b 1 -j $(shell bash -c 'echo $$[$(3)]') $(KDIR)/bzImage $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2).img - $(STAGING_DIR_HOST)/bin/airlink -e -b 1 -j $(shell bash -c 'echo $$[$(3)]') $(KDIR)/bzImage $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2)-web.img -endef - -define Image/Postprocess/sitecom/squashfs - dd if=/dev/zero of=$(KDIR)/tmp2.img count=1 bs=32k #32k config data a start of flash - cat $(KDIR)/tmp.img >> $(KDIR)/tmp2.img - $(call prepare_generic_squashfs,$(KDIR)/tmp2.img) - dd if=$(KDIR)/tmp2.img of=$(KDIR)/tmp.img bs=32k skip=1 + cp $(KDIR)/bzImage $(KDIR)/bzImage.tmp + $(SCRIPT_DIR)/pad_image $(1) $(KDIR)/bzImage.tmp $(KDIR)/root.$(1) 32 + $(STAGING_DIR_HOST)/bin/airlink -b 1 $(KDIR)/bzImage.tmp $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2).img + $(STAGING_DIR_HOST)/bin/airlink -e -b 1 $(KDIR)/bzImage.tmp $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2)-web.img endef define Image/Build/sitecom - $(TOPDIR)/target/linux/rdc/image/mkimg_sitecom.pl $(KDIR)/bzImage > $(KDIR)/tmp.img + cp $(KDIR)/bzImage $(KDIR)/bzImage.tmp + #32k config data + 20 bytes header + 2 bytes checksum after kernel image + $(SCRIPT_DIR)/pad_image $(1) $(KDIR)/bzImage.tmp $(KDIR)/root.$(1) 32790 + $(TOPDIR)/target/linux/rdc/image/mkimg_sitecom.pl $(KDIR)/bzImage.tmp > $(KDIR)/tmp.img cat $(KDIR)/root.$(1) >> $(KDIR)/tmp.img - $(call Image/Postprocess/sitecom/$(1)) cp $(KDIR)/tmp.img $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2).img -endef - -define Image/Build/dir450 - touch $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2).img - dd if=$(KDIR)/root.$(1) of=$(KDIR)/root.tmp $(call trxalign/$(1)) conv=sync - mv $(KDIR)/root.tmp $(KDIR)/root.$(1) - $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/onlyrootfs-$(BOARD)-$(1)-$(2).img -endef - -define Image/Build/g570s - $(call Image/Prepare/$(1)) - mv $(KDIR)/root.$(1) $(KDIR)/root.tmp - dd of=$(KDIR)/root.$(1) if=$(KDIR)/root.tmp $(call trxalign/$(1)) conv=sync - $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-tftp-$(BOARD)-$(1)-$(2).img - dd of=$(BIN_DIR)/openwrt-tftp-$(BOARD)-$(1)-$(2).img if=/dev/null bs=1024 seek=1024 - cat $(KDIR)/root.$(1) >> $(BIN_DIR)/openwrt-tftp-$(BOARD)-$(1)-$(2).img - if [ ! -x $(STAGING_DIR_HOST)/bin/zyxel_combine ]; then echo "#ERR Please copy the ZyXEL \"combine\" tool as $(STAGING_DIR_HOST)/bin/zyxel_combine to build."; fi - sh -c "mkdir $(KDIR)/zyxel.tmp && cd $(KDIR)/zyxel.tmp && mv ../root.tmp initrd.bin && cp ../bzImage kernel.bin && $(STAGING_DIR_HOST)/bin/zyxel_combine -mcf kernel.bin initrd.bin && mv image $(BIN_DIR)/openwrt-$(BOARD)-$(1)-$(2).rmt" || : - $(RM) -r $(KDIR)/zyxel.tmp -endef - -define Image/Prepare/amit/squashfs - echo -n "0123456789abcdef" > $(KDIR)/root.tmp - cat $(KDIR)/root.squashfs >> $(KDIR)/root.tmp - dd if=$(KDIR)/root.tmp of=$(KDIR)/root2.tmp bs=64k conv=sync - dd if=$(KDIR)/root2.tmp of=$(KDIR)/root.squashfs bs=1 skip=16 - $(RM) $(KDIR)/root.tmp $(KDIR)/root2.tmp - $(call add_jffs2_mark,$(KDIR)/root.squashfs) -endef - -define Image/Build/amit - $(call Image/Prepare/amit/$(1)) - if [ ! -x $(STAGING_DIR_HOST)/bin/amit_makebin ]; then echo "#ERR Please copy the AMIT \"makebin\" tool from http://mgb111.pradnik.net/ as $(STAGING_DIR_HOST)/bin/amit_makebin to build."; fi - sh -c "mkdir -p $(KDIR)/amit.tmp/linux_src/arch/i386/boot $(KDIR)/amit.tmp/rom_disk && cd $(KDIR)/amit.tmp && ln -s ../../root.$(1) rom_disk/fs.img && ln -s ../../../../../bzImage linux_src/arch/i386/boot && $(STAGING_DIR_HOST)/bin/amit_makebin && mv upgrade.img $(BIN_DIR)/openwrt-$(BOARD)-$(1)-anas350.bin" || : - $(RM) -r $(KDIR)/amit.tmp - $(STAGING_DIR_HOST)/bin/makeamitbin -o $(BIN_DIR)/openwrt-$(BOARD)-$(1)-ar360w3g.bin -1 ALK_ATG001 -2 Atropos linux3g $(KDIR)/bzImage ramdisk3g $(KDIR)/root.$(1) + rm $(KDIR)/tmp.img $(KDIR)/bzImage.tmp endef define Image/Build/bifferboard diff --git a/target/linux/rdc/image/mkimg_sitecom.pl b/target/linux/rdc/image/mkimg_sitecom.pl index 4dd4a398c..cfd5e652f 100755 --- a/target/linux/rdc/image/mkimg_sitecom.pl +++ b/target/linux/rdc/image/mkimg_sitecom.pl @@ -1,17 +1,11 @@ #!/usr/bin/perl -$bzimgsize = -s @ARGV[0]; -$padding = 4 - ($bzimgsize + 2) % 4; -if ($padding == 4) { - $padding = 0; } open (bzimg, @ARGV[0]); while () { $i .= $_; } -$i .= "\0"x$padding; $i .= pack "v", -(unpack "%v*", $i); print "CSYS"; print pack("V", length($i)); print pack("V", 0); -#-s @ARGV[1] print "WRRM"; print pack("V", length($i)); print $i; diff --git a/target/linux/rdc/patches-2.6.30/012-export_erase_write.patch b/target/linux/rdc/patches-2.6.30/012-export_erase_write.patch new file mode 100644 index 000000000..2d6feba24 --- /dev/null +++ b/target/linux/rdc/patches-2.6.30/012-export_erase_write.patch @@ -0,0 +1,28 @@ +Index: linux-2.6.30.10/drivers/mtd/mtdblock.c +=================================================================== +--- linux-2.6.30.10.orig/drivers/mtd/mtdblock.c 2010-03-19 00:17:37.000000000 +0100 ++++ linux-2.6.30.10/drivers/mtd/mtdblock.c 2010-03-19 00:17:54.000000000 +0100 +@@ -45,7 +45,7 @@ + wake_up(wait_q); + } + +-static int erase_write (struct mtd_info *mtd, unsigned long pos, ++int erase_write (struct mtd_info *mtd, unsigned long pos, + int len, const char *buf) + { + struct erase_info erase; +Index: linux-2.6.30.10/include/linux/mtd/mtd.h +=================================================================== +--- linux-2.6.30.10.orig/include/linux/mtd/mtd.h 2010-03-19 00:17:42.000000000 +0100 ++++ linux-2.6.30.10/include/linux/mtd/mtd.h 2010-03-19 00:21:22.000000000 +0100 +@@ -319,6 +319,10 @@ + int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, + unsigned long count, loff_t from, size_t *retlen); + ++int erase_write (struct mtd_info *mtd, unsigned long pos, ++ int len, const char *buf); ++ ++ + #ifdef CONFIG_MTD_PARTITIONS + void mtd_erase_callback(struct erase_info *instr); + #else diff --git a/target/linux/rdc/r8610/config-2.6.30 b/target/linux/rdc/r8610/config-2.6.30 index edda24234..e69de29bb 100644 --- a/target/linux/rdc/r8610/config-2.6.30 +++ b/target/linux/rdc/r8610/config-2.6.30 @@ -1,3 +0,0 @@ -CONFIG_MTD_PHYSMAP=y -# CONFIG_MTD_R8610 is not set -# CONFIG_MTD_RDC3210 is not set From 1b0ddf18aac17e2e4d2e722afeb8733fb056c963 Mon Sep 17 00:00:00 2001 From: blogic Date: Fri, 19 Mar 2010 11:22:07 +0000 Subject: [PATCH 36/64] [ifxmips] adds support in uboot for eon flash chips git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20298 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../uboot-ifxmips/patches/120-eon_flash.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/uboot-ifxmips/patches/120-eon_flash.patch diff --git a/package/uboot-ifxmips/patches/120-eon_flash.patch b/package/uboot-ifxmips/patches/120-eon_flash.patch new file mode 100644 index 000000000..0a2624c72 --- /dev/null +++ b/package/uboot-ifxmips/patches/120-eon_flash.patch @@ -0,0 +1,28 @@ +Index: u-boot-1.1.5/board/ifx/danube/flash.c +=================================================================== +--- u-boot-1.1.5.orig/board/ifx/danube/flash.c 2010-03-19 12:12:27.000000000 +0100 ++++ u-boot-1.1.5/board/ifx/danube/flash.c 2010-03-19 12:12:30.000000000 +0100 +@@ -477,7 +477,10 @@ + printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); + info->flash_id = FLASH_MAN_MX ;//0x00030000 + break; +- ++ case (uchar)EON_MANUFACT: ++ printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); ++ info->flash_id = FLASH_MAN_AMD ; ++ break; + default: + printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); + info->flash_id = FLASH_UNKNOWN; +Index: u-boot-1.1.5/include/flash.h +=================================================================== +--- u-boot-1.1.5.orig/include/flash.h 2010-03-19 12:16:23.000000000 +0100 ++++ u-boot-1.1.5/include/flash.h 2010-03-19 12:16:48.000000000 +0100 +@@ -130,6 +130,7 @@ + #define TOSH_MANUFACT 0x00980098 /* TOSHIBA manuf. ID in D23..D16, D7..D0 */ + #define MT2_MANUFACT 0x002C002C /* alternate MICRON manufacturer ID*/ + #define EXCEL_MANUFACT 0x004A004A /* Excel Semiconductor */ ++#define EON_MANUFACT 0x0000007F + + #define EON_ID_EN29LV320B 0x22f9 + #define FLASH_29LV320B 0xE0 From aca2129d2d65c66ed60c8ab31c7ea3ebb4709550 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 19 Mar 2010 13:44:47 +0000 Subject: [PATCH 37/64] accept unknown server certificates by default on svn download Some packages sources need to be checked out from server with unknown certificates, silently accept by default in order not to stop builds, thanks rhk. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20299 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/download.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/download.mk b/include/download.mk index e0d743a4d..4e201464b 100644 --- a/include/download.mk +++ b/include/download.mk @@ -70,7 +70,7 @@ define DownloadMethod/svn cd $(TMP_DIR)/dl && \ rm -rf $(SUBDIR) && \ [ \! -d $(SUBDIR) ] && \ - svn export --non-interactive -r$(VERSION) $(URL) $(SUBDIR) && \ + svn export --non-interactive --trust-server-cert -r$(VERSION) $(URL) $(SUBDIR) && \ echo "Packing checkout..." && \ $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \ mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \ From 393b91d29a76bf99908143d0d981f897c99c14cf Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 19 Mar 2010 16:34:41 +0000 Subject: [PATCH 38/64] [package] update compcache to 0.6.2 (#6884) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20303 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/compcache/Makefile | 21 ++-- package/compcache/files/compcache.init | 2 - .../patches/000-provide_lzo_kmod.patch | 95 +++++++++---------- .../patches/100-use_register_width.patch | 24 ----- .../patches/200-av_compress_ratio.patch | 39 -------- 5 files changed, 57 insertions(+), 124 deletions(-) delete mode 100644 package/compcache/patches/100-use_register_width.patch delete mode 100644 package/compcache/patches/200-av_compress_ratio.patch diff --git a/package/compcache/Makefile b/package/compcache/Makefile index 98a1cadf5..2fec28952 100644 --- a/package/compcache/Makefile +++ b/package/compcache/Makefile @@ -10,10 +10,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=compcache -PKG_VERSION:=0.5.4 +PKG_VERSION:=0.6.2 PKG_RELEASE:=$(PKG_VERSION)-1 PKG_SOURCE_URL:=http://compcache.googlecode.com/files/ -PKG_MD5SUM:=e83535925a014ac34e1eaeb4f7a2f49a +PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz @@ -25,22 +25,25 @@ define KernelPackage/compcache TITLE:=Driver for compressed ram swap device VERSION:=$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)+$(PKG_RELEASE) FILES:=$(PKG_BUILD_DIR)/ramzswap.$(LINUX_KMOD_SUFFIX) \ - $(PKG_BUILD_DIR)/sub-projects/compression/lzo-kmod/lzo1x.$(LINUX_KMOD_SUFFIX) \ - $(PKG_BUILD_DIR)/sub-projects/allocators/xvmalloc-kmod/xvmalloc.$(LINUX_KMOD_SUFFIX) + $(PKG_BUILD_DIR)/sub-projects/compression/lzo-kmod/lzo1x.$(LINUX_KMOD_SUFFIX) endef + include $(INCLUDE_DIR)/kernel-defaults.mk -XVM = sub-projects/allocators/xvmalloc-kmod LZO = sub-projects/compression/lzo-kmod +RZSC = sub-projects/rzscontrol -BUILDFLAGS:=-DCONFIG_BLK_DEV_RAMZSWAP_STATS \ - -I$(PKG_BUILD_DIR)/$(XVM) \ +BUILDFLAGS:=-DCONFIG_RAMZSWAP_STATS \ -I$(PKG_BUILD_DIR)/$(LZO) \ - -g -Wall + -Wall + +RZSCFLAGS:=-I$(PKG_BUILD_DIR)/$(RZSC)/../include \ + -I$(PKG_BUILD_DIR)/$(RZSC)/../.. define Build/Compile $(MAKE) $(KERNEL_MAKEOPTS) EXTRA_CFLAGS="$(BUILDFLAGS)" M="$(PKG_BUILD_DIR)" modules + $(TARGET_CC) $(TARGET_CFLAGS) $(RZSCFLAGS) $(PKG_BUILD_DIR)/$(RZSC)/rzscontrol.c -o $(PKG_BUILD_DIR)/rzscontrol endef define KernelPackage/compcache/install @@ -52,6 +55,8 @@ define KernelPackage/compcache/install $(1)/etc/config/compcache $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/compcache.init $(1)/etc/init.d/compcache + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rzscontrol $(1)/sbin/rzscontrol endef define KernelPackage/compcache/config diff --git a/package/compcache/files/compcache.init b/package/compcache/files/compcache.init index b9406d108..ec377ffaa 100644 --- a/package/compcache/files/compcache.init +++ b/package/compcache/files/compcache.init @@ -18,7 +18,6 @@ load_modules() { params_set="disksize_kb=$size_kbytes" fi if [ "`lsmod | grep 'ramzswap'`" == "" ]; then - insmod xvmalloc insmod lzo1x insmod ramzswap $params_set swapon /dev/ramzswap0 @@ -34,7 +33,6 @@ remove_modules() { [ "`cat /proc/swaps | grep 'ramzswap0'`" != "" ] && swapoff /dev/ramzswap0 [ "`lsmod | grep 'ramzswap'`" != "" ] && rmmod ramzswap &> /dev/null [ "`lsmod | grep 'lzo1x'`" != "" ] && rmmod lzo1x &> /dev/null - [ "`lsmod | grep 'xvmalloc'`" != "" ] && rmmod xvmalloc &> /dev/null fi } diff --git a/package/compcache/patches/000-provide_lzo_kmod.patch b/package/compcache/patches/000-provide_lzo_kmod.patch index 1ad4fb63a..369bc1feb 100644 --- a/package/compcache/patches/000-provide_lzo_kmod.patch +++ b/package/compcache/patches/000-provide_lzo_kmod.patch @@ -1,60 +1,53 @@ -diff -uNr compcache-0.5.4-old/Makefile compcache-0.5.4/Makefile ---- compcache-0.5.4-old/Makefile 2009-10-17 08:49:42.000000000 +0200 -+++ compcache-0.5.4/Makefile 2009-10-17 09:39:34.000000000 +0200 -@@ -1,19 +1,26 @@ +diff -uNr compcache-org/Makefile compcache-0.6.2/Makefile +--- compcache-org/Makefile 2010-01-24 17:46:50.000000000 +0100 ++++ compcache-0.6.2/Makefile 2010-03-18 16:00:41.000000000 +0100 +@@ -1,14 +1,17 @@ KERNEL_BUILD_PATH ?= "/lib/modules/$(shell uname -r)/build" XVM = sub-projects/allocators/xvmalloc-kmod --EXTRA_CFLAGS := -DCONFIG_BLK_DEV_RAMZSWAP_STATS \ -- -I$(PWD)/$(XVM) \ +LZO = sub-projects/compression/lzo-kmod -+ -+EXTRA_CFLAGS += -DCONFIG_BLK_DEV_RAMZSWAP_STATS \ -+ -I$(PWD)/$(XVM) \ -+ -I$(PWD)/$(LZO) \ - -g -Wall + EXTRA_CFLAGS := -DCONFIG_RAMZSWAP_STATS \ + -Wall - obj-m += $(XVM)/xvmalloc.o \ -+ $(LZO)/lzo1x.o \ - ramzswap.o +-obj-m += ramzswap.o ++obj-m += ramzswap.o $(LZO)/lzo1x.o + ramzswap-objs := ramzswap_drv.o $(XVM)/xvmalloc.o ++ all: - make -C $(KERNEL_BUILD_PATH) M=$(PWD)/$(XVM) modules -+ make -C $(KERNEL_BUILD_PATH) M=$(PWD)/$(LZO) modules make -C $(KERNEL_BUILD_PATH) M=$(PWD) modules - @ln -sf $(XVM)/xvmalloc.ko -+ @ln -sf $(LZO)/xvmalloc.ko ++ make -C $(KERNEL_BUILD_PATH) M=$(PWD)/$(LZO) modules + make -C sub-projects/rzscontrol + + doc: +@@ -16,5 +19,6 @@ clean: make -C $(KERNEL_BUILD_PATH) M=$(PWD) clean - make -C $(KERNEL_BUILD_PATH) M=$(PWD)/$(XVM) clean + make -C $(KERNEL_BUILD_PATH) M=$(PWD)/$(LZO) clean + make -C sub-projects/rzscontrol clean @rm -rf *.ko -diff -uNr compcache-0.5.4-old/ramzswap.c compcache-0.5.4/ramzswap.c ---- compcache-0.5.4-old/ramzswap.c 2009-10-17 08:50:06.000000000 +0200 -+++ compcache-0.5.4/ramzswap.c 2009-10-17 09:35:59.000000000 +0200 -@@ -20,7 +20,6 @@ +diff -uNr compcache-org/ramzswap_drv.c compcache-0.6.2/ramzswap_drv.c +--- compcache-org/ramzswap_drv.c 2010-01-24 17:52:19.000000000 +0100 ++++ compcache-0.6.2/ramzswap_drv.c 2010-03-18 16:03:23.000000000 +0100 +@@ -23,13 +23,13 @@ #include #include #include -#include - #include - #include #include -diff -uNr compcache-0.5.4-old/ramzswap.h compcache-0.5.4/ramzswap.h ---- compcache-0.5.4-old/ramzswap.h 2009-10-17 08:50:06.000000000 +0200 -+++ compcache-0.5.4/ramzswap.h 2009-10-17 09:40:45.000000000 +0200 -@@ -16,6 +16,7 @@ - #define _RAMZSWAP_H_ + #include + #include + #include + #include - #include "xvmalloc.h" +#include "lzo.h" + #include "compat.h" + #include "ramzswap_drv.h" - /* - * Stored at beginning of each compressed object. -diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x.c compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo1x.c ---- compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x.c 1970-01-01 01:00:00.000000000 +0100 -+++ compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo1x.c 2009-10-17 09:35:59.000000000 +0200 +diff -uNr compcache-old/sub-projects/compression/lzo-kmod/lzo1x.c compcache/sub-projects/compression/lzo-kmod/lzo1x.c +--- compcache-old/sub-projects/compression/lzo-kmod/lzo1x.c 1970-01-01 01:00:00.000000000 +0100 ++++ compcache/sub-projects/compression/lzo-kmod/lzo1x.c 2009-10-17 09:35:59.000000000 +0200 @@ -0,0 +1,7 @@ +#include + @@ -63,9 +56,9 @@ diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x.c compcach + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("LZO1X Lib"); -diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x_compress.c compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo1x_compress.c ---- compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x_compress.c 1970-01-01 01:00:00.000000000 +0100 -+++ compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo1x_compress.c 2009-10-17 09:35:59.000000000 +0200 +diff -uNr compcache-old/sub-projects/compression/lzo-kmod/lzo1x_compress.c compcache/sub-projects/compression/lzo-kmod/lzo1x_compress.c +--- compcache-old/sub-projects/compression/lzo-kmod/lzo1x_compress.c 1970-01-01 01:00:00.000000000 +0100 ++++ compcache/sub-projects/compression/lzo-kmod/lzo1x_compress.c 2009-10-17 09:35:59.000000000 +0200 @@ -0,0 +1,227 @@ +/* + * LZO1X Compressor from MiniLZO @@ -294,9 +287,9 @@ diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x_compress.c +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("LZO1X-1 Compressor"); + -diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x_decompress.c compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo1x_decompress.c ---- compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x_decompress.c 1970-01-01 01:00:00.000000000 +0100 -+++ compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo1x_decompress.c 2009-10-17 09:35:59.000000000 +0200 +diff -uNr compcache-old/sub-projects/compression/lzo-kmod/lzo1x_decompress.c compcache/sub-projects/compression/lzo-kmod/lzo1x_decompress.c +--- compcache-old/sub-projects/compression/lzo-kmod/lzo1x_decompress.c 1970-01-01 01:00:00.000000000 +0100 ++++ compcache/sub-projects/compression/lzo-kmod/lzo1x_decompress.c 2009-10-17 09:35:59.000000000 +0200 @@ -0,0 +1,255 @@ +/* + * LZO1X Decompressor from MiniLZO @@ -553,9 +546,9 @@ diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo1x_decompress +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("LZO1X Decompressor"); + -diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzodefs.h compcache-0.5.4/sub-projects/compression/lzo-kmod/lzodefs.h ---- compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzodefs.h 1970-01-01 01:00:00.000000000 +0100 -+++ compcache-0.5.4/sub-projects/compression/lzo-kmod/lzodefs.h 2009-10-17 09:35:59.000000000 +0200 +diff -uNr compcache-old/sub-projects/compression/lzo-kmod/lzodefs.h compcache/sub-projects/compression/lzo-kmod/lzodefs.h +--- compcache-old/sub-projects/compression/lzo-kmod/lzodefs.h 1970-01-01 01:00:00.000000000 +0100 ++++ compcache/sub-projects/compression/lzo-kmod/lzodefs.h 2009-10-17 09:35:59.000000000 +0200 @@ -0,0 +1,43 @@ +/* + * lzodefs.h -- architecture, OS and compiler specific defines @@ -600,9 +593,9 @@ diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzodefs.h compca +#define DX2(p, s1, s2) (((((size_t)((p)[2]) << (s2)) ^ (p)[1]) \ + << (s1)) ^ (p)[0]) +#define DX3(p, s1, s2, s3) ((DX2((p)+1, s2, s3) << (s1)) ^ (p)[0]) -diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo.h compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo.h ---- compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo.h 1970-01-01 01:00:00.000000000 +0100 -+++ compcache-0.5.4/sub-projects/compression/lzo-kmod/lzo.h 2009-10-17 09:35:59.000000000 +0200 +diff -uNr compcache-old/sub-projects/compression/lzo-kmod/lzo.h compcache/sub-projects/compression/lzo-kmod/lzo.h +--- compcache-old/sub-projects/compression/lzo-kmod/lzo.h 1970-01-01 01:00:00.000000000 +0100 ++++ compcache/sub-projects/compression/lzo-kmod/lzo.h 2009-10-17 09:35:59.000000000 +0200 @@ -0,0 +1,44 @@ +#ifndef __LZO_H__ +#define __LZO_H__ @@ -648,9 +641,9 @@ diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/lzo.h compcache- +#define LZO_E_NOT_YET_IMPLEMENTED (-9) + +#endif -diff -uNr compcache-0.5.4-old/sub-projects/compression/lzo-kmod/Makefile compcache-0.5.4/sub-projects/compression/lzo-kmod/Makefile ---- compcache-0.5.4-old/sub-projects/compression/lzo-kmod/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ compcache-0.5.4/sub-projects/compression/lzo-kmod/Makefile 2009-10-17 09:35:59.000000000 +0200 +diff -uNr compcache-old/sub-projects/compression/lzo-kmod/Makefile compcache/sub-projects/compression/lzo-kmod/Makefile +--- compcache-old/sub-projects/compression/lzo-kmod/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ compcache/sub-projects/compression/lzo-kmod/Makefile 2009-10-17 09:35:59.000000000 +0200 @@ -0,0 +1,8 @@ +obj-m += lzo1x_compress.o lzo1x_decompress.o + diff --git a/package/compcache/patches/100-use_register_width.patch b/package/compcache/patches/100-use_register_width.patch deleted file mode 100644 index 6200d56fd..000000000 --- a/package/compcache/patches/100-use_register_width.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -uNr compcache-0.5.2/compcache.c compcache/compcache.c ---- compcache-0.5.2/compcache.c 2009-03-10 13:03:56.000000000 +0100 -+++ compcache/ramzswap.c 2009-04-01 17:38:20.000000000 +0200 -@@ -68,15 +68,15 @@ - static int page_zero_filled(void *ptr) - { - u32 pos; -- u64 *page; -- -- page = (u64 *)ptr; -- -+#if defined(CONFIG_64BIT) -+ u64 *page = (u64 *)ptr; -+#else -+ u32 *page = (u32 *)ptr; -+#endif - for (pos = 0; pos != PAGE_SIZE / sizeof(*page); pos++) { - if (page[pos]) - return 0; - } -- - return 1; - } - diff --git a/package/compcache/patches/200-av_compress_ratio.patch b/package/compcache/patches/200-av_compress_ratio.patch deleted file mode 100644 index 82a1ecce8..000000000 --- a/package/compcache/patches/200-av_compress_ratio.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -uNr compcache-0.5.4-old/ramzswap.c compcache-0.5.4/ramzswap.c ---- compcache-0.5.4-old/ramzswap.c 2009-10-18 09:14:53.000000000 +0200 -+++ compcache-0.5.4/ramzswap.c 2009-10-18 09:12:08.000000000 +0200 -@@ -126,7 +126,9 @@ - { - int len; - size_t succ_writes, mem_used; -- unsigned int good_compress_perc = 0, no_compress_perc = 0; -+ unsigned int good_compress_perc = 0, -+ av_compression_perc = 0, -+ no_compress_perc = 0; - - mem_used = xv_get_total_size_bytes(rzs.mem_pool) - + (stats.pages_expand << PAGE_SHIFT); -@@ -154,6 +156,8 @@ - if (succ_writes && stats.pages_stored) { - good_compress_perc = stats.good_compress * 100 - / stats.pages_stored; -+ av_compression_perc = stats.compr_size * 100 -+ / (stats.good_compress << PAGE_SHIFT); - no_compress_perc = stats.pages_expand * 100 - / stats.pages_stored; - } -@@ -168,6 +172,7 @@ - "NotifyFree: %8llu\n" - "ZeroPages: %8u\n" - "GoodCompress: %8u %%\n" -+ "AvCompression: %8u %%\n" - "NoCompress: %8u %%\n" - "PagesStored: %8u\n" - "PagesUsed: %8zu\n" -@@ -182,6 +187,7 @@ - stats.notify_free, - stats.pages_zero, - good_compress_perc, -+ av_compression_perc, - no_compress_perc, - stats.pages_stored, - mem_used >> PAGE_SHIFT, From 944f5a8ff2cb63ac665c82b5df92f313376162ae Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Mar 2010 10:27:18 +0000 Subject: [PATCH 39/64] [package] add sn9c201 webcam driver, patch from Chris Li git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20310 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/video.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/modules/video.mk b/package/kernel/modules/video.mk index 4308a2a19..c0ab5d15a 100644 --- a/package/kernel/modules/video.mk +++ b/package/kernel/modules/video.mk @@ -323,6 +323,21 @@ endef $(eval $(call KernelPackage,video-gspca-pac7311)) +define KernelPackage/video-gspca-sn9c20x +$(call KernelPackage/video-gspca/Depends,@LINUX_2_6 @USB_SUPPORT +kmod-usb-core) + TITLE:=sn9c20x webcam support + KCONFIG:=CONFIG_USB_GSPCA_SN9C20X + FILES:=$(LINUX_DIR)/drivers/media/video/gspca/gspca_sn9c20x.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,75,sn9c20x) +endef + +define KernelPackage/video-gspca-sn9c20x/description + The SN9C20X USB Camera Driver (sn9c20x) kernel module. +endef + +$(eval $(call KernelPackage,video-gspca-sn9c20x)) + + define KernelPackage/video-gspca-sonixb $(call KernelPackage/video-gspca/Depends,) TITLE:=sonixb webcam support From 4e01d0a25985a492cce47c7583cb6bafbd23ce17 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Mar 2010 10:27:24 +0000 Subject: [PATCH 40/64] [package] update netfilter packages description, patch from Edgar Soldin git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20311 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/netfilter.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/kernel/modules/netfilter.mk b/package/kernel/modules/netfilter.mk index c8f8b1381..0b8cb21a9 100644 --- a/package/kernel/modules/netfilter.mk +++ b/package/kernel/modules/netfilter.mk @@ -49,7 +49,12 @@ endef define KernelPackage/ipt-conntrack/description Netfilter (IPv4) kernel modules for connection tracking Includes: + - conntrack + - defrag + - iptables_raw + - NOTRACK - state + - xt_NOTRACK endef $(eval $(call KernelPackage,ipt-conntrack)) @@ -71,7 +76,6 @@ define KernelPackage/ipt-conntrack-extra/description - conntrack - helper - recent - - NOTRACK endef $(eval $(call KernelPackage,ipt-conntrack-extra)) @@ -309,8 +313,6 @@ define KernelPackage/ipt-extra/description - ipt_physdev - ipt_pkttype - ipt_recent - - iptable_raw - - xt_NOTRACK endef $(eval $(call KernelPackage,ipt-extra)) From e3e02843a6f8191790b23e4d14f4523e0bbd84b7 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Mar 2010 10:27:30 +0000 Subject: [PATCH 41/64] [package] add missing dependency to kmod-crypto-misc, patch from Benjamin Cama git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20312 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/fs.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package/kernel/modules/fs.mk b/package/kernel/modules/fs.mk index 0075a2063..f497292d2 100644 --- a/package/kernel/modules/fs.mk +++ b/package/kernel/modules/fs.mk @@ -362,14 +362,12 @@ define KernelPackage/fs-btrfs SUBMENU:=$(FS_MENU) TITLE:=BTRFS filesystem support KCONFIG:=\ - CONFIG_CRYPTO_CRC32C \ CONFIG_LIBCRC32C \ CONFIG_BTRFS_FS \ CONFIG_BTRFS_FS_POSIX_ACL=n # for crc32c - DEPENDS:=+kmod-crypto-core + DEPENDS:=+kmod-crypto-core +kmod-crypto-misc FILES:=\ - $(LINUX_DIR)/crypto/crc32c.$(LINUX_KMOD_SUFFIX) \ $(LINUX_DIR)/lib/libcrc32c.$(LINUX_KMOD_SUFFIX) \ $(LINUX_DIR)/fs/btrfs/btrfs.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,30,crc32c libcrc32c btrfs,1) From 19b7cd172992a8dc97ee20064dd1d38c2c04072a Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Mar 2010 17:18:47 +0000 Subject: [PATCH 42/64] fix svn download with older svn client versions git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20322 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/download.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/download.mk b/include/download.mk index 4e201464b..2d3f35fee 100644 --- a/include/download.mk +++ b/include/download.mk @@ -63,6 +63,12 @@ define DownloadMethod/cvs ) endef +SVN_VERSION=$(shell svn --version | head -1 | awk '{ print $3 }' | cut -d. -f2) +ifeq ($(SVN_VERSION),5) +else +SVN_OPTS:=--trust-server-cert +endif + define DownloadMethod/svn $(call wrap_mirror, \ echo "Checking out files from the svn repository..."; \ @@ -70,7 +76,7 @@ define DownloadMethod/svn cd $(TMP_DIR)/dl && \ rm -rf $(SUBDIR) && \ [ \! -d $(SUBDIR) ] && \ - svn export --non-interactive --trust-server-cert -r$(VERSION) $(URL) $(SUBDIR) && \ + svn export --non-interactive $(SVN_OPTS) -r$(VERSION) $(URL) $(SUBDIR) && \ echo "Packing checkout..." && \ $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \ mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \ From d3b97bce9f451984bb9477452d24616e2f9f9061 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Mar 2010 17:18:54 +0000 Subject: [PATCH 43/64] [package] add more usb-storage modules (#6067) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20323 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/usb.mk | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/package/kernel/modules/usb.mk b/package/kernel/modules/usb.mk index 7ad447c72..816e7f1aa 100644 --- a/package/kernel/modules/usb.mk +++ b/package/kernel/modules/usb.mk @@ -508,6 +508,44 @@ endef $(eval $(call KernelPackage,usb-storage)) +define KernelPackage/usb-storage-extras + SUBMENU:=$(USB_MENU) + TITLE:=Extra drivers for usb-storage + DEPENDS:=@LINUX_2_6 +kmod-usb-storage + KCONFIG:= \ + CONFIG_USB_STORAGE_ALAUDA \ + CONFIG_USB_STORAGE_CYPRESS_ATACB \ + CONFIG_USB_STORAGE_DATAFAB \ + CONFIG_USB_STORAGE_FREECOM \ + CONFIG_USB_STORAGE_ISD200 \ + CONFIG_USB_STORAGE_JUMPSHOT \ + CONFIG_USB_STORAGE_KARMA \ + CONFIG_USB_STORAGE_SDDR09 \ + CONFIG_USB_STORAGE_SDDR55 \ + CONFIG_USB_STORAGE_USBAT + FILES:= \ + $(LINUX_DIR)/drivers/usb/storage/ums-alauda.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-cypress.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-datafab.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-freecom.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-isd200.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-jumpshot.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-karma.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-sddr09.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-sddr55.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/usb/storage/ums-usbat.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,60,ums-alauda ums-cypress ums-datafab \ + ums-freecom ums-isd200 ums-jumpshot \ + ums-karma ums-sddr09 ums-sddr55 ums-usbat) +endef + +define KernelPackage/usb-storage-extras/description + Say Y here if you want to have some more drivers, + such as for SmartMedia card readers. +endef + +$(eval $(call KernelPackage,usb-storage-extras)) + define KernelPackage/usb-video $(call KernelPackage/usb/Depends,@LINUX_2_6) From bf84c66678b024e0625765ae0dc0a0ad05293eff Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Mar 2010 17:45:41 +0000 Subject: [PATCH 44/64] [rdc] do not set panic_on_unrecovered_nmi in watchdog, already set in southbridge driver, thanks rtz git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20324 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/rdc/files-2.6.30/drivers/watchdog/rdc321x_wdt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/rdc/files-2.6.30/drivers/watchdog/rdc321x_wdt.c b/target/linux/rdc/files-2.6.30/drivers/watchdog/rdc321x_wdt.c index 2572c0e2c..694917949 100644 --- a/target/linux/rdc/files-2.6.30/drivers/watchdog/rdc321x_wdt.c +++ b/target/linux/rdc/files-2.6.30/drivers/watchdog/rdc321x_wdt.c @@ -243,7 +243,6 @@ static int __init rdc321x_wdt_probe(struct platform_device *pdev) return err; } - panic_on_unrecovered_nmi = 1; dev_info(&pdev->dev, "watchdog init success\n"); return 0; From a1ce9f6f9b88ba41955079034e8f1c2b6e39c8c6 Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 06:53:08 +0000 Subject: [PATCH 45/64] generic-2.6: sync patches to 2.6.34-rc2 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20329 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/generic-2.6/patches-2.6.34/510-yaffs_support.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/linux/generic-2.6/patches-2.6.34/510-yaffs_support.patch b/target/linux/generic-2.6/patches-2.6.34/510-yaffs_support.patch index e490452e5..b14de5940 100644 --- a/target/linux/generic-2.6/patches-2.6.34/510-yaffs_support.patch +++ b/target/linux/generic-2.6/patches-2.6.34/510-yaffs_support.patch @@ -10,8 +10,9 @@ --- a/fs/Makefile +++ b/fs/Makefile -@@ -125,3 +125,4 @@ obj-$(CONFIG_OCFS2_FS) += ocfs2/ - obj-$(CONFIG_BTRFS_FS) += btrfs/ +@@ -127,3 +127,5 @@ obj-$(CONFIG_GFS2_FS) += gfs2/ obj-$(CONFIG_EXOFS_FS) += exofs/ + obj-$(CONFIG_CEPH_FS) += ceph/ +obj-$(CONFIG_YAFFS_FS) += yaffs2/ ++ From 527d6ed65d529898770fd176e3748a74f06739a2 Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 08:13:01 +0000 Subject: [PATCH 46/64] hostap-driver: make hostap-pci visible (similarly to r20047) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20331 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/hostap-driver/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/hostap-driver/Makefile b/package/hostap-driver/Makefile index 52167c1f0..f78d7877d 100644 --- a/package/hostap-driver/Makefile +++ b/package/hostap-driver/Makefile @@ -103,7 +103,7 @@ endef define KernelPackage/hostap-pci $(call KernelPackage/hostap/Default) TITLE:=Host AP driver for PCI adaptors - DEPENDS:=@PCI_SUPPORT kmod-hostap + DEPENDS:= kmod-hostap KCONFIG:=CONFIG_HOSTAP_PCI AUTOLOAD:=$(call AutoLoad,60,hostap_pci) endef From dd040c4451d8d1a9a4608e28ab03871130cf071f Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 11:03:57 +0000 Subject: [PATCH 47/64] atheros: config-2.6.33, fix CONFIG_CMDLINE git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20332 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/atheros/config-2.6.33 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/linux/atheros/config-2.6.33 b/target/linux/atheros/config-2.6.33 index dfc72e347..fd439a6ea 100644 --- a/target/linux/atheros/config-2.6.33 +++ b/target/linux/atheros/config-2.6.33 @@ -24,7 +24,9 @@ CONFIG_BITREVERSE=y # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set CONFIG_CEVT_R4K=y CONFIG_CEVT_R4K_LIB=y -# CONFIG_CMDLINE_BOOL is not set +CONFIG_CMDLINE="console=ttyS0,9600 rootfstype=squashfs,jffs2" +CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set CONFIG_CPU_BIG_ENDIAN=y # CONFIG_CPU_CAVIUM_OCTEON is not set CONFIG_CPU_HAS_PREFETCH=y @@ -187,7 +189,9 @@ CONFIG_SYS_HAS_EARLY_PRINTK=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +# CONFIG_TINY_RCU is not set CONFIG_TRAD_SIGNALS=y # CONFIG_TREE_PREEMPT_RCU is not set +CONFIG_TREE_RCU=y CONFIG_USB_SUPPORT=y CONFIG_ZONE_DMA_FLAG=0 From c7988448844a2b9389fc5d8ef2367f3e6efc7e24 Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 11:07:35 +0000 Subject: [PATCH 48/64] atheros: config-2.6.33, turn off BSD Process Accounting git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20333 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/atheros/config-2.6.33 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/atheros/config-2.6.33 b/target/linux/atheros/config-2.6.33 index fd439a6ea..9d8e8d6e8 100644 --- a/target/linux/atheros/config-2.6.33 +++ b/target/linux/atheros/config-2.6.33 @@ -20,6 +20,7 @@ CONFIG_ATHEROS_WDT=y # CONFIG_BCM47XX is not set # CONFIG_BCM63XX is not set CONFIG_BITREVERSE=y +# CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set CONFIG_CEVT_R4K=y From c3c2b07763ea8ff85c54251a3236aae41f03eb66 Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 11:10:00 +0000 Subject: [PATCH 49/64] atheros: config-2.6.33, turn off swap memory git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20334 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/atheros/config-2.6.33 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/atheros/config-2.6.33 b/target/linux/atheros/config-2.6.33 index 9d8e8d6e8..014723037 100644 --- a/target/linux/atheros/config-2.6.33 +++ b/target/linux/atheros/config-2.6.33 @@ -184,6 +184,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=1 # CONFIG_SIBYTE_RHONE is not set # CONFIG_SIBYTE_SENTOSA is not set # CONFIG_SIBYTE_SWARM is not set +# CONFIG_SWAP is not set CONFIG_SWCONFIG=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y CONFIG_SYS_HAS_EARLY_PRINTK=y From b33f0c06de6a668d840347afc3932974685bcecd Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 11:13:27 +0000 Subject: [PATCH 50/64] atheros: config-2.6.33, optimize for size git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20335 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/atheros/config-2.6.33 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/atheros/config-2.6.33 b/target/linux/atheros/config-2.6.33 index 014723037..3d2ea92c9 100644 --- a/target/linux/atheros/config-2.6.33 +++ b/target/linux/atheros/config-2.6.33 @@ -21,8 +21,10 @@ CONFIG_ATHEROS_WDT=y # CONFIG_BCM63XX is not set CONFIG_BITREVERSE=y # CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_BUG is not set # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y CONFIG_CEVT_R4K_LIB=y CONFIG_CMDLINE="console=ttyS0,9600 rootfstype=squashfs,jffs2" From e9c11afbbd9c0a9eff9ef4fce086b324b0bee555 Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 11:19:23 +0000 Subject: [PATCH 51/64] atheros: config-2.6.33, use UP-only small-memory-footprint RCU (tested on production system, works solid for couple of weeks) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20336 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/atheros/config-2.6.33 | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/atheros/config-2.6.33 b/target/linux/atheros/config-2.6.33 index 3d2ea92c9..e6c265356 100644 --- a/target/linux/atheros/config-2.6.33 +++ b/target/linux/atheros/config-2.6.33 @@ -193,9 +193,7 @@ CONFIG_SYS_HAS_EARLY_PRINTK=y CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -# CONFIG_TINY_RCU is not set CONFIG_TRAD_SIGNALS=y # CONFIG_TREE_PREEMPT_RCU is not set -CONFIG_TREE_RCU=y CONFIG_USB_SUPPORT=y CONFIG_ZONE_DMA_FLAG=0 From e5332c71e5ffda031747222016dac353112983a6 Mon Sep 17 00:00:00 2001 From: acoul Date: Sun, 21 Mar 2010 11:22:40 +0000 Subject: [PATCH 52/64] atheros: config-2.6.33, PCI: disable common quirks git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20337 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/atheros/config-2.6.33 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/atheros/config-2.6.33 b/target/linux/atheros/config-2.6.33 index e6c265356..a823710dc 100644 --- a/target/linux/atheros/config-2.6.33 +++ b/target/linux/atheros/config-2.6.33 @@ -162,6 +162,7 @@ CONFIG_MVSWITCH_PHY=y # CONFIG_NXP_STB225 is not set CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_PCI=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y CONFIG_PCI_DOMAINS=y CONFIG_PHYLIB=y # CONFIG_PMC_MSP is not set From dd21794488edf7c0b933e20480a472422a8e9465 Mon Sep 17 00:00:00 2001 From: blogic Date: Sun, 21 Mar 2010 13:35:33 +0000 Subject: [PATCH 53/64] [ifxmips] add register definitions for ebu git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20338 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../ifxmips/files/arch/mips/include/asm/mach-ifxmips/ifxmips.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/ifxmips.h b/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/ifxmips.h index 1076dc463..7d5ae23be 100644 --- a/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/ifxmips.h +++ b/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/ifxmips.h @@ -143,7 +143,8 @@ #define IFXMIPS_EBU_PCC_CON ((u32 *)(IFXMIPS_EBU_BASE_ADDR + 0x0090)) #define IFXMIPS_EBU_PCC_IEN ((u32 *)(IFXMIPS_EBU_BASE_ADDR + 0x00A4)) #define IFXMIPS_EBU_PCC_ISTAT ((u32 *)(IFXMIPS_EBU_BASE_ADDR + 0x00A0)) - +#define IFXMIPS_EBU_BUSCON1 ((u32 *)(IFXMIPS_EBU_BASE_ADDR + 0x0064)) +#define IFXMIPS_EBU_ADDRSEL1 ((u32 *)(IFXMIPS_EBU_BASE_ADDR + 0x0024)) /*------------ CGU */ #define IFXMIPS_CGU_BASE_ADDR (KSEG1 + 0x1F103000) From c863d2afc3649139d38aed459442d12a270b9b8c Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 13:57:07 +0000 Subject: [PATCH 54/64] kernel: Add some missing config symbols This adds some missing config symbols and opens the menu behind CONFIG_SND_PCI and CONFIG_ISDN. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20339 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/generic-2.6/config-2.6.30 | 33 ++++++++++++++++++++++++-- target/linux/generic-2.6/config-2.6.31 | 27 +++++++++++++++++++-- target/linux/generic-2.6/config-2.6.32 | 32 +++++++++++++++++++++++-- target/linux/generic-2.6/config-2.6.33 | 30 +++++++++++++++++++++-- target/linux/generic-2.6/config-2.6.34 | 30 +++++++++++++++++++++-- 5 files changed, 142 insertions(+), 10 deletions(-) diff --git a/target/linux/generic-2.6/config-2.6.30 b/target/linux/generic-2.6/config-2.6.30 index 0379ce239..1cbb6abca 100644 --- a/target/linux/generic-2.6/config-2.6.30 +++ b/target/linux/generic-2.6/config-2.6.30 @@ -154,8 +154,10 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_BLK_DEV_4DRIVES is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_ALI14XX is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_ATIIXP is not set # CONFIG_BLK_DEV_BSG is not set @@ -169,6 +171,7 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_DEV_CS5535 is not set # CONFIG_BLK_DEV_CS5536 is not set # CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_DTC2278 is not set # CONFIG_BLK_DEV_DELKIN is not set # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_GENERIC is not set @@ -177,6 +180,7 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_DEV_HD_ONLY is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_HT6560B is not set # CONFIG_BLK_DEV_IDEACPI is not set # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDECS is not set @@ -203,6 +207,7 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_PLATFORM is not set +# CONFIG_BLK_DEV_QD65XX is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_RZ1000 is not set # CONFIG_BLK_DEV_SC1200 is not set @@ -218,6 +223,7 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_UB is not set +# CONFIG_BLK_DEV_UMC8672 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_BLK_DEV_XIP is not set @@ -324,6 +330,7 @@ CONFIG_COMPAT_NET_DEV_OPS=y # CONFIG_CONFIGFS_FS is not set # CONFIG_CONNECTOR is not set # CONFIG_CONTEXT_SWITCH_TRACER is not set +# CONFIG_COPS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CPU_DCACHE_DISABLE is not set # CONFIG_CPU_FREQ is not set @@ -618,6 +625,7 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_TIME=y +# CONFIG_GIGASET_DEBUG is not set # CONFIG_GFS2_FS is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_DEVICE is not set @@ -699,6 +707,7 @@ CONFIG_HOTPLUG=y # CONFIG_HW_RANDOM_INTEL is not set # CONFIG_HW_RANDOM_TIMERIOMEM is not set # CONFIG_HW_RANDOM_VIA is not set +# CONFIG_HYSDN is not set CONFIG_HZ=100 # CONFIG_HZ_1000 is not set CONFIG_HZ_100=y @@ -997,7 +1006,20 @@ CONFIG_IPW2200_MONITOR=y # CONFIG_IRDA is not set # CONFIG_IRQSOFF_TRACER is not set # CONFIG_ISCSI_TCP is not set -# CONFIG_ISDN is not set +CONFIG_ISDN=y +# CONFIG_ISDN_AUDIO is not set +# CONFIG_ISDN_CAPI_CAPIDRV is not set +# CONFIG_ISDN_DIVERSION is not set +# CONFIG_ISDN_DRV_ACT2000 is not set +# CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set +# CONFIG_ISDN_DRV_EICON is not set +# CONFIG_ISDN_DRV_HISAX is not set +# CONFIG_ISDN_DRV_ICN is not set +# CONFIG_ISDN_DRV_LOOP is not set +# CONFIG_ISDN_DRV_PCBIT is not set +# CONFIG_ISDN_DRV_SC is not set +# CONFIG_ISDN_DRV_TPAM is not set +# CONFIG_ISDN_WITH_ABC is not set # CONFIG_ISL29003 is not set # CONFIG_ISO9660_FS is not set # CONFIG_IWL3945 is not set @@ -1097,6 +1119,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_LOGITECH_FF is not set # CONFIG_LSF is not set # CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LTPC is not set # CONFIG_LXT_PHY is not set # CONFIG_MAC80211 is not set # CONFIG_MAC_EMUMOUSEBTN is not set @@ -1825,6 +1848,7 @@ CONFIG_SCSI_LOWLEVEL=y # CONFIG_SCSI_MPT2SAS is not set CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVSAS_DEBUG is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_NSP32 is not set @@ -2010,6 +2034,7 @@ CONFIG_SLAB=y # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS5530 is not set # CONFIG_SND_CS5535AUDIO is not set +# CONFIG_SND_CTXFI is not set # CONFIG_SND_DARLA20 is not set # CONFIG_SND_DARLA24 is not set # CONFIG_SND_DEBUG is not set @@ -2042,7 +2067,9 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGODJX is not set # CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGOIOX is not set # CONFIG_SND_INDIGO is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_INTEL8X0M is not set @@ -2053,6 +2080,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_KORG1212 is not set # CONFIG_SND_LAYLA20 is not set # CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_LX6464ES is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_MIA is not set # CONFIG_SND_MIPS is not set @@ -2069,7 +2097,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_OPTI93X is not set CONFIG_SND_OSSEMUL=y # CONFIG_SND_OXYGEN is not set -# CONFIG_SND_PCI is not set +CONFIG_SND_PCI=y # CONFIG_SND_PCMCIA is not set # CONFIG_SND_PCM is not set # CONFIG_SND_PCM_OSS is not set @@ -2088,6 +2116,7 @@ CONFIG_SND_PCM_OSS_PLUGINS=y # CONFIG_SND_SBAWE is not set # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_SIS7019 is not set # CONFIG_SND_SGALAXY is not set # CONFIG_SND_SOC is not set # CONFIG_SND_SONICVIBES is not set diff --git a/target/linux/generic-2.6/config-2.6.31 b/target/linux/generic-2.6/config-2.6.31 index 320ccb928..f42f7d668 100644 --- a/target/linux/generic-2.6/config-2.6.31 +++ b/target/linux/generic-2.6/config-2.6.31 @@ -337,6 +337,7 @@ CONFIG_COMPAT_NET_DEV_OPS=y # CONFIG_CONNECTOR is not set CONFIG_CONSTRUCTORS=y # CONFIG_CONTEXT_SWITCH_TRACER is not set +# CONFIG_COPS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CPU_DCACHE_DISABLE is not set # CONFIG_CPU_FREQ is not set @@ -606,6 +607,7 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_TIME=y +# CONFIG_GIGASET_DEBUG is not set # CONFIG_GFS2_FS is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_DEVICE is not set @@ -696,6 +698,7 @@ CONFIG_HOTPLUG=y # CONFIG_HW_RANDOM_INTEL is not set # CONFIG_HW_RANDOM_TIMERIOMEM is not set # CONFIG_HW_RANDOM_VIA is not set +# CONFIG_HYSDN is not set CONFIG_HZ=100 # CONFIG_HZ_1000 is not set CONFIG_HZ_100=y @@ -995,7 +998,20 @@ CONFIG_IPW2200_MONITOR=y # CONFIG_IRDA is not set # CONFIG_IRQSOFF_TRACER is not set # CONFIG_ISCSI_TCP is not set -# CONFIG_ISDN is not set +CONFIG_ISDN=y +# CONFIG_ISDN_AUDIO is not set +# CONFIG_ISDN_CAPI_CAPIDRV is not set +# CONFIG_ISDN_DIVERSION is not set +# CONFIG_ISDN_DRV_ACT2000 is not set +# CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set +# CONFIG_ISDN_DRV_EICON is not set +# CONFIG_ISDN_DRV_HISAX is not set +# CONFIG_ISDN_DRV_ICN is not set +# CONFIG_ISDN_DRV_LOOP is not set +# CONFIG_ISDN_DRV_PCBIT is not set +# CONFIG_ISDN_DRV_SC is not set +# CONFIG_ISDN_DRV_TPAM is not set +# CONFIG_ISDN_WITH_ABC is not set # CONFIG_ISL29003 is not set # CONFIG_ISO9660_FS is not set # CONFIG_IWL3945 is not set @@ -1099,6 +1115,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_LOGO is not set # CONFIG_LSF is not set # CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LTPC is not set # CONFIG_LXT_PHY is not set CONFIG_MAC80211_DEFAULT_PS_VALUE=1 CONFIG_MAC80211_DEFAULT_PS=y @@ -1835,6 +1852,7 @@ CONFIG_SCSI_LOWLEVEL=y # CONFIG_SCSI_MPT2SAS is not set CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVSAS_DEBUG is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_NSP32 is not set @@ -2024,6 +2042,7 @@ CONFIG_SLAB=y # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS5530 is not set # CONFIG_SND_CS5535AUDIO is not set +# CONFIG_SND_CTXFI is not set # CONFIG_SND_DARLA20 is not set # CONFIG_SND_DARLA24 is not set # CONFIG_SND_DEBUG is not set @@ -2056,7 +2075,9 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGODJX is not set # CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGOIOX is not set # CONFIG_SND_INDIGO is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_INTEL8X0M is not set @@ -2067,6 +2088,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_KORG1212 is not set # CONFIG_SND_LAYLA20 is not set # CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_LX6464ES is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_MIA is not set # CONFIG_SND_MIPS is not set @@ -2083,7 +2105,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_OPTI93X is not set CONFIG_SND_OSSEMUL=y # CONFIG_SND_OXYGEN is not set -# CONFIG_SND_PCI is not set +CONFIG_SND_PCI=y # CONFIG_SND_PCMCIA is not set # CONFIG_SND_PCM is not set # CONFIG_SND_PCM_OSS is not set @@ -2101,6 +2123,7 @@ CONFIG_SND_PCM_OSS_PLUGINS=y # CONFIG_SND_SBAWE is not set # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_SIS7019 is not set # CONFIG_SND_SGALAXY is not set # CONFIG_SND_SOC is not set # CONFIG_SND_SONICVIBES is not set diff --git a/target/linux/generic-2.6/config-2.6.32 b/target/linux/generic-2.6/config-2.6.32 index 5dff3ffed..3fdf530a9 100644 --- a/target/linux/generic-2.6/config-2.6.32 +++ b/target/linux/generic-2.6/config-2.6.32 @@ -5,6 +5,7 @@ # CONFIG_AB3100_CORE is not set # CONFIG_ACCESSIBILITY is not set # CONFIG_ACENIC is not set +# CONFIG_ACPI_POWER_METER is not set # CONFIG_ACORN_PARTITION is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_ADFS_FS is not set @@ -344,6 +345,7 @@ CONFIG_COMPAT_NET_DEV_OPS=y # CONFIG_CONNECTOR is not set CONFIG_CONSTRUCTORS=y # CONFIG_CONTEXT_SWITCH_TRACER is not set +# CONFIG_COPS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CPU_DCACHE_DISABLE is not set # CONFIG_CPU_FREQ is not set @@ -653,6 +655,7 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_TIME=y +# CONFIG_GIGASET_DEBUG is not set # CONFIG_GFS2_FS is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_DEVICE is not set @@ -747,6 +750,7 @@ CONFIG_HOTPLUG=y # CONFIG_HW_RANDOM_TIMERIOMEM is not set # CONFIG_HW_RANDOM_VIA is not set # CONFIG_HYPERV is not set +# CONFIG_HYSDN is not set CONFIG_HZ=100 # CONFIG_HZ_1000 is not set CONFIG_HZ_100=y @@ -787,6 +791,7 @@ CONFIG_HZ_100=y # CONFIG_I2C_PIIX4 is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set +# CONFIG_I2C_SCMI is not set # CONFIG_I2C_SIMTEC is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set @@ -1050,7 +1055,20 @@ CONFIG_IPW2200_MONITOR=y # CONFIG_IRDA is not set # CONFIG_IRQSOFF_TRACER is not set # CONFIG_ISCSI_TCP is not set -# CONFIG_ISDN is not set +CONFIG_ISDN=y +# CONFIG_ISDN_AUDIO is not set +# CONFIG_ISDN_CAPI_CAPIDRV is not set +# CONFIG_ISDN_DIVERSION is not set +# CONFIG_ISDN_DRV_ACT2000 is not set +# CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set +# CONFIG_ISDN_DRV_EICON is not set +# CONFIG_ISDN_DRV_HISAX is not set +# CONFIG_ISDN_DRV_ICN is not set +# CONFIG_ISDN_DRV_LOOP is not set +# CONFIG_ISDN_DRV_PCBIT is not set +# CONFIG_ISDN_DRV_SC is not set +# CONFIG_ISDN_DRV_TPAM is not set +# CONFIG_ISDN_WITH_ABC is not set # CONFIG_ISL29003 is not set # CONFIG_ISO9660_FS is not set # CONFIG_IWL3945 is not set @@ -1160,6 +1178,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_LOGO is not set # CONFIG_LSF is not set # CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LTPC is not set # CONFIG_LXT_PHY is not set CONFIG_MAC80211_DEFAULT_PS_VALUE=1 CONFIG_MAC80211_DEFAULT_PS=y @@ -1936,6 +1955,7 @@ CONFIG_SCSI_LOWLEVEL=y # CONFIG_SCSI_MPT2SAS is not set CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVSAS_DEBUG is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_NSP32 is not set @@ -1986,6 +2006,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_ADT7475 is not set # CONFIG_SENSORS_APPLESMC is not set # CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ATK0110 is not set # CONFIG_SENSORS_ATXP1 is not set # CONFIG_SENSORS_CORETEMP is not set # CONFIG_SENSORS_DME1737 is not set @@ -2007,6 +2028,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_K8TEMP is not set # CONFIG_SENSORS_LIS3_SPI is not set +# CONFIG_SENSORS_LIS3LV02D is not set # CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM70 is not set # CONFIG_SENSORS_LM75 is not set @@ -2127,6 +2149,7 @@ CONFIG_SLAB=y # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS5530 is not set # CONFIG_SND_CS5535AUDIO is not set +# CONFIG_SND_CTXFI is not set # CONFIG_SND_DARLA20 is not set # CONFIG_SND_DARLA24 is not set # CONFIG_SND_DEBUG is not set @@ -2159,7 +2182,9 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGODJX is not set # CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGOIOX is not set # CONFIG_SND_INDIGO is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_INTEL8X0M is not set @@ -2170,6 +2195,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_KORG1212 is not set # CONFIG_SND_LAYLA20 is not set # CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_LX6464ES is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_MIA is not set # CONFIG_SND_MIPS is not set @@ -2186,7 +2212,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_OPTI93X is not set CONFIG_SND_OSSEMUL=y # CONFIG_SND_OXYGEN is not set -# CONFIG_SND_PCI is not set +CONFIG_SND_PCI=y # CONFIG_SND_PCMCIA is not set # CONFIG_SND_PCM is not set # CONFIG_SND_PCM_OSS is not set @@ -2206,6 +2232,7 @@ CONFIG_SND_PCM_OSS_PLUGINS=y # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_SGALAXY is not set +# CONFIG_SND_SIS7019 is not set # CONFIG_SND_SOC is not set # CONFIG_SND_SONICVIBES is not set # CONFIG_SND_SPI is not set @@ -2232,6 +2259,7 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_SONYPI is not set +# CONFIG_SONY_LAPTOP is not set # CONFIG_SOUND is not set # CONFIG_SOUND_PRIME is not set # CONFIG_SPARSEMEM_MANUAL is not set diff --git a/target/linux/generic-2.6/config-2.6.33 b/target/linux/generic-2.6/config-2.6.33 index 82c3e3258..80fdf4c26 100644 --- a/target/linux/generic-2.6/config-2.6.33 +++ b/target/linux/generic-2.6/config-2.6.33 @@ -6,6 +6,7 @@ # CONFIG_AB4500_CORE is not set # CONFIG_ACCESSIBILITY is not set # CONFIG_ACENIC is not set +# CONFIG_ACPI_POWER_METER is not set # CONFIG_ACORN_PARTITION is not set # CONFIG_AD525X_DPOT is not set # CONFIG_ADAPTEC_STARFIRE is not set @@ -660,6 +661,7 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_TIME=y +# CONFIG_GIGASET_DEBUG is not set # CONFIG_GFS2_FS is not set # CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_BT8XX is not set @@ -756,6 +758,7 @@ CONFIG_HOTPLUG=y # CONFIG_HW_RANDOM_TIMERIOMEM is not set # CONFIG_HW_RANDOM_VIA is not set # CONFIG_HYPERV is not set +# CONFIG_HYSDN is not set CONFIG_HZ=100 # CONFIG_HZ_1000 is not set CONFIG_HZ_100=y @@ -1063,7 +1066,20 @@ CONFIG_IPW2200_MONITOR=y # CONFIG_IRDA is not set # CONFIG_IRQSOFF_TRACER is not set # CONFIG_ISCSI_TCP is not set -# CONFIG_ISDN is not set +CONFIG_ISDN=y +# CONFIG_ISDN_AUDIO is not set +# CONFIG_ISDN_CAPI_CAPIDRV is not set +# CONFIG_ISDN_DIVERSION is not set +# CONFIG_ISDN_DRV_ACT2000 is not set +# CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set +# CONFIG_ISDN_DRV_EICON is not set +# CONFIG_ISDN_DRV_HISAX is not set +# CONFIG_ISDN_DRV_ICN is not set +# CONFIG_ISDN_DRV_LOOP is not set +# CONFIG_ISDN_DRV_PCBIT is not set +# CONFIG_ISDN_DRV_SC is not set +# CONFIG_ISDN_DRV_TPAM is not set +# CONFIG_ISDN_WITH_ABC is not set # CONFIG_ISL29003 is not set # CONFIG_ISO9660_FS is not set # CONFIG_IWL3945 is not set @@ -1173,6 +1189,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_LOGO is not set # CONFIG_LSF is not set # CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LTPC is not set # CONFIG_LXT_PHY is not set CONFIG_MAC80211_DEFAULT_PS_VALUE=1 CONFIG_MAC80211_DEFAULT_PS=y @@ -1961,6 +1978,7 @@ CONFIG_SCSI_LOWLEVEL=y # CONFIG_SCSI_MPT2SAS is not set CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVSAS_DEBUG is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_NSP32 is not set @@ -2013,6 +2031,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_AMC6821 is not set # CONFIG_SENSORS_APPLESMC is not set # CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ATK0110 is not set # CONFIG_SENSORS_ATXP1 is not set # CONFIG_SENSORS_CORETEMP is not set # CONFIG_SENSORS_DME1737 is not set @@ -2033,6 +2052,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_I5K_AMB is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_K8TEMP is not set +# CONFIG_SENSORS_LIS3LV02D is not set # CONFIG_SENSORS_LIS3_I2C is not set # CONFIG_SENSORS_LIS3_SPI is not set # CONFIG_SENSORS_LM63 is not set @@ -2156,6 +2176,7 @@ CONFIG_SLAB=y # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS5530 is not set # CONFIG_SND_CS5535AUDIO is not set +# CONFIG_SND_CTXFI is not set # CONFIG_SND_DARLA20 is not set # CONFIG_SND_DARLA24 is not set # CONFIG_SND_DEBUG is not set @@ -2188,7 +2209,9 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGODJX is not set # CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGOIOX is not set # CONFIG_SND_INDIGO is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_INTEL8X0M is not set @@ -2199,6 +2222,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_KORG1212 is not set # CONFIG_SND_LAYLA20 is not set # CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_LX6464ES is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_MIA is not set # CONFIG_SND_MIPS is not set @@ -2215,7 +2239,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_OPTI93X is not set CONFIG_SND_OSSEMUL=y # CONFIG_SND_OXYGEN is not set -# CONFIG_SND_PCI is not set +CONFIG_SND_PCI=y # CONFIG_SND_PCMCIA is not set # CONFIG_SND_PCM is not set # CONFIG_SND_PCM_OSS is not set @@ -2233,6 +2257,7 @@ CONFIG_SND_PCM_OSS_PLUGINS=y # CONFIG_SND_SBAWE is not set # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_SIS7019 is not set # CONFIG_SND_SGALAXY is not set # CONFIG_SND_SOC is not set # CONFIG_SND_SONICVIBES is not set @@ -2260,6 +2285,7 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_SONYPI is not set +# CONFIG_SONY_LAPTOP is not set # CONFIG_SOUND is not set # CONFIG_SOUND_PRIME is not set # CONFIG_SPARSEMEM_MANUAL is not set diff --git a/target/linux/generic-2.6/config-2.6.34 b/target/linux/generic-2.6/config-2.6.34 index b985bc5f3..03ed7879f 100644 --- a/target/linux/generic-2.6/config-2.6.34 +++ b/target/linux/generic-2.6/config-2.6.34 @@ -6,6 +6,7 @@ # CONFIG_AB4500_CORE is not set # CONFIG_ACCESSIBILITY is not set # CONFIG_ACENIC is not set +# CONFIG_ACPI_POWER_METER is not set # CONFIG_ACORN_PARTITION is not set # CONFIG_AD525X_DPOT is not set # CONFIG_ADAPTEC_STARFIRE is not set @@ -660,6 +661,7 @@ CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_TIME=y +# CONFIG_GIGASET_DEBUG is not set # CONFIG_GFS2_FS is not set # CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_BT8XX is not set @@ -756,6 +758,7 @@ CONFIG_HOTPLUG=y # CONFIG_HW_RANDOM_TIMERIOMEM is not set # CONFIG_HW_RANDOM_VIA is not set # CONFIG_HYPERV is not set +# CONFIG_HYSDN is not set CONFIG_HZ=100 # CONFIG_HZ_1000 is not set CONFIG_HZ_100=y @@ -1063,7 +1066,20 @@ CONFIG_IPW2200_MONITOR=y # CONFIG_IRDA is not set # CONFIG_IRQSOFF_TRACER is not set # CONFIG_ISCSI_TCP is not set -# CONFIG_ISDN is not set +CONFIG_ISDN=y +# CONFIG_ISDN_AUDIO is not set +# CONFIG_ISDN_CAPI_CAPIDRV is not set +# CONFIG_ISDN_DIVERSION is not set +# CONFIG_ISDN_DRV_ACT2000 is not set +# CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set +# CONFIG_ISDN_DRV_EICON is not set +# CONFIG_ISDN_DRV_HISAX is not set +# CONFIG_ISDN_DRV_ICN is not set +# CONFIG_ISDN_DRV_LOOP is not set +# CONFIG_ISDN_DRV_PCBIT is not set +# CONFIG_ISDN_DRV_SC is not set +# CONFIG_ISDN_DRV_TPAM is not set +# CONFIG_ISDN_WITH_ABC is not set # CONFIG_ISL29003 is not set # CONFIG_ISO9660_FS is not set # CONFIG_IWL3945 is not set @@ -1173,6 +1189,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_LOGO is not set # CONFIG_LSF is not set # CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LTPC is not set # CONFIG_LXT_PHY is not set CONFIG_MAC80211_DEFAULT_PS_VALUE=1 CONFIG_MAC80211_DEFAULT_PS=y @@ -1961,6 +1978,7 @@ CONFIG_SCSI_LOWLEVEL=y # CONFIG_SCSI_MPT2SAS is not set CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVSAS_DEBUG is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NETLINK is not set # CONFIG_SCSI_NSP32 is not set @@ -2013,6 +2031,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_AMC6821 is not set # CONFIG_SENSORS_APPLESMC is not set # CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ATK0110 is not set # CONFIG_SENSORS_ATXP1 is not set # CONFIG_SENSORS_CORETEMP is not set # CONFIG_SENSORS_DME1737 is not set @@ -2033,6 +2052,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_I5K_AMB is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_K8TEMP is not set +# CONFIG_SENSORS_LIS3LV02D is not set # CONFIG_SENSORS_LIS3_I2C is not set # CONFIG_SENSORS_LIS3_SPI is not set # CONFIG_SENSORS_LM63 is not set @@ -2156,6 +2176,7 @@ CONFIG_SLAB=y # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS5530 is not set # CONFIG_SND_CS5535AUDIO is not set +# CONFIG_SND_CTXFI is not set # CONFIG_SND_DARLA20 is not set # CONFIG_SND_DARLA24 is not set # CONFIG_SND_DEBUG is not set @@ -2188,7 +2209,9 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGODJX is not set # CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGOIOX is not set # CONFIG_SND_INDIGO is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_INTEL8X0M is not set @@ -2199,6 +2222,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_KORG1212 is not set # CONFIG_SND_LAYLA20 is not set # CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_LX6464ES is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_MIA is not set # CONFIG_SND_MIPS is not set @@ -2215,7 +2239,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_OPTI93X is not set CONFIG_SND_OSSEMUL=y # CONFIG_SND_OXYGEN is not set -# CONFIG_SND_PCI is not set +CONFIG_SND_PCI=y # CONFIG_SND_PCMCIA is not set # CONFIG_SND_PCM is not set # CONFIG_SND_PCM_OSS is not set @@ -2233,6 +2257,7 @@ CONFIG_SND_PCM_OSS_PLUGINS=y # CONFIG_SND_SBAWE is not set # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_SIS7019 is not set # CONFIG_SND_SGALAXY is not set # CONFIG_SND_SOC is not set # CONFIG_SND_SONICVIBES is not set @@ -2260,6 +2285,7 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_SONYPI is not set +# CONFIG_SONY_LAPTOP is not set # CONFIG_SOUND is not set # CONFIG_SOUND_PRIME is not set # CONFIG_SPARSEMEM_MANUAL is not set From e2b35b4810b1f5bd7dcb0e4c609850c364b77e85 Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:02:30 +0000 Subject: [PATCH 55/64] x86: do no overwrite CONFIG_SCSI_LOWLEVEL CONFIG_SCSI_LOWLEVEL is needed for some packages. Backport commit r19759 into kernel 2.6.30 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20340 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/x86/config-2.6.30 | 3 ++- target/linux/x86/config-default | 1 - target/linux/x86/olpc/config-2.6.31 | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/target/linux/x86/config-2.6.30 b/target/linux/x86/config-2.6.30 index b66a2e9d9..24fcb1340 100644 --- a/target/linux/x86/config-2.6.30 +++ b/target/linux/x86/config-2.6.30 @@ -193,6 +193,8 @@ CONFIG_ISA=y # CONFIG_IT87_WDT is not set # CONFIG_ITCO_WDT is not set CONFIG_KALLSYMS=y +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_LZMA is not set CONFIG_KEXEC=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_LKKBD is not set @@ -311,7 +313,6 @@ CONFIG_RTC=y # CONFIG_SC520_WDT is not set # CONFIG_SCHED_HRTICK is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y -# CONFIG_SCSI_LOWLEVEL is not set CONFIG_SCSI=y # CONFIG_SCx200_GPIO is not set CONFIG_SCx200HR_TIMER=y diff --git a/target/linux/x86/config-default b/target/linux/x86/config-default index 535eab3c3..9b20f1eab 100644 --- a/target/linux/x86/config-default +++ b/target/linux/x86/config-default @@ -380,7 +380,6 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y # CONFIG_SCHED_MC is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y # CONFIG_SCHED_SMT is not set -# CONFIG_SCSI_LOWLEVEL is not set CONFIG_SCSI=y # CONFIG_SCx200_GPIO is not set CONFIG_SCx200HR_TIMER=y diff --git a/target/linux/x86/olpc/config-2.6.31 b/target/linux/x86/olpc/config-2.6.31 index 1144e9f28..7db4baa7c 100644 --- a/target/linux/x86/olpc/config-2.6.31 +++ b/target/linux/x86/olpc/config-2.6.31 @@ -430,7 +430,6 @@ CONFIG_SCHED_DEBUG=y # CONFIG_SCHED_HRTICK is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_SCHEDSTATS=y -# CONFIG_SCSI_LOWLEVEL is not set CONFIG_SCSI=y # CONFIG_SCx200 is not set # CONFIG_SDIO_UART is not set From 1f2659822aa252d92ea7bc580d49143fe02445fa Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:05:59 +0000 Subject: [PATCH 56/64] kernel: make ISDN build again In combination with r20339 ISDN will be build again. * Fix syntax problem in kmod-capi * add xfrm_ipcomp to kmod-ipsec git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20341 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/netsupport.mk | 40 +++++++++------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/package/kernel/modules/netsupport.mk b/package/kernel/modules/netsupport.mk index 16a8378ad..53e218d26 100644 --- a/package/kernel/modules/netsupport.mk +++ b/package/kernel/modules/netsupport.mk @@ -88,11 +88,12 @@ define KernelPackage/capi KCONFIG:= \ CONFIG_ISDN_CAPI \ CONFIG_ISDN_CAPI_CAPI20 \ - CONFIG_ISDN_CAPIFS + CONFIG_ISDN_CAPIFS \ + CONFIG_ISDN_CAPI_CAPIFS FILES:= \ $(LINUX_DIR)/drivers/isdn/capi/kernelcapi.$(LINUX_KMOD_SUFFIX) \ - $(LINUX_DIR)/drivers/isdn/capi/capifs.$(LINUX_KMOD_SUFFIX) - $(LINUX_DIR)/drivers/isdn/capi/capi.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/isdn/capi/capifs.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/isdn/capi/capi.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,30,kernelcapi capifs capi) endef @@ -108,19 +109,7 @@ define KernelPackage/misdn KCONFIG:= \ CONFIG_MISDN \ CONFIG_MISDN_DSP \ - CONFIG_MISDN_L1OIP \ - CONFIG_ISDN_AUDIO=n \ - CONFIG_ISDN_WITH_ABC=n \ - CONFIG_ISDN_DRV_LOOP=n \ - CONFIG_ISDN_DIVERSION=n \ - CONFIG_ISDN_DRV_HISAX=n \ - CONFIG_ISDN_DRV_ICN=n \ - CONFIG_ISDN_DRV_PCBIT=n \ - CONFIG_ISDN_DRV_SC=n \ - CONFIG_ISDN_DRV_ACT2000=n \ - CONFIG_ISDN_DRV_EICON=n \ - CONFIG_ISDN_DRV_TPAM=n \ - CONFIG_HYSDN=n + CONFIG_MISDN_L1OIP FILES:= \ $(LINUX_DIR)/drivers/isdn/mISDN/mISDN_core.$(LINUX_KMOD_SUFFIX) \ $(LINUX_DIR)/drivers/isdn/mISDN/mISDN_dsp.$(LINUX_KMOD_SUFFIX) \ @@ -155,19 +144,12 @@ define KernelPackage/isdn4linux CONFIG_ISDN_MPP=y \ CONFIG_IPPP_FILTER=y \ CONFIG_ISDN_PPP_BSDCOMP \ + CONFIG_ISDN_CAPI_MIDDLEWARE=y \ + CONFIG_ISDN_CAPI_CAPIFS_BOOL=y \ CONFIG_ISDN_AUDIO=y \ CONFIG_ISDN_TTY_FAX=y \ CONFIG_ISDN_X25=y \ - CONFIG_ISDN_DIVERSION \ - CONFIG_ISDN_CAPI_CAPIDRV=n \ - CONFIG_ISDN_DRV_ACT2000=n \ - CONFIG_ISDN_DRV_GIGASET=n \ - CONFIG_ISDN_DRV_HISAX=n \ - CONFIG_ISDN_DRV_ICN=n \ - CONFIG_ISDN_DRV_LOOP=n \ - CONFIG_ISDN_DRV_PCBIT=n \ - CONFIG_ISDN_DRV_SC=n \ - CONFIG_HYSDN=n + CONFIG_ISDN_DIVERSION FILES:= \ $(LINUX_DIR)/drivers/isdn/divert/dss1_divert.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,40,isdn isdn_bsdcomp dss1_divert) @@ -217,10 +199,12 @@ define KernelPackage/ipsec DEPENDS:=@LINUX_2_6 +kmod-crypto-core +kmod-crypto-des +kmod-crypto-hmac +kmod-crypto-md5 +kmod-crypto-sha1 KCONFIG:= \ CONFIG_NET_KEY \ - CONFIG_XFRM_USER + CONFIG_XFRM_USER \ + CONFIG_XFRM_IPCOMP FILES:= \ $(LINUX_DIR)/net/key/af_key.$(LINUX_KMOD_SUFFIX) \ - $(LINUX_DIR)/net/xfrm/xfrm_user.$(LINUX_KMOD_SUFFIX) + $(LINUX_DIR)/net/xfrm/xfrm_user.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/net/xfrm/xfrm_ipcomp.$(LINUX_KMOD_SUFFIX) endef define KernelPackage/ipsec/description From ed449985f5d07871fb59f918b59bc22e8fcd0a7a Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:06:32 +0000 Subject: [PATCH 57/64] kernel: fix typo git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20342 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/hwmon.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/modules/hwmon.mk b/package/kernel/modules/hwmon.mk index d50fd3ea5..2219d38fa 100644 --- a/package/kernel/modules/hwmon.mk +++ b/package/kernel/modules/hwmon.mk @@ -102,7 +102,7 @@ $(call KernelPackage/hwmon/Depends,@TARGET_rdc||TARGET_x86) FILES:= \ $(LINUX_DIR)/drivers/hwmon/hwmon-vid.$(LINUX_KMOD_SUFFIX) \ $(LINUX_DIR)/drivers/hwmon/w83627hf.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,50,hwmon-vid w83627h) + AUTOLOAD:=$(call AutoLoad,50,hwmon-vid w83627hf) endef define KernelPacakge/hwmon-w83627hf/description From 09c79fcf66c407e4087461715646610c98606d14 Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:07:30 +0000 Subject: [PATCH 58/64] kernel: include aes-i586 and twofish-i586 into crypto packages for x86 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20343 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/crypto.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/kernel/modules/crypto.mk b/package/kernel/modules/crypto.mk index a068964c3..0e161fea0 100644 --- a/package/kernel/modules/crypto.mk +++ b/package/kernel/modules/crypto.mk @@ -149,7 +149,7 @@ $(call KernelPackage/crypto/Depends,) AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX)) endef -define KernelPackage/crypto-aes/x86-2.6 +define KernelPackage/crypto-aes/x86 FILES+=$(LINUX_DIR)/arch/x86/crypto/aes-i586.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,09,aes$(AES_SUFFIX) aes-i586) endef @@ -252,6 +252,7 @@ $(call KernelPackage/crypto/Depends,) CONFIG_CRYPTO_TEA \ CONFIG_CRYPTO_TGR192 \ CONFIG_CRYPTO_TWOFISH \ + CONFIG_CRYPTO_TWOFISH_COMMON \ CONFIG_CRYPTO_TWOFISH_586 \ CONFIG_CRYPTO_WP512 FILES:= \ @@ -266,6 +267,7 @@ $(call KernelPackage/crypto/Depends,) $(LINUX_DIR)/crypto/sha512$(SHA512_SUFFIX).$(LINUX_KMOD_SUFFIX) \ $(LINUX_DIR)/crypto/tea.$(LINUX_KMOD_SUFFIX) \ $(LINUX_DIR)/crypto/twofish.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/crypto/twofish_common.$(LINUX_KMOD_SUFFIX) \ $(LINUX_DIR)/crypto/wp512.$(LINUX_KMOD_SUFFIX) endef @@ -277,6 +279,10 @@ define KernelPackage/crypto-misc/2.6 $(LINUX_DIR)/crypto/tgr192.$(LINUX_KMOD_SUFFIX) endef +define KernelPackage/crypto-misc/x86 + FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.$(LINUX_KMOD_SUFFIX) +endef + $(eval $(call KernelPackage,crypto-misc)) From 39c3b81b390d6fce3254bc8c9baac3bbd0d88e30 Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:09:24 +0000 Subject: [PATCH 59/64] kernel: fix tg3 installation libphy is build into the kernel for brcm47xx and not as an extra module. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20344 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/netdevices.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/modules/netdevices.mk b/package/kernel/modules/netdevices.mk index c15ce0fad..e2a00811c 100644 --- a/package/kernel/modules/netdevices.mk +++ b/package/kernel/modules/netdevices.mk @@ -290,7 +290,7 @@ define KernelPackage/tg3 TITLE:=Broadcom Tigon3 Gigabit Ethernet FILES:=$(LINUX_DIR)/drivers/net/tg3.$(LINUX_KMOD_SUFFIX) KCONFIG:=CONFIG_TIGON3 - DEPENDS:=@LINUX_2_6 +kmod-libphy @!TARGET_ubicom32 + DEPENDS:=@LINUX_2_6 +!TARGET_brcm47xx:kmod-libphy @!TARGET_ubicom32 SUBMENU:=$(NETWORK_DEVICES_MENU) AUTOLOAD:=$(call AutoLoad,50,tg3) endef From 5ff066b558bbb7551b633344480110a5519e36f8 Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:12:32 +0000 Subject: [PATCH 60/64] kernel: load after its dependencies git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20345 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/sound.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/modules/sound.mk b/package/kernel/modules/sound.mk index e4a4c73cf..46bc6853a 100644 --- a/package/kernel/modules/sound.mk +++ b/package/kernel/modules/sound.mk @@ -141,7 +141,7 @@ $(call KernelPackage/sound/Depends) CONFIG_SND_SOC \ CONFIG_SND_SOC_ALL_CODECS=n FILES:=$(LINUX_DIR)/sound/soc/snd-soc-core.ko - AUTOLOAD:=$(call AutoLoad,35, snd-soc-core) + AUTOLOAD:=$(call AutoLoad,55, snd-soc-core) endef $(eval $(call KernelPackage,sound-soc-core)) From 11476e81c4be673822360fb9268d6d7c2503773d Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:18:11 +0000 Subject: [PATCH 61/64] kernel: x86 remove dependency on ata-core and scsi-core The x86 image includes the modules out of ata-core and scsi-core directly in the kernel image. Do not depend on these packages, because they are not build in a x86 image. This fixes #6873 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20346 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/block.mk | 7 ++++--- package/kernel/modules/usb.mk | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package/kernel/modules/block.mk b/package/kernel/modules/block.mk index 92b9e6390..009a8e168 100644 --- a/package/kernel/modules/block.mk +++ b/package/kernel/modules/block.mk @@ -10,7 +10,7 @@ BLOCK_MENU:=Block Devices define KernelPackage/ata-core SUBMENU:=$(BLOCK_MENU) TITLE:=Serial and Parallel ATA support - DEPENDS:=@PCI_SUPPORT @LINUX_2_6 +kmod-scsi-core @(!TARGET_ubicom32||!TARGET_etrax) + DEPENDS:=@PCI_SUPPORT @LINUX_2_6 +kmod-scsi-core @(!TARGET_ubicom32||!TARGET_etrax||!TARGET_x86) KCONFIG:=CONFIG_ATA FILES:=$(LINUX_DIR)/drivers/ata/libata.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,21,libata,1) @@ -21,7 +21,7 @@ $(eval $(call KernelPackage,ata-core)) define KernelPackage/ata/Depends SUBMENU:=$(BLOCK_MENU) - DEPENDS:=kmod-ata-core $(1) + DEPENDS:=!TARGET_x86:kmod-ata-core $(1) endef @@ -302,6 +302,7 @@ $(eval $(call KernelPackage,ide-it821x)) define KernelPackage/scsi-core SUBMENU:=$(BLOCK_MENU) TITLE:=SCSI device support + DEPENDS:=@!TARGET_x86 KCONFIG:= \ CONFIG_SCSI \ CONFIG_BLK_DEV_SD @@ -451,7 +452,7 @@ $(eval $(call KernelPackage,axonram)) define KernelPackage/libsas SUBMENU:=$(BLOCK_MENU) TITLE:=SAS Domain Transport Attributes - DEPENDS:=+kmod-scsi-core @TARGET_x86 + DEPENDS:=@TARGET_x86 KCONFIG:=CONFIG_SCSI_SAS_LIBSAS \ CONFIG_SCSI_SAS_ATTRS \ CONFIG_SCSI_SAS_ATA=y \ diff --git a/package/kernel/modules/usb.mk b/package/kernel/modules/usb.mk index 816e7f1aa..251d66654 100644 --- a/package/kernel/modules/usb.mk +++ b/package/kernel/modules/usb.mk @@ -495,7 +495,7 @@ $(eval $(call KernelPackage,usb-serial-option)) define KernelPackage/usb-storage -$(call KernelPackage/usb/Depends,+kmod-scsi-core) +$(call KernelPackage/usb/Depends,+!TARGET_x86:kmod-scsi-core) TITLE:=USB Storage support KCONFIG:=CONFIG_USB_STORAGE FILES:=$(LINUX_DIR)/drivers/usb/storage/usb-storage.$(LINUX_KMOD_SUFFIX) From c013a5f64c6118fbe32d718c25db9105f8a226ca Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:19:48 +0000 Subject: [PATCH 62/64] kernel: these modules are already loaded by the scsi-core package git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20347 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/usb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/modules/usb.mk b/package/kernel/modules/usb.mk index 251d66654..322c62398 100644 --- a/package/kernel/modules/usb.mk +++ b/package/kernel/modules/usb.mk @@ -499,7 +499,7 @@ $(call KernelPackage/usb/Depends,+!TARGET_x86:kmod-scsi-core) TITLE:=USB Storage support KCONFIG:=CONFIG_USB_STORAGE FILES:=$(LINUX_DIR)/drivers/usb/storage/usb-storage.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,60,scsi_mod sd_mod usb-storage,1) + AUTOLOAD:=$(call AutoLoad,60,usb-storage,1) endef define KernelPackage/usb-storage/description From 75ea7f242b30d20de52f4541dd6db860447c9d7d Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 21 Mar 2010 14:22:38 +0000 Subject: [PATCH 63/64] kernel: fix some minor error: * module ide-pci-generic is also included if it was build * correct loading queue for kmod-dm * place for mvsas.ko changed in new kernel. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20348 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/kernel/modules/block.mk | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/package/kernel/modules/block.mk b/package/kernel/modules/block.mk index 009a8e168..db4624284 100644 --- a/package/kernel/modules/block.mk +++ b/package/kernel/modules/block.mk @@ -223,8 +223,14 @@ endef ifneq ($(CONFIG_arm)$(CONFIG_powerpc),y) define KernelPackage/ide-core/2.6 - FILES+=$(LINUX_DIR)/drivers/ide/ide-generic.$(LINUX_KMOD_SUFFIX) - AUTOLOAD+=$(call AutoLoad,30,ide-generic,1) + ifeq ($(CONFIG_PCI_SUPPORT),y) + FILES+=$(LINUX_DIR)/drivers/ide/ide-generic.$(LINUX_KMOD_SUFFIX) \ + $(LINUX_DIR)/drivers/ide/ide-pci-generic.$(LINUX_KMOD_SUFFIX) + AUTOLOAD+=$(call AutoLoad,30,ide-generic ide-pci-generic,1) + else + FILES+=$(LINUX_DIR)/drivers/ide/ide-generic.$(LINUX_KMOD_SUFFIX) + AUTOLOAD+=$(call AutoLoad,30,ide-generic,1) + endif endef endif @@ -380,7 +386,7 @@ define KernelPackage/dm CONFIG_BLK_DEV_DM \ CONFIG_DM_MIRROR FILES:=$(LINUX_DIR)/drivers/md/dm-*.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,30,dm-mod dm-region-hash dm-mirror dm-log) + AUTOLOAD:=$(call AutoLoad,30,dm-mod dm-log dm-region-hash dm-mirror) endef define KernelPackage/dm/description @@ -475,7 +481,11 @@ define KernelPackage/mvsas TITLE:=Marvell 88SE6440 SAS/SATA driver DEPENDS:=@TARGET_x86 +kmod-libsas KCONFIG:=CONFIG_SCSI_MVSAS - FILES:=$(LINUX_DIR)/drivers/scsi/mvsas.$(LINUX_KMOD_SUFFIX) + ifneq ($(CONFIG_LINUX_2_6_25)$(CONFIG_LINUX_2_6_30),) + FILES:=$(LINUX_DIR)/drivers/scsi/mvsas.$(LINUX_KMOD_SUFFIX) + else + FILES:=$(LINUX_DIR)/drivers/scsi/mvsas/mvsas.$(LINUX_KMOD_SUFFIX) + endif AUTOLOAD:=$(call AutoLoad,40,mvsas,1) endef From 8ffe821c146827bebd18ddce865681ff2b661dc0 Mon Sep 17 00:00:00 2001 From: lars Date: Sun, 21 Mar 2010 15:46:49 +0000 Subject: [PATCH 64/64] [xburst] jz_mmc: Fix timeout timer. Annotate timeout checks as unlikely() git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20349 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../files-2.6.32/drivers/mmc/host/jz_mmc.c | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/target/linux/xburst/files-2.6.32/drivers/mmc/host/jz_mmc.c b/target/linux/xburst/files-2.6.32/drivers/mmc/host/jz_mmc.c index 0f1a310a7..6c42a12b8 100644 --- a/target/linux/xburst/files-2.6.32/drivers/mmc/host/jz_mmc.c +++ b/target/linux/xburst/files-2.6.32/drivers/mmc/host/jz_mmc.c @@ -101,6 +101,8 @@ #define JZ_MMC_CLK_RATE 24000000 +#define JZ4740_MMC_MAX_TIMEOUT 10000000 + struct jz4740_mmc_host { struct mmc_host *mmc; struct platform_device *pdev; @@ -212,11 +214,11 @@ static void jz4740_mmc_write_data(struct jz4740_mmc_host *host, struct mmc_data j = i >> 3; i = i & 0x7; while (j) { - timeout = 100000; + timeout = JZ4740_MMC_MAX_TIMEOUT; do { status = readw(host->base + JZ_REG_MMC_IREG); } while (!(status & JZ_MMC_IRQ_TXFIFO_WR_REQ) && --timeout); - if (timeout == 0) + if (unlikely(timeout == 0)) goto err_timeout; writew(JZ_MMC_IRQ_TXFIFO_WR_REQ, host->base + JZ_REG_MMC_IREG); @@ -233,11 +235,11 @@ static void jz4740_mmc_write_data(struct jz4740_mmc_host *host, struct mmc_data --j; } if (i) { - timeout = 100000; + timeout = JZ4740_MMC_MAX_TIMEOUT; do { status = readw(host->base + JZ_REG_MMC_IREG); } while (!(status & JZ_MMC_IRQ_TXFIFO_WR_REQ) && --timeout); - if (timeout == 0) + if (unlikely(timeout == 0)) goto err_timeout; writew(JZ_MMC_IRQ_TXFIFO_WR_REQ, host->base + JZ_REG_MMC_IREG); @@ -256,11 +258,12 @@ static void jz4740_mmc_write_data(struct jz4740_mmc_host *host, struct mmc_data goto err; writew(JZ_MMC_IRQ_TXFIFO_WR_REQ, host->base + JZ_REG_MMC_IREG); - timeout = 100000; + timeout = JZ4740_MMC_MAX_TIMEOUT; do { status = readl(host->base + JZ_REG_MMC_STATUS); } while ((status & JZ_MMC_STATUS_DATA_TRAN_DONE) == 0 && --timeout); - if (timeout == 0) + + if (unlikely(timeout == 0)) goto err_timeout; writew(JZ_MMC_IRQ_DATA_TRAN_DONE, host->base + JZ_REG_MMC_IREG); @@ -312,7 +315,7 @@ static void jz4740_mmc_read_data(struct jz4740_mmc_host *host, struct mmc_data * j = i >> 5; i = i & 0x1f; while (j) { - timeout = 100000; + timeout = JZ4740_MMC_MAX_TIMEOUT; do { status = readw(host->base + JZ_REG_MMC_IREG); } while (!(status & JZ_MMC_IRQ_RXFIFO_RD_REQ) && --timeout); @@ -336,7 +339,7 @@ static void jz4740_mmc_read_data(struct jz4740_mmc_host *host, struct mmc_data * } while (i >= 4) { - timeout = 100000; + timeout = JZ4740_MMC_MAX_TIMEOUT; do { status = readl(host->base + JZ_REG_MMC_STATUS); } while ((status & JZ_MMC_STATUS_DATA_FIFO_EMPTY) && --timeout); @@ -416,6 +419,7 @@ static irqreturn_t jz_mmc_irq(int irq, void *devid) writew(tmp & ~irq_reg, host->base + JZ_REG_MMC_IREG); } + if (irq_reg & JZ_MMC_IRQ_SDIO) { writew(JZ_MMC_IRQ_SDIO, host->base + JZ_REG_MMC_IREG); mmc_signal_sdio_irq(host->mmc); @@ -466,14 +470,17 @@ handled: static int jz4740_mmc_set_clock_rate(struct jz4740_mmc_host *host, int rate) { int div = 0; - int real_rate = host->max_clock; - jz4740_mmc_clock_disable(host); + int real_rate; - while ((real_rate >> 1) >= rate && div < 7) { + jz4740_mmc_clock_disable(host); + clk_set_rate(host->clk, JZ_MMC_CLK_RATE); + + real_rate = clk_get_rate(host->clk); + + while (real_rate > rate && div < 7) { ++div; real_rate >>= 1; } - clk_set_rate(host->clk, JZ_MMC_CLK_RATE); writew(div, host->base + JZ_REG_MMC_CLKRT); return real_rate; @@ -543,7 +550,7 @@ static void jz4740_mmc_send_command(struct jz4740_mmc_host *host, struct mmc_com host->waiting = 1; jz4740_mmc_clock_enable(host, 1); - mod_timer(&host->timeout_timer, 4*HZ); + mod_timer(&host->timeout_timer, jiffies + 5*HZ); } static void jz4740_mmc_cmd_done(struct jz4740_mmc_host *host) @@ -551,8 +558,7 @@ static void jz4740_mmc_cmd_done(struct jz4740_mmc_host *host) uint32_t status; struct mmc_command *cmd = host->req->cmd; struct mmc_request *req = host->req; - unsigned int timeout = 100000; - status = readl(host->base + JZ_REG_MMC_STATUS); + unsigned int timeout = JZ4740_MMC_MAX_TIMEOUT; if (cmd->flags & MMC_RSP_PRESENT) jz4740_mmc_read_response(host, cmd); @@ -567,12 +573,12 @@ static void jz4740_mmc_cmd_done(struct jz4740_mmc_host *host) if (req->stop) { jz4740_mmc_send_command(host, req->stop); do { - status = readl(host->base + JZ_REG_MMC_STATUS); - } while ((status & JZ_MMC_STATUS_PRG_DONE) == 0 && --timeout); + status = readw(host->base + JZ_REG_MMC_IREG); + } while ((status & JZ_MMC_IRQ_PRG_DONE) == 0 && --timeout); writew(JZ_MMC_IRQ_PRG_DONE, host->base + JZ_REG_MMC_IREG); } - if (timeout == 0) + if (unlikely(timeout == 0)) req->stop->error = -ETIMEDOUT; jz4740_mmc_request_done(host);