Re: [OpenWrt-Devel] OpenOCD and RT3050/5350

2013-07-05 Thread Drasko DRASKOVIC
On Fri, Jul 5, 2013 at 3:57 AM, jonsm...@gmail.com jonsm...@gmail.com wrote:
 32MB memory, 8MB flash. If you need 32MB flash they will pass along
 for whatever the difference is in chip price.

Which then becomes more expensive than Carambola 2...

 I'm starting to discover some the missing pieces in Ralink support.
 Like no WifiDirect and no simultaneous (adhoc, AP). Looking at the
 Ralink driver I don't see why they couldn't be added, but why isn't
 Ralink doing the work?

This is also mystery to me. Too lazy, I guess. However, Carambola 1
has RT3050 and AP mode works quite fine - which proves that it is
absolutely possible.


 I have found three AR9331 modules in the $10-12 range. But they are
 all castellated, I would rather have one with pins. Any idea on the
 Q1000 price for Carambo2 without VAT?

From what I see here http://shop.8devices.com/carambola2 they can go
down to 15 eur and I would not expect that this would change much for
1k pieces.

 Camabola2 is kind of big for our
 needs, we like the RT5350 modules since they are putting chips on both
 sides of the board. That allows them to be much smaller.

I am not really sure on which Toplink board you meandm but from what I
see here: 
http://toplink-tech.en.alibaba.com/product/831612427-218431933/IP_TV_150Mbps_embedded_wifi_router_module.html
 dimensions are 42x30mm, and here : http://8devices.com/carambola-2
specs say that Carambola 2 module is 28x38 mm

BR,
Drasko
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Expose NSLU2 power and reset buttons to gpio-keys

2013-07-05 Thread Mike Brady
This match modifies the setup file for the Linksys NSLU2 (slug) to
allow the power button on the front and the reset button on the back,
behind a pinhole, to be seen by gpio-keys.

The present situation is that neither button can be used effectively
and this patch is designed to fix that. At present, both buttons are
hard-coded as follows: The power button sends a ctrlaltdel signal
which can be intercepted via /etc/inittab
(see http://wiki.openwrt.org/toh/linksys/nslu2/nslu2.hardware.button).
Unfortunately, the button isn't debounced, so the signal is sent many times,
and in addition (I think) it runs as an interrupt handler. It interferes
with other processes, e.g. pppd. The reset button powers the machine
off directly.

This patch fixes the situation by making the buttons accessible
in the normal way via gpio-keys so that they can be used in the normal way.

Signed-off-by Mike Brady mikebr...@eircom.net

Index: target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch
===
--- target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch  
(revision 0)
+++ target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch  
(revision 0)
@@ -0,0 +1,116 @@
+--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
 b/arch/arm/mach-ixp4xx/nslu2-setup.c
+@@ -9,6 +9,8 @@
+  *  Copyright (C) 2003-2004 MontaVista Software, Inc.
+  * based on nslu2-power.c:
+  *Copyright (C) 2005 Tower Technologies
++ * modified to allow the use of gpio-keys to sense the power and reset 
buttons,
++ *July 5, 2013 by Mike Brady mikebr...@eircom.net.
+  *
+  * Author: Mark Rakes mrakes at mac.com
+  * Author: Rod Whitby r...@whitby.id.au
+@@ -26,6 +28,8 @@
+ #include linux/i2c.h
+ #include linux/i2c-gpio.h
+ #include linux/io.h
++#include linux/gpio_keys.h
++#include linux/input.h
+ #include asm/mach-types.h
+ #include asm/mach/arch.h
+ #include asm/mach/flash.h
+@@ -186,11 +190,46 @@ static struct platform_device nslu2_eth[
+   }
+ };
+ 
++/*
++ * Buttons attached to GPIO. Used to permit gpio-keys to see them
++ * The Power Button is towards the bottom on the front. 
++ * The Reset Button is behind a pinhole at the back.
++ */
++static struct gpio_keys_button nslu2_buttons[] = {
++  {
++  .code   = BTN_0,
++  .gpio   = NSLU2_PB_GPIO,
++  .desc   = nslu2-power-button,
++  .type   = EV_KEY,
++  }, {
++  .code   = BTN_1,
++  .gpio   = NSLU2_RB_GPIO,
++  .desc   = nslu2-reset-button,
++  .type   = EV_KEY,
++  .active_low = 1,
++  },
++};
++
++static struct gpio_keys_platform_data nslu2_button_data = {
++  .buttons= nslu2_buttons,
++  .nbuttons   = ARRAY_SIZE(nslu2_buttons),
++};
++
++static struct platform_device nslu2_button_device = {
++  .name   = gpio-keys,
++  .id = -1,
++  .num_resources  = 0,
++  .dev= {
++  .platform_data  = nslu2_button_data,
++  },
++};
++
+ static struct platform_device *nslu2_devices[] __initdata = {
+   nslu2_i2c_gpio,
+   nslu2_flash,
+   nslu2_beeper,
+   nslu2_leds,
++  nslu2_button_device,
+   nslu2_eth[0],
+ };
+ 
+@@ -205,25 +244,6 @@ static void nslu2_power_off(void)
+   gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
+ }
+ 
+-static irqreturn_t nslu2_power_handler(int irq, void *dev_id)
+-{
+-  /* Signal init to do the ctrlaltdel action, this will bypass init if
+-   * it hasn't started and do a kernel_restart.
+-   */
+-  ctrl_alt_del();
+-
+-  return IRQ_HANDLED;
+-}
+-
+-static irqreturn_t nslu2_reset_handler(int irq, void *dev_id)
+-{
+-  /* This is the paper-clip reset, it shuts the machine down directly.
+-   */
+-  machine_power_off();
+-
+-  return IRQ_HANDLED;
+-}
+-
+ static void __init nslu2_timer_init(void)
+ {
+ /* The xtal on this machine is non-standard. */
+@@ -258,22 +278,6 @@ static void __init nslu2_init(void)
+ 
+   pm_power_off = nslu2_power_off;
+ 
+-  if (request_irq(gpio_to_irq(NSLU2_RB_GPIO), nslu2_reset_handler,
+-  IRQF_DISABLED | IRQF_TRIGGER_LOW,
+-  NSLU2 reset button, NULL)  0) {
+-
+-  printk(KERN_DEBUG Reset Button IRQ %d not available\n,
+-  gpio_to_irq(NSLU2_RB_GPIO));
+-  }
+-
+-  if (request_irq(gpio_to_irq(NSLU2_PB_GPIO), nslu2_power_handler,
+-  IRQF_DISABLED | IRQF_TRIGGER_HIGH,
+-  NSLU2 power button, NULL)  0) {
+-
+-  printk(KERN_DEBUG Power Button IRQ %d not available\n,
+-  gpio_to_irq(NSLU2_PB_GPIO));
+-  }
+-
+   /*
+* Map in a portion of the flash and read the MAC address.
+* Since it is stored in BE in the flash itself, we need to

___
openwrt-devel 

Re: [OpenWrt-Devel] OpenOCD and RT3050/5350

2013-07-05 Thread jonsm...@gmail.com
On Fri, Jul 5, 2013 at 4:51 AM, Drasko DRASKOVIC
drasko.drasko...@gmail.com wrote:
 On Fri, Jul 5, 2013 at 3:57 AM, jonsm...@gmail.com jonsm...@gmail.com wrote:
 32MB memory, 8MB flash. If you need 32MB flash they will pass along
 for whatever the difference is in chip price.

 Which then becomes more expensive than Carambola 2...

 I'm starting to discover some the missing pieces in Ralink support.
 Like no WifiDirect and no simultaneous (adhoc, AP). Looking at the
 Ralink driver I don't see why they couldn't be added, but why isn't
 Ralink doing the work?

 This is also mystery to me. Too lazy, I guess. However, Carambola 1
 has RT3050 and AP mode works quite fine - which proves that it is
 absolutely possible.


 I have found three AR9331 modules in the $10-12 range. But they are
 all castellated, I would rather have one with pins. Any idea on the
 Q1000 price for Carambo2 without VAT?

 From what I see here http://shop.8devices.com/carambola2 they can go
 down to 15 eur and I would not expect that this would change much for
 1k pieces.

 Camabola2 is kind of big for our
 needs, we like the RT5350 modules since they are putting chips on both
 sides of the board. That allows them to be much smaller.

 I am not really sure on which Toplink board you meandm but from what I
 see here: 
 http://toplink-tech.en.alibaba.com/product/831612427-218431933/IP_TV_150Mbps_embedded_wifi_router_module.html
  dimensions are 42x30mm, and here : http://8devices.com/carambola-2
 specs say that Carambola 2 module is 28x38 mm

AsiaRF is 25mm x 35mm. What is important is that it is on a pin
connector instead of being castellated. Being on a connector means I
can put my own chips below it. With a castellated module I lose the
whole 28 x 38mm of board space.



 BR,
 Drasko



--
Jon Smirl
jonsm...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenOCD and RT3050/5350

2013-07-05 Thread David Goodenough
On Friday 05 Jul 2013, jonsm...@gmail.com wrote:
 On Fri, Jul 5, 2013 at 4:51 AM, Drasko DRASKOVIC
 
 drasko.drasko...@gmail.com wrote:
  On Fri, Jul 5, 2013 at 3:57 AM, jonsm...@gmail.com jonsm...@gmail.com 
wrote:
  32MB memory, 8MB flash. If you need 32MB flash they will pass along
  for whatever the difference is in chip price.
  
  Which then becomes more expensive than Carambola 2...
  
  I'm starting to discover some the missing pieces in Ralink support.
  Like no WifiDirect and no simultaneous (adhoc, AP). Looking at the
  Ralink driver I don't see why they couldn't be added, but why isn't
  Ralink doing the work?
  
  This is also mystery to me. Too lazy, I guess. However, Carambola 1
  has RT3050 and AP mode works quite fine - which proves that it is
  absolutely possible.
  
  I have found three AR9331 modules in the $10-12 range. But they are
  all castellated, I would rather have one with pins. Any idea on the
  Q1000 price for Carambo2 without VAT?
  
  From what I see here http://shop.8devices.com/carambola2 they can go
  down to 15 eur and I would not expect that this would change much for
  1k pieces.
  
  Camabola2 is kind of big for our
  needs, we like the RT5350 modules since they are putting chips on both
  sides of the board. That allows them to be much smaller.
  
  I am not really sure on which Toplink board you meandm but from what I
  see here:
  http://toplink-tech.en.alibaba.com/product/831612427-218431933/IP_TV_150
  Mbps_embedded_wifi_router_module.html
  
   dimensions are 42x30mm, and here : http://8devices.com/carambola-2
  
  specs say that Carambola 2 module is 28x38 mm
 
 AsiaRF is 25mm x 35mm. What is important is that it is on a pin
 connector instead of being castellated. Being on a connector means I
 can put my own chips below it. With a castellated module I lose the
 whole 28 x 38mm of board space.
You could always solder on a single row pin header onto the side of the
castelation, and put a single row socket in the board to mount it, 
so it would be like the original Carambola module.  Then you would
have the ability to add your own chips below it.

David
 
  BR,
  Drasko
 
 --
 Jon Smirl
 jonsm...@gmail.com
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel

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


Re: [OpenWrt-Devel] [PATCH] Expose NSLU2 power and reset buttons to gpio-keys

2013-07-05 Thread Jonas Gorski
On Fri, Jul 5, 2013 at 11:45 AM, Mike Brady mikebr...@eircom.net wrote:
 This match modifies the setup file for the Linksys NSLU2 (slug) to
 allow the power button on the front and the reset button on the back,
 behind a pinhole, to be seen by gpio-keys.

 The present situation is that neither button can be used effectively
 and this patch is designed to fix that. At present, both buttons are
 hard-coded as follows: The power button sends a ctrlaltdel signal
 which can be intercepted via /etc/inittab
 (see http://wiki.openwrt.org/toh/linksys/nslu2/nslu2.hardware.button).
 Unfortunately, the button isn't debounced, so the signal is sent many times,
 and in addition (I think) it runs as an interrupt handler. It interferes
 with other processes, e.g. pppd. The reset button powers the machine
 off directly.

 This patch fixes the situation by making the buttons accessible
 in the normal way via gpio-keys so that they can be used in the normal way.

 Signed-off-by Mike Brady mikebr...@eircom.net

I like the approach. It would be nice if you could also add scripts
for those buttons to keep the reset/shutdown behaviour of the buttons
by default (I just want to avoid tickets that these buttons suddenly
don't work anymore ;).

Some additional comments below ...

 Index: target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch
 ===
 --- target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch  
 (revision 0)
 +++ target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch  
 (revision 0)
 @@ -0,0 +1,116 @@
 +--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
  b/arch/arm/mach-ixp4xx/nslu2-setup.c
 +@@ -9,6 +9,8 @@
 +  *  Copyright (C) 2003-2004 MontaVista Software, Inc.
 +  * based on nslu2-power.c:
 +  *Copyright (C) 2005 Tower Technologies
 ++ * modified to allow the use of gpio-keys to sense the power and reset 
 buttons,
 ++ *July 5, 2013 by Mike Brady mikebr...@eircom.net.
 +  *
 +  * Author: Mark Rakes mrakes at mac.com
 +  * Author: Rod Whitby r...@whitby.id.au
 +@@ -26,6 +28,8 @@
 + #include linux/i2c.h
 + #include linux/i2c-gpio.h
 + #include linux/io.h
 ++#include linux/gpio_keys.h
 ++#include linux/input.h
 + #include asm/mach-types.h
 + #include asm/mach/arch.h
 + #include asm/mach/flash.h
 +@@ -186,11 +190,46 @@ static struct platform_device nslu2_eth[
 +   }
 + };
 +
 ++/*
 ++ * Buttons attached to GPIO. Used to permit gpio-keys to see them
 ++ * The Power Button is towards the bottom on the front.
 ++ * The Reset Button is behind a pinhole at the back.
 ++ */
 ++static struct gpio_keys_button nslu2_buttons[] = {
 ++  {
 ++  .code   = BTN_0,

It's a power button, so KEY_POWER would be more appropriate.

 ++  .gpio   = NSLU2_PB_GPIO,
 ++  .desc   = nslu2-power-button,
 ++  .type   = EV_KEY,
 ++  }, {
 ++  .code   = BTN_1,

And here KEY_RESTART.

 ++  .gpio   = NSLU2_RB_GPIO,
 ++  .desc   = nslu2-reset-button,
 ++  .type   = EV_KEY,
 ++  .active_low = 1,
 ++  },
 ++};
 ++



Regards,
Jonas
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Expose NSLU2 power and reset buttons to gpio-keys

2013-07-05 Thread Mike Brady
Fair enough -- might take a little time though; holidays beckon!
Regards
Mike

On 5 Jul 2013, at 14:32, Jonas Gorski j...@openwrt.org wrote:

 On Fri, Jul 5, 2013 at 11:45 AM, Mike Brady mikebr...@eircom.net wrote:
 This match modifies the setup file for the Linksys NSLU2 (slug) to
 allow the power button on the front and the reset button on the back,
 behind a pinhole, to be seen by gpio-keys.
 
 The present situation is that neither button can be used effectively
 and this patch is designed to fix that. At present, both buttons are
 hard-coded as follows: The power button sends a ctrlaltdel signal
 which can be intercepted via /etc/inittab
 (see http://wiki.openwrt.org/toh/linksys/nslu2/nslu2.hardware.button).
 Unfortunately, the button isn't debounced, so the signal is sent many times,
 and in addition (I think) it runs as an interrupt handler. It interferes
 with other processes, e.g. pppd. The reset button powers the machine
 off directly.
 
 This patch fixes the situation by making the buttons accessible
 in the normal way via gpio-keys so that they can be used in the normal way.
 
 Signed-off-by Mike Brady mikebr...@eircom.net
 
 I like the approach. It would be nice if you could also add scripts
 for those buttons to keep the reset/shutdown behaviour of the buttons
 by default (I just want to avoid tickets that these buttons suddenly
 don't work anymore ;).
 
 Some additional comments below ...
 
 Index: target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch
 ===
 --- target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch  
 (revision 0)
 +++ target/linux/ixp4xx/patches-3.10/920-nslu2-add-gpio-keys.patch  
 (revision 0)
 @@ -0,0 +1,116 @@
 +--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
  b/arch/arm/mach-ixp4xx/nslu2-setup.c
 +@@ -9,6 +9,8 @@
 +  *  Copyright (C) 2003-2004 MontaVista Software, Inc.
 +  * based on nslu2-power.c:
 +  *Copyright (C) 2005 Tower Technologies
 ++ * modified to allow the use of gpio-keys to sense the power and reset 
 buttons,
 ++ *July 5, 2013 by Mike Brady mikebr...@eircom.net.
 +  *
 +  * Author: Mark Rakes mrakes at mac.com
 +  * Author: Rod Whitby r...@whitby.id.au
 +@@ -26,6 +28,8 @@
 + #include linux/i2c.h
 + #include linux/i2c-gpio.h
 + #include linux/io.h
 ++#include linux/gpio_keys.h
 ++#include linux/input.h
 + #include asm/mach-types.h
 + #include asm/mach/arch.h
 + #include asm/mach/flash.h
 +@@ -186,11 +190,46 @@ static struct platform_device nslu2_eth[
 +   }
 + };
 +
 ++/*
 ++ * Buttons attached to GPIO. Used to permit gpio-keys to see them
 ++ * The Power Button is towards the bottom on the front.
 ++ * The Reset Button is behind a pinhole at the back.
 ++ */
 ++static struct gpio_keys_button nslu2_buttons[] = {
 ++  {
 ++  .code   = BTN_0,
 
 It's a power button, so KEY_POWER would be more appropriate.
 
 ++  .gpio   = NSLU2_PB_GPIO,
 ++  .desc   = nslu2-power-button,
 ++  .type   = EV_KEY,
 ++  }, {
 ++  .code   = BTN_1,
 
 And here KEY_RESTART.
 
 ++  .gpio   = NSLU2_RB_GPIO,
 ++  .desc   = nslu2-reset-button,
 ++  .type   = EV_KEY,
 ++  .active_low = 1,
 ++  },
 ++};
 ++
 
 
 
 Regards,
 Jonas
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel

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


[OpenWrt-Devel] How to modify WR703N wlan mac

2013-07-05 Thread jinzhcheng
Dear Sir
I try to modify mach-tl-wr703n.c:
static void __init tl_wr703n_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);

printk(%s\n, __func__);
// set mac test, will be set same in /etc/config/wireless
*mac = 0x84;
*(mac+1) = 0x5d;
*(mac+2) = 0xd8;
*(mac+3) = 0x0;
*(mac+4) = 0x31;
*(mac+5) = 0x88;
/* disable PHY_SWAP and PHY_ADDR_SWAP bits *
... ...
but i can't modify the content of 0x1f01fc00 which is in uboot partition region
and I try to write /dev/mtd0 in userspace, but it failed too.
If any methods to modify mac?

Thank you very much!

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


Re: [OpenWrt-Devel] How to modify WR703N wlan mac

2013-07-05 Thread Bastian Bittorf
* jinzhcheng bjzhoug...@126.com [05.07.2013 20:58]:
 I try to modify mach-tl-wr703n.c:
 static void __init tl_wr703n_setup(void)
 {
 u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
 u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
 
 printk(%s\n, __func__);
 // set mac test, will be set same in /etc/config/wireless
 *mac = 0x84;
 *(mac+1) = 0x5d;
 *(mac+2) = 0xd8;
 *(mac+3) = 0x0;
 *(mac+4) = 0x31;
 *(mac+5) = 0x88;
 /* disable PHY_SWAP and PHY_ADDR_SWAP bits *
 . ...
 but i can't modify the content of 0x1f01fc00 which is in uboot partition 
 region
 and I try to write /dev/mtd0 in userspace, but it failed too.
 If any methods to modify mac?

you can configure this via uci:

option macaddr ...

if you want to write to mtd0, you must modify e.g.:
/openwrt/build_dir/target-mips_r2_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.8.13/drivers/mtd/tplinkpart.c

and comment/remove the line:
parts[0].mask_flags = MTD_WRITEABLE;

recompile and you can do:
mtd write /tmp/myuboot.bin u-boot

bye, bastian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel