On 04/08/2014 07:45 PM, Matthew Fatheree wrote: > This adds support for Belkin/Linksys WRT1900AC Router Basic functionality > Belkin Inc. would like to announce the > patch submission release for WRT1900AC which is based on > OpenWRT trunk, the detail base revision is specified in > each release > > This is the release version 1.3 of WRT1900AC Openwrt patch submission > OpenWRT git base revision: e97be7a104e5c809ae4638cf169823249a505698 > OpenWRT svn base revision: 40006 > > Signed-off-by: Matthew Fatheree <matthew.fathe...@belkin.com>
Like Pete said it is way easier to review the patches when they are send as separate mails. There is no problem in sending 30 mails to the list. The whitespaces in this mail are damaged (all tabs are replaced with spaces, additional line breaks are added) some mail programs do that, now it is impossible to apply the patch with "git am". I would recommend you to use "git send-email" it takes care of such things and then I am able to apply your patches with "git am". You should add Matthew Fatheree <matthew.fathe...@belkin.com> into the From: field of all your patches and add a Signed-off-by: Matthew Fatheree <matthew.fathe...@belkin.com> under all the patches. > --- > From 1635e36f9854032945cd2a0d2c68600494755064 Mon Sep 17 00:00:00 2001 > From: Belkin Inc. Engineering > Date: Fri, 14 Mar 2014 23:08:34 +0700 > Subject: [PATCH 01/31] Restructure Marvell Armada 370/XP based boards to > Generic board, add Mamba board as sub-target > + The target mvebu is now divided into Generic and Mamba subtargets > + Add profile for Generic Marvell Armada XP/370 > + Add profile for Belkin Mamba (Marvell Armada XP MV73230 > > --- > target/linux/mvebu/Makefile | 1 + > target/linux/mvebu/generic/profiles/100-Generic.mk | 21 > ++++++++++++++++++++ > target/linux/mvebu/generic/target.mk | 5 +++++ > .../linux/mvebu/mamba/profiles/101-Belkin-Mamba.mk | 21 > ++++++++++++++++++++ > target/linux/mvebu/mamba/target.mk | 5 +++++ > target/linux/mvebu/profiles/100-Generic.mk | 21 > -------------------- > 6 files changed, 53 insertions(+), 21 deletions(-) > create mode 100644 target/linux/mvebu/generic/profiles/100-Generic.mk > create mode 100644 target/linux/mvebu/generic/target.mk > create mode 100644 target/linux/mvebu/mamba/profiles/101-Belkin-Mamba.mk > create mode 100644 target/linux/mvebu/mamba/target.mk > delete mode 100644 target/linux/mvebu/profiles/100-Generic.mk Better make one patch that just moves the existing stuff and does not add anything else and one additional patch that adds your new stuff so it is easier to review. > diff --git > a/target/linux/mvebu/patches-3.10/0305-ARM-mvebu-nand-mamba-nand-support.patch > > b/target/linux/mvebu/patches-3.10/0305-ARM-mvebu-nand-mamba-nand-support.patch > new file mode 100644 > index 0000000..a564661 > --- /dev/null > +++ > b/target/linux/mvebu/patches-3.10/0305-ARM-mvebu-nand-mamba-nand-support.patch > @@ -0,0 +1,14 @@ > +--- a/drivers/mtd/nand/pxa3xx_nand.c > ++++ b/drivers/mtd/nand/pxa3xx_nand.c > +@@ -1755,7 +1776,11 @@ static int pxa3xx_nand_probe(struct plat > + * parameter. This name cannot be changed or otherwise > + * user's mtd partitions configuration would get broken. > + */ > ++#ifdef CONFIG_MACH_ARMADA_MAMBA > ++ mtd->name = "armada-nand"; > ++#else > + mtd->name = "pxa3xx_nand-0"; > ++#endif Is this really needed the comment above says you should better not change this. > + info->cs = cs; > + ret = pxa3xx_nand_scan(mtd); > + if (ret) { > -- > 1.7.9.5 > > > From a5c305e7837cc363523e558cd6981565b3f3db6b Mon Sep 17 00:00:00 2001 > From: Belkin Inc. Engineering > Date: Sun, 16 Mar 2014 00:00:21 +0700 > Subject: [PATCH 10/31] CONFIG_UBIFS_FS_XATTR is no longer defined in kernel > 3.10, remove the ifdef to enable ubifs xattr This looks correct, but better fix the patch in target/linux/generic/patches-3.10/550-ubifs-symlink-xattr-support.patch directly. > > --- > ...9-ubifs-xattr-fix-no-longer-define-config.patch | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > create mode 100644 > target/linux/mvebu/patches-3.10/0309-ubifs-xattr-fix-no-longer-define-config.patch > > diff --git > a/target/linux/mvebu/patches-3.10/0309-ubifs-xattr-fix-no-longer-define-config.patch > > b/target/linux/mvebu/patches-3.10/0309-ubifs-xattr-fix-no-longer-define-config.patch > new file mode 100644 > index 0000000..20b409e > --- /dev/null > +++ > b/target/linux/mvebu/patches-3.10/0309-ubifs-xattr-fix-no-longer-define-config.patch > @@ -0,0 +1,15 @@ > +--- a/fs/ubifs/file.c > ++++ b/fs/ubifs/file.c > +@@ -1576,12 +1576,10 @@ const struct inode_operations ubifs_syml > + .follow_link = ubifs_follow_link, > + .setattr = ubifs_setattr, > + .getattr = ubifs_getattr, > +-#ifdef CONFIG_UBIFS_FS_XATTR > + .setxattr = ubifs_setxattr, > + .getxattr = ubifs_getxattr, > + .listxattr = ubifs_listxattr, > + .removexattr = ubifs_removexattr, > +-#endif > + }; > + > + const struct file_operations ubifs_file_operations = { > -- > 1.7.9.5 > > > From 0669843614edbcf7c7ea1fee72fd58d869deb297 Mon Sep 17 00:00:00 2001 > From: Belkin Inc. Engineering > Date: Sun, 16 Mar 2014 00:35:30 +0700 > Subject: [PATCH 13/31] mamba mvebu: add default network configuration for > Mamba > Better use a script like target/linux/ar71xx/base-files/etc/uci-defaults/02_network to generate your default config. This way your script will also work in case OpenWrt decides to change something in the file layout or something new is added to the default. > --- > .../mvebu/mamba/base-files/etc/config/network | 20 > ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > create mode 100644 target/linux/mvebu/mamba/base-files/etc/config/network > > diff --git a/target/linux/mvebu/mamba/base-files/etc/config/network > b/target/linux/mvebu/mamba/base-files/etc/config/network > new file mode 100644 > index 0000000..83d168c > --- /dev/null > +++ b/target/linux/mvebu/mamba/base-files/etc/config/network > @@ -0,0 +1,20 @@ > +# Copyright (C) 2006 OpenWrt.org > + > +config interface loopback > + option ifname lo > + option proto static > + option ipaddr 127.0.0.1 > + option netmask 255.0.0.0 > + > +config interface lan > + option type bridge > + option ifname "eth0 wdev0ap0 wdev1ap0" are wdev0ap0 wdev1ap0 generated anywhere? > + option proto static > + option ipaddr 192.168.200.1 > + option netmask 255.255.255.0 > + option gateway 192.168.200.1 > + > +config interface wan > + option proto dhcp > + option ifname eth1 > + > -- > From 1f850672c8c2e1ffba95b4ad2759ac774c9100f6 Mon Sep 17 00:00:00 2001 > From: Belkin Inc. Engineering > Date: Sun, 6 Apr 2014 20:44:04 +0700 > Subject: [PATCH 23/31] mamba mvebu: LED control support > + Mamba LED driver controls SOC leds. > + ledctrl script controls TLC & SOC leds from user space. > > > --- > .../linux/mvebu/mamba/base-files/usr/sbin/ledctrl | 164 +++++++++++ > target/linux/mvebu/mamba/config-default | 1 + > .../0313-ARM-mvebu-power-led-driver.patch | 298 > ++++++++++++++++++++ > 3 files changed, 463 insertions(+) > create mode 100755 target/linux/mvebu/mamba/base-files/usr/sbin/ledctrl > create mode 100644 > target/linux/mvebu/patches-3.10/0313-ARM-mvebu-power-led-driver.patch > > +index c235d5b..b04a55a 100644 > +--- a/drivers/misc/Makefile > ++++ b/drivers/misc/Makefile > +@@ -53,3 +53,4 @@ obj-$(CONFIG_INTEL_MEI) += mei/ > + obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci/ > + obj-$(CONFIG_LATTICE_ECP3_CONFIG) += lattice-ecp3-config.o > + obj-$(CONFIG_SRAM) += sram.o > ++obj-$(CONFIG_MAMBA_LED) += mamba_led.o > +diff --git a/drivers/misc/mamba_led.c b/drivers/misc/mamba_led.c > +new file mode 100644 > +index 0000000..8a334f7 > +--- /dev/null > ++++ b/drivers/misc/mamba_led.c > +@@ -0,0 +1,260 @@ > ++ > ++/* > ++ * mamba_led.c - Utility driver to control Mamba LEDs > ++ * > ++ * Copyright (C) 2013 Belkin Inc. > ++ * > ++ * This program is free software; you can redistribute it and/or modify > ++ * it under the terms of the GNU General Public License as published by > ++ * the Free Software Foundation; version 2 of the License. > ++ * > ++ * > ++ */ > ++#include <linux/module.h> > ++#include <linux/kernel.h> > ++#include <asm/uaccess.h> > ++#include <linux/cdev.h> > ++#include <linux/proc_fs.h> > ++#include <linux/mutex.h> > ++#include <linux/sched.h> > ++#include <linux/kthread.h> > ++#include <linux/time.h> // for using jiffies > ++#include <linux/delay.h> > ++#include <linux/kmod.h> > ++#include <linux/gpio.h> > ++#include <asm/io.h> > ++ > ++#define MAX_PROC_SIZE 100 > ++#define MAX_LED_NAME_LEN 20 > ++#define LED_ON 255 > ++#define LED_OFF 0 > ++#define GPIO_OUT_DIR 0 > ++#define GPIO_IN_DIR 1 > ++ > ++struct mamba_led_t { > ++ char name[MAX_LED_NAME_LEN]; > ++ unsigned int brightness; > ++ unsigned char blink; > ++ int delay_on; > ++ int delay_off; > ++ int gpio; > ++ unsigned char default_gpio_dir; > ++ int (*led_handler)(struct mamba_led_t *led); > ++}; > ++ > ++#define MAMBA_LED_BASE_ADDR 0xf1018000 > ++#define MAMBA_LED_MAP_SIZE 0x1000 > ++#define MAMBA_POWER_LED_ENABLE_BLINK_ADDR 0x148 > ++#define MAMBA_POWER_LED_COUNTER_A_ADDR 0x160 > ++#define MAMBA_POWER_LED_ON_DURATION_ADDR 0x1c0 > ++#define MAMBA_POWER_LED_OFF_DURATION_ADDR 0x1c4 > ++#define MAMBA_POWER_LED_CTRL_GPIO 40 > ++ > ++int power_led_handler(struct mamba_led_t *led); > ++ > ++static struct mamba_led_t mamba_leds[] = { > ++ {"power", 0, 0, 0, 0, 40, GPIO_IN_DIR, power_led_handler} > ++}; > ++ > ++static DEFINE_MUTEX(mutex); > ++static char proc_data[MAX_PROC_SIZE]; > ++static struct proc_dir_entry *mamba_led_proc_entry; > ++ > ++void __iomem *base_reg = NULL; > ++ > ++int power_led_handler(struct mamba_led_t *led) > ++{ > ++ if (base_reg == NULL) > ++ return -1; > ++ > ++ if (led->brightness == 0) { > ++ gpio_direction_input(led->gpio); > ++ } > ++ else { > ++ gpio_direction_output(led->gpio, led->brightness ? 1 : 0); > ++ if (led->blink) { > ++ // Enable blink register > ++ writel(0x00000100, > ++ base_reg + MAMBA_POWER_LED_ENABLE_BLINK_ADDR); > ++ // Set blink counter A for GPIO40 > ++ writel(0x00000000, > ++ base_reg + MAMBA_POWER_LED_COUNTER_A_ADDR); > ++ // On durration > ++ writel(led->delay_on*250*1000, > ++ base_reg + MAMBA_POWER_LED_ON_DURATION_ADDR); > ++ // Off duration > ++ writel(led->delay_off*250*1000, > ++ base_reg + MAMBA_POWER_LED_OFF_DURATION_ADDR); > ++ } > ++ else { > ++ // Disable blink register > ++ writel(0x00000000, > ++ base_reg + MAMBA_POWER_LED_ENABLE_BLINK_ADDR); > ++ } > ++ } > ++ return 0; > ++} > ++ > ++static int mamba_led_read_proc(struct file *filp, char *buf, size_t count, > loff_t *offp ) > ++{ > ++ int i = 0; > ++ struct mamba_led_t *led = NULL; > ++ > ++ printk("%12s%12s%7s%10s%11s%6s\n", "led_name", "brightness","blink", > ++ "delay_on", "delay_off","gpio"); > ++ for (i = 0; i < sizeof(mamba_leds)/sizeof(struct mamba_led_t); i++) { > ++ led = &mamba_leds[i]; > ++ printk("%12s", led->name); > ++ printk("%12d", led->brightness); > ++ printk("%7d", led->blink); > ++ printk("%10d", led->delay_on); > ++ printk("%11d", led->delay_off); > ++ printk("%6d\n", led->gpio); > ++ } > ++ printk("echo <led_name> <on|off|brightness_value> [<delay_on>" > ++ " <delay_off>] > /proc/mamba_led\n"); What are you doing here? You should not print to the kernel log when some applications want to get something from proc, provide data on proc. > ++ > ++ return 0; > ++} > ++ > ++static struct mamba_led_t *check_led_valid(char *led_name) { > ++ int i = 0; > ++ struct mamba_led_t *led = NULL; > ++ for (i = 0; i < sizeof(mamba_leds)/sizeof(struct mamba_led_t); i++) { > ++ led = &mamba_leds[i]; > ++ if(!strncmp(led_name, led->name, strlen(led->name))) { > ++ return led; > ++ } > ++ } > ++ return NULL; > ++} > ++ > ++static int check_brightness_valid(char *brightness_s, > ++ unsigned char *brightness) { > ++ int ret = 0; > ++ int tmp = 0; > ++ if (!strncmp(brightness_s, "on", 2)) { > ++ *brightness = 255; > ++ } > ++ else if (!strncmp(brightness_s, "off", 3)) { > ++ *brightness = 0; > ++ } > ++ else { > ++ ret = sscanf(brightness_s, "%d\n", &tmp); > ++ if (ret == 1) { > ++ *brightness = tmp & 0xff; > ++ } > ++ else { > ++ return -1; > ++ } > ++ } > ++ return 0; > ++} > ++ > ++static int mamba_led_write_proc(struct file *filp, const char *buf, > ++ size_t count, loff_t *offp) > ++{ > ++ int ret = 0; > ++ char led_name[32]; > ++ char brightness_s[32]; > ++ struct mamba_led_t *target_led = NULL; > ++ unsigned char brightness = 0; > ++ int delay_on, delay_off; > ++ > ++ if (!count) { > ++ printk("echo <led_name> <on|off|brightness_value> [<delay_on>" > ++ " <delay_off>] > /proc/mamba_led\n"); > ++ goto err; > ++ } > ++ if(count > MAX_PROC_SIZE) > ++ count = MAX_PROC_SIZE; > ++ > ++ memset(proc_data, 0, sizeof(proc_data)); > ++ if(copy_from_user(proc_data, buf, count)) { > ++ goto err; > ++ } > ++ > ++ ret = sscanf(proc_data, "%s %s %d %d\n", > ++ led_name, brightness_s, &delay_on, &delay_off); > ++ if (ret < 2 || (ret > 2 && ret != 4) > ++ || (target_led = check_led_valid(led_name)) == NULL > ++ || check_brightness_valid(brightness_s, &brightness) != 0) { > ++ goto err; > ++ } > ++ > ++ mutex_lock(&mutex); > ++ target_led->brightness = brightness; > ++ if (ret > 2) { > ++ target_led->blink = 1; > ++ target_led->delay_on = delay_on; > ++ target_led->delay_off = delay_off; > ++ } > ++ else { > ++ target_led->blink = 0; > ++ } > ++ > ++ if (target_led->led_handler) > ++ target_led->led_handler(target_led); > ++ > ++ mutex_unlock(&mutex); > ++ > ++ return count; > ++err: > ++ return -EFAULT; > ++} > ++ > ++static struct file_operations proc_fops = { > ++ read: mamba_led_read_proc, > ++ write: mamba_led_write_proc > ++}; > ++ > ++int mamba_led_init (void) { > ++ int i = 0; > ++ struct mamba_led_t *led = NULL; > ++ > ++ mamba_led_proc_entry = proc_create("mamba_led", 0, NULL, &proc_fops); > ++ if(!mamba_led_proc_entry) > ++ { > ++ printk("%s: Error creating proc entry\n", __FUNCTION__); > ++ return -ENOMEM; > ++ } > ++ > ++ base_reg = ioremap(MAMBA_LED_BASE_ADDR, MAMBA_LED_MAP_SIZE); > ++ if (base_reg == NULL) > ++ goto ioremap_failed; > ++ > ++ for (i = 0; i < sizeof(mamba_leds)/sizeof(struct mamba_led_t); i++) { > ++ led = &mamba_leds[i]; > ++ if(gpio_request(led->gpio, led->name) != 0) { > ++ printk("failed to request gpio for %s led\n", > ++ led->name); > ++ goto gpio_request_failed; > ++ } > ++ if (led->default_gpio_dir == GPIO_OUT_DIR) > ++ gpio_direction_output(led->gpio, 0); > ++ else > ++ gpio_direction_input(led->gpio); > ++ } > ++ > ++ printk("Mamba LED init done\n"); > ++ return 0; > ++ > ++gpio_request_failed: > ++ if (base_reg) > ++ iounmap(base_reg); > ++ioremap_failed: > ++ remove_proc_entry("mamba_led",NULL); > ++ return -1; > ++} > ++ > ++void mamba_led_cleanup(void) { > ++ if (base_reg) > ++ iounmap(base_reg); > ++ remove_proc_entry("mamba_led",NULL); > ++} > ++MODULE_AUTHOR("Belkin Inc."); > ++MODULE_LICENSE("GPL"); > ++MODULE_DESCRIPTION("mamba led driver"); > ++ > ++module_init(mamba_led_init); > ++module_exit(mamba_led_cleanup); > -- > 1.7.9.5 > _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel