[OpenWrt-Devel] [PATCH] Add mostly complete support for Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards
This patch adds support for the Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards for sysupgrade support and for the initial flash through pushbutton initiated recovery mode with the special partition table and fixes for the quirks and things required by the modified bootloader. There are two known bugs: 1. The LED configuration is broken -- only one led is working, an amber led, as I found no way to know which GPIOs were used for those. The board has 6 unlabeled leds, of which 1 is blue only and 5 are amber/blue. If I understand which GPIOs go to which leds I'll submit a patch later. 2. Wi-Fi is not working on my board probably because of the lack of RAM (the board only has 16MiB ram, but there is an empty slot for another ram chip,) but I don't know for sure. The driver loads but hostapd fails to load so I think it's not related to the specific device except for the lack of RAM. Signed-off-by: Marco Antonio Mauro --- Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig === --- target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig (revision 29835) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig (working copy) @@ -36,6 +36,11 @@ select RALINK_DEV_GPIO_BUTTONS select RALINK_DEV_GPIO_LEDS +config RT305X_MACH_WL341V3 + bool "Sitecom WL-341 v3 board support" + select RALINK_DEV_GPIO_BUTTONS + select RALINK_DEV_GPIO_LEDS + config RT305X_MACH_ESR_9753 bool "EnGenius ESR-9753 support" select RALINK_DEV_GPIO_BUTTONS Index: target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl341v3.c === --- target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl341v3.c (revision 0) +++ target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl341v3.c (revision 0) @@ -0,0 +1,134 @@ +/* + * Sitecom WL341v3 board support + * + * Copyright (C) 2012 Marco Antonio Mauro + * + * 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 +#include +#include + +#include +#include +#include +#include +#include + +#include "devices.h" + +#define WL341V3_GPIO_LED_STATUS_AMBER 8 +#define WL341V3_GPIO_LED_STATUS_GREEN 9 +#define WL341V3_GPIO_LED_WPS 13 + +#define WL341V3_GPIO_BUTTON_WPS5 /* active low */ +#define WL341V3_GPIO_BUTTON_RESET 7 /* active low */ + +#define WL341V3_BUTTONS_POLL_INTERVAL 20 + +#ifdef CONFIG_MTD_PARTITIONS +static struct mtd_partition wl341v3_partitions[] = { + { + .name = "u-boot", + .offset = 0, + .size = 0x02, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "board-nvram", + .offset = 0x02, + .size = 0x01, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "u-boot-env", + .offset = 0x03, + .size = 0x01, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "kernel", + .offset = 0x04, + .size = 0x0d, + }, { + .name = "rootfs", + .offset = 0x11, + .size = 0x2e, + }, { + .name = "signature-eRcOmM", + .offset = 0x3f, + .size = 0x01, + }, { + .name = "firmware", + .offset = 0x04, + .size = 0x3b, + }, { + .name = "fullflash", + .offset = 0x00, + .size = 0x40, + } +}; +#endif /* CONFIG_MTD_PARTITIONS */ + +static struct physmap_flash_data wl341v3_flash_data = { +#ifdef CONFIG_MTD_PARTITIONS + .nr_parts = ARRAY_SIZE(wl341v3_partitions), + .parts = wl341v3_partitions, +#endif +}; + +static struct gpio_led wl341v3_leds_gpio[] __initdata = { + { + .name = "wl341v3:amber:status", + .gpio = WL341V3_GPIO_LED_STATUS_AMBER, + .active_low = 1, + }, { + .name = "wl341v3:blue:status", + .gpio = WL341V3_GPIO_LED_STATUS_GREEN, + .active_low = 1, + }, { + .name = "wl341v3:blue:wps", + .gpio = WL341V3_GPIO_LED_WPS, + .active_low = 1, + } +}; + +static struct gpio_button wl341v3_gpio_buttons[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .threshold = 3, + .gpio = WL341V3_GPIO_BUTTON_R
Re: [OpenWrt-Devel] [PATCH] Add mostly complete support for Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards
On 21 January 2012 00:53, Marco Antonio Mauro wrote: > This patch adds support for the Sitecom WL-341 v3 and other Sercomm > IP1006RRv2 based boards for sysupgrade support and for the initial > flash through pushbutton initiated recovery mode with the special > partition table and fixes for the quirks and things required by the > modified bootloader. > > There are two known bugs: > > 1. The LED configuration is broken -- only one led is working, an > amber led, as I found no way to know which GPIOs were used for those. > The board has 6 unlabeled leds, of which 1 is blue only and 5 are > amber/blue. If I understand which GPIOs go to which leds I'll submit a > patch later. I had this problem too and wrote a script to test gpios for leds and buttons (see attachment). Hope it'll help you (and maybe someone else). Note that it will not help if your leds are connected via shift registers (as on Belkin boards). > 2. Wi-Fi is not working on my board probably because of the lack of > RAM (the board only has 16MiB ram, but there is an empty slot for > another ram chip,) but I don't know for sure. The driver loads but > hostapd fails to load so I think it's not related to the specific > device except for the lack of RAM. That's very strange, I don't have such problem with my 4/16 MB Sparklan WCR-150GN. I don't quite understand how it could be that it's low RAM problem if all kernel modules are loaded _before_ everything else? Regards, Roman blinker Description: Binary data ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] Add mostly complete support for Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards
On Sat, Jan 21, 2012 at 6:36 PM, Roman Yeryomin wrote: > On 21 January 2012 00:53, Marco Antonio Mauro wrote: >> This patch adds support for the Sitecom WL-341 v3 and other Sercomm >> IP1006RRv2 based boards for sysupgrade support and for the initial >> flash through pushbutton initiated recovery mode with the special >> partition table and fixes for the quirks and things required by the >> modified bootloader. >> >> There are two known bugs: >> >> 1. The LED configuration is broken -- only one led is working, an >> amber led, as I found no way to know which GPIOs were used for those. >> The board has 6 unlabeled leds, of which 1 is blue only and 5 are >> amber/blue. If I understand which GPIOs go to which leds I'll submit a >> patch later. > > I had this problem too and wrote a script to test gpios for leds and > buttons (see attachment). > Hope it'll help you (and maybe someone else). > Note that it will not help if your leds are connected via shift > registers (as on Belkin boards). Your script helped me (but I had to modify it slightly, the ls had to be ls -d else it wouldn't work) I found out 4 more leds, but I still miss 7 leds. Also, your script errors out on some pins: this is the log. Here the pins that return 0s are leds. root@OpenWrt:/tmp# ./blinker.bin /sys/class/gpio/gpiochip0 Testing pins from 0 to 23 pin 0 sh: write error: Device or resource busy output mode qbreaking input mode 1 1 1 breaking pin 1 sh: write error: Device or resource busy pin 2 sh: write error: Device or resource busy pin 3 sh: write error: Device or resource busy pin 4 sh: write error: Device or resource busy pin 5 sh: write error: Device or resource busy pin 6 sh: write error: Device or resource busy output mode qbreaking input mode 1 1 1 breaking pin 7 sh: write error: Device or resource busy pin 8 sh: write error: Device or resource busy pin 9 sh: write error: Device or resource busy pin 10 sh: write error: Device or resource busy output mode qbreaking input mode 0 0 0 qbreaking pin 11 sh: write error: Device or resource busy output mode qbreaking input mode 0 0 0 qbreaking pin 12 sh: write error: Device or resource busy output mode breaking input mode 0 0 0 breaking pin 13 sh: write error: Device or resource busy pin 14 sh: write error: Device or resource busy output mode breaking input mode 0 0 0 breaking pin 15 sh: write error: Device or resource busy pin 16 sh: write error: Device or resource busy pin 17 sh: write error: Device or resource busy pin 18 sh: write error: Device or resource busy pin 19 sh: write error: Device or resource busy output mode qbreaking input mode 1 1 1 breaking pin 20 sh: write error: Device or resource busy output mode qbreaking input mode 1 q1 1 breaking pin 21 sh: write error: Device or resource busy output mode qbreaking input mode 1 1 1 breaking pin 22 sh: write error: Device or resource busy pin 23 sh: write error: Device or resource busy /sys/class/gpio/gpiochip24 Testing pins from 24 to 39 pin 24 sh: write error: Device or resource busy pin 25 sh: write error: Device or resource busy pin 26 sh: write error: Device or resource busy pin 27 sh: write error: Device or resource busy pin 28 sh: write error: Device or resource busy pin 29 sh: write error: Device or resource busy pin 30 sh: write error: Device or resource busy pin 31 sh: write error: Device or resource busy pin 32 sh: write error: Device or resource busy pin 33 sh: write error: Device or resource busy pin 34 sh: write error: Device or resource busy pin 35 sh: write error: Device or resource busy pin 36 sh: write error: Device or resource busy pin 37 sh: write error: Device or resource busy pin 38 sh: write error: Device or resource busy pin 39 sh: write error: Device or resource busy /sys/class/gpio/gpiochip40 Testing pins from 40 to 51 pin 40 sh: write error: Device or resource busy pin 41 sh: write error: Device or resource busy pin 42 sh: write error: Device or resource busy pin 43 sh: write error: Device or resource busy pin 44 sh: write error: Device or resource busy pin 45 sh: write error: Device or resource busy pin 46 sh: write error: Device or resource busy pin 47 sh: write error: Device or resource busy pin 48 sh: write error: Device or resource busy pin 49 sh: write error: Device or resource busy pin 50 sh: write error: Device or resource busy pin 51 sh: write error: Device or resource busy > >> 2. Wi-Fi is not working on my board probably because of the lack of >> RAM (the board only has 16MiB ram, but there is an empty slot for >> another ram chip,) but I don't know for sure. The driver loads but >> hostapd fails to load so I think it's not related to the specific >> device except for the lack of RAM. > > That's very strange, I don't have such problem with my 4/16 MB > Sparklan WCR-150GN. > I don't quite understand how it could be that it's low RAM problem if > all kernel modules are loaded _before_ everything else? It's hostapd that fails executing, not the .kos that fail loading. -- Marcus905 GPG pu
Re: [OpenWrt-Devel] [PATCH] Add mostly complete support for Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards
On 22 January 2012 14:13, Marco Antonio Mauro wrote: > On Sat, Jan 21, 2012 at 6:36 PM, Roman Yeryomin wrote: >> On 21 January 2012 00:53, Marco Antonio Mauro wrote: >>> This patch adds support for the Sitecom WL-341 v3 and other Sercomm >>> IP1006RRv2 based boards for sysupgrade support and for the initial >>> flash through pushbutton initiated recovery mode with the special >>> partition table and fixes for the quirks and things required by the >>> modified bootloader. >>> >>> There are two known bugs: >>> >>> 1. The LED configuration is broken -- only one led is working, an >>> amber led, as I found no way to know which GPIOs were used for those. >>> The board has 6 unlabeled leds, of which 1 is blue only and 5 are >>> amber/blue. If I understand which GPIOs go to which leds I'll submit a >>> patch later. >> >> I had this problem too and wrote a script to test gpios for leds and >> buttons (see attachment). >> Hope it'll help you (and maybe someone else). >> Note that it will not help if your leds are connected via shift >> registers (as on Belkin boards). > > Your script helped me (but I had to modify it slightly, the ls had to > be ls -d else it wouldn't work) you are right, it should be with '-d' > I found out 4 more leds, but I still miss 7 leds. Also, your script > errors out on some pins: this is the log. sure, it returns error for those pins which are occupied by other modules > Here the pins that return 0s are leds. Leds are tested in output mode which you are skipping. If you are testing leds only you should be skipping input mode, not output, and see which led blinks (it should blink 3 times if you don't interrupt it). Testing for buttons you should press it, while in input mode, and see if pin state changes. >>> 2. Wi-Fi is not working on my board probably because of the lack of >>> RAM (the board only has 16MiB ram, but there is an empty slot for >>> another ram chip,) but I don't know for sure. The driver loads but >>> hostapd fails to load so I think it's not related to the specific >>> device except for the lack of RAM. >> >> That's very strange, I don't have such problem with my 4/16 MB >> Sparklan WCR-150GN. >> I don't quite understand how it could be that it's low RAM problem if >> all kernel modules are loaded _before_ everything else? > > It's hostapd that fails executing, not the .kos that fail loading. > ah.. well, no problem with that anyway.. Regards, Roman ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] Add mostly complete support for Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards
On Sun, Jan 22, 2012 at 8:40 PM, Roman Yeryomin wrote: > On 22 January 2012 14:13, Marco Antonio Mauro wrote: >> On Sat, Jan 21, 2012 at 6:36 PM, Roman Yeryomin >> wrote: >>> On 21 January 2012 00:53, Marco Antonio Mauro wrote: This patch adds support for the Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards for sysupgrade support and for the initial flash through pushbutton initiated recovery mode with the special partition table and fixes for the quirks and things required by the modified bootloader. There are two known bugs: 1. The LED configuration is broken -- only one led is working, an amber led, as I found no way to know which GPIOs were used for those. The board has 6 unlabeled leds, of which 1 is blue only and 5 are amber/blue. If I understand which GPIOs go to which leds I'll submit a patch later. >>> >>> I had this problem too and wrote a script to test gpios for leds and >>> buttons (see attachment). >>> Hope it'll help you (and maybe someone else). >>> Note that it will not help if your leds are connected via shift >>> registers (as on Belkin boards). >> >> Your script helped me (but I had to modify it slightly, the ls had to >> be ls -d else it wouldn't work) > > you are right, it should be with '-d' > >> I found out 4 more leds, but I still miss 7 leds. Also, your script >> errors out on some pins: this is the log. > > sure, it returns error for those pins which are occupied by other modules > >> Here the pins that return 0s are leds. > > Leds are tested in output mode which you are skipping. > If you are testing leds only you should be skipping input mode, not > output, and see which led blinks (it should blink 3 times if you don't > interrupt it). The thing is that it won't change gpio if I don't skip input and output manually I figured out some more leds, now I only miss 4, one of which is turned on by default. Some pins error out even though no modules apart from network are loaded. I'm trying to find those too and once done I'll update the patch -- you can disregard this one. > Testing for buttons you should press it, while in input mode, and see > if pin state changes. Buttons should work as is as I found the pins for them in the source code released by the manufacturer. 2. Wi-Fi is not working on my board probably because of the lack of RAM (the board only has 16MiB ram, but there is an empty slot for another ram chip,) but I don't know for sure. The driver loads but hostapd fails to load so I think it's not related to the specific device except for the lack of RAM. >>> >>> That's very strange, I don't have such problem with my 4/16 MB >>> Sparklan WCR-150GN. >>> I don't quite understand how it could be that it's low RAM problem if >>> all kernel modules are loaded _before_ everything else? >> >> It's hostapd that fails executing, not the .kos that fail loading. >> > > ah.. well, no problem with that anyway.. I can't seem to make it run at boot time instead -- if I free enough ram it starts after the device boots. -- Marcus905 GPG pubkey: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x1FC0ECC932FE5FAC ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] Add mostly complete support for Sitecom WL-341 v3 and other Sercomm IP1006RRv2 based boards
On 24 January 2012 03:39, Marco Antonio Mauro wrote: >> Leds are tested in output mode which you are skipping. >> If you are testing leds only you should be skipping input mode, not >> output, and see which led blinks (it should blink 3 times if you don't >> interrupt it). > > The thing is that it won't change gpio if I don't skip input and output > manually How is that? Did you wait for it to change the state (blink) 3 times (you'll see the value of the pin printed 3 times)? > Some pins error out even though no modules apart from network are > loaded. I'm trying to find those too and once done I'll update the > patch -- you can disregard this one. Forget about those errors - these are the pins which are already occupied. >> Testing for buttons you should press it, while in input mode, and see >> if pin state changes. > > Buttons should work as is as I found the pins for them in the source > code released by the manufacturer. Should and work are completely different things ;) Regards, Roman ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel