Re: [OpenWrt-Devel] [PATCH v3 7/7] ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

2015-07-08 Thread John Crispin
Hi,

this function seem to be overly complicated. do you really need this ?

John

On 07/07/2015 14:58, Günther Kelleter wrote:
> +static void inc_mac_addr(u8 *base_mac, u8 *dst_mac, u8 inc)
> +{
> + u32  tmp = 0;
> + char index = 6;
> +
> + tmp = base_mac[5] + inc;
> + while ((tmp > 255) && (index > 0)) {
> + dst_mac[index-1] = tmp - 256;
> + index--;
> + tmp = base_mac[index-1] + 1;
> + }
> +
> + dst_mac[index-1] = tmp;
> + index--;
> +
> + while (index > 0) {
> + dst_mac[index-1] = base_mac[index-1];
> + index--;
> + }
> +}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3 6/7] base-files: added option to configure the gpio led trigger in uci-defaults

2015-07-08 Thread John Crispin
Hi,

see inline

On 07/07/2015 14:58, Günther Kelleter wrote:
> Signed-off-by: Günther Kelleter 
> ---
>  package/base-files/files/etc/init.d/led  |  7 +++
>  .../base-files/files/lib/functions/uci-defaults.sh   | 20 
> 
>  2 files changed, 27 insertions(+)
> 
> diff --git a/package/base-files/files/etc/init.d/led 
> b/package/base-files/files/etc/init.d/led
> index 1a57e8a..3f45732 100755
> --- a/package/base-files/files/etc/init.d/led
> +++ b/package/base-files/files/etc/init.d/led
> @@ -26,6 +26,8 @@ load_led() {
>   config_get port_state $1 port_state
>   config_get delay $1 delay "150"
>   config_get message $1 message ""
> + config_get gpio $1 gpio "0"
> + config_get inverted $1 inverted "0"
>  
>   if [ "$trigger" = "rssi" ]; then
>   # handled by rssileds userspace process
> @@ -80,6 +82,11 @@ load_led() {
>   echo $delay > /sys/class/leds/${sysfs}/delay
>   ;;
>  
> + "gpio")
> + echo $gpio > /sys/class/leds/${sysfs}/gpio
> + echo $inverted > /sys/class/leds/${sysfs}/inverted
> + ;;
> +
>   switch[0-9]*)
>   local port_mask
>  
> diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
> b/package/base-files/files/lib/functions/uci-defaults.sh
> index 5a8809d..93997b2 100644
> --- a/package/base-files/files/lib/functions/uci-defaults.sh
> +++ b/package/base-files/files/lib/functions/uci-defaults.sh
> @@ -157,6 +157,26 @@ EOF
>   UCIDEF_LEDS_CHANGED=1
>  }
>  
> +ucidef_set_led_gpio() {

the name is a bit misleading. could you change it to
ucidef_set_led_trigger_gpio or similar ?

John


> + local cfg="led_$1"
> + local name=$2
> + local sysfs=$3
> + local gpio=$4
> + local inverted=$5
> +
> + uci -q get system.$cfg && return 0
> +
> + uci batch < +set system.$cfg='led'
> +set system.$cfg.name='$name'
> +set system.$cfg.sysfs='$sysfs'
> +set system.$cfg.trigger='gpio'
> +set system.$cfg.gpio='$gpio'
> +set system.$cfg.inverted='$inverted'
> +EOF
> + UCIDEF_LEDS_CHANGED=1
> +}
> +
>  ucidef_set_rssimon() {
>   local dev="$1"
>   local refresh="$2"
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3 5/7] mac80211: make ath10k firmware v2 selectable

2015-07-08 Thread John Crispin
Hi,

dont know at10k very well so pardon my uneducated question...

how does at10k know/choose which of the 2 to use ?

John

On 07/07/2015 14:58, Günther Kelleter wrote:
> Added option for old firmware version (10.1 API v2). It seems that recent
> firmware versions are constantly crashing (at least on a QCA9880-BR4A-R) and
> this provides the option to select an older version instead.
> 
> Signed-off-by: Günther Kelleter 
> ---
>  package/kernel/mac80211/Makefile | 19 +++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/package/kernel/mac80211/Makefile 
> b/package/kernel/mac80211/Makefile
> index 7f698f0..cc98fb7 100644
> --- a/package/kernel/mac80211/Makefile
> +++ b/package/kernel/mac80211/Makefile
> @@ -620,6 +620,19 @@ Atheros IEEE 802.11ac family of chipsets. For now only
>  PCI is supported.
>  endef
>  
> +define KernelPackage/ath10k/config
> +  if PACKAGE_kmod-ath10k
> +
> + config ATH10K_API2_FW
> + bool "Firmware optimized for AP operation (v10.1 / API v2)"
> + default n
> + help
> +   Use the ath10k firmware from the 10.1 SDK using API v2 
> optimized
> +   for access point operation if the default firmware keeps 
> crashing.
> +
> +  endif
> +endef
> +
>  define KernelPackage/carl9170
>$(call KernelPackage/mac80211/Default)
>TITLE:=Driver for Atheros AR9170 USB sticks
> @@ -1844,9 +1857,15 @@ define KernelPackage/ath10k/install
>   $(INSTALL_DATA) \
>   
> $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin
>  \
>   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/
> +ifeq ($(CONFIG_ATH10K_API2_FW),y)
> + $(INSTALL_DATA) \
> + 
> $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1
>  \
> + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
> +else
>   $(INSTALL_DATA) \
>   
> $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/untested/firmware-5.bin_10.2.4.70-2
>  \
>   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
> +endif
>  endef
>  
>  define KernelPackage/mwl8k/install
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3 4/7] ar71xx: add support to use gpio irqs

2015-07-08 Thread John Crispin
Hi,

minor nitpick inline

On 07/07/2015 14:58, Günther Kelleter wrote:
> Signed-off-by: Günther Kelleter 
> ---
>  .../739-MIPS-ath79-add-gpio-irq-support.patch  | 225 
> +
>  1 file changed, 225 insertions(+)
>  create mode 100644 
> target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
> 
> diff --git 
> a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch 
> b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
> new file mode 100644
> index 000..2b90df0
> --- /dev/null
> +++ 
> b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
> @@ -0,0 +1,225 @@
> +--- a/arch/mips/ath79/gpio.c
>  b/arch/mips/ath79/gpio.c
> +@@ -20,9 +20,14 @@
> + #include 
> + #include 
> + #include 
> ++#include 
> ++#include 
> ++
> ++#include 
> + 
> + #include 
> + #include 
> ++#include 
> + #include "common.h"
> + 
> + void __iomem *ath79_gpio_base;
> +@@ -31,6 +36,13 @@ EXPORT_SYMBOL_GPL(ath79_gpio_base);
> + static unsigned long ath79_gpio_count;
> + static DEFINE_SPINLOCK(ath79_gpio_lock);
> + 
> ++/*
> ++ * gpio_both_edge is a bitmask of which gpio pins need to have
> ++ * the detect priority flipped from the interrupt handler to
> ++ * emulate IRQ_TYPE_EDGE_BOTH.
> ++ */
> ++static unsigned long gpio_both_edge = 0;
> ++
> + static void __ath79_gpio_set_value(unsigned gpio, int value)
> + {
> + void __iomem *base = ath79_gpio_base;
> +@@ -209,6 +221,133 @@ void __init ath79_gpio_output_select(uns
> + spin_unlock_irqrestore(&ath79_gpio_lock, flags);
> + }
> + 
> ++static int ath79_gpio_irq_type(struct irq_data *d, unsigned type)
> ++{
> ++int offset = d->irq - ATH79_GPIO_IRQ_BASE;
> ++void __iomem *base = ath79_gpio_base;
> ++unsigned long flags;
> ++unsigned long int_type;
> ++unsigned long int_polarity;
> ++unsigned long bit = (1 << offset);
> ++
> ++spin_lock_irqsave(&ath79_gpio_lock, flags);
> ++
> ++int_type = __raw_readl(base + AR71XX_GPIO_REG_INT_TYPE);
> ++int_polarity = __raw_readl(base + AR71XX_GPIO_REG_INT_POLARITY);
> ++
> ++gpio_both_edge &= ~bit;
> ++
> ++switch (type) {
> ++case IRQ_TYPE_EDGE_RISING:
> ++int_type &= ~bit;
> ++int_polarity |= bit;
> ++break;
> ++
> ++case IRQ_TYPE_EDGE_FALLING:
> ++int_type &= ~bit;
> ++int_polarity &= ~bit;
> ++break;
> ++
> ++case IRQ_TYPE_LEVEL_HIGH:
> ++int_type |= bit;
> ++int_polarity |= bit;
> ++break;
> ++
> ++case IRQ_TYPE_LEVEL_LOW:
> ++int_type |= bit;
> ++int_polarity &= ~bit;
> ++break;
> ++
> ++case IRQ_TYPE_EDGE_BOTH:
> ++int_type |= bit;
> ++/* set polarity based on current value */
> ++if (gpio_get_value(offset)) {
> ++int_polarity &= ~bit;
> ++} else {
> ++int_polarity |= bit;
> ++}
> ++/* flip this gpio in the interrupt handler */
> ++gpio_both_edge |= bit;
> ++break;
> ++
> ++default:
> ++spin_unlock_irqrestore(&ath79_gpio_lock, flags);
> ++return -EINVAL;
> ++}
> ++
> ++__raw_writel(int_type, base + AR71XX_GPIO_REG_INT_TYPE);
> ++__raw_writel(int_polarity, base + AR71XX_GPIO_REG_INT_POLARITY);
> ++
> ++__raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_MODE) | (1 << 
> offset),
> ++ base + AR71XX_GPIO_REG_INT_MODE);
> ++
> ++__raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
> offset),
> ++ base + AR71XX_GPIO_REG_INT_ENABLE);
> ++
> ++spin_unlock_irqrestore(&ath79_gpio_lock, flags);
> ++return 0;
> ++}
> ++
> ++static void ath79_gpio_irq_enable(struct irq_data *d)
> ++{
> ++int offset = d->irq - ATH79_GPIO_IRQ_BASE;
> ++void __iomem *base = ath79_gpio_base;
> ++
> ++__raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) | (1 << 
> offset),
> ++ base + AR71XX_GPIO_REG_INT_ENABLE);
> ++}
> ++
> ++static void ath79_gpio_irq_disable(struct irq_data *d)
> ++{
> ++int offset = d->irq - ATH79_GPIO_IRQ_BASE;
> ++void __iomem *base = ath79_gpio_base;
> ++
> ++__raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) & ~(1 << 
> offset),
> ++ base + AR71XX_GPIO_REG_INT_ENABLE);
> ++}
> ++
> ++static struct irq_chip ath79_gpio_irqchip = {
> ++.name = "GPIO",
> ++.irq_enable = ath79_gpio_irq_enable,
> ++.irq_disable = ath79_gpio_irq_disable,
> ++.irq_set_type = ath79_gpio_irq_type,
> ++};
> ++
> ++static irqreturn_t ath79_gpio_irq(int irq, void *dev)
> ++{
> ++void __iomem *base = ath79_gpio_base;
> ++unsigned int stat = __raw_readl(base + AR71XX_GPIO_REG_INT_PENDING);
> ++
> ++while (stat) {

make use of the for_each_set_bit() macro please


John





> ++int bit_num = __ffs(stat);
>

Re: [OpenWrt-Devel] [PATCH v3 2/7] ath79: dev-eth: initialize clock for id 0 on AR934X

2015-07-08 Thread John Crispin
Hi,

looking closer at the code i noticed that you need to do this as
ath79_mdio1_data is not initialized to 0 properly. the reason being that
it is not static and that in turn is because the header file declares it
as extern yet there are no users.

i would suggest you drop this patch and instead make ath79_mdio1_data
static and remove the prototype from the header file. that should have
the same effect and will make sure ath79_mdio1_data is properly initialized.

please also fix ath79_mdio0_data while at it.

John

On 07/07/2015 14:58, Günther Kelleter wrote:
> Signed-off-by: Günther Kelleter 
> ---
>  target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
> index ff94e2e..c7524be 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
> @@ -251,9 +251,11 @@ void __init ath79_register_mdio(unsigned int id, u32 
> phy_mask)
>   case ATH79_SOC_AR9344:
>   if (id == 1) {
>   mdio_data->builtin_switch = 1;
> - mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
> - mdio_data->mdio_clock = 625;
> + } else {
> + mdio_data->builtin_switch = 0;
>   }
> + mdio_data->ref_clock = ar934x_get_mdio_ref_clock();
> + mdio_data->mdio_clock = 625;
>   mdio_data->is_ar934x = 1;
>   break;
>  
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3 1/7] ar71xx: ag71xx: add pdata field supported

2015-07-08 Thread John Crispin
Hi,

On 07/07/2015 14:58, Günther Kelleter wrote:
> to allow target specific override of phydev->supported.
> 

why do you need to do this ? do you want to force a specific link type ?
if so, then using a fixed link would be preferable to faking phy caps

John


> Signed-off-by: Günther Kelleter 
> ---
>  .../ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h  | 1 +
>  .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c| 5 
> +
>  2 files changed, 6 insertions(+)
> 
> diff --git 
> a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
>  
> b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
> index d46dc4e..aa7663b 100644
> --- 
> a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
> +++ 
> b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
> @@ -30,6 +30,7 @@ struct ag71xx_platform_data {
>   u32 reset_bit;
>   u8  mac_addr[ETH_ALEN];
>   struct device   *mii_bus_dev;
> + u32 supported;
>  
>   u8  has_gbit:1;
>   u8  is_ar91xx:1;
> diff --git 
> a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c 
> b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
> index 9de77e9..0f5ec9c 100644
> --- 
> a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
> +++ 
> b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
> @@ -146,6 +146,11 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
>   else
>   phydev->supported &= PHY_BASIC_FEATURES;
>  
> + if (pdata->supported) {
> + dev_info(dev, "overriding phydev->supported (%08x)\n", 
> pdata->supported);
> + phydev->supported = pdata->supported;
> + }
> +
>   phydev->advertising = phydev->supported;
>  
>   dev_info(dev, "connected to PHY at %s [uid=%08x, driver=%s]\n",
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 3/5] ar71xx: compex wpj531 remove unnecessary switch initialization

2015-07-08 Thread John Crispin
Hi,

On 08/07/2015 17:48, Christian Mehlis wrote:
> Signed-off-by: Christian Mehlis 
> ---
>  target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
> index 2cc2fe8..7a074c8 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
> @@ -99,8 +99,6 @@ static void __init common_setup(void)
>  
>   ath79_register_m25p80(NULL);
>  
> - ath79_setup_ar933x_phy4_switch(false, false);
> -

why is this unnecessary ? do we now rely on the bootloader to have
already made the setup ?

i picked up the other 4 patches from the series already.


John




>   ath79_register_mdio(0, 0x0);
>  
>   /* LAN */
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Rebooting boards with > 16M SPI flash (was: Re: help)

2015-07-08 Thread John Crispin
Hi Paul,

looks good to me but i will run this past linux-mtd and ask them for an
opinion before merging it.

John

On 08/07/2015 14:00, Paul Fertser wrote:
> Hi,
> 
> ldy647  writes:
>> recently, when we install our wireless router, we found when we run
>> the reboot command, the board couldn't restart. We hope you could lend
>> us a hand to solve this problem. We'll be quite grateful for what you
>> do for us.
> 
> Apparently MT7620 can't handle 4 byte addressing mode of the flash
> memory on hardware (probably ROM bootloader) level so it needs to be
> reset somehow prior to resetting the SoC. Some SoCs have a special
> output from the watchdog to reset all the on-board peripherals, it
> should be connected to the !RESET pin of the flash as well. And the
> kernel should then use the watchdog driver to cause a reboot.
> 
> As a workaround when hardware modification is not possible and the
> flash IC supports a reset command, you can use a patch like this (in
> some cases when the kernel is completely stuck it won't help to reboot
> of course, as the watchdog will fire on hardware level automatically,
> if configured):
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index b298466..932f307 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -21,6 +21,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -61,6 +62,9 @@
>  /* Used for Spansion flashes only. */
>  #define  OPCODE_BRWR 0x17/* Bank register write */
>  
> +#define OPCODE_RESET_ENABLE  0x66
> +#define OPCODE_RESET 0x99
> +
>  /* Status Register bits. */
>  #define  SR_WIP  1   /* Write in progress */
>  #define  SR_WEL  2   /* Write enable latch */
> @@ -907,6 +911,21 @@ static const struct spi_device_id *jedec_probe(struct 
> spi_device *spi)
>   return ERR_PTR(-ENODEV);
>  }
>  
> +static int m25p80_reboot(struct notifier_block *nb, unsigned long val,
> +void *v)
> +{
> + struct mtd_info *mtd;
> +
> + mtd = container_of(nb, struct mtd_info, reboot_notifier);
> + struct m25p *flash = mtd_to_m25p(mtd);
> +
> + flash->command[0] = OPCODE_RESET_ENABLE;
> + spi_write(flash->spi, flash->command, 1);
> + flash->command[0] = OPCODE_RESET;
> + spi_write(flash->spi, flash->command, 1);
> +
> + return NOTIFY_DONE;
> +}
>  
>  /*
>   * board specific setup should have ensured the SPI clock used here
> @@ -1010,6 +1029,7 @@ static int m25p_probe(struct spi_device *spi)
>   flash->mtd.size = info->sector_size * info->n_sectors;
>   flash->mtd._erase = m25p80_erase;
>   flash->mtd._read = m25p80_read;
> + flash->mtd.reboot_notifier.notifier_call = m25p80_reboot;
>  
>   /* flash protection support for STmicro chips */
>   if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ST) {
> @@ -1085,6 +1105,7 @@ static int m25p_probe(struct spi_device *spi)
>   flash->mtd.eraseregions[i].numblocks);
>  
>  
> + register_reboot_notifier(&flash->mtd.reboot_notifier);
>   /* partitions should match sector boundaries; and it may be good to
>* use readonly partitions for writeprotected sectors (BP2..BP0).
>*/
> @@ -1099,6 +1120,8 @@ static int m25p_remove(struct spi_device *spi)
>   struct m25p *flash = dev_get_drvdata(&spi->dev);
>   int status;
>  
> + unregister_reboot_notifier(&flash->mtd.reboot_notifier);
> +
>   /* Clean up MTD stuff. */
>   status = mtd_device_unregister(&flash->mtd);
>   if (status == 0) {
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [ar71xx] Add support for Onion Omega

2015-07-08 Thread John Crispin
Hi,

your mail client chewed the tabs and replaced them with spaces. please
check your ail clients settings or use git to send the patch

John

On 09/07/2015 07:47, Boken Lin wrote:
> From: Boken Lin 
> 
> Add support for Onion Omega.
> Signed-off-by: Boken Lin 
> 
> ---
> target/linux/ar71xx/base-files/etc/diag.sh |  3 +
> .../ar71xx/base-files/etc/uci-defaults/02_network  |  1 +
> target/linux/ar71xx/base-files/lib/ar71xx.sh   |  3 +
> .../ar71xx/base-files/lib/upgrade/platform.sh  |  1 +
> target/linux/ar71xx/config-3.18|  1 +
> .../files/arch/mips/ath79/mach-onion-omega.c   | 85 ++
> target/linux/ar71xx/generic/profiles/onion.mk  | 16 
> target/linux/ar71xx/image/Makefile |  9 +++
> .../610-MIPS-ath79-openwrt-machines.patch  | 24 --
> tools/firmware-utils/src/mktplinkfw.c  |  8 +-
> 10 files changed, 144 insertions(+), 7 deletions(-)
> create mode 100644 
> target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
> create mode 100644 target/linux/ar71xx/generic/profiles/onion.mk
> 
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
> b/target/linux/ar71xx/base-files/etc/diag.sh
> index ce2b9ba..0015d4c 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -167,6 +167,9 @@ get_status_led() {
>   om5p-an)
>   status_led="om5p:blue:power"
>   ;;
> +onion-omega)
> +status_led="onion:amber:system"
> +;;
>   pb44)
>   status_led="pb44:amber:jump1"
>   ;;
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> index ec709a0..6e9185c 100755
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -313,6 +313,7 @@ mr600 |\
> mr600v2 |\
> mr900 |\
> mr900v2 |\
> +onion-omega |\
> rb-411 |\
> rb-911g-2hpnd |\
> rb-911g-5hpacd |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index dd13948..e23ed74 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -550,6 +550,9 @@ ar71xx_board_detect() {
>   *"OM5P AN")
>   name="om5p-an"
>   ;;
> +*"Onion Omega")
> +name="onion-omega"
> +;;
>   *PB42)
>   name="pb42"
>   ;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 73d8b0d..b045a33 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -312,6 +312,7 @@ platform_check_image() {
>   gl-inet | \
>   mc-mac1200r | \
>   oolite | \
> +onion-omega | \
>   smart-300 | \
>   tl-mr10u | \
>   tl-mr11u | \
> diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
> index 02857d5..388cb2b 100644
> --- a/target/linux/ar71xx/config-3.18
> +++ b/target/linux/ar71xx/config-3.18
> @@ -86,6 +86,7 @@ CONFIG_ATH79_MACH_NBG460N=y
> CONFIG_ATH79_MACH_NBG6716=y
> CONFIG_ATH79_MACH_OM2P=y
> CONFIG_ATH79_MACH_OM5P=y
> +CONFIG_ATH79_MACH_ONION_OMEGA=y
> CONFIG_ATH79_MACH_PB42=y
> CONFIG_ATH79_MACH_PB44=y
> CONFIG_ATH79_MACH_PB92=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
> new file mode 100644
> index 000..177e76f
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
> @@ -0,0 +1,85 @@
> +/*
> + *  Onion Omega board support
> + *
> + *  Copyright (C) 2015 Boken Lin 
> + *
> + *  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.
> + */
> +
> +#include 
> +
> +#include 
> +
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-usb.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +
> +#define OMEGA_GPIO_LED_SYSTEM   27
> +#define OMEGA_GPIO_BTN_RESET11
> +
> +#define OMEGA_GPIO_USB_POWER8
> +
> +#define OMEGA_KEYS_POLL_INTERVAL20  /* msecs */
> +#define OMEGA_KEYS_DEBOUNCE_INTERVAL(3 * OMEGA_KEYS_POLL_INTERVAL)
> +
> +static const char *omega_part_probes[] = {
> +"tp-link",
> +NULL,
> +};
> +
> +static struct flash_platform_data omega_flash_data = {
> +.part_probes= omega_part_probes,
> +};
> +
> +static struct gpio_led omega_leds_gpio[] __initdata = {
> +{
> +.name   = "onion:amber:system",
> +.gpio   = OMEGA_GPIO_LED_SYSTEM,
> +.active_low = 1,
> +},
> +};
> +
> +static struct 

[OpenWrt-Devel] [PATCH] [ar71xx] Add support for Onion Omega

2015-07-08 Thread Boken Lin
From: Boken Lin 

Add support for Onion Omega.
Signed-off-by: Boken Lin 

---
target/linux/ar71xx/base-files/etc/diag.sh |  3 +
.../ar71xx/base-files/etc/uci-defaults/02_network  |  1 +
target/linux/ar71xx/base-files/lib/ar71xx.sh   |  3 +
.../ar71xx/base-files/lib/upgrade/platform.sh  |  1 +
target/linux/ar71xx/config-3.18|  1 +
.../files/arch/mips/ath79/mach-onion-omega.c   | 85 ++
target/linux/ar71xx/generic/profiles/onion.mk  | 16 
target/linux/ar71xx/image/Makefile |  9 +++
.../610-MIPS-ath79-openwrt-machines.patch  | 24 --
tools/firmware-utils/src/mktplinkfw.c  |  8 +-
10 files changed, 144 insertions(+), 7 deletions(-)
create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
create mode 100644 target/linux/ar71xx/generic/profiles/onion.mk

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index ce2b9ba..0015d4c 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -167,6 +167,9 @@ get_status_led() {
om5p-an)
status_led="om5p:blue:power"
;;
+onion-omega)
+status_led="onion:amber:system"
+;;
pb44)
status_led="pb44:amber:jump1"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index ec709a0..6e9185c 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -313,6 +313,7 @@ mr600 |\
mr600v2 |\
mr900 |\
mr900v2 |\
+onion-omega |\
rb-411 |\
rb-911g-2hpnd |\
rb-911g-5hpacd |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index dd13948..e23ed74 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -550,6 +550,9 @@ ar71xx_board_detect() {
*"OM5P AN")
name="om5p-an"
;;
+*"Onion Omega")
+name="onion-omega"
+;;
*PB42)
name="pb42"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 73d8b0d..b045a33 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -312,6 +312,7 @@ platform_check_image() {
gl-inet | \
mc-mac1200r | \
oolite | \
+onion-omega | \
smart-300 | \
tl-mr10u | \
tl-mr11u | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 02857d5..388cb2b 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -86,6 +86,7 @@ CONFIG_ATH79_MACH_NBG460N=y
CONFIG_ATH79_MACH_NBG6716=y
CONFIG_ATH79_MACH_OM2P=y
CONFIG_ATH79_MACH_OM5P=y
+CONFIG_ATH79_MACH_ONION_OMEGA=y
CONFIG_ATH79_MACH_PB42=y
CONFIG_ATH79_MACH_PB44=y
CONFIG_ATH79_MACH_PB92=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
new file mode 100644
index 000..177e76f
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
@@ -0,0 +1,85 @@
+/*
+ *  Onion Omega board support
+ *
+ *  Copyright (C) 2015 Boken Lin 
+ *
+ *  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.
+ */
+
+#include 
+
+#include 
+
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define OMEGA_GPIO_LED_SYSTEM   27
+#define OMEGA_GPIO_BTN_RESET11
+
+#define OMEGA_GPIO_USB_POWER8
+
+#define OMEGA_KEYS_POLL_INTERVAL20  /* msecs */
+#define OMEGA_KEYS_DEBOUNCE_INTERVAL(3 * OMEGA_KEYS_POLL_INTERVAL)
+
+static const char *omega_part_probes[] = {
+"tp-link",
+NULL,
+};
+
+static struct flash_platform_data omega_flash_data = {
+.part_probes= omega_part_probes,
+};
+
+static struct gpio_led omega_leds_gpio[] __initdata = {
+{
+.name   = "onion:amber:system",
+.gpio   = OMEGA_GPIO_LED_SYSTEM,
+.active_low = 1,
+},
+};
+
+static struct gpio_keys_button omega_gpio_keys[] __initdata = {
+{
+.desc   = "reset",
+.type   = EV_KEY,
+.code   = KEY_RESTART,
+.debounce_interval = OMEGA_KEYS_DEBOUNCE_INTERVAL,
+.gpio   = OMEGA_GPIO_BTN_RESET,
+.active_low = 0,
+}
+};
+
+static void __init onion_omega_setup(void)
+{
+u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+

Re: [OpenWrt-Devel] [PATCH] ramips mt7620: ArcherC20i USB support and more

2015-07-08 Thread John Crispin
Hi,

the prefix is wrong please change it to "ramips:" there is also trailing
stuff in the mail and see below

On 08/07/2015 20:57, Gunnar Thorburn wrote:
> For TP-Link Archer C20i, USB port does not work with CC/trunk.
> This patch adds two nodes (ehci, ohci) to the Device Tree, enabling USB.
> 
> Signed-off-by: Gunnar Thorburn 
> 
> $ diff -up target/linux/ramips/dts/ArcherC20i.dts{.orig,} 
> --- target/linux/ramips/dts/ArcherC20i.dts.orig   2015-07-05 
> 15:27:04.763421748 +0200
> +++ target/linux/ramips/dts/ArcherC20i.dts2015-07-07 22:17:28.851225781 
> +0200

this patch is created against the wrong base folder. use git to generate
proper patches please.

John

> @@ -77,6 +77,14 @@
>   ralink,port-map = "w";
>   };
>  
> + ehci@101c {
> + status = "okay";
> + };
> +
> + ohci@101c1000 {
> + status = "okay";
> + };
> +
>   gsw@1011 {
>   ralink,port4 = "ephy";
>   };
> 
> 
> 
> 
> 07.07.2015 11:32 wrote Jonas Gorski:
>> Hi,
>>
> [...]
>>
>> Please fix and resend.
>>
>>
>> Jonas
> 
> The other changes (related to gpio, buttons, leds) I will perhaps submit in 
> the future when I have tested and understood better.
> 
> Gunnar
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Raspberry Pi 2 sysupgrade

2015-07-08 Thread John Crispin


On 08/07/2015 19:42, Bruno Randolf wrote:
> Hi!
> 
> I have the below change to add rudimentary support for sysupgrade on the
> Raspberry Pi. I looked at the way platform_copy_config() is implemented
> for x86 and tried to do the same, but I get the following error on mount:
> 
> mount: mounting /dev/mmcblk0p2 on /mnt failed: Device or resource busy

in that case its either still flushing the cache or has not been
properly unmounted i think. you could try adding the "partprobe" tool to
force a rescan of the table but i am not sure this is the problem here

> 
> I believe I'd need some way to re-read the partition table after the dd
> command. How does it work on x86? Any ideas?

partprobe and i think fdisk had a feature for that aswell

> 
> Also would it be OK to gzip the sdcard image to save space? It
> compresses from 76M to 11M.
> 

ok, as there is not sysupgrade supported yet this change wont break
running installations



> Below is the diff, but this is not a properly formatted patch, yet.
> 
> bruno
> 
> diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
> b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
> new file mode 100644
> index 000..95ade38
> --- /dev/null
> +++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
> @@ -0,0 +1,19 @@
> +platform_check_image() {
> +   # i know no way to verify the image
> +   return 0;
> +}
> +
> +platform_do_upgrade() {
> +   sync
> +   get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
> +   sleep 1
> +}
> +
> +## mount does not work. I think I'd need to re-read the partition table!
> +#platform_copy_config() {
> +#  echo "*** platform_copy_config called" > /dev/console
> +#  mount -t ext4 -o rw,noatime /dev/mmcblk0p2 /mnt
> +#  cp -af "$CONF_TAR" /mnt/
> +#  umount /mnt
> +#  echo "*** platform_copy_config done" > /dev/console
> +#}
> diff --git a/target/linux/brcm2708/image/Makefile
> b/target/linux/brcm2708/image/Makefile
> index e70bdd0..095cf0d 100644
> --- a/target/linux/brcm2708/image/Makefile
> +++ b/target/linux/brcm2708/image/Makefile
> @@ -28,6 +28,7 @@ define Image/Build/RaspberryPi
> mcopy -i $(KDIR)/boot.img $(KDIR)/Image ::kernel.img  # Copy
> OpenWrt built kernel
> ./gen_rpi_sdcard_img.sh
> $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img $(KDIR)/boot.img
> $(KDIR)/root.$(1) \
> $(CONFIG_BRCM2708_SD_BOOT_PARTSIZE)
> $(CONFIG_TARGET_ROOTFS_PARTSIZE)
> +   gzip -k -f $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img
>  endef
> 
>  define Image/Build
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/4] gemini: add NAS packages to Raidsonic profile

2015-07-08 Thread John Crispin


On 08/07/2015 23:00, Roman Yeryomin wrote:
> Signed-off-by: Roman Yeryomin 
> ---
>  target/linux/gemini/raidsonic/target.mk | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/target/linux/gemini/raidsonic/target.mk 
> b/target/linux/gemini/raidsonic/target.mk
> index 56eda4e..d158090 100644
> --- a/target/linux/gemini/raidsonic/target.mk
> +++ b/target/linux/gemini/raidsonic/target.mk
> @@ -4,6 +4,13 @@
>  
>  SUBTARGET:=raidsonic
>  BOARDNAME:=Raidsonic NAS42x0
> +FEATURES+=usb
> +DEFAULT_PACKAGES+=kmod-usb2 kmod-md-mod kmod-md-linear kmod-md-multipath \
> + kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-md-raid456 \
> + kmod-fs-btrfs kmod-fs-cifs kmod-fs-ext4 kmod-fs-nfs \
> + kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \
> + kmod-nls-utf8 kmod-usb-storage-extras \
> + samba36-server mdadm cfdisk fdisk e2fsprogs badblocks

some of these are not part of trunk. i think there was a policy that
DEFAULT_PACKAGES should only point at stuff in trunk. i guess madm and
badblocks need to be dropped or moved to trunk



>  
>  define Target/Description
>   Build firmware images for Raidsonic NAS4220.
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] x86/xen_domu: enable image generation

2015-07-08 Thread John Crispin
r46277 adds the backport to CC



On 08/07/2015 23:39, Luiz Angelo Daros de Luca wrote:
> This was already accepted in trunk. Is there any chance to backport to cc?
> 
> 
> Em seg, 15 de jun de 2015 04:10, Luiz Angelo Daros de Luca
> mailto:luizl...@gmail.com>> escreveu:
> 
> Add features ext4 targz to target x86/xen_domu in order to
> generate images in defconfig.
> 
> This fixes #18074.
> 
> Signed-off-by: Luiz Angelo Daros de Luca  >
> ---
>  target/linux/x86/xen_domu/target.mk  | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/linux/x86/xen_domu/target.mk 
> b/target/linux/x86/xen_domu/target.mk 
> index 80bac3b..f7a69bf 100644
> --- a/target/linux/x86/xen_domu/target.mk 
> +++ b/target/linux/x86/xen_domu/target.mk 
> @@ -1,3 +1,3 @@
>  BOARDNAME:=Xen Paravirt Guest
>  DEFAULT_PACKAGES += kmod-xen-fs kmod-xen-evtchn kmod-xen-netdev
> kmod-xen-kbddev
> -FEATURES:=display
> +FEATURES:=display ext4 targz
> --
> 2.1.4
> 
> 
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/4] gemini: copy kernel image to BIN_DIR

2015-07-08 Thread John Crispin


On 08/07/2015 23:00, Roman Yeryomin wrote:
> Signed-off-by: Roman Yeryomin 
> ---
>  target/linux/gemini/image/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/linux/gemini/image/Makefile 
> b/target/linux/gemini/image/Makefile
> index 7ed1d61..1c51b62 100644
> --- a/target/linux/gemini/image/Makefile
> +++ b/target/linux/gemini/image/Makefile
> @@ -74,7 +74,8 @@ define Image/Build
>   dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/rd.gz bs=6144k 
> count=1
>  #dd if=/dev/zero of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1
>   dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/hddapp.tgz 
> bs=6144k count=1 seek=1
> - cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage
> + cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/
> + cp $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage

this will lead to the same file being int the bin/ folder twice with
different names. is that intentional ?



>   cp ./ImageInfo-ib4220 $(BIN_DIR)/ImageInfo
>   (cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-ib4220.tar.gz 
> ImageInfo zImage rd.gz hddapp.tgz)
>   mv $(BIN_DIR)/rd.gz $(BIN_DIR)/$(IMG_PREFIX)-nas4220-rd.gz
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [OpenWrt] [LUCI] ar71xx: GUI changes

2015-07-08 Thread John kerry
Hi  Everyone,

I am working on openWRT Luci, I need to create the GUI in such way that WAN
connection is either using wireless or RJ45 using a slide switch.

Could anyone please help me how i can change the GUI based on the above.
Which part of the code i need to change.

Thanks & Regards,
John
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] x86/xen_domu: enable image generation

2015-07-08 Thread Luiz Angelo Daros de Luca
This was already accepted in trunk. Is there any chance to backport to cc?

Em seg, 15 de jun de 2015 04:10, Luiz Angelo Daros de Luca <
luizl...@gmail.com> escreveu:

> Add features ext4 targz to target x86/xen_domu in order to
> generate images in defconfig.
>
> This fixes #18074.
>
> Signed-off-by: Luiz Angelo Daros de Luca 
> ---
>  target/linux/x86/xen_domu/target.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/linux/x86/xen_domu/target.mk
> b/target/linux/x86/xen_domu/target.mk
> index 80bac3b..f7a69bf 100644
> --- a/target/linux/x86/xen_domu/target.mk
> +++ b/target/linux/x86/xen_domu/target.mk
> @@ -1,3 +1,3 @@
>  BOARDNAME:=Xen Paravirt Guest
>  DEFAULT_PACKAGES += kmod-xen-fs kmod-xen-evtchn kmod-xen-netdev
> kmod-xen-kbddev
> -FEATURES:=display
> +FEATURES:=display ext4 targz
> --
> 2.1.4
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/4] gemini: switch to 4.1

2015-07-08 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 target/linux/gemini/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/gemini/Makefile b/target/linux/gemini/Makefile
index 3667254..42f8c1e 100644
--- a/target/linux/gemini/Makefile
+++ b/target/linux/gemini/Makefile
@@ -14,7 +14,7 @@ FEATURES:=squashfs pci rtc
 CPU_TYPE:=fa526
 MAINTAINER:=Roman Yeryomin 
 
-KERNEL_PATCHVER:=3.18
+KERNEL_PATCHVER:=4.1
 
 KERNELNAME:=zImage
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] gemini: add NAS packages to Raidsonic profile

2015-07-08 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 target/linux/gemini/raidsonic/target.mk | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/gemini/raidsonic/target.mk 
b/target/linux/gemini/raidsonic/target.mk
index 56eda4e..d158090 100644
--- a/target/linux/gemini/raidsonic/target.mk
+++ b/target/linux/gemini/raidsonic/target.mk
@@ -4,6 +4,13 @@
 
 SUBTARGET:=raidsonic
 BOARDNAME:=Raidsonic NAS42x0
+FEATURES+=usb
+DEFAULT_PACKAGES+=kmod-usb2 kmod-md-mod kmod-md-linear kmod-md-multipath \
+   kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-md-raid456 \
+   kmod-fs-btrfs kmod-fs-cifs kmod-fs-ext4 kmod-fs-nfs \
+   kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \
+   kmod-nls-utf8 kmod-usb-storage-extras \
+   samba36-server mdadm cfdisk fdisk e2fsprogs badblocks
 
 define Target/Description
Build firmware images for Raidsonic NAS4220.
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/4] gemini: copy kernel image to BIN_DIR

2015-07-08 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin 
---
 target/linux/gemini/image/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/gemini/image/Makefile 
b/target/linux/gemini/image/Makefile
index 7ed1d61..1c51b62 100644
--- a/target/linux/gemini/image/Makefile
+++ b/target/linux/gemini/image/Makefile
@@ -74,7 +74,8 @@ define Image/Build
dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/rd.gz bs=6144k 
count=1
 #  dd if=/dev/zero of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1
dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/hddapp.tgz 
bs=6144k count=1 seek=1
-   cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage
+   cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/
+   cp $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage
cp ./ImageInfo-ib4220 $(BIN_DIR)/ImageInfo
(cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-ib4220.tar.gz 
ImageInfo zImage rd.gz hddapp.tgz)
mv $(BIN_DIR)/rd.gz $(BIN_DIR)/$(IMG_PREFIX)-nas4220-rd.gz
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips mt7620: ArcherC20i USB support and more

2015-07-08 Thread Gunnar Thorburn
For TP-Link Archer C20i, USB port does not work with CC/trunk.
This patch adds two nodes (ehci, ohci) to the Device Tree, enabling USB.

Signed-off-by: Gunnar Thorburn 

$ diff -up target/linux/ramips/dts/ArcherC20i.dts{.orig,} 
--- target/linux/ramips/dts/ArcherC20i.dts.orig 2015-07-05 15:27:04.763421748 
+0200
+++ target/linux/ramips/dts/ArcherC20i.dts  2015-07-07 22:17:28.851225781 
+0200
@@ -77,6 +77,14 @@
ralink,port-map = "w";
};
 
+   ehci@101c {
+   status = "okay";
+   };
+
+   ohci@101c1000 {
+   status = "okay";
+   };
+
gsw@1011 {
ralink,port4 = "ephy";
};




07.07.2015 11:32 wrote Jonas Gorski:
> Hi,
> 
[...]
> 
> Please fix and resend.
> 
> 
> Jonas

The other changes (related to gpio, buttons, leds) I will perhaps submit in the 
future when I have tested and understood better.

Gunnar
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Raspberry Pi 2 sysupgrade

2015-07-08 Thread Bruno Randolf
Hi!

I have the below change to add rudimentary support for sysupgrade on the
Raspberry Pi. I looked at the way platform_copy_config() is implemented
for x86 and tried to do the same, but I get the following error on mount:

mount: mounting /dev/mmcblk0p2 on /mnt failed: Device or resource busy

I believe I'd need some way to re-read the partition table after the dd
command. How does it work on x86? Any ideas?

Also would it be OK to gzip the sdcard image to save space? It
compresses from 76M to 11M.

Below is the diff, but this is not a properly formatted patch, yet.

bruno

diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
new file mode 100644
index 000..95ade38
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,19 @@
+platform_check_image() {
+   # i know no way to verify the image
+   return 0;
+}
+
+platform_do_upgrade() {
+   sync
+   get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
+   sleep 1
+}
+
+## mount does not work. I think I'd need to re-read the partition table!
+#platform_copy_config() {
+#  echo "*** platform_copy_config called" > /dev/console
+#  mount -t ext4 -o rw,noatime /dev/mmcblk0p2 /mnt
+#  cp -af "$CONF_TAR" /mnt/
+#  umount /mnt
+#  echo "*** platform_copy_config done" > /dev/console
+#}
diff --git a/target/linux/brcm2708/image/Makefile
b/target/linux/brcm2708/image/Makefile
index e70bdd0..095cf0d 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -28,6 +28,7 @@ define Image/Build/RaspberryPi
mcopy -i $(KDIR)/boot.img $(KDIR)/Image ::kernel.img  # Copy
OpenWrt built kernel
./gen_rpi_sdcard_img.sh
$(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img $(KDIR)/boot.img
$(KDIR)/root.$(1) \
$(CONFIG_BRCM2708_SD_BOOT_PARTSIZE)
$(CONFIG_TARGET_ROOTFS_PARTSIZE)
+   gzip -k -f $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img
 endef

 define Image/Build
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] AES module vs builtin

2015-07-08 Thread Dirk Neukirchen
On 08.07.2015 16:20, Cristian Morales Vega wrote:
> target/linux/generic/config-* has "CONFIG_CRYPTO_AES=y".

for reference its introduced in: https://dev.openwrt.org/changeset/35329/

> But package/kernel/linux/modules/crypto.mk still defines a
> kmod-crypto-aes package which just contains a file in /etc/modules.d/
> trying to load a module which doesn't exist.
> 
> Not sure how the config files in target/linux/generic files are
> created... Should kmod-crypto-aes be removed, or is
> "CONFIG_CRYPTO_AES=y" what shouldn't be there?
> 
> 
> Also, it's a bit worrisome that there was no build failure since the
> kmod-crypto-aes package description defines
> FILES:=$(LINUX_DIR)/crypto/aes_generic.ko
> and the file doesn't exist.
> There is an "OpenWRT build system expert" around? Otherwise I will try
> to take a look.

If you enable logging there will be messages that help you find cases of 
builtin modules
or other inconsistencies:

NOTICE: module 
'<...>/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.58/drivers/net/phy/rtl8366s.ko'
 is built-in.
WARNING: kmod-pwm is not available in the kernel config - generating empty 
package

No build failure makes sense because
- some modules depend on other symbols not available on all target archs
- some modules have to be built-in to boot from a rootfs (ext4) when on other 
targets built-in does not make sense
(4mb flash routers with squashfs)

> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/5] ar71xx: compex wpe72 add space to include statement

2015-07-08 Thread Christian Mehlis
Signed-off-by: Christian Mehlis 
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-wpe72.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpe72.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpe72.c
index 70bf7db..9452484 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpe72.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpe72.c
@@ -8,7 +8,7 @@
  *  by the Free Software Foundation.
  */
 
-#include
+#include 
 
 #include "dev-eth.h"
 #include "dev-gpio-buttons.h"
-- 
2.3.4.263.gf53fc38
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/5] ar71xx: compex wpj531 register usb support

2015-07-08 Thread Christian Mehlis
Signed-off-by: Christian Mehlis 
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
index 7a074c8..6992226 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
@@ -121,6 +121,7 @@ static void __init common_setup(void)
ath79_register_wmac(art + WPJ531_WMAC_CALDATA_OFFSET, NULL);
 
ath79_register_pci();
+   ath79_register_usb();
 }
 
 static void __init wpj531_setup(void)
-- 
2.3.4.263.gf53fc38
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] ar71xx: compex wpj531 remove unnecessary switch initialization

2015-07-08 Thread Christian Mehlis
Signed-off-by: Christian Mehlis 
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
index 2cc2fe8..7a074c8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
@@ -99,8 +99,6 @@ static void __init common_setup(void)
 
ath79_register_m25p80(NULL);
 
-   ath79_setup_ar933x_phy4_switch(false, false);
-
ath79_register_mdio(0, 0x0);
 
/* LAN */
-- 
2.3.4.263.gf53fc38
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/5] ar71xx: compex wpj531 fix setting mac address on ethernet

2015-07-08 Thread Christian Mehlis
Signed-off-by: Christian Mehlis 
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
index b106917..2cc2fe8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
@@ -94,9 +94,8 @@ static struct gpio_keys_button wpj531_gpio_keys[] __initdata 
= {
 
 static void __init common_setup(void)
 {
-   u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
-   u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
-   u8 tmpmac[ETH_ALEN];
+   u8 *art = (u8 *) KSEG1ADDR(0x1fff);
+   u8 *mac = (u8 *) KSEG1ADDR(0x1f02e000);
 
ath79_register_m25p80(NULL);
 
@@ -109,7 +108,7 @@ static void __init common_setup(void)
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ath79_eth0_data.speed = SPEED_100;
ath79_eth0_data.phy_mask = BIT(4);
-   ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+   ath79_init_mac(ath79_eth0_data.mac_addr, mac + WPJ531_MAC0_OFFSET, 0);
ath79_register_eth(0);
 
/* WAN */
@@ -118,10 +117,10 @@ static void __init common_setup(void)
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
ath79_eth1_data.speed = SPEED_1000;
ath79_switch_data.phy_poll_mask |= BIT(4);
-   ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
+   ath79_init_mac(ath79_eth1_data.mac_addr, mac + WPJ531_MAC1_OFFSET, 0);
ath79_register_eth(1);
 
-   ath79_register_wmac(ee, tmpmac);
+   ath79_register_wmac(art + WPJ531_WMAC_CALDATA_OFFSET, NULL);
 
ath79_register_pci();
 }
-- 
2.3.4.263.gf53fc38
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/5] ar71xx: compex wpj531 fix ethernet registration

2015-07-08 Thread Christian Mehlis
In fb6f62e97733312053ab593fcf68eea47a21169e several settings
are set on the ethernet device, but they are not working.

Fix Ethernet by setting the right values.

Signed-off-by: Christian Mehlis 
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
index e665a2e..b106917 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
@@ -115,8 +115,8 @@ static void __init common_setup(void)
/* WAN */
ath79_switch_data.phy4_mii_en = 1;
ath79_eth1_data.duplex = DUPLEX_FULL;
-   ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
-   ath79_eth1_data.speed = SPEED_100;
+   ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+   ath79_eth1_data.speed = SPEED_1000;
ath79_switch_data.phy_poll_mask |= BIT(4);
ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
ath79_register_eth(1);
-- 
2.3.4.263.gf53fc38
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mpc85xx: Enable RFKill and USB Power GPIO Control for WDR4900v1

2015-07-08 Thread Rafał Miłecki
On 8 July 2015 at 17:00, gwlim  wrote:
> This patch adds the RFKill GPIO control switch and enables another GPIO to 
> control power supply to USB Ports by emulating an LED GPIO for WDR4900v1.
>
> Signed-off-by: Guo Wei Lim 

The patch format looks fine :) The commit message could use a line
break, but I'm sure commiter can handle that if he cares at all.

Thanks for working on it!
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mpc85xx: Enable RFKill and USB Power GPIO Control for WDR4900v1

2015-07-08 Thread gwlim
This patch adds the RFKill GPIO control switch and enables another GPIO to 
control power supply to USB Ports by emulating an LED GPIO for WDR4900v1.

Signed-off-by: Guo Wei Lim 

---
 .../mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts 
b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 2beb39c..148c7a2 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -198,6 +198,11 @@
gpios = <&gpio0 4 1>; /* active low */
label = "tp-link:green:usb2";
};
+
+   usbpower {
+   gpios = <&gpio0 10 1>; /* active low */
+   label = "tp-link:usb:power";
+   };
};
 
buttons {
@@ -208,6 +213,12 @@
gpios = <&gpio0 5 1>; /* active low */
linux,code = <0x198>; /* KEY_RESTART */
};
+
+   rfkill {
+   label = "RFKILL switch";
+   gpios = <&gpio0 11 1>; /* active low */
+   linux,code = <0xf7>; /* RFKill */
+   };
};
 };
 
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: ag71xx remove IRQF_DISABLED

2015-07-08 Thread Dirk Neukirchen
no-op since 2.6.35
removed in Kernel 4.1
see https://lwn.net/Articles/380931/

Signed-off-by: Dirk Neukirchen 
---
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index dc77699..c7671d9 100644
--- 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -1248,7 +1248,7 @@ static int ag71xx_probe(struct platform_device *pdev)
 
dev->irq = platform_get_irq(pdev, 0);
err = request_irq(dev->irq, ag71xx_interrupt,
- IRQF_DISABLED,
+ 0x0,
  dev->name, dev);
if (err) {
dev_err(&pdev->dev, "unable to request IRQ %d\n", dev->irq);
-- 
2.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] AES module vs builtin

2015-07-08 Thread Cristian Morales Vega
target/linux/generic/config-* has "CONFIG_CRYPTO_AES=y".
But package/kernel/linux/modules/crypto.mk still defines a
kmod-crypto-aes package which just contains a file in /etc/modules.d/
trying to load a module which doesn't exist.

Not sure how the config files in target/linux/generic files are
created... Should kmod-crypto-aes be removed, or is
"CONFIG_CRYPTO_AES=y" what shouldn't be there?


Also, it's a bit worrisome that there was no build failure since the
kmod-crypto-aes package description defines
FILES:=$(LINUX_DIR)/crypto/aes_generic.ko
and the file doesn't exist.
There is an "OpenWRT build system expert" around? Otherwise I will try
to take a look.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Enable RFKill and USB Power GPIO Control for WDR4900v1

2015-07-08 Thread Rafał Miłecki
On 8 July 2015 at 15:19, gwlim  wrote:
>  This patch adds the RFKill GPIO control switch and enables another GPIO to
>  control power supply to USB Ports by emulating an LED GPIO.
>
>  Signed-off-by: Guo Wei Lim 

Looks better.
1) Use "mpc85xx: " prefix as already requested
2) Don't prepend every commit message line with a space
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: Fix LED-to-phy mapping for EnGenius ESR1750.

2015-07-08 Thread Christian Beier
wlan5g is phy0tpt and wlan2g phy1tpt.

Signed-off-by: Christian Beier 
---
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 4bb8d40..a361b77 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -184,8 +184,8 @@ esr900)
;;
 
 esr1750)
-   ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "esr1750:blue:wlan-2g" 
"phy0tpt"
-   ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "esr1750:blue:wlan-5g" 
"phy1tpt"
+   ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "esr1750:blue:wlan-2g" 
"phy1tpt"
+   ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "esr1750:blue:wlan-5g" 
"phy0tpt"
;;
 
 epg5000)
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH][v2] ar71xx: add support for D-Link DIR-615 rev. Ix board

2015-07-08 Thread Karl Palsson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

a couple of places look to be out of order...


> On 07/07/2015 15:18, Jaehoon You wrote:
> > diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
> > b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > old mode 100644
> > new mode 100755
> > index 6d76af8..e0712a5
> > --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > @@ -214,6 +214,7 @@ tl-wr941nd)
> >  
> >  r6100 |\
> >  smart-300 |\
> > +dir-615-i1 |\
> >  tl-mr3420-v2 |\
> >  tl-wr841n-v8 |\
> >  tl-wr842n-v2 |\

This one...



> > diff --git 
> > a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 
> > b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
> > index b40dff5..c39169a 100644
> > --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
> > +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
> > @@ -29,6 +29,9 @@ preinit_set_mac_address() {
> > fetch_mac_from_mtd config lan_mac wan_mac
> > echo 1 > 
> > /sys/class/leds/dir-615-c1:green:wancpu/brightness
> > ;;
> > +   dir-615-i1)
> > +   fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac
> > +   ;;
> > r6100)
> > mac_lan=$(mtd_get_mac_binary caldata 0)
> > [ -n "$mac_lan" ] && ifconfig eth1 hw ether "$mac_lan"

This one...


> > diff --git a/target/linux/ar71xx/image/Makefile 
> > b/target/linux/ar71xx/image/Makefile
> > index 53ce56b..05e9595 100644
> > --- a/target/linux/ar71xx/image/Makefile
> > +++ b/target/linux/ar71xx/image/Makefile
> > @@ -1154,6 +1154,7 @@ 
> > cameo_ap91_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3712k(firmware)
> >  
> > cameo_ap99_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3520k(firmware),64k(mac)ro,192k(lp)ro,64k(art)ro
> >  
> > cameo_ap121_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,3648k(firmware)
> >  
> > cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,256k(language)ro,7680k@0x8(firmware)
> > +cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
> >  
> > cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
> >  
> > cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
> >  
> > cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa(firmware)
> > @@ -1336,6 +1337,10 @@ Image/Build/CameoAP99/buildkernel=$(call 
> > MkuImageLzma,$(2),$(3) $(cameo_ap99_mtd
> >  Image/Build/CameoAP99=$(call 
> > Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap99_mtdlayout),$(4),65536)
> >  Image/Build/CameoAP99/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) 
> > $(cameo_ap99_mtdlayout))
> >  
> > +Image/Build/CameoAP123_4M/buildkernel=$(call MkuImageLzma,$(2),$(3) 
> > $(cameo_ap123_mtdlayout_4M))
> > +Image/Build/CameoAP123_4M=$(call 
> > Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap123_mtdlayout_4M),$(4),26)
> > +Image/Build/CameoAP123_4M/initramfs=$(call 
> > MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
> > +
> >  Image/Build/CameoAP135/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
> >  Image/Build/CameoAP135=$(call 
> > Image/Build/Cameo,$(1),$(2),$(3),$(4),$(5),26)
> >  Image/Build/CameoAP135/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) 
> > $(4))
> > @@ -2004,6 +2009,9 @@ $(eval $(call 
> > SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,1
> >  $(eval $(call 
> > SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
> >  $(eval $(call 
> > SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
> >  
> > +$(eval $(call 
> > SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00"))
> > +$(eval $(call 
> > SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00"))
> > +
> >  $(eval $(call 
> > SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
> >  $(eval $(call 
> > SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
> >  $(eval $(call 
> > SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
> > @@ -2124,6 +2132,7 @@ $(eval $(call 
> > SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,tt
> >  $(eval $(call 
> > SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115

[OpenWrt-Devel] [PATCH] Enable RFKill and USB Power GPIO Control for WDR4900v1

2015-07-08 Thread gwlim
 This patch adds the RFKill GPIO control switch and enables another GPIO to
 control power supply to USB Ports by emulating an LED GPIO.
 
 Signed-off-by: Guo Wei Lim 

---
 
 .../mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts 
b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 2beb39c..0abc297 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -198,6 +198,11 @@
gpios = <&gpio0 4 1>; /* active low */
label = "tp-link:green:usb2";
};
+   
+   usbpower {
+   gpios = <&gpio0 10 1>; /* active low */
+   label = "tp-link:usb:power";
+   };
};
 
buttons {
@@ -208,6 +213,12 @@
gpios = <&gpio0 5 1>; /* active low */
linux,code = <0x198>; /* KEY_RESTART */
};
+
+   rfkill {
+   label = "RFKILL switch";
+   gpios = <&gpio0 11 1>; /* active low */
+   linux,code = <0xf7>; /* RFKill */
+   };
};
 };
 
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [RFC] [RESEND] swconfig: Split libsw out of swconfig for reuse in other packages

2015-07-08 Thread Helmut Schaa
On Wed, Jul 8, 2015 at 8:37 AM, Alexandru Ardelean
 wrote:
> From: Helmut Schaa 
>
> Signed-off-by: Helmut Schaa 

Just for completeness here's my SoB.

Signed-off-by: Helmut Schaa 


Helmut

> ---
>  package/network/config/swconfig/Makefile | 9 +
>  package/network/config/swconfig/src/Makefile | 9 ++---
>  2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/package/network/config/swconfig/Makefile 
> b/package/network/config/swconfig/Makefile
> index 50d395c..5af31f7 100644
> --- a/package/network/config/swconfig/Makefile
> +++ b/package/network/config/swconfig/Makefile
> @@ -41,9 +41,18 @@ define Build/Compile
> LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm -luci"
>  endef
>
> +define Build/InstallDev
> +   $(INSTALL_DIR) $(1)/usr/include
> +   $(CP) $(PKG_BUILD_DIR)/swlib.h $(1)/usr/include/
> +
> +   $(INSTALL_DIR) $(1)/lib
> +   $(CP) $(PKG_BUILD_DIR)/libsw.so $(1)/lib/
> +endef
> +
>  define Package/swconfig/install
> $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
> $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig
> +   $(INSTALL_BIN) $(PKG_BUILD_DIR)/libsw.so $(1)/lib
> $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
>  endef
>
> diff --git a/package/network/config/swconfig/src/Makefile 
> b/package/network/config/swconfig/src/Makefile
> index 0d56f43..1176bf0 100644
> --- a/package/network/config/swconfig/src/Makefile
> +++ b/package/network/config/swconfig/src/Makefile
> @@ -6,7 +6,10 @@ LIBS=-lnl -lnl-genl
>  all: swconfig
>
>  %.o: %.c
> -   $(CC) $(CFLAGS) -c -o $@ $^
> +   $(CC) $(CFLAGS) -fPIC -c -o $@ $^
>
> -swconfig: cli.o swlib.o uci.o
> -   $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
> +libsw.so: swlib.o
> +   $(CC) $(CFLAGS) -fPIC -shared -o $@ swlib.o
> +
> +swconfig: libsw.so cli.o uci.o
> +   $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -L./ -lsw
> --
> 2.1.4
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [RESEND] swconfig: swlib.c: Fix another memleak

2015-07-08 Thread Helmut Schaa
On Wed, Jul 8, 2015 at 2:05 PM, Felix Fietkau  wrote:
> On 2015-07-08 08:37, Alexandru Ardelean wrote:
>> From: Helmut Schaa 
>>
>> Signed-off-by: Helmut Schaa 
> Erm... The author is supposed to add the Signed-off-by himself, as
> described in https://dev.openwrt.org/wiki/SubmittingPatches

Sorry, should have used my googlemail address ...

Signed-off-by: Helmut Schaa 

Helmut
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 6/8] generic: replace request_irq by request_threaded_irq to fix non working ledtrig-gpio

2015-07-08 Thread Guenther Kelleter
> -Original Message-
> From: Felix Fietkau [mailto:n...@openwrt.org]
> Sent: Wednesday, July 08, 2015 2:35 PM
> To: Guenther Kelleter; openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH v2 6/8] generic: replace request_irq by
> request_threaded_irq to fix non working ledtrig-gpio
> 
> On 2015-07-07 11:48, Guenther Kelleter wrote:
> >> -Original Message-
> >> From: Felix Fietkau [mailto:n...@openwrt.org]
> >> Sent: Monday, July 06, 2015 3:00 PM
> >> To: Guenther Kelleter; openwrt-devel@lists.openwrt.org
> >> Subject: Re: [OpenWrt-Devel] [PATCH v2 6/8] generic: replace
> >> request_irq by request_threaded_irq to fix non working ledtrig-gpio
> >>
> >> On 2015-07-06 14:14, Guenther Kelleter wrote:
> >> >
> >> >> -Original Message-
> >> >> From: Felix Fietkau [mailto:n...@openwrt.org]
> >> >> Sent: Monday, July 06, 2015 12:43 PM
> >> >> To: Guenther Kelleter; openwrt-devel@lists.openwrt.org
> >> >> Subject: Re: [OpenWrt-Devel] [PATCH v2 6/8] generic: replace
> >> >> request_irq by request_threaded_irq to fix non working
> >> >> ledtrig-gpio
> >> >>
> >> >> On 2015-07-02 13:47, Günther Kelleter wrote:
> >> >> > Signed-off-by: Günther Kelleter 
> >> >> What issue does this fix?
> >> >>
> >> >> - Felix
> >> >
> >> > Without this change, gpio_trig_gpio_store() throws this error:
> >> > [   88.54] leds devolo:status:dlan: request_irq failed with error -22
> >> > [   88.55] leds devolo:error:dlan: request_irq failed with error -22
> >> If you rework the GPIO IRQ handler code to not require threading, you
> >> probably won't have to change this generic code.
> >>
> >> - Felix
> >
> > I don't see how I could rework this. It fails because of nested interrupt
> handlers.
> > Someone already tried to solve this issue on lkml
> > http://lkml.iu.edu/hypermail/linux/kernel/1409.1/00930.html
> > but this also requires generic code changes.
> Do you really need to use a threaded IRQ for the nested interrupt handler for
> GPIO?
> Can't you change the ar71xx GPIO patch to use request_irq instead and drop the
> irq_set_nested_thread part?
> 
> - Felix


Yes, I did that already and it's still working. PATCH v3 was posted yesterday.
But: Not really sure what I'm doing. All those interrupt handling functionality 
looks really confusing to me...
 
The patches sent yesterday don't apply anymore today. Guess I have to rebase 
them again.

Günther
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 6/8] generic: replace request_irq by request_threaded_irq to fix non working ledtrig-gpio

2015-07-08 Thread Felix Fietkau
On 2015-07-07 11:48, Guenther Kelleter wrote:
>> -Original Message-
>> From: Felix Fietkau [mailto:n...@openwrt.org]
>> Sent: Monday, July 06, 2015 3:00 PM
>> To: Guenther Kelleter; openwrt-devel@lists.openwrt.org
>> Subject: Re: [OpenWrt-Devel] [PATCH v2 6/8] generic: replace request_irq by
>> request_threaded_irq to fix non working ledtrig-gpio
>> 
>> On 2015-07-06 14:14, Guenther Kelleter wrote:
>> >
>> >> -Original Message-
>> >> From: Felix Fietkau [mailto:n...@openwrt.org]
>> >> Sent: Monday, July 06, 2015 12:43 PM
>> >> To: Guenther Kelleter; openwrt-devel@lists.openwrt.org
>> >> Subject: Re: [OpenWrt-Devel] [PATCH v2 6/8] generic: replace
>> >> request_irq by request_threaded_irq to fix non working ledtrig-gpio
>> >>
>> >> On 2015-07-02 13:47, Günther Kelleter wrote:
>> >> > Signed-off-by: Günther Kelleter 
>> >> What issue does this fix?
>> >>
>> >> - Felix
>> >
>> > Without this change, gpio_trig_gpio_store() throws this error:
>> > [   88.54] leds devolo:status:dlan: request_irq failed with error -22
>> > [   88.55] leds devolo:error:dlan: request_irq failed with error -22
>> If you rework the GPIO IRQ handler code to not require threading, you 
>> probably
>> won't have to change this generic code.
>> 
>> - Felix
> 
> I don't see how I could rework this. It fails because of nested interrupt 
> handlers.
> Someone already tried to solve this issue on lkml
> http://lkml.iu.edu/hypermail/linux/kernel/1409.1/00930.html
> but this also requires generic code changes.
Do you really need to use a threaded IRQ for the nested interrupt
handler for GPIO?
Can't you change the ar71xx GPIO patch to use request_irq instead and
drop the irq_set_nested_thread part?

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH openwrt 1/3] hostapd: Always isolate if brport->multicast_to_unicast is enabled

2015-07-08 Thread Felix Fietkau
On 2015-06-18 17:23, Linus Lüssing wrote:
> For the multicast-to-unicast feature of a bridge to function correctly,
> it is necessary that all STAs are always isolated on the AP level. The
> bridge will take care of reflecting packets back to the AP interface
> if necessary and/or no STA isolation wanted by using the hairpin feature
> of the bridge.
> 
> Signed-off-by: Linus Lüssing 
> ---
>  package/network/services/hostapd/files/netifd.sh |   15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/package/network/services/hostapd/files/netifd.sh 
> b/package/network/services/hostapd/files/netifd.sh
> index 23d2e7e..74b2d02 100644
> --- a/package/network/services/hostapd/files/netifd.sh
> +++ b/package/network/services/hostapd/files/netifd.sh
> @@ -1,3 +1,6 @@
> +. /lib/network/config.sh
> +. /lib/config/uci.sh
> +
>  wpa_supplicant_add_rate() {
>   local var="$1"
>   local val="$(($2 / 1000))"
> @@ -176,6 +179,9 @@ hostapd_set_bss_options() {
>   local bss_conf
>   local wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey 
> wpa_key_mgmt
>  
> + local bridge_section=""
> + local mcast_to_ucast="1"
> +
>   json_get_vars \
>   wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \
>   maxassoc max_inactivity disassoc_low_ack isolate auth_cache \
> @@ -193,9 +199,18 @@ hostapd_set_bss_options() {
>   set_default wmm 1
>   set_default uapsd 1
>  
> + if [ -n "$network_bridge" ]; then
> + bridge_section="$(find_config $network_bridge)"
> + fi
> + if [ -n "$bridge_section" ]; then
> + mcast_to_ucast="$(uci_get_state network $bridge_section 
> mcast_to_ucast 1)"
> + fi
I really don't like the use of uci here. I think the information of
whether ap_isolate needs to be enabled should be passed from netifd to
this script in the json data.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add dts patch to enable RFKill and USB Power GPIO Control

2015-07-08 Thread Rafał Miłecki
On 8 July 2015 at 14:04, gwlim  wrote:
> --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
> +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts

This patch doesn't add a patch, but simply modifies DTS files. Your
patch subject is wrong.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add dts patch to enable RFKill and USB Power GPIO Control

2015-07-08 Thread Rafał Miłecki
Please use a prefix for the patch subject. Use e.g.
git log --oneline target/linux/mpc85xx
to get a nice view how previous patches were prefixed.

On 8 July 2015 at 14:04, gwlim  wrote:
> ---
>  This patch adds the RFKill GPIO control switch and enables another GPIO to
>  control power supply to USB Ports by emulating an LED GPIO.
>  Signed-off-by: Guo Wei Lim 

You put the comment and S-o-b under the "---" which is a comment part
of the patch. It won't be visible after applying the patch.
Also there should be an empty line above S-o-b line.

Please fix above issues and resend the patch.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Rebooting boards with > 16M SPI flash (was: Re: help)

2015-07-08 Thread Paul Fertser
Hi,

ldy647  writes:
> recently, when we install our wireless router, we found when we run
> the reboot command, the board couldn't restart. We hope you could lend
> us a hand to solve this problem. We'll be quite grateful for what you
> do for us.

Apparently MT7620 can't handle 4 byte addressing mode of the flash
memory on hardware (probably ROM bootloader) level so it needs to be
reset somehow prior to resetting the SoC. Some SoCs have a special
output from the watchdog to reset all the on-board peripherals, it
should be connected to the !RESET pin of the flash as well. And the
kernel should then use the watchdog driver to cause a reboot.

As a workaround when hardware modification is not possible and the
flash IC supports a reset command, you can use a patch like this (in
some cases when the kernel is completely stuck it won't help to reboot
of course, as the watchdog will fire on hardware level automatically,
if configured):

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index b298466..932f307 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -61,6 +62,9 @@
 /* Used for Spansion flashes only. */
 #defineOPCODE_BRWR 0x17/* Bank register write */
 
+#define OPCODE_RESET_ENABLE0x66
+#define OPCODE_RESET   0x99
+
 /* Status Register bits. */
 #defineSR_WIP  1   /* Write in progress */
 #defineSR_WEL  2   /* Write enable latch */
@@ -907,6 +911,21 @@ static const struct spi_device_id *jedec_probe(struct 
spi_device *spi)
return ERR_PTR(-ENODEV);
 }
 
+static int m25p80_reboot(struct notifier_block *nb, unsigned long val,
+  void *v)
+{
+   struct mtd_info *mtd;
+
+   mtd = container_of(nb, struct mtd_info, reboot_notifier);
+   struct m25p *flash = mtd_to_m25p(mtd);
+
+   flash->command[0] = OPCODE_RESET_ENABLE;
+   spi_write(flash->spi, flash->command, 1);
+   flash->command[0] = OPCODE_RESET;
+   spi_write(flash->spi, flash->command, 1);
+
+   return NOTIFY_DONE;
+}
 
 /*
  * board specific setup should have ensured the SPI clock used here
@@ -1010,6 +1029,7 @@ static int m25p_probe(struct spi_device *spi)
flash->mtd.size = info->sector_size * info->n_sectors;
flash->mtd._erase = m25p80_erase;
flash->mtd._read = m25p80_read;
+   flash->mtd.reboot_notifier.notifier_call = m25p80_reboot;
 
/* flash protection support for STmicro chips */
if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ST) {
@@ -1085,6 +1105,7 @@ static int m25p_probe(struct spi_device *spi)
flash->mtd.eraseregions[i].numblocks);
 
 
+   register_reboot_notifier(&flash->mtd.reboot_notifier);
/* partitions should match sector boundaries; and it may be good to
 * use readonly partitions for writeprotected sectors (BP2..BP0).
 */
@@ -1099,6 +1120,8 @@ static int m25p_remove(struct spi_device *spi)
struct m25p *flash = dev_get_drvdata(&spi->dev);
int status;
 
+   unregister_reboot_notifier(&flash->mtd.reboot_notifier);
+
/* Clean up MTD stuff. */
status = mtd_device_unregister(&flash->mtd);
if (status == 0) {

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercer...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [RESEND] swconfig: swlib.c: Fix another memleak

2015-07-08 Thread Felix Fietkau
On 2015-07-08 08:37, Alexandru Ardelean wrote:
> From: Helmut Schaa 
> 
> Signed-off-by: Helmut Schaa 
Erm... The author is supposed to add the Signed-off-by himself, as
described in https://dev.openwrt.org/wiki/SubmittingPatches

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Add dts patch to enable RFKill and USB Power GPIO Control

2015-07-08 Thread gwlim
---
 This patch adds the RFKill GPIO control switch and enables another GPIO to
 control power supply to USB Ports by emulating an LED GPIO.
 Signed-off-by: Guo Wei Lim 
 
 .../mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts 
b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 2beb39c..0abc297 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -198,6 +198,11 @@
gpios = <&gpio0 4 1>; /* active low */
label = "tp-link:green:usb2";
};
+   
+   usbpower {
+   gpios = <&gpio0 10 1>; /* active low */
+   label = "tp-link:usb:power";
+   };
};
 
buttons {
@@ -208,6 +213,12 @@
gpios = <&gpio0 5 1>; /* active low */
linux,code = <0x198>; /* KEY_RESTART */
};
+
+   rfkill {
+   label = "RFKILL switch";
+   gpios = <&gpio0 11 1>; /* active low */
+   linux,code = <0xf7>; /* RFKill */
+   };
};
 };
 
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3] ncm: add support to run via proto wwan

2015-07-08 Thread Aleksandr Kolesnik
Signed-off-by: Aleksandr Kolesnik mailto:ner...@gmail.com> >

 

--- a/package/network/utils/comgt/files/ncm.sh

+++ b/package/network/utils/comgt/files/ncm.sh

@@ -27,6 +27,8 @@ proto_ncm_setup() {

   local device apn auth username password pincode delay mode

   json_get_vars device apn auth username password pincode delay
mode

+ [ -n "$ctl_device" ] && device=$ctl_device

+ 

   [ -n "$device" ] || {

   echo "No control device specified"

   proto_notify_error "$interface" NO_DEVICE

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Hardening Issues / Revert r46146 ?

2015-07-08 Thread Dirk Neukirchen
On 08.07.2015 09:41, Steven Barth wrote:
> The reason for the commit was that supporting hardening such as SSP
> accross 3 libcs is a PITA to maintain. I'm fine if someone comes up
> with a patch that would fix it, though.
> 
> In general, you suggest to always enabled UCLIBCs SSP options and get
> rid of the GCCs libssp?
> 

If I read the documents correctly libssp will be "empty" because
glibc and uclibc both contain the symbols for SSP in libc.so/ldso
(by default (?) in glibc, if enabled in uclibc case)
This since around 2005/2006.

Most normal software should link/use that glibc/uclibc implementation in 
OpenWrt environment.

Since libssp is empty the libssp switch should have no effect on building 
binaries
because gcc decides what to link against in both cases of 
"--disable/enable-libssp"
("If your libc does not provide SSP, then libssp will be linked automatically.")

so we only need libssp when:
- using a libc without SSP that requires libssp from gcc (dietlibc)
- we disable the SSP features that are in uclibc/glibc
- software not linked against libc (?, example: grub2 upstream disables ssp)

The main issues are probably bad __FLAGS handling when cross compiling and
most of these issues are/should be already fixed by upstream, other hardened 
distros 
or variants of these.


> 
> Cheers,
> 
> Steven
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add uclibc-ng 1.0.3

2015-07-08 Thread Steven Barth
Thanks for the effort. However, I personally think we should rather phase out 
uclibc
completely and focus on musl which has a much cleaner codebase. I don't think 
it is
worth in the long run to maintain support for both libcs given our limited 
ressources.


Cheers,

Steven
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow to use ath79_gpio_output_select on QCA955x

2015-07-08 Thread Felix Fietkau
On 2015-06-25 16:30, Sven Eckelmann wrote:
> Signed-off-by: Sven Eckelmann 
I had to revert this one because it was breaking the build (patch did
not apply). Please fix and re-submit

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] malta: add harddisk support

2015-07-08 Thread Yousong Zhou
On 8 July 2015 at 14:17, Dirk Neukirchen  wrote:
> works with:
> qemu-system-mipsel -M malta \
> -hda openwrt-malta-le-root.ext4 \
> -kernel openwrt-malta-le-vmlinux.elf \
> -nographic -append "root=/dev/sda console=ttyS0"
>

Nice.  Never get a chance to play with a real malta board, I have been
wondering whether we should convert malta to a router type DEVICE_TYPE
and give it 2 interfaces for lan and wan by default.

I have run OpenWrt within QEMU Malta for quite a while and it's
working very well.  In case someone is interested, a gist for the
steps involved is available in
https://gist.github.com/yousong/8d94c6823a2a6f0f79fd

yousong
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Hardening Issues / Revert r46146 ?

2015-07-08 Thread Steven Barth
The reason for the commit was that supporting hardening such as SSP
accross 3 libcs is a PITA to maintain. I'm fine if someone comes up
with a patch that would fix it, though.

In general, you suggest to always enabled UCLIBCs SSP options and get
rid of the GCCs libssp?


Cheers,

Steven
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] swconfig: Split libsw out of swconfig for reuse in other packages

2015-07-08 Thread Cristian Morales Vega
On 8 July 2015 at 07:26, Alexandru Ardelean  wrote:
> From: Helmut Schaa 
>
> Also a bit of an RFC.
> We use this patch internally.

FWIW we also do it.
But we only build a static library since we use it only in one program
(it's not me, no idea of the details) and, since I guess nobody cares
about API/ABI stability, we couldn't decide on a proper soname. (i.e.
it should have been upstreamed).
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel