[OpenWrt-Devel] [PATCH 1/3] kernel-3.14: backport UBI block support

2014-05-12 Thread Daniel Golle
Signed-off-by: Daniel Golle dan...@makrotopia.org

 create mode 100644 
target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
 create mode 100644 
target/linux/generic/patches-3.14/491-UBI-block-do-not-use-term-attach.patch
 create mode 100644 
target/linux/generic/patches-3.14/492-UBI-block-Mark-init-only-symbol-as-__initdata.patch
 create mode 100644 
target/linux/generic/patches-3.14/493-UBI-block-Use-u64-for-the-64-bit-dividend.patch
 create mode 100644 
target/linux/generic/patches-3.14/494-UBI-rename-block-device-ioctls.patch
 create mode 100644 
target/linux/generic/patches-3.14/495-UBI-block-Remove-__initdata-from-ubiblock_param_ops.patch
 create mode 100644 
target/linux/generic/patches-3.14/496-UBI-avoid-workqueue-format-string-leak.patch
 create mode 100644 
target/linux/generic/patches-3.14/497-UBI-make-UBI_IOCVOLCRBLK-take-a-parameter-for-future.patch

diff --git 
a/target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
 
b/target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
new file mode 100644
index 000..50e9e2f
--- /dev/null
+++ 
b/target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
@@ -0,0 +1,847 @@
+From 9d54c8a33eec78289b1b3f6e10874719c27ce0a7 Mon Sep 17 00:00:00 2001
+From: Ezequiel Garcia ezequiel.gar...@free-electrons.com
+Date: Tue, 25 Feb 2014 13:25:22 -0300
+Subject: [PATCH] UBI: R/O block driver on top of UBI volumes
+
+This commit introduces read-only block device emulation on top of UBI volumes.
+
+Given UBI takes care of wear leveling and bad block management it's possible
+to add a thin layer to enable block device access to UBI volumes.
+This allows to use a block-oriented filesystem on a flash device.
+
+The UBI block devices are meant to be used in conjunction with any
+regular, block-oriented file system (e.g. ext4), although it's primarily
+targeted at read-only file systems, such as squashfs.
+
+Block devices are created upon user request through new ioctls:
+UBI_IOCVOLATTBLK to attach and UBI_IOCVOLDETBLK to detach.
+Also, a new UBI module parameter is added 'ubi.block'. This parameter is
+needed in order to attach a block device on boot-up time, allowing to
+mount the rootfs on a ubiblock device.
+For instance, you could have these kernel parameters:
+
+  ubi.mtd=5 ubi.block=0,0 root=/dev/ubiblock0_0
+
+Or, if you compile ubi as a module:
+
+  $ modprobe ubi mtd=/dev/mtd5 block=/dev/ubi0_0
+
+Artem: amend commentaries and massage the patch a little bit.
+
+Signed-off-by: Ezequiel Garcia ezequiel.gar...@free-electrons.com
+Signed-off-by: Artem Bityutskiy artem.bityuts...@linux.intel.com
+---
+ drivers/mtd/ubi/Kconfig |  15 +
+ drivers/mtd/ubi/Makefile|   1 +
+ drivers/mtd/ubi/block.c | 646 
+ drivers/mtd/ubi/build.c |  11 +
+ drivers/mtd/ubi/cdev.c  |  20 ++
+ drivers/mtd/ubi/ubi.h   |  14 +
+ include/uapi/mtd/ubi-user.h |  11 +
+ 7 files changed, 718 insertions(+)
+ create mode 100644 drivers/mtd/ubi/block.c
+
+diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig
+index 36663af..783fb18 100644
+--- a/drivers/mtd/ubi/Kconfig
 b/drivers/mtd/ubi/Kconfig
+@@ -87,4 +87,19 @@ config MTD_UBI_GLUEBI
+  work on top of UBI. Do not enable this unless you use legacy
+  software.
+ 
++config MTD_UBI_BLOCK
++  bool Read-only block devices on top of UBI volumes
++  default n
++  help
++ This option enables read-only UBI block devices support. UBI block
++ devices will be layered on top of UBI volumes, which means that the
++ UBI driver will transparently handle things like bad eraseblocks and
++ bit-flips. You can put any block-oriented file system on top of UBI
++ volumes in read-only mode (e.g., ext4), but it is probably most
++ practical for read-only file systems, like squashfs.
++
++ When selected, this feature will be built in the UBI driver.
++
++ If in doubt, say N.
++
+ endif # MTD_UBI
+diff --git a/drivers/mtd/ubi/Makefile b/drivers/mtd/ubi/Makefile
+index b46b0c97..4e3c3d7 100644
+--- a/drivers/mtd/ubi/Makefile
 b/drivers/mtd/ubi/Makefile
+@@ -3,5 +3,6 @@ obj-$(CONFIG_MTD_UBI) += ubi.o
+ ubi-y += vtbl.o vmt.o upd.o build.o cdev.o kapi.o eba.o io.o wl.o attach.o
+ ubi-y += misc.o debug.o
+ ubi-$(CONFIG_MTD_UBI_FASTMAP) += fastmap.o
++ubi-$(CONFIG_MTD_UBI_BLOCK) += block.o
+ 
+ obj-$(CONFIG_MTD_UBI_GLUEBI) += gluebi.o
+diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
+new file mode 100644
+index 000..cea7d1c
+--- /dev/null
 b/drivers/mtd/ubi/block.c
+@@ -0,0 +1,646 @@
++/*
++ * Copyright (c) 2014 Ezequiel Garcia
++ * Copyright (c) 2011 Free Electrons
++ *
++ * Driver parameter handling strongly based on drivers/mtd/ubi/build.c
++ *   Copyright (c) International Business Machines Corp., 2006
++ *   Copyright (c) Nokia Corporation, 2007

[OpenWrt-Devel] [PATCH 3/3] fstools: support ubifs overlay

2014-05-12 Thread Daniel Golle
Signed-off-by: Daniel Golle dan...@makrotopia.org

diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index 826f77d..e052552 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fstools
-PKG_VERSION:=2014-04-17
+PKG_VERSION:=2014-05-13
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://nbd.name/fstools.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=fe222812cc12d37647fbb8667851eb005ea95331
+PKG_SOURCE_VERSION:=a9e8236cde8c9b4784e4c91b23a2ba006e727f6a
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 CMAKE_INSTALL:=1
 
-- 
1.9.2



pgpgcsbJdqzaH.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 16/30][ WRT1900AC ] mamba mvebu: sysupgrade support for mamba + dual boot

2014-05-10 Thread Daniel Golle
Hi!

On 05/10/2014 06:45 PM, Marek Lindner wrote:
 On Saturday 10 May 2014 16:38:42 Karl P wrote:
 On 05/10/2014 10:53 AM, Marek Lindner wrote:
 On Friday 09 May 2014 14:11:32 Karl Palsson wrote:
 I understand how it works in general, John was nacking the support as it
 duplicated existing functionality.  I was asking more about this existing
 functionality within openwrt for supporting dual firmware images.  I
 wasn't
 aware of any existing functionality for this.

 Check target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh. All OpenMesh
 boards provide exactly this kind of upgrade behavior.

 Which of course begs the question why it's buried in openmesh support code
 :)
 
 Feel free to 'liberate' the code any way you see fit. I would not know how to 
 abstract this code in a meaningful way, so it could be re-used elsewhere but 
 I 
 am certainly willing to review your patches on that matter.
I also implemented this for the ALL0258N in r28700, later added the necessary
abstraction to at least support all the similar Allnet devices within the same
script. When I saw the OM2P support was merged, I wasn't that happy to see a 90%
copy of an already ugly vendor-specific hack occupying flash-space on *all*
ar71xx-based devices... (ugly because the uImage header already got a checksum,
and if already start hacking on the bootloader, they could have implemented FIT
or alike)

Anyway, we are far from having decent U-Boot source coverage on ar71xx to
replace the affected bootloaders, so we'll have to deal with it. It should be
possible to further generalize the two existing scripts into one.
I'd be happy to provide assistance and code review in that matter. However, I do
not have time to work on this, nor casual access to testing devices which might
end up bricked and need recovery via serial...


Cheers


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


[OpenWrt-Devel] [PATCH 3/3] uboot-envtools: add support for oxnas target

2014-04-02 Thread Daniel Golle
Signed-off-by: Daniel Golle daniel.go...@gmail.com
---
 package/boot/uboot-envtools/Makefile|  4 
 package/boot/uboot-envtools/files/oxnas | 28 
 2 files changed, 32 insertions(+)
 create mode 100644 package/boot/uboot-envtools/files/oxnas

diff --git a/package/boot/uboot-envtools/Makefile 
b/package/boot/uboot-envtools/Makefile
index 631032c..5f27268 100644
--- a/package/boot/uboot-envtools/Makefile
+++ b/package/boot/uboot-envtools/Makefile
@@ -81,6 +81,10 @@ ifneq ($(CONFIG_TARGET_mxs),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
 endif
+ifneq ($(CONFIG_TARGET_oxnas),)
+   $(INSTALL_DIR) $(1)/etc/uci-defaults
+   $(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools
+endif
 ifneq ($(CONFIG_TARGET_ramips),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
diff --git a/package/boot/uboot-envtools/files/oxnas 
b/package/boot/uboot-envtools/files/oxnas
new file mode 100644
index 000..425855c
--- /dev/null
+++ b/package/boot/uboot-envtools/files/oxnas
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ]  exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/oxnas.sh
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(oxnas_board_name)
+
+case $board in
+stg-212)
+   ubootenv_add_uci_config /dev/mtd0 0x3c 0x2 0x2 1
+   ;;
+kd20)
+   ubootenv_add_uci_config /dev/mtd0 0x22 0x02000 0x2 1
+   ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
-- 
1.9.0



pgpz2D2t_pOiB.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] allow including FIT kernel image only on device-tree targets

2013-11-22 Thread Daniel Golle
---
 config/Config-images.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/Config-images.in b/config/Config-images.in
index a744fc7..194130f 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -184,6 +184,7 @@ menu Target Images
 
config TARGET_ROOTFS_INCLUDE_FIT
bool include FIT if TARGET_ROOTFS_INCLUDE_KERNEL
+   depends on USES_DEVICETREE  (TARGET_ROOTFS_UBIFS || 
TARGET_ROOTFS_EXT4FS)
default y
help
  This option might not apply to all targets. Make sure
-- 
1.8.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] use kernel 3.12.1 for targets already on 3.12

2013-11-22 Thread Daniel Golle
also add MD5 sum for 3.12.1
---
 include/kernel-version.mk   | 3 +++
 target/linux/mxs/Makefile   | 2 +-
 target/linux/omap/Makefile  | 2 +-
 target/linux/sunxi/Makefile | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 91752e0..8946fe1 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -20,6 +20,9 @@ endif
 ifeq ($(LINUX_VERSION),3.10.18)
   LINUX_KERNEL_MD5SUM:=e091753da622788cfd662dd67c2f9b48
 endif
+ifeq ($(LINUX_VERSION),3.12.1)
+  LINUX_KERNEL_MD5SUM:=f6f34baf553f278ff4637d8eaeff5dcd
+endif
 
 # disable the md5sum check for unknown kernel versions
 LINUX_KERNEL_MD5SUM?=x
diff --git a/target/linux/mxs/Makefile b/target/linux/mxs/Makefile
index d2d612d..f8c8a20 100644
--- a/target/linux/mxs/Makefile
+++ b/target/linux/mxs/Makefile
@@ -13,7 +13,7 @@ FEATURES:=ext4 rtc usb gpio
 CPU_TYPE:=arm926ej-s
 
 MAINTAINER:=Zoltan HERPAI wigy...@uid0.hu
-LINUX_VERSION:=3.12
+LINUX_VERSION:=3.12.1
 KERNELNAME:=zImage dtbs
 
 define Target/Description
diff --git a/target/linux/omap/Makefile b/target/linux/omap/Makefile
index dcab026..669f1ec 100644
--- a/target/linux/omap/Makefile
+++ b/target/linux/omap/Makefile
@@ -13,7 +13,7 @@ FEATURES:=usb targz audio display
 CPU_TYPE:=cortex-a9
 CPU_SUBTYPE:=vfpv3
 
-LINUX_VERSION:=3.12
+LINUX_VERSION:=3.12.1
 
 MAINTAINER:=Imre Kaloz ka...@openwrt.org
 
diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile
index 658de40..9d1a257 100644
--- a/target/linux/sunxi/Makefile
+++ b/target/linux/sunxi/Makefile
@@ -15,7 +15,7 @@ CPU_TYPE:=cortex-a8
 CPU_SUBTYPE:=vfpv3
 MAINTAINER:=Zoltan HERPAI wigy...@uid0.hu
 
-LINUX_VERSION:=3.12
+LINUX_VERSION:=3.12.1
 KERNELNAME:=zImage dtbs
 DEFAULT_PACKAGES += uboot-envtools uboot-sunxi
 
-- 
1.8.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] target.mk: add default packages for NAS device-type

2013-11-21 Thread Daniel Golle
---
 include/target.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/target.mk b/include/target.mk
index 467ef35..a835512 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -13,6 +13,8 @@ DEVICE_TYPE?=router
 
 # Default packages - the really basic set
 DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd
+# For nas targets
+DEFAULT_PACKAGES.nas:=block-mount fdisk hdparm lvm2 lsblk mdadm e2fsprogs 
badblocks resize2fs tune2fs dosfsck dosfslabel mkdosfs
 # For router targets
 DEFAULT_PACKAGES.router:=dnsmasq iptables ip6tables ppp ppp-mod-pppoe 
kmod-ipt-nathelper firewall 6relayd odhcp6c
 DEFAULT_PACKAGES.bootloader:=
-- 
1.8.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: add more missing symbols for 3.12

2013-11-21 Thread Daniel Golle
---
 target/linux/generic/config-3.12 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/generic/config-3.12 b/target/linux/generic/config-3.12
index cd6429b..b16720c 100644
--- a/target/linux/generic/config-3.12
+++ b/target/linux/generic/config-3.12
@@ -3027,6 +3027,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
 # CONFIG_SENSORS_GSC is not set
 # CONFIG_SENSORS_HDAPS is not set
 # CONFIG_SENSORS_HIH6130 is not set
+# CONFIG_SENSORS_HTU21 is not set
 # CONFIG_SENSORS_HMC5843 is not set
 # CONFIG_SENSORS_HTU21 is not set
 # CONFIG_SENSORS_I5K_AMB is not set
@@ -3094,6 +3095,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
 # CONFIG_SENSORS_TMP421 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_SENSORS_TSL2563 is not set
+# CONFIG_SENSORS_VEXPRESS is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_VIA_CPUTEMP is not set
 # CONFIG_SENSORS_VT1211 is not set
@@ -3343,6 +3345,7 @@ CONFIG_SND_USB=y
 # CONFIG_SND_USB_6FIRE is not set
 # CONFIG_SND_USB_AUDIO is not set
 # CONFIG_SND_USB_CAIAQ is not set
+# CONFIG_SND_USB_HIFACE is not set
 # CONFIG_SND_USB_UA101 is not set
 # CONFIG_SND_USB_US122L is not set
 # CONFIG_SND_USB_USX2Y is not set
-- 
1.8.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel/modules: set DM_SWITCH=n in kmod-dm

2013-11-21 Thread Daniel Golle
Kconfig asks for
  Switch target support (EXPERIMENTAL) (DM_SWITCH) [N/m/?] (NEW)
and waits for user input which breaks automated builds when using
kernel 3.12.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 package/kernel/linux/modules/block.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kernel/linux/modules/block.mk 
b/package/kernel/linux/modules/block.mk
index 8a84aa4..7b6ef06 100644
--- a/package/kernel/linux/modules/block.mk
+++ b/package/kernel/linux/modules/block.mk
@@ -221,6 +221,7 @@ define KernelPackage/dm
CONFIG_DM_MULTIPATH=n \
CONFIG_DM_ZERO=n \
CONFIG_DM_SNAPSHOT=n \
+   CONFIG_DM_SWITCH=n \
CONFIG_DM_LOG_USERSPACE=n \
CONFIG_MD=y \
CONFIG_BLK_DEV_DM \
-- 
1.8.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel/modules: snd-pcm-dmaengine only if CONFIG_SND_DMAENGINE_PCM is set

2013-11-21 Thread Daniel Golle
Platforms without in-soc audio don't provide CONFIG_SND_DMAENGINE_PCM, thus
the module is not generated.
---
 package/kernel/linux/modules/sound.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/kernel/linux/modules/sound.mk 
b/package/kernel/linux/modules/sound.mk
index 4e1a656..bed2e3c 100644
--- a/package/kernel/linux/modules/sound.mk
+++ b/package/kernel/linux/modules/sound.mk
@@ -42,10 +42,10 @@ endif
 
 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.12.0)),1)
 SOUNDCORE_LOAD += \
-   snd-pcm-dmaengine
+   $(if $(CONFIG_SND_DMAENGINE_PCM),snd-pcm-dmaengine)
 
 SOUNDCORE_FILES += \
-   $(LINUX_DIR)/sound/core/snd-pcm-dmaengine.ko
+   $(if 
$(CONFIG_SND_DMAENGINE_PCM),$(LINUX_DIR)/sound/core/snd-pcm-dmaengine.ko)
 endif
 
 define KernelPackage/sound-core
-- 
1.8.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC] new target PLXTECH NAS782x (ox820, oxnas)

2013-11-15 Thread Daniel Golle
Hi!

Based on the patches to Kernel 3.12 and U-Boot available on
https://github.com/kref/
I botched-up an experimental OpenWrt oxnas target
https://gitorious.org/openwrt-oxnas/openwrt-oxnas

I got a MEDION NAS P89625 (MD 86517), apparently an OEM product based on the
ZyXEL/MitraStar STG-212 design which is now fully working (even including LEDs,
buttons and I2C).
http://wiki.openwrt.org/toh/medion/md86587

Most of target/oxnas/patches-3.12 can be consolidated by having
target/oxnas/files/ and only patch files outside of arch/arm/mach-oxnas --
however, as I want to keep this in sync with kref's kernel tree, I found it most
convenient/transparent to just use git format-patch to generate the whole
patchset and include it as-is in OpenWrt.
Also some work has to be done to build the EHCI driver as a module and push
whatever left platform code into DT.
Another obscurity is that gpio-button-hotplug doesn't trigger any hotplug events
while both buttons do work with input-gpio-keys-polled if I install that and
remove gpio-button-hotplug. What's the status of gpio-button-hotplug?
I also saw that only specific buttons are handled, i.e. the COPY button also
present on kirkwood (keycode 0x85) will not work with gpio-button-hotplug, but
the reset button should work.

Is anyone else interested in having support for the NAS782x target in OpenWrt?
How would you like things to be submitted to the mailinglist/patchwork?
(- have a look at the gitorious repo I created)


Cheers


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


[OpenWrt-Devel] [PATCH] kernel/modules: set DM_SWITCH=n in kmod-dm

2013-11-13 Thread Daniel Golle
Kconfig asks for
  Switch target support (EXPERIMENTAL) (DM_SWITCH) [N/m/?] (NEW)
and waits for user input which breaks automated builds when using
kernel 3.12.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 package/kernel/linux/modules/block.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/block.mk 
b/package/kernel/linux/modules/block.mk
index 8a84aa4..290c574 100644
--- a/package/kernel/linux/modules/block.mk
+++ b/package/kernel/linux/modules/block.mk
@@ -225,7 +225,8 @@ define KernelPackage/dm
CONFIG_MD=y \
CONFIG_BLK_DEV_DM \
CONFIG_DM_CRYPT \
-   CONFIG_DM_MIRROR
+   CONFIG_DM_MIRROR \
+   CONFIG_DM_SWITCH=n
   FILES:=$(LINUX_DIR)/drivers/md/dm-*.ko
   AUTOLOAD:=$(call AutoLoad,30,dm-mod dm-log dm-region-hash dm-mirror dm-crypt)
 endef
-- 
1.8.4.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] AR9344 wifi dying on WD N600 routers

2013-10-24 Thread Daniel Golle
Hi!

On 10/24/2013 12:17 PM, Steven Haigh wrote:
 Hi all,
 
 I've been trying to debug this for quite a while with little success.
 
 It seems that the AR9344 (2.4GHz side only) on the WD N600 routers is
 rather unstable. At random intervals, the 2.4GHz side of things
 completely stops passing traffic.
 
 Stations remain associated, however no data is processed.
I observed similar behaviour on other modern low-cost QCA WiSoC devices (such as
TL-WR841ND v8). My guess is that chip-specific things like dynamic
filter-adjustment or temperature compensation curves are missing or incorrect
for these modern chips.

I'd be happy if someone with access to QCA datasheets can verify that ath9k does
things right on these chips.


Cheers


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


Re: [OpenWrt-Devel] [PATCH] ar71xx: Fix sysupgrades for Allnet and OpenMesh devices

2013-10-17 Thread Daniel Golle
Hi Sven,

thank you for addressing that issue!

On 10/17/2013 06:42 PM, Sven Eckelmann wrote:
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh
 index 9a375ff..8076fbd 100644
 --- a/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh
 @@ -7,6 +7,7 @@
  platform_add_ramfs_ubootenv() {
   [ -e /usr/sbin/fw_printenv ]  install_bin /usr/sbin/fw_printenv 
 /usr/sbin/fw_setenv
   [ -e /etc/fw_env.config ]  install_file /etc/fw_env.config
 + [ -e /bin/mkdir ]  install_bin /bin/mkdir /bin/mkdir
mkdir is a link to busybox. wouldn't it be better to just add that symlink to
the list of busybox symlinks in
/package/base-files/files/lib/upgrade/common.sh
or even better: why not just
mkdir -p $RAM_ROOT/var/lock
and not even use mkdir inside the ramdisk?


  }
  append sysupgrade_pre_upgrade platform_add_ramfs_ubootenv
  
 @@ -151,6 +152,10 @@ rootfs_size $rootfs_hexsize
  rootfs_checksum $rootfs_md5
  bootcmd bootm $vmlinux_hexaddr
  EOF
 +
 + # fw_setenv needs the lock /var/lock/fw_setenv.lock
 + mkdir -p /var/lock/
 +
This part would then be unneeded if $RAM_ROOT/var/lock is created before
chroot'ing into the ramdisk.

   fw_setenv -s /tmp/fw_env_upgrade || {
   echo failed to update U-Boot environment
   return 1
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
 index 5179875..7b82180 100644
 --- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh

Same applies here, of course.



Cheers


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


[OpenWrt-Devel] [PATCH] uboot-envtools: add config for the ALFA NETWORKS Hornet-UB (AP121U)

2013-07-17 Thread Daniel Golle
Signed-off-by: Daniel Golle daniel.go...@gmail.com
---
 package/boot/uboot-envtools/files/ar71xx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx 
b/package/boot/uboot-envtools/files/ar71xx
index 1803a9f..3e076cb 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -16,6 +16,7 @@ board=$(ar71xx_board_name)
 case $board in
 all0258n | \
 cap4200ag | \
+hornet-ub | \
 mr600 | \
 mr600v2)
ubootenv_add_uci_config /dev/mtd1 0x0 0x1 0x1
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


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 dgo...@allnet.de
Schulungs-/Veranstaltungsprogramm: http://www.802lab.dehttp://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] Using JTAG on a new Ralink board

2013-04-16 Thread Daniel Golle
On 04/16/2013 06:54 PM, Drasko DRASKOVIC wrote:
 The closest I got is 8Devices' Carambola u-boot, as they have probably
 demanded sources from Ralink : https://github.com/8devices/u-boot

 I can see in the code rt2880_config, but Carambola has RT3050 and uses
 this U-Boot, so there is a goot chacnce that it can work on RT5350
 also.
8devices/u-boot are the complete U-Boot sources taken from Ralink SDK, I checked
it and it got support for all Ralink SoCs up to Rt5350. Compiling it with
OpenWrt's toolchain works.
It comes with a menuconfig script which allows you to comfortably setup SoC
type, flash type, flash size and switch-port-configuration which is apparently
all you need to get it working.


Have fun!


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


[OpenWrt-Devel] [PATCH 1/2] [ramips] introduce DTS for ALL5003

2013-04-14 Thread Daniel Golle
Prior to the switch to 3.8, ALL5002 and ALL5003 boards shared mach-all5002.c.
With the change to DTS, this is no longer accurate, as ALL5002 is based on
Rt3352 SoC while ALL5003 is based on Rt5350 SoC, therefore the corresponding
rt5350.dtsi need to be included for ALL5003.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/ramips/dts/ALL5003.dts

diff --git 
a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 5915a02..206d774 100644
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -58,6 +58,7 @@ case $FIRMWARE in
all0239-3g | \
all0256n | \
all5002 | \
+   all5003 | \
argus-atp52b | \
bc2 | \
br6425 | \
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network 
b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index e28f2b5..6e95368 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -41,6 +41,7 @@ ramips_setup_interfaces()
w150m | \
all0256n | \
all5002 | \
+   all5003 | \
broadway | \
wnce2001)
ucidef_add_switch switch0 1 0
diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac 
b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
index 52bf115..0b517d3 100644
--- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
+++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
@@ -51,6 +51,7 @@ preinit_set_mac_address() {
all0239-3g |\
all0256n |\
all5002 |\
+   all5003 |\
carambola |\
dir-615-h1 |\
fonera20n |\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 37b477a..aba983e 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -48,9 +48,12 @@ ramips_board_detect() {
*Allnet ALL0256N)
name=all0256n
;;
-   *Allnet ALL5002/ALL5003)
+   *Allnet ALL5002)
name=all5002
;;
+   *Allnet ALL5003)
+   name=all5003
+   ;;
*ARC FreeStation5)
name=freestation5
;;
@@ -206,7 +209,7 @@ ramips_board_detect() {
;;
*UR-326N4G Wireless N router)
name=ur-326n4g
-   ;;
+   ;;
*UR-336UN Wireless N router)
name=ur-336un
;;
@@ -222,7 +225,7 @@ ramips_board_detect() {
esac
 
case $machine in
-   *Allnet ALL5002/ALL5003)
+   *Allnet ALL500[23]*)
all500x_board_detect
;;
esac
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index ef15044..f62d809 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -22,6 +22,7 @@ platform_check_image() {
all0239-3g | \
all0256n | \
all5002 | \
+   all5003 | \
bc2 | \
broadway | \
carambola | \
diff --git a/target/linux/ramips/dts/ALL5002.dts 
b/target/linux/ramips/dts/ALL5002.dts
index fb704f3..0ede2e3 100644
--- a/target/linux/ramips/dts/ALL5002.dts
+++ b/target/linux/ramips/dts/ALL5002.dts
@@ -4,7 +4,7 @@
 
 / {
compatible = ALL5002, ralink,rt3352-soc;
-   model = Allnet ALL5002/ALL5003;
+   model = Allnet ALL5002;
 
palmbus@1000 {
sysc@0 {
diff --git a/target/linux/ramips/dts/ALL5003.dts 
b/target/linux/ramips/dts/ALL5003.dts
new file mode 100644
index 000..581304e
--- /dev/null
+++ b/target/linux/ramips/dts/ALL5003.dts
@@ -0,0 +1,108 @@
+/dts-v1/;
+
+/include/ rt5350.dtsi
+
+/ {
+   compatible = ALL5003, ralink,rt5350-soc;
+   model = Allnet ALL5003;
+
+   palmbus@1000 {
+   sysc@0 {
+   ralink,pinmux = spi, uartlite, jtag, mdio, 
sdram, rgmii;
+   ralink,gpiomux = i2c;
+   ralink,uartmux = gpio;
+   ralink,wdtmux = 1;
+   };
+
+   gpio0: gpio@600 {
+   status = okay;
+   };
+
+   spi@b00 {
+   status = okay;
+   m25p80@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = mx25l25635e;
+   reg = 0 0;
+   linux,modalias = m25p80, mx25l25635e;
+   spi-max-frequency = 1000

[OpenWrt-Devel] [PATCH 2/2] [ramips] remove now unneeded user-space board detection

2013-04-14 Thread Daniel Golle
Now that ALL5002 and ALL5003 each got their own DTS and board names, remove
the now no longer needed user-space part which previously differentiated between
ALL5002 and ALL5003.

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index aba983e..4fedbad 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -6,20 +6,6 @@
 RAMIPS_BOARD_NAME=
 RAMIPS_MODEL=
 
-all500x_board_detect() {
-   local systype
-
-   systype=$(awk 'BEGIN{FS=[ \t]+:[ \t]} /system type/ {print $2}' 
/proc/cpuinfo)
-   case $systype in
-   *RT5350*)
-   RAMIPS_MODEL=Allnet ALL5003
-   ;;
-   *RT3352*)
-   RAMIPS_MODEL=Allnet ALL5002
-   ;;
-   esac
-}
-
 ramips_board_detect() {
local machine
local name
@@ -224,12 +210,6 @@ ramips_board_detect() {
;;
esac
 
-   case $machine in
-   *Allnet ALL500[23]*)
-   all500x_board_detect
-   ;;
-   esac
-
[ -z $RAMIPS_BOARD_NAME ]  RAMIPS_BOARD_NAME=$name
[ -z $RAMIPS_MODEL ]  RAMIPS_MODEL=$machine
 
-- 
1.8.2

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


Re: [OpenWrt-Devel] Using JTAG on a new Ralink board

2013-04-08 Thread Daniel Golle
Hi!

On 04/09/2013 12:38 AM, jonsm...@gmail.com wrote:
 Does the MIPS u-boot in the OpenWRT tree run on the RT5350? If so,

U-Boot for Ralink chips is not (yet) part of OpenWrt, however, you can compile
it from the sources on
https://github.com/8devices/u-boot

Flashing the boards via JTAG will require you to initialize some registers of
the SoC (at least SDRAM configuration, so you can load U-Boot into the ram and
flash using U-Boot).
OpenOCD contains code for some Atheros SoCs, that should be useful to get an
impression of what needs to be done to support other type of MIPS SoCs.


Good luck!


Daniel

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


Re: [OpenWrt-Devel] Using JTAG on a new Ralink board

2013-04-08 Thread Daniel Golle
On 04/09/2013 01:24 AM, Drasko DRASKOVIC wrote:
 I am missing some more flash though. 8MB is just enough, but it seems
 like RT5350 chipset does not support more.

NACK. We got Rt5350 boards with 32MB NOR (ALL5003, Art.Nr.92763).
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] integrate torrent source distribution in Makefiles?

2013-03-13 Thread Daniel Golle
Hi!

Today I dreamed about using mktorrent and aria2 to improve the source-code
distribution situation and be more prone to mirror downtimes.
Dynamically generating a torrent bundle for each source-package could be another
Make target or even part of the update target (i.e. generate the torrent file,
set web-seed HTTP mirrors)... Maybe even patching magnet URLs into the package
Makefiles :)
Getting download.pl to probe for torrent files in the package directory or use
magnet-URLs on use some text-mode torrent client should also not be too
difficult, then preferably running single background process handling all
downloads and seeding in parallel.

What are your preferences regarding the integration into the Makefile voodoo?
I imagine it as an experimental feature, selectable in menuconfig, in my wildest
dreams the torrent-client integration could even be modular and allow the user
to choose the torrent-client implementation she likes.

Ideas? Hints?


Cheers


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


[OpenWrt-Devel] [PATCH] [lantiq] fix USB-enable GPIO and use default PCI configuration for now

2013-03-12 Thread Daniel Golle
EEPROM is an actial serial EEPROM on the WiFi module, therefore we can remove
ralink_eep from the dts.
USB power-enable GPIO turned out to be GPIO #3 (found via probing/brute-force).
PCI works with default settings as long as the vendor bootloader is used.

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/lantiq/image/ACMP252.dts 
b/target/linux/lantiq/image/ACMP252.dts
index 174ae2e..31cb9de 100644
--- a/target/linux/lantiq/image/ACMP252.dts
+++ b/target/linux/lantiq/image/ACMP252.dts
@@ -82,7 +82,7 @@
 
ifxhcd@E101000 {
status = okay;
-   gpios = gpio 28 0;
+   gpios = gpio 3 0;
};
 
etop@E18 {
@@ -91,13 +91,6 @@
 
pci@E105400 {
status = okay;
-   interrupt-map = 0x7000 0 0 1 icu0 135 1;
-   req-mask = 0x1;
};
};
-
-   ralink_eep {
-   compatible = ralink,eeprom;
-   ralink,eeprom = RT2860.eeprom;
-   };
 };
-- 
1.8.1.4

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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL) / regdomain issue

2013-03-11 Thread Daniel Golle
Hi Bastian,

On 03/11/2013 10:58 AM, Bastian Bittorf wrote:
 sorry, for mixing things up. i understud Daniel Golle, that they
 cannot use all allowed 5 GHz channels - they dont want to break the law.
I didn't say that. Mentioning it again:
There is no problem with the original firmware in that regard. It allows using
exactly what is legal in Israel. It might be a conservative interpretation, but
well, that's not a bad thing, it will keep users out of trouble and make it less
likely that they accidentally interfere.
My concern is, if we add the hardware id and generate images which can be loaded
through the webui of these devices, we should make sure that radio regulation
law is enforced *just as in* the original firmware.
In a way, the real mistake the designers of the original firmware made was to
make such a big fuzz about it and write there in big letters you are limited
because your government does not allow you to do X. Because this will just make
everybody think that they are missing out on something, so they will believe
that circumventing the regulatory enforcement will give them something / be
advantageous (it is not!).
Daniel Dickinson's analogy comparing this to traffic rules is nice. You don't
want to drive around according to UK traffic rules (on the left side) in France
(where everybody is driving on the right). It doesn't seem like an advantageous
idea to me, at least (no matter how much of a freedom-loving individualist I
might be).

 Lets sum things up:
 most dev's dont want to support breaking the law, so better
 keep the limits lower (maybe even lower than allowed).

Ack.

 so, thanks for discussing this and share your options, now
 back to work 8-) : what is the best way to enforce ISRAEL in this
 specific router?
Great, after all, we are back to the practical level :)
As an outcome of this discussion, I realized that what I believed to be a
specific local problem (ie. no country code or 'US' default in the EEPROM) is a
reality, probably in most places and for most manufacturers.
For now, I guess the work-around I suggested does the trick (anyone got a better
*practical* idea) -- it detects the hwid of the board and (ab)uses it as a
regulatory hint. That's not very elegant, but until there is a better solution,
this is better than not having it (assuming that people will manage to flash
OpenWrt anyway -- it's not that difficult of a hack to do so)

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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL) / regdomain issue

2013-03-11 Thread Daniel Golle
On 03/11/2013 02:28 PM, Bastian Bittorf wrote:
 * Daniel Golle daniel.go...@gmail.com [11.03.2013 13:23]:
 
 For now, I guess the work-around I suggested does the trick (anyone got a 
 better
 *practical* idea) -- it detects the hwid of the board and (ab)uses it as a
 regulatory hint. That's not very elegant, but until there is a better 
 solution,
 
 what about this instead of using 'iw reg ...'?:
 https://lists.openwrt.org/pipermail/openwrt-devel/2013-March/019253.html

As I previously said
https://lists.openwrt.org/pipermail/openwrt-devel/2013-March/019240.html

This won't work during firstboot, because /etc/config/wireless will be created
by 'wifi detect' only after tplink_board_detect already run.
For me, it would be agreeable to do both,
iw reg set IL
and
uci set wireless.radio{0,1}.country=IL
independently of existing user settings.
(sorry, but to be honest, people who can't even edit a shell-script should not
be able to set any other country code, just like in the original firmware)

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


[OpenWrt-Devel] [PATCH] [toolchain] gdb: update to 7.5-2012.12-1

2013-03-11 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index 89f73ef..6d4c16d 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -7,12 +7,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gdb
-PKG_REV:=7.5-2012.09
+PKG_REV:=7.5-2012.12-1
 PKG_VERSION_MAJOR:=7.5
 PKG_VERSION:=linaro-$(PKG_REV)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=758c2da97c27f7b50ca48cb803eaa9aa
+PKG_MD5SUM:=016cf2c5ed06adf7c601e3301a14e370
 
PKG_SOURCE_URL:=http://launchpad.net/gdb-linaro/$(PKG_VERSION_MAJOR)/$(PKG_REV)/+download/
 
 HOST_BUILD_PARALLEL:=1
-- 
1.8.1.4

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


[OpenWrt-Devel] [PATCH/RFC] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
Hi everyone!

The hardware-ID is different for TL-WDR4300v1 devices sold in Israel.

For unknown reasons, instead of having proper settings in the WiFi EEPROM, the
importer decided to have a rootfs-mod of TP-LINKs original firmware -- still
with US regdomain in the EEPROM, but limiting the choices in the web-gui to
values which are compliant with regulations in Israel.
The firmware on devices sold in Israel expects a different hardware-id to
prevent users from flashing the upstream firmware and therefore bypassing the
limitations.

Though this approach seems formally wrong to me (they should have rather just
put the right settings in the art / eeprom), it's already out there.

To allow users to use OpenWrt on these devices and (similar to the original
firmware) also make sure that they do not violate the local regulations, I
suggest this patch (sorry for the attachment, but in that way it doesn't get
mangled by gmail).



Cheers


Daniel
From 70816138ee35a08aaf129f750979496a5443586a Mon Sep 17 00:00:00 2001
From: Daniel Golle dgo...@allnet.de
Date: Fri, 8 Mar 2013 03:42:56 +0200
Subject: [PATCH] [ar71xx] build image for TL-WDR4300v1 (IL)

---
 target/linux/ar71xx/image/Makefile| 1 +
 tools/firmware-utils/src/mktplinkfw.c | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 20caff8..879e768 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -935,6 +935,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR2543,tl-wr2543-v1,TL-WR
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3500V1,tl-wdr3500-v1,TL-WDR3500,ttyS0,115200,0x3501,1,8Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3600V1,tl-wdr3600-v1,TL-WDR4300,ttyS0,115200,0x3601,1,8Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4300V1,tl-wdr4300-v1,TL-WDR4300,ttyS0,115200,0x4301,1,8Mlzma))
+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4300V1,tl-wdr4300-v1-il,TL-WDR4300,ttyS0,115200,0x43008001,1,8Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4310V1,tl-wdr4310-v1,TL-WDR4300,ttyS0,115200,0x4311,1,8Mlzma))
 
 $(eval $(call SingleProfile,UAPPRO,$(fs_64k),UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 9483640..27e5281 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -41,6 +41,7 @@
 #define HWID_TL_WA830RE_V2	0x0832
 #define HWID_TL_WA901ND_V1	0x09010001
 #define HWID_TL_WA901ND_V2	0x09010002
+#define HWID_TL_WDR4300_V1_IL	0x43008001
 #define HWID_TL_WDR4900_V1	0x4901
 #define HWID_TL_WR703N_V1	0x07030101
 #define HWID_TL_WR741ND_V1	0x07410001
@@ -246,6 +247,11 @@ static struct board_info boards[] = {
 		.hw_rev = 1,
 		.layout_id	= 4M,
 	}, {
+		.id = TL-WDR4300v1,
+		.hw_id  = HWID_TL_WDR4300_V1_IL,
+		.hw_rev = 1,
+		.layout_id	= 8Mlzma,
+	}, {
 		.id = TL-WDR4900v1,
 		.hw_id  = HWID_TL_WDR4900_V1,
 		.hw_rev = 1,
-- 
1.8.1.4

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


[OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
Sorry, the previous mail contained the wrong patch (that's the problem with
attachments -- you don't see their content while composing the mail...)

From 062e4686778df46a94729195cc07ff4bfdc57fa2 Mon Sep 17 00:00:00 2001
From: Daniel Golle dgo...@allnet.de
Date: Fri, 8 Mar 2013 03:42:56 +0200
Subject: [PATCH] build image for TL-WDR4300v1 (IL)
To: openwrt-devel@lists.openwrt.org

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 4fd48d5..51249aa 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -138,6 +138,10 @@ tplink_board_detect() {
 	43*)
 		model=TP-Link TL-WDR4300
 		;;
+	430080*)
+		iw reg set IL
+		model=TP-Link TL-WDR4300 (IL)
+		;;
 	431000*)
 		model=TP-Link TL-WDR4310
 		;;
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 20caff8..879e768 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -935,6 +935,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR2543,tl-wr2543-v1,TL-WR
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3500V1,tl-wdr3500-v1,TL-WDR3500,ttyS0,115200,0x3501,1,8Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3600V1,tl-wdr3600-v1,TL-WDR4300,ttyS0,115200,0x3601,1,8Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4300V1,tl-wdr4300-v1,TL-WDR4300,ttyS0,115200,0x4301,1,8Mlzma))
+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4300V1,tl-wdr4300-v1-il,TL-WDR4300,ttyS0,115200,0x43008001,1,8Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4310V1,tl-wdr4310-v1,TL-WDR4300,ttyS0,115200,0x4311,1,8Mlzma))
 
 $(eval $(call SingleProfile,UAPPRO,$(fs_64k),UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 9483640..27e5281 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -41,6 +41,7 @@
 #define HWID_TL_WA830RE_V2	0x0832
 #define HWID_TL_WA901ND_V1	0x09010001
 #define HWID_TL_WA901ND_V2	0x09010002
+#define HWID_TL_WDR4300_V1_IL	0x43008001
 #define HWID_TL_WDR4900_V1	0x4901
 #define HWID_TL_WR703N_V1	0x07030101
 #define HWID_TL_WR741ND_V1	0x07410001
@@ -246,6 +247,11 @@ static struct board_info boards[] = {
 		.hw_rev = 1,
 		.layout_id	= 4M,
 	}, {
+		.id = TL-WDR4300v1,
+		.hw_id  = HWID_TL_WDR4300_V1_IL,
+		.hw_rev = 1,
+		.layout_id	= 8Mlzma,
+	}, {
 		.id = TL-WDR4900v1,
 		.hw_id  = HWID_TL_WDR4900_V1,
 		.hw_rev = 1,
-- 
1.8.1.4

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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
On 03/10/2013 04:18 PM, Bastian Bittorf wrote:
 * Daniel Golle daniel.go...@gmail.com [10.03.2013 15:17]:
  ;;
 +430080*)
 +iw reg set IL
 +model=TP-Link TL-WDR4300 (IL)
 +;;
 
 dont do 'iw reg' magic here, the user should decide
 that in the common way (uci...)

Well, I agree :)

However, the law over here says that it should not be up to the user to decide 
that.
And if the importer implemented it properly (ie. setting the right values in the
EEPROM), it also wouldn't allow the user the violate the law.
Usually, it goes like this:
ath9k interprets the EEPROM and sets the regdomain according to what it finds
there and then crda will only allow the user to further limit herself by setting
a countrycode in UCI or follow-up iw reg set or crda calls.
The idea of doing iw reg set IL when the board is detected was to simulate that
behaviour and achieve the same result as if it was done properly in the EEPROM
(i.e. the user can then only further limit herself)

An alternative to my current way of implementing it would be to handle it via
ath9k_platform_data and detect the board in mach-*.c (and in the future pass
that nasty little detail through DTS/OF)
However, doing it in user-space is a one-liner (though I agree it's in the wrong
place).

Not implementing it at all would be irresponsible towards users imho.


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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
On 03/10/2013 05:37 PM, Bastian Bittorf wrote:
 * Daniel Golle daniel.go...@gmail.com [10.03.2013 16:24]:
 However, the law over here says that it should not be up to the user to 
 decide that.
 
 i understand your thoughts, but linux/openwrt is not responsible for
 fight with the law. otherwise we must e.g. built it without SSL for
 several countries. the user is smart enough for that. if he is not,
 it's not our fault. 
 
 the big question is: how deep you want to restrict the user
 for protect for himself? imho, it there should be no restriction at
 all, but ofcourse there are more conservative people out there 8-)
 
 also: in germany i'am allowed to power with 40.000 mW under
 some circumstances, but my regdomain knows it better?!
 
 it's the same like having an english DVD with a regdomain code, which
 a friend gave me as a gift, but my german player cannot deal
 with it, because it's forbidden?!
 
 long story short: in the UI the user must select
 the right country. if he dont want that, he knows why...
 (unsure, if this enforces the correct regdomain?)
Comparing radio regulations with DCMA cases (DVD country code) is not
appropriate. No *user* ever got fined for operating a region-free DVD player,
not even in the US. However, if you start using channel 14 outdoors @500mW in
germany, you might well attract some attention...

If what you suggest is the official policy of OpenWrt to handle radio regulation
-- why don't we include stuff like
https://code.google.com/p/iwleeprom/source/browse/branches/atheros
and also adapt it to deal with in-flash EEPROM-data, i.e. have the art partition
R/W, so users can change their in-EEPROM regdomain settings (among other 
things).
Or just have CONFIG_ATH_USER_REGD enabled by default.
We don't do that. Because it would make users violate the law without even
knowing they do so. And get them fined by the Bundesnetzagentur, FCC or whoever
is in charge where they life. So I'm not talking about some silly DCMA-like
issues, software-patents or your local dictatorship preventing you from using
SSL (btw: OpenWrt binaries don't ship with any SSL implementation afaik).

Simply speaking: If I buy a TP-LINK router in germany and flash it with OpenWrt,
it will come with ETSI 0x68 regdomain (or similar) set in the art partition,
which is marked read-only. OpenWrt *binaries* will not allow me to exceed or
bypass the regulations the WiFi EEPROM suggests, in no possible way.
If I know what I'm doing, I can recompile the image with CONFIG_ATH_USER_REGD or
maybe even change the in-flash EEPROM-data. However, then I apparently know what
I'm doing and it's just really my own fault if I violate the law.
The default settings of the binaries on downloads.openwrt.org do *not* allow me
to do that. And that's what I'm talking about.

The danger is simply that people will flash OpenWrt and without even knowing
start using frequency bands or TX-power-levels which they are not allowed to
operate in their country.

This whole discussion is mainly due to the importer failing to set proper values
in the EEPROM and that's sad, but already happened.


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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
On 03/10/2013 05:42 PM, Bastian Bittorf wrote:
 * Daniel Golle daniel.go...@gmail.com [10.03.2013 16:24]:
 The idea of doing iw reg set IL when the board is detected was to simulate 
 that
 behaviour and achieve the same result as if it was done properly in the 
 EEPROM
 (i.e. the user can then only further limit herself)
 
 it will be resetted anyway after booting up further or after wifi
 restart.
not true. tplink_board_detect will be called on every boot, thus executing iw
reg set IL on every boot. And yes, it will probably be further restricted once
the WiFi driver loads or user-settings are applied.

 maybe you can set it via uci (without commiting it),
 so it survives any wifi action _and_ can be overidden...

technically that's not that easy, because tplink_board_detect is called before
wifi detect during firstboot. Therefore /etc/config/wireless doesn't exist yet.
Integrating this into /lib/wifi/mac80211.sh is also ugly, because it's ar71xx
specific.

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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
On 03/10/2013 06:56 PM, Matthias Schiffer wrote:
 On 03/10/2013 05:05 PM, Daniel Golle wrote:
 Simply speaking: If I buy a TP-LINK router in germany and flash it with 
 OpenWrt,
 it will come with ETSI 0x68 regdomain (or similar) set in the art 
 partition,
 which is marked read-only. OpenWrt *binaries* will not allow me to exceed or
 bypass the regulations the WiFi EEPROM suggests, in no possible way.
 If I know what I'm doing, I can recompile the image with 
 CONFIG_ATH_USER_REGD or
 maybe even change the in-flash EEPROM-data. However, then I apparently know 
 what
 I'm doing and it's just really my own fault if I violate the law.
 The default settings of the binaries on downloads.openwrt.org do *not* allow 
 me
 to do that. And that's what I'm talking about.
 
 By the way, this is not entirely correct... a lot of the TP-Link routers
 I've bought in Germany have the regdomain set to US in the art
 partitition (the stock firmware gives me a list with many Countries and
 allows me to set it to Germany), but when I flash OpenWRT onto it, I'm
 stuck with the US domain, and I have to recompile the image with
 CONFIG_ATH_USER_REGD to be compliant with the law.

Interesting Looks like the EEPROM part of TP-LINK routers is somehow
neglected...
However, if I got it right, you only need to recompile the firmware if you want
to use channel 12 and 13. To restrict your TX-power to 100mW (instead of 500mW
allowed in FCC-land) you can just set the country code in UCI.
So by default, this just *prevents* you from using channels you are legally
allowed to use in your country. Using the binary from downloads.openwrt.org
won't give you access to bands which are restricted by law, right?
Not that this is any better, but chances to get into trouble for accidentally
using reserved frequencies are much higher than for just using too high 
TX-power...

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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
On 03/10/2013 07:19 PM, Matthias Schiffer wrote:
 On 03/10/2013 06:11 PM, Daniel Golle wrote:
 On 03/10/2013 06:56 PM, Matthias Schiffer wrote:
 By the way, this is not entirely correct... a lot of the TP-Link routers
 I've bought in Germany have the regdomain set to US in the art
 partitition (the stock firmware gives me a list with many Countries and
 allows me to set it to Germany), but when I flash OpenWRT onto it, I'm
 stuck with the US domain, and I have to recompile the image with
 CONFIG_ATH_USER_REGD to be compliant with the law.

 Interesting Looks like the EEPROM part of TP-LINK routers is somehow
 neglected...
 However, if I got it right, you only need to recompile the firmware if you 
 want
 to use channel 12 and 13. To restrict your TX-power to 100mW (instead of 
 500mW
 allowed in FCC-land) you can just set the country code in UCI.
 So by default, this just *prevents* you from using channels you are legally
 allowed to use in your country. Using the binary from downloads.openwrt.org
 won't give you access to bands which are restricted by law, right?
 Not that this is any better, but chances to get into trouble for accidentally
 using reserved frequencies are much higher than for just using too high 
 TX-power...

 
 Not sure about that, it's been a few months since I last tested this. If
 I remember correctly, I wasn't able to set the regdomain to anything but
 US with the default OpenWRT image, thus allowing me to use channel 14,
 and using too high tx power by default.

afaik channel 14 is only permitted in Japan and used as a public safety
channel in the US.
US regdomain means channel 1 to 11, which is more restricted than EU countries
which permit 1 to 13.


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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL) / regdomain issue

2013-03-10 Thread Daniel Golle
On 03/10/2013 07:52 PM, Bastian Bittorf wrote:
 * Daniel Golle daniel.go...@gmail.com [10.03.2013 18:00]:
 The default settings of the binaries on downloads.openwrt.org do *not* allow 
 me
 to do that. And that's what I'm talking about.
 
 thats not true. OpenWrt defaults to regdomain US (hardcoded in the
 builts, because the regdomain is choosen during compiletime). so

NACK. no such a thing as a hardcoded country code. initial regdomain is hinted
from the value found in the EEPROM (and that may be 'US' for some hardware,
despite the fact that it is sold outside of FCC-land). Many hardware vendors
(e.g. wifi modules in laptops) even go as far as restricting their users to the
*intersection* of all regdomains, i.e. you can't break the law *anywhere*.

Using OpenWrt with the mac80211 stack (as it is the case when using the ath9k
driver) means it works like this
http://linuxwireless.org/en/developers/Regulatory/CRDA#Changing_regulatory_domains

maybe someone else can confirm this?

 people from e.g. country TN can use freq 5835 at 30 db which is 
 completely forbidden there.

as mentioned above, this would only be possible if your wifi card or in-flash
EEPROM data initially permits the use of that frequency band. m'key?


 The danger is simply that people will flash OpenWrt and without even knowing
 start using frequency bands or TX-power-levels which they are not allowed to
 operate in their country.
 
 it's the same like block the word f*ck in the wordprocessor, because
 the government forbids it? ok, dont get me wrong, i overact a littly
 bit, but the hole thing upset's me...

sorry, but this is really a different case.

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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL)

2013-03-10 Thread Daniel Golle
Hi Stefan,

thank you for that delighting summary of the situation!

On 03/10/2013 08:04 PM, Stefan Lippers-Hollmann wrote:
 I'm not going to comment upon what's the correct approach in this case
 and certainly agree that the local regulatory requirements should be
 enforced by default.


 Simply speaking: If I buy a TP-LINK router in germany and flash it with 
 OpenWrt,
 it will come with ETSI 0x68 regdomain (or similar) set in the art 
 partition,

 If only this were true…
 
 Over the years, I've bought 4 TP-Link routers (TL-WR941ND, two
 TL-WR1043ND and TL-WDR4300) through regular (and different) retail 
 channels (online and brick  mortar stores). Every single one has an
 EEPROM/ ART locked to the 'US' regdomain (the official vendor firmware,
 including localized variants, ignores the ART content and makes the 
 user to select the country freely).
[...]

 [1]   http://www.tp-link.com/resources/simulator/TL-WDR4300/index.htm
   Wireless 2.4GHz -- Wireless Settings -- Region/ Channel
   Wireless 2GHz   -- Wireless Settings -- Region/ Channel
   yes, this reflects the actual firmware and the country setting can
   be toggled freely, including different settings for 2.4 GHz and 5 GHz…

In the firmware version the device ships with in Israel, it looks like this:

http://i.pictr.com/md1uuyux4h.png
http://i.pictr.com/nuoci2o0lx.png

In order not to jeopardize future imports of decent WiFi gear, I believe we
should try to at least have a sane default when generating ready-made binaries
which can be loaded onto dual-band devices.
The law over here clearly states that future imports of 802.11an and 802.11ac
devices depend on the ability of the importers to prevent the user from
violating the radio spectrum regulation law.
In the current implementation on the TL-WDR4300 it's literally just 1 bit (in
the flash OR in the firmware upgrade image) that prevents the user from doing
so. So the situation is a bit fragile...
But never mind, that's not really our problem, but it's the importer who got to
fix this. I'm just concerned about users who might accidentally get into trouble
and believe we should prevent that.

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


Re: [OpenWrt-Devel] [PATCH/RFC v2] add hardware id for TL-WDR4300v1 (IL) / regdomain issue

2013-03-10 Thread Daniel Golle
On 03/10/2013 09:28 PM, Bastian Bittorf wrote:
 you posted some screenshots of the original tplink-firmware for Israel:
 they made nearly everything wrong for the user.
I don't think it's all wrong for the user. It's definitely not the right way to
do it [tm], but it serves the purpose (getting the import approved).
It's an interesting question if that firmware was made by TP-LINK or is a
rootfs-mod made by someone else, paid by the importer.
Fact is, that the original firmware enforces the local regulatory rules.
And yes, it's a very conservative interpretation of the law, which e.g. mentions
HT40 and coexistence mechanisms (clear channel assessment) only for 2.4GHz and
doesn't state anything about HT40 in 5GHz -- so they assumed it's better not to
use it. Similarly, as DFS is required, it's simpler to just assume
channel-selection should always be automatic.

I also just realized that this firmware has been previously discussed in the
forum https://forum.openwrt.org/viewtopic.php?id=41071
Reading this (people blindly executing .EXE files from unknown sources in
Windows) makes me want to take this serious (i.e. make sure also OpenWrt
enforced regulatory rules, at least per default) :p

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


[OpenWrt-Devel] [PATCH/RFC] [lantiq] add support for AudioCodes AC-252

2013-03-08 Thread Daniel Golle
user-space support for extracting the EEPROM for the RaLink WiFi is still
missing. Besides this, it's all working.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/lantiq/image/ACMP252.dts
 create mode 100644 target/linux/lantiq/xway/profiles/audiocodes.mk

diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_network 
b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
index db5b58e..1eadb56 100755
--- a/target/linux/lantiq/base-files/etc/uci-defaults/02_network
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_network
@@ -47,7 +47,7 @@ ARV4520PW)
ucidef_add_switch_vlan eth0 1 3 2 1 0 5t
;;
 
-GIGASX76X)
+ACMP252|GIGASX76X)
ucidef_set_interface_lan eth0.1
ucidef_add_switch eth0 1 1
ucidef_add_switch_vlan eth0 1 4 3 2 1 5t
diff --git a/target/linux/lantiq/image/ACMP252.dts 
b/target/linux/lantiq/image/ACMP252.dts
new file mode 100644
index 000..174ae2e
--- /dev/null
+++ b/target/linux/lantiq/image/ACMP252.dts
@@ -0,0 +1,103 @@
+/dts-v1/;
+
+/include/ danube.dtsi
+
+/ {
+   model = ACMP252 - AudioCodes MediaPack MP-252;
+
+   chosen {
+   bootargs = console=ttyLTQ0,115200 init=/etc/preinit;
+   };
+
+   memory@0 {
+   reg = 0x0 0x400;
+   };
+
+   sram@1F00 {
+   vmmc@107000 {
+   status = okay;
+   gpios = gpio 31 0;
+   };
+   };
+
+   fpi@1000 {
+   localbus@0 {
+   nor-boot@0 {
+   compatible = lantiq,nor;
+   bank-width = 2;
+   reg = 0 0x0 0x200;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   partition@0 {
+   label = uboot;
+   reg = 0x0 0x2;
+   read-only;
+   };
+
+   partition@2 {
+   label = uboot_env;
+   reg = 0x2 0x2;
+   };
+
+   partition@4 {
+   label = boardconfig;
+   reg = 0x4 0x6;
+   read-only;
+   };
+
+   partition@a {
+   label = linux;
+   reg = 0xa 0xf2;
+   };
+
+   partition@fc {
+   label = sysconfig;
+   reg = 0xfc 0x4;
+   };
+
+   partition@0x100 {
+   label = rootfs_data;
+   reg = 0x100 0x100;
+   };
+
+   };
+   };
+
+   gpio: pinmux@E100B10 {
+   pinctrl-names = default;
+   pinctrl-0 = state_default;
+
+   state_default: pinmux {
+   exin {
+   lantiq,groups = exin1;
+   lantiq,function = exin;
+   };
+   pci {
+   lantiq,groups = gnt1, req1;
+   lantiq,function = pci;
+   };
+   };
+   };
+
+   ifxhcd@E101000 {
+   status = okay;
+   gpios = gpio 28 0;
+   };
+
+   etop@E18 {
+   phy-mode = rmii;
+   };
+
+   pci@E105400 {
+   status = okay;
+   interrupt-map = 0x7000 0 0 1 icu0 135 1;
+   req-mask = 0x1;
+   };
+   };
+
+   ralink_eep {
+   compatible = ralink,eeprom;
+   ralink,eeprom = RT2860.eeprom;
+   };
+};
diff --git a/target/linux/lantiq/image/Makefile 
b/target/linux/lantiq/image/Makefile
index a68d65b..067767f 100644
--- a/target/linux/lantiq/image/Makefile
+++ b/target/linux/lantiq/image/Makefile
@@ -131,6 +131,9 @@ ifeq ($(CONFIG_TARGET_lantiq_xway),y)
 Image/BuildKernel/Profile/EASY50712=$(call 
Image/BuildKernel/Template,EASY50712)
 Image/Build/Profile/EASY50712=$(call Image/Build/$(1),$(1),EASY50712)
 
+Image/BuildKernel/Profile/ACMP252=$(call Image/BuildKernel/Template,ACMP252)
+Image/Build/Profile/ACMP252=$(call Image/Build/$(1),$(1),ACMP252

[OpenWrt-Devel] [PATCH 1/4] [ramips] fix whitespace in /lib/ramips.sh

2013-02-26 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 5d24abc..8ca3bfb 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -70,9 +70,9 @@ ramips_board_name() {
*DIR-645)
name=dir-645
;;
-*DAP-1350)
-name=dap-1350
-;;
+   *DAP-1350)
+   name=dap-1350
+   ;;
*ESR-9753)
name=esr-9753
;;
-- 
1.7.2.5

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


[OpenWrt-Devel] [PATCH 2/4] [ramips] enhance user-space board detection

2013-02-26 Thread Daniel Golle
Similar to ar71xx, detect only once and cache the strings in
/tmp/sysinfo/model and /tmp/sysinfo/boardname.

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh 
b/target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh
index e76418d..31ef5f8 100644
--- a/target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh
+++ b/target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh
@@ -2,6 +2,8 @@
 
 do_ramips() {
. /lib/ramips.sh
+
+   ramips_board_detect
 }
 
 boot_hook_add preinit_main do_ramips
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 8ca3bfb..4687856 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -1,9 +1,13 @@
 #!/bin/sh
 #
-# Copyright (C) 2010 OpenWrt.org
+# Copyright (C) 2010-2013 OpenWrt.org
 #
 
-ramips_board_name() {
+RAMIPS_BOARD_NAME=
+RAMIPS_MODEL=
+
+
+ramips_board_detect() {
local machine
local name
 
@@ -189,5 +193,20 @@ ramips_board_name() {
;;
esac
 
-   echo $name
+   [ -z $RAMIPS_BOARD_NAME ]  RAMIPS_BOARD_NAME=$name
+   [ -z $RAMIPS_MODEL ]  RAMIPS_MODEL=$machine
+
+   [ -e /tmp/sysinfo/ ] || mkdir -p /tmp/sysinfo/
+
+   echo $RAMIPS_BOARD_NAME  /tmp/sysinfo/board_name
+   echo $RAMIPS_MODEL  /tmp/sysinfo/model
+}
+
+ramips_board_name() {
+   local name
+
+   [ -f /tmp/sysinfo/board_name ]  name=$(cat /tmp/sysinfo/board_name)
+   [ -z $name ]  name=unknown
+
+   echo $name
 }
-- 
1.7.2.5

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


[OpenWrt-Devel] [PATCH 3/4] [ramips] indicate support for ALL5003

2013-02-26 Thread Daniel Golle
add ALL5003 to board description in mach-all5002.c
adapt detection in user-space accordingly
(no functional changes)

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 4687856..4b3e362 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -32,7 +32,7 @@ ramips_board_detect() {
*Allnet ALL0256N)
name=all0256n
;;
-   *Allnet ALL5002)
+   *Allnet ALL5002/ALL5003)
name=all5002
;;
*ARC FreeStation5)
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-all5002.c 
b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-all5002.c
index 151671a..71938f0 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-all5002.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-all5002.c
@@ -57,5 +57,5 @@ static void __init all5002_init(void)
rt305x_register_usb();
 }
 
-MIPS_MACHINE(RAMIPS_MACH_ALL5002, ALL5002, Allnet ALL5002,
+MIPS_MACHINE(RAMIPS_MACH_ALL5002, ALL5002, Allnet ALL5002/ALL5003,
 all5002_init);
-- 
1.7.2.5

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


[OpenWrt-Devel] [PATCH 4/4] [ramips] add user-space detection for ALL5002/ALL5003

2013-02-26 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 4b3e362..0702145 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -6,6 +6,19 @@
 RAMIPS_BOARD_NAME=
 RAMIPS_MODEL=
 
+all500x_board_detect() {
+   local systype
+
+   systype=$(awk 'BEGIN{FS=[ \t]+:[ \t]} /system type/ {print $2}' 
/proc/cpuinfo)
+   case $systype in
+   *RT5350*)
+   RAMIPS_MODEL=Allnet ALL5003
+   ;;
+   *RT3352*)
+   RAMIPS_MODEL=Allnet ALL5002
+   ;;
+   esac
+}
 
 ramips_board_detect() {
local machine
@@ -193,6 +206,12 @@ ramips_board_detect() {
;;
esac
 
+   case $machine in
+   *Allnet ALL5002/ALL5003)
+   all500x_board_detect
+   ;;
+   esac
+
[ -z $RAMIPS_BOARD_NAME ]  RAMIPS_BOARD_NAME=$name
[ -z $RAMIPS_MODEL ]  RAMIPS_MODEL=$machine
 
-- 
1.7.2.5

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


[OpenWrt-Devel] [PATCH] [ramips] set -march=24kec for rt305x and rt3883 to enable use of DSP extension

2013-02-26 Thread Daniel Golle
All known rt305x and rt3883 implementations support at least the 24kec
instruction set which includes the DSP extension. For rt288x, the previous
value mips32r2 is kept.
The cpu target is now set per sub-archtecture, according to
cpu-feature-overrides.h of each SoC family.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 target/linux/ramips/Makefile | 2 +-
 target/linux/ramips/rt288x/target.mk | 1 +
 target/linux/ramips/rt305x/target.mk | 1 +
 target/linux/ramips/rt3883/target.mk | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile
index 039a57c..b02c801 100644
--- a/target/linux/ramips/Makefile
+++ b/target/linux/ramips/Makefile
@@ -10,7 +10,7 @@ ARCH:=mipsel
 BOARD:=ramips
 BOARDNAME:=Ralink RT288x/RT3xxx
 SUBTARGETS:=rt288x rt305x rt3883
-CFLAGS:=-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves 
-mno-branch-likely
+CFLAGS:=-Os -pipe -fno-caller-saves -mno-branch-likely
 FEATURES:=squashfs
 
 LINUX_VERSION:=3.7.9
diff --git a/target/linux/ramips/rt288x/target.mk 
b/target/linux/ramips/rt288x/target.mk
index cb3b719..f826eab 100644
--- a/target/linux/ramips/rt288x/target.mk
+++ b/target/linux/ramips/rt288x/target.mk
@@ -4,6 +4,7 @@
 
 SUBTARGET:=rt288x
 BOARDNAME:=RT288x based boards
+CFLAGS+= -mips32r2 -mtune=mips32r2
 
 define Target/Description
Build firmware images for Ralink RT288x based boards.
diff --git a/target/linux/ramips/rt305x/target.mk 
b/target/linux/ramips/rt305x/target.mk
index 2c78756..3ebb553 100644
--- a/target/linux/ramips/rt305x/target.mk
+++ b/target/linux/ramips/rt305x/target.mk
@@ -4,6 +4,7 @@
 
 SUBTARGET:=rt305x
 BOARDNAME:=RT305x based boards
+CFLAGS+= -march=24kec
 
 define Target/Description
Build firmware images for Ralink RT305x based boards.
diff --git a/target/linux/ramips/rt3883/target.mk 
b/target/linux/ramips/rt3883/target.mk
index 590bb98..2089edc 100644
--- a/target/linux/ramips/rt3883/target.mk
+++ b/target/linux/ramips/rt3883/target.mk
@@ -4,6 +4,7 @@
 
 SUBTARGET:=rt3883
 BOARDNAME:=RT3662/RT3883 based boards
+CFLAGS+= -march=24kec
 
 define Target/Description
Build firmware images for Ralink RT3662/RT3883 based boards.
-- 
1.8.1.4

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


[OpenWrt-Devel] [PATCH] Add asterisk11 package.

2013-02-10 Thread Daniel Golle
Add asterisk11 package. LTS version of Asterisk has been recently released. 
This package is a bleeding-edge alternative to existing asterisk-1.8.x package.

Signed-off-by: Jiri Slachta slac...@cesnet.cz
[Daniel Golle: whitespace fixes and added PostgreSQL support]
Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 net/asterisk-11.x/Makefile
 create mode 100644 net/asterisk-11.x/files/asterisk.default
 create mode 100644 net/asterisk-11.x/files/asterisk.init
 create mode 100644 
net/asterisk-11.x/patches/000-pjlib-move-configure-compile-to-makefile.patch
 create mode 100644 
net/asterisk-11.x/patches/010-asterisk-configure-undef-res-ninit.patch
 create mode 100644 
net/asterisk-11.x/patches/020-asterisk-enable-default-modules.patch

diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile
new file mode 100644
index 000..88e1b2f
--- /dev/null
+++ b/net/asterisk-11.x/Makefile
@@ -0,0 +1,396 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=asterisk11
+PKG_VERSION:=11.2.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
+PKG_MD5SUM:=b82a82e5adfff0383769e923bfb54c56
+
+PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/asterisk11/install/module
+   $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*$(2).so* 
$(1)/usr/lib/asterisk/modules/
+endef
+
+define Package/asterisk11/install/conffile
+   $(INSTALL_DIR) $(1)/etc/asterisk
+   $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/*$(2)* $(1)/etc/asterisk/
+endef
+
+define Package/asterisk11/install/lib
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(2).so* $(1)/usr/lib/
+endef
+
+define Package/asterisk11/install/sbin
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $(1)/usr/sbin/
+endef
+
+define Package/asterisk11/install/sounds
+   $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/$(2) 
$(1)/usr/lib/asterisk/sounds/
+endef
+
+define BuildAsteriskModule
+  define Package/asterisk11-$(1)
+  $$(call Package/asterisk11/Default)
+TITLE:=$(2) support
+DEPENDS:= asterisk11 $(4)
+  endef
+
+  define Package/asterisk11-$(1)/conffiles
+$(5)
+  endef
+
+  define Package/asterisk11-$(1)/description
+  $$(call Package/asterisk11/Default/description)
+This package provides support $(3) in Asterisk.
+  endef
+
+  define Package/asterisk11-$(1)/install
+$(foreach c,$(6),$(call Package/asterisk11/install/conffile,$$(1),$(c));)
+$(foreach m,$(7),$(call Package/asterisk11/install/module,$$(1),$(m));)
+$(foreach s,$(8),$(call Package/asterisk11/install/sounds,$$(1),$(s));)
+  endef
+
+  $$(eval $$(call BuildPackage,asterisk11-$(1)))
+endef
+
+define Package/asterisk11/Default
+  SUBMENU:=Telephony
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=http://www.asterisk.org/
+endef
+
+define Package/asterisk11/Default/description
+Asterisk is a complete PBX in software. It provides all of the features
+you would expect from a PBX and more. Asterisk does voice over IP in three
+protocols, and can interoperate with almost all standards-based telephony
+equipment using relatively inexpensive hardware.
+endef
+
+define Package/asterisk11
+$(call Package/asterisk11/Default)
+  TITLE:=Complete open source PBX, v11.x
+  MENU:=1
+  DEPENDS:=+libuuid +libopenssl +libncurses +libpopt +libpthread +libsqlite3 
+librt +zlib @!TARGET_avr32
+endef
+
+define Package/asterisk11/description
+$(call Package/asterisk11/Default/description)
+endef
+
+define Package/asterisk11/conffiles
+/etc/asterisk/asterisk.conf
+/etc/asterisk/acl.conf
+/etc/asterisk/ccss.conf
+/etc/asterisk/modules.conf
+/etc/asterisk/extconfig.conf
+/etc/asterisk/extensions.conf
+/etc/asterisk/features.conf
+/etc/asterisk/indications.conf
+/etc/asterisk/logger.conf
+/etc/asterisk/manager.conf
+/etc/asterisk/rtp.conf
+/etc/asterisk/sip.conf
+/etc/asterisk/sip_notify.conf
+/etc/asterisk/udptl.conf
+/etc/default/asterisk
+/etc/init.d/asterisk
+endef
+
+AST_CFG_FILES:= \
+   asterisk.conf acl.conf ccss.conf extconfig.conf extensions.conf 
features.conf indications.conf logger.conf manager.conf modules.conf \
+   rtp.conf sip_notify.conf sip.conf udptl.conf
+AST_EMB_MODULES:=\
+   app_dial app_echo app_macro app_playback codec_gsm codec_ulaw 
format_gsm format_pcm format_wav format_wav_gsm func_callerid \
+   func_logic func_strings func_timeout chan_sip chan_local pbx_config 
res_crypto res_http_websocket res_rtp_asterisk res_rtp_multicast
+
+define Package/asterisk11/install
+$(call Package/asterisk11/install/lib,$(1),libasteriskssl)
+$(call Package/asterisk11/install/sbin,$(1

[OpenWrt-Devel] [PATCH] add /usr/lib/ipsec to LD_PATH

2013-01-28 Thread Daniel Golle
fix for sstrip, which otherwise fails if strongswan is installed.
---
 package/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/Makefile b/package/Makefile
index df7cf79..2dde1df 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -37,6 +37,7 @@ ifdef CONFIG_USE_MKLIBS
-L /lib \
-L /usr/lib \
-L /usr/lib/ebtables \
+   -L /usr/lib/ipsec \
--ldlib $(patsubst $(STAGING_DIR_ROOT)/%,/%,$(firstword 
$(wildcard \
$(foreach name,ld-uClibc.so.* ld-linux.so.* ld-*.so, \
  $(STAGING_DIR_ROOT)/lib/$(name) \
-- 
1.8.1.1

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


[OpenWrt-Devel] [PATCH] ramips: reset switch on single-port devices

2013-01-28 Thread Daniel Golle
Signed-off-by: Daniel Gole dgo...@allnet.de
---
 target/linux/ramips/base-files/etc/uci-defaults/02_network | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network 
b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index a8e5ef9..b9c88e3 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -46,6 +46,7 @@ ramips_setup_interfaces()
all0256n | \
all5002 | \
broadway)
+   ucidef_add_switch switch0 1 0
ucidef_set_interface_lan eth0
;;
 
-- 
1.8.1.1

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


Re: [OpenWrt-Devel] [PATCH] packages/net/olsrd: retry tunnel setup

2013-01-21 Thread Daniel Golle
On 01/20/2013 11:53 PM, Bastian Bittorf wrote:
 * Daniel Golle dgo...@allnet.de [20.01.2013 22:50]:
 When started while boot, olsrd quits when SmartGW is enabled with the message

 olsrd[1395]: Received netlink error code Cannot assign requested address 
 (-126)
 olsrd[1395]: olsrd exit: Cannot initialize gateway tunnels
 
 this is likely a netifd race which should be fixed with
 https://dev.openwrt.org/changeset/35240/trunk
 
 please check if this patch helps you.

I had that included already when the problem initially occured.
I recompiled vanilla r35287 without my patch and the problem still persists.
Moving olsrd to the end of the init priority (START=99) does not help either.

Having olsrd retry for a while (as I did with my patch) does the trick.

olsrd also retries in case a main interface cannot be configured. Why not have
it retry as well in case the setup of the SmartGW tunnel interface(s) fails?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] 6relayd: fix shell library includes in init-script

2013-01-20 Thread Daniel Golle
If the libraties are included on top-level, the script will exit when being
included on the host where those files don't exist. This results in 6relayd's
init-script not being enabled due to the run-level link not being set when
preparing the rootfs on the build host.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 package/network/ipv6/6relayd/files/6relayd.init | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/network/ipv6/6relayd/files/6relayd.init 
b/package/network/ipv6/6relayd/files/6relayd.init
index 790396e..82cd24d 100644
--- a/package/network/ipv6/6relayd/files/6relayd.init
+++ b/package/network/ipv6/6relayd/files/6relayd.init
@@ -1,8 +1,6 @@
 #!/bin/sh /etc/rc.common
 # Copyright (c) 2011-2012 OpenWrt.org
 START=80
-. /lib/functions/network.sh
-. /lib/functions/service.sh
 
 start_6relayd() {
local cfg=$1
@@ -106,6 +104,8 @@ restart_affected_6relayd() {
 }
 
 restart_affected() {
+   . /lib/functions/service.sh
+   . /lib/functions/network.sh
local net=$1
config_load 6relayd
config_foreach restart_affected_6relayd server $net
@@ -113,6 +113,7 @@ restart_affected() {
 }
 
 stop() {
+   . /lib/functions/service.sh
for pid in /var/run/6relayd-*.pid; do
SERVICE_PID_FILE=$pid
service_stop /usr/sbin/6relayd
@@ -121,6 +122,8 @@ stop() {
 }
 
 start() {
+   . /lib/functions/service.sh
+   . /lib/functions/network.sh
config_load 6relayd
config_foreach start_6relayd server
config_foreach start_6relayd relay relay
-- 
1.8.1.1

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


[OpenWrt-Devel] [PATCH] packages/net/olsrd: retry tunnel setup

2013-01-20 Thread Daniel Golle
When started while boot, olsrd quits when SmartGW is enabled with the message

olsrd[1395]: Received netlink error code Cannot assign requested address (-126)
olsrd[1395]: olsrd exit: Cannot initialize gateway tunnels

When restart after boot, olsrd starts up and works as expected.

I wrote this patch to work around this phenomenon, with this olsrd will retry
to setup the gateway tunnels and only exit with a failure if the problem
persists.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 net/olsrd/patches/001-retry-tunnel-setup.patch | 28 ++
 1 file changed, 28 insertions(+)
 create mode 100644 net/olsrd/patches/001-retry-tunnel-setup.patch

diff --git a/net/olsrd/patches/001-retry-tunnel-setup.patch 
b/net/olsrd/patches/001-retry-tunnel-setup.patch
new file mode 100644
index 000..d2c3caf
--- /dev/null
+++ b/net/olsrd/patches/001-retry-tunnel-setup.patch
@@ -0,0 +1,28 @@
+Index: olsrd-0.6.4/src/main.c
+===
+--- olsrd-0.6.4.orig/src/main.c
 olsrd-0.6.4/src/main.c
+@@ -240,6 +240,7 @@ int main(int argc, char *argv[]) {
+   struct ipaddr_str buf;
+   bool loadedConfig = false;
+   int i;
++  int retry;
+ 
+ #ifdef linux
+   struct interface *ifn;
+@@ -449,8 +450,13 @@ int main(int argc, char *argv[]) {
+ #ifdef linux
+   /* initialize gateway system */
+   if (olsr_cnf-smart_gw_active) {
+-if (olsr_init_gateways()) {
+-  olsr_exit(Cannot initialize gateway tunnels, 1);
++int retry=0;
++while (olsr_init_gateways()) {
++  if (retry5) {
++  olsr_exit(Cannot initialize gateway tunnels, 1);
++  }
++  retry++;
++  olsr_startup_sleep(5);
+ }
+   }
+ 
-- 
1.8.1.1

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


Re: [OpenWrt-Devel] [PATCH] network/iproute2: Bump version to 3.7.0

2013-01-19 Thread Daniel Golle
Updated to latest stable version and added an upstream patch to handle
a link failure

Signed-off-by: Oliver Smith oli...@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa
[dgo...@allnet.de: refreshed patches]
Signed-off-by: Daniel Golle dgo...@allnet.de
---
 package/network/utils/iproute2/Makefile|   4 +-
 .../iproute2/patches/000-sync_pkt_sched_h.patch|  87 +---
 .../utils/iproute2/patches/008-no_netem.patch  |   8 +-
 .../utils/iproute2/patches/110-extra-ccopts.patch  |  10 +-
 .../utils/iproute2/patches/210-add_codel.patch | 437 -
 .../210-build-unbreak-linkage-of-m_xt.so.patch |  58 +++
 6 files changed, 70 insertions(+), 534 deletions(-)
 delete mode 100644 package/network/utils/iproute2/patches/210-add_codel.patch
 create mode 100644 
package/network/utils/iproute2/patches/210-build-unbreak-linkage-of-m_xt.so.patch

diff --git a/package/network/utils/iproute2/Makefile 
b/package/network/utils/iproute2/Makefile
index 256064e..578010f 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
-PKG_VERSION:=3.3.0
+PKG_VERSION:=3.7.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
-PKG_MD5SUM:=308e7145218dd552c2766fe527e239e1
+PKG_MD5SUM:=47040899f8fa30c8721fc5aec6509b44
 PKG_BUILD_PARALLEL:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
diff --git a/package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch 
b/package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch
index d3315a0..b06bc70 100644
--- a/package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch
+++ b/package/network/utils/iproute2/patches/000-sync_pkt_sched_h.patch
@@ -1,6 +1,6 @@
 --- a/include/linux/pkt_sched.h
 +++ b/include/linux/pkt_sched.h
-@@ -193,6 +193,33 @@ struct tc_sfq_xstats {
+@@ -214,6 +214,33 @@ struct tc_sfq_xstats {
__s32   allot;
  };
  
@@ -34,88 +34,3 @@
  /* RED section */
  
  enum {
-@@ -633,4 +660,84 @@ struct tc_qfq_stats {
-   __u32 lmax;
- };
- 
-+/* CODEL */
-+
-+enum {
-+  TCA_CODEL_UNSPEC,
-+  TCA_CODEL_TARGET,
-+  TCA_CODEL_LIMIT,
-+  TCA_CODEL_INTERVAL,
-+  TCA_CODEL_ECN,
-+  __TCA_CODEL_MAX
-+};
-+
-+#define TCA_CODEL_MAX (__TCA_CODEL_MAX - 1)
-+
-+struct tc_codel_xstats {
-+  __u32   maxpacket; /* largest packet we've seen so far */
-+  __u32   count; /* how many drops we've done since the last time we
-+  * entered dropping state
-+  */
-+  __u32   lastcount; /* count at entry to dropping state */
-+  __u32   ldelay;/* in-queue delay seen by most recently dequeued 
packet */
-+  __s32   drop_next; /* time to drop next packet */
-+  __u32   drop_overlimit; /* number of time max qdisc packet limit was 
hit */
-+  __u32   ecn_mark;  /* number of packets we ECN marked instead of 
dropped */
-+  __u32   dropping;  /* are we in dropping state ? */
-+};
-+
-+/* FQ_CODEL */
-+
-+enum {
-+  TCA_FQ_CODEL_UNSPEC,
-+  TCA_FQ_CODEL_TARGET,
-+  TCA_FQ_CODEL_LIMIT,
-+  TCA_FQ_CODEL_INTERVAL,
-+  TCA_FQ_CODEL_ECN,
-+  TCA_FQ_CODEL_FLOWS,
-+  TCA_FQ_CODEL_QUANTUM,
-+  __TCA_FQ_CODEL_MAX
-+};
-+
-+#define TCA_FQ_CODEL_MAX  (__TCA_FQ_CODEL_MAX - 1)
-+
-+enum {
-+  TCA_FQ_CODEL_XSTATS_QDISC,
-+  TCA_FQ_CODEL_XSTATS_CLASS,
-+};
-+
-+struct tc_fq_codel_qd_stats {
-+  __u32   maxpacket;  /* largest packet we've seen so far */
-+  __u32   drop_overlimit; /* number of time max qdisc
-+   * packet limit was hit
-+   */
-+  __u32   ecn_mark;   /* number of packets we ECN marked
-+   * instead of being dropped
-+   */
-+  __u32   new_flow_count; /* number of time packets
-+   * created a 'new flow'
-+   */
-+  __u32   new_flows_len;  /* count of flows in new list */
-+  __u32   old_flows_len;  /* count of flows in old list */
-+};
-+
-+struct tc_fq_codel_cl_stats {
-+  __s32   deficit;
-+  __u32   ldelay; /* in-queue delay seen by most recently
-+   * dequeued packet
-+   */
-+  __u32   count;
-+  __u32   lastcount;
-+  __u32   dropping;
-+  __s32   drop_next;
-+};
-+
-+struct tc_fq_codel_xstats {
-+  __u32   type;
-+  union {
-+  struct tc_fq_codel_qd_stats qdisc_stats;
-+  struct tc_fq_codel_cl_stats class_stats;
-+  };
-+};
-+
- #endif
diff --git a/package/network/utils/iproute2/patches/008-no_netem.patch 
b/package/network/utils/iproute2/patches/008-no_netem.patch
index c804b14..a6a74aa 100644
--- a/package/network/utils/iproute2/patches/008-no_netem.patch
+++ b/package/network/utils

[OpenWrt-Devel] [PATCH] [packages] net/olsrd: IPv6 SmartGW doesn't require IPv6 NAT support

2013-01-19 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de
---
 net/olsrd/files/olsrd.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/olsrd/files/olsrd.init b/net/olsrd/files/olsrd.init
index 7578316..5deca06 100644
--- a/net/olsrd/files/olsrd.init
+++ b/net/olsrd/files/olsrd.init
@@ -604,9 +604,9 @@ olsrd_setup_smartgw_rules() {
$IP6T -I input_rule -i $IFACE -p 4 -j 
ACCEPT
done
else
+   $IP4T -t nat -I postrouting_rule -o tnl_+ -j 
MASQUERADE
for IPT in $IP4T $IP6T; do
$IPT -I forwarding_rule -o tnl_+ -j 
ACCEPT
-   $IPT -t nat -I postrouting_rule -o 
tnl_+ -j MASQUERADE
if [ $nowan=0 ]; then
for IFACE in $wanifnames; do
$IPT -A forwarding_rule 
-i tunl0 -o $IFACE -j ACCEPT
-- 
1.8.1

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


[OpenWrt-Devel] [PATCH] [ramips] enable BR6425N in kernel config

2013-01-16 Thread Daniel Golle
Though originally contained in the patch applied in r35020, the move to 3.7 in
r34845 lost the kernel .config option. Reintroduce it to config-3.7.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 target/linux/ramips/rt288x/config-3.7 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/rt288x/config-3.7 
b/target/linux/ramips/rt288x/config-3.7
index 5fdd62f..2dfdc78 100644
--- a/target/linux/ramips/rt288x/config-3.7
+++ b/target/linux/ramips/rt288x/config-3.7
@@ -106,6 +106,7 @@ CONFIG_RALINK_RT288X=y
 # CONFIG_RALINK_RT305X is not set
 # CONFIG_RALINK_RT3883 is not set
 CONFIG_RAMIPS_WDT=y
+CONFIG_RT288X_MACH_BR6524N=y
 CONFIG_RT288X_MACH_F5D8235_V1=y
 CONFIG_RT288X_MACH_RT_N15=y
 CONFIG_RT288X_MACH_V11ST_FE=y
-- 
1.8.1

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


Re: [OpenWrt-Devel] rt2x00: add rt5350 wlan support

2013-01-06 Thread Daniel Golle
On 01/07/2013 09:40 AM, Michel Stempin wrote:
 Le 07/01/2013 05:36, Сергей Василюгин a écrit :
 Do you think that Dlink include driver source in the GPL tarball by mistake? 
 Hmm, it's possible. The only thing that I see in the source is software 
 determination of Xtal20MHz/Xtal40MHz. All other stuff exist in GPL'ed source 
 for USB/PCI/PCIe cards at 
 http://www.ralinktech.com/_en/07_downloads/01_windows.php?sn=501
 404 Not Found
The domain name was recently changed, as MediaTek acquired RaLink, so this can
now be found on MediaTek's website:

http://www.mediatek.com/_en/07_downloads/01_windows.php?sn=501


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


[OpenWrt-Devel] odhcp6c compile failure

2012-12-21 Thread Daniel Golle
Hi!

compiling odhcp6c fails on OpenWrt:

/home/public/source/openwrt/build_dir/target-arm_v5te_uClibc-0.9.33.2_eabi/odhcp6c-2012-11-29/src/script.c:
In function 'script_unhexlify':
/home/public/source/openwrt/build_dir/target-arm_v5te_uClibc-0.9.33.2_eabi/odhcp6c-2012-11-29/src/script.c:61:3:
error: comparison is always false due to limited range of data type
[-Werror=type-limits]
/home/public/source/openwrt/build_dir/target-arm_v5te_uClibc-0.9.33.2_eabi/odhcp6c-2012-11-29/src/script.c:61:3:
error: comparison is always false due to limited range of data type
[-Werror=type-limits]
cc1: all warnings being treated as errors

Looking at that part of script.c:

ssize_t script_unhexlify(uint8_t *dst, size_t len, const char *src)
{
size_t c;
for (c = 0; c  len  src[0]  src[1]; ++c) {
int8_t x = (int8_t)*src++;
int8_t y = (int8_t)*src++;
if (x  0 || (x = hexvals[x])  0
|| y  0 || (y = hexvals[y])  0)
return -1;
dst[c] = x  4 | y;
while (*src  0 || (*src  hexvals[(uint8_t)*src]  0))
src++;
}

return c;
}


So yes, the condition in the while-loop will always be false, as *src is of type
char* which is identical to uint8_t, at least on my target platform (arm_v5te).
I'm too lazy to get all the way into what is actually supposed to happen there,
but as far as I remember, you should use signed char or int8_t if you intend to
use signed 8-bit integers.


Cheers


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


[OpenWrt-Devel] [PATCH] [ar7] add AudioCodes AC495 SoC

2012-11-26 Thread Daniel Golle
Found in the AudioCodes Tulip AC494 ATA.

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch 
b/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
index 80f0f28..fccd357 100644
--- a/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
+++ b/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
@@ -13,22 +13,25 @@
 +load-$(CONFIG_AR7_AC49X)+= 0x945ca000
 --- a/arch/mips/ar7/setup.c
 +++ b/arch/mips/ar7/setup.c
-@@ -69,6 +69,8 @@ const char *get_system_type(void)
+@@ -69,6 +69,10 @@ const char *get_system_type(void)
return TI AR7 (TNETV1056);
case TITAN_CHIP_1060:
return TI AR7 (TNETV1060);
-+  case TITAN_CHIP_AC:
-+  return AudioCodes AC49x;
++  case TITAN_CHIP_AC495:
++  return AudioCodes AC495;
++  case TITAN_CHIP_AC496:
++  return AudioCodes AC496;
}
default:
return TI AR7 (unknown);
 --- a/arch/mips/include/asm/mach-ar7/ar7.h
 +++ b/arch/mips/include/asm/mach-ar7/ar7.h
-@@ -92,6 +92,7 @@
+@@ -92,6 +92,8 @@
  #define TITAN_CHIP_1055   0x0e
  #define TITAN_CHIP_1056   0x0d
  #define TITAN_CHIP_1060   0x07
-+#define TITAN_CHIP_AC 0x02
++#define TITAN_CHIP_AC495  0x00
++#define TITAN_CHIP_AC496  0x02
  
  /* Interrupts */
  #define AR7_IRQ_UART0 15
diff --git a/target/linux/ar7/patches-3.6/300-add-ac49x-platform.patch 
b/target/linux/ar7/patches-3.6/300-add-ac49x-platform.patch
index 39f7330..7218584 100644
--- a/target/linux/ar7/patches-3.6/300-add-ac49x-platform.patch
+++ b/target/linux/ar7/patches-3.6/300-add-ac49x-platform.patch
@@ -13,22 +13,25 @@
 +load-$(CONFIG_AR7_AC49X)+= 0x945ca000
 --- a/arch/mips/ar7/setup.c
 +++ b/arch/mips/ar7/setup.c
-@@ -69,6 +69,8 @@ const char *get_system_type(void)
+@@ -69,6 +69,10 @@ const char *get_system_type(void)
return TI AR7 (TNETV1056);
case TITAN_CHIP_1060:
return TI AR7 (TNETV1060);
-+  case TITAN_CHIP_AC:
-+  return AudioCodes AC49x;
++  case TITAN_CHIP_AC495:
++  return AudioCodes AC495;
++  case TITAN_CHIP_AC496:
++  return AudioCodes AC496;
}
default:
return TI AR7 (unknown);
 --- a/arch/mips/include/asm/mach-ar7/ar7.h
 +++ b/arch/mips/include/asm/mach-ar7/ar7.h
-@@ -92,6 +92,7 @@
+@@ -92,6 +92,8 @@
  #define TITAN_CHIP_1055   0x0e
  #define TITAN_CHIP_1056   0x0d
  #define TITAN_CHIP_1060   0x07
-+#define TITAN_CHIP_AC 0x02
++#define TITAN_CHIP_AC495  0x00
++#define TITAN_CHIP_AC496  0x02
  
  /* Interrupts */
  #define AR7_IRQ_UART0 15
-- 
1.8.0.1



pgpmrZQhU2Ojx.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] AA: mac80211/rt2x00: backport r34268

2012-11-25 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de
---
 .../patches/622-rt2x00-fix-rt3352-ext-pa.patch | 212 +
 1 file changed, 212 insertions(+)
 create mode 100644 package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch

diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
new file mode 100644
index 000..8015a12
--- /dev/null
+++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
@@ -0,0 +1,212 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -2271,15 +2271,18 @@ static void rt2800_config_channel(struct
+   /*
+* Change BBP settings
+*/
++  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
++
+   if (rt2x00_rt(rt2x00dev, RT3352)) {
+   rt2800_bbp_write(rt2x00dev, 27, 0x0);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 27, 0x20);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 86, 0x38);
++  rt2800_bbp_write(rt2x00dev, 83, 0x6a);
+   } else {
+-  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 86, 0);
+   }
+ 
+@@ -3850,6 +3853,7 @@ static int rt2800_init_rfcsr(struct rt2x
+* Init RF calibration.
+*/
+   if (rt2x00_rt(rt2x00dev, RT3290) ||
++  rt2x00_rt(rt2x00dev, RT3352) ||
+   rt2x00_rt(rt2x00dev, RT5390) ||
+   rt2x00_rt(rt2x00dev, RT5392)) {
+   rt2800_rfcsr_read(rt2x00dev, 2, rfcsr);
+@@ -4036,6 +4040,10 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
+   return 0;
+   } else if (rt2x00_rt(rt2x00dev, RT3352)) {
++  int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0,
++rt2x00dev-cap_flags);
++  int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1,
++rt2x00dev-cap_flags);
+   rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
+   rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
+   rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
+@@ -4069,15 +4077,30 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 34, 0x01);
++  rfcsr =  0x01;
++  if (!tx0_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX0_EXT_PA, 1);
++  if (!tx1_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX1_EXT_PA, 1);
++  rt2800_rfcsr_write(rt2x00dev, 34, rfcsr );
+   rt2800_rfcsr_write(rt2x00dev, 35, 0x03);
+   rt2800_rfcsr_write(rt2x00dev, 36, 0xbd);
+   rt2800_rfcsr_write(rt2x00dev, 37, 0x3c);
+   rt2800_rfcsr_write(rt2x00dev, 38, 0x5f);
+   rt2800_rfcsr_write(rt2x00dev, 39, 0xc5);
+   rt2800_rfcsr_write(rt2x00dev, 40, 0x33);
+-  rt2800_rfcsr_write(rt2x00dev, 41, 0x5b);
+-  rt2800_rfcsr_write(rt2x00dev, 42, 0x5b);
++  rfcsr = 0x52;
++  if (tx0_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 41, rfcsr);
++  rfcsr = 0x52;
++  if (tx1_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 42, rfcsr);
+   rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
+@@ -4085,15 +4108,20 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
+   rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
+   rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 50, 0x2d);
+-  rt2800_rfcsr_write(rt2x00dev, 51, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 52, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 53, 0x52);
+-  rt2800_rfcsr_write(rt2x00dev, 54, 0x1b);
+-  rt2800_rfcsr_write(rt2x00dev, 55, 0x7f

[OpenWrt-Devel] [PATCH 2/3] AA: mac80211/rt2x00: backport r34269

2012-11-25 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de
---
 .../patches/623-rt2x00-rf_vals-rt3352-xtal20.patch | 121 +
 .../generic/files/include/linux/rt2x00_platform.h  |   1 +
 2 files changed, 122 insertions(+)
 create mode 100644 
package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch

diff --git a/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch 
b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
new file mode 100644
index 000..e240488
--- /dev/null
+++ b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
@@ -0,0 +1,121 @@
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2800lib.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5072,6 +5072,27 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = rt2x00dev-spec;
+@@ -5149,7 +5170,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5157,6 +5177,12 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec-num_channels = 14;
+   spec-channels = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec-num_channels = 14;
++  if (spec-clk_is_20mhz)
++  spec-channels = rf_vals_xtal20mhz_3x;
++  else
++  spec-channels = rf_vals_3x;
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_3x);
+@@ -5250,6 +5276,19 @@ static int rt2800_probe_hw_mode(struct r
+   return 0;
+ }
+ 
++int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
++{
++  struct rt2x00_platform_data *pdata = rt2x00dev-dev-platform_data;
++  struct hw_mode_spec *spec = rt2x00dev-spec;
++
++  if (!pdata)
++  return -EINVAL;
++
++  spec-clk_is_20mhz = pdata-clk_is_20mhz;
++
++  return 0;
++}
++
+ int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
+ {
+   int retval;
+@@ -5275,6 +5314,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
+   rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
+ 
+   /*
++   * Probe SoC clock.
++   */
++  if (rt2x00_is_soc(rt2x00dev)) {
++  retval = rt2800_probe_clk(rt2x00dev);
++  if (retval)
++  return retval;
++  }
++
++  /*
+* Initialize hw specifications.
+*/
+   retval = rt2800_probe_hw_mode(rt2x00dev);
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2x00.h
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -421,6 +421,7 @@ static inline struct rt2x00_intf* vif_to
+  * @channels: Device/chipset specific channel values (See struct rf_channel).
+  * @channels_info: Additional information for channels (See struct 
channel_info).
+  * @ht: Driver HT Capabilities (See ieee80211_sta_ht_cap).
++ * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
+  */
+ struct hw_mode_spec {
+   unsigned int supported_bands;
+@@ -437,6 +438,7 @@ struct hw_mode_spec {
+   const struct channel_info *channels_info;
+ 
+   struct ieee80211_sta_ht_cap ht;
++  int clk_is_20mhz;
+ };
+ 
+ /*
+Index: compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+===
+--- compat-wireless-2012-09-07.orig/include/linux/rt2x00_platform.h
 compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+@@ -18,6 +18,7 @@ struct rt2x00_platform_data

[OpenWrt-Devel] [PATCH 3/3] AA: ramips: backport r34270

2012-11-25 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de
---
 .../ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h  | 2 ++
 target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c   | 8 
 2 files changed, 10 insertions(+)

diff --git 
a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h 
b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
index 949232d..943facb 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
@@ -111,6 +111,8 @@
 #define RT5350_SYSCFG0_DRAM_SIZE_32M   3
 #define RT5350_SYSCFG0_DRAM_SIZE_64M   4
 
+#define RT3352_SYSCFG0_XTAL_SELBIT(20)
+
 #define RT3352_SYSCFG1_USB0_HOST_MODE  BIT(10)
 
 #define RT3352_CLKCFG1_UPHY0_CLK_ENBIT(18)
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c 
b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
index 92ae56d..56eae8a 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
@@ -215,7 +215,15 @@ static struct platform_device rt305x_wifi_device = {
 
 void __init rt305x_register_wifi(void)
 {
+   u32 t;
rt305x_wifi_data.eeprom_file_name = RT305X.eeprom;
+
+   if (soc_is_rt3352() || soc_is_rt5350()) {
+   t = rt305x_sysc_rr(SYSC_REG_SYSTEM_CONFIG);
+   t = RT3352_SYSCFG0_XTAL_SEL;
+   if (!t)
+   rt305x_wifi_data.clk_is_20mhz = 1;
+   }
platform_device_register(rt305x_wifi_device);
 }
 
-- 
1.8.0



pgpZToxLtUrN4.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [package] xtables-addons: update to version 2.0

2012-11-21 Thread Daniel Golle
also update the use of nf_conntrack_helper in OpenWrt-added rtsp-conntrack
(which otherwise breaks at compile-time)

Signed-off-by: Daniel Golle dgo...@allnet.de

 delete mode 100644 net/xtables-addons/patches/003-redundant-bracket.patch

diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile
index 4d3af54..73570cd 100644
--- a/net/xtables-addons/Makefile
+++ b/net/xtables-addons/Makefile
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=xtables-addons
-PKG_VERSION:=1.45
+PKG_VERSION:=2.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=802d2f556a5e545f44e4b69937bf8490
+PKG_MD5SUM:=26b1b1dbb4a8faff24597723ebde04c9
 PKG_SOURCE_URL:=@SF/xtables-addons
 PKG_BUILD_DEPENDS:=iptables
 PKG_INSTALL:=1
diff --git a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch 
b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch
index 87385fd..8dc6384 100644
--- a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch
+++ b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -11617,7 +11617,7 @@ regular_CFLAGS=-Wall -Waggregate-return
+@@ -11892,7 +11892,7 @@ regular_CFLAGS=-Wall -Waggregate-return
  if test -n $kbuilddir; then
{ $as_echo $as_me:${as_lineno-$LINENO}: checking kernel version that 
we will build against 5
  $as_echo_n checking kernel version that we will build against...  6; }
@@ -11,7 +11,7 @@
krel=${krel:${#kmajor}};
 --- a/configure.ac
 +++ b/configure.ac
-@@ -43,7 +43,7 @@ regular_CFLAGS=-Wall -Waggregate-return
+@@ -44,7 +44,7 @@ regular_CFLAGS=-Wall -Waggregate-return
  
  if test -n $kbuilddir; then
AC_MSG_CHECKING([kernel version that we will build against])
diff --git a/net/xtables-addons/patches/003-redundant-bracket.patch 
b/net/xtables-addons/patches/003-redundant-bracket.patch
deleted file mode 100644
index d35c430..000
--- a/net/xtables-addons/patches/003-redundant-bracket.patch
+++ /dev/null
@@ -1,11 +0,0 @@
 a/configure.ac
-+++ b/configure.ac
-@@ -30,7 +30,7 @@ xtlibdir=$(pkg-config --variable=xtlibd
- 
- AC_ARG_WITH([xtlibdir],
-   AS_HELP_STRING([--with-xtlibdir=PATH],
--  [Path where to install Xtables extensions [[autodetect),
-+  [Path where to install Xtables extensions [[autodetect]]]),
-   [xtlibdir=$withval])
- AC_MSG_CHECKING([Xtables module directory])
- AC_MSG_RESULT([$xtlibdir])
diff --git a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch 
b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch
index 1e155ce..299a394 100644
--- a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch
+++ b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch
@@ -734,7 +734,7 @@
 +  } else {
 +  sprintf(tmpname, rtsp-%d, i);
 +  }
-+  hlpr-name = tmpname;
++  strncpy(hlpr-name, tmpname, sizeof(hlpr-name));
 +
 +  pr_debug(port #%d: %d\n, i, ports[i]);
 +
@@ -1327,7 +1327,7 @@
  -include ${M}/Kbuild.*
 --- a/mconfig
 +++ b/mconfig
-@@ -26,3 +26,4 @@ build_lscan=m
+@@ -24,3 +24,4 @@ build_lscan=m
  build_pknock=m
  build_psd=m
  build_quota2=m
diff --git a/net/xtables-addons/patches/200-add-lua-packetscript.patch 
b/net/xtables-addons/patches/200-add-lua-packetscript.patch
index 03fe5fa..c2731b7 100644
--- a/net/xtables-addons/patches/200-add-lua-packetscript.patch
+++ b/net/xtables-addons/patches/200-add-lua-packetscript.patch
@@ -18216,14 +18216,14 @@
  -include ${M}/Kbuild.*
 --- a/extensions/Mbuild
 +++ b/extensions/Mbuild
-@@ -26,3 +26,4 @@ obj-${build_pknock}  += pknock/
+@@ -24,3 +24,4 @@ obj-${build_pknock}  += pknock/
  obj-${build_psd} += libxt_psd.so
  obj-${build_quota2}  += libxt_quota2.so
  obj-${build_gradm}   += libxt_gradm.so
 +obj-${build_LUA} += LUA/
 --- a/mconfig
 +++ b/mconfig
-@@ -27,3 +27,4 @@ build_pknock=m
+@@ -25,3 +25,4 @@ build_pknock=m
  build_psd=m
  build_quota2=m
  build_rtsp=m
-- 
1.8.0



pgpqS7aUTmmQb.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] [package] xtables-addons: update to version 2.0

2012-11-21 Thread Daniel Golle
also update the use of nf_conntrack_helper in OpenWrt-added rtsp-conntrack
and add a compatibility patch to distinguish between pre-3.6.0 and post-3.6.0
kernels.

Signed-off-by: Daniel Golle dgo...@allnet.de

 delete mode 100644 net/xtables-addons/patches/003-redundant-bracket.patch
 create mode 100644 
net/xtables-addons/patches/101-rtsp-conntrack-compatibility.patch

diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile
index 4d3af54..73570cd 100644
--- a/net/xtables-addons/Makefile
+++ b/net/xtables-addons/Makefile
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=xtables-addons
-PKG_VERSION:=1.45
+PKG_VERSION:=2.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=802d2f556a5e545f44e4b69937bf8490
+PKG_MD5SUM:=26b1b1dbb4a8faff24597723ebde04c9
 PKG_SOURCE_URL:=@SF/xtables-addons
 PKG_BUILD_DEPENDS:=iptables
 PKG_INSTALL:=1
diff --git a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch 
b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch
index 87385fd..8dc6384 100644
--- a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch
+++ b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -11617,7 +11617,7 @@ regular_CFLAGS=-Wall -Waggregate-return
+@@ -11892,7 +11892,7 @@ regular_CFLAGS=-Wall -Waggregate-return
  if test -n $kbuilddir; then
{ $as_echo $as_me:${as_lineno-$LINENO}: checking kernel version that 
we will build against 5
  $as_echo_n checking kernel version that we will build against...  6; }
@@ -11,7 +11,7 @@
krel=${krel:${#kmajor}};
 --- a/configure.ac
 +++ b/configure.ac
-@@ -43,7 +43,7 @@ regular_CFLAGS=-Wall -Waggregate-return
+@@ -44,7 +44,7 @@ regular_CFLAGS=-Wall -Waggregate-return
  
  if test -n $kbuilddir; then
AC_MSG_CHECKING([kernel version that we will build against])
diff --git a/net/xtables-addons/patches/003-redundant-bracket.patch 
b/net/xtables-addons/patches/003-redundant-bracket.patch
deleted file mode 100644
index d35c430..000
--- a/net/xtables-addons/patches/003-redundant-bracket.patch
+++ /dev/null
@@ -1,11 +0,0 @@
 a/configure.ac
-+++ b/configure.ac
-@@ -30,7 +30,7 @@ xtlibdir=$(pkg-config --variable=xtlibd
- 
- AC_ARG_WITH([xtlibdir],
-   AS_HELP_STRING([--with-xtlibdir=PATH],
--  [Path where to install Xtables extensions [[autodetect),
-+  [Path where to install Xtables extensions [[autodetect]]]),
-   [xtlibdir=$withval])
- AC_MSG_CHECKING([Xtables module directory])
- AC_MSG_RESULT([$xtlibdir])
diff --git a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch 
b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch
index 1e155ce..299a394 100644
--- a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch
+++ b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch
@@ -734,7 +734,7 @@
 +  } else {
 +  sprintf(tmpname, rtsp-%d, i);
 +  }
-+  hlpr-name = tmpname;
++  strncpy(hlpr-name, tmpname, sizeof(hlpr-name));
 +
 +  pr_debug(port #%d: %d\n, i, ports[i]);
 +
@@ -1327,7 +1327,7 @@
  -include ${M}/Kbuild.*
 --- a/mconfig
 +++ b/mconfig
-@@ -26,3 +26,4 @@ build_lscan=m
+@@ -24,3 +24,4 @@ build_lscan=m
  build_pknock=m
  build_psd=m
  build_quota2=m
diff --git a/net/xtables-addons/patches/101-rtsp-conntrack-compatibility.patch 
b/net/xtables-addons/patches/101-rtsp-conntrack-compatibility.patch
new file mode 100644
index 000..40fadea
--- /dev/null
+++ b/net/xtables-addons/patches/101-rtsp-conntrack-compatibility.patch
@@ -0,0 +1,14 @@
+--- a/extensions/rtsp/nf_conntrack_rtsp.c
 b/extensions/rtsp/nf_conntrack_rtsp.c
+@@ -496,7 +496,11 @@ init(void)
+   } else {
+   sprintf(tmpname, rtsp-%d, i);
+   }
++#if LINUX_VERSION_CODE = KERNEL_VERSION(3,6,0)
+   strncpy(hlpr-name, tmpname, sizeof(hlpr-name));
++#else
++  hlpr-name = tmpname;
++#endif
+ 
+   pr_debug(port #%d: %d\n, i, ports[i]);
+ 
diff --git a/net/xtables-addons/patches/200-add-lua-packetscript.patch 
b/net/xtables-addons/patches/200-add-lua-packetscript.patch
index 03fe5fa..c2731b7 100644
--- a/net/xtables-addons/patches/200-add-lua-packetscript.patch
+++ b/net/xtables-addons/patches/200-add-lua-packetscript.patch
@@ -18216,14 +18216,14 @@
  -include ${M}/Kbuild.*
 --- a/extensions/Mbuild
 +++ b/extensions/Mbuild
-@@ -26,3 +26,4 @@ obj-${build_pknock}  += pknock/
+@@ -24,3 +24,4 @@ obj-${build_pknock}  += pknock/
  obj-${build_psd} += libxt_psd.so
  obj-${build_quota2}  += libxt_quota2.so
  obj-${build_gradm}   += libxt_gradm.so
 +obj-${build_LUA} += LUA/
 --- a/mconfig
 +++ b/mconfig
-@@ -27,3 +27,4 @@ build_pknock=m
+@@ -25,3 +25,4 @@ build_pknock=m
  build_psd=m
  build_quota2=m
  build_rtsp=m
-- 
1.8.0



pgpZNcwqAqAGD.pgp
Description: PGP signature

[OpenWrt-Devel] [PATCH 2/2 v5] mac80211/rt2x00: add rf_vals for Rt3352 with Xtal=20MHz

2012-11-19 Thread Daniel Golle
Now it should really work, please test and ack' if it finally does the job.
(I still don't have any such hardware to test)

--

Add function rt2800_probe_clk which detects if 20MHz clock is used on WiSoCs
via rt2x00_platform_data. This is then used in rt2800_probe_hw_mode to decide
whether to use rf_vals_3x or rf_vals_xtal20mhz_3x.

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch 
b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
new file mode 100644
index 000..e240488
--- /dev/null
+++ b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
@@ -0,0 +1,121 @@
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2800lib.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5072,6 +5072,27 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = rt2x00dev-spec;
+@@ -5149,7 +5170,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5157,6 +5177,12 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec-num_channels = 14;
+   spec-channels = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec-num_channels = 14;
++  if (spec-clk_is_20mhz)
++  spec-channels = rf_vals_xtal20mhz_3x;
++  else
++  spec-channels = rf_vals_3x;
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_3x);
+@@ -5250,6 +5276,19 @@ static int rt2800_probe_hw_mode(struct r
+   return 0;
+ }
+ 
++int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
++{
++  struct rt2x00_platform_data *pdata = rt2x00dev-dev-platform_data;
++  struct hw_mode_spec *spec = rt2x00dev-spec;
++
++  if (!pdata)
++  return -EINVAL;
++
++  spec-clk_is_20mhz = pdata-clk_is_20mhz;
++
++  return 0;
++}
++
+ int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
+ {
+   int retval;
+@@ -5275,6 +5314,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
+   rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
+ 
+   /*
++   * Probe SoC clock.
++   */
++  if (rt2x00_is_soc(rt2x00dev)) {
++  retval = rt2800_probe_clk(rt2x00dev);
++  if (retval)
++  return retval;
++  }
++
++  /*
+* Initialize hw specifications.
+*/
+   retval = rt2800_probe_hw_mode(rt2x00dev);
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2x00.h
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -421,6 +421,7 @@ static inline struct rt2x00_intf* vif_to
+  * @channels: Device/chipset specific channel values (See struct rf_channel).
+  * @channels_info: Additional information for channels (See struct 
channel_info).
+  * @ht: Driver HT Capabilities (See ieee80211_sta_ht_cap).
++ * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
+  */
+ struct hw_mode_spec {
+   unsigned int supported_bands;
+@@ -437,6 +438,7 @@ struct hw_mode_spec {
+   const struct channel_info *channels_info;
+ 
+   struct ieee80211_sta_ht_cap ht;
++  int clk_is_20mhz;
+ };
+ 
+ /*
+Index: compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+===
+--- compat-wireless-2012-09-07.orig/include/linux/rt2x00_platform.h
 compat-wireless-2012-09-07/include/linux

[OpenWrt-Devel] [PATCH 1/2 v4] mac80211/rt2x00: support Rt3352 with external PA

2012-11-16 Thread Daniel Golle
This is needed for WiFi to work e.g. on DIR-615 rev.H1.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch

diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
new file mode 100644
index 000..8015a12
--- /dev/null
+++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
@@ -0,0 +1,212 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -2271,15 +2271,18 @@ static void rt2800_config_channel(struct
+   /*
+* Change BBP settings
+*/
++  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
++
+   if (rt2x00_rt(rt2x00dev, RT3352)) {
+   rt2800_bbp_write(rt2x00dev, 27, 0x0);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 27, 0x20);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 86, 0x38);
++  rt2800_bbp_write(rt2x00dev, 83, 0x6a);
+   } else {
+-  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 86, 0);
+   }
+ 
+@@ -3850,6 +3853,7 @@ static int rt2800_init_rfcsr(struct rt2x
+* Init RF calibration.
+*/
+   if (rt2x00_rt(rt2x00dev, RT3290) ||
++  rt2x00_rt(rt2x00dev, RT3352) ||
+   rt2x00_rt(rt2x00dev, RT5390) ||
+   rt2x00_rt(rt2x00dev, RT5392)) {
+   rt2800_rfcsr_read(rt2x00dev, 2, rfcsr);
+@@ -4036,6 +4040,10 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
+   return 0;
+   } else if (rt2x00_rt(rt2x00dev, RT3352)) {
++  int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0,
++rt2x00dev-cap_flags);
++  int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1,
++rt2x00dev-cap_flags);
+   rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
+   rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
+   rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
+@@ -4069,15 +4077,30 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 34, 0x01);
++  rfcsr =  0x01;
++  if (!tx0_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX0_EXT_PA, 1);
++  if (!tx1_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX1_EXT_PA, 1);
++  rt2800_rfcsr_write(rt2x00dev, 34, rfcsr );
+   rt2800_rfcsr_write(rt2x00dev, 35, 0x03);
+   rt2800_rfcsr_write(rt2x00dev, 36, 0xbd);
+   rt2800_rfcsr_write(rt2x00dev, 37, 0x3c);
+   rt2800_rfcsr_write(rt2x00dev, 38, 0x5f);
+   rt2800_rfcsr_write(rt2x00dev, 39, 0xc5);
+   rt2800_rfcsr_write(rt2x00dev, 40, 0x33);
+-  rt2800_rfcsr_write(rt2x00dev, 41, 0x5b);
+-  rt2800_rfcsr_write(rt2x00dev, 42, 0x5b);
++  rfcsr = 0x52;
++  if (tx0_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 41, rfcsr);
++  rfcsr = 0x52;
++  if (tx1_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 42, rfcsr);
+   rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
+@@ -4085,15 +4108,20 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
+   rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
+   rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 50, 0x2d);
+-  rt2800_rfcsr_write(rt2x00dev, 51, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 52, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 53, 0x52);
+-  rt2800_rfcsr_write(rt2x00dev, 54, 0x1b);
+-  rt2800_rfcsr_write(rt2x00dev, 55, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 56, 0x00

[OpenWrt-Devel] [PATCH 2/2 v4] mac80211/rt2x00: add rf_vals for Rt3352 with Xtal=20MHz

2012-11-16 Thread Daniel Golle
Detect 20Mhz clock during board-setup of the Rt3352 and Rt5350 and make the
value available to rt2x00 via rt2x00_platform_data.
This is then used to select rf_vals according to whether the clock runs at 40MHz
or at 20MHz in rt2x00.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch

diff --git a/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch 
b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
new file mode 100644
index 000..5ee6627
--- /dev/null
+++ b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
@@ -0,0 +1,89 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5072,6 +5072,27 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = rt2x00dev-spec;
+@@ -5149,7 +5170,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5157,6 +5177,12 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec-num_channels = 14;
+   spec-channels = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec-num_channels = 14;
++  if (spec-is_clk_20mhz)
++  spec-channels = rf_vals_xtal20mhz_3x;
++  else
++  spec-channels = rf_vals_3x;
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_3x);
+--- a/drivers/net/wireless/rt2x00/rt2x00.h
 b/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -421,6 +421,7 @@ static inline struct rt2x00_intf* vif_to
+  * @channels: Device/chipset specific channel values (See struct rf_channel).
+  * @channels_info: Additional information for channels (See struct 
channel_info).
+  * @ht: Driver HT Capabilities (See ieee80211_sta_ht_cap).
++ * @is_clk_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
+  */
+ struct hw_mode_spec {
+   unsigned int supported_bands;
+@@ -437,6 +438,7 @@ struct hw_mode_spec {
+   const struct channel_info *channels_info;
+ 
+   struct ieee80211_sta_ht_cap ht;
++  int is_clk_20mhz;
+ };
+ 
+ /*
+--- a/include/linux/rt2x00_platform.h
 b/include/linux/rt2x00_platform.h
+@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
+ 
+   int disable_2ghz;
+   int disable_5ghz;
++  int is_clk_20mhz;
+ };
+ 
+ #endif /* _RT2X00_PLATFORM_H */
+--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
 b/drivers/net/wireless/rt2x00/rt2x00dev.c
+@@ -854,6 +854,7 @@ static int rt2x00lib_probe_hw_modes(stru
+   spec-supported_bands = ~SUPPORT_BAND_2GHZ;
+   if (pdata-disable_5ghz)
+   spec-supported_bands = ~SUPPORT_BAND_5GHZ;
++  spec-is_clk_20mhz = pdata-is_clk_20mhz;
+   }
+ 
+   if ((spec-supported_bands  SUPPORT_BAND_BOTH) == 0) {
diff --git a/target/linux/generic/files/include/linux/rt2x00_platform.h 
b/target/linux/generic/files/include/linux/rt2x00_platform.h
index e10377e..80483ef 100644
--- a/target/linux/generic/files/include/linux/rt2x00_platform.h
+++ b/target/linux/generic/files/include/linux/rt2x00_platform.h
@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
 
int disable_2ghz;
int disable_5ghz;
+   int is_clk_20mhz;
 };
 
 #endif /* _RT2X00_PLATFORM_H */
diff --git 
a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h 
b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
index 949232d..81c0a44 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
@@ -110,6 +110,7 @@
 #define RT5350_SYSCFG0_DRAM_SIZE_16M   2
 #define

Re: [OpenWrt-Devel] [PATCH 2/2] mac80211/rt2x00: add rf_vals for Rt3352 with Xtal=20MHz

2012-11-13 Thread Daniel Golle
Hi Serge,

thanks for the review and the patience :)
I'll fix that inverted if ... then ... else block and maybe also rename xtal20
in rt2x00_platform_data to be clk_is_20mhz, as that would be more consistent
(ath9k_platform_data which got a clk_is_25mhz flag for a similar purpose).

Cheers


Daniel

On 13/11/12 08:19, Сергей Василюгин wrote:
 Hi
 
 Looks good but something wrong with if-logic (see below)

[...]

 ++ } else if (rt2x00_rf(rt2x00dev, RF3322)) {
 ++ spec-num_channels = 14;
 ++ if (spec-xtal_freq == XTAL_FREQ_20MHZ)
 ^
 ++ spec-channels = rf_vals_3x;
 ++ else
 ++ spec-channels = rf_vals_xtal20mhz_3x;
 ^^
 I think you meen == XTAL_FREQ_40MHZ
Yeah, right, I got it exactly the wrong way around :(
Should rather be
if (spec-xtal_freq == XTAL_FREQ_20MHZ)
spec-channels = rf_vals_xtal20mhz_3x;
else
spec-channels = rf_vals_3x;


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


[OpenWrt-Devel] [PATCH 1/2 v3] mac80211/rt2x00: support Rt3352 with external PA

2012-11-13 Thread Daniel Golle
This is needed for WiFi to work e.g. on DIR-615 rev.H1.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch

diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
new file mode 100644
index 000..ab4f7b3
--- /dev/null
+++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
@@ -0,0 +1,207 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -2271,15 +2271,18 @@ static void rt2800_config_channel(struct
+   /*
+* Change BBP settings
+*/
++  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
++
+   if (rt2x00_rt(rt2x00dev, RT3352)) {
+   rt2800_bbp_write(rt2x00dev, 27, 0x0);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 27, 0x20);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 86, 0x38);
++  rt2800_bbp_write(rt2x00dev, 83, 0x6a);
+   } else {
+-  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 86, 0);
+   }
+ 
+@@ -3850,6 +3853,7 @@ static int rt2800_init_rfcsr(struct rt2x
+* Init RF calibration.
+*/
+   if (rt2x00_rt(rt2x00dev, RT3290) ||
++  rt2x00_rt(rt2x00dev, RT3352) ||
+   rt2x00_rt(rt2x00dev, RT5390) ||
+   rt2x00_rt(rt2x00dev, RT5392)) {
+   rt2800_rfcsr_read(rt2x00dev, 2, rfcsr);
+@@ -4036,6 +4040,10 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
+   return 0;
+   } else if (rt2x00_rt(rt2x00dev, RT3352)) {
++  int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0,
++rt2x00dev-cap_flags);
++  int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1,
++rt2x00dev-cap_flags);
+   rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
+   rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
+   rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
+@@ -4069,15 +4077,30 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 34, 0x01);
++  rfcsr =  0x01;
++  if (!tx0_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX0_EXT_PA, 1);
++  if (!tx1_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX1_EXT_PA, 1);
++  rt2800_rfcsr_write(rt2x00dev, 34, rfcsr );
+   rt2800_rfcsr_write(rt2x00dev, 35, 0x03);
+   rt2800_rfcsr_write(rt2x00dev, 36, 0xbd);
+   rt2800_rfcsr_write(rt2x00dev, 37, 0x3c);
+   rt2800_rfcsr_write(rt2x00dev, 38, 0x5f);
+   rt2800_rfcsr_write(rt2x00dev, 39, 0xc5);
+   rt2800_rfcsr_write(rt2x00dev, 40, 0x33);
+-  rt2800_rfcsr_write(rt2x00dev, 41, 0x5b);
+-  rt2800_rfcsr_write(rt2x00dev, 42, 0x5b);
++  rfcsr = 0x52;
++  if (tx0_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 41, rfcsr);
++  rfcsr = 0x52;
++  if (tx1_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 42, rfcsr);
+   rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
+@@ -4085,15 +4108,20 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
+   rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
+   rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 50, 0x2d);
+-  rt2800_rfcsr_write(rt2x00dev, 51, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 52, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 53, 0x52);
+-  rt2800_rfcsr_write(rt2x00dev, 54, 0x1b);
+-  rt2800_rfcsr_write(rt2x00dev, 55, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 56, 0x00

[OpenWrt-Devel] [PATCH 2/2 v3] mac80211/rt2x00: add rf_vals for Rt3352 with Xtal=20MHz

2012-11-13 Thread Daniel Golle
Though rt2x00lib_probe_hw_modes seems to be the least-intrusive opportunity to
introduce that change, I wonder if it's actually the right place[tm] to do it.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch

diff --git a/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch 
b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
new file mode 100644
index 000..e060f9a
--- /dev/null
+++ b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
@@ -0,0 +1,97 @@
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2800lib.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5067,6 +5067,27 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = rt2x00dev-spec;
+@@ -5144,7 +5165,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5152,6 +5172,12 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec-num_channels = 14;
+   spec-channels = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec-num_channels = 14;
++  if (spec-clk_is_20mhz)
++  spec-channels = rf_vals_xtal20mhz_3x;
++  else
++  spec-channels = rf_vals_3x;
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_3x);
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2x00.h
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -421,6 +421,7 @@ static inline struct rt2x00_intf* vif_to
+  * @channels: Device/chipset specific channel values (See struct rf_channel).
+  * @channels_info: Additional information for channels (See struct 
channel_info).
+  * @ht: Driver HT Capabilities (See ieee80211_sta_ht_cap).
++ * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
+  */
+ struct hw_mode_spec {
+   unsigned int supported_bands;
+@@ -437,6 +438,7 @@ struct hw_mode_spec {
+   const struct channel_info *channels_info;
+ 
+   struct ieee80211_sta_ht_cap ht;
++  int clk_is_20mhz;
+ };
+ 
+ /*
+Index: compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+===
+--- compat-wireless-2012-09-07.orig/include/linux/rt2x00_platform.h
 compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
+ 
+   int disable_2ghz;
+   int disable_5ghz;
++  int clk_is_20mhz;
+ };
+ 
+ #endif /* _RT2X00_PLATFORM_H */
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00dev.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2x00dev.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00dev.c
+@@ -854,6 +854,7 @@ static int rt2x00lib_probe_hw_modes(stru
+   spec-supported_bands = ~SUPPORT_BAND_2GHZ;
+   if (pdata-disable_5ghz)
+   spec-supported_bands = ~SUPPORT_BAND_5GHZ;
++  spec-clk_is_20mhz = pdata-clk_is_20mhz;
+   }
+ 
+   if ((spec-supported_bands  SUPPORT_BAND_BOTH) == 0) {
diff --git a/target/linux/generic/files/include/linux/rt2x00_platform.h 
b/target/linux/generic/files/include/linux/rt2x00_platform.h
index e10377e..80483ef 100644
--- a/target/linux/generic

Re: [OpenWrt-Devel] [PATCH 1/2 v3] mac80211/rt2x00: support Rt3352 with external PA

2012-11-13 Thread Daniel Golle
On 13/11/12 19:12, Сергей Василюгин wrote:
 The same problem with this version on my dir-620 d1. Searching what is 
 broken..
Looks like rt2x00lib_probe_hw_modes isn't actually called on the SoCs... *sigh*
I guess that rt2800pci.c would be the right place to add another function which
copies the is_clk_20mhz flag from platform_data into the spec-struct used in
rt2800lib.c later on...


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


[OpenWrt-Devel] [PATCH 2/2 v4] mac80211/rt2x00: add rf_vals for Rt3352 with Xtal=20MHz

2012-11-13 Thread Daniel Golle
Accessing rt2x00_platform_data directly in rt2800lib is not very beautiful, but
should do the job.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch

diff --git a/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch 
b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
new file mode 100644
index 000..efeb89e
--- /dev/null
+++ b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
@@ -0,0 +1,73 @@
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2800lib.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5067,10 +5067,32 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = rt2x00dev-spec;
+   struct channel_info *info;
++  struct rt2x00_platform_data *pdata;
+   char *default_power1;
+   char *default_power2;
+   unsigned int i;
+@@ -5144,7 +5166,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5152,6 +5173,15 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec-num_channels = 14;
+   spec-channels = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec-num_channels = 14;
++  spec-channels = rf_vals_3x;
++  if (rt2x00_is_soc(rt2x00dev)  rt2x00dev-dev-platform_data) {
++  pdata = rt2x00dev-dev-platform_data;
++  if (pdata-is_clk_20mhz)
++  spec-channels = rf_vals_xtal20mhz_3x;
++  }
++
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_3x);
+Index: compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+===
+--- compat-wireless-2012-09-07.orig/include/linux/rt2x00_platform.h
 compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
+ 
+   int disable_2ghz;
+   int disable_5ghz;
++  int is_clk_20mhz;
+ };
+ 
+ #endif /* _RT2X00_PLATFORM_H */
diff --git a/target/linux/generic/files/include/linux/rt2x00_platform.h 
b/target/linux/generic/files/include/linux/rt2x00_platform.h
index e10377e..d79be84 100644
--- a/target/linux/generic/files/include/linux/rt2x00_platform.h
+++ b/target/linux/generic/files/include/linux/rt2x00_platform.h
@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
 
int disable_2ghz;
int disable_5ghz;
+   int is_clk_20mhz;
 };
 
 #endif /* _RT2X00_PLATFORM_H */
diff --git 
a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h 
b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
index 949232d..81c0a44 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
@@ -110,6 +110,7 @@
 #define RT5350_SYSCFG0_DRAM_SIZE_16M   2
 #define RT5350_SYSCFG0_DRAM_SIZE_32M   3
 #define RT5350_SYSCFG0_DRAM_SIZE_64M   4
+#define RT3352_SYSCFG0_XTAL_SELBIT(20)
 
 #define RT3352_SYSCFG1_USB0_HOST_MODE  BIT(10)
 
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c 
b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
index 92ae56d..92d7b73 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
@@ -215,6 +215,15 @@ static struct platform_device rt305x_wifi_device = {
 
 void __init rt305x_register_wifi(void

Re: [OpenWrt-Devel] [PATCH 2/3] mac80211/rt2x00: differentiate rf_vals for ht20/ht40

2012-11-12 Thread Daniel Golle
Hi!

Thank you for clarifying this one! That was probably a life saver. I should have
google'd the acronym XTAL=Crystal...

So: I'm wondering why it's done in SwitchChannel and not during initialization
in the vendor driver (as it won't ever change in run-time, if I got it right 
now...)
If this depends on the choice of an external crystal and therefore is a constant
specific to the board, it can probably be probed in arch/mips/ramips/... and be
passed to rt2x00 via platform_data.
(Gabor: right?)


Cheers


Daniel

On 12/11/12 05:33, Сергей Василюгин wrote:
 Hi, Daniel
 
 
 And no, No, NO! :)
 
 I pooly explain or you don't pay attention. Xtal20/40MHz external clock/tick 
 generator have no direct relation to HT20/HT40
 but precision of channel frequency only. So for that case we use corrected 
 frequency rf_vals table. And Xtal20/40MHz really must
 be read from SYSC_CFG_REG as in original patch. In my dir-620 d1 Xtal20MHz 
 really exist. rt3050/rt3052 use xtal40MHz (in specs,
 I don't check in my dir-620 a1 (rt3052), tonight I'll check it).
 I think no need to differentiate ht20/ht40.


 
 12.11.2012, 07:06, Daniel Golle dgo...@allnet.de:
 
  Recent Ralink RFs need different rf_vals depending on whether HT20 or HT40 
 is
  being used.

  Signed-off-by: Daniel Golle dgo...@allnet.de

   create mode 100644 package/mac80211/patches/623-differentiate-rf_vals.patch

  diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
 b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
  index 17beaa0..ab4f7b3 100644
  --- a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
  +++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
  @@ -119,7 +119,7 @@
EIRP_MAX_TX_POWER_LIMIT)
__set_bit(CAPABILITY_POWER_LIMIT, rt2x00dev-cap_flags);

  -+ if (rt2x00_rt(rt2x00dev, RT3352) {
  ++ if (rt2x00_rt(rt2x00dev, RT3352)) {
   + if (!rt2x00_get_field16(eeprom,
   +EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
   + __set_bit(CAPABILITY_INTERNAL_PA_TX0,
  diff --git a/package/mac80211/patches/623-differentiate-rf_vals.patch 
 b/package/mac80211/patches/623-differentiate-rf_vals.patch
  new file mode 100644
  index 000..8e569d6
  --- /dev/null
  +++ b/package/mac80211/patches/623-differentiate-rf_vals.patch
  @@ -0,0 +1,211 @@
  +--- a/drivers/net/wireless/rt2x00/rt2400pci.c
   b/drivers/net/wireless/rt2x00/rt2400pci.c
  +@@ -1588,7 +1588,7 @@ static int rt2400pci_probe_hw_mode(struc
  + spec-supported_rates = SUPPORT_RATE_CCK;
  +
  + spec-num_channels = ARRAY_SIZE(rf_vals_b);
  +- spec-channels = rf_vals_b;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_b;
  +
  + /*
  + * Create channel information array
  +--- a/drivers/net/wireless/rt2x00/rt2500pci.c
   b/drivers/net/wireless/rt2x00/rt2500pci.c
  +@@ -1882,23 +1882,23 @@ static int rt2500pci_probe_hw_mode(struc
  +
  + if (rt2x00_rf(rt2x00dev, RF2522)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2522);
  +- spec-channels = rf_vals_bg_2522;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2522;
  + } else if (rt2x00_rf(rt2x00dev, RF2523)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2523);
  +- spec-channels = rf_vals_bg_2523;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2523;
  + } else if (rt2x00_rf(rt2x00dev, RF2524)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2524);
  +- spec-channels = rf_vals_bg_2524;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2524;
  + } else if (rt2x00_rf(rt2x00dev, RF2525)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2525);
  +- spec-channels = rf_vals_bg_2525;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2525;
  + } else if (rt2x00_rf(rt2x00dev, RF2525E)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2525e);
  +- spec-channels = rf_vals_bg_2525e;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2525e;
  + } else if (rt2x00_rf(rt2x00dev, RF5222)) {
  + spec-supported_bands |= SUPPORT_BAND_5GHZ;
  + spec-num_channels = ARRAY_SIZE(rf_vals_5222);
  +- spec-channels = rf_vals_5222;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_5222;
  + }
  +
  + /*
  +--- a/drivers/net/wireless/rt2x00/rt2500usb.c
   b/drivers/net/wireless/rt2x00/rt2500usb.c
  +@@ -1721,23 +1721,23 @@ static int rt2500usb_probe_hw_mode(struc
  +
  + if (rt2x00_rf(rt2x00dev, RF2522)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2522);
  +- spec-channels = rf_vals_bg_2522;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2522;
  + } else if (rt2x00_rf(rt2x00dev, RF2523)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2523);
  +- spec-channels = rf_vals_bg_2523;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2523;
  + } else if (rt2x00_rf(rt2x00dev, RF2524)) {
  + spec-num_channels = ARRAY_SIZE(rf_vals_bg_2524);
  +- spec-channels = rf_vals_bg_2524;
  ++ spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2524;
  + } else if (rt2x00_rf(rt2x00dev, RF2525

[OpenWrt-Devel] [PATCH 1/2] mac80211/rt2x00: support Rt3352 with external PA

2012-11-12 Thread Daniel Golle
This is needed for WiFi to work e.g. on DIR-615 rev.H1.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch

diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
new file mode 100644
index 000..ab4f7b3
--- /dev/null
+++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
@@ -0,0 +1,207 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -2271,15 +2271,18 @@ static void rt2800_config_channel(struct
+   /*
+* Change BBP settings
+*/
++  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
++
+   if (rt2x00_rt(rt2x00dev, RT3352)) {
+   rt2800_bbp_write(rt2x00dev, 27, 0x0);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 27, 0x20);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 86, 0x38);
++  rt2800_bbp_write(rt2x00dev, 83, 0x6a);
+   } else {
+-  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 86, 0);
+   }
+ 
+@@ -3850,6 +3853,7 @@ static int rt2800_init_rfcsr(struct rt2x
+* Init RF calibration.
+*/
+   if (rt2x00_rt(rt2x00dev, RT3290) ||
++  rt2x00_rt(rt2x00dev, RT3352) ||
+   rt2x00_rt(rt2x00dev, RT5390) ||
+   rt2x00_rt(rt2x00dev, RT5392)) {
+   rt2800_rfcsr_read(rt2x00dev, 2, rfcsr);
+@@ -4036,6 +4040,10 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
+   return 0;
+   } else if (rt2x00_rt(rt2x00dev, RT3352)) {
++  int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0,
++rt2x00dev-cap_flags);
++  int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1,
++rt2x00dev-cap_flags);
+   rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
+   rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
+   rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
+@@ -4069,15 +4077,30 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 34, 0x01);
++  rfcsr =  0x01;
++  if (!tx0_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX0_EXT_PA, 1);
++  if (!tx1_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX1_EXT_PA, 1);
++  rt2800_rfcsr_write(rt2x00dev, 34, rfcsr );
+   rt2800_rfcsr_write(rt2x00dev, 35, 0x03);
+   rt2800_rfcsr_write(rt2x00dev, 36, 0xbd);
+   rt2800_rfcsr_write(rt2x00dev, 37, 0x3c);
+   rt2800_rfcsr_write(rt2x00dev, 38, 0x5f);
+   rt2800_rfcsr_write(rt2x00dev, 39, 0xc5);
+   rt2800_rfcsr_write(rt2x00dev, 40, 0x33);
+-  rt2800_rfcsr_write(rt2x00dev, 41, 0x5b);
+-  rt2800_rfcsr_write(rt2x00dev, 42, 0x5b);
++  rfcsr = 0x52;
++  if (tx0_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 41, rfcsr);
++  rfcsr = 0x52;
++  if (tx1_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 42, rfcsr);
+   rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
+@@ -4085,15 +4108,20 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
+   rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
+   rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 50, 0x2d);
+-  rt2800_rfcsr_write(rt2x00dev, 51, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 52, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 53, 0x52);
+-  rt2800_rfcsr_write(rt2x00dev, 54, 0x1b);
+-  rt2800_rfcsr_write(rt2x00dev, 55, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 56, 0x00

[OpenWrt-Devel] [PATCH 2/2] mac80211/rt2x00: add rf_vals for Rt3352 with Xtal=20MHz

2012-11-12 Thread Daniel Golle
Check if Xtal=20MHz is selected in SYSCFG0 reg and make that information
available to rt2x00 via platform_data.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch

diff --git a/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch 
b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
new file mode 100644
index 000..7d85597
--- /dev/null
+++ b/package/mac80211/patches/623-rt2x00-rf_vals-rt3352-xtal20.patch
@@ -0,0 +1,95 @@
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2800lib.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5067,6 +5067,27 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = rt2x00dev-spec;
+@@ -5144,7 +5165,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5152,6 +5172,12 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec-num_channels = 14;
+   spec-channels = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec-num_channels = 14;
++  if (spec-xtal_freq == XTAL_FREQ_20MHZ)
++  spec-channels = rf_vals_3x;
++  else
++  spec-channels = rf_vals_xtal20mhz_3x;
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_3x);
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2x00.h
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -432,6 +432,10 @@ struct hw_mode_spec {
+ #define SUPPORT_RATE_CCK  0x0001
+ #define SUPPORT_RATE_OFDM 0x0002
+ 
++  unsigned int xtal_freq;
++#define XTAL_FREQ_40MHZ   0x0
++#define XTAL_FREQ_20MHZ   0x1
++
+   unsigned int num_channels;
+   const struct rf_channel *channels;
+   const struct channel_info *channels_info;
+Index: compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+===
+--- compat-wireless-2012-09-07.orig/include/linux/rt2x00_platform.h
 compat-wireless-2012-09-07/include/linux/rt2x00_platform.h
+@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
+ 
+   int disable_2ghz;
+   int disable_5ghz;
++  int xtal20;
+ };
+ 
+ #endif /* _RT2X00_PLATFORM_H */
+Index: compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00dev.c
+===
+--- compat-wireless-2012-09-07.orig/drivers/net/wireless/rt2x00/rt2x00dev.c
 compat-wireless-2012-09-07/drivers/net/wireless/rt2x00/rt2x00dev.c
+@@ -854,6 +854,10 @@ static int rt2x00lib_probe_hw_modes(stru
+   spec-supported_bands = ~SUPPORT_BAND_2GHZ;
+   if (pdata-disable_5ghz)
+   spec-supported_bands = ~SUPPORT_BAND_5GHZ;
++  if (pdata-xtal20)
++  spec-xtal_freq = XTAL_FREQ_20MHZ;
++  else
++  spec-xtal_freq = XTAL_FREQ_40MHZ;
+   }
+ 
+   if ((spec-supported_bands  SUPPORT_BAND_BOTH) == 0) {
diff --git a/target/linux/generic/files/include/linux/rt2x00_platform.h 
b/target/linux/generic/files/include/linux/rt2x00_platform.h
index e10377e..3c7c7a2 100644
--- a/target/linux/generic/files/include/linux/rt2x00_platform.h
+++ b/target/linux/generic/files/include/linux/rt2x00_platform.h
@@ -18,6 +18,7 @@ struct

[OpenWrt-Devel] [PATCH] ramips: enable DSP extensions on supported platforms

2012-11-12 Thread Daniel Golle
I don't think its actually used anywhere, but GCC supports generating code for
it, both explicitely and also by using the generic vector extension.
I carried this around in my tree for a while and it at least didn't cause any
trouble so far.
And I got no idea if Rt288x comes with MIPS DSP ASE.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 target/linux/ramips/rt305x/target.mk | 1 +
 target/linux/ramips/rt3883/target.mk | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ramips/rt305x/target.mk 
b/target/linux/ramips/rt305x/target.mk
index 2c78756..a403d26 100644
--- a/target/linux/ramips/rt305x/target.mk
+++ b/target/linux/ramips/rt305x/target.mk
@@ -4,6 +4,7 @@
 
 SUBTARGET:=rt305x
 BOARDNAME:=RT305x based boards
+CFLAGS+= -mdsp
 
 define Target/Description
Build firmware images for Ralink RT305x based boards.
diff --git a/target/linux/ramips/rt3883/target.mk 
b/target/linux/ramips/rt3883/target.mk
index 590bb98..0d27ba1 100644
--- a/target/linux/ramips/rt3883/target.mk
+++ b/target/linux/ramips/rt3883/target.mk
@@ -4,6 +4,7 @@
 
 SUBTARGET:=rt3883
 BOARDNAME:=RT3662/RT3883 based boards
+CFLAGS+= -mdspr2
 
 define Target/Description
Build firmware images for Ralink RT3662/RT3883 based boards.
-- 
1.8.0



pgpOCYpVFqBM1.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Allow to build kmod-ssb-gige as module for brcm47xx

2012-11-11 Thread Daniel Golle
Hi Soma,

On 11/11/12 13:33, Manuel Munz wrote:
 Without this patch imagebuilder fails to build images for bcm4705*
 targets which depend on kmod-ssb-gige because no kmod-package was built.
 I don't have any hardware to test if it is still properly built into the
 images, so please review/test.
 
 Signed-off-by: Manuel Munz freif...@somakoma.de
 
 Index: target/linux/brcm47xx/modules.mk
 ===
 --- target/linux/brcm47xx/modules.mk  (Revision 34135)
 +++ target/linux/brcm47xx/modules.mk  (Arbeitskopie)
 @@ -26,6 +26,8 @@
KCONFIG:=CONFIG_SSB_DRIVER_GIGE=y
DEPENDS:=@TARGET_brcm47xx +kmod-tg3
SUBMENU:=$(NETWORK_DEVICES_MENU)
 +  FILES:=$(LINUX_DIR)/drivers/ssb/driver_gige.o
Shouldn't it rather be .ko?
Maybe you also beed to replace
KCONFIG:=CONFIG_SSB_DRIVER_GIGE=y
by
KCONFIG:=CONFIG_SSB_DRIVER_GIGE
so it would actually build it as a module and a .ko gets created.



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


Re: [OpenWrt-Devel] [PATCH v3 0/7] [ar7] AudioCodes AC49x sub-target

2012-11-11 Thread Daniel Golle
On 11/11/12 18:12, Florian Fainelli wrote:
 On Wednesday 17 October 2012 15:46:44 Daniel Golle wrote:
 Some more cleanup was done:
 AC49x is now a sub-target (instead of a separate machine) also in the kernel.
 This further reduces the foot-print of this addition...

 Daniel Golle (7):
   [ar7] free memory below kernel offset
   [ar7] add AudioCodes AC49x platform support to kernel
   [ar7] support AC49x bootloader environment
   [ar7] detect AC49x flash partitions
   [ar7] create generic subtarget
   [ar7] create AC49x subtarget
   [ar7] generate image for AC49x
 
 Applied in r34143 - r34149 thanks Daniel! I successfully boot tested these
 patches on several AR7 boards.
 

Thanks for including!

AC49x also boots fine with OpenWrt trunk (tried both, Kernel 3.3.8 and 3.6.6) 
now:
Flash found: MX29LV640DBTC
Press ESC for monitor... 221

(ac494bl)
[boot 84] attempt (0) trying to boot from (BOOTCFG)

Booting...
[0.00] Linux version 3.6.6 (daniel@localhost.localdomain) (gcc version
4.6.4 20121001 (prerelease) (Linaro GCC 4.6-2012.10) ) #1 Mon Nov 12 01:37:00
IST 2012
[0.00] titan-gpio: registered 51 GPIOs
[0.00] bootconsole [early0] enabled
[0.00] CPU revision is: 00018448 (MIPS 4KEc)
[0.00] AudioCodes AC49x, ID: 0x0007, Revision: 0x02
[0.00] Determined physical RAM map:
[0.00]  memory: 0100 @ 1400 (usable)
[0.00] Initrd not found or empty - disabling initrd
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x1400-0x14ff]
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x1400-0x14ff]
[0.00] Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
[0.00] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 
bytes
[0.00] Built 1 zonelists in Zone order, mobility grouping off.  Total
pages: 4064
[0.00] Kernel command line:  console=ttyS0,115200n8
[0.00] PID hash table entries: 64 (order: -4, 256 bytes)
[0.00] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
[0.00] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.00] __ex_table already sorted, skipping sort
[0.00] Memory: 7136k/16384k available (2386k kernel code, 9248k
reserved, 372k data, 164k init, 0k highmem)
[0.00] NR_IRQS:256
[0.00] Calibrating delay loop... 148.88 BogoMIPS (lpj=78)
[0.07] pid_max: default: 32768 minimum: 301
[0.07] Mount-cache hash table entries: 512
[0.08] NET: Registered protocol family 16
[0.12] bio: create slab bio-0 at 0
[0.13] Switching to clocksource MIPS
[0.15] NET: Registered protocol family 2
[0.15] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[0.16] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[0.17] TCP: Hash tables configured (established 512 bind 512)
[0.17] TCP: reno registered
[0.17] UDP hash table entries: 256 (order: 0, 4096 bytes)
[0.18] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[0.19] NET: Registered protocol family 1
[0.25] cannot parse mac address, using random address
[0.25] unable to register fixed phy for cpmac-high: 0
[0.27] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[0.27] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME)
(CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[0.28] msgmni has been set to 16
[0.29] io scheduler noop registered
[0.29] io scheduler deadline registered (default)
[0.30] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[0.30] serial8250: ttyS0 at MMIO 0x8610e00 (irq = 15) is a TI-AR7
[0.31] console [ttyS0] enabled, bootconsole disabled
[0.31] console [ttyS0] enabled, bootconsole disabled
[0.32] serial8250: ttyS1 at MMIO 0x8610f00 (irq = 16) is a TI-AR7
[0.33] physmap platform flash device: 0200 at 1000
[0.34] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank.
Manufacturer ID 0xc2 Chip ID 0x0022cb
[0.35] Amd/Fujitsu Extended Query Table at 0x0040
[0.35]   Amd/Fujitsu Extended Query version 1.1.
[0.36] number of CFI chips: 1
[0.36] detected sub-partition rootfs: 0x004f@0x0030
[0.37] 4 ac49xpart partitions found on MTD device physmap-flash.0
[0.38] Creating 4 MTD partitions on physmap-flash.0:
[0.38] 0x0001-0x007f : linux
[0.39] 0x0030-0x007f : rootfs
[0.40] mtd: partition rootfs set to be root filesystem
[0.41] mtd: partition rootfs_data created automatically, ofs=47,
len=38
[0.41] 0x0047-0x007f : rootfs_data
[0.42] 0x-0x0001 : loader
[0.44] 0x007f-0x0080 : config
[0.46] libphy: Fixed MDIO Bus

[OpenWrt-Devel] [PATCH 1/3] mac80211/rt2x00: support Rt3352 with external PA

2012-11-11 Thread Daniel Golle
Fix a few issues on Rt3352 and make WiFi work e.g. on DIR-615 rev.H1.

Based on the work of Сергей Василюгин vasilu...@yandex.ru

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch

diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
new file mode 100644
index 000..17beaa0
--- /dev/null
+++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
@@ -0,0 +1,207 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -2271,15 +2271,18 @@ static void rt2800_config_channel(struct
+   /*
+* Change BBP settings
+*/
++  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
++
+   if (rt2x00_rt(rt2x00dev, RT3352)) {
+   rt2800_bbp_write(rt2x00dev, 27, 0x0);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 27, 0x20);
+   rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev-lna_gain);
++  rt2800_bbp_write(rt2x00dev, 86, 0x38);
++  rt2800_bbp_write(rt2x00dev, 83, 0x6a);
+   } else {
+-  rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev-lna_gain);
+-  rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev-lna_gain);
+   rt2800_bbp_write(rt2x00dev, 86, 0);
+   }
+ 
+@@ -3850,6 +3853,7 @@ static int rt2800_init_rfcsr(struct rt2x
+* Init RF calibration.
+*/
+   if (rt2x00_rt(rt2x00dev, RT3290) ||
++  rt2x00_rt(rt2x00dev, RT3352) ||
+   rt2x00_rt(rt2x00dev, RT5390) ||
+   rt2x00_rt(rt2x00dev, RT5392)) {
+   rt2800_rfcsr_read(rt2x00dev, 2, rfcsr);
+@@ -4036,6 +4040,10 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x00);
+   return 0;
+   } else if (rt2x00_rt(rt2x00dev, RT3352)) {
++  int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0,
++rt2x00dev-cap_flags);
++  int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1,
++rt2x00dev-cap_flags);
+   rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
+   rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
+   rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
+@@ -4069,15 +4077,30 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
+   rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 34, 0x01);
++  rfcsr =  0x01;
++  if (!tx0_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX0_EXT_PA, 1);
++  if (!tx1_int_pa)
++  rt2x00_set_field8(rfcsr, RFCSR34_TX1_EXT_PA, 1);
++  rt2800_rfcsr_write(rt2x00dev, 34, rfcsr );
+   rt2800_rfcsr_write(rt2x00dev, 35, 0x03);
+   rt2800_rfcsr_write(rt2x00dev, 36, 0xbd);
+   rt2800_rfcsr_write(rt2x00dev, 37, 0x3c);
+   rt2800_rfcsr_write(rt2x00dev, 38, 0x5f);
+   rt2800_rfcsr_write(rt2x00dev, 39, 0xc5);
+   rt2800_rfcsr_write(rt2x00dev, 40, 0x33);
+-  rt2800_rfcsr_write(rt2x00dev, 41, 0x5b);
+-  rt2800_rfcsr_write(rt2x00dev, 42, 0x5b);
++  rfcsr = 0x52;
++  if (tx0_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR41_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 41, rfcsr);
++  rfcsr = 0x52;
++  if (tx1_int_pa) {
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT1, 1);
++  rt2x00_set_field8(rfcsr, RFCSR42_BIT4, 1);
++  }
++  rt2800_rfcsr_write(rt2x00dev, 42, rfcsr);
+   rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
+   rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
+@@ -4085,15 +4108,20 @@ static int rt2800_init_rfcsr(struct rt2x
+   rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
+   rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
+   rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 50, 0x2d);
+-  rt2800_rfcsr_write(rt2x00dev, 51, 0x7f);
+-  rt2800_rfcsr_write(rt2x00dev, 52, 0x00);
+-  rt2800_rfcsr_write(rt2x00dev, 53, 0x52);
+-  rt2800_rfcsr_write(rt2x00dev, 54, 0x1b);
+-  rt2800_rfcsr_write(rt2x00dev, 55

[OpenWrt-Devel] [PATCH 2/3] mac80211/rt2x00: differentiate rf_vals for ht20/ht40

2012-11-11 Thread Daniel Golle
Recent Ralink RFs need different rf_vals depending on whether HT20 or HT40 is
being used.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 package/mac80211/patches/623-differentiate-rf_vals.patch

diff --git a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch 
b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
index 17beaa0..ab4f7b3 100644
--- a/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
+++ b/package/mac80211/patches/622-rt2x00-fix-rt3352-ext-pa.patch
@@ -119,7 +119,7 @@
EIRP_MAX_TX_POWER_LIMIT)
__set_bit(CAPABILITY_POWER_LIMIT, rt2x00dev-cap_flags);
  
-+  if (rt2x00_rt(rt2x00dev, RT3352) {
++  if (rt2x00_rt(rt2x00dev, RT3352)) {
 +  if (!rt2x00_get_field16(eeprom,
 +  EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
 +  __set_bit(CAPABILITY_INTERNAL_PA_TX0,
diff --git a/package/mac80211/patches/623-differentiate-rf_vals.patch 
b/package/mac80211/patches/623-differentiate-rf_vals.patch
new file mode 100644
index 000..8e569d6
--- /dev/null
+++ b/package/mac80211/patches/623-differentiate-rf_vals.patch
@@ -0,0 +1,211 @@
+--- a/drivers/net/wireless/rt2x00/rt2400pci.c
 b/drivers/net/wireless/rt2x00/rt2400pci.c
+@@ -1588,7 +1588,7 @@ static int rt2400pci_probe_hw_mode(struc
+   spec-supported_rates = SUPPORT_RATE_CCK;
+ 
+   spec-num_channels = ARRAY_SIZE(rf_vals_b);
+-  spec-channels = rf_vals_b;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_b;
+ 
+   /*
+* Create channel information array
+--- a/drivers/net/wireless/rt2x00/rt2500pci.c
 b/drivers/net/wireless/rt2x00/rt2500pci.c
+@@ -1882,23 +1882,23 @@ static int rt2500pci_probe_hw_mode(struc
+ 
+   if (rt2x00_rf(rt2x00dev, RF2522)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2522);
+-  spec-channels = rf_vals_bg_2522;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2522;
+   } else if (rt2x00_rf(rt2x00dev, RF2523)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2523);
+-  spec-channels = rf_vals_bg_2523;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2523;
+   } else if (rt2x00_rf(rt2x00dev, RF2524)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2524);
+-  spec-channels = rf_vals_bg_2524;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2524;
+   } else if (rt2x00_rf(rt2x00dev, RF2525)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2525);
+-  spec-channels = rf_vals_bg_2525;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2525;
+   } else if (rt2x00_rf(rt2x00dev, RF2525E)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2525e);
+-  spec-channels = rf_vals_bg_2525e;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2525e;
+   } else if (rt2x00_rf(rt2x00dev, RF5222)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_5222);
+-  spec-channels = rf_vals_5222;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_5222;
+   }
+ 
+   /*
+--- a/drivers/net/wireless/rt2x00/rt2500usb.c
 b/drivers/net/wireless/rt2x00/rt2500usb.c
+@@ -1721,23 +1721,23 @@ static int rt2500usb_probe_hw_mode(struc
+ 
+   if (rt2x00_rf(rt2x00dev, RF2522)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2522);
+-  spec-channels = rf_vals_bg_2522;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2522;
+   } else if (rt2x00_rf(rt2x00dev, RF2523)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2523);
+-  spec-channels = rf_vals_bg_2523;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2523;
+   } else if (rt2x00_rf(rt2x00dev, RF2524)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2524);
+-  spec-channels = rf_vals_bg_2524;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2524;
+   } else if (rt2x00_rf(rt2x00dev, RF2525)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2525);
+-  spec-channels = rf_vals_bg_2525;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2525;
+   } else if (rt2x00_rf(rt2x00dev, RF2525E)) {
+   spec-num_channels = ARRAY_SIZE(rf_vals_bg_2525e);
+-  spec-channels = rf_vals_bg_2525e;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_bg_2525e;
+   } else if (rt2x00_rf(rt2x00dev, RF5222)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_5222);
+-  spec-channels = rf_vals_5222;
++  spec-channels_ht20 = spec-channels_ht40 = rf_vals_5222;
+   }
+ 
+   /*
+--- a/drivers/net/wireless/rt2x00

[OpenWrt-Devel] [PATCH 3/3] mac80211/rt2x00: add rf_vals for Rt3352 in HT20 mode

2012-11-11 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
package/mac80211/patches/624-rt2x00-rf_vals-for-rt3352-in-ht20.patch

diff --git 
a/package/mac80211/patches/624-rt2x00-rf_vals-for-rt3352-in-ht20.patch 
b/package/mac80211/patches/624-rt2x00-rf_vals-for-rt3352-in-ht20.patch
new file mode 100644
index 000..ffc935d
--- /dev/null
+++ b/package/mac80211/patches/624-rt2x00-rf_vals-for-rt3352-in-ht20.patch
@@ -0,0 +1,49 @@
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
 b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -5067,6 +5067,27 @@ static const struct rf_channel rf_vals_3
+   {173, 0x61, 0, 9},
+ };
+ 
++/*
++ * RF value list for rt3xxx with Xtal20MHz
++ * Supports: 2.4 GHz (all) (RF3322)
++ */
++static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
++  {1,0xE2, 2,  0x14},
++  {2,0xE3, 2,  0x14},
++  {3,0xE4, 2,  0x14},
++  {4,0xE5, 2,  0x14},
++  {5,0xE6, 2,  0x14},
++  {6,0xE7, 2,  0x14},
++  {7,0xE8, 2,  0x14},
++  {8,0xE9, 2,  0x14},
++  {9,0xEA, 2,  0x14},
++  {10,   0xEB, 2,  0x14},
++  {11,   0xEC, 2,  0x14},
++  {12,   0xED, 2,  0x14},
++  {13,   0xEE, 2,  0x14},
++  {14,   0xF0, 2,  0x18},
++};
++
+ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
+ {
+   struct hw_mode_spec *spec = rt2x00dev-spec;
+@@ -5144,7 +5165,6 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF3022) ||
+  rt2x00_rf(rt2x00dev, RF3290) ||
+  rt2x00_rf(rt2x00dev, RF3320) ||
+- rt2x00_rf(rt2x00dev, RF3322) ||
+  rt2x00_rf(rt2x00dev, RF5360) ||
+  rt2x00_rf(rt2x00dev, RF5370) ||
+  rt2x00_rf(rt2x00dev, RF5372) ||
+@@ -5152,6 +5172,10 @@ static int rt2800_probe_hw_mode(struct r
+  rt2x00_rf(rt2x00dev, RF5392)) {
+   spec-num_channels = 14;
+   spec-channels_ht20 = spec-channels_ht40 = rf_vals_3x;
++  } else if (rt2x00_rf(rt2x00dev, RF3322)) {
++  spec-num_channels = 14;
++  spec-channels_ht20 = rf_vals_xtal20mhz_3x;
++  spec-channels_ht40 = rf_vals_3x;
+   } else if (rt2x00_rf(rt2x00dev, RF3052)) {
+   spec-supported_bands |= SUPPORT_BAND_5GHZ;
+   spec-num_channels = ARRAY_SIZE(rf_vals_3x);
-- 
1.8.0



pgpzu8J5JMuZf.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] pptp fails on x86

2012-11-07 Thread Daniel Golle
On 07/11/12 16:27, Илья Кучмин wrote:
 Any idea? Or /etc/config/network is depricated?
Not at all, /etc/config/network is the way.
Anyway, what you do there looks quite correct and given that all required
packages are installed (ppp-mod-pptp and stuff) it should work (and does for
me). I never tried with empty username/password though.
Maybe you are affected by the bug which makes resolveip hang on some platforms
(I got no idea if x86 is affected).
Please try

resolveip www.openwrt.org

and see if it works.



nslookup www.openwrt.org

should always work.


Cheers


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


Re: [OpenWrt-Devel] [PATCH][RFC] uboot-kirkwood: upgrade to 2012.10

2012-11-06 Thread Daniel Golle
Hi!

On 18/10/12 22:59, open...@lukaperkov.net wrote:
 All our kirkwood uboot patches have been upstreamed with this release ;)

 Board owners please test this patch and give feedback for the boards:

  * sheevaplug
  * dockstar
  * iconnect

ACK. Works on the iConnect.

Just lost the environment as it isn't stored in an separate mtd partition and I
did mtd erase u-boot ... :/

Having u-boot and u-boot-env separate would make it easier and also reduce the
risks involved when dealing with either one of them.

Besides that, we should have the resulting .kwb image aligned with the NAND
pages, otherwise flashing it results in:
nand_do_write_ops: attempt to write non page aligned data
Error writing image.

So it would be nice to have the partition layout in-sync with what we got in the
kernel.

U-Boot default env:
mtdparts=mtdparts=orion_nand:0x8@0x0(uboot),0x2@0x8(uboot_env),-@0xa(rootfs)
vs.
arch/arm/mach-kirkwood/iconnect-setup.c:
static struct mtd_partition iconnect_nand_parts[] = {
{
.name = u-boot,
.offset = 0,
.size = SZ_1M
}, {
.name = uImage,
.offset = MTDPART_OFS_NXTBLK,
.size = SZ_1M + SZ_2M
}, {
.name = rootfs,
.offset = MTDPART_OFS_NXTBLK,
.size = SZ_32M,
}, {
.name = data,
.offset = MTDPART_OFS_NXTBLK,
.size = MTDPART_SIZ_FULL
},
};

U-Boot 2012.10 (Oct 23 2012 - 14:48:13) Iomega iConnect

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  512 MiB
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH][RFC] uboot-kirkwood: upgrade to 2012.10

2012-11-06 Thread Daniel Golle
On 06/11/12 15:21, Imre Kaloz wrote:
 Hi,
 
 On Tue, 06 Nov 2012 14:13:26 +0100, Daniel Golle dgo...@allnet.de wrote:
 
 snip
 
 U-Boot default env:
 mtdparts=mtdparts=orion_nand:0x8@0x0(uboot),0x2@0x8(uboot_env),-@0xa(rootfs)
 vs.
 arch/arm/mach-kirkwood/iconnect-setup.c:
 static struct mtd_partition iconnect_nand_parts[] = {
 
 IMHO u-boot shouldn't do anything with mtdparts...

Unless you want to use ubi/ubifs to load the kernel, which I do want to use,
especially on large NAND (like the one of the iConnect, which already got 3
bad-blocks when it left the factory -- a well-known common phenomena on big NAND
chips and the reason why we got UBI)

See the whole uboot-environment to illustrate what I mean:
iconnect = printenv
baudrate=115200
bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part
rootfs; ubifsmount rootfs; ubifsload 0x80 ${kernel}; bootm 0x80
bootdelay=3
console=console=ttyS0,115200
ethact=egiga0
kernel=/boot/uImage
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x8@0x0(uboot),0x2@0x8(uboot_env),-@0xa(rootfs)
stderr=serial
stdin=serial
stdout=serial

So the kernel uImage is loaded from inside the filesystem, similar to GRUB
loading vmlinuz from an ext3 partition on x86.

Besides that, given that one might want to update u-boot itself or use
fw_printenv from inside OpenWrt, it makes sense to have the uboot/uboot-env
partitions in-sync.

Maybe even the opposite is true:
The kernel shouldn't have mtd-partitions built-in but rather rely on the cmdline
(like the way it works now on ar71xx; you can still have a patched built-in
cmdline, if needed)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] pptp fails on x86

2012-11-06 Thread Daniel Golle
On 06/11/12 12:29, Nikolai Zhubr wrote:
[...]
 TP-link wr1043nd was configured as follows:
 VLAN 2:
   info: VLAN 2: Ports: '01', members=0021, untag=0001, fid=0
   fid: 0
   ports: 0 1

Looks like VLAN 2 here got no host-interface (i.e. '5t' is missing) -- this will
make the two ports behave like a two-port switch and not allow the wr1043nd
itself to participate in that network.

 Now pptp link fails to come up with no visible relevant messages/complaints.

 Then we created /etc/ppp/peers/isp describing the connection.
 Issueing pppd call isp nodetach debug completes without any messages.
 I've noticed that ppp.sh exits as soon as the server is available.

 Any help is much appreciated. I'll try to provide whatever debugging
 information necessary.

Using /etc/ppp/peers/isp and directly using pppd to dial-up may work, but I
highly recommend to use /etc/config/network and have netifd manage the 
connection.

Anyway, in /etc/ppp/peers/isp, do you use pptpd to call ppdp or pppd pty 'pptpd
...' or pppd plugin pptp.so ?


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


[OpenWrt-Devel] [PATCH 1/4] ramips: port patches to linux-3.6

2012-11-06 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
target/linux/ramips/patches-3.6/001-mips-add-cp0-compare-irq-function.patch
 create mode 100644 
target/linux/ramips/patches-3.6/010-mtd_fix_cfi_cmdset_0002_erase_status_check.patch
 create mode 100644 
target/linux/ramips/patches-3.6/011-mtd-cfi_cmdset_0002-force-word-write.patch
 create mode 100644 target/linux/ramips/patches-3.6/100-mips-ralink-core.patch
 create mode 100644 
target/linux/ramips/patches-3.6/101-rt288x_serial_driver_hack.patch
 create mode 100644 
target/linux/ramips/patches-3.6/102-rt288x-pci-driver-hook.patch
 create mode 100644 target/linux/ramips/patches-3.6/103-ethernet.patch
 create mode 100644 
target/linux/ramips/patches-3.6/104-ramips-watchdog-driver.patch
 create mode 100644 target/linux/ramips/patches-3.6/105-ramips-spi-driver.patch
 create mode 100644 target/linux/ramips/patches-3.6/105-usb_dwc_otg.patch
 create mode 100644 target/linux/ramips/patches-3.6/106-rt3883-pci-support.patch
 create mode 100644 target/linux/ramips/patches-3.6/200-rt3883-ehci-glue.patch
 create mode 100644 target/linux/ramips/patches-3.6/201-rt3883-ohci-glue.patch

diff --git 
a/target/linux/ramips/patches-3.6/001-mips-add-cp0-compare-irq-function.patch 
b/target/linux/ramips/patches-3.6/001-mips-add-cp0-compare-irq-function.patch
new file mode 100644
index 000..41e5e8e
--- /dev/null
+++ 
b/target/linux/ramips/patches-3.6/001-mips-add-cp0-compare-irq-function.patch
@@ -0,0 +1,29 @@
+--- a/arch/mips/kernel/traps.c
 b/arch/mips/kernel/traps.c
+@@ -54,6 +54,7 @@
+ #include asm/types.h
+ #include asm/stacktrace.h
+ #include asm/uasm.h
++#include asm/time.h
+ 
+ extern void check_wait(void);
+ extern asmlinkage void r4k_wait(void);
+@@ -1598,6 +1599,8 @@ void __cpuinit per_cpu_trap_init(bool is
+   if (cpu_has_mips_r2) {
+   cp0_compare_irq_shift = CAUSEB_TI - CAUSEB_IP;
+   cp0_compare_irq = (read_c0_intctl()  INTCTLB_IPTI)  7;
++  if (get_c0_compare_irq)
++  cp0_compare_irq = get_c0_compare_irq();
+   cp0_perfcount_irq = (read_c0_intctl()  INTCTLB_IPPCI)  7;
+   if (cp0_perfcount_irq == cp0_compare_irq)
+   cp0_perfcount_irq = -1;
+--- a/arch/mips/include/asm/time.h
 b/arch/mips/include/asm/time.h
+@@ -52,6 +52,7 @@ extern int (*perf_irq)(void);
+  */
+ #ifdef CONFIG_CEVT_R4K_LIB
+ extern unsigned int __weak get_c0_compare_int(void);
++extern unsigned int __weak get_c0_compare_irq(void);
+ extern int r4k_clockevent_init(void);
+ #endif
+ 
diff --git 
a/target/linux/ramips/patches-3.6/010-mtd_fix_cfi_cmdset_0002_erase_status_check.patch
 
b/target/linux/ramips/patches-3.6/010-mtd_fix_cfi_cmdset_0002_erase_status_check.patch
new file mode 100644
index 000..8d3dec9
--- /dev/null
+++ 
b/target/linux/ramips/patches-3.6/010-mtd_fix_cfi_cmdset_0002_erase_status_check.patch
@@ -0,0 +1,20 @@
+--- a/drivers/mtd/chips/cfi_cmdset_0002.c
 b/drivers/mtd/chips/cfi_cmdset_0002.c
+@@ -1860,7 +1860,7 @@ static int __xipram do_erase_chip(struct
+   chip-erase_suspended = 0;
+   }
+ 
+-  if (chip_ready(map, adr))
++  if (chip_good(map, adr, map_word_ff(map)))
+   break;
+ 
+   if (time_after(jiffies, timeo)) {
+@@ -1949,7 +1949,7 @@ static int __xipram do_erase_oneblock(st
+   chip-erase_suspended = 0;
+   }
+ 
+-  if (chip_ready(map, adr)) {
++  if (chip_good(map, adr, map_word_ff(map))) {
+   xip_enable(map, chip, adr);
+   break;
+   }
diff --git 
a/target/linux/ramips/patches-3.6/011-mtd-cfi_cmdset_0002-force-word-write.patch
 
b/target/linux/ramips/patches-3.6/011-mtd-cfi_cmdset_0002-force-word-write.patch
new file mode 100644
index 000..e60bdf5
--- /dev/null
+++ 
b/target/linux/ramips/patches-3.6/011-mtd-cfi_cmdset_0002-force-word-write.patch
@@ -0,0 +1,63 @@
+Index: linux-3.6.6/drivers/mtd/chips/cfi_cmdset_0002.c
+===
+--- linux-3.6.6.orig/drivers/mtd/chips/cfi_cmdset_0002.c
 linux-3.6.6/drivers/mtd/chips/cfi_cmdset_0002.c
+@@ -39,7 +39,7 @@
+ #include linux/mtd/xip.h
+ 
+ #define AMD_BOOTLOC_BUG
+-#define FORCE_WORD_WRITE 0
++#define FORCE_WORD_WRITE 1
+ 
+ #define MAX_WORD_RETRIES 3
+ 
+@@ -50,7 +50,9 @@
+ 
+ static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, 
u_char *);
+ static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t 
*, const u_char *);
++#if !FORCE_WORD_WRITE
+ static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t 
*, const u_char *);
++#endif
+ static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *);
+ static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *);
+ static void cfi_amdstd_sync (struct mtd_info *);
+@@ -186,6 +188,7 @@ static void

[OpenWrt-Devel] [PATCH 2/4] ramips: add linux-3.6 configuration for ramips socs

2012-11-06 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/ramips/rt288x/config-3.6
 create mode 100644 target/linux/ramips/rt305x/config-3.6
 create mode 100644 target/linux/ramips/rt3883/config-3.6

diff --git a/target/linux/ramips/rt288x/config-3.6 
b/target/linux/ramips/rt288x/config-3.6
new file mode 100644
index 000..b48c080
--- /dev/null
+++ b/target/linux/ramips/rt288x/config-3.6
@@ -0,0 +1,125 @@
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_BCMA_POSSIBLE=y
+CONFIG_BUILDTIME_EXTABLE_SORT=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CEVT_R4K=y
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CMDLINE=rootfstype=squashfs,jffs2
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPSR2=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CSRC_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_WORK=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HW_HAS_PCI=y
+CONFIG_HW_RANDOM=m
+CONFIG_IMAGE_CMDLINE_HACK=y
+CONFIG_INITRAMFS_SOURCE=
+CONFIG_IP17XX_PHY=y
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_FORCED_THREADING=y
+# CONFIG_MACH_LOONGSON1 is not set
+CONFIG_MDIO_BOARDINFO=y
+# CONFIG_MII is not set
+CONFIG_MIPS=y
+CONFIG_MIPS_L1_CACHE_SHIFT=4
+CONFIG_MIPS_MACHINE=y
+CONFIG_MIPS_MT_DISABLED=y
+CONFIG_MIPS_RALINK=y
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NET_RAMIPS=y
+# CONFIG_NET_RAMIPS_DEBUG is not set
+# CONFIG_NET_RAMIPS_DEBUG_FS is not set
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PANIC_ON_OOPS_VALUE=0
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PHYLIB=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_RALINK_DEV_GPIO_BUTTONS=y
+CONFIG_RALINK_DEV_GPIO_LEDS=y
+CONFIG_RALINK_RT288X=y
+# CONFIG_RALINK_RT305X is not set
+# CONFIG_RALINK_RT3883 is not set
+CONFIG_RAMIPS_WDT=y
+CONFIG_RT288X_MACH_F5D8235_V1=y
+CONFIG_RT288X_MACH_RT_N15=y
+CONFIG_RT288X_MACH_V11ST_FE=y
+CONFIG_RT288X_MACH_WLI_TX4_AG300N=y
+CONFIG_RT288X_MACH_WZR_AGL300NH=y
+CONFIG_RTL8366S_PHY=y
+CONFIG_RTL8366_SMI=y
+# CONFIG_SCSI_DMA is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RT288X=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+CONFIG_SOC_RT288X=y
+CONFIG_SWCONFIG=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_USB_ARCH_HAS_XHCI=y
+CONFIG_USB_SUPPORT=y
+CONFIG_XZ_DEC=y
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ramips/rt305x/config-3.6 
b/target/linux/ramips/rt305x/config-3.6
new file mode 100644
index 000..2a29f85
--- /dev/null
+++ b/target/linux/ramips/rt305x/config-3.6
@@ -0,0 +1,153 @@
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_BCMA_POSSIBLE=y
+CONFIG_BUILDTIME_EXTABLE_SORT=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CEVT_R4K=y
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CMDLINE=rootfstype=squashfs,jffs2
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPSR2=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CSRC_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+CONFIG_DECOMPRESS_LZMA=y

[OpenWrt-Devel] [PATCH 3/4] ramips: add HAVE_CLK to Kconfig on all ramips socs

2012-11-06 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ramips/files/arch/mips/ralink/Kconfig 
b/target/linux/ramips/files/arch/mips/ralink/Kconfig
index 444a88a..74bca6d 100644
--- a/target/linux/ramips/files/arch/mips/ralink/Kconfig
+++ b/target/linux/ramips/files/arch/mips/ralink/Kconfig
@@ -37,6 +37,7 @@ config SOC_RT288X
select SYS_SUPPORTS_LITTLE_ENDIAN
select SYS_HAS_EARLY_PRINTK
select MIPS_MACHINE
+   select HAVE_CLK
 
 config SOC_RT305X
bool
@@ -54,6 +55,7 @@ config SOC_RT305X
select USB_ARCH_HAS_HCD
select USB_ARCH_HAS_OHCI
select USB_ARCH_HAS_EHCI
+   select HAVE_CLK
 
 config SOC_RT3883
bool
@@ -70,6 +72,7 @@ config SOC_RT3883
select MIPS_MACHINE
select USB_ARCH_HAS_OHCI
select USB_ARCH_HAS_EHCI
+   select HAVE_CLK
 
 config RALINK_DEV_GPIO_BUTTONS
def_bool n
-- 
1.8.0



pgpa2knbvGg9n.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/4] ramips: use kernel 3.6.6

2012-11-06 Thread Daniel Golle
] Freeing unused kernel memory: 2676k freed
[6.49] Button Hotplug driver version 0.4.1
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
- init -

Please press Enter to activate this console. [   10.15] Compat-drivers 
backport release: compat-drivers-2012-09-04-2-gddac993
[   10.17] Backport based on wireless-testing.git master-2012-09-07
[   10.18] compat.git: wireless-testing.git
[   10.21] cfg80211: Calling CRDA to update world regulatory domain
[   10.23] cfg80211: World regulatory domain updated:
[   10.24] cfg80211:   (start_freq - end_freq @ bandwidth), 
(max_antenna_gain, max_eirp)
[   10.25] cfg80211:   (2402000 KHz - 2472000 KHz @ 4 KHz), (300 mBi, 
2000 mBm)
[   10.27] cfg80211:   (2457000 KHz - 2482000 KHz @ 2 KHz), (300 mBi, 
2000 mBm)
[   10.28] cfg80211:   (2474000 KHz - 2494000 KHz @ 2 KHz), (300 mBi, 
2000 mBm)
[   10.30] cfg80211:   (517 KHz - 525 KHz @ 4 KHz), (300 mBi, 
2000 mBm)
[   10.31] cfg80211:   (5735000 KHz - 5835000 KHz @ 4 KHz), (300 mBi, 
2000 mBm)
[   10.43] NET: Registered protocol family 10
[   10.76] PPP generic driver version 2.4.2
[   10.82] l2tp_core: L2TP core driver, V2.0
[   10.84] l2tp_netlink: L2TP netlink interface
[   10.87] sit: IPv6 over IPv4 tunneling driver
[   10.92] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.06] NET: Registered protocol family 24
[   11.09] nf_conntrack version 0.5.0 (464 buckets, 1856 max)
[   11.23] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[   11.41] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   14.51] device eth0.1 entered promiscuous mode
[   14.52] device eth0 entered promiscuous mode
[   14.53] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[   14.55] br-lan: port 1(eth0.1) entered forwarding state
[   14.56] br-lan: port 1(eth0.1) entered forwarding state
[   16.56] br-lan: port 1(eth0.1) entered forwarding state
[   16.60] ramips-wdt: timeout value 60 must be 0  timeout = 33, using 33



BusyBox v1.19.4 (2012-11-06 13:40:37 IST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  ___ __
 |   |.-.-.-.|  |  |  |..|  |_
 |   -   ||  _  |  -__| ||  |  |  ||   _||   _|
 |___||   __|_|__|__||||__|  ||
  |__| W I R E L E S S   F R E E D O M
 -
 BARRIER BREAKER (Bleeding Edge, r34079)
 -
  * 1/2 oz Galliano Pour all ingredients into
  * 4 oz cold Coffeean irish coffee mug filled
  * 1 1/2 oz Dark Rum   with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -
root@OpenWrt:/# 

-- 
Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile
index e49ff41..5ff8e86 100644
--- a/target/linux/ramips/Makefile
+++ b/target/linux/ramips/Makefile
@@ -13,7 +13,7 @@ SUBTARGETS:=rt288x rt305x rt3883
 CFLAGS:=-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves
 FEATURES:=squashfs
 
-LINUX_VERSION:=3.3.8
+LINUX_VERSION:=3.6.6
 
 include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES+=\
-- 
1.8.0



pgpjAMNIyFYku.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] pptp fails on x86

2012-11-06 Thread Daniel Golle
You can either edit /etc/config/network or use LuCI to add a PPtP interface
which will work fine. If you -- for which ever reason -- like to go the old
fashioned way of directly using pppd, you have to change your configuration,
so it can work with the pptp plugin instead of the external pty.

On 06/11/12 18:52, Илья Кучмин wrote:
[...]
 pty /usr/sbin/pptp server.avtograd.ru --nolaunchpppd
replace this line with:
plugin pptp.so pptp_server server.avtograd.ru

The rest should be ok as far as I can see.

And don't forget to change your password ;)

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


Re: [OpenWrt-Devel] [PATCH] mac80211/rt2x00: sync Rt3352 support

2012-11-05 Thread Daniel Golle
Hi!

On 05/11/12 16:16, Сергей Василюгин wrote:
 While porting to dlink DIR-620 D1 (rt3352) I see that ralink driver 
 (ftp://ftp.dlink.ru/pub/Router/DIR-620/Source/gpl_DIR_620D1.tar.gz):
  - toggles rf02 before initing RF (like rt3290, rt5390, rt5392 in 
 rt2800lib.c);
  - use different rf_vals if Xtal 20MHz (checked by SYSC_REG_SYSTEM_CONFIG   
 (120) -  0 = 20MHz, 1 = 40MHz).
 After patching these and ap_type netif_carrier wifi works, LEDs don't (with 
 vendor firmware too :)).

Good to hear that! Thank you for the effort!
Did you test on the DIR-620 itself?

 So two questions:
  1. Are these patches not so critical? Or I don't understand something.

Probably just not relevant for the ALL5002 system-in-a-module and where missing
in the reference driver I had access to.
Or I overlooked something, the more eye-pairs, the more you see :)

  2. LEDs work?

The SoM we got exposes all GPIOs to the user, and gpio-leds seems to work in
that way. I got no idea if OR/AND'ing a GPIO with a WiFi-hardware-trigger works
(I saw that such a feature seems to exist in the vendor driver)

Please share your patch so I can test it on my hardware as well.
I suggest that once we tested it on both our Rt3352F-based gear, you should post
the patch to be included in OpenWrt mac80211/patches and simultanously also post
on the rt2x00-users mailing list. Once it got ack'ed by some rt2x00 maintainer,
re-post it on linux-wireless so it can go into wireless-testing and then
linux-next...


Thank you for the review and the testing!


Best regards



Daniel

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


[OpenWrt-Devel] [PATCH] ramips: add restorefactory to default package set for ALL0239-3G and ALL0256N

2012-11-02 Thread Daniel Golle
Signed-off-by: Daniel Golle dgo...@allnet.de
---
 target/linux/ramips/rt305x/profiles/allnet.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/rt305x/profiles/allnet.mk 
b/target/linux/ramips/rt305x/profiles/allnet.mk
index fb3e4d4..35f6332 100644
--- a/target/linux/ramips/rt305x/profiles/allnet.mk
+++ b/target/linux/ramips/rt305x/profiles/allnet.mk
@@ -9,7 +9,7 @@ define Profile/ALL02393G
NAME:=Allnet ALL0239-3G
PACKAGES:=\
kmod-usb-core kmod-usb-rt305x-dwc_otg \
-   kmod-ledtrig-usbdev
+   kmod-ledtrig-usbdev restorefactory
 endef
 
 define Profile/ALL02393G/Description
@@ -20,7 +20,7 @@ $(eval $(call Profile,ALL02393G))
 
 define Profile/ALL0256N
NAME:=Allnet ALL0256N
-   PACKAGES:=rssileds
+   PACKAGES:=restorefactory rssileds
 endef
 
 define Profile/ALL0256N/Description
-- 
1.8.0



pgpe2cthEE5Jk.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: perform vlan-migration from eth0.1 to eth0 if ESW is disabled

2012-10-31 Thread Daniel Golle
[please apply to both, trunk and AA]

Since r33305 the embedded switch is disabled for some boards.
This causes sysupgrade to make the device inaccessible when coming from a
version before r33305 as the switch is then disabled, but the kept network
settings still refer to eth0.1.

Signed-off-by: Daniel Golle dgo...@allnet.de
---
 .../ramips/base-files/etc/uci-defaults/vlan-migration   | 17 +
 1 file changed, 17 insertions(+)
 create mode 100755 
target/linux/ramips/base-files/etc/uci-defaults/vlan-migration

diff --git a/target/linux/ramips/base-files/etc/uci-defaults/vlan-migration 
b/target/linux/ramips/base-files/etc/uci-defaults/vlan-migration
new file mode 100755
index 000..efbe0f6
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/vlan-migration
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+if [ ! -x /sbin/swconfig ]; then
+   return
+fi
+
+local lanif=$(uci -q get network.lan.ifname)
+local vlanenabled=$(swconfig dev rt305x get enable_vlan)
+
+if [ $lanif = eth0.1 ]  [ $vlanenabled = 0 ]; then
+   logger -t vlan-migration ESW is disabled, use untagged instead of 
legacy VLAN 1
+   uci set network.lan.ifname=eth0
+   uci commit network
+fi
-- 
1.8.0



pgpeztIRcebbc.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/8 v2] [ar7] AudioCodes AC49x sub-target

2012-10-17 Thread Daniel Golle
So now some sosmetics fixes according to the comments I got:
I fixed everything checkpatch.pl was complaining about and refreshed the patches
in target/linux/ar7/patches-3.3

Daniel Golle (8):
  [ar7] free memory below kernel offset
  [ar7] add AudioCodes AC49x platform support to kernel
  [ar7] support AC49x bootloader environment
  [ar7] detect AC49x flash partitions
  [ar7] enable serial kludge on AC49x
  [ar7] create generic subtarget
  [ar7] create AC49x subtarget
  [ar7] generate image for AC49x

 target/linux/ar7/Makefile  |   1 +
 target/linux/ar7/ac49x/config-3.3  | 102 ++
 target/linux/ar7/ac49x/profiles/210-None.mk|  17 ++
 target/linux/ar7/ac49x/target.mk   |  10 +
 target/linux/ar7/config-3.3| 102 --
 target/linux/ar7/files/drivers/mtd/ac49xpart.c | 220 +
 target/linux/ar7/generic/config-3.3| 102 ++
 target/linux/ar7/generic/profiles/100-Annex-A.mk   |  17 ++
 target/linux/ar7/generic/profiles/110-Annex-B.mk   |  17 ++
 target/linux/ar7/generic/profiles/200-Texas.mk |  18 ++
 target/linux/ar7/generic/profiles/210-None.mk  |  17 ++
 target/linux/ar7/generic/target.mk |  10 +
 target/linux/ar7/image/Makefile|  15 ++
 .../200-free-mem-below-kernel-offset.patch |  15 ++
 .../ar7/patches-3.3/300-add-ac49x-platform.patch   | 124 
 .../ar7/patches-3.3/310-ac49x-prom-support.patch   |  20 ++
 .../ar7/patches-3.3/320-ac49x-mtd-partitions.patch |  35 
 .../linux/ar7/patches-3.3/500-serial_kludge.patch  |   8 +-
 target/linux/ar7/profiles/100-Annex-A.mk   |  17 --
 target/linux/ar7/profiles/110-Annex-B.mk   |  17 --
 target/linux/ar7/profiles/200-Texas.mk |  18 --
 target/linux/ar7/profiles/210-None.mk  |  17 --
 22 files changed, 745 insertions(+), 174 deletions(-)
 create mode 100644 target/linux/ar7/ac49x/config-3.3
 create mode 100644 target/linux/ar7/ac49x/profiles/210-None.mk
 create mode 100644 target/linux/ar7/ac49x/target.mk
 delete mode 100644 target/linux/ar7/config-3.3
 create mode 100644 target/linux/ar7/files/drivers/mtd/ac49xpart.c
 create mode 100644 target/linux/ar7/generic/config-3.3
 create mode 100644 target/linux/ar7/generic/profiles/100-Annex-A.mk
 create mode 100644 target/linux/ar7/generic/profiles/110-Annex-B.mk
 create mode 100644 target/linux/ar7/generic/profiles/200-Texas.mk
 create mode 100644 target/linux/ar7/generic/profiles/210-None.mk
 create mode 100644 target/linux/ar7/generic/target.mk
 create mode 100644 
target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch
 create mode 100644 target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
 create mode 100644 target/linux/ar7/patches-3.3/310-ac49x-prom-support.patch
 create mode 100644 target/linux/ar7/patches-3.3/320-ac49x-mtd-partitions.patch
 delete mode 100644 target/linux/ar7/profiles/100-Annex-A.mk
 delete mode 100644 target/linux/ar7/profiles/110-Annex-B.mk
 delete mode 100644 target/linux/ar7/profiles/200-Texas.mk
 delete mode 100644 target/linux/ar7/profiles/210-None.mk

-- 
1.7.12.2



pgp5wyVEjc1ds.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/8] [ar7] free memory below kernel offset

2012-10-17 Thread Daniel Golle
Some bootloaders (e.g. PSPBoot on AC49x) have a load-offset, this frees that
memory region so it is usable for Linux.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch

diff --git 
a/target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch 
b/target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch
new file mode 100644
index 000..399822a
--- /dev/null
+++ b/target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch
@@ -0,0 +1,15 @@
+--- a/arch/mips/ar7/memory.c
 b/arch/mips/ar7/memory.c
+@@ -67,5 +67,11 @@ void __init prom_meminit(void)
+ 
+ void __init prom_free_prom_memory(void)
+ {
+-  /* Nothing to free */
++  /* adapted from arch/mips/txx9/generic/setup.c */
++  unsigned long saddr = PHYS_OFFSET + PAGE_SIZE;
++  unsigned long eaddr = __pa_symbol(_text);
++
++  /* free memory between prom-record and kernel _text base */
++  if (saddr  eaddr)
++  free_init_pages(prom memory, saddr, eaddr);
+ }
-- 
1.7.12.2



pgprbgonTzIFS.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/8] [ar7] add AudioCodes AC49x platform support to kernel

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch

diff --git a/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch 
b/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
new file mode 100644
index 000..7132743
--- /dev/null
+++ b/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
@@ -0,0 +1,124 @@
+--- a/arch/mips/Kconfig
 b/arch/mips/Kconfig
+@@ -39,6 +39,25 @@ choice
+   prompt System type
+   default SGI_IP22
+ 
++config AC49X
++  bool AudioCodes AC49X
++  select BOOT_ELF32
++  select DMA_NONCOHERENT
++  select CEVT_R4K
++  select CSRC_R4K
++  select IRQ_CPU
++  select NO_EXCEPT_FILL
++  select SWAP_IO_SPACE
++  select SYS_HAS_CPU_MIPS32_R1
++  select SYS_HAS_EARLY_PRINTK
++  select SYS_SUPPORTS_32BIT_KERNEL
++  select SYS_SUPPORTS_LITTLE_ENDIAN
++  select SYS_SUPPORTS_ZBOOT_UART16550
++  select ARCH_REQUIRE_GPIOLIB
++  select VLYNQ
++  help
++Support for the AudioCodes AC49x System-on-a-Chip family.
++
+ config MIPS_ALCHEMY
+   bool Alchemy processor based machines
+   select 64BIT_PHYS_ADDR
+--- a/arch/mips/ar7/Platform
 b/arch/mips/ar7/Platform
+@@ -4,3 +4,10 @@
+ platform-$(CONFIG_AR7)  += ar7/
+ cflags-$(CONFIG_AR7)+= -I$(srctree)/arch/mips/include/asm/mach-ar7
+ load-$(CONFIG_AR7)  += 0x9410
++
++#
++# AudioCodes AC49x
++#
++platform-$(CONFIG_AC49X)+= ar7/
++cflags-$(CONFIG_AC49X)  += -I$(srctree)/arch/mips/include/asm/mach-ar7
++load-$(CONFIG_AC49X)+= 0x945ca000
+--- a/drivers/char/Kconfig
 b/drivers/char/Kconfig
+@@ -480,7 +480,7 @@ config MWAVE
+ 
+ config AR7_GPIO
+   tristate TI AR7 GPIO Support
+-  depends on AR7
++  depends on AR7 || AC49X
+   help
+ Give userspace access to the GPIO pins on the Texas Instruments AR7
+ processors.
+--- a/drivers/net/ethernet/ti/Kconfig
 b/drivers/net/ethernet/ti/Kconfig
+@@ -5,7 +5,7 @@
+ config NET_VENDOR_TI
+   bool Texas Instruments (TI) devices
+   default y
+-  depends on PCI || EISA || AR7 || (ARM  (ARCH_DAVINCI || ARCH_OMAP3))
++  depends on PCI || EISA || AC49X || AR7 || (ARM  (ARCH_DAVINCI || 
ARCH_OMAP3))
+   ---help---
+ If you have a network (Ethernet) card belonging to this class, say Y
+ and read the Ethernet-HOWTO, available from
+@@ -69,7 +69,7 @@ config TLAN
+ 
+ config CPMAC
+   tristate TI AR7 CPMAC Ethernet support (EXPERIMENTAL)
+-  depends on EXPERIMENTAL  AR7
++  depends on EXPERIMENTAL  ( AC49X || AR7 )
+   select PHYLIB
+   ---help---
+ TI AR7 CPMAC Ethernet support
+--- a/drivers/vlynq/Kconfig
 b/drivers/vlynq/Kconfig
+@@ -1,5 +1,5 @@
+ menu TI VLYNQ
+-  depends on AR7  EXPERIMENTAL
++  depends on ( AR7 || AC49X )  EXPERIMENTAL
+ 
+ config VLYNQ
+   bool TI VLYNQ bus support
+--- a/drivers/watchdog/Kconfig
 b/drivers/watchdog/Kconfig
+@@ -989,7 +989,7 @@ config SIBYTE_WDOG
+ 
+ config AR7_WDT
+   tristate TI AR7 Watchdog Timer
+-  depends on AR7
++  depends on AR7 || AC49X
+   help
+ Hardware driver for the TI AR7 Watchdog Timer.
+ 
+--- a/arch/mips/boot/compressed/uart-16550.c
 b/arch/mips/boot/compressed/uart-16550.c
+@@ -13,7 +13,7 @@
+ #define PORT(offset) (CKSEG1ADDR(UART_BASE) + (offset))
+ #endif
+ 
+-#ifdef CONFIG_AR7
++#if defined(CONFIG_AR7) || defined(CONFIG_AC49X)
+ #include ar7.h
+ #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset))
+ #endif
+--- a/arch/mips/ar7/setup.c
 b/arch/mips/ar7/setup.c
+@@ -69,6 +69,8 @@ const char *get_system_type(void)
+   return TI AR7 (TNETV1056);
+   case TITAN_CHIP_1060:
+   return TI AR7 (TNETV1060);
++  case TITAN_CHIP_AC:
++  return AudioCodes AC49x;
+   }
+   default:
+   return TI AR7 (unknown);
+--- a/arch/mips/include/asm/mach-ar7/ar7.h
 b/arch/mips/include/asm/mach-ar7/ar7.h
+@@ -92,6 +92,7 @@
+ #define TITAN_CHIP_1055   0x0e
+ #define TITAN_CHIP_1056   0x0d
+ #define TITAN_CHIP_1060   0x07
++#define TITAN_CHIP_AC 0x02
+ 
+ /* Interrupts */
+ #define AR7_IRQ_UART0 15
-- 
1.7.12.2



pgpXUfs1Zevpq.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/8] [ar7] support AC49x bootloader environment

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/ar7/patches-3.3/310-ac49x-prom-support.patch

diff --git a/target/linux/ar7/patches-3.3/310-ac49x-prom-support.patch 
b/target/linux/ar7/patches-3.3/310-ac49x-prom-support.patch
new file mode 100644
index 000..dddf221
--- /dev/null
+++ b/target/linux/ar7/patches-3.3/310-ac49x-prom-support.patch
@@ -0,0 +1,20 @@
+--- a/arch/mips/ar7/prom.c
 b/arch/mips/ar7/prom.c
+@@ -70,6 +70,7 @@ struct psbl_rec {
+ };
+ 
+ static const char psp_env_version[] __initconst = TIENV0.8;
++static const char psp_env_version_ac49x[] __initconst = MaxENV0.2;
+ 
+ struct psp_env_chunk {
+   u8  num;
+@@ -186,7 +187,8 @@ static void __init ar7_init_env(struct e
+   struct psbl_rec *psbl = (struct psbl_rec *)(KSEG1ADDR(0x14000300));
+   void *psp_env = (void *)KSEG1ADDR(psbl-env_base);
+ 
+-  if (strcmp(psp_env, psp_env_version) == 0) {
++  if (strcmp(psp_env, psp_env_version) == 0 ||
++  strcmp(psp_env, psp_env_version_ac49x) == 0) {
+   parse_psp_env(psp_env);
+   } else {
+   for (i = 0; i  MAX_ENTRY; i++, env++)
-- 
1.7.12.2



pgpLlykafwkLu.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/8] [ar7] detect AC49x flash partitions

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/ar7/files/drivers/mtd/ac49xpart.c
 create mode 100644 target/linux/ar7/patches-3.3/320-ac49x-mtd-partitions.patch

diff --git a/target/linux/ar7/files/drivers/mtd/ac49xpart.c 
b/target/linux/ar7/files/drivers/mtd/ac49xpart.c
new file mode 100644
index 000..1f937f0
--- /dev/null
+++ b/target/linux/ar7/files/drivers/mtd/ac49xpart.c
@@ -0,0 +1,220 @@
+/*
+ * AudioCodes AC49x PSPBoot-based flash partition table
+ * Copyright 2012 Daniel Golle daniel.go...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include linux/kernel.h
+#include linux/slab.h
+
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/bootmem.h
+#include linux/magic.h
+#include linux/module.h
+
+#include asm/mach-ar7/prom.h
+
+#define AC49X_MAXENVPARTS  8
+
+#define AC49X_PARTTYPE_LOADER  0
+#define AC49X_PARTTYPE_BOOTENV 1
+#define AC49X_PARTTYPE_LINUX   2
+#define AC49X_PARTTYPE_ROOTFS  3
+#define AC49X_PARTTYPE_UNKNOWN 4
+#define AC49X_NUM_PARTTYPES5
+
+#define AC49X_FLASH_ADDRMASK   0x00FF
+
+#define AC49X_LOADER_MAGIC 0x40809000
+#define AC49X_LINUX_MAGIC  0x464c457f /*  ELF */
+#define AC49X_BOOTENV_MAGIC0x4578614d /* MaxE */
+
+#define ROOTFS_MIN_OFFSET  0xC
+
+int parse_partvar(const unsigned char *partvar, struct mtd_partition *part)
+{
+   unsigned int partstart, partend;
+   unsigned int pnum;
+
+   pnum = sscanf(partvar, 0x%x,0x%x, partstart, partend);
+   if (pnum != 2)
+   return 1;
+
+   part-offset = partstart  AC49X_FLASH_ADDRMASK;
+   part-size = partend - partstart;
+
+   return 0;
+}
+
+int detect_parttype(struct mtd_info *master, struct mtd_partition part)
+{
+   unsigned int magic;
+   size_t len;
+
+   if (part.size  4)
+   return -1;
+
+   mtd_read(master, part.offset, sizeof(magic), len,
+(uint8_t *)magic);
+
+   if (len != sizeof(magic))
+   return -1;
+
+   switch (magic) {
+   case AC49X_LOADER_MAGIC:
+   return AC49X_PARTTYPE_LOADER;
+   case AC49X_LINUX_MAGIC:
+   return AC49X_PARTTYPE_LINUX;
+   case SQUASHFS_MAGIC:
+   case CRAMFS_MAGIC:
+   case CRAMFS_MAGIC_WEND:
+   return AC49X_PARTTYPE_ROOTFS;
+   case AC49X_BOOTENV_MAGIC:
+   return AC49X_PARTTYPE_BOOTENV;
+   default:
+   switch (magic  0xFF) {
+   case JFFS2_SUPER_MAGIC:
+   return AC49X_PARTTYPE_ROOTFS;
+   }
+   switch (magic  8) {
+   case JFFS2_SUPER_MAGIC:
+   return AC49X_PARTTYPE_ROOTFS;
+   }
+   return AC49X_PARTTYPE_UNKNOWN;
+   }
+}
+
+const char *partnames[] = {
+   loader,
+   config,
+   linux,
+   rootfs,
+   data
+};
+
+void gen_partname(unsigned int type,
+ unsigned int *typenumeration,
+ struct mtd_partition *part)
+{
+   char *s  = kzalloc(sizeof(char) * 8, GFP_KERNEL);
+
+   (typenumeration[type])++;
+   if (typenumeration[type] == 1)
+   sprintf(s, %s, partnames[type]);
+   else
+   sprintf(s, %s%d, partnames[type], typenumeration[type]);
+
+   part-name = s;
+}
+
+static int create_mtd_partitions(struct mtd_info *master,
+struct mtd_partition **pparts,
+struct mtd_part_parser_data *data)
+{
+   unsigned int envpartnum = 0, linuxpartnum = 0;
+   unsigned int typenumeration[5] = { 0, 0, 0, 0, 0 };
+   unsigned char evn[5];
+   const unsigned char *partvar = NULL;
+
+   struct mtd_partition *ac49x_parts;
+
+   ac49x_parts = kzalloc(sizeof(*ac49x_parts) * AC49X_MAXENVPARTS,
+   GFP_KERNEL);
+
+   if (!ac49x_parts)
+   return -ENOMEM;
+
+   linuxpartnum = 0;
+   for (envpartnum = 0; envpartnum  AC49X_MAXENVPARTS; envpartnum++) {
+   struct mtd_partition parsepart;
+   unsigned int offset, size, type;
+   int err;
+   sprintf(evn, mtd%d, envpartnum);
+   partvar = prom_getenv(evn);
+   if (!partvar

[OpenWrt-Devel] [PATCH 5/8] [ar7] enable serial kludge on AC49x

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ar7/patches-3.3/500-serial_kludge.patch 
b/target/linux/ar7/patches-3.3/500-serial_kludge.patch
index 5c19cf2..159fb56 100644
--- a/target/linux/ar7/patches-3.3/500-serial_kludge.patch
+++ b/target/linux/ar7/patches-3.3/500-serial_kludge.patch
@@ -1,5 +1,7 @@
 a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
+Index: linux-3.3.8/drivers/tty/serial/8250/8250.c
+===
+--- linux-3.3.8.orig/drivers/tty/serial/8250/8250.c
 linux-3.3.8/drivers/tty/serial/8250/8250.c
 @@ -290,6 +290,13 @@ static const struct serial8250_config ua
.fcr= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags  = UART_CAP_FIFO | UART_CAP_AFE | UART_CAP_EFR,
@@ -18,7 +20,7 @@
struct uart_8250_port *up =
container_of(port, struct uart_8250_port, port);
  
-+#ifdef CONFIG_AR7
++#if defined(CONFIG_AR7) || defined(CONFIG_AC49X)
 +  wait_for_xmitr(up, BOTH_EMPTY);
 +#else
wait_for_xmitr(up, UART_LSR_THRE);
-- 
1.7.12.2



pgpi26cqvlKqC.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/8] [ar7] create generic subtarget

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

 delete mode 100644 target/linux/ar7/config-3.3
 create mode 100644 target/linux/ar7/generic/config-3.3
 create mode 100644 target/linux/ar7/generic/profiles/100-Annex-A.mk
 create mode 100644 target/linux/ar7/generic/profiles/110-Annex-B.mk
 create mode 100644 target/linux/ar7/generic/profiles/200-Texas.mk
 create mode 100644 target/linux/ar7/generic/profiles/210-None.mk
 create mode 100644 target/linux/ar7/generic/target.mk
 delete mode 100644 target/linux/ar7/profiles/100-Annex-A.mk
 delete mode 100644 target/linux/ar7/profiles/110-Annex-B.mk
 delete mode 100644 target/linux/ar7/profiles/200-Texas.mk
 delete mode 100644 target/linux/ar7/profiles/210-None.mk

diff --git a/target/linux/ar7/Makefile b/target/linux/ar7/Makefile
index da3e252..ead26d9 100644
--- a/target/linux/ar7/Makefile
+++ b/target/linux/ar7/Makefile
@@ -11,6 +11,7 @@ BOARD:=ar7
 BOARDNAME:=TI AR7
 FEATURES:=squashfs jffs2 atm
 MAINTAINER:=Florian Fainelli flor...@openwrt.org
+SUBTARGETS:=generic ac49x
 
 LINUX_VERSION:=3.3.8
 
diff --git a/target/linux/ar7/config-3.3 b/target/linux/ar7/config-3.3
deleted file mode 100644
index 8ff39e2..000
--- a/target/linux/ar7/config-3.3
+++ /dev/null
@@ -1,102 +0,0 @@
-CONFIG_ADM6996_PHY=y
-CONFIG_AR7=y
-CONFIG_AR7_GPIO=y
-CONFIG_AR7_WDT=y
-CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
-CONFIG_ARCH_DISCARD_MEMBLOCK=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_BCMA_POSSIBLE=y
-CONFIG_BOOT_ELF32=y
-CONFIG_CEVT_R4K=y
-CONFIG_CEVT_R4K_LIB=y
-CONFIG_CPMAC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-CONFIG_CPU_MIPSR1=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_CSRC_R4K=y
-CONFIG_CSRC_R4K_LIB=y
-# CONFIG_DEBUG_ZBOOT is not set
-CONFIG_DECOMPRESS_LZMA=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_ETHERNET_PACKET_MANGLE=y
-CONFIG_FIXED_PHY=y
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GPIOLIB=y
-CONFIG_HARDWARE_WATCHPOINTS=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_GENERIC_HARDIRQS=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_WORK=y
-CONFIG_HAVE_KERNEL_BZIP2=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HW_RANDOM=y
-CONFIG_INITRAMFS_SOURCE=
-CONFIG_IP17XX_PHY=y
-CONFIG_IRQ_CPU=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_KALLSYMS=y
-CONFIG_KERNEL_GZIP=y
-CONFIG_LEDS_GPIO=y
-CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-CONFIG_MDIO_BOARDINFO=y
-CONFIG_MIPS=y
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MACHINE is not set
-CONFIG_MIPS_MT_DISABLED=y
-CONFIG_MTD_AR7_PARTS=y
-CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MVSWITCH_PHY=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_PER_CPU_KM=y
-CONFIG_NO_EXCEPT_FILL=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PHYLIB=y
-# CONFIG_PREEMPT_RCU is not set
-# CONFIG_SCSI_DMA is not set
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SWCONFIG=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_SYS_SUPPORTS_ZBOOT=y
-CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y
-CONFIG_VLYNQ=y
-# CONFIG_VLYNQ_DEBUG is not set
-CONFIG_XZ_DEC=y
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ar7/generic/config-3.3 
b/target/linux/ar7/generic/config-3.3
new file mode 100644
index 000..8ff39e2
--- /dev/null
+++ b/target/linux/ar7/generic/config-3.3
@@ -0,0 +1,102 @@
+CONFIG_ADM6996_PHY=y
+CONFIG_AR7=y
+CONFIG_AR7_GPIO=y
+CONFIG_AR7_WDT=y
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_BCMA_POSSIBLE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_CEVT_R4K=y
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CPMAC=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CSRC_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+# CONFIG_DEBUG_ZBOOT is not set
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FIXED_PHY=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y

[OpenWrt-Devel] [PATCH 7/8] [ar7] create AC49x subtarget

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/ar7/ac49x/config-3.3
 create mode 100644 target/linux/ar7/ac49x/profiles/210-None.mk
 create mode 100644 target/linux/ar7/ac49x/target.mk

diff --git a/target/linux/ar7/ac49x/config-3.3 
b/target/linux/ar7/ac49x/config-3.3
new file mode 100644
index 000..2875d3b
--- /dev/null
+++ b/target/linux/ar7/ac49x/config-3.3
@@ -0,0 +1,102 @@
+CONFIG_AC49X=y
+CONFIG_ADM6996_PHY=y
+CONFIG_AR7_GPIO=y
+CONFIG_AR7_WDT=y
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_BCMA_POSSIBLE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_CEVT_R4K=y
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CPMAC=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CSRC_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+# CONFIG_DEBUG_ZBOOT is not set
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FIXED_PHY=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GPIOLIB=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_WORK=y
+CONFIG_HAVE_KERNEL_BZIP2=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HW_RANDOM=y
+CONFIG_INITRAMFS_SOURCE=
+CONFIG_IP17XX_PHY=y
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_KALLSYMS=y
+CONFIG_KERNEL_GZIP=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MIPS=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+# CONFIG_MIPS_MACHINE is not set
+CONFIG_MIPS_MT_DISABLED=y
+CONFIG_MTD_AC49X_PARTS=y
+CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MVSWITCH_PHY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NO_EXCEPT_FILL=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PHYLIB=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_SCSI_DMA is not set
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_SWCONFIG=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_ZBOOT=y
+CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y
+CONFIG_VLYNQ=y
+# CONFIG_VLYNQ_DEBUG is not set
+CONFIG_XZ_DEC=y
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ar7/ac49x/profiles/210-None.mk 
b/target/linux/ar7/ac49x/profiles/210-None.mk
new file mode 100644
index 000..2fcfacd
--- /dev/null
+++ b/target/linux/ar7/ac49x/profiles/210-None.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/None
+  NAME:=No WiFi
+  PACKAGES:=
+endef
+
+define Profile/None/Description
+   Package set without WiFi support
+endef
+$(eval $(call Profile,None))
+
diff --git a/target/linux/ar7/ac49x/target.mk b/target/linux/ar7/ac49x/target.mk
new file mode 100644
index 000..47f3ab2
--- /dev/null
+++ b/target/linux/ar7/ac49x/target.mk
@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+SUBTARGET:=ac49x
+BOARDNAME:=AudioCodes AC49x
+
+define Target/Description
+   Build firmware images for AudioCodes AC49x based routers.
+endef
-- 
1.7.12.2



pgpAOfAUzPlyn.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 8/8] [ar7] generate image for AC49x

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

diff --git a/target/linux/ar7/image/Makefile b/target/linux/ar7/image/Makefile
index 6278b31..dcc8a75 100644
--- a/target/linux/ar7/image/Makefile
+++ b/target/linux/ar7/image/Makefile
@@ -67,6 +67,9 @@ define Image/Build/Titan
$(STAGING_DIR_HOST)/bin/mktitanimg -o 
$(BIN_DIR)/openwrt-$(2)-na-$(4)-code.bin -i $(KDIR)/loader.bin 
$(KDIR)/root.$(1) -a 0x1 0x1 -h 2  -p 0x4D575943 -s 0x0b01
 endef
 
+define Image/Build/AudioCodes
+   ( dd if=$(KDIR)/vmlinux.elf bs=64k conv=sync ; dd if=$(KDIR)/root.$(1) 
)  $(BIN_DIR)/openwrt-$(2)-$(1).bin
+endef
 
 #define Image/Build/sErCoMm
 #  cat sercomm/adam2.bin $(BIN_DIR)/$(IMG_PREFIX)-$(1).bin  
$(KDIR)/dgfw.tmp
@@ -86,6 +89,7 @@ define Image/Build/Initramfs
$(CP) $(KDIR)/vmlinux.bin $(BIN_DIR)/$(IMG_PREFIX)-initramfs.bin
 endef
 
+ifeq ($(CONFIG_AR7),y)
 define Image/Build
dd if=$(KDIR)/loader.bin $(call align/$(1))  
$(BIN_DIR)/$(IMG_PREFIX)-$(1).bin
cat $(KDIR)/root.$(1)  $(BIN_DIR)/$(IMG_PREFIX)-$(1).bin
@@ -113,5 +117,16 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call Image/Build/Initramfs)
 endif
 endef
+endif
+
+ifeq ($(CONFIG_AC49X),y)
+define Image/Build
+#  $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(1).bin)
+   $(call Image/Build/AudioCodes,$(1),mp202,$(1))
+ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+   $(call Image/Build/Initramfs)
+endif
+endef
+endif
 
 $(eval $(call BuildImage))
-- 
1.7.12.2



pgpSenmCvBqvR.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 0/7] [ar7] AudioCodes AC49x sub-target

2012-10-17 Thread Daniel Golle
Some more cleanup was done:
AC49x is now a sub-target (instead of a separate machine) also in the kernel.
This further reduces the foot-print of this addition...

Daniel Golle (7):
  [ar7] free memory below kernel offset
  [ar7] add AudioCodes AC49x platform support to kernel
  [ar7] support AC49x bootloader environment
  [ar7] detect AC49x flash partitions
  [ar7] create generic subtarget
  [ar7] create AC49x subtarget
  [ar7] generate image for AC49x

 target/linux/ar7/Makefile  |   1 +
 target/linux/ar7/ac49x/config-default  |   6 +
 target/linux/ar7/ac49x/profiles/210-None.mk|  17 ++
 target/linux/ar7/ac49x/target.mk   |  10 +
 target/linux/ar7/config-3.3|   1 -
 target/linux/ar7/files/drivers/mtd/ac49xpart.c | 220 +
 target/linux/ar7/generic/config-default|   6 +
 target/linux/ar7/generic/profiles/100-Annex-A.mk   |  17 ++
 target/linux/ar7/generic/profiles/110-Annex-B.mk   |  17 ++
 target/linux/ar7/generic/profiles/200-Texas.mk |  18 ++
 target/linux/ar7/generic/profiles/210-None.mk  |  17 ++
 target/linux/ar7/generic/target.mk |  10 +
 target/linux/ar7/image/Makefile|  15 ++
 .../200-free-mem-below-kernel-offset.patch |  15 ++
 .../ar7/patches-3.3/300-add-ac49x-platform.patch   |  82 
 .../ar7/patches-3.3/310-ac49x-prom-support.patch   |  20 ++
 .../ar7/patches-3.3/320-ac49x-mtd-partitions.patch |  35 
 target/linux/ar7/profiles/100-Annex-A.mk   |  17 --
 target/linux/ar7/profiles/110-Annex-B.mk   |  17 --
 target/linux/ar7/profiles/200-Texas.mk |  18 --
 target/linux/ar7/profiles/210-None.mk  |  17 --
 21 files changed, 506 insertions(+), 70 deletions(-)
 create mode 100644 target/linux/ar7/ac49x/config-default
 create mode 100644 target/linux/ar7/ac49x/profiles/210-None.mk
 create mode 100644 target/linux/ar7/ac49x/target.mk
 create mode 100644 target/linux/ar7/files/drivers/mtd/ac49xpart.c
 create mode 100644 target/linux/ar7/generic/config-default
 create mode 100644 target/linux/ar7/generic/profiles/100-Annex-A.mk
 create mode 100644 target/linux/ar7/generic/profiles/110-Annex-B.mk
 create mode 100644 target/linux/ar7/generic/profiles/200-Texas.mk
 create mode 100644 target/linux/ar7/generic/profiles/210-None.mk
 create mode 100644 target/linux/ar7/generic/target.mk
 create mode 100644 
target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch
 create mode 100644 target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
 create mode 100644 target/linux/ar7/patches-3.3/310-ac49x-prom-support.patch
 create mode 100644 target/linux/ar7/patches-3.3/320-ac49x-mtd-partitions.patch
 delete mode 100644 target/linux/ar7/profiles/100-Annex-A.mk
 delete mode 100644 target/linux/ar7/profiles/110-Annex-B.mk
 delete mode 100644 target/linux/ar7/profiles/200-Texas.mk
 delete mode 100644 target/linux/ar7/profiles/210-None.mk

-- 
1.7.12.2



pgpg4F7JcrqIj.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 1/7] [ar7] free memory below kernel offset

2012-10-17 Thread Daniel Golle
Some bootloaders (e.g. PSPBoot on AC49x) have a load-offset, this frees that
memory region so it is usable for Linux.

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 
target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch

diff --git 
a/target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch 
b/target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch
new file mode 100644
index 000..399822a
--- /dev/null
+++ b/target/linux/ar7/patches-3.3/200-free-mem-below-kernel-offset.patch
@@ -0,0 +1,15 @@
+--- a/arch/mips/ar7/memory.c
 b/arch/mips/ar7/memory.c
+@@ -67,5 +67,11 @@ void __init prom_meminit(void)
+ 
+ void __init prom_free_prom_memory(void)
+ {
+-  /* Nothing to free */
++  /* adapted from arch/mips/txx9/generic/setup.c */
++  unsigned long saddr = PHYS_OFFSET + PAGE_SIZE;
++  unsigned long eaddr = __pa_symbol(_text);
++
++  /* free memory between prom-record and kernel _text base */
++  if (saddr  eaddr)
++  free_init_pages(prom memory, saddr, eaddr);
+ }
-- 
1.7.12.2



pgp6BAOxoTIjH.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 2/7] [ar7] add AudioCodes AC49x platform support to kernel

2012-10-17 Thread Daniel Golle

Signed-off-by: Daniel Golle dgo...@allnet.de

 create mode 100644 target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch

diff --git a/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch 
b/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
new file mode 100644
index 000..80f0f28
--- /dev/null
+++ b/target/linux/ar7/patches-3.3/300-add-ac49x-platform.patch
@@ -0,0 +1,82 @@
+--- a/arch/mips/ar7/Platform
 b/arch/mips/ar7/Platform
+@@ -3,4 +3,9 @@
+ #
+ platform-$(CONFIG_AR7)  += ar7/
+ cflags-$(CONFIG_AR7)+= -I$(srctree)/arch/mips/include/asm/mach-ar7
+-load-$(CONFIG_AR7)  += 0x9410
++load-$(CONFIG_AR7_TI)   += 0x9410
++
++#
++# AudioCodes AC49x
++#
++load-$(CONFIG_AR7_AC49X)+= 0x945ca000
+--- a/arch/mips/ar7/setup.c
 b/arch/mips/ar7/setup.c
+@@ -69,6 +69,8 @@ const char *get_system_type(void)
+   return TI AR7 (TNETV1056);
+   case TITAN_CHIP_1060:
+   return TI AR7 (TNETV1060);
++  case TITAN_CHIP_AC:
++  return AudioCodes AC49x;
+   }
+   default:
+   return TI AR7 (unknown);
+--- a/arch/mips/include/asm/mach-ar7/ar7.h
 b/arch/mips/include/asm/mach-ar7/ar7.h
+@@ -92,6 +92,7 @@
+ #define TITAN_CHIP_1055   0x0e
+ #define TITAN_CHIP_1056   0x0d
+ #define TITAN_CHIP_1060   0x07
++#define TITAN_CHIP_AC 0x02
+ 
+ /* Interrupts */
+ #define AR7_IRQ_UART0 15
+--- a/arch/mips/Kconfig
 b/arch/mips/Kconfig
+@@ -72,7 +72,7 @@ config AR7
+   select VLYNQ
+   help
+ Support for the Texas Instruments AR7 System-on-a-Chip
+-family: TNETD7100, 7200 and 7300.
++family: TI TNETD7100, 7200, 7300 and AudioCodes AC49x.
+ 
+ config ATH79
+   bool Atheros AR71XX/AR724X/AR913X based boards
+@@ -814,6 +814,7 @@ config NLM_XLP_BOARD
+ endchoice
+ 
+ source arch/mips/alchemy/Kconfig
++source arch/mips/ar7/Kconfig
+ source arch/mips/ath79/Kconfig
+ source arch/mips/bcm47xx/Kconfig
+ source arch/mips/bcm63xx/Kconfig
+--- /dev/null
 b/arch/mips/ar7/Kconfig
+@@ -0,0 +1,26 @@
++if AR7
++
++config AR7_TI
++  bool
++
++config AR7_AC49X
++  bool
++
++choice
++  prompt AR7 SoC family selection
++  default AR7_TYPE_TI
++  depends on AR7
++  help
++Select AR7 MIPS SoC implementation.
++
++  config AR7_TYPE_TI
++  bool Texas Instruments AR7
++  select AR7_TI
++
++  config AR7_TYPE_AC49X
++  bool AudioCodes AC49X
++  select AR7_AC49X
++
++endchoice
++
++endif
-- 
1.7.12.2



pgpF7YAJaxXNS.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


<    4   5   6   7   8   9   10   11   12   >