On 06/03/11 13:58, Luca Olivetti wrote:
> Al 06/03/11 13:15, En/na Luca Olivetti ha escrit:
> 
>> Will post patches once the pending ones are applied.
> 
> If you prefer, here's my cumulative patch that supersedes all patches
> I previously posted for lantiq:
> 
> - gpio to activate usb on the arv7518pw
> - improve support for the arv7518pw
> - use netif_rx provided by the ar8216 driver
> - various fixes to the extract.sh script
> 
> and now additionally
> 
> - export lq_register_tapi in devices.h
> - move ifx_get_cp1_base from setup.c to devices.c, where it can
>   return the address of the memory reserved for the tapi firmware
> 
> Signed-off-by: Luca Olivetti <[email protected]>
> 
> --- 
> 
> Index: target/linux/lantiq/image/Makefile
> ===================================================================
> --- target/linux/lantiq/image/Makefile        (revisión: 25626)
> +++ target/linux/lantiq/image/Makefile        (copia de trabajo)
> @@ -9,7 +9,7 @@
>  
>  JFFS2_BLOCKSIZE = 64k 128k 256k
>  
> -xway_cmdline=-console=ttyS1,115200 rootfstype=squashfs,jffs2
> +xway_cmdline=console=ttyS1,115200 rootfstype=squashfs,jffs2
>  falcon_cmdline=-console=ttyS0,115200 rootfstype=squashfs,jffs2
>  
>  define CompressLzma
> @@ -111,6 +111,14 @@
>       $(call Image/Build/$(1),$(1),ARV752DPW22)
>  endef
>  
> +define Image/BuildKernel/Profile/ARV7518PW
> +     $(call Image/BuildKernel/Template,ARV7518PW,$(xway_cmdline))
> +endef
> +
> +define Image/Build/Profile/ARV7518PW
> +     $(call Image/Build/$(1),$(1),ARV7518PW)
> +endef
> +
>  define Image/BuildKernel/Profile/Generic
>       $(call Image/BuildKernel/Template,EASY4010,$(xway_cmdline))
>       $(call Image/BuildKernel/Template,EASY50712,$(xway_cmdline))
> Index: target/linux/lantiq/extract.sh
> ===================================================================
> --- target/linux/lantiq/extract.sh    (revisión: 25626)
> +++ target/linux/lantiq/extract.sh    (copia de trabajo)
> @@ -12,30 +12,30 @@
>  }
>  
>  [ -f ${DIR}/ifxmips_fw_decodev2.tar.bz2 -a ! -f ${DIR}voip_coef.bin ] && {
> -     [ ! -f ${DIR}decode_ifx_fw && -f ${DIR}ifxmips_fw_decodev2.tar.bz2 ] && 
> {
> +     [ ! -f ${DIR}decode_ifx_fw -a -f ${DIR}ifxmips_fw_decodev2.tar.bz2 ] && 
> {
>               tar xjf ${DIR}ifxmips_fw_decodev2.tar.bz2 
> ifxmips_fw_decode/decode.c -O > ${DIR}decode.c
>               gcc -o ${DIR}decode_ifx_fw ${DIR}decode.c
>       }
> -     [ ! -f ${DIR}decode_ifx_fw ] && {
> +     [ -f ${DIR}decode_ifx_fw ] && {
>               [ ! -f ${DIR}voip_coef.lzma ] && {
> -                     ${DIR}decode_ifx_fw $FILE ${DIR}voip_coef.lzma
> +                     ${DIR}decode_ifx_fw ${FILE} ${DIR}voip_coef.lzma
>               }
> -             lzma d ${DIR}voip_coef.lzma ${DIR}voip_coef.bin
> +             lzcat ${DIR}voip_coef.lzma > ${DIR}voip_coef.bin
>       }
>  }
>  [ ! -f ${DIR}dsl_a.bin ] && {
>       dd if=${FILE} of=${DIR}dsl1.lzma bs=1 skip=2168832 count=150724
> -     lzma d ${DIR}dsl2.lzma ${DIR}dsl_a.bin
> +     lzcat ${DIR}dsl1.lzma > ${DIR}dsl_a.bin
>  }
>  
>  [ ! -f ${DIR}dsl_b.bin ] && {
>       dd if=${FILE} of=${DIR}dsl2.lzma bs=1 skip=2320384 count=148343
> -     lzma d ${DIR}dsl1.lzma ${DIR}dsl_b.bin
> +     lzcat ${DIR}dsl2.lzma > ${DIR}dsl_b.bin
>  }
>  
>  [ ! -f ${DIR}voip.bin ] && {
>       dd if=${FILE} of=${DIR}voip.lzma bs=1 skip=2468864 count=452105
> -     lzma d ${DIR}voip.lzma ${DIR}voip.bin
> +     lzcat ${DIR}voip.lzma > ${DIR}voip.bin
>  }
>  exit 0
>  
> Index: target/linux/lantiq/patches/230-xway_etop.patch
> ===================================================================
> --- target/linux/lantiq/patches/230-xway_etop.patch   (revisión: 25626)
> +++ target/linux/lantiq/patches/230-xway_etop.patch   (copia de trabajo)
> @@ -1,6 +1,6 @@
>  --- a/drivers/net/Kconfig
>  +++ b/drivers/net/Kconfig
> -@@ -343,6 +343,12 @@ config MACB
> +@@ -355,6 +355,12 @@ config MACB
>   
>   source "drivers/net/arm/Kconfig"
>   
> @@ -15,7 +15,7 @@
>       depends on ARM || MIPS || SUPERH
>  --- a/drivers/net/Makefile
>  +++ b/drivers/net/Makefile
> -@@ -204,6 +204,7 @@ obj-$(CONFIG_SNI_82596) += sni_82596.o
> +@@ -209,6 +209,7 @@ obj-$(CONFIG_SNI_82596) += sni_82596.o
>   obj-$(CONFIG_MVME16x_NET) += 82596.o
>   obj-$(CONFIG_BVME6000_NET) += 82596.o
>   obj-$(CONFIG_SC92031) += sc92031.o
> @@ -25,7 +25,7 @@
>   obj-$(CONFIG_LP486E) += lp486e.o
>  --- /dev/null
>  +++ b/drivers/net/lantiq_etop.c
> -@@ -0,0 +1,552 @@
> +@@ -0,0 +1,557 @@
>  +/*
>  + *   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
> @@ -201,8 +201,13 @@
>  +
>  +    skb_put(skb, len);
>  +    skb->dev = dev;
> -+    skb->protocol = eth_type_trans(skb, dev);
> -+    netif_rx(skb);
> ++    if (priv->phydev && priv->phydev->netif_rx) {
> ++            priv->phydev->netif_rx(skb);
> ++    } else
> ++    {
> ++            skb->protocol = eth_type_trans(skb, dev);
> ++            netif_rx(skb);
> ++    }
>  +
>  +    priv->stats.rx_packets++;
>  +    priv->stats.rx_bytes += len;
> Index: target/linux/lantiq/patches/400-mach-arv45xx.patch
> ===================================================================
> --- target/linux/lantiq/patches/400-mach-arv45xx.patch        (revisión: 
> 25626)
> +++ target/linux/lantiq/patches/400-mach-arv45xx.patch        (copia de 
> trabajo)
> @@ -1,6 +1,6 @@
>  --- a/arch/mips/include/asm/mach-lantiq/machine.h
>  +++ b/arch/mips/include/asm/mach-lantiq/machine.h
> -@@ -11,4 +11,14 @@
> +@@ -11,4 +11,14 @@ enum lantiq_mach_type {
>       LANTIQ_MACH_EASY4010,           /* Twinpass evalkit */
>       LANTIQ_MACH_EASY50712,          /* Danube evalkit */
>       LANTIQ_MACH_EASY50812,          /* AR9 eval board */
> @@ -17,7 +17,7 @@
>   };
>  --- a/arch/mips/lantiq/xway/Kconfig
>  +++ b/arch/mips/lantiq/xway/Kconfig
> -@@ -14,6 +14,10 @@
> +@@ -14,6 +14,10 @@ config LANTIQ_MACH_EASY4010
>       bool "Easy4010"
>       default y
>   
> @@ -30,14 +30,14 @@
>   endif
>  --- a/arch/mips/lantiq/xway/Makefile
>  +++ b/arch/mips/lantiq/xway/Makefile
> -@@ -3,3 +3,4 @@
> +@@ -3,3 +3,4 @@ obj-y += gpio.o gpio_ebu.o gpio_leds.o d
>   obj-$(CONFIG_LANTIQ_MACH_EASY50812) += mach-easy50812.o
>   obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
>   obj-$(CONFIG_LANTIQ_MACH_EASY4010) += mach-easy4010.o
>  +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
>  --- /dev/null
>  +++ b/arch/mips/lantiq/xway/mach-arv45xx.c
> -@@ -0,0 +1,514 @@
> +@@ -0,0 +1,552 @@
>  +/*
>  + *  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
> @@ -57,6 +57,7 @@
>  +#include <linux/input.h>
>  +#include <linux/etherdevice.h>
>  +#include <linux/ath5k_platform.h>
> ++#include <linux/ath9k_platform.h>
>  +#include <linux/pci.h>
>  +
>  +#include <machine.h>
> @@ -358,6 +359,42 @@
>  +    lqpci_plat_dev_init = arv45xx_pci_plat_dev_init;
>  +}
>  +
> ++static struct ath9k_platform_data arv7518_ath9k_wmac_data = {
> ++    .led_pin = -1,
> ++    .check_endianness = 1,
> ++};
> ++
> ++static int arv7518_pci_plat_dev_init(struct pci_dev *dev)
> ++{
> ++    dev->dev.platform_data = &arv7518_ath9k_wmac_data;
> ++    return 0;
> ++}
> ++
> ++void __init
> ++arv7518_register_ath9k(unsigned char *mac)
> ++{
> ++#define ARV7518_BRN_ATH             0xa07f0400
> ++    int i;
> ++    u16 *eepdata, sum, el;
> ++
> ++    memcpy_fromio(arv7518_ath9k_wmac_data.eeprom_data,
> ++            (void *)KSEG1ADDR(LQ_FLASH_START + ARV7518_BRN_ATH 
> ),sizeof(arv7518_ath9k_wmac_data.eeprom_data));
> ++    arv7518_ath9k_wmac_data.eeprom_data[0x208>>1]=0x82d4; /* Spain */
> ++    arv7518_ath9k_wmac_data.eeprom_data[0x20a>>1]=0x1f1f; /* as in stock 
> firmware */
> ++    /* recalc checksum for new regdomain */
> ++    sum = arv7518_ath9k_wmac_data.eeprom_data[0x200>>1];
> ++    el = sum / sizeof(u16) - 2;  /* skip length and (old) checksum */
> ++    eepdata = (u16 *) (&arv7518_ath9k_wmac_data.eeprom_data[0x204>>1]); /* 
> after checksum */
> ++    for (i = 0; i < el; i++)
> ++            sum ^= *eepdata++;
> ++    sum ^= 0xffff;
> ++    arv7518_ath9k_wmac_data.eeprom_data[0x202>>1]=sum;
> ++            
> ++    arv7518_ath9k_wmac_data.macaddr = mac;
> ++    lqpci_plat_dev_init = arv7518_pci_plat_dev_init;
> ++    pci_enable_ath9k_fixup(14, arv7518_ath9k_wmac_data.eeprom_data);
> ++}
> ++
>  +static void __init
>  +arv4510pw_init(void)
>  +{
> @@ -501,7 +538,7 @@
>  +arv7518pw_init(void)
>  +{
>  +#define ARV7518PW_EBU                       0x2
> -+#define ARV7518PW_USB                       -1
> ++#define ARV7518PW_USB                       14
>  +
>  +    lq_register_gpio();
>  +    lq_register_gpio_ebu(ARV7518PW_EBU);
> @@ -512,9 +549,10 @@
>  +    lq_register_nor(&arv75xx_flash_data);
>  +    lq_register_pci(&lq_pci_data);
>  +    lq_register_wdt();
> ++    lq_register_tapi();
>  +    xway_register_dwc(ARV7518PW_USB);
>  +    arv75xx_register_ethernet();
> -+    //arv7518_register_ath9k(mac);
> ++    arv7518_register_ath9k(lq_eth_data.mac);
>  +}
>  +
>  +MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
> @@ -552,3 +590,130 @@
>  +                    "ARV752DPW22",
>  +                    "ARV752DPW22 - Arcor A803",
>  +                    arv752dpw22_init);
> +--- a/arch/mips/include/asm/mach-lantiq/lantiq_platform.h
> ++++ b/arch/mips/include/asm/mach-lantiq/lantiq_platform.h
> +@@ -47,5 +47,6 @@ struct lq_pci_data {
> + };
> + 
> + extern int (*lqpci_plat_dev_init)(struct pci_dev *dev);
> ++void pci_enable_ath9k_fixup(unsigned slot, u16 *cal_data) __init;
> + 
> + #endif
> +--- a/arch/mips/pci/pci-lantiq.c
> ++++ b/arch/mips/pci/pci-lantiq.c
> +@@ -65,6 +65,100 @@ extern int lq_pci_read_config_dword(stru
> + extern int lq_pci_write_config_dword(struct pci_bus *bus,
> +     unsigned int devfn, int where, int size, u32 val);
> + 
> ++struct ath9k_fixup {
> ++    u16             *cal_data;
> ++    unsigned        slot;
> ++};
> ++
> ++static int ath9k_num_fixups;
> ++static struct ath9k_fixup ath9k_fixups[2];
> ++
> ++static void ath9k_pci_fixup(struct pci_dev *dev)
> ++{
> ++    void __iomem *mem;
> ++    u16 *cal_data = NULL;
> ++    u16 cmd;
> ++    u32 bar0;
> ++    u32 val;
> ++    unsigned i;
> ++
> ++    pr_info("ath9k_pci_fixup slot: %d, ath9k_num_fixups %d\n", 
> PCI_SLOT(dev->devfn), ath9k_num_fixups);
> ++    for (i = 0; i < ath9k_num_fixups; i++) {
> ++            if (ath9k_fixups[i].cal_data == NULL)
> ++                    continue;
> ++
> ++            if (ath9k_fixups[i].slot != PCI_SLOT(dev->devfn))
> ++                    continue;
> ++
> ++            cal_data = ath9k_fixups[i].cal_data;
> ++            break;
> ++    }
> ++
> ++    if (cal_data == NULL)
> ++            return;
> ++
> ++    if (*cal_data != 0xa55a) {
> ++            pr_err("pci %s: invalid calibration data\n", pci_name(dev));
> ++            return;
> ++    }
> ++
> ++    pr_info("pci %s: fixup device configuration\n", pci_name(dev));
> ++
> ++    mem = ioremap(LQ_PCI_MEM_BASE, 0x10000);
> ++    if (!mem) {
> ++            pr_err("pci %s: ioremap error\n", pci_name(dev));
> ++            return;
> ++    }
> ++
> ++    pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar0);
> ++
> ++    pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, LQ_PCI_MEM_BASE);
> ++
> ++    pci_read_config_word(dev, PCI_COMMAND, &cmd);
> ++    cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
> ++    pci_write_config_word(dev, PCI_COMMAND, cmd);
> ++
> ++    /* set pointer to first reg address */
> ++    cal_data += 3;
> ++    while (*cal_data != 0xffff) {
> ++            u32 reg;
> ++            reg = *cal_data++;
> ++            val = *cal_data++;
> ++            val |= (*cal_data++) << 16;
> ++            pr_info("ath9k_pci_fixup   reg %x val %x\n",reg,val);
> ++            __raw_writel(cpu_to_le32(val), mem + reg);
> ++            udelay(100);
> ++    }
> ++
> ++    pci_read_config_dword(dev, PCI_VENDOR_ID, &val);
> ++    dev->vendor = val & 0xffff;
> ++    dev->device = (val >> 16) & 0xffff;
> ++    pr_info("ath9k_pci_fixup  vid:pid %04x:%04x\n", dev->vendor, 
> dev->device);
> ++
> ++    pci_read_config_dword(dev, PCI_CLASS_REVISION, &val);
> ++    dev->revision = val & 0xff;
> ++    dev->class = val >> 8; /* upper 3 bytes */
> ++
> ++    pci_read_config_word(dev, PCI_COMMAND, &cmd);
> ++    cmd &= ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
> ++    pci_write_config_word(dev, PCI_COMMAND, cmd);
> ++
> ++    pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, bar0);
> ++
> ++    iounmap(mem);
> ++}
> ++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup);
> ++
> ++void __init pci_enable_ath9k_fixup(unsigned slot, u16 *cal_data)
> ++{
> ++    if (ath9k_num_fixups >= ARRAY_SIZE(ath9k_fixups))
> ++            return;
> ++
> ++    ath9k_fixups[ath9k_num_fixups].slot = slot;
> ++    ath9k_fixups[ath9k_num_fixups].cal_data = cal_data;
> ++    ath9k_num_fixups++;
> ++}
> ++
> + u32 lq_pci_mapped_cfg;
> + 
> + int (*lqpci_plat_dev_init)(struct pci_dev *dev) = NULL;
> +--- a/include/linux/ath9k_platform.h
> ++++ b/include/linux/ath9k_platform.h
> +@@ -23,6 +23,12 @@
> + 
> + struct ath9k_platform_data {
> +     u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
> ++    u8 *macaddr;
> ++
> ++    int led_pin;
> ++    u32 gpio_mask;
> ++    u32 gpio_val;
> ++    int check_endianness;
> + };
> + 
> + #endif /* _LINUX_ATH9K_PLATFORM_H */
> Index: target/linux/lantiq/patches/104-board_xway.patch
> ===================================================================
> --- target/linux/lantiq/patches/104-board_xway.patch  (revisión: 25626)
> +++ target/linux/lantiq/patches/104-board_xway.patch  (copia de trabajo)
> @@ -615,7 +615,7 @@
>  +}
>  --- /dev/null
>  +++ b/arch/mips/lantiq/xway/devices.c
> -@@ -0,0 +1,313 @@
> +@@ -0,0 +1,320 @@
>  +/*
>  + *  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
> @@ -882,6 +882,13 @@
>  +    platform_device_register(&vmmc_device);
>  +}
>  +
> ++unsigned int*
> ++lq_get_cp1_base(void)
> ++{
> ++    return mps_device.dev.platform_data;
> ++}
> ++EXPORT_SYMBOL(lq_get_cp1_base);
> ++
>  +/* asc ports */
>  +static struct resource lq_asc0_resources[] =
>  +{
> @@ -931,7 +938,7 @@
>  +}
>  --- /dev/null
>  +++ b/arch/mips/lantiq/xway/devices.h
> -@@ -0,0 +1,26 @@
> +@@ -0,0 +1,27 @@
>  +/*
>  + *  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
> @@ -954,6 +961,7 @@
>  +extern void __init lq_register_nor(struct physmap_flash_data *data);
>  +extern void __init lq_register_wdt(void);
>  +extern void __init lq_register_ethernet(struct lq_eth_data *eth);
> ++extern void __init lq_register_tapi(void);
>  +extern void __init lq_register_asc(int port);
>  +extern void __init lq_register_gpio_buttons(struct gpio_button *buttons, 
> int cnt);
>  +
> Index: target/linux/lantiq/patches/110-machine.patch
> ===================================================================
> --- target/linux/lantiq/patches/110-machine.patch     (revisión: 25626)
> +++ target/linux/lantiq/patches/110-machine.patch     (copia de trabajo)
> @@ -1,18 +1,16 @@
>  --- a/arch/mips/lantiq/setup.c
>  +++ b/arch/mips/lantiq/setup.c
> -@@ -12,7 +12,10 @@
> +@@ -12,7 +12,8 @@
>   #include <linux/ioport.h>
>   
>   #include <lantiq.h>
>  -#include <lantiq_regs.h>
>  +
>  +#include <machine.h>
> -+
> -+static unsigned int *cp1_base;
>   
>   void __init
>   plat_mem_setup(void)
> -@@ -31,6 +34,7 @@
> +@@ -31,6 +32,7 @@ plat_mem_setup(void)
>       ioport_resource.end = IOPORT_RESOURCE_END;
>       iomem_resource.start = IOMEM_RESOURCE_START;
>       iomem_resource.end = IOMEM_RESOURCE_END;
> @@ -20,23 +18,11 @@
>   
>       while (*envp)
>       {
> -@@ -42,6 +46,37 @@
> -             }
> -             envp++;
> -     }
> -+//  memsize -= 2;
> +@@ -45,3 +47,25 @@ plat_mem_setup(void)
>       memsize *= 1024 * 1024;
> -+//  cp1_base = (unsigned int*)(KSEG1 | memsize);
>       add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);
>   }
>  +
> -+unsigned int*
> -+lq_get_cp1_base(void)
> -+{
> -+    return cp1_base;
> -+}
> -+EXPORT_SYMBOL(lq_get_cp1_base);
> -+
>  +static int __init
>  +lq_machine_setup(void)
>  +{
> Index: target/linux/lantiq/xway/profiles/002-arcadyan.mk
> ===================================================================
> --- target/linux/lantiq/xway/profiles/002-arcadyan.mk (revisión: 25626)
> +++ target/linux/lantiq/xway/profiles/002-arcadyan.mk (copia de trabajo)
> @@ -63,3 +63,15 @@
>  
>  $(eval $(call Profile,ARV752DPW22))
>  
> +define Profile/ARV7518PW
> +  NAME:=ARV7518PW - ASTORIA
> +  PACKAGES:= kmod-usb-core kmod-usb-dwc-otg \
> +     kmod-ledtrig-netdev kmod-ledtrig-usbdev kmod-leds-gpio 
> kmod-button-hotplug \
> +     kmod-ath9k wpad-mini ltq-dsl-firmware-a swconfig
> +endef
> +
> +define Profile/ARV7518PW/Description
> +     Package set optimized for the ARV7518PW
> +endef
> +
> +$(eval $(call Profile,ARV7518PW))
> 
> 


i will merge the 2.6.37 update next week. this also obseltes extract.sh.
i will apply a modified version of your patch when i apply the rest

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to