diff options
author | John Crispin <john@openwrt.org> | 2011-07-17 19:27:44 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2011-07-17 19:27:44 +0000 |
commit | 59063773328e02631c611efc34cf574c0abbeb42 (patch) | |
tree | 898e2625ceeabbeb76bb0595d7e08cfa9cde9362 /target/linux/lantiq/patches-2.6.39 | |
parent | 4da4c491a6fc76f40022c96e2f142f8ed9656ab1 (diff) | |
download | upstream-59063773328e02631c611efc34cf574c0abbeb42.tar.gz upstream-59063773328e02631c611efc34cf574c0abbeb42.tar.bz2 upstream-59063773328e02631c611efc34cf574c0abbeb42.zip |
* add gigasx76x update
* rebase patches
* add arv752DPW arv7525PD
* fixes gpio_keys
Signed-off-by: Luka Perkov <openwrt@lukaperkov.net>
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 27665
Diffstat (limited to 'target/linux/lantiq/patches-2.6.39')
14 files changed, 420 insertions, 134 deletions
diff --git a/target/linux/lantiq/patches-2.6.39/0014-fix_mtd.patch b/target/linux/lantiq/patches-2.6.39/0014-fix_mtd.patch index 051ba86cf4..d74fcb69d5 100644 --- a/target/linux/lantiq/patches-2.6.39/0014-fix_mtd.patch +++ b/target/linux/lantiq/patches-2.6.39/0014-fix_mtd.patch @@ -1,6 +1,6 @@ --- a/arch/mips/lantiq/xway/mach-easy50601.c +++ b/arch/mips/lantiq/xway/mach-easy50601.c -@@ -32,12 +32,7 @@ +@@ -32,12 +32,7 @@ static struct mtd_partition easy50601_pa { .name = "linux", .offset = 0x20000, @@ -16,7 +16,7 @@ --- a/arch/mips/lantiq/xway/mach-easy50712.c +++ b/arch/mips/lantiq/xway/mach-easy50712.c -@@ -34,12 +34,7 @@ +@@ -34,12 +34,7 @@ static struct mtd_partition easy50712_pa { .name = "linux", .offset = 0x20000, diff --git a/target/linux/lantiq/patches-2.6.39/150-falcon-easy98020.patch b/target/linux/lantiq/patches-2.6.39/150-falcon-easy98020.patch index 65557bff25..d384867eba 100644 --- a/target/linux/lantiq/patches-2.6.39/150-falcon-easy98020.patch +++ b/target/linux/lantiq/patches-2.6.39/150-falcon-easy98020.patch @@ -133,8 +133,8 @@ endif --- a/arch/mips/lantiq/falcon/Makefile +++ b/arch/mips/lantiq/falcon/Makefile -@@ -2,3 +2,4 @@ obj-y := clk-falcon.o devices.o gpio.o p - obj-y += softdog_vpe.o +@@ -3,3 +3,4 @@ obj-y += softdog_vpe.o + obj-$(CONFIG_LANTIQ_MACH_EASY98000) += addon-easy98000.o obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o +obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o diff --git a/target/linux/lantiq/patches-2.6.39/160-falcon-95C3AM1.patch b/target/linux/lantiq/patches-2.6.39/160-falcon-95C3AM1.patch index fbe858474f..9bed477e44 100644 --- a/target/linux/lantiq/patches-2.6.39/160-falcon-95C3AM1.patch +++ b/target/linux/lantiq/patches-2.6.39/160-falcon-95C3AM1.patch @@ -119,16 +119,16 @@ endif --- a/arch/mips/lantiq/falcon/Makefile +++ b/arch/mips/lantiq/falcon/Makefile -@@ -3,3 +3,4 @@ obj-y += softdog_vpe.o +@@ -4,3 +4,4 @@ obj-$(CONFIG_LANTIQ_MACH_EASY98000) += a obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o +obj-$(CONFIG_LANTIQ_MACH_95C3AM1) += mach-95C3AM1.o --- a/arch/mips/lantiq/machtypes.h +++ b/arch/mips/lantiq/machtypes.h -@@ -20,6 +20,7 @@ enum lantiq_mach_type { - LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */ +@@ -21,6 +21,7 @@ enum lantiq_mach_type { LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */ + LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */ LANTIQ_MACH_EASY98020, /* Falcon Reference Board */ + LANTIQ_MACH_95C3AM1, /* Board 95C3AM1 */ }; diff --git a/target/linux/lantiq/patches-2.6.39/200-mach-arv45xx.patch b/target/linux/lantiq/patches-2.6.39/200-mach-arv45xx.patch index 12f7c0034a..7a92b3cc2a 100644 --- a/target/linux/lantiq/patches-2.6.39/200-mach-arv45xx.patch +++ b/target/linux/lantiq/patches-2.6.39/200-mach-arv45xx.patch @@ -1,6 +1,6 @@ --- a/arch/mips/lantiq/xway/Kconfig +++ b/arch/mips/lantiq/xway/Kconfig -@@ -6,6 +6,10 @@ config LANTIQ_MACH_EASY50712 +@@ -6,6 +6,10 @@ bool "Easy50712 - Danube" default y @@ -13,14 +13,14 @@ endif --- a/arch/mips/lantiq/xway/Makefile +++ b/arch/mips/lantiq/xway/Makefile -@@ -5,3 +5,4 @@ obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o +@@ -5,3 +5,4 @@ obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o --- /dev/null +++ b/arch/mips/lantiq/xway/mach-arv45xx.c -@@ -0,0 +1,504 @@ +@@ -0,0 +1,634 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published @@ -33,7 +33,6 @@ +#include <linux/platform_device.h> +#include <linux/leds.h> +#include <linux/gpio.h> -+#include <linux/gpio_buttons.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/physmap.h> @@ -49,6 +48,7 @@ +#include "devices.h" +#include "dev-leds-gpio.h" +#include "dev-dwc_otg.h" ++#include "../dev-gpio-buttons.h" + +#ifdef CONFIG_MTD_PARTITIONS +static struct mtd_partition arv4510_partitions[] = @@ -123,6 +123,29 @@ + }, +}; + ++static struct mtd_partition arv7525_partitions[] = ++{ ++ { ++ .name = "uboot", ++ .offset = 0x0, ++ .size = 0x10000, ++ }, ++ { ++ .name = "uboot_env", ++ .offset = 0x10000, ++ .size = 0x10000, ++ }, ++ { ++ .name = "linux", ++ .offset = 0x20000, ++ .size = 0x3d0000, ++ }, ++ { ++ .name = "board_config", ++ .offset = 0x3f0000, ++ .size = 0x10000, ++ }, ++}; +#endif + +static struct physmap_flash_data arv4510_flash_data = { @@ -146,6 +169,13 @@ +#endif +}; + ++static struct physmap_flash_data arv7525_flash_data = { ++#ifdef CONFIG_MTD_PARTITIONS ++ .nr_parts = ARRAY_SIZE(arv7525_partitions), ++ .parts = arv7525_partitions, ++#endif ++}; ++ +static struct ltq_pci_data ltq_pci_data = { + .clock = PCI_CLOCK_EXT, + .gpio = PCI_GNT1 | PCI_REQ1, @@ -178,11 +208,32 @@ + { .name = "soc:green:fxo", .gpio = 75, .active_low = 1, .default_trigger = "default-on" }, +}; + -+static struct gpio_button -+arv4518pw_gpio_buttons[] __initdata = { -+ { .desc = "wlan", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 28, .active_low = 1, }, -+ { .desc = "wps", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 29, .active_low = 1, }, -+ { .desc = "reset", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 30, .active_low = 1, }, ++static struct gpio_keys_button ++arv4518pw_gpio_keys[] __initdata = { ++ { ++ .desc = "wlan", ++ .type = EV_KEY, ++ .code = BTN_0, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 28, ++ .active_low = 1, ++ }, ++ { ++ .desc = "wps", ++ .type = EV_KEY, ++ .code = BTN_1, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 29, ++ .active_low = 1, ++ }, ++ { ++ .desc = "reset", ++ .type = EV_KEY, ++ .code = BTN_2, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 30, ++ .active_low = 1, ++ }, +}; + +static struct gpio_led @@ -249,11 +300,32 @@ + { .name = "soc:green:eth4", .gpio = 86, .active_low = 1, .default_trigger = "default-on", }, +}; + -+static struct gpio_button -+arv752dpw22_gpio_buttons[] __initdata = { -+ { .desc = "btn0", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 12, .active_low = 1, }, -+ { .desc = "btn1", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 13, .active_low = 1, }, -+ { .desc = "btn2", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 28, .active_low = 1, }, ++static struct gpio_keys_button ++arv752dpw22_gpio_keys[] __initdata = { ++ { ++ .desc = "btn0", ++ .type = EV_KEY, ++ .code = BTN_0, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 12, ++ .active_low = 1, ++ }, ++ { ++ .desc = "btn1", ++ .type = EV_KEY, ++ .code = BTN_1, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 13, ++ .active_low = 1, ++ }, ++ { ++ .desc = "btn2", ++ .type = EV_KEY, ++ .code = BTN_2, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 28, ++ .active_low = 1, ++ }, +}; + +static struct gpio_led @@ -266,10 +338,24 @@ + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, }, +}; + -+static struct gpio_button -+arv7518pw_gpio_buttons[] __initdata = { -+ { .desc = "reset", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 23, .active_low = 1, }, -+ { .desc = "wlan", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 25, .active_low = 1, }, ++static struct gpio_keys_button ++arv7518pw_gpio_keys[] __initdata = { ++ { ++ .desc = "reset", ++ .type = EV_KEY, ++ .code = BTN_0, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 23, ++ .active_low = 1, ++ }, ++ { ++ .desc = "wlan", ++ .type = EV_KEY, ++ .code = BTN_1, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 25, ++ .active_low = 1, ++ }, +}; + +static void @@ -328,7 +414,7 @@ + p[i] = ((eeprom_data[(i<<1)+1]&0xff)<<24)|((eeprom_data[(i<<1)+1]&0xff00)<<8)|((eeprom_data[i<<1]&0xff)<<8)|((eeprom_data[i<<1]&0xff00)>>8); + if (i == 0xbf>>1){ + // printk ("regdomain: 0x%x --> 0x%x\n", p[i], (p[i] & 0xffff0000)|0x67); -+ /* regdomain is invalid?? how did original fw convert ++ /* regdomain is invalid?? how did original fw convert + * value to 0x82d4 ?? + * for now, force to 0x67 */ + p[i] &= 0xffff0000; @@ -378,14 +464,15 @@ +#define ARV4518PW_EBU 0 +#define ARV4518PW_USB 14 +#define ARV4518PW_SWITCH_RESET 13 ++#define ARV4518PW_MADWIFI_ADDR 0xb07f0400 + + ltq_register_gpio_ebu(ARV4518PW_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4518pw_leds_gpio), arv4518pw_leds_gpio); -+ ltq_register_gpio_buttons(arv4518pw_gpio_buttons, ARRAY_SIZE(arv4518pw_gpio_buttons)); ++ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv4518pw_gpio_keys), arv4518pw_gpio_keys); + ltq_register_nor(&arv45xx_flash_data); + ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2; + ltq_register_pci(<q_pci_data); -+ ltq_register_madwifi_eep(); ++ ltq_register_madwifi_eep(ARV4518PW_MADWIFI_ADDR); + xway_register_dwc(ARV4518PW_USB); + arv45xx_register_ethernet(); + arv45xx_register_ath5k(); @@ -432,12 +519,13 @@ +#define ARV452CPW_RELAY1 31 +#define ARV452CPW_RELAY2 79 +#define ARV452CPW_SWITCH_RESET 82 ++#define ARV452CPW_MADWIFI_ADDR 0xb07f0400 + + ltq_register_gpio_ebu(ARV452CPW_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv452cpw_leds_gpio), arv452cpw_leds_gpio); + ltq_register_nor(&arv45xx_flash_data); + ltq_register_pci(<q_pci_data); -+ ltq_register_madwifi_eep(); ++ ltq_register_madwifi_eep(ARV452CPW_MADWIFI_ADDR); + xway_register_dwc(ARV452CPW_USB); + arv45xx_register_ethernet(); + arv45xx_register_ath5k(); @@ -463,11 +551,13 @@ +static void __init +arv4525pw_init(void) +{ ++#define ARV4525PW_MADWIFI_ADDR 0xb07f0400 ++ + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4525pw_leds_gpio), arv4525pw_leds_gpio); + ltq_register_nor(&arv45xx_flash_data); + ltq_pci_data.clock = PCI_CLOCK_INT; + ltq_register_pci(<q_pci_data); -+ ltq_register_madwifi_eep(); ++ ltq_register_madwifi_eep(ARV4525PW_MADWIFI_ADDR); + ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII; + arv45xx_register_ethernet(); +} @@ -478,6 +568,22 @@ + arv4525pw_init); + +static void __init ++arv7525pw_init(void) ++{ ++ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4525pw_leds_gpio), arv4525pw_leds_gpio); ++ ltq_register_nor(&arv7525_flash_data); ++ ltq_register_pci(<q_pci_data); ++ ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII; ++ ltq_register_tapi(); ++ arv45xx_register_ethernet(); ++} ++ ++MIPS_MACHINE(LANTIQ_MACH_ARV7525PW, ++ "ARV7525PW", ++ "ARV7525PW - Speedport W303V", ++ arv7525pw_init); ++ ++static void __init +arv7518pw_init(void) +{ +#define ARV7518PW_EBU 0x2 @@ -485,7 +591,7 @@ + + ltq_register_gpio_ebu(ARV7518PW_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv7518pw_leds_gpio), arv7518pw_leds_gpio); -+ ltq_register_gpio_buttons(arv7518pw_gpio_buttons, ARRAY_SIZE(arv7518pw_gpio_buttons)); ++ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv7518pw_gpio_keys), arv7518pw_gpio_keys); + ltq_register_nor(&arv75xx_flash_data); + ltq_register_pci(<q_pci_data); + ltq_register_tapi(); @@ -499,6 +605,30 @@ + "ARV7518PW - ASTORIA", + arv7518pw_init); + ++ ++static void __init ++arv752dpw_init(void) ++{ ++#define ARV752DPW22_EBU 0x2 ++#define ARV752DPW22_USB 72 ++#define ARV752DPW22_RELAY 73 ++ ltq_register_gpio_ebu(ARV752DPW22_EBU); ++ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv752dpw22_leds_gpio), arv752dpw22_leds_gpio); ++ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv752dpw22_gpio_keys), arv752dpw22_gpio_keys); ++ ltq_register_nor(&arv75xx_flash_data); ++ ltq_register_pci(<q_pci_data); ++ xway_register_dwc(ARV752DPW22_USB); ++ arv75xx_register_ethernet(); ++ gpio_request(ARV752DPW22_RELAY, "relay"); ++ gpio_set_value(ARV752DPW22_RELAY, 1); ++ gpio_export(ARV752DPW22_RELAY, 0); ++} ++ ++MIPS_MACHINE(LANTIQ_MACH_ARV752DPW, ++ "ARV752DPW", ++ "ARV752DPW - Arcor A802", ++ arv752dpw_init); ++ +static void __init +arv752dpw22_init(void) +{ @@ -508,9 +638,9 @@ + + ltq_register_gpio_ebu(ARV752DPW22_EBU); + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv752dpw22_leds_gpio), arv752dpw22_leds_gpio); -+ ltq_register_gpio_buttons(arv752dpw22_gpio_buttons, ARRAY_SIZE(arv752dpw22_gpio_buttons)); ++ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv752dpw22_gpio_keys), arv752dpw22_gpio_keys); + ltq_register_nor(&arv75xx_flash_data); -+ ltq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31); ++ ltq_pci_data.irq[15] = (INT_NUM_IM3_IRL0 + 31); + ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2; + ltq_register_pci(<q_pci_data); + xway_register_dwc(ARV752DPW22_USB); @@ -527,8 +657,8 @@ + arv752dpw22_init); --- a/arch/mips/lantiq/machtypes.h +++ b/arch/mips/lantiq/machtypes.h -@@ -21,6 +21,17 @@ enum lantiq_mach_type { - LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */ +@@ -22,6 +22,18 @@ + LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */ LANTIQ_MACH_EASY98020, /* Falcon Reference Board */ LANTIQ_MACH_95C3AM1, /* Board 95C3AM1 */ + @@ -539,6 +669,7 @@ + LANTIQ_MACH_ARV4520PW, /* Airties WAV-281, Arcor EasyboxA800 */ + LANTIQ_MACH_ARV452CPW, /* Arcor EasyboxA801 */ + LANTIQ_MACH_ARV4525PW, /* Speedport W502V */ ++ LANTIQ_MACH_ARV7525PW, /* Speedport W303V Typ A */ + LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */ + LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */ + LANTIQ_MACH_ARV7518PW, /* ASTORIA */ diff --git a/target/linux/lantiq/patches-2.6.39/280-netif_receive_skb.patch b/target/linux/lantiq/patches-2.6.39/280-netif_receive_skb.patch index 7e870e28f9..e4a9ebdda1 100644 --- a/target/linux/lantiq/patches-2.6.39/280-netif_receive_skb.patch +++ b/target/linux/lantiq/patches-2.6.39/280-netif_receive_skb.patch @@ -1,6 +1,6 @@ --- a/drivers/net/lantiq_etop.c +++ b/drivers/net/lantiq_etop.c -@@ -155,8 +155,12 @@ +@@ -155,8 +155,12 @@ ltq_etop_hw_receive(struct ltq_etop_chan skb_put(skb, len); skb->dev = ch->netdev; diff --git a/target/linux/lantiq/patches-2.6.39/410-spi2.patch b/target/linux/lantiq/patches-2.6.39/410-spi2.patch index ee07188ed2..f84aa9fb8c 100644 --- a/target/linux/lantiq/patches-2.6.39/410-spi2.patch +++ b/target/linux/lantiq/patches-2.6.39/410-spi2.patch @@ -10,7 +10,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -193,6 +193,14 @@ +@@ -193,6 +193,14 @@ config SPI_IMX This enables using the Freescale i.MX SPI controllers in master mode. @@ -27,7 +27,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> depends on PARPORT && EXPERIMENTAL --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile -@@ -26,6 +26,7 @@ +@@ -26,6 +26,7 @@ obj-$(CONFIG_SPI_EP93XX) += ep93xx_spi. obj-$(CONFIG_SPI_GPIO) += spi_gpio.o obj-$(CONFIG_SPI_GPIO_OLD) += spi_gpio_old.o obj-$(CONFIG_SPI_IMX) += spi_imx.o diff --git a/target/linux/lantiq/patches-2.6.39/420-spi3.patch b/target/linux/lantiq/patches-2.6.39/420-spi3.patch index a0e517a7c9..b8bb0e487f 100644 --- a/target/linux/lantiq/patches-2.6.39/420-spi3.patch +++ b/target/linux/lantiq/patches-2.6.39/420-spi3.patch @@ -18,7 +18,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> #include <asm/bootinfo.h> #include <asm/irq.h> -@@ -119,3 +120,41 @@ +@@ -119,3 +120,41 @@ ltq_register_etop(struct ltq_eth_data *e platform_device_register(<q_etop); } } diff --git a/target/linux/lantiq/patches-2.6.39/510-register_madwifi.patch b/target/linux/lantiq/patches-2.6.39/510-register_madwifi.patch index 64c13b0670..faf30827fd 100644 --- a/target/linux/lantiq/patches-2.6.39/510-register_madwifi.patch +++ b/target/linux/lantiq/patches-2.6.39/510-register_madwifi.patch @@ -1,17 +1,20 @@ --- a/arch/mips/lantiq/xway/devices.c +++ b/arch/mips/lantiq/xway/devices.c -@@ -144,6 +144,16 @@ ltq_register_gpio_ebu(unsigned int value +@@ -144,6 +144,19 @@ ltq_register_gpio_ebu(unsigned int value platform_device_register(<q_ebu); } +/* madwifi */ +int lantiq_emulate_madwifi_eep = 0; ++unsigned long long lantiq_madwifi_eep_addr = 0; +EXPORT_SYMBOL(lantiq_emulate_madwifi_eep); ++EXPORT_SYMBOL(lantiq_madwifi_eep_addr); + +void __init -+ltq_register_madwifi_eep(void) ++ltq_register_madwifi_eep(unsigned long long addr) +{ + lantiq_emulate_madwifi_eep = 1; ++ lantiq_madwifi_eep_addr = addr; +} + static struct resource ltq_spi_resources[] = { @@ -23,6 +26,6 @@ extern void ltq_register_ase_asc(void); extern void ltq_register_etop(struct ltq_eth_data *eth); extern void ltq_register_gpio_ebu(unsigned int value); -+extern void ltq_register_madwifi_eep(void); ++extern void ltq_register_madwifi_eep(unsigned long long addr); #endif diff --git a/target/linux/lantiq/patches-2.6.39/520-register_buttons.patch b/target/linux/lantiq/patches-2.6.39/520-register_buttons.patch index 442df5d5ce..11097bab57 100644 --- a/target/linux/lantiq/patches-2.6.39/520-register_buttons.patch +++ b/target/linux/lantiq/patches-2.6.39/520-register_buttons.patch @@ -1,46 +1,101 @@ ---- a/arch/mips/lantiq/xway/devices.c -+++ b/arch/mips/lantiq/xway/devices.c -@@ -154,6 +154,26 @@ ltq_register_madwifi_eep(void) - lantiq_emulate_madwifi_eep = 1; - } +--- a/arch/mips/lantiq/Makefile ++++ b/arch/mips/lantiq/Makefile +@@ -4,7 +4,7 @@ + # under the terms of the GNU General Public License version 2 as published + # by the Free Software Foundation. -+/* gpio buttons */ -+static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data; +-obj-y := irq.o setup.o clk.o prom.o devices.o ++obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-buttons.o + + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o + +--- /dev/null ++++ b/arch/mips/lantiq/dev-gpio-buttons.c +@@ -0,0 +1,58 @@ ++/* ++ * Lantiq GPIO button support ++ * ++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org> ++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ */ + -+static struct platform_device ltq_gpio_buttons_platform_device = -+{ -+ .name = "gpio-buttons", -+ .id = 0, -+ .dev = { -+ .platform_data = (void *) <q_gpio_buttons_platform_data, -+ }, -+}; -+ -+void __init -+ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt) ++#include "linux/init.h" ++#include "linux/slab.h" ++#include <linux/platform_device.h> ++ ++#include "dev-gpio-buttons.h" ++ ++void __init ltq_register_gpio_keys_polled(int id, ++ unsigned poll_interval, ++ unsigned nbuttons, ++ struct gpio_keys_button *buttons) +{ -+ ltq_gpio_buttons_platform_data.buttons = buttons; -+ ltq_gpio_buttons_platform_data.nbuttons = cnt; -+ platform_device_register(<q_gpio_buttons_platform_device); ++ struct platform_device *pdev; ++ struct gpio_keys_platform_data pdata; ++ struct gpio_keys_button *p; ++ int err; ++ ++ p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL); ++ if (!p) ++ return; ++ ++ memcpy(p, buttons, nbuttons * sizeof(*p)); ++ ++ pdev = platform_device_alloc("gpio-keys-polled", id); ++ if (!pdev) ++ goto err_free_buttons; ++ ++ memset(&pdata, 0, sizeof(pdata)); ++ pdata.poll_interval = poll_interval; ++ pdata.nbuttons = nbuttons; ++ pdata.buttons = p; ++ ++ err = platform_device_add_data(pdev, &pdata, sizeof(pdata)); ++ if (err) ++ goto err_put_pdev; ++ ++ err = platform_device_add(pdev); ++ if (err) ++ goto err_put_pdev; ++ ++ return; ++ ++err_put_pdev: ++ platform_device_put(pdev); ++ ++err_free_buttons: ++ kfree(p); +} +--- /dev/null ++++ b/arch/mips/lantiq/dev-gpio-buttons.h +@@ -0,0 +1,26 @@ ++/* ++ * Lantiq GPIO button support ++ * ++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org> ++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ */ + - static struct resource ltq_spi_resources[] = { - { - .start = LTQ_SSC_BASE_ADDR, ---- a/arch/mips/lantiq/xway/devices.h -+++ b/arch/mips/lantiq/xway/devices.h -@@ -11,6 +11,7 @@ - - #include "../devices.h" - #include <linux/phy.h> -+#include <linux/gpio_buttons.h> - - extern void ltq_register_gpio(void); - extern void ltq_register_gpio_stp(void); -@@ -18,5 +19,6 @@ extern void ltq_register_ase_asc(void); - extern void ltq_register_etop(struct ltq_eth_data *eth); - extern void ltq_register_gpio_ebu(unsigned int value); - extern void ltq_register_madwifi_eep(void); -+extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt); - - #endif ++#ifndef _LANTIQ_DEV_GPIO_BUTTONS_H ++#define _LANTIQ_DEV_GPIO_BUTTONS_H ++ ++#include <linux/input.h> ++#include <linux/gpio_keys.h> ++ ++#define LTQ_KEYS_POLL_INTERVAL 20 /* msecs */ ++#define LTQ_KEYS_DEBOUNCE_INTERVAL (3 * LTQ_KEYS_POLL_INTERVAL) ++ ++void ltq_register_gpio_keys_polled(int id, ++ unsigned poll_interval, ++ unsigned nbuttons, ++ struct gpio_keys_button *buttons); ++ ++#endif /* _LANTIQ_DEV_GPIO_BUTTONS_H */ diff --git a/target/linux/lantiq/patches-2.6.39/530-register_tapi.patch b/target/linux/lantiq/patches-2.6.39/530-register_tapi.patch index a525313eae..e2b0b30649 100644 --- a/target/linux/lantiq/patches-2.6.39/530-register_tapi.patch +++ b/target/linux/lantiq/patches-2.6.39/530-register_tapi.patch @@ -32,7 +32,7 @@ #endif --- a/arch/mips/lantiq/xway/mach-easy50712.c +++ b/arch/mips/lantiq/xway/mach-easy50712.c -@@ -66,6 +66,7 @@ static void __init easy50712_init(void) +@@ -61,6 +61,7 @@ static void __init easy50712_init(void) ltq_register_nor(&easy50712_flash_data); ltq_register_pci(<q_pci_data); ltq_register_etop(<q_eth_data); diff --git a/target/linux/lantiq/patches-2.6.39/550-dwc_otg.patch b/target/linux/lantiq/patches-2.6.39/550-dwc_otg.patch index 88955934bf..a4f3e8ec75 100644 --- a/target/linux/lantiq/patches-2.6.39/550-dwc_otg.patch +++ b/target/linux/lantiq/patches-2.6.39/550-dwc_otg.patch @@ -15613,7 +15613,7 @@ +#endif --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -2812,11 +2812,11 @@ hub_port_init (struct usb_hub *hub, stru +@@ -2814,11 +2814,11 @@ hub_port_init (struct usb_hub *hub, stru udev->ttport = hdev->ttport; } else if (udev->speed != USB_SPEED_HIGH && hdev->speed == USB_SPEED_HIGH) { diff --git a/target/linux/lantiq/patches-2.6.39/560-dev-leds-gpio.patch b/target/linux/lantiq/patches-2.6.39/560-dev-leds-gpio.patch index a66dc0d858..326f8a78c2 100644 --- a/target/linux/lantiq/patches-2.6.39/560-dev-leds-gpio.patch +++ b/target/linux/lantiq/patches-2.6.39/560-dev-leds-gpio.patch @@ -88,8 +88,8 @@ # under the terms of the GNU General Public License version 2 as published # by the Free Software Foundation. --obj-y := irq.o setup.o clk.o prom.o devices.o -+obj-y := irq.o setup.o clk.o prom.o devices.o dev-leds-gpio.o +-obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-buttons.o ++obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-buttons.o dev-leds-gpio.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o diff --git a/target/linux/lantiq/patches-2.6.39/600-mach-dgn3500.patch b/target/linux/lantiq/patches-2.6.39/600-mach-dgn3500.patch index aa8db1008e..20f1cd729e 100644 --- a/target/linux/lantiq/patches-2.6.39/600-mach-dgn3500.patch +++ b/target/linux/lantiq/patches-2.6.39/600-mach-dgn3500.patch @@ -1,6 +1,6 @@ --- a/arch/mips/lantiq/machtypes.h +++ b/arch/mips/lantiq/machtypes.h -@@ -32,6 +32,9 @@ +@@ -34,6 +34,9 @@ enum lantiq_mach_type { LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */ LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */ LANTIQ_MACH_ARV7518PW, /* ASTORIA */ @@ -12,7 +12,7 @@ #endif --- a/arch/mips/lantiq/xway/Kconfig +++ b/arch/mips/lantiq/xway/Kconfig -@@ -10,6 +10,10 @@ +@@ -10,6 +10,10 @@ config LANTIQ_MACH_ARV45XX bool "ARV45XX" default y @@ -25,7 +25,7 @@ endif --- a/arch/mips/lantiq/xway/Makefile +++ b/arch/mips/lantiq/xway/Makefile -@@ -6,4 +6,5 @@ +@@ -6,4 +6,5 @@ obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o @@ -33,18 +33,18 @@ obj-y += dev-dwc_otg.o --- a/arch/mips/lantiq/xway/devices.h +++ b/arch/mips/lantiq/xway/devices.h -@@ -12,6 +12,7 @@ +@@ -11,6 +11,7 @@ + #include "../devices.h" #include <linux/phy.h> - #include <linux/gpio_buttons.h> +#include <linux/spi/spi.h> extern void ltq_register_gpio(void); extern void ltq_register_gpio_stp(void); -@@ -20,5 +21,7 @@ +@@ -18,5 +19,7 @@ extern void ltq_register_ase_asc(void); + extern void ltq_register_etop(struct ltq_eth_data *eth); extern void ltq_register_gpio_ebu(unsigned int value); - extern void ltq_register_madwifi_eep(void); - extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt); + extern void ltq_register_madwifi_eep(unsigned long long addr); +extern void ltq_register_spi(struct ltq_spi_platform_data *pdata, + struct spi_board_info const *info, unsigned n); diff --git a/target/linux/lantiq/patches-2.6.39/601-mach-gigasx76x.patch b/target/linux/lantiq/patches-2.6.39/601-mach-gigasx76x.patch index ef667fb823..0cd6e0203e 100644 --- a/target/linux/lantiq/patches-2.6.39/601-mach-gigasx76x.patch +++ b/target/linux/lantiq/patches-2.6.39/601-mach-gigasx76x.patch @@ -1,11 +1,12 @@ --- a/arch/mips/lantiq/xway/Kconfig +++ b/arch/mips/lantiq/xway/Kconfig -@@ -14,6 +14,10 @@ +@@ -14,6 +14,11 @@ config LANTIQ_MACH_NETGEAR bool "Netgear" default y +config LANTIQ_MACH_GIGASX76X + bool "GIGASX76X" ++ select LTQ_DEV_GPIO_BUTTONS + default y + endmenu @@ -13,7 +14,7 @@ endif --- a/arch/mips/lantiq/xway/Makefile +++ b/arch/mips/lantiq/xway/Makefile -@@ -7,4 +7,5 @@ +@@ -7,4 +7,5 @@ obj-$(CONFIG_LANTIQ_MACH_EASY50712) += m obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o @@ -21,7 +22,7 @@ obj-y += dev-dwc_otg.o --- /dev/null +++ b/arch/mips/lantiq/xway/mach-gigasx76x.c -@@ -0,0 +1,113 @@ +@@ -0,0 +1,209 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published @@ -32,11 +33,11 @@ + * + */ + ++#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/leds.h> +#include <linux/gpio.h> -+#include <linux/gpio_buttons.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/physmap.h> @@ -44,58 +45,71 @@ +#include <linux/ath5k_platform.h> +#include <linux/pci.h> +#include <linux/phy.h> ++#include <linux/io.h> ++#include <linux/string.h> + +#include <irq.h> + +#include <lantiq_soc.h> +#include <lantiq_platform.h> + -+#include "../machtypes.h" +#include "devices.h" +#include "dev-dwc_otg.h" -+#include "dev-leds-gpio.h" ++#include "../machtypes.h" ++#include "../dev-leds-gpio.h" ++#include "../dev-gpio-buttons.h" ++ ++#define UBOOT_ENV_OFFSET 0x010000 ++#define UBOOT_ENV_SIZE 0x010000 + +#ifdef CONFIG_MTD_PARTITIONS +static struct mtd_partition gigasx76x_partitions[] = +{ + { -+ .name = "secondary_env", -+ .offset = 0xe000, -+ .size = 0x2000, -+ }, -+ { -+ .name = "secondary_boot", -+ .offset = 0x10000, -+ .size = 0x10000, ++ .name = "uboot", ++ .offset = 0x000000, ++ .size = 0x010000, + }, + { -+ .name = "uboot", -+ .offset = 0x20000, -+ .size = 0x30000, ++ .name = "uboot_env", ++ .offset = UBOOT_ENV_OFFSET, ++ .size = UBOOT_ENV_SIZE, + }, + { + .name = "linux", -+ .offset = 0x50000, -+ .size = 0x7a0000, ++ .offset = 0x020000, ++ .size = 0x7d0000, + }, + { + .name = "board_config", + .offset = 0x7f0000, -+ .size = 0x10000, ++ .size = 0x010000, + }, +}; +#endif + +static struct gpio_led -+gigasx76x_leds_gpio[] __initdata = { ++gigasx76x_gpio_leds[] __initdata = { + { .name = "soc:green:usb", .gpio = 50, }, + { .name = "soc:green:wlan", .gpio = 51, }, + { .name = "soc:green:phone2", .gpio = 52, }, + { .name = "soc:green:phone1", .gpio = 53, }, + { .name = "soc:green:line", .gpio = 54, }, + { .name = "soc:green:online", .gpio = 55, }, ++ { .name = "soc:green:voip", .gpio = 56, }, +}; + ++static struct gpio_keys_button ++gigasx76x_gpio_keys[] __initdata = { ++ { ++ .desc = "reset", ++ .type = EV_KEY, ++ .code = KEY_RESTART, ++ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL, ++ .gpio = 14, ++ .active_low = 1, ++ }, ++}; + +static struct physmap_flash_data gigasx76x_flash_data = { +#ifdef CONFIG_MTD_PARTITIONS @@ -105,39 +119,122 @@ +}; + +static struct ltq_pci_data ltq_pci_data = { -+ .clock = PCI_CLOCK_INT, -+ .gpio = PCI_GNT1 | PCI_REQ1, -+ .irq = { -+ [14] = INT_NUM_IM0_IRL0 + 22, -+ }, ++ .clock = PCI_CLOCK_INT, ++ .gpio = PCI_GNT1 | PCI_REQ1, ++ .irq = { [14] = INT_NUM_IM0_IRL0 + 22, }, +}; + +static struct ltq_eth_data ltq_eth_data = { -+ .mii_mode = PHY_INTERFACE_MODE_MII, ++ .mii_mode = PHY_INTERFACE_MODE_MII, +}; + -+static void __init -+gigasx76x_init(void) -+{ -+#define GIGASX76X_USB 29 ++static char __init *get_uboot_env_var(char *haystack, int haystack_len, char *needle, int needle_len) { ++ int i; ++ for (i = 0; i <= haystack_len - needle_len; i++) { ++ if (memcmp(haystack + i, needle, needle_len) == 0) { ++ return haystack + i + needle_len; ++ } ++ } ++ return NULL; ++} ++ ++/* ++ * gigasx76x_parse_hex_* are not uniq. in arm/orion there are also duplicates: ++ * dns323_parse_hex_* ++ * TODO: one day write a patch for this :) ++ */ ++static int __init gigasx76x_parse_hex_nibble(char n) { ++ if (n >= '0' && n <= '9') ++ return n - '0'; ++ ++ if (n >= 'A' && n <= 'F') ++ return n - 'A' + 10; ++ ++ if (n >= 'a' && n <= 'f') ++ return n - 'a' + 10; ++ ++ return -1; ++} ++ ++static int __init gigasx76x_parse_hex_byte(const char *b) { ++ int hi; ++ int lo; ++ ++ hi = gigasx76x_parse_hex_nibble(b[0]); ++ lo = gigasx76x_parse_hex_nibble(b[1]); ++ ++ if (hi < 0 || lo < 0) ++ return -1; ++ ++ return (hi << 4) | lo; ++} ++ ++static int __init gigasx76x_register_ethernet(void) { ++ u_int8_t addr[6]; ++ int i; ++ char *uboot_env_page; ++ char *mac; ++ ++ uboot_env_page = ioremap(LTQ_FLASH_START + UBOOT_ENV_OFFSET, UBOOT_ENV_SIZE); ++ if (!uboot_env_page) ++ return -ENOMEM; ++ ++ mac = get_uboot_env_var(uboot_env_page, UBOOT_ENV_SIZE, "\0ethaddr=", 9); ++ ++ if (!mac) { ++ goto error_fail; ++ } ++ ++ /* Sanity check the string we're looking at */ ++ for (i = 0; i < 5; i++) { ++ if (*(mac + (i * 3) + 2) != ':') { ++ goto error_fail; ++ } ++ } ++ ++ for (i = 0; i < 6; i++) { ++ int byte; ++ byte = gigasx76x_parse_hex_byte(mac + (i * 3)); ++ if (byte < 0) { ++ goto error_fail; ++ } ++ addr[i] = byte; ++ } ++ ++ iounmap(uboot_env_page); ++ printk("GIGASX76X: Found ethernet MAC address: "); ++ for (i = 0; i < 6; i++) ++ printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n"); ++ ++ memcpy(<q_eth_data.mac.sa_data, addr, 6); ++ ltq_register_etop(<q_eth_data); ++ ++ return 0; ++ ++ error_fail: ++ iounmap(uboot_env_page); ++ return -EINVAL; ++} ++ ++static void __init gigasx76x_init(void) { ++#define GIGASX76X_USB 29 ++#define GIGASX76X_MADWIFI_ADDR 0xb07f0000 + + ltq_register_gpio_stp(); + ltq_register_nor(&gigasx76x_flash_data); + ltq_register_pci(<q_pci_data); -+ ltq_register_etop(<q_eth_data); ++ gigasx76x_register_ethernet(); + xway_register_dwc(GIGASX76X_USB); + ltq_register_tapi(); -+ ltq_register_madwifi_eep(); -+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(gigasx76x_leds_gpio), gigasx76x_leds_gpio); ++ ltq_register_madwifi_eep(GIGASX76X_MADWIFI_ADDR); ++ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(gigasx76x_gpio_leds), gigasx76x_gpio_leds); ++ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(gigasx76x_gpio_keys), gigasx76x_gpio_keys); +} + -+MIPS_MACHINE(LANTIQ_MACH_GIGASX76X, -+ "GIGASX76X", -+ "GIGASX76X - Gigaset SX761,SX762,SX763", -+ gigasx76x_init); ++MIPS_MACHINE(LANTIQ_MACH_GIGASX76X, "GIGASX76X", "GIGASX76X - Gigaset SX761,SX762,SX763", gigasx76x_init); --- a/arch/mips/lantiq/machtypes.h +++ b/arch/mips/lantiq/machtypes.h -@@ -35,6 +35,9 @@ +@@ -37,6 +37,9 @@ enum lantiq_mach_type { /* Netgear */ LANTIQ_MACH_DGN3500B, /* Netgear DGN3500 */ |