Re: [OpenWrt-Devel] [PATCH] ar71xx: Add uThing support
Hi, please read the howto that explains how to submit patches. a few pointers are * subject i wrong * patch is attached and not inline * SoB line is missing * inside the patch there is commented out code. remove it please * // is a c++ style comment. please use /* ... */ syntax -- https://dev.openwrt.org/wiki/SubmittingPatches John On 11/04/2015 07:49, Lars Boegild Thomsen wrote: Add support for the uThing More information about the device here: http://bright-things.com/wiki/UThing I'll add it to the OpenWrt wiki once included in OpenWrt. ___ 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] ar71xx: Add uThing support
Add support for the uThing More information about the device here: http://bright-things.com/wiki/UThing I'll add it to the OpenWrt wiki once included in OpenWrt. -- Lars Bøgild Thomsen Public Key: http://bright-things.com/lars-bogild-thomsen/ signature.asc Description: This is a digitally signed message part. diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 14ff625..32efd63 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -186,6 +186,9 @@ get_status_led() { oolite) status_led=oolite:red:system ;; + uthing) + status_led=uthing:green:system + ;; qihoo-c301) status_led=qihoo:green:status ;; 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 9789834..2784dd4 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -1,6 +1,7 @@ #!/bin/sh # # Copyright (C) 2011 OpenWrt.org +# Copyright (C) 2014 Bright Things Unlimited # [ -e /etc/config/network ] exit 0 @@ -380,6 +381,7 @@ ja76pf |\ mc-mac1200r|\ mynet-n600 |\ oolite |\ +uthing |\ qihoo-c301 |\ rb-750 |\ rb-751 |\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index b3dbcf5..5b3e5a7 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -410,6 +410,9 @@ ar71xx_board_detect() { *Dragino v2) name=dragino2 ;; + *uThing) + name=uthing + ;; *EAP300 v2) name=eap300v2 ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 0cbee1d..5ed7440 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -206,6 +206,7 @@ platform_check_image() { dir-825-c1 | \ dir-835-a1 | \ dragino2 | \ + uthing | \ esr1750 | \ esr900 | \ ew-dorin | \ diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 index b988048..720f3d3 100644 --- a/target/linux/ar71xx/config-3.18 +++ b/target/linux/ar71xx/config-3.18 @@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_DIR_615_C1=y CONFIG_ATH79_MACH_DIR_825_B1=y CONFIG_ATH79_MACH_DIR_825_C1=y CONFIG_ATH79_MACH_DRAGINO2=y +CONFIG_ATH79_MACH_UTHING=y CONFIG_ATH79_MACH_EAP300V2=y CONFIG_ATH79_MACH_EAP7660D=y CONFIG_ATH79_MACH_EL_M150=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-uthing.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-uthing.c new file mode 100644 index 000..4f16102 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-uthing.c @@ -0,0 +1,128 @@ +/* + * uThing module support, based on Rio700 + * + * Copyright (C) 2011-2012 Gabor Juhos juh...@openwrt.org + * Copyright (C) 2012 Elektra Wagenrad elek...@villagetelco.org + * Copyright (C) 2014 Bright Things Unlimited l...@bright-things.com + * + * 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 linux/gpio.h +#include asm/mach-ath79/ath79.h +#include asm/mach-ath79/ar71xx_regs.h +#include common.h +#include dev-eth.h +#include dev-gpio-buttons.h +#include dev-leds-gpio.h +#include dev-m25p80.h +#include dev-spi.h +#include dev-usb.h +#include dev-wmac.h +#include machtypes.h + +#define UTHING_GPIO_LED_SYS 15 +#define UTHING_GPIO_LED_WLAN 0 + +#define UTHING_GPIO_USB_PWR 1 + +//#define UTHING_GPIO_16 16 +//#define UTHING_GPIO_24 24 +//#define UTHING_GPIO_27 27 +//#define UTHING_GPIO_28 28 + +#define UTHING_GPIO_BTN_JUMPSTART 11 +#define UTHING_GPIO_BTN_RESET 12 + +#define UTHING_KEYS_POLL_INTERVAL 20 /* msecs */ +#define UTHING_KEYS_DEBOUNCE_INTERVAL (3 * UTHING_KEYS_POLL_INTERVAL) + +#define UTHING_MAC0_OFFSET 0x +#define UTHING_MAC1_OFFSET 0x0006 +#define UTHING_CALDATA_OFFSET 0x1000 +#define UTHING_WMAC_MAC_OFFSET 0x1002 + +static struct gpio_led uthing_leds_gpio[] __initdata = { + { + .name = uthing:yellow:wlan, + .gpio = UTHING_GPIO_LED_WLAN, + .active_low = 0, + }, + { + .name = uthing:green:system, + .gpio = UTHING_GPIO_LED_SYS, + .active_low = 0, + }, +}; + +static struct gpio_keys_button uthing_gpio_keys[] __initdata = { + { + .desc = jumpstart button, + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = UTHING_KEYS_DEBOUNCE_INTERVAL, + .gpio = UTHING_GPIO_BTN_JUMPSTART, + .active_low = 1, + }, + { + .desc = reset button, + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = UTHING_KEYS_DEBOUNCE_INTERVAL, + .gpio = UTHING_GPIO_BTN_RESET, + .active_low = 1, + } +}; + +static void __init uthing_common_setup(void) +{ + u8 *art = (u8 *)
[OpenWrt-Devel] [PATCH V2 fstools 1/2] jffs2reset: avoid code duplication in jffs2_reset and jffs2_mark
Signed-off-by: Rafał Miłecki zaj...@gmail.com --- jffs2reset.c | 52 +--- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/jffs2reset.c b/jffs2reset.c index 1080883..d634386 100644 --- a/jffs2reset.c +++ b/jffs2reset.c @@ -39,26 +39,10 @@ ask_user(int argc, char **argv) } -static int -jffs2_reset(int argc, char **argv) +static int jffs2_reset(struct volume *v) { - struct volume *v; char *mp; - if (ask_user(argc, argv)) - return -1; - - if (find_filesystem(overlay)) { - ULOG_ERR(overlayfs not supported by kernel\n); - return -1; - } - - v = volume_find(rootfs_data); - if (!v) { - ULOG_ERR(MTD partition 'rootfs_data' not found\n); - return -1; - } - mp = find_mount_point(v-blk, 1); if (mp) { ULOG_INFO(%s is mounted as %s, only erasing files\n, v-blk, mp); @@ -73,23 +57,12 @@ jffs2_reset(int argc, char **argv) return 0; } -static int -jffs2_mark(int argc, char **argv) +static int jffs2_mark(struct volume *v) { __u32 deadc0de = __cpu_to_be32(0xdeadc0de); - struct volume *v; size_t sz; int fd; - if (ask_user(argc, argv)) - return -1; - - v = volume_find(rootfs_data); - if (!v) { - ULOG_ERR(MTD partition 'rootfs_data' not found\n); - return -1; - } - fd = open(v-blk, O_WRONLY); ULOG_INFO(%s - marking with deadc0de\n, v-blk); if (!fd) { @@ -110,7 +83,24 @@ jffs2_mark(int argc, char **argv) int main(int argc, char **argv) { + struct volume *v; + + if (ask_user(argc, argv)) + return -1; + + /* TODO: Check for /overlay filesystem */ + if (find_filesystem(overlay)) { + ULOG_ERR(overlayfs not supported by kernel\n); + return -1; + } + + v = volume_find(rootfs_data); + if (!v) { + ULOG_ERR(MTD partition 'rootfs_data' not found\n); + return -1; + } + if (!strcmp(*argv, jffs2mark)) - return jffs2_mark(argc, argv); - return jffs2_reset(argc, argv); + return jffs2_mark(v); + return jffs2_reset(v); } -- 1.8.4.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH V2 fstools 2/2] jffs2reset: use jffs2_mark if rootfs_data isn't mounted
Erasing all rootfs_data blocks may cause some problems with partition identification. It won't contain MAGIC, but will be successfully mounted with delayed blocks marking. This may be really confusing when user reboots before JFFS2 finishes its blocks management. During the next boot rootfs_data will be a valid partition (possibly with data) but libblkid won't detect it. Also adjust message in jffs2_mark to make more sense when used together with jffs2_reset. Signed-off-by: Rafał Miłecki zaj...@gmail.com --- jffs2reset.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jffs2reset.c b/jffs2reset.c index d634386..20218de 100644 --- a/jffs2reset.c +++ b/jffs2reset.c @@ -27,6 +27,8 @@ #include libfstools/libfstools.h #include libfstools/volume.h +static int jffs2_mark(struct volume *v); + static int ask_user(int argc, char **argv) { @@ -50,8 +52,8 @@ static int jffs2_reset(struct volume *v) overlay_delete(mp, false); mount(mp, /, NULL, MS_REMOUNT, 0); } else { - ULOG_INFO(%s is not mounted, erasing it\n, v-blk); - volume_erase_all(v); + ULOG_INFO(%s is not mounted\n, v-blk); + return jffs2_mark(v); } return 0; @@ -64,7 +66,7 @@ static int jffs2_mark(struct volume *v) int fd; fd = open(v-blk, O_WRONLY); - ULOG_INFO(%s - marking with deadc0de\n, v-blk); + ULOG_INFO(%s will be erased on next mount\n, v-blk); if (!fd) { ULOG_ERR(opening %s failed\n, v-blk); return -1; -- 1.8.4.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] mxs: fix ext4 image
Harald Geyer wrote: Zoltan HERPAI writes: Michael Heimpold wrote: Am Sonntag, 5. April 2015, 12:01:48 schrieb Harald Geyer: commit 597a84e52d9eff8d4686c40cd8be4f7a9b47679d with git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45052 3c298f89-4303-0410-b956-a3cf2f4a3e73 made the ext4 rootfs image unavailable for download from snapshots. Only a SD-card image with u-boot and everything is available. This is annoying for people who either have their own custom partition layout or want to upgrade the rootfs without losing the u-boot configuration. The same commit also broke the inclusion of dtbs in the root filesystem. Note: I don't know if this is the right way to implement this. I'm just adding code back that was there before. [snip] Acked-by: Michael Heimpold m...@heimpold.de With Michael's acks, I'll add this code (and the other patch) back in. Thanks. [snip] Added the two patches in r45368-45369. Thanks, Zoltan H ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel