Re: [OpenWrt-Devel] One question of ralink wifi ht40 mode

2013-05-14 Thread Daniel Golle
This is because the vendor driver makes ensures operation in HT20 before
triggering RF calibration.

On 05/13/2013 08:29 PM, Сергей Василюгин wrote:
> Hi, All
>  
> Anybody knows why ht40 mode explicitly switch off for some ralink wifi?
> rt2800lib.c in function rt2800_config_channel():
>  
> if (rt2x00_rf(rt2x00dev, RF3290) ||
> rt2x00_rf(rt2x00dev, RF3322) ||
> rt2x00_rf(rt2x00dev, RF5350) ||
> rt2x00_rf(rt2x00dev, RF5360) ||
> rt2x00_rf(rt2x00dev, RF5370) ||
> rt2x00_rf(rt2x00dev, RF5372) ||
> rt2x00_rf(rt2x00dev, RF5390) ||
> rt2x00_rf(rt2x00dev, RF5392)) {
> rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr);
> rt2x00_set_field8(&rfcsr, RFCSR30_TX_H20M, 0);<
> rt2x00_set_field8(&rfcsr, RFCSR30_RX_H20M, 0);<
> rt2800_rfcsr_write(rt2x00dev, 30, rfcsr);
> 
> rt2800_rfcsr_read(rt2x00dev, 3, &rfcsr);
> rt2x00_set_field8(&rfcsr, RFCSR30_RF_CALIBRATION, 1);
> rt2800_rfcsr_write(rt2x00dev, 3, rfcsr);
> }
> I've done correct{?) configs and ht40 works for my rt3290, rt3352 & rt5350.
> Or it's simple mistake and instead of 0 it must be conf_is_ht40(conf).
>  
> ---
> serge


-- 
ALLNET GmbH ; Maistr. 2 ; D-82110 Germering ; Germany
Tel. +49-89-89422217 - Fax +49-89-89422233
http://www.allnet.de
email: Daniel Golle 
Schulungs-/Veranstaltungsprogramm: http://www.802lab.de
Geschäftsführer: Wolfgang Marcus Bauer
Handelsregister München B 95922 ; UST-ID-Nr. DE 128214294 ;
St.-Nr.117/115/00164
WEEE-Reg.-NR. DE 13101093
Bankverbindung:
Sparkasse Fürstenfeldbruck KTO: 2774594 ; BLZ: 70053070
Swift-Code: BYLADEM1FFB ; IBAN: DE6170053072774594
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Booting x86 from SATA drive

2013-05-14 Thread Lukas Macura

Hi,

yes, this is clean way. Alternatively, you can use our besip build 
system which will do kernel config for you if you know directly, which 
directives to enable. See example here: 
https://homeproj.cesnet.cz/projects/besip/wiki/Build


If you have any questions for this, feel free to contact me personaly. 
Besip build system will prepare openwrt buildroot for you with 
parameters which you need.


With regards,
Lukas Macura

Dne 14.5.2013 03:36, Adam Gensler napsal(a):

Hi Hanno,

Last time I checked the x86 target does not include the drivers for SATA ports. 
The only way I've been able to get it work is by building a custom kernel.

1. make kernel_menuconfig

2. Device Drivers --> Serial ATA and Parallel ATA drivers --> AHCI SATA Support

Press "y" on both the "Serial ATA and Parallel ATA drivers" and "AHCI SATA 
Support" then exit and save and rebuilt the image.

Adam


On May 13, 2013, at 7:41 AM, Hanno Schupp  wrote:


Hi,

I have a fit-pc2-i http://www.fit-pc.com/web/fit-pc/fit-pc2-i/ with a ADATA 32GB SSD 
w/ a SATA interface drive built in. Kamikaze boots fine and from scratch,  but 
neither backfire nor attitude adjustment. For them the boot process stops while 
"waiting for root device /dev/sda2 in both cases.
I assume I need to include some additional modules in my firmware, but am 
unsure which ones and at which level:
Can I compile kernel modules kmod* into the image and expect it to work?  I 
thought that kmod models were stored in rootfs and since the system fails to 
boot before it can even find rootfs. If my assumption is correct I have to 
compile support directly into the kernel using make kernel_menuconfig
Is that correct? And if so, what do i have to include when configuring make 
kernel_menuconfig and/or make menuconfig to get SATA drive to be recognised as 
initial and only rootfs?
I consulted the extroot page in wiki, but I understand that approach relies on 
an initial rootfs in the device's flash drive to be present, which then writes 
its /overlay or / to the external storage; this is not what happens with this 
fit-pc2-I, which has no flash drive but but only he SATA drive.

Any help and pointers on how to build such a x86 image is appreciated.

Thanks

Hanno Schupp

___
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 mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] How to enable debug mode in wpa_supplicant?

2013-05-14 Thread Francisco Cuesta
Hello Jonas, thanks for replying.

Sorry but I don't understand where I have to set on this variable, is
it somewhere in the hostapd code or it's in the openwrt .conf file.

Thanks

2013/5/13 Jonas Gorski :
> On Mon, May 13, 2013 at 4:47 PM, Francisco Cuesta  wrote:
>> HEllo,
>>
>> I would like to enable the dbug mode of wpa_supplicant,  I have read
>> the help and modified the script /lib/wifi/wpa_supplicant.sh line
>> which invokes the wpa_supplicant, in order to enable the debug mode
>> like this
>>
>> wpa_supplicant -dd -B -P /var/run/wifi-wlan1.pid -D nl80211 -i wlan1
>> -c /var/run/wpa_supplicant-wlan1.conf
>>
>> However, I cannot seen any debug mode, I have try to read the log with
>> logread but it doesn't show any debug message, neither the dmesg. May
>> anyone tell me how to enable this feature?
>
> You need to build your own image/package with the "minimum debug
> message priority" set to 0 for wpa_supplicant
> (CONFIG_WPA_MSG_MIN_PRIORITY).
>
>
> 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


Re: [OpenWrt-Devel] How to enable debug mode in wpa_supplicant?

2013-05-14 Thread Francisco Cuesta
Hi again Jon,

I've found where to enable the variable, is it in hostapd/Config.in,
isn't it? However after setting the variable to "default 2"  and
compiling the whole package again, I don't know where the output goes,
to the log or it should be displayed in the stdout?

Thanks again!

2013/5/14 Francisco Cuesta :
> Hello Jonas, thanks for replying.
>
> Sorry but I don't understand where I have to set on this variable, is
> it somewhere in the hostapd code or it's in the openwrt .conf file.
>
> Thanks
>
> 2013/5/13 Jonas Gorski :
>> On Mon, May 13, 2013 at 4:47 PM, Francisco Cuesta  
>> wrote:
>>> HEllo,
>>>
>>> I would like to enable the dbug mode of wpa_supplicant,  I have read
>>> the help and modified the script /lib/wifi/wpa_supplicant.sh line
>>> which invokes the wpa_supplicant, in order to enable the debug mode
>>> like this
>>>
>>> wpa_supplicant -dd -B -P /var/run/wifi-wlan1.pid -D nl80211 -i wlan1
>>> -c /var/run/wpa_supplicant-wlan1.conf
>>>
>>> However, I cannot seen any debug mode, I have try to read the log with
>>> logread but it doesn't show any debug message, neither the dmesg. May
>>> anyone tell me how to enable this feature?
>>
>> You need to build your own image/package with the "minimum debug
>> message priority" set to 0 for wpa_supplicant
>> (CONFIG_WPA_MSG_MIN_PRIORITY).
>>
>>
>> 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


Re: [OpenWrt-Devel] How to enable debug mode in wpa_supplicant?

2013-05-14 Thread Jonas Gorski
On Tue, May 14, 2013 at 10:27 AM, Francisco Cuesta  wrote:
> Hi again Jon,

it's still "Jonas" :p

> I've found where to enable the variable, is it in hostapd/Config.in,
> isn't it? However after setting the variable to "default 2"  and

Yes, or rather menuconfig / .config.

> compiling the whole package again, I don't know where the output goes,
> to the log or it should be displayed in the stdout?

2 is too high, you should set it to 0 to get everything; it should
then be displayed on stdout if you start wpa_supplicant in foreground.


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


Re: [OpenWrt-Devel] [PATCH] unbound bump to 1.4.20 and add uci support

2013-05-14 Thread Martin Strbačka

Hello,

We just made the same thing (patches for uci support) in our company and 
I wanted to send our patches. At a first look, it looks almost the same 
as our approach. Just one thing - maybe you should remove the 
unbound.conf.example file. OpenWRT wants to be very tiny, so there is no 
place for man pages or even example configs. And if we have uci support, 
than the standard conf file is almost useless, at least from my point of 
view.


With regards,
Martin Strbacka
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] packages: curl: Allow fine grained protocol configuration

2013-05-14 Thread Helmut Schaa
Disabling unused protocols in libcurl can save more then 100K, hence add
some build time config options to enable/disable protocols.

Signed-off-by: Helmut Schaa 
---
 libs/curl/Config.in |   60 +++
 libs/curl/Makefile  |   28 
 2 files changed, 79 insertions(+), 9 deletions(-)
 create mode 100644 libs/curl/Config.in

diff --git a/libs/curl/Config.in b/libs/curl/Config.in
new file mode 100644
index 000..b47286a
--- /dev/null
+++ b/libs/curl/Config.in
@@ -0,0 +1,60 @@
+menu "Configuration"
+   depends on PACKAGE_libcurl
+
+config LIBCURL_ENABLE_FILE
+   bool "Enable FILE support"
+   default y
+
+config LIBCURL_ENABLE_HTTP
+   bool "Enable HTTP support"
+   default y
+
+config LIBCURL_ENABLE_FTP
+   bool "Enable FTP support"
+   default y
+
+config LIBCURL_ENABLE_TFTP
+   bool "Enable TFTP support"
+   default y
+
+config LIBCURL_ENABLE_POP3
+   bool "Enable POP3 support"
+   default n
+
+config LIBCURL_ENABLE_IMAP
+   bool "Enable IMAP support"
+   default n
+
+config LIBCURL_ENABLE_SMTP
+   bool "Enable IMAP support"
+   default n
+
+config LIBCURL_ENABLE_RTSP
+   bool "Enable RTSP support"
+   default n
+
+config LIBCURL_ENABLE_LDAP
+   bool "Enable LDAP support"
+   default n
+
+config LIBCURL_ENABLE_GOPHER
+   bool "Enable Gopher support"
+   default n
+
+config LIBCURL_ENABLE_DICT
+   bool "Enable Dict support"
+   default n
+
+config LIBCURL_ENABLE_TELNET
+   bool "Enable Telnet support"
+   default n
+
+config LIBCURL_ENABLE_SSPI
+   bool "Enable SSPI support"
+   default n
+
+config LIBCURL_ENABLE_PROXY
+   bool "Enable Proxy support"
+   default n
+
+endmenu
diff --git a/libs/curl/Makefile b/libs/curl/Makefile
index e8d0276..b0e3279 100644
--- a/libs/curl/Makefile
+++ b/libs/curl/Makefile
@@ -48,6 +48,11 @@ define Package/libcurl
   CATEGORY:=Libraries
   DEPENDS:=+libopenssl +zlib
   TITLE:=A client-side URL transfer library
+  MENU:=1
+endef
+
+define Package/libcurl/config
+  source "$(SOURCE)/Config.in"
 endef
 
 TARGET_CFLAGS += $(FPIC)
@@ -59,18 +64,9 @@ CONFIGURE_ARGS += \
--enable-cookies \
--enable-crypto-auth \
--enable-nonblocking \
-   --enable-file \
-   --enable-ftp \
-   --enable-http \
--disable-ares \
--disable-debug \
-   --disable-dict \
-   --disable-gopher \
-   --disable-ldap \
--disable-manual \
-   --disable-sspi \
-   --disable-telnet \
-   --enable-tftp \
--disable-verbose \
--with-random="/dev/urandom" \
--with-ssl="$(STAGING_DIR)/usr" \
@@ -82,6 +78,20 @@ CONFIGURE_ARGS += \
--without-libssh2 \
--with-zlib="$(STAGING_DIR)/usr" \
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_FILE,file) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_HTTP,http) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_FTP,ftp) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_TFTP,tftp) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_POP3,pop3) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_IMAP,imap) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_SMTP,smtp) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_RTSP,rtsp) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_LDAP,ldap) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_GOPHER,gopher) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_DICT,dict) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_TELNET,telnet) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_SSPI,sspi) \
+   $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_PROXY,proxy) \
 
 CONFIGURE_VARS += \
LIBS="-lcrypto -lssl -lz" \
-- 
1.7.10.4

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Add AG7240+S26+8309 network driver to enable support of DIR-632-A1 (supersedes previous emails for this patch)

2013-05-14 Thread Andrew McDonnell
Hi Jonas,

I eventually managed to get eth0 to work, without too much effort as it turns
out, once I concentrated on the ethernet and understood how the platform data
hangs together.

Fixing eth1, on the otherhand, has caused me several late nights with no
reward (more below)

So shortly I will submit a series of patches to add support for the DIR632 -
without eth1 (wan) functionality working.  Hopefully they conform as
required... I have other tasks that need my attention for a while, and fixing
eth1 needs input from people who have more experience working with ethernet
drivers :-)

At least, this will allow the DIR-632 to be added as 'partial support', and
usable by anyone who has a use case that doesn't require the wan port (e.g.
wireless repeater, basic switch, etc.)  If they badly need wan support they
can use my unofficial patches for the interim

With eth1, after a couple of false starts and fixing obvious things like being
able to register platform mdio.1, I ended up instrumenting DD-WRT to trace
every register write, switch register and mdio write, and it appears that the
ar71xx_ag7240.c has quite a lot of differences - where the DD-WRT driver
writes to many registers on the switch and mdio that are not touched by
OpenWRT.  I started by naively adding the missing calls, but then finally
stalled when I realised there is a whole interrupt handler missing from
openwrt.  If you like I can post my partial work to my github or here, but
first I want to get the rest of the board into the trunk if at all possible.

hope this helps,
Andrew


On 30/04/13 21:41, Jonas Gorski wrote:
> On Tue, Apr 30, 2013 at 1:58 PM, Andrew McDonnell
>  wrote:
>>
>> This patch adds ethernet and switch support - ag7240 ethernet driver 
>> incorporating RTL8309 switch and S26 switch support - for the D-link DIR 632 
>> router (hardware version A1) based on DD-WRT r20421. I added Linux platform 
>> support for integration with OpenWRT.
> 
> NACK. There already is a ethernet driver for ar7240 (ag71xx) including
> switch support, so let's rather fix there what's wrong if it doesn't
> work for the DIR-632 A1; everything else is a maintenance nightmare.
> 
> 
> Jonas
> 

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


[OpenWrt-Devel] [PATCH] ar71xx: WARN instead of BUG when an invalid speed indicated via platform data of ag71xx

2013-05-14 Thread Andrew McDonnell

This patch causes a kernel WARN stacktrace and falls back to a default
100mbit, instead of a BUG and panicing the kernel, when an invalid speed is
pased to ath79_mii_ctrl_set_speed() via incorrect platform data settings.
This makes debugging slightly easier when working with a board (such as the
dir632a1) for which u-boot has broken TFTP and you dont have nearby a suitable
browser/operating system combination for restoring the firmware via the
factory recovery mechanism.

Signed-off-by: Andrew McDonnell 
---
 .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c   |4 +++-
 1 files changed, 3 insertions(+), 1 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 d7f3595..47e1350 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -134,7 +134,9 @@ static void ath79_mii_ctrl_set_speed(unsigned int reg,
unsigned int speed)
mii_speed =  AR71XX_MII_CTRL_SPEED_1000;
break;
default:
-   BUG();
+   WARN(1, "ath79_mii_ctrl_set_speed(): invalid speed (%d),
fallback to %d\n", speed, SPEED_100);
+   mii_speed = AR71XX_MII_CTRL_SPEED_100;
+break;
}

base = ioremap(AR71XX_MII_BASE, AR71XX_MII_SIZE);
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: Add missing GPIO function bits for AR7242

2013-05-14 Thread Andrew McDonnell

This patch adds GPIO function enable/disable bits for the AR7242, as derived
from the D-Link GPL firmware sources for the DIR-632-A1.

Note that of these,  AR724X_GPIO_FUNCTION_CLK_OBS6_ENABLE and
AR724X_GPIO_FUNCTION_PCIEPHY_TST_EN are explicitly cleared by the D-Link
sources.  I suspect these bits are necessary to enable the test pin GPIOs
although I havent had a chance to scientifically verify this.

Signed-off-by: Andrew McDonnell 
---
 .../902-MIPS-ath79-ar7274-gpio-functions.patch |   26 
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git
a/target/linux/ar71xx/patches-3.8/902-MIPS-ath79-ar7274-gpio-functions.patch
b/target/linux/ar71xx/patches-3.8/902-MIPS-ath79-ar7274-gpio-functions.patch
new file mode 100644
index 000..9ea2276
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.8/902-MIPS-ath79-ar7274-gpio-functions.patch
@@ -0,0 +1,26 @@
+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
 b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+@@ -672,8 +672,23 @@
+ #define AR71XX_GPIO_FUNC_USB_OC_ENBIT(4)
+ #define AR71XX_GPIO_FUNC_USB_CLK_EN   BIT(0)
+
++#define AR724X_GPIO_FUNCTION_SPDIF2TCK_EN   BIT(31)
++#define AR724X_GPIO_FUNCTION_SPDIF_EN   BIT(30)
++#define AR724X_GPIO_FUNCTION_I2S_GPIO_18_22_EN  BIT(29)
++#define AR724X_GPIO_FUNCTION_I2S_REFCLKEN   BIT(28)
++#define AR724X_GPIO_FUNCTION_I2S_MCKEN  BIT(27)
++#define AR724X_GPIO_FUNCTION_I2S0_ENBIT(26)
++#define AR724X_GPIO_FUNCTION_ETH_SWITCH_LED_DUPL_EN BIT(25)
++#define AR724X_GPIO_FUNCTION_ETH_SWITCH_LED_COLLBIT(24)
++#define AR724X_GPIO_FUNCTION_ETH_SWITCH_LED_ACTVBIT(23)
++#define AR724X_GPIO_FUNCTION_PLL_SHIFT_EN   BIT(22)
++#define AR724X_GPIO_FUNCTION_EXT_MDIO_SEL   BIT(21)
++#define AR724X_GPIO_FUNCTION_CLK_OBS6_ENABLEBIT(20)
+ #define AR724X_GPIO_FUNC_GE0_MII_CLK_EN   BIT(19)
+ #define AR724X_GPIO_FUNC_SPI_EN   BIT(18)
++#define AR724X_GPIO_FUNCTION_DDR_DQOE_ENBIT(17)
++#define AR724X_GPIO_FUNCTION_PCIEPHY_TST_EN BIT(16)
++#define AR724X_GPIO_FUNCTION_S26_UART_DISABLE   BIT(15)
+ #define AR724X_GPIO_FUNC_SPI_CS_EN2   BIT(14)
+ #define AR724X_GPIO_FUNC_SPI_CS_EN1   BIT(13)
+ #define AR724X_GPIO_FUNC_CLK_OBS5_EN  BIT(12)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx:

2013-05-14 Thread Andrew McDonnell

This patch allows a board to enable the mdio bus on the second ethernet port
provided by the AR7242 (as used in the D-Link DIR-632-A1.)  The AR7242 (at
least on the dir632) has two ethernet, eth0 at 0x1900 and eth1 at
0x1a00, and both have enumerable mdio busses.

It further defaults to connecting eth1 to ag71xx-mdio.1 when registering eth1
with ath79 platform data.


Signed-off-by: Andrew McDonnell 
---

.../linux/ar71xx/files/arch/mips/ath79/dev-eth.c   |   19 +--
 1 files changed, 13 insertions(+), 6 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 47e1350..cbd782d 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -183,6 +183,7 @@ void __init ath79_register_mdio(unsigned int id, u32 
phy_mask)
if (ath79_soc == ATH79_SOC_AR9341 ||
ath79_soc == ATH79_SOC_AR9342 ||
ath79_soc == ATH79_SOC_AR9344 ||
+   ath79_soc == ATH79_SOC_AR7242 ||
ath79_soc == ATH79_SOC_QCA9556 ||
ath79_soc == ATH79_SOC_QCA9558)
max_id = 1;
@@ -202,6 +203,13 @@ void __init ath79_register_mdio(unsigned int id, u32
phy_mask)
mdio_data = &ath79_mdio1_data;
break;

+   case ATH79_SOC_AR7242:
+   ath79_set_pll(AR71XX_PLL_REG_SEC_CONFIG,
+  AR7242_PLL_REG_ETH0_INT_CLOCK, 0x6200,
+  AR71XX_ETH0_PLL_SHIFT);
+   /* The driver in DD-WRT always has a 100ms delay after setting
the PLL */
+   udelay(100*1000);
+   /* fall through - the AR7242 has two eth ports */
case ATH79_SOC_AR9341:
case ATH79_SOC_AR9342:
case ATH79_SOC_AR9344:
@@ -216,11 +224,6 @@ void __init ath79_register_mdio(unsigned int id, u32
phy_mask)
}
break;

-   case ATH79_SOC_AR7242:
-   ath79_set_pll(AR71XX_PLL_REG_SEC_CONFIG,
-  AR7242_PLL_REG_ETH0_INT_CLOCK, 0x6200,
-  AR71XX_ETH0_PLL_SHIFT);
-   /* fall through */
default:
mdio_dev = &ath79_mdio0_device;
mdio_data = &ath79_mdio0_data;
@@ -236,7 +239,11 @@ void __init ath79_register_mdio(unsigned int id, u32
phy_mask)
case ATH79_SOC_AR7241:
mdio_data->builtin_switch = 1;
break;
-
+   case ATH79_SOC_AR7242:
+   if (id == 1) {
+   mdio_data->builtin_switch = 1;
+}
+break;
case ATH79_SOC_AR9330:
mdio_data->is_ar9330 = 1;
/* fall through */
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: Allow for activation of second mdio bus in ar7242 / ag71xx driver

2013-05-14 Thread Andrew McDonnell

This patch allows a board to enable the mdio bus on the second ethernet port
provided by the AR7242 (as used in the D-Link DIR-632-A1.)  The AR7242 (at
least on the dir632) has two ethernet, eth0 at 0x1900 and eth1 at
0x1a00, and both have enumerable mdio busses.

It further defaults to connecting eth1 to ag71xx-mdio.1 when registering eth1
with ath79 platform data.

Please note this superseded prior email with missing subject(!)


Signed-off-by: Andrew McDonnell 
---

.../linux/ar71xx/files/arch/mips/ath79/dev-eth.c   |   19 +--
 1 files changed, 13 insertions(+), 6 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 47e1350..cbd782d 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -183,6 +183,7 @@ void __init ath79_register_mdio(unsigned int id, u32 
phy_mask)
if (ath79_soc == ATH79_SOC_AR9341 ||
ath79_soc == ATH79_SOC_AR9342 ||
ath79_soc == ATH79_SOC_AR9344 ||
+   ath79_soc == ATH79_SOC_AR7242 ||
ath79_soc == ATH79_SOC_QCA9556 ||
ath79_soc == ATH79_SOC_QCA9558)
max_id = 1;
@@ -202,6 +203,13 @@ void __init ath79_register_mdio(unsigned int id, u32
phy_mask)
mdio_data = &ath79_mdio1_data;
break;

+   case ATH79_SOC_AR7242:
+   ath79_set_pll(AR71XX_PLL_REG_SEC_CONFIG,
+  AR7242_PLL_REG_ETH0_INT_CLOCK, 0x6200,
+  AR71XX_ETH0_PLL_SHIFT);
+   /* The driver in DD-WRT always has a 100ms delay after setting
the PLL */
+   udelay(100*1000);
+   /* fall through - the AR7242 has two eth ports */
case ATH79_SOC_AR9341:
case ATH79_SOC_AR9342:
case ATH79_SOC_AR9344:
@@ -216,11 +224,6 @@ void __init ath79_register_mdio(unsigned int id, u32
phy_mask)
}
break;

-   case ATH79_SOC_AR7242:
-   ath79_set_pll(AR71XX_PLL_REG_SEC_CONFIG,
-  AR7242_PLL_REG_ETH0_INT_CLOCK, 0x6200,
-  AR71XX_ETH0_PLL_SHIFT);
-   /* fall through */
default:
mdio_dev = &ath79_mdio0_device;
mdio_data = &ath79_mdio0_data;
@@ -236,7 +239,11 @@ void __init ath79_register_mdio(unsigned int id, u32
phy_mask)
case ATH79_SOC_AR7241:
mdio_data->builtin_switch = 1;
break;
-
+   case ATH79_SOC_AR7242:
+   if (id == 1) {
+   mdio_data->builtin_switch = 1;
+}
+break;
case ATH79_SOC_AR9330:
mdio_data->is_ar9330 = 1;
/* fall through */
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: Allow platform configurable tx/rx ring size in ag71xx

2013-05-14 Thread Andrew McDonnell

This patch allows the platform to configure the default ethernet tx/rx ring
size (specifcally, for the ar7242 ag7240 device as found in the D-Link
DIR-632-A1).  This patch only causes the platform data to be used if
specifically initialised in the board specific support, otherwise the existing
defaults remain in place.

This change allows the DIR-632-A1 to set the ring sizes to the same values as
is done in the DD-WRT ag7240 driver.

Signed-off-by: Andrew McDonnell 
---
 .../mips/include/asm/mach-ath79/ag71xx_platform.h  |3 +++
 .../net/ethernet/atheros/ag71xx/ag71xx_main.c  |6 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

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 656a6ef..dcc1170 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
@@ -45,6 +45,9 @@ struct ag71xx_platform_data {
u32 fifo_cfg1;
u32 fifo_cfg2;
u32 fifo_cfg3;
+
+   unsignedtx_ring_size;
+   unsignedrx_ring_size;
 };

 struct ag71xx_mdio_platform_data {
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 50029ff..2e1d39e 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
@@ -1149,6 +1149,12 @@ static int ag71xx_probe(struct platform_device *pdev)

ag->tx_ring.size = AG71XX_TX_RING_SIZE_DEFAULT;
ag->rx_ring.size = AG71XX_RX_RING_SIZE_DEFAULT;
+   if (pdata->tx_ring_size > 0 && pdata->tx_ring_size <
AG71XX_TX_RING_SIZE_MAX) {
+   ag->tx_ring.size = pdata->tx_ring_size;
+   }
+   if (pdata->rx_ring_size > 0 && pdata->rx_ring_size <
AG71XX_RX_RING_SIZE_MAX) {
+   ag->rx_ring.size = pdata->rx_ring_size;
+   }

ag->stop_desc = dma_alloc_coherent(NULL,
sizeof(struct ag71xx_desc), &ag->stop_desc_dma, GFP_KERNEL);
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] How to enable debug mode in wpa_supplicant?

2013-05-14 Thread Francisco Cuesta
Thanks again Jonas :D

I have set it on the menuconfig and now when I call wpa_supplicant
with -dd mode I get some output in the terminal!

Thanks!

2013/5/14 Jonas Gorski :
> On Tue, May 14, 2013 at 10:27 AM, Francisco Cuesta  
> wrote:
>> Hi again Jon,
>
> it's still "Jonas" :p
>
>> I've found where to enable the variable, is it in hostapd/Config.in,
>> isn't it? However after setting the variable to "default 2"  and
>
> Yes, or rather menuconfig / .config.
>
>> compiling the whole package again, I don't know where the output goes,
>> to the log or it should be displayed in the stdout?
>
> 2 is too high, you should set it to 0 to get everything; it should
> then be displayed on stdout if you start wpa_supplicant in foreground.
>
>
> 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] [PATCH] ar71xx: Add user space support for the D-Link DIR-632-A1

2013-05-14 Thread Andrew McDonnell

This patch adds user space supoprt for the D-Link DIR-632-A1, specifically
provides default LED behaviour and default bridge configuration and boot board
platform check.

Signed-off-by: Andrew McDonnell 
---
 target/linux/ar71xx/base-files/etc/diag.sh |3 +++
 .../ar71xx/base-files/etc/uci-defaults/01_leds |6 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |8 
 .../etc/uci-defaults/03_network-switchX-migration  |1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |3 +++
 .../ar71xx/base-files/lib/upgrade/platform.sh  |1 +
 6 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
b/target/linux/ar71xx/base-files/etc/diag.sh
index ed269b2..cd39f59 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -47,6 +47,9 @@ get_status_led() {
dir-615-e4)
status_led="d-link:green:power"
;;
+   dir-632-a1)
+   status_led="d-link:amber:power"
+   ;;
dir-615-c1)
status_led="d-link:green:status"
;;
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 6e3e370..0bf3a09 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -60,6 +60,12 @@ dir-615-e4)
ucidef_set_led_switch "lan4" "LAN4" "d-link:green:lan4" "switch0" "0x10"
;;

+dir-632-a1)
+   ucidef_set_led_usbdev "usb" "USB" "d-link:green:usb" "1-1"
+   ucidef_set_led_netdev "wan" "WAN" "d-link:green:wan" "eth1"
+   ucidef_set_led_wlan "wlan" "WLAN" "d-link:green:wireless" "phy0tpt"
+   ;;
+
 dir-825-b1 | \
 dir-825-c1)
ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1"
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 a9a3ff2..c19b9e7 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -217,6 +217,14 @@ wpe72)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;

+dir-632-a1)
+   ucidef_set_interfaces_lan_wan "eth0" "eth1"
+   ucidef_add_switch "switch0" "1" "1"
+   ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 5 6 7 8"
+  ;;
+
+
+
 ap121 |\
 ap121-mini |\
 ap96 |\
diff --git
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
index 718a924..3bf74fe 100755
--- 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
+++ 
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
@@ -57,6 +57,7 @@ ap121-mini|\
 ap96|\
 airrouter|\
 dir-600-a1|\
+dir-632-a1|\
 dir-615-c1|\
 dir-615-e4|\
 ja76pf|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 194a40b..94437ef 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -237,6 +237,9 @@ ar71xx_board_detect() {
*"DIR-615 rev. E4")
name="dir-615-e4"
;;
+   *"DIR-632 rev. A1")
+   name="dir-632-a1"
+   ;;
*"DIR-825 rev. B1")
name="dir-825-b1"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 817123b..4410859 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -108,6 +108,7 @@ platform_check_image() {
dir-600-a1 | \
dir-615-c1 | \
dir-615-e4 | \
+   dir-632-a1 | \
dir-825-c1 | \
dir-835-a1 | \
ew-dorin | \
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: Add board profile for the D-Link DIR-632-A1

2013-05-14 Thread Andrew McDonnell

This patch adds a board profile for the D-Link DIR-632-A1, specifically,
ensures that USB support is built in by default.

Signed-off-by: Andrew McDonnell 
---
 target/linux/ar71xx/generic/profiles/d-link.mk |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/target/linux/ar71xx/generic/profiles/d-link.mk
b/target/linux/ar71xx/generic/profiles/d-link.mk
index f30e9b1..8c371a3e 100644
--- a/target/linux/ar71xx/generic/profiles/d-link.mk
+++ b/target/linux/ar71xx/generic/profiles/d-link.mk
@@ -50,6 +50,17 @@ endef

 $(eval $(call Profile,DIR615E4))

+define Profile/DIR632A1
+   NAME:=D-Link DIR-632 rev. A1
+   PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+endef
+
+define Profile/DIR632A1/Description
+   Package set optimized for the D-Link DIR-632 rev. A1
+endef
+
+$(eval $(call Profile,DIR632A1))
+

 define Profile/DIR825B1
NAME:=D-Link DIR-825 rev. B1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: add image build support for the D-Link DIR-632-A1

2013-05-14 Thread Andrew McDonnell

This patch adds image build support for the D-Link DIR-632-A1.

Note the sizes are set based on the manufacturer upgrade image, but I think
there is a lot of wasted space as the lzma compressed kernel is not as big as
the space left here, so perhaps this could be improved in the future.

Signed-off-by: Andrew McDonnell 
---
 target/linux/ar71xx/image/Makefile |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile
b/target/linux/ar71xx/image/Makefile
index c6b4dc4..73e256d 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -174,6 +174,7 @@
cameo933x_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvra
 
cameo934x_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,1280k(kernel),14656k(rootfs),192k(lang)ro,64k(mac)ro,64k(art)ro,15936k@0x2(firmware)
 
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)
 
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
+dir632a1_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(nvram),1984k(linux),5568k(rootfs),64k(MAC),192k(LP),64k(ART)ro,7488k@0x5(firmware)
debug loglevel=8
 
dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x5(firmware),64k@0x7f(caldata_copy)
 
dir825b1_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),6784k(rootfs),64k(caldata)ro,7808k@0x5(firmware),64k@0x66(caldata_orig),6208k@0x5(firmware_orig)
 
ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1024k(kernel),2688k(rootfs),64k(art),3712k@0x5(firmware)
@@ -359,6 +360,15 @@ define Image/Build/Cameo933x/initramfs
$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo933x_mtdlayout))
 endef

+define Image/Build/DIR632A1
+   $(call
Image/Build/Cameo,$(1),$(2),$(3),$(dir632a1_mtdlayout),2031616,5636096,$(4))
+endef
+
+define Image/Build/DIR632A1/initramfs
+   $(call MkuImageLzma/initramfs,$(2),$(3) $(dir632a1_mtdlayout))
+endef
+
+
 define Image/Build/Cameo934x
$(call
Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout),1310720,15007718,$(4))
 endef
@@ -864,6 +874,8 @@ $(eval $(call
SingleProfile,Cameo934x,$(fs_64k),DIR835A1,dir-835-a1,DIR-835-A1,t

 $(eval $(call
SingleProfile,CyberTAN,$(fs_64k),WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,1.00.01))

+$(eval $(call
SingleProfile,DIR632A1,$(fs_squash),DIR632A1,dir-632-a1,DIR-632-A1,ttyS0,115200,"A101-AR7242-RT-100324-02"))
+
 $(eval $(call
SingleProfile,DIR825B1,$(fs_64k),DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
 $(eval $(call
SingleProfile,DIR825B1,$(fs_64k),TEW673GRU,tew-673gru,TEW-673GRU,ttyS0,115200,01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))

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


[OpenWrt-Devel] [PATCH] ar71xx: adds kernel target for the D-Link DIR-632-A1.

2013-05-14 Thread Andrew McDonnell

This patch adds a kernel target for the D-Link DIR-632-A1.

Note that the CONFIG_MTD_CFI_I2 and BANK changes are duplicated from DD-WRT
and the D-Link firmware; I think it is because this uses a different flash
chip (mx25l6405d) from many of the other similar devices.

Signed-off-by: Andrew McDonnell 
---
 target/linux/ar71xx/config-3.8 |4 +--
 .../619-MIPS-ath79-add-DIR-632-A1-support.patch|   39 
 2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/config-3.8 b/target/linux/ar71xx/config-3.8
index ea2be6b..7f3d4db 100644
--- a/target/linux/ar71xx/config-3.8
+++ b/target/linux/ar71xx/config-3.8
@@ -38,6 +38,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
+CONFIG_ATH79_MACH_DIR_632_A1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
 CONFIG_ATH79_MACH_EAP7660D=y
@@ -191,12 +192,9 @@ CONFIG_MIPS_MT_DISABLED=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
 CONFIG_MTD_CFI_GEOMETRY=y
-# CONFIG_MTD_CFI_I2 is not set
 # CONFIG_MTD_CFI_INTELEXT is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_M25P80=y
-# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
 CONFIG_MTD_MYLOADER_PARTS=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2
diff --git
a/target/linux/ar71xx/patches-3.8/619-MIPS-ath79-add-DIR-632-A1-support.patch
b/target/linux/ar71xx/patches-3.8/619-MIPS-ath79-add-DIR-632-A1-support.patch
new file mode 100644
index 000..b4c5bf2
--- /dev/null
+++ 
b/target/linux/ar71xx/patches-3.8/619-MIPS-ath79-add-DIR-632-A1-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/Kconfig
 b/arch/mips/ath79/Kconfig
+@@ -273,6 +273,16 @@ config ATH79_MACH_DIR_615_C1
+   select ATH79_DEV_WMAC
+   select ATH79_NVRAM
+
++config ATH79_MACH_DIR_632_A1
++  bool "D-Link DIR-632 rev. A1 support"
++  select SOC_AR724X
++  select ATH79_DEV_ETH
++  select ATH79_DEV_GPIO_BUTTONS
++  select ATH79_DEV_LEDS_GPIO
++  select ATH79_DEV_M25P80
++  select ATH79_DEV_USB
++  select ATH79_NVRAM
++
+ config ATH79_MACH_DIR_825_B1
+   bool "D-Link DIR-825 rev. B1 board support"
+   select SOC_AR71XX
+--- a/arch/mips/ath79/machtypes.h
 b/arch/mips/ath79/machtypes.h
+@@ -38,6 +38,7 @@ enum ath79_mach_type {
+   ATH79_MACH_DIR_600_A1,  /* D-Link DIR-600 rev. A1 */
+   ATH79_MACH_DIR_615_C1,  /* D-Link DIR-615 rev. C1 */
+   ATH79_MACH_DIR_615_E4,  /* D-Link DIR-615 rev. E4 */
++  ATH79_MACH_DIR_632_A1,  /* D-Link DIR-632 rev. A1 */
+   ATH79_MACH_DIR_825_B1,  /* D-Link DIR-825 rev. B1 */
+   ATH79_MACH_DIR_825_C1,  /* D-Link DIR-825 rev. C1 */
+   ATH79_MACH_DIR_835_A1,  /* D-Link DIR-835 rev. A1 */
+--- a/arch/mips/ath79/Makefile
 b/arch/mips/ath79/Makefile
+@@ -54,6 +54,7 @@ obj-$(CONFIG_ATH79_MACH_CAP4200AG)   += ma
+ obj-$(CONFIG_ATH79_MACH_DB120)+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DIR_600_A1)   += mach-dir-600-a1.o
+ obj-$(CONFIG_ATH79_MACH_DIR_615_C1)   += mach-dir-615-c1.o
++obj-$(CONFIG_ATH79_MACH_DIR_632_A1)   += mach-dir-632-a1.o
+ obj-$(CONFIG_ATH79_MACH_DIR_825_B1)   += mach-dir-825-b1.o
+ obj-$(CONFIG_ATH79_MACH_DIR_825_C1)   += mach-dir-825-c1.o
+ obj-$(CONFIG_ATH79_MACH_EW_DORIN) += mach-ew-dorin.o
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: Add platform machine support for the D-Link DIR-632-A1

2013-05-14 Thread Andrew McDonnell

This patch adds platform machine support for the D-Link DIR-632-A1.
Currently eth1 is not supported as the ag71xx driver does not work with the
AR7242 at least for all the configurations I have tested for this board.

With this patch and the preceding patches, the DIR-632-A1 is fully usable for
all use cases that do not require a separate WAN port.  Tested succesfully:
LEDs, 2x switches, wireless, eth0, USB2.


Signed-off-by: Andrew McDonnell 
---
 .../ar71xx/files/arch/mips/ath79/mach-dir-632-a1.c |  391 
 1 files changed, 391 insertions(+), 0 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-632-a1.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-632-a1.c
new file mode 100644
index 000..8744abf
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-632-a1.c
@@ -0,0 +1,391 @@
+/*
+ *  D-Link DIR-632 rev. A1 board support
+ *
+ *  Copyright (C) 2013 Andrew McDonnell 
+ *  Copyright (C) 2010-2012 Gabor Juhos 
+ *
+ *  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 "common.h"
+#include "dev-common.h"
+#include "dev-eth.h"
+#include "dev-m25p80.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-ap9x-pci.h"
+#include "dev-usb.h"
+#include "machtypes.h"
+#include "nvram.h"
+
+/* Set the following to zero to have a look at actual RAM when trying to find
MAC addresses, etc. */
+#define DEBUG_CHECK_MEMORY_CONTENTS 1
+
+  /* Various in-memory items of interest:
+   *
+   * Memory Flash Description
+   * 1f04   04u-boot environment variables
+   * 1ffb0004   7b0004ASCII MAC address matching the case sticker.
+   *  I suspect this is 'fixed' when you first execute
+   *  setenv mac= in u-boot (which I inadvertently did)
+   *  (mtd "MAC" partition)
+   * 1ffe   7eNVRAM  (area prefix: "HSLF")
+   *  (partway through factory mtd "LP" partition)
+   * 1fff   7fHardware MAC address for eth0, according to source
+   *  code of DD-WRT and zRouter, except this MAC address
+   *  is _different_ to the stickered MAC address.
+   *  (mtd "ART" partition)
+   * 1fff0006   7f0006Hardware MAC address for eth1, according to source
+   *  code of DD-WRT and zRouter, except this MAC address
+   *  is set to ff:ff:ff:ff:ff:ff in my router.
+   * 1ff1   7f1000PCI EEPROM - "calibration data"
+   * 1ff1010c   7f110cPCI EEPROM - WLAN mac address reported in DD-WRT
+   *  In my board this is set to 00:00:22:22:22:22
+   *  Which happens to be the same as the NVRAM value
+   *  ath_hwaddr
+   */
+
+/* Network architecture:
+ *
+ * eth0 --> 8309 switch - LAN
+ * eth1 --> S26 switch - WAN
+ * wlan0 --> PCI ath9k driver
+ */
+
+#define ADDR_UBOOT   0x1f04
+#define ADDR_AMAC0x1ffb
+#define ADDR_NVRAM   0x1ffe
+#define ADDR_HMAC0x1fff
+#define ADDR_PCIBASE 0x1fff
+#define ADDR_EEPROM  0x1fff1000
+
+#define EEPROM_WLAN_MAC_OFFSET 0x10c
+
+#define NVRAM_SIZE 0x1
+
+#define DIR632_MAC0_OFFSET 0
+#define DIR632_MAC1_OFFSET 6
+
+#define DIR632_AMAC_OFFSET 4
+
+/*
+
+ Known LED and GPIO Definitions, derived from
+
+ 
http://zrouter.org/projects/zrouter/repository/entry/boards/D-Link/DIR-632/GPIO
+
http://zrouter.org/projects/zrouter/repository/entry/boards/D-Link/DIR-632/board.hints
+
+ and from practical experimentation using the DD-WRT generic_leds and testing
+
+GPIO LED
+ 0 LED WPS (blue)
+ 1 LED STATUS (bicolour: orange)
+ 6 LED STATUS (bicolour: green)
+ 7 LED WAN (bicolour: orange)
+ 8 BUTTON Reset
+ 9 UART
+ 10UART
+ 11LED USB (green)
+ 12 BUTTON WPS
+ 13 Test point TP3
+ 14 Test point TP4
+ 15 Test point TP5
+ 17LED WAN (bicolour: green)
+
+Additionally, the ATH9k has GPIO, specified for the LED in platform data
+
+ 0  LED, WLAN (green)
+
+*/
+
+#define DIR_632_A1_GPIO_LED_WPS0
+#define DIR_632_A1_GPIO_LED_POWER_AMBER1
+#define DIR_632_A1_GPIO_LED_POWER_GREEN6
+#define DIR_632_A1_GPIO_LED_WAN_AMBER  7
+#define DIR_632_A1_GPIO_LED_USB11
+#define DIR_632_A1_GPIO_LED_WAN_GREEN  17
+
+#define DIR_632_A1_WLAN_GPIO_LED   0
+
+#define DIR_632_A1_GPIO_BTN_RESET  8
+#define DIR_632_A1_GPIO_BTN_WPS12
+
+#define DIR_632_A1_KEYS_POLL_INTERVAL  20  /* msecs */
+#define DIR_632_A1_KEYS_DEBOUNCE_INTERVAL (3 * DIR_632_A1_KEYS_POLL_INTERVAL)
+
+static struct gpio_led dir_632_a1_leds_gpio[] __initd

Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow platform configurable tx/rx ring size in ag71xx

2013-05-14 Thread Felix Fietkau
On 2013-05-14 2:33 PM, Andrew McDonnell wrote:
> 
> This patch allows the platform to configure the default ethernet tx/rx ring
> size (specifcally, for the ar7242 ag7240 device as found in the D-Link
> DIR-632-A1).  This patch only causes the platform data to be used if
> specifically initialised in the board specific support, otherwise the existing
> defaults remain in place.
> 
> This change allows the DIR-632-A1 to set the ring sizes to the same values as
> is done in the DD-WRT ag7240 driver.
I can't think of any good reason to make the ring size platform specific
(and you didn't give one), so NACK from me.

- Felix

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: adds kernel target for the D-Link DIR-632-A1.

2013-05-14 Thread Felix Fietkau
On 2013-05-14 2:44 PM, Andrew McDonnell wrote:
> 
> This patch adds a kernel target for the D-Link DIR-632-A1.
> 
> Note that the CONFIG_MTD_CFI_I2 and BANK changes are duplicated from DD-WRT
> and the D-Link firmware; I think it is because this uses a different flash
> chip (mx25l6405d) from many of the other similar devices.
Please don't port random changes from DD-WRT that serve no real purpose
and aren't understood properly. The MTD related changes in that patch
are bogus and don't affect the SPI based flash chip in this board.

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow platform configurable tx/rx ring size in ag71xx

2013-05-14 Thread Andrew McDonnell
Hi Felix,

I am trying to port the DIR-632-A1 and made the most progress fixing the
ag71xx to work on this board by following what the (working but differently
architectured) DD-WRT driver for the AG7240 does.  It sets ring sizes that are
different from the defaults provided by OPenWRT.  This was one of the changes
I made early on before I finally got eth0 working, so it is possibly
redundant, but I figured the developers chose those values for a reason and
they work for me...

Is the above too verbose? :-)

Note, I am still gaining experience workng with Linux kernel ethernet drivers,
so I dont deeply understand some of the code, but I am following proven
working software and testing by transferring multiple large files.

--Andrew

On 14/05/13 22:28, Felix Fietkau wrote:
> On 2013-05-14 2:33 PM, Andrew McDonnell wrote:
>>
>> This patch allows the platform to configure the default ethernet tx/rx ring
>> size (specifcally, for the ar7242 ag7240 device as found in the D-Link
>> DIR-632-A1).  This patch only causes the platform data to be used if
>> specifically initialised in the board specific support, otherwise the 
>> existing
>> defaults remain in place.
>>
>> This change allows the DIR-632-A1 to set the ring sizes to the same values as
>> is done in the DD-WRT ag7240 driver.
> I can't think of any good reason to make the ring size platform specific
> (and you didn't give one), so NACK from me.
> 
> - Felix
> 
> 

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow for activation of second mdio bus in ar7242 / ag71xx driver

2013-05-14 Thread Felix Fietkau
On 2013-05-14 2:30 PM, Andrew McDonnell wrote:
> 
> This patch allows a board to enable the mdio bus on the second ethernet port
> provided by the AR7242 (as used in the D-Link DIR-632-A1.)  The AR7242 (at
> least on the dir632) has two ethernet, eth0 at 0x1900 and eth1 at
> 0x1a00, and both have enumerable mdio busses.
> 
> It further defaults to connecting eth1 to ag71xx-mdio.1 when registering eth1
> with ath79 platform data.
> 
> Please note this superseded prior email with missing subject(!)
Are you sure about this? In other AR724x SoCs one MDIO bus goes to the
built-in switch, and the other one is external. You don't seem to make
use of the second MDIO bus in your DIR-632-A1 patch either.
I think the AR7242 does not have the built-in switch, so it would
surprise me to see a second MDIO bus being used there.

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


Re: [OpenWrt-Devel] One question of ralink wifi ht40 mode

2013-05-14 Thread Сергей Василюгин
  14.05.2013, 14:10, "Daniel Golle" :This is because the vendor driver makes ensures operation in HT20 beforetriggering RF calibration.And never set it back to ht40 so works only in ht20 mode? I don't think it's wright. Vendor driver explicitly set ht20 only for scanning (in sta or apsta mode).On 05/13/2013 08:29 PM, Сергей Василюгин wrote: Hi, All Anybody knows why ht40 mode explicitly switch off for some ralink wifi? rt2800lib.c in function rt2800_config_channel(): if (rt2x00_rf(rt2x00dev, RF3290) || rt2x00_rf(rt2x00dev, RF3322) || rt2x00_rf(rt2x00dev, RF5350) || rt2x00_rf(rt2x00dev, RF5360) || rt2x00_rf(rt2x00dev, RF5370) || rt2x00_rf(rt2x00dev, RF5372) || rt2x00_rf(rt2x00dev, RF5390) || rt2x00_rf(rt2x00dev, RF5392)) { rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); rt2x00_set_field8(&rfcsr, RFCSR30_TX_H20M, 0);< rt2x00_set_field8(&rfcsr, RFCSR30_RX_H20M, 0);< rt2800_rfcsr_write(rt2x00dev, 30, rfcsr); rt2800_rfcsr_read(rt2x00dev, 3, &rfcsr); rt2x00_set_field8(&rfcsr, RFCSR30_RF_CALIBRATION, 1); rt2800_rfcsr_write(rt2x00dev, 3, rfcsr); } I've done correct{?) configs and ht40 works for my rt3290, rt3352 & rt5350. Or it's simple mistake and instead of 0 it must be conf_is_ht40(conf). --- serge-- ALLNET GmbH ; Maistr. 2 ; D-82110 Germering ; GermanyTel. +49-89-89422217 - Fax +49-89-89422233http://www.allnet.deemail: Daniel Golle Schulungs-/Veranstaltungsprogramm: http://www.802lab.deGeschäftsführer: Wolfgang Marcus BauerHandelsregister München B 95922 ; UST-ID-Nr. DE 128214294 ;St.-Nr.117/115/00164WEEE-Reg.-NR. DE 13101093Bankverbindung:Sparkasse Fürstenfeldbruck KTO: 2774594 ; BLZ: 70053070Swift-Code: BYLADEM1FFB ; IBAN: DE6170053072774594___openwrt-devel mailing listopenwrt-devel@lists.openwrt.orghttps://lists.openwrt.org/mailman/listinfo/openwrt-devel  ---serge___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: adds kernel target for the D-Link DIR-632-A1.

2013-05-14 Thread Andrew McDonnell
Hi Felix,

Sorry, I'm still learning how this project works ... I have been trying to
follow the patch submission checklist as best I can.

Perhaps that adivce could be added to the guidelines on
https://dev.openwrt.org/wiki/SubmittingPatches page, but I only worked out how
to get edit access to other wiki http://wiki.openwrt.org/.  Do you know where
I can propose changes to the dev wiki?

(I was confusing for quite a while when I started, being there is a forum and
two wikis and a mailing list...)

I think of the patches I have submmited  just now, the MTD and the ring size
are the only ones directly copied as such

--Andrew


On 14/05/13 22:32, Felix Fietkau wrote:
> On 2013-05-14 2:44 PM, Andrew McDonnell wrote:
>>
>> This patch adds a kernel target for the D-Link DIR-632-A1.
>>
>> Note that the CONFIG_MTD_CFI_I2 and BANK changes are duplicated from DD-WRT
>> and the D-Link firmware; I think it is because this uses a different flash
>> chip (mx25l6405d) from many of the other similar devices.
> Please don't port random changes from DD-WRT that serve no real purpose
> and aren't understood properly. The MTD related changes in that patch
> are bogus and don't affect the SPI based flash chip in this board.
> 
> - Felix
> 

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow for activation of second mdio bus in ar7242 / ag71xx driver

2013-05-14 Thread Andrew McDonnell
Hi Felix

at this stage I have had no luck getting eth1 to work so I have deliberately
left out all the code attempting to make eth1 work.  (I am intending to post
my progress to my github but I am all coded out for tonight)

But again, having no other point of reference I traced through the working
DDWRT driver and discovered that eth1 in this board is connected to S26
internal switch and sends mdio commands over 0x1a00.

An easy test is when the following is present in the mach-dir632-a1.c, and if
you add debugging printks into the right places in ag71xx, you can see the
kernel enumerating phys 0..8 and 18 in eth0 and phys 0..4 in eth1 and
ag71xx_mdio.1.00 --> 05 shows up in /sys/class/mdio

+   ath79_register_mdio(1, 0);
+   ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev;

When I printk instrument the DD-WRT driver you can also see it writing to the
mdio registers on 0x1a00 for eth1

I am new to how kernel ethernet drivers work so it is quite possible I am
misunderstanding something or misinterpreting some output - and it is hard to
find decent documentation on how all this works other than tracing kernel code
and experimenting, and reading and instrumenting the working source code in
DD-WRT.



--Andrew


On 14/05/13 22:39, Felix Fietkau wrote:
> On 2013-05-14 2:30 PM, Andrew McDonnell wrote:
>>
>> This patch allows a board to enable the mdio bus on the second ethernet port
>> provided by the AR7242 (as used in the D-Link DIR-632-A1.)  The AR7242 (at
>> least on the dir632) has two ethernet, eth0 at 0x1900 and eth1 at
>> 0x1a00, and both have enumerable mdio busses.
>>
>> It further defaults to connecting eth1 to ag71xx-mdio.1 when registering eth1
>> with ath79 platform data.
>>
>> Please note this superseded prior email with missing subject(!)
> Are you sure about this? In other AR724x SoCs one MDIO bus goes to the
> built-in switch, and the other one is external. You don't seem to make
> use of the second MDIO bus in your DIR-632-A1 patch either.
> I think the AR7242 does not have the built-in switch, so it would
> surprise me to see a second MDIO bus being used there.
> 
> - Felix
> 

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: adds kernel target for the D-Link DIR-632-A1.

2013-05-14 Thread Felix Fietkau
On 2013-05-14 3:13 PM, Andrew McDonnell wrote:
> Hi Felix,
> 
> Sorry, I'm still learning how this project works ... I have been trying to
> follow the patch submission checklist as best I can.
> 
> Perhaps that adivce could be added to the guidelines on
> https://dev.openwrt.org/wiki/SubmittingPatches page, but I only worked out how
> to get edit access to other wiki http://wiki.openwrt.org/.  Do you know where
> I can propose changes to the dev wiki?
> 
> (I was confusing for quite a while when I started, being there is a forum and
> two wikis and a mailing list...)
> 
> I think of the patches I have submmited  just now, the MTD and the ring size
> are the only ones directly copied as such
What I mentioned is a general development issue that doesn't really fit
well into the SubmittingPatches howto. In general you should not submit
changes that are unnecessary and/or not well understood.
I wasn't objecting to copying stuff from DD-WRT per se, but more about
copying stuff from it without understanding it or knowing if it helps at
all.
I'm pretty sure that the MTD kernel config changes are wrong and not
needed for bringing up your board.

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow for activation of second mdio bus in ar7242 / ag71xx driver

2013-05-14 Thread Felix Fietkau
On 2013-05-14 3:22 PM, Andrew McDonnell wrote:
> Hi Felix
> 
> at this stage I have had no luck getting eth1 to work so I have deliberately
> left out all the code attempting to make eth1 work.  (I am intending to post
> my progress to my github but I am all coded out for tonight)
> 
> But again, having no other point of reference I traced through the working
> DDWRT driver and discovered that eth1 in this board is connected to S26
> internal switch and sends mdio commands over 0x1a00.
> 
> An easy test is when the following is present in the mach-dir632-a1.c, and if
> you add debugging printks into the right places in ag71xx, you can see the
> kernel enumerating phys 0..8 and 18 in eth0 and phys 0..4 in eth1 and
> ag71xx_mdio.1.00 --> 05 shows up in /sys/class/mdio
> 
> + ath79_register_mdio(1, 0);
> + ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev;
> 
> When I printk instrument the DD-WRT driver you can also see it writing to the
> mdio registers on 0x1a00 for eth1
> 
> I am new to how kernel ethernet drivers work so it is quite possible I am
> misunderstanding something or misinterpreting some output - and it is hard to
> find decent documentation on how all this works other than tracing kernel code
> and experimenting, and reading and instrumenting the working source code in
> DD-WRT.
With DD-WRT you have to keep in mind that it does not have proper
hardware/platform detection in the kernel. It simply registers a whole
bunch of stuff and then tries to fix up the mess in user space. You
should not use its register writes as a reference of what to do.
As for the changes enabling the second MDIO bus - I think we should hold
those back. It's more likely that your board shares the primary MDIO bus
between eth0 and eth1. You could try setting the PHY mask to BIT(18) for
eth1 (using mdio0) to make it attach to that PHY.

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: adds kernel target for the D-Link DIR-632-A1.

2013-05-14 Thread Andrew McDonnell
Hi Felix

I can resubmit this without those, but I wont be able to test it for a couple
of days and would prefer to wait until I have tested it, is that OK?

thanks for the feedback

--Andrew

On 14/05/13 22:56, Felix Fietkau wrote:
> On 2013-05-14 3:13 PM, Andrew McDonnell wrote:
>> Hi Felix,
>>
>> Sorry, I'm still learning how this project works ... I have been trying to
>> follow the patch submission checklist as best I can.
>>
>> Perhaps that adivce could be added to the guidelines on
>> https://dev.openwrt.org/wiki/SubmittingPatches page, but I only worked out 
>> how
>> to get edit access to other wiki http://wiki.openwrt.org/.  Do you know where
>> I can propose changes to the dev wiki?
>>
>> (I was confusing for quite a while when I started, being there is a forum and
>> two wikis and a mailing list...)
>>
>> I think of the patches I have submmited  just now, the MTD and the ring size
>> are the only ones directly copied as such
> What I mentioned is a general development issue that doesn't really fit
> well into the SubmittingPatches howto. In general you should not submit
> changes that are unnecessary and/or not well understood.
> I wasn't objecting to copying stuff from DD-WRT per se, but more about
> copying stuff from it without understanding it or knowing if it helps at
> all.
> I'm pretty sure that the MTD kernel config changes are wrong and not
> needed for bringing up your board.
> 
> - Felix
> 

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: adds kernel target for the D-Link DIR-632-A1.

2013-05-14 Thread Felix Fietkau
On 2013-05-14 3:38 PM, Andrew McDonnell wrote:
> Hi Felix
> 
> I can resubmit this without those, but I wont be able to test it for a couple
> of days and would prefer to wait until I have tested it, is that OK?
Sure. You can make things easier to follow by submitting your changes as
a series using git-send-email, so they show up as one thread.
Also, please merge the patch that adds the mach-* source file with the
one that adds the patch that makes use of it.

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow for activation of second mdio bus in ar7242 / ag71xx driver

2013-05-14 Thread Andrew McDonnell
Hi Felix,

I was wondering why there was something out on 18...

if setting that to the phy mask makes everything work after all my debugging I
will be very annoyed at myself for not posting my work sooner (and at DD-WRT!)

Yes, this patch is not immediately needed for support for the rest of the DIR632

thanks again

--Andrew

On 14/05/13 23:03, Felix Fietkau wrote:
> On 2013-05-14 3:22 PM, Andrew McDonnell wrote:
>> Hi Felix
>>
>> at this stage I have had no luck getting eth1 to work so I have deliberately
>> left out all the code attempting to make eth1 work.  (I am intending to post
>> my progress to my github but I am all coded out for tonight)
>>
>> But again, having no other point of reference I traced through the working
>> DDWRT driver and discovered that eth1 in this board is connected to S26
>> internal switch and sends mdio commands over 0x1a00.
>>
>> An easy test is when the following is present in the mach-dir632-a1.c, and if
>> you add debugging printks into the right places in ag71xx, you can see the
>> kernel enumerating phys 0..8 and 18 in eth0 and phys 0..4 in eth1 and
>> ag71xx_mdio.1.00 --> 05 shows up in /sys/class/mdio
>>
>> +ath79_register_mdio(1, 0);
>> +ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev;
>>
>> When I printk instrument the DD-WRT driver you can also see it writing to the
>> mdio registers on 0x1a00 for eth1
>>
>> I am new to how kernel ethernet drivers work so it is quite possible I am
>> misunderstanding something or misinterpreting some output - and it is hard to
>> find decent documentation on how all this works other than tracing kernel 
>> code
>> and experimenting, and reading and instrumenting the working source code in
>> DD-WRT.
> With DD-WRT you have to keep in mind that it does not have proper
> hardware/platform detection in the kernel. It simply registers a whole
> bunch of stuff and then tries to fix up the mess in user space. You
> should not use its register writes as a reference of what to do.
> As for the changes enabling the second MDIO bus - I think we should hold
> those back. It's more likely that your board shares the primary MDIO bus
> between eth0 and eth1. You could try setting the PHY mask to BIT(18) for
> eth1 (using mdio0) to make it attach to that PHY.
> 
> - Felix
> 

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Allow platform configurable tx/rx ring size in ag71xx

2013-05-14 Thread Felix Fietkau
On 2013-05-14 3:06 PM, Andrew McDonnell wrote:
> Hi Felix,
> 
> I am trying to port the DIR-632-A1 and made the most progress fixing the
> ag71xx to work on this board by following what the (working but differently
> architectured) DD-WRT driver for the AG7240 does.  It sets ring sizes that are
> different from the defaults provided by OPenWRT.  This was one of the changes
> I made early on before I finally got eth0 working, so it is possibly
> redundant, but I figured the developers chose those values for a reason and
> they work for me...
Right, the problem with that line of thinking is that sometimes things
are done in a particular way for no good reason :)

> Is the above too verbose? :-)
It's fine, but my recommendation stands: With every change that you make
in your patch submissions, you have to either have a reason for it, or
have explicitly tested if it makes a difference or not.

> Note, I am still gaining experience workng with Linux kernel ethernet drivers,
> so I dont deeply understand some of the code, but I am following proven
> working software and testing by transferring multiple large files.
Sounds good.

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


Re: [OpenWrt-Devel] [PATCH] [package] asterisk-11.x-chan-sccp-b initial creation (against git packages repository)

2013-05-14 Thread Jiri Slachta
Dne 11.5.2013 19:18, Diederik de Groot napsal(a):
> This patch includes new Makefile for chan-sccp-b V4.1-RC1 compiled against 
> the asterisk-11.x package (based on previous work for 
> asterisk-1.8-chan-sccp-b package). 
> 
> Signed-off-by: Diederik de Groot 

Applied! I shortened your commit message and slightly modified your Makefile.

Otherwise, thank you! 
Jiri
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [package] asterisk-chan-sccp-b update to revision 4631 (chan-sccp-b V4.1 RC1)

2013-05-14 Thread Jiri Slachta
Dne 11.5.2013 16:04, Diederik de Groot napsal(a):
> This patch includes Makefile changes for chan-sccp-b V4.1-RC1 compiled 
> against the asterisk-1.8.x package.
> 
> Signed-off-by: Diederik de Groot 

Applied! I shortened your commit message and slightly modified Makefile. I also 
moved asterisk-chan-sccp-b to asterisk-1.8.x-chan-sccp-b because of the 
existence asterisk-11.x-chan-sccp-b package to preserve naming convention.

Otherwise, thank you! 
Jiri
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Has anyone ported the openwrt on beaglebone?

2013-05-14 Thread Hui HU
Would you share some useful information? Any link or document? Thank you.

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


Re: [OpenWrt-Devel] [PATCH] add reSIProcate (SIP proxy and TURN server) package

2013-05-14 Thread Daniel Pocock
On 11/05/13 13:33, Jiri Slachta wrote:
> Hello Daniel,
> 
> I will take a look at this. Would you mind to find out, if there are any
> updates related to this app in upstream? I'll do some tests and if it's

The asio version 1.4.8 is the latest - they also have a 1.5.3 dev
release, but it is not for production use and apps like reSIProcate are
not tested with it.

The latest reSIProcate PKG_VERSION is 1.8.8 - it should work with the
same patch

The telephony repository is fine for reSIProcate, the asio package is a
general purpose development lib and belongs with things like boost
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [RFC] Add IPv6 NAT modules

2013-05-14 Thread Bernhard Schmidt
Hey,

this is my first patch to OpenWRT, please be gentle :-)  I already
submitted as a ticket (#13446), but I guess the list is more appropriate

Kernel 3.7 introduced IPv6 NAT, together with a couple of additional
netfilter targets.

- Core NAT Support:
  nf_nat_ipv6
  ip6table_nat

- known NAT targets
  MASQUERADE
  DNAT
  SNAT
  NETMAP
  REDIRECT

- Stateless 1:1 NAT (NPT)
  NPT

The attached patch adds these modules to OpenWRT. I have tested
MASQUERADE, SNAT and REDIRECT, NPT can be at least configured.

I'm not sure about the module placement though. At the moment I have put
the core NAT, MASQUERADE and SNAT/DNAT into kmod-ipt-nat, which would
probably make it depend on IPv6. NPT is also added to kmod-ipt-nat, that
could either be left there, moved to -core (since the main advantage of
NPT is to be without connection tracking) or moved to -natextra, since
it is a less used IPv6 NAT feature.

I don't really think it can be committed as is, but if you think so

Signed-Off-By: Bernhard Schmidt 

Index: include/netfilter.mk
===
--- include/netfilter.mk(Revision 36608)
+++ include/netfilter.mk(Arbeitskopie)
@@ -161,10 +161,14 @@
 
 # kernel only
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NF_NAT, $(P_XT)nf_nat 
$(P_V4)nf_nat_ipv4 $(P_XT)xt_nat $(P_V4)iptable_nat, ge 3.7.0),))
+$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NF_NAT_IPV6, 
$(P_V6)nf_nat_ipv6 $(P_V6)ip6table_nat, ge 3.7.0),))
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NF_NAT, $(P_V4)nf_nat 
$(P_V4)iptable_nat, lt 3.7.0),))
+$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_IP6_NF_TARGET_MASQUERADE, 
$(P_V6)ip6t_MASQUERADE, ge 3.7.0),))
+$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_IP6_NF_TARGET_NPT, 
$(P_V6)ip6t_NPT, ge 3.7.0),))
 
 # userland only
 $(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT,CONFIG_NF_NAT, ipt_SNAT 
ipt_DNAT)))
+$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT,CONFIG_IP6_NF_TARGET_NPT, 
ip6t_DNPT ip6t_SNPT)))
 
 $(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_MASQUERADE, 
$(P_V4)ipt_MASQUERADE))
 
@@ -173,8 +177,10 @@
 
 $(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_NETMAP, 
$(P_XT)xt_NETMAP, ge 3.7.0))
 $(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_NETMAP, 
$(P_V4)ipt_NETMAP, lt 3.7.0))
+$(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_NETMAP, 
$(P_V6)ip6t_NETMAP, lt 3.7.0))
 $(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_REDIRECT, 
$(P_XT)xt_REDIRECT, ge 3.7.0))
 $(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_REDIRECT, 
$(P_V4)ipt_REDIRECT, lt 3.7.0))
+$(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_REDIRECT, 
$(P_V4)ip6t_REDIRECT, lt 3.7.0))
 
 
 # nathelper

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


Re: [OpenWrt-Devel] [PATCH] [RFC] Add IPv6 NAT modules

2013-05-14 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

> The attached patch adds these modules to OpenWRT. I have tested
> MASQUERADE, SNAT and REDIRECT, NPT can be at least configured.

NETMAP works fine as well, NPT does not work for me. This is not a
problem of OpenWRT though, just the NPT support is broken in the 3.8
kernel. This commit should fix it

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=906b1c394d0906a154fbdc904ca506bceb515756

but since 3.8 won't see more stable updates you either need to import
that patch or wait for 3.9 for it to work.

Bernhard

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


[OpenWrt-Devel] We are seeking bandwith per user configuration

2013-05-14 Thread Oguz Ersoz

dear developers

we seek some one to configure OpenWRT to
basic queue list and
limit each users DL UL for mac address
if any one able to do it please get in touch with me
example 3 user is enough for us

user1   AA-AA-AA-B2-DA-08DL=4000  UL=400
user2AA-AA-AA-B2-DA-09DL=1000  UL=100
user3AA-AA-AA-B2-DA-10DL=512  UL=50





Atilla Oguz Ersoz







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


[OpenWrt-Devel] rt2800 eeprom endianness

2013-05-14 Thread Matti Laakso

Hi,

I've been debugging wifi on a couple of Lantiq units, Easybox 802 and 
803, both with Ralink wireless (RT2860 and RT3062, respectively). It 
seems that rt2x00_eeprom_read function expects EEPROM to be 
little-endian, whereas on these units it is stored big-endian in flash. 
As a result wireless does not work (well, it miraculously works on 802, 
but unoptimally).


I tried to simply patch the 10-rt2x00-eeprom hotplug script to use dd's 
conv=swab when copying the EEPROM, but dd in OpenWrt doesn't support it. 
What would be the best place to do the byte swapping? Maybe a variable 
int swab = 1 in rt2x00 platform_data and a function which does the swap 
when passing the EEPROM to the driver?


Best regards,
Matti Laakso
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Attitude Adjustment (r36608) Configuration config problems

2013-05-14 Thread cmsv
I have encountered the following problems while compiling images:

After make kernel menuconfig i was i not able to fully revert the
changes with svn revert -R target/linux/ and even tho svn diff
target/linux/ does not output anything some previous selected options
still persist when doing make menuconfig and i am unable to revert them
even after doing make defconfig.
Only make distclean solved the issue

When adding my own templates to the final image and placing them inside
 /files/ the only ones the image ends up by being
compiled with, are /files/bin. All the other files in
/files/etc and so on do not get added.
I thought it had to do with file permissions but they are the same as
the ones i have with an older buildroot.
All files have the shell user's permissions.


I also have a question regarding the use of custom templates.
By trial and error i noticed that i cannot use the following
configuration files for all my images

- wireless
- network
- system

The reason being is for example that the network configuration file for
a dlink is not fully the same as for example tp-link.
Having any of these  config files in /files/config/ will
eventually "brick" routers that for example have a different switch
configuration; will fail working properly for wireless and have
functioning problems with system.

These files exist in /package/base-files/files/etc/ and
while building the image they get merged with the specifics of the hardware.
My question is if we can have the same "merging" task done while having
/files/ .

For example; having the network file in /files/config/network with all the settings we need which then will
be merged with the switch specifics of the hardware that it is being
compiled for.






-- 





Site: http://wirelesspt.net
Mesh: http://tinyurl.com/wirelesspt
Admin: http://wirelesspt.net/wiki/Cmsv
Twitter: http://twitter.com/wirelesspt
Suporte técnico via sms: 91 19 11 798
Donativos/Paypal: http://tinyurl.com/doar-verba
Chave publica PGP/SSH: http://wirelesspt.net/arquivos/pk
Email assinado digitalmente pelo emissor assegurando autenticidade



0x782BF73E.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] unbound bump to 1.4.20 and add uci support

2013-05-14 Thread Adam Gensler
Hi Stepan,

Thanks for the feedback. See my comments inline with [adam]:

On May 14, 2013, at 8:00 AM, Stepan Henek  wrote:

> Hello Adam,
> 
> we were implementing the same thing as you were (ucifying unbound).
> We put less uci attributes in our config files, so in this way our version is 
> more advanced.


[adam] Any chance I could see the version you put together? I struggled with 
the best way to handle certain aspects of the config. Perhaps you have done it 
a better way?


> 
> But there are also some things which you might want to consider:
> 
> 1) reload() function is missing in your init script
> I thing that calling stop() and start() functions flushes the cache of the 
> server which is something what you don't want when you want just reload the 
> configuration (e.g. when you are adding a zone).
> We used something like this:
> reload() {
> 
> mkdir -p $(dirname "$CONFIGFILE")
> 
> init_unbound
> 
> local pidfile
> config_get pidfile server pidfile
> 
> if [ -f "$pidfile" ] ; then
> kill -HUP $(cat "$pidfile")
> fi
> }


[adam] I tried this and ran into two problems:

1. I'm running unbound as a non-root user. So in this regard, reloading unbound 
fails because the "unbound" user is not privileged to open ports, etc.

2. Using the "-c /path/to/config" option doesn't seem to be compatible with 
-HUP signal. When I sent -HUP to unbound it complained that it couldn't find 
/etc/unbound/unbound.conf, which is not the config I was using. Again, this may 
be because unbound drops privileges.


> 
> 2) You are using just a single "include" parameter
> > add_param "$cfg" "include"
> I thing It would be better to include more than a single config path using 
> e.g.
> So options such as:
> > config unbound server
> >list include_path "/etc/unbound/zone1.conf" 
> >list include_path "/etc/unbound/zone2.conf"
> Are translated to
> > include: "/etc/unbound/zone1.conf" 
> > include: "/etc/unbound/zone2.conf"


[adam] I didn't get the impression from the unbound.conf man page that more 
than one include statement was allowed. Perhaps that was just an oversight with 
how I read it. This is a trivial change.


> 
> Our goal is to have ucified unbound in the mainstream, so we could try to 
> push it as well.
> 
> Cheers,
> Stepan
> 
> > Has anyone had a chance to look at this patch? If adjustments are needed 
> > please let me know and I'll work on getting them in.
> > 
> > Thanks!
> > Adam
> > 
> > 
> > On May 6, 2013, at 10:44 PM, Adam Gensler  
> > wrote:
> > 
> > > The following patch does these things:
> > > 
> > > 1. bumps unbound to version 1.4.20.
> > > 
> > > 2. adds uci support via /etc/config/unbound. The entirety of unbound.conf 
> > > has been implemented here.
> > > 
> > > 3. removes the existing patch which applied a memory optimized config to 
> > > /etc/unbound/unbound.conf. This has been migrated to /etc/config/unbound 
> > > as "option lowmem '1'" under "config server". This is the default. 
> > > Disabling "lowmem" opens up the relevant parameters for individual 
> > > tuning, if desired.
> > > 
> > > 4. The other portions of the existing /etc/unbound/unbound.conf have been 
> > > migrated to the default /etc/config/unbound, yielding the same operation.
> > > 
> > > 5. The old /etc/unbound/unbound.conf has been renamed to 
> > > /etc/unbound/unbound.conf.example to avoid confusion.
> > > 
> > > This is my first attempt at a uci configuration port. Any feedback and/or 
> > > suggestions are greatly appreciated.
> > > 
> > > Signed-off-by: Adam Gensler 
> > > ---
> > > 
> > > 
> > > Index: net/unbound/files/unbound.init
> > > ===
> > > --- net/unbound/files/unbound.init(revision 36569)
> > > +++ net/unbound/files/unbound.init(working copy)
> > > @@ -1,14 +1,355 @@
> > > #!/bin/sh /etc/rc.common
> > > -#Copyright (C) 2010 Ondrej Caletka 
> > > -START=61
> > > +# Copyright (C) 2007-2013 OpenWrt.org
> > > 
> > > -start () {
> > > -unbound
> > > +START=60
> > > +
> > > +SERVICE_USE_PID=1
> > > +
> > > +CONFIGFILE="/var/etc/unbound.conf"
> > > +
> > > +writeconf() {
> > > +local opt="$1"
> > > +local val="$2"
> > > +local extra="$3"
> > > +
> > > +# wrap values with spaces or / in quotes
> > > +if [ `echo $val | grep -c "[.[:space:]/]"` -gt 0 ]; then
> > > +val="\"$val\""
> > > +fi
> > > +
> > > +if [ -z "$val" ]; then
> > > +echo "${opt}: ${val} ${extra}" >> $CONFIGFILE
> > > +else
> > > +echo "${opt}: ${val} ${extra}" >> $CONFIGFILE
> > > +fi
> > > }
> > > 
> > > -stop () {
> > > -PIDFILE='/var/run/unbound.pid'
> > > -if [ -f $PIDFILE ] ; then
> > > -kill $(cat $PIDFILE)
> > > +add_bool() {
> > > +local section="$1"
> > > +local option="$2"
> > > +
> > > +if [ -z "$3" ]; then
> > > +local config="$2"
> > > +else
> > > +local config="$3"
> > > fi
> > > +
> > > +conf

Re: [OpenWrt-Devel] [PATCH] unbound bump to 1.4.20 and add uci support

2013-05-14 Thread Adam Gensler
Hello,

That is a good point, I can adjust the Makefile to not install the example 
config.

I have a question, how did you handle root.key? On my device, a Netgear 
WNDR3800, the clock is not saved between reboots. If the image is freshly 
installed and root.key hasn't been populated, unbound sometimes fails to update 
root.key if the NTP sync has not happened yet. Have you encountered this?

Adam


On May 14, 2013, at 4:59 AM, Martin Strbačka  wrote:

> Hello,
> 
> We just made the same thing (patches for uci support) in our company and I 
> wanted to send our patches. At a first look, it looks almost the same as our 
> approach. Just one thing - maybe you should remove the unbound.conf.example 
> file. OpenWRT wants to be very tiny, so there is no place for man pages or 
> even example configs. And if we have uci support, than the standard conf file 
> is almost useless, at least from my point of view.
> 
> With regards,
> Martin Strbacka
> ___
> 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] [PATCH] package/kernel/modules/usb.mk: add USB monitor

2013-05-14 Thread Xiangfu
---
 package/kernel/modules/usb.mk |   15 +++
 1 file changed, 15 insertions(+)

diff --git a/package/kernel/modules/usb.mk b/package/kernel/modules/usb.mk
index 9548c02..c5bc03a 100644
--- a/package/kernel/modules/usb.mk
+++ b/package/kernel/modules/usb.mk
@@ -36,6 +36,21 @@ define AddDepends/usb
 endef
 
 
+define KernelPackage/usb-mon
+  TITLE:=USB Monitor
+  KCONFIG:=CONFIG_USB_MON
+  FILES:=$(LINUX_DIR)/drivers/usb/mon/usbmon.ko
+  AUTOLOAD:=$(call AutoLoad,51,usbmon)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-mon/description
+  Kernel support for USB Monitor
+endef
+
+$(eval $(call KernelPackage,usb-mon))
+
+
 define KernelPackage/usb-gadget
   TITLE:=USB Gadget support
   KCONFIG:=CONFIG_USB_GADGET
-- 
1.7.9.5

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