X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/18a076fccdba90cd7bea1dd4cff1b6b0559b75f0..0338679a1a20d4eda1a60334f0aa0bca96690d51:/target/linux/lantiq/patches/104-board_xway.patch diff --git a/target/linux/lantiq/patches/104-board_xway.patch b/target/linux/lantiq/patches/104-board_xway.patch index 1aaeab63e..297fbd346 100644 --- a/target/linux/lantiq/patches/104-board_xway.patch +++ b/target/linux/lantiq/patches/104-board_xway.patch @@ -23,7 +23,7 @@ +endif --- /dev/null +++ b/arch/mips/lantiq/xway/gpio_ebu.c -@@ -0,0 +1,107 @@ +@@ -0,0 +1,116 @@ +/* + * 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 @@ -54,13 +54,9 @@ +} + +static void -+lq_ebu_set(struct gpio_chip *chip, unsigned offset, int value) ++lq_ebu_apply(void) +{ + unsigned long flags; -+ if(value) -+ shadow |= (1 << offset); -+ else -+ shadow &= ~(1 << offset); + spin_lock_irqsave(&ebu_lock, flags); + lq_w32(LQ_EBU_BUSCON, LQ_EBU_BUSCON1); + *((__u16*)virt) = shadow; @@ -68,6 +64,16 @@ + spin_unlock_irqrestore(&ebu_lock, flags); +} + ++static void ++lq_ebu_set(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ if(value) ++ shadow |= (1 << offset); ++ else ++ shadow &= ~(1 << offset); ++ lq_ebu_apply(); ++} ++ +static struct gpio_chip +lq_ebu_chip = +{ @@ -76,7 +82,7 @@ + .set = lq_ebu_set, + .base = 32, + .ngpio = 16, -+ .can_sleep = 1, ++ .can_sleep = 0, + .owner = THIS_MODULE, +}; + @@ -108,7 +114,10 @@ + + ret = gpiochip_add(&lq_ebu_chip); + if (!ret) ++ { ++ lq_ebu_apply(); + return 0; ++ } + +err_release_mem_region: + release_mem_region(res->start, resource_size(res)); @@ -130,7 +139,7 @@ + return platform_driver_register(&lq_ebu_driver); +} + -+arch_initcall(init_lq_ebu); ++postcore_initcall(init_lq_ebu); --- /dev/null +++ b/arch/mips/lantiq/xway/gpio_leds.c @@ -0,0 +1,161 @@ @@ -211,7 +220,7 @@ + .set = lq_stp_set, + .base = 48, + .ngpio = 24, -+ .can_sleep = 1, ++ .can_sleep = 0, + .owner = THIS_MODULE, +}; + @@ -294,10 +303,10 @@ + return ret; +} + -+arch_initcall(init_lq_stp); ++postcore_initcall(init_lq_stp); --- /dev/null +++ b/arch/mips/lantiq/xway/mach-easy4010.c -@@ -0,0 +1,79 @@ +@@ -0,0 +1,82 @@ +/* + * 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 @@ -353,7 +362,10 @@ + +static struct lq_pci_data lq_pci_data = { + .clock = PCI_CLOCK_INT, -+ .req_mask = 0xf, ++ .gpio = PCI_GNT1 | PCI_REQ1, ++ .irq = { ++ [14] = INT_NUM_IM0_IRL0 + 22, ++ }, +}; + +static struct lq_eth_data lq_eth_data = { @@ -379,7 +391,7 @@ + easy4010_init); --- /dev/null +++ b/arch/mips/lantiq/xway/mach-easy50712.c -@@ -0,0 +1,79 @@ +@@ -0,0 +1,82 @@ +/* + * 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 @@ -435,7 +447,10 @@ + +static struct lq_pci_data lq_pci_data = { + .clock = PCI_CLOCK_INT, -+ .req_mask = 0xf, ++ .gpio = PCI_GNT1 | PCI_REQ1, ++ .irq = { ++ [14] = INT_NUM_IM0_IRL0 + 22, ++ }, +}; + +static struct lq_eth_data lq_eth_data = { @@ -461,7 +476,7 @@ + easy50712_init); --- /dev/null +++ b/arch/mips/lantiq/xway/mach-easy50812.c -@@ -0,0 +1,78 @@ +@@ -0,0 +1,81 @@ +/* + * 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 @@ -517,7 +532,10 @@ + +static struct lq_pci_data lq_pci_data = { + .clock = PCI_CLOCK_INT, -+ .req_mask = 0xf, ++ .gpio = PCI_GNT1 | PCI_REQ1, ++ .irq = { ++ [14] = INT_NUM_IM0_IRL0 + 22, ++ }, +}; + +static struct lq_eth_data lq_eth_data = { @@ -597,7 +615,7 @@ +} --- /dev/null +++ b/arch/mips/lantiq/xway/devices.c -@@ -0,0 +1,278 @@ +@@ -0,0 +1,336 @@ +/* + * 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 @@ -620,6 +638,7 @@ +#include +#include +#include ++#include +#include + +#include @@ -650,6 +669,26 @@ + platform_device_register(&lq_gpio_leds); +} + ++/* gpio buttons */ ++static struct gpio_buttons_platform_data lq_gpio_buttons_platform_data; ++ ++static struct platform_device lq_gpio_buttons_platform_device = ++{ ++ .name = "gpio-buttons", ++ .id = 0, ++ .dev = { ++ .platform_data = (void *) &lq_gpio_buttons_platform_data, ++ }, ++}; ++ ++void __init ++lq_register_gpio_buttons(struct gpio_button *buttons, int cnt) ++{ ++ lq_gpio_buttons_platform_data.buttons = buttons; ++ lq_gpio_buttons_platform_data.nbuttons = cnt; ++ platform_device_register(&lq_gpio_buttons_platform_device); ++} ++ +/* serial to parallel conversion */ +static struct resource lq_stp_resource = +{ @@ -748,10 +787,18 @@ + .flags = IORESOURCE_MEM, +}; + ++static struct platform_device lq_ebu = ++{ ++ .name = "lq_ebu", ++ .resource = &lq_ebu_resource, ++ .num_resources = 1, ++}; ++ +void __init +lq_register_gpio_ebu(unsigned int value) +{ -+ platform_device_register_simple("lq_ebu", 0, &lq_ebu_resource, 1); ++ lq_ebu.dev.platform_data = (void*) value; ++ platform_device_register(&lq_ebu); +} + +/* ethernet */ @@ -824,13 +871,23 @@ + }, +}; + ++static unsigned int *cp1_base; ++unsigned int* ++lq_get_cp1_base(void) ++{ ++ return cp1_base; ++} ++EXPORT_SYMBOL(lq_get_cp1_base); ++ +void __init +lq_register_tapi(void) +{ +#define CP1_SIZE (1 << 20) + dma_addr_t dma; + mps_device.dev.platform_data = ++ cp1_base = + (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC)); ++ mps_device.dev.platform_data = cp1_base; + platform_device_register(&mps_device); + platform_device_register(&vmmc_device); +} @@ -876,9 +933,28 @@ + break; + } +} ++ ++void __init ++lq_register_crypto(const char *name) ++{ ++ platform_device_register_simple(name, 0, 0, 0); ++} ++ ++/* madwifi */ ++int lantiq_emulate_madwifi_eep = 0; ++EXPORT_SYMBOL(lantiq_emulate_madwifi_eep); ++ ++void __init ++lq_register_madwifi_eep(void) ++{ ++ lantiq_emulate_madwifi_eep = 1; ++} ++ ++ ++ --- /dev/null +++ b/arch/mips/lantiq/xway/devices.h -@@ -0,0 +1,24 @@ +@@ -0,0 +1,28 @@ +/* + * 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 @@ -891,6 +967,7 @@ +#define _LQ_DEVICES_H__ + +#include ++#include + +extern void __init lq_register_gpio(void); +extern void __init lq_register_gpio_stp(void); @@ -898,9 +975,12 @@ +extern void __init lq_register_gpio_leds(struct gpio_led *leds, int cnt); +extern void __init lq_register_pci(struct lq_pci_data *data); +extern void __init lq_register_nor(struct physmap_flash_data *data); ++extern void __init lq_register_tapi(void); ++extern void __init lq_register_madwifi_eep(void); +extern void __init lq_register_wdt(void); +extern void __init lq_register_ethernet(struct lq_eth_data *eth); +extern void __init lq_register_asc(int port); ++extern void __init lq_register_gpio_buttons(struct gpio_button *buttons, int cnt); + +#endif --- /dev/null @@ -1801,13 +1881,13 @@ + struct timer_dev_timer timer[MAX_NUM_OF_32BIT_TIMER_BLOCKS * 2]; +}; + -+static int gptu_ioctl(struct inode *, struct file *, unsigned int, unsigned long); ++static long gptu_ioctl(struct file *, unsigned int, unsigned long); +static int gptu_open(struct inode *, struct file *); +static int gptu_release(struct inode *, struct file *); + +static struct file_operations gptu_fops = { + .owner = THIS_MODULE, -+ .ioctl = gptu_ioctl, ++ .unlocked_ioctl = gptu_ioctl, + .open = gptu_open, + .release = gptu_release +}; @@ -2321,7 +2401,7 @@ +} +EXPORT_SYMBOL(lq_set_counter); + -+static int gptu_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ++static long gptu_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + int ret; @@ -2867,7 +2947,7 @@ + --- /dev/null +++ b/arch/mips/lantiq/xway/gpio.c -@@ -0,0 +1,203 @@ +@@ -0,0 +1,206 @@ +/* + * 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 @@ -2944,7 +3024,10 @@ + printk("failed to register %s gpio\n", name); + return -EBUSY; + } -+ gpio_direction_output(pin, dir); ++ if(dir) ++ gpio_direction_output(pin, 1); ++ else ++ gpio_direction_input(pin); + if(pin >= PINS_PER_PORT) + { + pin -= PINS_PER_PORT; @@ -3070,7 +3153,7 @@ + return ret; +} + -+arch_initcall(lq_gpio_init); ++postcore_initcall(lq_gpio_init); --- /dev/null +++ b/arch/mips/lantiq/xway/reset.c @@ -0,0 +1,53 @@