Re: [OpenWrt-Devel] [PATCH RESEND 2/2] Devel-Branch: Creating root default password in buildroot via menuconfig
Hi all, since i didn't hear anything about this in the last 6 weeks i like to ask, if there are any problems/concerns to add this? I would be more than happy to help :) Thanks alot and have a nice week! Ben Am 02.06.2014 09:26, schrieb Ben: Hi everybody, to deploy minimal OpenWrt images on multiple routers it is necessary to set a root password, while building the deployable file. Therefore i added a patch that is setting a default password in the /etc/shadow file of the base-files package. It is using the openssl command of the building host to create the hash of the password. Here are the diff files for both the current development branch (Barrier Braker) and the 12.09 branch..please add the patches to both branches, to be able to use it in the currently stable release as well. *devel-branch (http://git.openwrt.org/?p=openwrt.git;a=summary):* Signed-off-by: Benjamin Pflueg b...@bensbox.de --- diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 207af35..494047e 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -9,6 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/baseconf.mk PKG_NAME:=base-files PKG_RELEASE:=152 @@ -113,6 +114,11 @@ define Package/base-files/install $(1)/etc/openwrt_version \ $(1)/etc/openwrt_release +$(if $(filter $(BASECONF_ROOT_PASSWORD),x), \ +$(SED) 's/%P/x/g' $(1)/etc/shadow, \ +$(SED) 's/%P/$(shell $(OPENSSL) passwd -1 $(BASECONF_ROOT_PASSWORD) | $(SED_PLAIN) -e 's/[/.$$^]/\\/g' | $(SED_PLAIN) -e 's/\$$/\$$\$$/g')/' $(1)/etc/shadow \ +) + mkdir -p $(1)/CONTROL mkdir -p $(1)/dev mkdir -p $(1)/etc/crontabs diff --git a/package/base-files/files/etc/shadow b/package/base-files/files/etc/shadow index 4b4154f..f35be79 100644 --- a/package/base-files/files/etc/shadow +++ b/package/base-files/files/etc/shadow @@ -1,4 +1,4 @@ -root::0:0:9:7::: +root:%P:0:0:9:7::: daemon:*:0:0:9:7::: ftp:*:0:0:9:7::: network:*:0:0:9:7::: diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index a9eb78c..2f2e22a 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -221,3 +221,19 @@ menuconfig SMIMEOPT Path to a file containing the passphrase for the signing key. If the signing key is not encrypted and does not require a passphrase, this option may be left blank. + +menuconfig BASECONFOPT +bool Base system configurations if IMAGEOPT +default n +help +In here you can set configurations like a default root password. +They are suppose to be very basic and default settings to the +vanilla OpenWRT firmware. + +config BASECONF_ROOT_PASSWORD +string +prompt Custom default root password if BASECONFOPT +help +Usually the firmware does not have the root password set. +Here you can set a default one, that will be in effect +even after a factory reset. diff --git a/rules.mk b/rules.mk index a84636a..ef8ef2f 100644 --- a/rules.mk +++ b/rules.mk @@ -196,10 +196,12 @@ TARGET_AR:=$(TARGET_CROSS)ar TARGET_RANLIB:=$(TARGET_CROSS)ranlib TARGET_CXX:=$(TARGET_CROSS)g++ KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh -SED:=$(STAGING_DIR_HOST)/bin/sed -i -e +SED_PLAIN:=$(STAGING_DIR_HOST)/bin/sed +SED:=$(SED_PLAIN) -i -e CP:=cp -fpR LN:=ln -sf XARGS:=xargs -r +OPENSSL:=openssl INSTALL_BIN:=install -m0755 INSTALL_DIR:=install -d -m0755 diff --git a/include/baseconf.mk b/include/baseconf.mk new file mode 100644 index 000..ad8db58 --- /dev/null +++ b/include/baseconf.mk @@ -0,0 +1,6 @@ + +PKG_CONFIG_DEPENDS += \ +CONFIG_BASECONF_ROOT_PASSWORD + +BASECONF_ROOT_PASSWORD:=$(call qstrip,$(CONFIG_BASECONF_ROOT_PASSWORD)) +BASECONF_ROOT_PASSWORD:=$(if $(BASECONF_ROOT_PASSWORD),$(BASECONF_ROOT_PASSWORD),x) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 00/17] atheros: I/O cleanups
I've tried to test this on an ar2317, but the series isn't applying cleanly to today's trunk. I got the first one to succeed, with some fuzz, the second applied cleanly, but the third failed, and I stopped trying. Cheers, Karl P 2014-07-12 17:33 GMT+04:00 Sergey Ryazanov ryazanov@gmail.com: Main goals of this series: * Simplify interface between arch code and SoC drivers * Simplify internal realization of arch code * Make code consistent with mainstream kernel rules and practice Forgot to say, that this series extensively tested with FON2202 (ar2315 based) and D-Link DWL-2100AP (ar2313 based), but tests are not done with AR2317/8 and AR5312, since I have no access to such boards now :( ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
On 14/07/2014 12:59, Xiongfei Guo wrote: Hi, john, How is the luci, which version the luci will be used. Teh devel? or luci will bump to 0.12? Xiongfei Guo Credo Semi. On 07/14/2014 05:12 PM, John Crispin wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. ___ __ | |.-.-.-.| | | |..| |_ | - || _ | -__| || | | || _|| _| |___|| __|_|__|__||||__| || |__| W I R E L E S S F R E E D O M - BARRIER BREAKER (14.07 RC1) - * 1/2 oz Galliano Pour all ingredients into * 4 oz cold Coffee an irish coffee mug filled * 1 1/2 oz Dark Rum with crushed ice. Stir. * 2 tsp. Creme de Cacao - Hi, we are using 9b9b17ece34db50cf634a7f5ba38872b1c32c827 for RC1 John ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
On 14 July 2014 17:12, John Crispin j...@phrozen.org wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. ___ __ | |.-.-.-.| | | |..| |_ | - || _ | -__| || | | || _|| _| |___|| __|_|__|__||||__| || |__| W I R E L E S S F R E E D O M - BARRIER BREAKER (14.07 RC1) - * 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 - Cool. Two years have passed and a fresh new OpenWrt release is coming :) http://downloads.openwrt.org/barrier_breaker/14.07-rc1/ ** Highlights since Attitude Adjustment ** Default configuration and images * Linux kernel updated to version 3.10 * Procd: new preinit, init, hotplug and event system written in C * Native IPv6-support - RA DHCPv6+PD client and server - Local prefix allocation source-restricted routes (multihoming) * Filesystem improvements - Added support for sysupgrade on NAND-flash - Added support for filesystem snapshot and rollback I may ask how can this feature be enabled? I am not following the trunk commits for quite a while and thus not aware of this new feature. Regards. yousong - Rewritten mounting system in C for rootfs and block devices * UCI configuration improvements - Support for testing configuration and rollback to working last working state - Unified change trigger system to restart services on-demand - Added a data validation layer * Networking improvements - Netifd now handles setup and configuration reload of wireless interfaces - Added reworked event support to allow obsoleting network hotplug-scripts - Added support for dynamic firewall rules and zones - Added support for transparent multicast to unicast translation for bridges - Various other fixes and improvements Additional highlights selectable in the package feeds or SDK * Extended IPv6-support - Added DS-Lite support and improved 6to4, 6in4 and 6rd-support - Experimental support for Lightweight 4over6, MAP-E and MAP-T - Draft-support for self-managing home networks (HNCP) * rpcd: new JSONRPC over HTTP-frontend for remote access to ubus * mdns: new lightweight mdns daemon (work in progress) * Initial support for the musl C standard library * Support for QMI-based 3g/4g modems * Support for DNSSEC validation * Added architecture for package signing and SHA256 hashing * ... and many more cool things Package feed reorganization For quite a while already we are not very satisfied with the quality of the packages-feed. To address this, we decided to do a fresh start on GitHub. The new feed https://github.com/openwrt/packages should be used from now on and package maintainers are asked to move their packages there. For the final release we will still build the old packages feed but it will be necessary to enable it manually in the opkg package list to be usable. All current feeds should not have any dependencies on the old.packages feed. Currently a few packages still fail, mainly due to these cross feed dependencies. We will contact the respective maintainers to help resolve these issues for RC2. New build servers We would like to express our gratitude to Imagination Technology for funding the 2 build servers that we used for the release. Whats next ? We aim at releasing Chaos Calmer (CC) before the end of the year. The CC release will use 3.14 or a newer LTS kernel as baseline. Have fun! The OpenWrt developer team ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
On 14/07/2014 13:13, Yousong Zhou wrote: On 14 July 2014 17:12, John Crispin j...@phrozen.org wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. ___ __ | |.-.-.-.| | | |..| |_ | - || _ | -__| || | | || _|| _| |___|| __|_|__|__||||__| || |__| W I R E L E S S F R E E D O M - BARRIER BREAKER (14.07 RC1) - * 1/2 oz Galliano Pour all ingredients into * 4 oz cold Coffee an irish coffee mug filled * 1 1/2 oz Dark Rum with crushed ice. Stir. * 2 tsp. Creme de Cacao - Cool. Two years have passed and a fresh new OpenWrt release is coming :) actually it is 1 year and 3 months http://downloads.openwrt.org/barrier_breaker/14.07-rc1/ ** Highlights since Attitude Adjustment ** Default configuration and images * Linux kernel updated to version 3.10 * Procd: new preinit, init, hotplug and event system written in C * Native IPv6-support - RA DHCPv6+PD client and server - Local prefix allocation source-restricted routes (multihoming) * Filesystem improvements - Added support for sysupgrade on NAND-flash - Added support for filesystem snapshot and rollback I may ask how can this feature be enabled? I am not following the trunk commits for quite a while and thus not aware of this new feature. use the /sbin/snapshot tool. i think i will make a howto for this in the wiki as its quite a hidden feature Regards. yousong - Rewritten mounting system in C for rootfs and block devices * UCI configuration improvements - Support for testing configuration and rollback to working last working state - Unified change trigger system to restart services on-demand - Added a data validation layer * Networking improvements - Netifd now handles setup and configuration reload of wireless interfaces - Added reworked event support to allow obsoleting network hotplug-scripts - Added support for dynamic firewall rules and zones - Added support for transparent multicast to unicast translation for bridges - Various other fixes and improvements Additional highlights selectable in the package feeds or SDK * Extended IPv6-support - Added DS-Lite support and improved 6to4, 6in4 and 6rd-support - Experimental support for Lightweight 4over6, MAP-E and MAP-T - Draft-support for self-managing home networks (HNCP) * rpcd: new JSONRPC over HTTP-frontend for remote access to ubus * mdns: new lightweight mdns daemon (work in progress) * Initial support for the musl C standard library * Support for QMI-based 3g/4g modems * Support for DNSSEC validation * Added architecture for package signing and SHA256 hashing * ... and many more cool things Package feed reorganization For quite a while already we are not very satisfied with the quality of the packages-feed. To address this, we decided to do a fresh start on GitHub. The new feed https://github.com/openwrt/packages should be used from now on and package maintainers are asked to move their packages there. For the final release we will still build the old packages feed but it will be necessary to enable it manually in the opkg package list to be usable. All current feeds should not have any dependencies on the old.packages feed. Currently a few packages still fail, mainly due to these cross feed dependencies. We will contact the respective maintainers to help resolve these issues for RC2. New build servers We would like to express our gratitude to Imagination Technology for funding the 2 build servers that we used for the release. Whats next ? We aim at releasing Chaos Calmer (CC) before the end of the year. The CC release will use 3.14 or a newer LTS kernel as baseline. Have fun! The OpenWrt developer team ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
Good to see package feed on GitHub. Would be great if there was a full OpenWRT source mirror on GitHub, for some reason git.openwrt.org refuses connections on HTTPS, both from my home and work IPs. On Mon, Jul 14, 2014 at 1:12 PM, John Crispin j...@phrozen.org wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. ___ __ | |.-.-.-.| | | |..| |_ | - || _ | -__| || | | || _|| _| |___|| __|_|__|__||||__| || |__| W I R E L E S S F R E E D O M - BARRIER BREAKER (14.07 RC1) - * 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 - http://downloads.openwrt.org/barrier_breaker/14.07-rc1/ ** Highlights since Attitude Adjustment ** Default configuration and images * Linux kernel updated to version 3.10 * Procd: new preinit, init, hotplug and event system written in C * Native IPv6-support - RA DHCPv6+PD client and server - Local prefix allocation source-restricted routes (multihoming) * Filesystem improvements - Added support for sysupgrade on NAND-flash - Added support for filesystem snapshot and rollback - Rewritten mounting system in C for rootfs and block devices * UCI configuration improvements - Support for testing configuration and rollback to working last working state - Unified change trigger system to restart services on-demand - Added a data validation layer * Networking improvements - Netifd now handles setup and configuration reload of wireless interfaces - Added reworked event support to allow obsoleting network hotplug-scripts - Added support for dynamic firewall rules and zones - Added support for transparent multicast to unicast translation for bridges - Various other fixes and improvements Additional highlights selectable in the package feeds or SDK * Extended IPv6-support - Added DS-Lite support and improved 6to4, 6in4 and 6rd-support - Experimental support for Lightweight 4over6, MAP-E and MAP-T - Draft-support for self-managing home networks (HNCP) * rpcd: new JSONRPC over HTTP-frontend for remote access to ubus * mdns: new lightweight mdns daemon (work in progress) * Initial support for the musl C standard library * Support for QMI-based 3g/4g modems * Support for DNSSEC validation * Added architecture for package signing and SHA256 hashing * ... and many more cool things Package feed reorganization For quite a while already we are not very satisfied with the quality of the packages-feed. To address this, we decided to do a fresh start on GitHub. The new feed https://github.com/openwrt/packages should be used from now on and package maintainers are asked to move their packages there. For the final release we will still build the old packages feed but it will be necessary to enable it manually in the opkg package list to be usable. All current feeds should not have any dependencies on the old.packages feed. Currently a few packages still fail, mainly due to these cross feed dependencies. We will contact the respective maintainers to help resolve these issues for RC2. New build servers We would like to express our gratitude to Imagination Technology for funding the 2 build servers that we used for the release. Whats next ? We aim at releasing Chaos Calmer (CC) before the end of the year. The CC release will use 3.14 or a newer LTS kernel as baseline. Have fun! The OpenWrt developer team ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
On 14 July 2014 19:15, John Crispin j...@phrozen.org wrote: On 14/07/2014 13:13, Yousong Zhou wrote: On 14 July 2014 17:12, John Crispin j...@phrozen.org wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. ___ __ | |.-.-.-.| | | |..| |_ | - || _ | -__| || | | || _|| _| |___|| __|_|__|__||||__| || |__| W I R E L E S S F R E E D O M - BARRIER BREAKER (14.07 RC1) - * 1/2 oz Galliano Pour all ingredients into * 4 oz cold Coffee an irish coffee mug filled * 1 1/2 oz Dark Rum with crushed ice. Stir. * 2 tsp. Creme de Cacao - Cool. Two years have passed and a fresh new OpenWrt release is coming :) actually it is 1 year and 3 months Sorry, I thought AA 12.09 is for September of year 2012. yousong http://downloads.openwrt.org/barrier_breaker/14.07-rc1/ ** Highlights since Attitude Adjustment ** Default configuration and images * Linux kernel updated to version 3.10 * Procd: new preinit, init, hotplug and event system written in C * Native IPv6-support - RA DHCPv6+PD client and server - Local prefix allocation source-restricted routes (multihoming) * Filesystem improvements - Added support for sysupgrade on NAND-flash - Added support for filesystem snapshot and rollback I may ask how can this feature be enabled? I am not following the trunk commits for quite a while and thus not aware of this new feature. use the /sbin/snapshot tool. i think i will make a howto for this in the wiki as its quite a hidden feature Regards. yousong - Rewritten mounting system in C for rootfs and block devices * UCI configuration improvements - Support for testing configuration and rollback to working last working state - Unified change trigger system to restart services on-demand - Added a data validation layer * Networking improvements - Netifd now handles setup and configuration reload of wireless interfaces - Added reworked event support to allow obsoleting network hotplug-scripts - Added support for dynamic firewall rules and zones - Added support for transparent multicast to unicast translation for bridges - Various other fixes and improvements Additional highlights selectable in the package feeds or SDK * Extended IPv6-support - Added DS-Lite support and improved 6to4, 6in4 and 6rd-support - Experimental support for Lightweight 4over6, MAP-E and MAP-T - Draft-support for self-managing home networks (HNCP) * rpcd: new JSONRPC over HTTP-frontend for remote access to ubus * mdns: new lightweight mdns daemon (work in progress) * Initial support for the musl C standard library * Support for QMI-based 3g/4g modems * Support for DNSSEC validation * Added architecture for package signing and SHA256 hashing * ... and many more cool things Package feed reorganization For quite a while already we are not very satisfied with the quality of the packages-feed. To address this, we decided to do a fresh start on GitHub. The new feed https://github.com/openwrt/packages should be used from now on and package maintainers are asked to move their packages there. For the final release we will still build the old packages feed but it will be necessary to enable it manually in the opkg package list to be usable. All current feeds should not have any dependencies on the old.packages feed. Currently a few packages still fail, mainly due to these cross feed dependencies. We will contact the respective maintainers to help resolve these issues for RC2. New build servers We would like to express our gratitude to Imagination Technology for funding the 2 build servers that we used for the release. Whats next ? We aim at releasing Chaos Calmer (CC) before the end of the year. The CC release will use 3.14 or a newer LTS kernel as baseline. Have fun! The OpenWrt developer team ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [ANN] MicroPython - well-known scripting language, unbloated
Hello, I wondered if it makes sense to post about MicroPython, but recent post about Squirrel language prompted me to. So, there's a project to implement, from scratch, very lean interpreter for Python3 scripting language. The project is well under way and currently implements good deal of Python3 semantics. It can't yet run arbitrary existing Python code, but the whole idea of MicroPython is to provide efficient subset of Python to develop apps from scratch (or to port existing code). Source code: https://github.com/micropython/micropython User-facing site: http://micropython.org/ My motive for working on MicroPython is dissatisfaction with Lua - based both on my personal tastes and experience, and analyzing other projects' experience. For example, LuCI web UI, as used in OpenWRT, is known to be slow, and known not to be able to reasonably work on system with less than 32MB of RAM at all. I don't think these are results of Lua's technical traits - rather, its semantic and programming psychology issues. The way I see it, in many places where Lua is used currently, it is used only because of the lack of alternatives. So, people have to use it thru not wanting to use it. Then, they're not interested to learn details of the language to use it efficiently, they're not interested in writing efficient programs, not interested in optimizing code, etc. - they interested just to do something ASAP, and get their hands off of it. So, if you consciously or subconsciously dissatisfied with Lua, please consider giving MicroPython a look and try! ;-) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] IPv6 firewall and Port Control Protocol (Was: Barrier Breaker 14.07-rc1)
On Mon, Jul 14, 2014 at 11:12:01AM +0200, John Crispin wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. Excellent news, thanks! * Native IPv6-support - RA DHCPv6+PD client and server - Local prefix allocation source-restricted routes (multihoming) * Extended IPv6-support - Added DS-Lite support and improved 6to4, 6in4 and 6rd-support - Experimental support for Lightweight 4over6, MAP-E and MAP-T - Draft-support for self-managing home networks (HNCP) The default configuration of the IPv6 firewall seems to take the mostly closed approach. That is, it doesn't forward any inbound packets (except for ICMPv6 and, of course, return traffic). This is a perfectly valid approach, although one could argue about end-to-end reachability. But without a firewall control protocol such as PCP [1], applications cannot be reached from the outside (which might be desirable for P2P, VoIP, gaming, etc). Interesting, people from Swisscom take the opposite approach, and deployed a mostly open IPv6 firewall in their CPEs: http://tools.ietf.org/html/draft-ietf-v6ops-balanced-ipv6-security-01 http://www.internetsociety.org/deploy360/blog/2014/06/video-balancing-end-user-ipv6-security-and-end-to-end-connectivity-ripe-68/ Which brings me to the question: is supporting PCP [1] a planned feature? Not that many clients support it yet, but well... It seems that MiniUPnPd has recently gained support for PCP: http://www.ietf.org/proceedings/87/slides/slides-87-pcp-13.pdf But since server-side PCP is closely related to the firewall, it probably needs some proper integration for OpenWRT (unless this is already implemented?) Thanks, Baptiste [1] http://en.wikipedia.org/wiki/Port_Control_Protocol pgp_4pZJKrYEj.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] [ANN] MicroPython - well-known scripting language, unbloated
Interesting, MicroPython is great. By the way, Luci2 doesn't use Lua at all. On Mon, Jul 14, 2014 at 4:20 PM, Paul Sokolovsky pmis...@gmail.com wrote: Hello, I wondered if it makes sense to post about MicroPython, but recent post about Squirrel language prompted me to. So, there's a project to implement, from scratch, very lean interpreter for Python3 scripting language. The project is well under way and currently implements good deal of Python3 semantics. It can't yet run arbitrary existing Python code, but the whole idea of MicroPython is to provide efficient subset of Python to develop apps from scratch (or to port existing code). Source code: https://github.com/micropython/micropython User-facing site: http://micropython.org/ My motive for working on MicroPython is dissatisfaction with Lua - based both on my personal tastes and experience, and analyzing other projects' experience. For example, LuCI web UI, as used in OpenWRT, is known to be slow, and known not to be able to reasonably work on system with less than 32MB of RAM at all. I don't think these are results of Lua's technical traits - rather, its semantic and programming psychology issues. The way I see it, in many places where Lua is used currently, it is used only because of the lack of alternatives. So, people have to use it thru not wanting to use it. Then, they're not interested to learn details of the language to use it efficiently, they're not interested in writing efficient programs, not interested in optimizing code, etc. - they interested just to do something ASAP, and get their hands off of it. So, if you consciously or subconsciously dissatisfied with Lua, please consider giving MicroPython a look and try! ;-) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] IPv6 firewall and Port Control Protocol (Was: Barrier Breaker 14.07-rc1)
Hi Baptiste, in general our current firewalling approach is to keep defaults for IPv4 and IPv6 relatively close (not considering NAT here of course). Opening up the IPv6 firewall by default would be unexpected and I don't really like the approach for that matter and honestly I don't trust client devices that much. However the packaged version of miniupnpd does indeed support both UPNP WANIPv6FirewallControl and PCP. One of my colleague recently ran a test with PCP and said miniupnpd and it works fine. Cheers, Steven ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
On Mon, 2014-07-14 at 15:17:13 +0400, Nick Shvelidze wrote: Good to see package feed on GitHub. Would be great if there was a full OpenWRT source mirror on GitHub, for some reason git.openwrt.org refuses connections on HTTPS, both from my home and work IPs. Look at here :-) https://github.com/mirrors/openwrt [...] ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] IPv6 firewall and Port Control Protocol (Was: Barrier Breaker 14.07-rc1)
Hi Steven, On Mon, Jul 14, 2014 at 02:38:16PM +0200, Steven Barth wrote: Hi Baptiste, in general our current firewalling approach is to keep defaults for IPv4 and IPv6 relatively close (not considering NAT here of course). Could you detail the reasoning behind this approach? Don't confuse the user? I'd rather have Don't bother the user: things should generally just work, without having to configure anything (in this case, port forwarding). But there is an obvious tradeoff with security. Opening up the IPv6 firewall by default would be unexpected and I don't really like the approach for that matter and honestly I don't trust client devices that much. At least opening UDP ports 1024 seems pretty reasonable, and covers most use-cases regarding VoIP and video. But it does indeed depart from the IPv4 case (not sure if it is such a bad idea though). However the packaged version of miniupnpd does indeed support both UPNP WANIPv6FirewallControl and PCP. One of my colleague recently ran a test with PCP and said miniupnpd and it works fine. Good news, thanks! PCP doesn't show up in the config file, so I guess PCP is controlled by the NAT-PMP-related options. Cheers, Steven Thank you, Baptiste pgpLyuqgFHLrc.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] Barrier Breaker 14.07-rc1
Hello all, this is good news, however bad news is that brcm47xx (generic) target is still seriously broken, at least on Asus WL-500W. The problem is absolutely reproducible, and I reported it some time ago, but unfortunately it attracted very little interest here for some reason. Don't take me wrong, I use openwrt quite a lot for a long time on various devices and value it high enough, but it's definitely beyond my expertise to fix ethernet driver bugs and that sort of things, and seeing broken images released for the second time (12.09 had similar problem) is pretty strange. Now back to the problem. The problem is, ethernet load causes kernel oopses. In 12.09 it was Unhandled kernel unaligned access, now in 14.07 it is Unable to handle kernel paging request. The serial log captured a few minutes ago from 14.07.rc1 is below. Usually I get this oopses in maybe a minute or two after the routed traffic rises above say 15-20 MBit. Additionally, there is now another (less important) problem. In 14.07 ethernet ports of WL-500W get initially configured as if it was e.g. wl-500gp: - WAN is assigned to eth0.2 instead of eth1. - WAN6 is assigned to some @wan. - LAN ports does not include eth0.2 but they should (Its labelled LAN1). (This is easily fixable by hand after installation as soon as you identify what is wrong with this setup) Thank you Nikolai == [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#1]: [ 131.40] CPU: 0 PID: 0 Comm: Not tainted 3.10.44 #2 [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#2]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#3]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#4]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#5]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#6]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#7]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#8]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#9]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#10]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#11]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#12]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#13]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#14]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#15]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#16]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#17]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#18]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#19]: [ 131.40] CPU 0 Unable to handle kernel paging request at virtual address 00a8, epc == 80014868, ra == 80001420 [ 131.40] Oops[#20]: [ 131.40] CPU: 0 PID: -980009870 Comm: АrрceivчкКgєpduАr Not tainted 3.10.44 #2 [ 131.40] Data bus error, epc == 800054e0, ra == 8005ecec [ 131.40] Oops[#21]: [ 131.40] CPU 0 Unable to handle kernel paging request at
Re: [OpenWrt-Devel] openwrt-devel Digest, Vol 103, Issue 58
On Monday, July 14, 2014 12:00:01 PM openwrt-devel-requ...@lists.openwrt.org wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. Glad to know that Barrier Breaker will be ready to rock. Would it possible to include my ticket #17028 here? I think it's necessary to add support for newer 3g dongle. Thanks. 0x00F488559C96A6F74E9C34DF118F08AA3FB5E957.asc Description: application/pgp-keys signature.asc Description: This is a digitally signed message part. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
On 14 July 2014 15:57, Nikolai Zhubr n-a-zh...@yandex.ru wrote: Additionally, there is now another (less important) problem. In 14.07 ethernet ports of WL-500W get initially configured as if it was e.g. wl-500gp: - WAN is assigned to eth0.2 instead of eth1. - WAN6 is assigned to some @wan. - LAN ports does not include eth0.2 but they should (Its labelled LAN1). Please create a ticket with boot log, nvram show and your default (broken) /etc/config/network. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AA on brcm47xx: Unhandled kernel unaligned access
On 21 June 2014 18:36, Nikolai Zhubr n-a-zh...@yandex.ru wrote: [ 637.43] [ cut here ] [ 637.44] WARNING: at net/core/dev.c:2194 skb_warn_bad_offload+0xc0/0xe8() [ 637.45] b44: caps=(0x4000, 0x) len=1500 data_len=0 gso_size=53118 gso_type=59551 ip_summed=0 [ 637.46] Modules linked in: pppoe ppp_async iptable_nat b43legacy b43 pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_REJECT ip_tables crc_ccitt compat ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 ipv6 arc4 crypto_blkcipher leds_gpio gpio_button_hotplug tg3 hwmon bgmac b44 ptp pps_core [ 637.52] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 3.10.36 #1 [ 637.52] Stack : 8030d552 0036 818201d0 0008 8026cfd0 802bb23b 0003 8030cd00 818201d0 0008 802b76e4 802b76dc 8001c118 0003 80019ad8 80293ecc 0008 8026e870 8182bc5c 8182bbe8 ... [ 637.56] Call Trace: [ 637.56] [80010bb4] show_stack+0x48/0x70 [ 637.57] [80019bd4] warn_slowpath_common+0x78/0xa8 [ 637.57] [80019c30] warn_slowpath_fmt+0x2c/0x38 [ 637.58] [801b27dc] skb_warn_bad_offload+0xc0/0xe8 [ 637.58] [801b6390] __skb_gso_segment+0x50/0xec [ 637.59] [801de0dc] ip_forward_finish+0x108/0x1bc [ 637.59] [801b386c] __netif_receive_skb_core+0x46c/0x52c [ 637.60] [81acc16c] 0x81acc16c [ 637.60] [ 637.60] ---[ end trace 2c2a6a28d6589bcc ]--- Any idea anyone? Does above mean b44 provided a corrupted packet? Or some wrong pointer? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Barrier Breaker 14.07-rc1
14.07.2014 18:34, Rafał Miłecki: Please create a ticket with boot log, nvram show and your default (broken) /etc/config/network. Done, https://dev.openwrt.org/ticket/17111 (Note: trac does not seem to know about rc1 yet, therefore I had to mark it for trunk) Thank you. Nikolai . ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AA on brcm47xx: Unhandled kernel unaligned access
14.07.2014 18:42, Rafał Miłecki: [...] [ 637.56] Call Trace: [ 637.56] [80010bb4] show_stack+0x48/0x70 [ 637.57] [80019bd4] warn_slowpath_common+0x78/0xa8 [ 637.57] [80019c30] warn_slowpath_fmt+0x2c/0x38 [ 637.58] [801b27dc] skb_warn_bad_offload+0xc0/0xe8 [ 637.58] [801b6390] __skb_gso_segment+0x50/0xec [ 637.59] [801de0dc] ip_forward_finish+0x108/0x1bc [ 637.59] [801b386c] __netif_receive_skb_core+0x46c/0x52c [ 637.60] [81acc16c] 0x81acc16c [ 637.60] [ 637.60] ---[ end trace 2c2a6a28d6589bcc ]--- Any idea anyone? Does above mean b44 provided a corrupted packet? Or some wrong pointer? Yet another note: the problem apparently appeared since after 10.03.1. Maybe I could try to bisect the revision of interest, but doing it blindly would probably require tons of time, unless someone aware of what was happening to the driver at that time gives some enlightening instructions. Thank you. Nikolai . ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 00/17] atheros: I/O cleanups
2014-07-14 14:31 GMT+04:00 Karl Palsson ka...@tweak.net.au: I've tried to test this on an ar2317, but the series isn't applying cleanly to today's trunk. I got the first one to succeed, with some fuzz, the second applied cleanly, but the third failed, and I stopped trying. Sounds strangely. I'll try to investigate this now. Thanks for your feedback. Cheers, Karl P 2014-07-12 17:33 GMT+04:00 Sergey Ryazanov ryazanov@gmail.com: Main goals of this series: * Simplify interface between arch code and SoC drivers * Simplify internal realization of arch code * Make code consistent with mainstream kernel rules and practice Forgot to say, that this series extensively tested with FON2202 (ar2315 based) and D-Link DWL-2100AP (ar2313 based), but tests are not done with AR2317/8 and AR5312, since I have no access to such boards now :( -- BR, Sergey С наилучшими пожеланиями Рязанов Сергей ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AA on brcm47xx: Unhandled kernel unaligned access
On 2014-07-14 16:42, Rafał Miłecki wrote: On 21 June 2014 18:36, Nikolai Zhubr n-a-zh...@yandex.ru wrote: [ 637.43] [ cut here ] [ 637.44] WARNING: at net/core/dev.c:2194 skb_warn_bad_offload+0xc0/0xe8() [ 637.45] b44: caps=(0x4000, 0x) len=1500 data_len=0 gso_size=53118 gso_type=59551 ip_summed=0 [ 637.46] Modules linked in: pppoe ppp_async iptable_nat b43legacy b43 pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_REJECT ip_tables crc_ccitt compat ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 ipv6 arc4 crypto_blkcipher leds_gpio gpio_button_hotplug tg3 hwmon bgmac b44 ptp pps_core [ 637.52] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 3.10.36 #1 [ 637.52] Stack : 8030d552 0036 818201d0 0008 8026cfd0 802bb23b 0003 8030cd00 818201d0 0008 802b76e4 802b76dc 8001c118 0003 80019ad8 80293ecc 0008 8026e870 8182bc5c 8182bbe8 ... [ 637.56] Call Trace: [ 637.56] [80010bb4] show_stack+0x48/0x70 [ 637.57] [80019bd4] warn_slowpath_common+0x78/0xa8 [ 637.57] [80019c30] warn_slowpath_fmt+0x2c/0x38 [ 637.58] [801b27dc] skb_warn_bad_offload+0xc0/0xe8 [ 637.58] [801b6390] __skb_gso_segment+0x50/0xec [ 637.59] [801de0dc] ip_forward_finish+0x108/0x1bc [ 637.59] [801b386c] __netif_receive_skb_core+0x46c/0x52c [ 637.60] [81acc16c] 0x81acc16c [ 637.60] [ 637.60] ---[ end trace 2c2a6a28d6589bcc ]--- Any idea anyone? Does above mean b44 provided a corrupted packet? Or some wrong pointer? It looks to me like the hardware is overwriting the skb shared info (at the end of the skb data buffer), possibly because the configured maximum frame length may be too big for the buffer. If I were to speculate wildly, I would guess that B44_RXMAXLEN refers to the maximum frame length, not the maximum buffer length - and in the code, it's being fed with the maximum buffer length. This would allow the hardware to receive slightly oversized frames which can corrupt the skb. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] openwrt-devel Digest, Vol 103, Issue 58
On 14/07/2014 15:56, Alive4Ever wrote: On Monday, July 14, 2014 12:00:01 PM openwrt-devel-requ...@lists.openwrt.org wrote: The OpenWrt developers are proud to announce the first release candidate of OpenWrt Barrier Breaker. Glad to know that Barrier Breaker will be ready to rock. Would it possible to include my ticket #17028 here? I think it's necessary to add support for newer 3g dongle. Thanks. queued for RC2, updating the device list is not enough, there is a new option that we need to support aswell. John ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AA on brcm47xx: Unhandled kernel unaligned access
On Mon, Jul 14, 2014 at 6:23 PM, Felix Fietkau n...@openwrt.org wrote: On 2014-07-14 16:42, Rafał Miłecki wrote: On 21 June 2014 18:36, Nikolai Zhubr n-a-zh...@yandex.ru wrote: [ 637.43] [ cut here ] [ 637.44] WARNING: at net/core/dev.c:2194 skb_warn_bad_offload+0xc0/0xe8() [ 637.45] b44: caps=(0x4000, 0x) len=1500 data_len=0 gso_size=53118 gso_type=59551 ip_summed=0 [ 637.46] Modules linked in: pppoe ppp_async iptable_nat b43legacy b43 pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_REJECT ip_tables crc_ccitt compat ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 ipv6 arc4 crypto_blkcipher leds_gpio gpio_button_hotplug tg3 hwmon bgmac b44 ptp pps_core [ 637.52] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 3.10.36 #1 [ 637.52] Stack : 8030d552 0036 818201d0 0008 8026cfd0 802bb23b 0003 8030cd00 818201d0 0008 802b76e4 802b76dc 8001c118 0003 80019ad8 80293ecc 0008 8026e870 8182bc5c 8182bbe8 ... [ 637.56] Call Trace: [ 637.56] [80010bb4] show_stack+0x48/0x70 [ 637.57] [80019bd4] warn_slowpath_common+0x78/0xa8 [ 637.57] [80019c30] warn_slowpath_fmt+0x2c/0x38 [ 637.58] [801b27dc] skb_warn_bad_offload+0xc0/0xe8 [ 637.58] [801b6390] __skb_gso_segment+0x50/0xec [ 637.59] [801de0dc] ip_forward_finish+0x108/0x1bc [ 637.59] [801b386c] __netif_receive_skb_core+0x46c/0x52c [ 637.60] [81acc16c] 0x81acc16c [ 637.60] [ 637.60] ---[ end trace 2c2a6a28d6589bcc ]--- Any idea anyone? Does above mean b44 provided a corrupted packet? Or some wrong pointer? It looks to me like the hardware is overwriting the skb shared info (at the end of the skb data buffer), possibly because the configured maximum frame length may be too big for the buffer. If I were to speculate wildly, I would guess that B44_RXMAXLEN refers to the maximum frame length, not the maximum buffer length - and in the code, it's being fed with the maximum buffer length. This would allow the hardware to receive slightly oversized frames which can corrupt the skb. Since there is a public datasheet[1], this is easily verifiable, and it looks you are right: Receive Maximum Length Register (RcvLength, Offset 0x404): The value stored in this register specifies the largest valid Ethernet Frame to be received. The same is true for the XmtMaxLength register, which is also set too large (it defaults to 1518). Jonas [1]: https://www.broadcom.com/collateral/pg/440X-PG02-R.pdf ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/4] ramips: squelch mdio debugging info on rt2880 ethernet
Hello, * Claudio Leite (lei...@staticky.com) wrote: Use pr_debug rather than pr_info since it is only relevant for debugging. Signed-off-by: Claudio Leite lei...@staticky.com While we are talking about things for Barrier Breaker RC's, could this patch be merged in? It was marked as accepted back in April, but I just tested the RC1 release on a RT2880 board and it still has the mdio r/w dumps. While it doesn't affect actual performance, it does slow down boot by a few seconds while it programs the switch. --- .../0220-NET-ralink-squelch_mdio_access.patch | 22 ++ 1 file changed, 22 insertions(+) create mode 100644 target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch diff --git a/target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch b/target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch new file mode 100644 index 000..bc92a02 --- /dev/null +++ b/target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch @@ -0,0 +1,22 @@ +Index: linux-3.10.34/drivers/net/ethernet/ralink/mdio_rt2880.c +=== +--- linux-3.10.34.orig/drivers/net/ethernet/ralink/mdio_rt2880.c linux-3.10.34/drivers/net/ethernet/ralink/mdio_rt2880.c +@@ -136,7 +136,7 @@ int rt2880_mdio_read(struct mii_bus *bus + if (err) + return 0x; + +-pr_info(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, ++pr_debug(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, + phy_addr, phy_reg, fe_r32(FE_MDIO_ACCESS) 0x); + + return fe_r32(FE_MDIO_ACCESS) 0x; +@@ -148,7 +148,7 @@ int rt2880_mdio_write(struct mii_bus *bu + int err; + u32 t; + +-pr_info(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, ++pr_debug(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, + phy_addr, phy_reg, fe_r32(FE_MDIO_ACCESS) 0x); + + err = rt2880_mdio_wait_ready(priv); -- 1.8.2.1 Thanks. -Claudio ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 00/17] atheros: I/O cleanups
2014-07-14 14:31 GMT+04:00 Karl Palsson ka...@tweak.net.au: I've tried to test this on an ar2317, but the series isn't applying cleanly to today's trunk. I got the first one to succeed, with some fuzz, the second applied cleanly, but the third failed, and I stopped trying. You right. I downloaded patches from patchwork, tried to apply them and got the same result. John, please, could you reject this series? I will send new one. Cheers, Karl P 2014-07-12 17:33 GMT+04:00 Sergey Ryazanov ryazanov@gmail.com: Main goals of this series: * Simplify interface between arch code and SoC drivers * Simplify internal realization of arch code * Make code consistent with mainstream kernel rules and practice Forgot to say, that this series extensively tested with FON2202 (ar2315 based) and D-Link DWL-2100AP (ar2313 based), but tests are not done with AR2317/8 and AR5312, since I have no access to such boards now :( -- BR, Sergey ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/4] ramips: squelch mdio debugging info on rt2880 ethernet
ok, no idea why it is not in trunk but marked as accepted but i would assume its my fault thanks, merged in r41653 On 14/07/2014 18:55, Claudio Leite wrote: Hello, * Claudio Leite (lei...@staticky.com) wrote: Use pr_debug rather than pr_info since it is only relevant for debugging. Signed-off-by: Claudio Leite lei...@staticky.com While we are talking about things for Barrier Breaker RC's, could this patch be merged in? It was marked as accepted back in April, but I just tested the RC1 release on a RT2880 board and it still has the mdio r/w dumps. While it doesn't affect actual performance, it does slow down boot by a few seconds while it programs the switch. --- .../0220-NET-ralink-squelch_mdio_access.patch | 22 ++ 1 file changed, 22 insertions(+) create mode 100644 target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch diff --git a/target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch b/target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch new file mode 100644 index 000..bc92a02 --- /dev/null +++ b/target/linux/ramips/patches-3.10/0220-NET-ralink-squelch_mdio_access.patch @@ -0,0 +1,22 @@ +Index: linux-3.10.34/drivers/net/ethernet/ralink/mdio_rt2880.c +=== +--- linux-3.10.34.orig/drivers/net/ethernet/ralink/mdio_rt2880.c linux-3.10.34/drivers/net/ethernet/ralink/mdio_rt2880.c +@@ -136,7 +136,7 @@ int rt2880_mdio_read(struct mii_bus *bus + if (err) + return 0x; + +- pr_info(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, ++ pr_debug(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, + phy_addr, phy_reg, fe_r32(FE_MDIO_ACCESS) 0x); + +return fe_r32(FE_MDIO_ACCESS) 0x; +@@ -148,7 +148,7 @@ int rt2880_mdio_write(struct mii_bus *bu + int err; + u32 t; + +- pr_info(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, ++ pr_debug(%s: addr=%04x, reg=%04x, value=%04x\n, __func__, + phy_addr, phy_reg, fe_r32(FE_MDIO_ACCESS) 0x); + + err = rt2880_mdio_wait_ready(priv); -- 1.8.2.1 Thanks. -Claudio ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 00/17] atheros: I/O cleanups
On 14/07/2014 19:05, Sergey Ryazanov wrote: John, please, could you reject this series? I will send new one. i just marked it as Changes Requested John ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [ANN] MicroPython - well-known scripting language, unbloated
Hello, On Mon, 14 Jul 2014 16:29:42 +0400 Nick Shvelidze capt...@pirrate.me wrote: Interesting, MicroPython is great. By the way, Luci2 doesn't use Lua at all. Yes, I heard from other replies, that's good news, hope it will be ready for prime time soon. Still, it would be nice to have good unbloated language for rapid app development in constrained environments, like most routers on which OpenWRT runs. I made initial proof of concept web microframework for MicroPython (https://github.com/pfalcon/picoweb), and a trivial webapp can run within 64K heap. I did initial build for OpenWRT/MIPS, and it starts up, but I didn't run test suite yet. I hope to contribute recipe when it's properly validated. On Mon, Jul 14, 2014 at 4:20 PM, Paul Sokolovsky pmis...@gmail.com wrote: Hello, I wondered if it makes sense to post about MicroPython, but recent post about Squirrel language prompted me to. So, there's a project to implement, from scratch, very lean interpreter for Python3 scripting language. The project is well under way and currently implements good deal of Python3 semantics. It can't yet run arbitrary existing Python code, but the whole idea of MicroPython is to provide efficient subset of Python to develop apps from scratch (or to port existing code). Source code: https://github.com/micropython/micropython User-facing site: http://micropython.org/ My motive for working on MicroPython is dissatisfaction with Lua - based both on my personal tastes and experience, and analyzing other projects' experience. For example, LuCI web UI, as used in OpenWRT, is known to be slow, and known not to be able to reasonably work on system with less than 32MB of RAM at all. I don't think these are results of Lua's technical traits - rather, its semantic and programming psychology issues. The way I see it, in many places where Lua is used currently, it is used only because of the lack of alternatives. So, people have to use it thru not wanting to use it. Then, they're not interested to learn details of the language to use it efficiently, they're not interested in writing efficient programs, not interested in optimizing code, etc. - they interested just to do something ASAP, and get their hands off of it. So, if you consciously or subconsciously dissatisfied with Lua, please consider giving MicroPython a look and try! ;-) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel -- Best regards, Paul mailto:pmis...@gmail.com ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] New gstreamer packages
Hi Sergey, the oldpackages feed is unsupported and will not be updated any more. If you want to submit packages or adopt packages from oldpackages which are not there yet please go to https://github.com/openwrt/packages and make a pull request there. Cheers, Steven ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [ANN] MicroPython - well-known scripting language, unbloated
Hi. Yes, I heard from other replies, that's good news, hope it will be ready for prime time soon. Still, it would be nice to have good unbloated language for rapid app development in constrained environments, like most routers on which OpenWRT runs. I made initial proof of concept web microframework for MicroPython (https://github.com/pfalcon/picoweb), and a trivial webapp can run within 64K heap. I welcome your effort but that project on github is just a glorified echo server as it stands now. You can easily do that with Lua too. I'd be interested in the performance once you implemented a proper template engine/parser, a proper gettext like translation system, wrapper libraries for POSIX functions, bindings to libuci and ubus, plugin mechanisms and all the other little bits that make up the current LuCI release. Don't get me wrong, but years ago when LuCI was started it was also lean, fast and tiny. I somehow doubt that a smaller python interpreter is going to solve the inherent bloat issues. a) You either start using python libraries which aren't exactly tiny by nature either and highly interdependant b) You start writing your own library ecosystem at which point you're in the same obscureness niche as Lua Also given the fact that Python 2.x vs. 3.x already fragmented the python landscape I'm not sure if introducing yet another not fully compatible spin of it is going to make anything better in the long run. ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] ramips: soc wmac eeprom cleanup
Move eeprom extraction from scripts to dts files. Additionally there are few other changes like: - whitespace fixes - add partition labels where needed - BR6524N board doesn't exist (lost in translation?) - fix Edimax 3g-6200nl model - add wmac eeprom to dts for Asus RT-N14U board Compile tested all subtargets and their profiles. Run tested on: - Asus RT-N15 - Asus RT-N14U - Buffalo WHR-600D - Argus ATP52B - Sparklan WCR-150GN Few problems noted: - many boards didn't have wmac eeprom information defined at all - several boards don't have any patitions defined (see FIXME comments in dts) Signed-off-by: Roman Yeryomin ro...@advem.lv --- .../etc/hotplug.d/firmware/10-rt2x00-eeprom| 106 + target/linux/ramips/base-files/lib/ramips.sh | 3 - target/linux/ramips/dts/3G-6200N.dts | 4 + target/linux/ramips/dts/3G-6200NL.dts | 8 +- target/linux/ramips/dts/3G300M.dts | 4 + target/linux/ramips/dts/AIR3GII.dts| 4 + target/linux/ramips/dts/ALL0239-3G.dts | 4 + target/linux/ramips/dts/ALL0256N-4M.dts| 4 + target/linux/ramips/dts/ALL0256N-8M.dts| 4 + target/linux/ramips/dts/ALL5002.dts| 4 + target/linux/ramips/dts/ALL5003.dts| 4 + target/linux/ramips/dts/ARGUS_ATP52B.dts | 4 + target/linux/ramips/dts/ASL26555-16M.dts | 6 +- target/linux/ramips/dts/ASL26555-8M.dts| 5 + target/linux/ramips/dts/AWAPN2403.dts | 4 + target/linux/ramips/dts/AWM002-EVB-4M.dts | 4 + target/linux/ramips/dts/AWM002-EVB-8M.dts | 4 + target/linux/ramips/dts/BC2.dts| 4 + target/linux/ramips/dts/BR-6425.dts| 4 + target/linux/ramips/dts/BR-6475ND.dts | 4 + target/linux/ramips/dts/BROADWAY.dts | 4 + target/linux/ramips/dts/CARAMBOLA.dts | 4 + target/linux/ramips/dts/CY-SWR1100.dts | 1 + target/linux/ramips/dts/D105.dts | 4 + target/linux/ramips/dts/DAP-1350.dts | 6 +- target/linux/ramips/dts/DCS-930.dts| 4 + target/linux/ramips/dts/DIR-300-B1.dts | 6 +- target/linux/ramips/dts/DIR-300-B7.dts | 7 +- target/linux/ramips/dts/DIR-320-B1.dts | 4 + target/linux/ramips/dts/DIR-600-B1.dts | 6 +- target/linux/ramips/dts/DIR-600-B2.dts | 6 +- target/linux/ramips/dts/DIR-610-A1.dts | 2 +- target/linux/ramips/dts/DIR-615-D.dts | 6 +- target/linux/ramips/dts/DIR-615-H1.dts | 4 + target/linux/ramips/dts/DIR-620-A1.dts | 4 + target/linux/ramips/dts/DIR-620-D1.dts | 4 + target/linux/ramips/dts/DIR-645.dts| 1 + target/linux/ramips/dts/ESR-9753.dts | 4 + target/linux/ramips/dts/F5D8235_V1.dts | 6 +- target/linux/ramips/dts/F5D8235_V2.dts | 6 +- target/linux/ramips/dts/F7C027.dts | 4 + target/linux/ramips/dts/FONERA20N.dts | 4 + target/linux/ramips/dts/FREESTATION5.dts | 4 + target/linux/ramips/dts/HG255D.dts | 4 + target/linux/ramips/dts/HW550-3G.dts | 4 + target/linux/ramips/dts/MOFI3500-3GN.dts | 1 + target/linux/ramips/dts/MPRA1.dts | 4 + target/linux/ramips/dts/MPRA2.dts | 4 + target/linux/ramips/dts/MZK-750DHP.dts | 4 + target/linux/ramips/dts/MZK-W300NH2.dts| 4 + target/linux/ramips/dts/NBG-419N.dts | 4 + target/linux/ramips/dts/NCS601W.dts| 4 + target/linux/ramips/dts/NW718.dts | 4 + target/linux/ramips/dts/OMNI-EMB-HPM.dts | 4 + target/linux/ramips/dts/OMNI-EMB.dts | 4 + target/linux/ramips/dts/PSR-680W.dts | 4 + target/linux/ramips/dts/PWH2004.dts| 4 + target/linux/ramips/dts/RT-G32-B1.dts | 8 +- target/linux/ramips/dts/RT-N10-PLUS.dts| 6 +- target/linux/ramips/dts/RT-N13U.dts| 4 + target/linux/ramips/dts/RT-N14U.dts| 4 + target/linux/ramips/dts/RT-N15.dts | 4 + target/linux/ramips/dts/RTN56U.dts | 2 +- target/linux/ramips/dts/RUT5XX.dts | 4 + target/linux/ramips/dts/SL-R7205.dts | 4 + target/linux/ramips/dts/UR-326N4G.dts | 4 + target/linux/ramips/dts/UR-336UN.dts | 10 +- target/linux/ramips/dts/V11STFE.dts| 6 +- target/linux/ramips/dts/V22RW-2X2.dts | 4 + target/linux/ramips/dts/W150M.dts | 4 + target/linux/ramips/dts/W306R_V20.dts | 4 + target/linux/ramips/dts/W502U.dts |
Re: [OpenWrt-Devel] AA on brcm47xx: Unhandled kernel unaligned access
14.07.2014 20:44, Jonas Gorski: [...] If I were to speculate wildly, I would guess that B44_RXMAXLEN refers to the maximum frame length, not the maximum buffer length - and in the code, it's being fed with the maximum buffer length. This would allow the hardware to receive slightly oversized frames which can corrupt the skb. Since there is a public datasheet[1], this is easily verifiable, and it looks you are right: Receive Maximum Length Register (RcvLength, Offset 0x404): The value stored in this register specifies the largest valid Ethernet Frame to be received. Ok, so I'd suppose bw32(bp, B44_RXMAXLEN, bp-dev-mtu + ETH_HLEN + 8 + RX_HEADER_LEN) should instead be bw32(bp, B44_RXMAXLEN, bp-dev-mtu + ETH_HLEN) ? or bw32(bp, B44_RXMAXLEN, bp-dev-mtu + ETH_HLEN + 8) ? or maybe even bw32(bp, B44_RXMAXLEN, bp-dev-mtu) ? Apology for my ignorance, just can't stand testing it immediately to hopefully get it right for BB. Thank you. Nikolai The same is true for the XmtMaxLength register, which is also set too large (it defaults to 1518). Jonas [1]: https://www.broadcom.com/collateral/pg/440X-PG02-R.pdf . ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [ANN] MicroPython - well-known scripting language, unbloated
Hello, On Mon, 14 Jul 2014 22:16:03 +0200 Jo-Philipp Wich j...@openwrt.org wrote: Hi. Yes, I heard from other replies, that's good news, hope it will be ready for prime time soon. Still, it would be nice to have good unbloated language for rapid app development in constrained environments, like most routers on which OpenWRT runs. I made initial proof of concept web microframework for MicroPython (https://github.com/pfalcon/picoweb), and a trivial webapp can run within 64K heap. I welcome your effort but that project on github is just a glorified echo server as it stands now. You can easily do that with Lua too. Sure, you can easily (or so) do it in any language ;-). I'd be interested in the performance once you implemented a proper template engine/parser, a proper gettext like translation system, wrapper libraries for POSIX functions, bindings to libuci and ubus, plugin mechanisms and all the other little bits that make up the current LuCI release. Don't get me wrong, but years ago when LuCI was started it was also lean, fast and tiny. I somehow doubt that a smaller python interpreter is going to solve the inherent bloat issues. I understand this problem. Actually, part of my motivation for working on MicroPython is research interest in whether all roads lead to bloat or people just give up somewhere ;-). I understand that in the end it may end up the same bloat as many other projects. I understand another risk too - that trying to perfectalize each small bit of efficiency may lead to small overall progress and project grind to a halt. My personal quest for usable unbloated scripting language is governed by awareness of these risks, and trying to avoid them ;-). (To clarify, I'm not an author of MicroPython, just a regular contributor - and that's part of the plan btw, I know that I don't have resources to carry out such project on my own, so smartly don't do that). a) You either start using python libraries which aren't exactly tiny by nature either and highly interdependant b) You start writing your own library ecosystem at which point you're in the same obscureness niche as Lua Yeah, so again, smartly both approaches are followed. That's why I gave up Squirrel - it doesn't have decent standard library. That means that one have opportunity to design the most perfect standard library - but one yet needs to do that, and at the end, it will be just yet another obscurity. Python, on the other hand, has vast and well-known standard library, with pretty good interface. The implementation can be bloaty, yeah, but it can be optimized if/when somebody likes. Also given the fact that Python 2.x vs. 3.x already fragmented the python landscape I'm not sure if introducing yet another not fully compatible spin of it is going to make anything better in the long run. Unlike other small Python implementations, MicroPython doesn't have aim to be a subset, vice versa, it strives to be a complete Python3 implementation. It's just being the optimal implementation has even higher priority. So, it's currently implements subset of Python3, but if someone will need some missing feature up to coding it up, it will be gladly accepted (as long as its configurable, so people who don't need such feature, won't suffer its bloat). So, MicroPython is going to stay compatible with Python (well, Python is a mature language with number of implementations, MicroPython is just one of them, with its distinctive design goals and requirements). I don't want to have a long thread here discussing non-technical sides of MicroPython (that's surely an offtopic), just hope that answers above clarify that there's some paradigm behind the project. One thing is clear - if more people won't use it, and contribute to it, it won't make it. I hope that MicroPython may be of interest (at least in FYI sense) to OpenWRT users/developers, that's why I posted about it, and if someone will like it - the better ;-). ~ Jow -- Best regards, Paul mailto:pmis...@gmail.com ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AA on brcm47xx: Unhandled kernel unaligned access
On 14 July 2014 18:44, Jonas Gorski j...@openwrt.org wrote: On Mon, Jul 14, 2014 at 6:23 PM, Felix Fietkau n...@openwrt.org wrote: It looks to me like the hardware is overwriting the skb shared info (at the end of the skb data buffer), possibly because the configured maximum frame length may be too big for the buffer. If I were to speculate wildly, I would guess that B44_RXMAXLEN refers to the maximum frame length, not the maximum buffer length - and in the code, it's being fed with the maximum buffer length. This would allow the hardware to receive slightly oversized frames which can corrupt the skb. Since there is a public datasheet[1], this is easily verifiable, and it looks you are right: Receive Maximum Length Register (RcvLength, Offset 0x404): The value stored in this register specifies the largest valid Ethernet Frame to be received. The same is true for the XmtMaxLength register, which is also set too large (it defaults to 1518). I wonder what's the point of that register if we set length per-skb anyway (b44_alloc_rx_skb): ctrl = (DESC_CTRL_LEN RX_PKT_BUF_SZ); ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] IPv6 firewall and Port Control Protocol (Was: Barrier Breaker 14.07-rc1)
Hi everyone, Le lundi 14 juillet 2014 à 22:17 +0900, Baptiste Jonglez a écrit : On Mon, Jul 14, 2014 at 02:38:16PM +0200, Steven Barth wrote: Hi Baptiste, in general our current firewalling approach is to keep defaults for IPv4 and IPv6 relatively close (not considering NAT here of course). Could you detail the reasoning behind this approach? Don't confuse the user? I'd rather have Don't bother the user: things should generally just work, without having to configure anything (in this case, port forwarding). But there is an obvious tradeoff with security. I agree with Baptiste here. There is no equivalent in IPv4 of “global reachability” by default with the NATs we have today, so we can't have the same defaults. Global reachability is how IP in general was meant to be; please, do not make it broken again. Opening up the IPv6 firewall by default would be unexpected and I don't really like the approach for that matter and honestly I don't trust client devices that much. At least opening UDP ports 1024 seems pretty reasonable, and covers most use-cases regarding VoIP and video. But it does indeed depart from the IPv4 case (not sure if it is such a bad idea though). This looks like a good compromise to me. Knowledgeable users can disable the firewall for needed hosts, while for others this “just work”. PCP may be coming one day, but it's still not there yet, so we need not to break the default configuration while waiting for it. Regards, -- benjamin ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AA on brcm47xx: Unhandled kernel unaligned access
On Mon, Jul 14, 2014 at 11:48 PM, Nikolai Zhubr n-a-zh...@yandex.ru wrote: 14.07.2014 20:44, Jonas Gorski: [...] If I were to speculate wildly, I would guess that B44_RXMAXLEN refers to the maximum frame length, not the maximum buffer length - and in the code, it's being fed with the maximum buffer length. This would allow the hardware to receive slightly oversized frames which can corrupt the skb. Since there is a public datasheet[1], this is easily verifiable, and it looks you are right: Receive Maximum Length Register (RcvLength, Offset 0x404): The value stored in this register specifies the largest valid Ethernet Frame to be received. Ok, so I'd suppose bw32(bp, B44_RXMAXLEN, bp-dev-mtu + ETH_HLEN + 8 + RX_HEADER_LEN) should instead be bw32(bp, B44_RXMAXLEN, bp-dev-mtu + ETH_HLEN) ? or bw32(bp, B44_RXMAXLEN, bp-dev-mtu + ETH_HLEN + 8) ? This is the right one; mtu (the payload) + ETH_HLEN (14 bytes) + 8 (4 bytes for vlan tag, probably 4 extra bytes for custom header optionally used by broadcom switches) or maybe even bw32(bp, B44_RXMAXLEN, bp-dev-mtu) ? Apology for my ignorance, just can't stand testing it immediately to hopefully get it right for BB. Thank you. Nikolai Thanks for testing! Jonas ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 00/18] atheros: I/O cleanups
Main goals of this series: * Simplify interface between arch code and SoC drivers * Simplify internal realization of arch code * Make code consistent with mainstream kernel rules and practice This series extensively tested with FON2202 (ar2315 based) and D-Link DWL-2100AP (ar2313 based), but tests are not done with AR2317/8 and AR5312, since I have no access to such boards now. Changes since v1: * Add missed patch 'atheros[ar2315-wdt]: update initialization' Sergey Ryazanov (18): atheros[ar2315-wdt]: update initialization atheros[ar2315-wdt]: rename config symbol atheros: use correct address space and pointer type for register access atheros[ar2315-wdt]: update interrupt handling atheros[ar2315-wdt]: update I/O handling atheros[ar231x-eth]: update MAC and PHY reset method atheros[ar231x-eth]: move driver to atheros subdirectory atheros: pass UART IRQ number via function argument atheros: move AR2315 misc IRQ dispatching to separate function atheros: rename some interrupt control handlers atheros: simplify AR2315 misc IRQ (un)masking atheros: use irq_set_chained_handler() atheros: simplify gpiolib realization atheros[ar231x-eth]: pass phys address of I/O memory via platform res atheros[ar231x-eth]: pass PHY I/O memory via device resources atheros[uart]: use 32-bit aligned I/O atheros[uart]: pass only physical I/O mem address to 8250 driver atheros: update macroses names target/linux/atheros/config-3.10 |4 +- target/linux/atheros/patches-3.10/100-board.patch | 1023 +--- .../patches-3.10/101-early-printk-support.patch|6 +- .../atheros/patches-3.10/105-ar2315_pci.patch | 37 +- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 138 +-- .../linux/atheros/patches-3.10/130-watchdog.patch | 82 +- .../patches-3.10/220-enet_micrel_workaround.patch | 12 +- 7 files changed, 622 insertions(+), 680 deletions(-) -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 04/18] atheros[ar2315-wdt]: update interrupt handling
Acknowledge watchdog interrupt in arch irq dispatcher and remove odd watchdog enable call from probe function. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch| 7 --- target/linux/atheros/patches-3.10/130-watchdog.patch | 5 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 02ab943..3169827 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -2134,7 +2134,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,623 @@ +@@ -0,0 +1,624 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -2234,9 +2234,10 @@ + ar2315_gpio_irq(); + else if (misc_intr AR2315_ISR_UART0) + do_IRQ(AR531X_MISC_IRQ_UART0); -+ else if (misc_intr AR2315_ISR_WD) ++ else if (misc_intr AR2315_ISR_WD) { ++ ar231x_write_reg(AR2315_ISR, AR2315_ISR_WD); + do_IRQ(AR531X_MISC_IRQ_WATCHDOG); -+ else ++ } else + do_IRQ(AR531X_MISC_IRQ_NONE); + } else if (pending CAUSEF_IP7) + do_IRQ(AR531X_IRQ_CPU_CLOCK); diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index b0284e7..06c8d44 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/drivers/watchdog/ar2315-wtd.c -@@ -0,0 +1,189 @@ +@@ -0,0 +1,186 @@ +/* + * 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 @@ -52,7 +52,6 @@ +ar2315_wdt_enable(void) +{ + ar231x_write_reg(AR2315_WD, wdt_timeout * CLOCK_RATE); -+ ar231x_write_reg(AR2315_ISR, 0x80); +} + +static ssize_t @@ -92,7 +91,6 @@ + } else { + ar231x_write_reg(AR2315_WDC, 0); + ar231x_write_reg(AR2315_WD, 0); -+ ar231x_write_reg(AR2315_ISR, 0x80); + } + return IRQ_HANDLED; +} @@ -151,7 +149,6 @@ +{ + int ret = 0; + -+ ar2315_wdt_enable(); + ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, +IRQF_DISABLED, DRIVER_NAME, dev); + if (ret) { -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 03/18] atheros: use correct address space and pointer type for register access
Make sparse happy :) Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 36ad7c8..02ab943 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -2876,13 +2876,13 @@ +static inline u32 +ar231x_read_reg(u32 reg) +{ -+ return __raw_readl((u32 *)KSEG1ADDR(reg)); ++ return __raw_readl((void __iomem *)KSEG1ADDR(reg)); +} + +static inline void +ar231x_write_reg(u32 reg, u32 val) +{ -+ __raw_writel(val, (u32 *)KSEG1ADDR(reg)); ++ __raw_writel(val, (void __iomem *)KSEG1ADDR(reg)); +} + +static inline u32 -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 01/18] atheros[ar2315-wdt]: update initialization
* update driver id to be consistent with other ar231x drivers * remove odd module_{init,exit} * add module metadata (description, name, etc.) Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 2 +- .../linux/atheros/patches-3.10/130-watchdog.patch | 29 -- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index f46dc0b..36ad7c8 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -2525,7 +2525,7 @@ + +static struct platform_device ar2315_wdt = { + .id = 0, -+ .name = ar2315_wdt, ++ .name = ar2315-wdt, +}; + +/* diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index 100dfa6..5dd0e75 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/drivers/watchdog/ar2315-wtd.c -@@ -0,0 +1,198 @@ +@@ -0,0 +1,189 @@ +/* + * 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 @@ -39,6 +39,8 @@ +#include ar2315_regs.h +#include ar231x.h + ++#define DRIVER_NAME ar2315-wdt ++ +#define CLOCK_RATE 4000 +#define HEARTBEAT(x) (x 1 || x 90 ? 20 : x) + @@ -151,7 +153,7 @@ + + ar2315_wdt_enable(); + ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, -+IRQF_DISABLED, ar2315_wdt, dev); ++IRQF_DISABLED, DRIVER_NAME, dev); + if (ret) { + dev_err(dev-dev, failed to register inetrrupt\n); + goto out; @@ -177,28 +179,17 @@ + .probe = ar2315_wdt_probe, + .remove = ar2315_wdt_remove, + .driver = { -+ .name = ar2315_wdt, ++ .name = DRIVER_NAME, + .owner = THIS_MODULE, + }, +}; + -+static int __init -+init_ar2315_wdt(void) -+{ -+ int ret = platform_driver_register(ar2315_wdt_driver); -+ if (ret) -+ pr_err(ar2315_wdt: error registering platfom driver!\n); -+ return ret; -+} -+ -+static void __exit -+exit_ar2315_wdt(void) -+{ -+ platform_driver_unregister(ar2315_wdt_driver); -+} ++module_platform_driver(ar2315_wdt_driver); + -+module_init(init_ar2315_wdt); -+module_exit(exit_ar2315_wdt); ++MODULE_DESCRIPTION(Atheros AR2315 hardware watchdog driver); ++MODULE_AUTHOR(John Crispin blo...@openwrt.org); ++MODULE_LICENSE(GPL); ++MODULE_ALIAS(platform: DRIVER_NAME); --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -1113,6 +1113,12 @@ config LANTIQ_WDT -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 02/18] atheros[ar2315-wdt]: rename config symbol
Rename config symbol to AR2315_WDT to avoid confusion with other Atheros SoCs. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/config-3.10 | 2 +- target/linux/atheros/patches-3.10/130-watchdog.patch | 11 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/target/linux/atheros/config-3.10 b/target/linux/atheros/config-3.10 index e6ab73b..ccbb592 100644 --- a/target/linux/atheros/config-3.10 +++ b/target/linux/atheros/config-3.10 @@ -12,7 +12,7 @@ CONFIG_ATHEROS_AR2315=y CONFIG_ATHEROS_AR2315_PCI=y CONFIG_ATHEROS_AR231X=y CONFIG_ATHEROS_AR5312=y -CONFIG_ATHEROS_WDT=y +CONFIG_AR2315_WDT=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y CONFIG_CLONE_BACKWARDS=y diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index 5dd0e75..b0284e7 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -192,15 +192,16 @@ +MODULE_ALIAS(platform: DRIVER_NAME); --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig -@@ -1113,6 +1113,12 @@ config LANTIQ_WDT +@@ -1113,6 +1113,13 @@ config LANTIQ_WDT help Hardware driver for the Lantiq SoC Watchdog Timer. -+config ATHEROS_WDT -+ tristate Atheros wisoc Watchdog Timer ++config AR2315_WDT ++ tristate Atheros AR2315+ WiSoCs Watchdog Timer + depends on ATHEROS_AR231X + help -+Hardware driver for the Atheros wisoc Watchdog Timer. ++Hardware driver for the built-in watchdog timer on the Atheros ++AR2315/AR2316 WiSoCs. + # PARISC Architecture @@ -211,7 +212,7 @@ obj-$(CONFIG_PNX833X_WDT) += pnx833x_wdt.o obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o obj-$(CONFIG_AR7_WDT) += ar7_wdt.o -+obj-$(CONFIG_ATHEROS_WDT) += ar2315-wtd.o ++obj-$(CONFIG_AR2315_WDT) += ar2315-wtd.o obj-$(CONFIG_TXX9_WDT) += txx9wdt.o obj-$(CONFIG_OCTEON_WDT) += octeon-wdt.o octeon-wdt-y := octeon-wdt-main.o octeon-wdt-nmi.o -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 10/18] atheros: rename some interrupt control handlers
Rename interrupt control handlers to be consistent with operation names and add IRQ chips names. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 45 --- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index bf7e30c..9e38c04 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -1550,7 +1550,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar5312.c -@@ -0,0 +1,601 @@ +@@ -0,0 +1,602 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -1631,7 +1631,7 @@ + +/* Enable the specified AR531X_MISC_IRQ interrupt */ +static void -+ar5312_misc_intr_enable(struct irq_data *d) ++ar5312_misc_irq_unmask(struct irq_data *d) +{ + unsigned int imr; + @@ -1642,7 +1642,7 @@ + +/* Disable the specified AR531X_MISC_IRQ interrupt */ +static void -+ar5312_misc_intr_disable(struct irq_data *d) ++ar5312_misc_irq_mask(struct irq_data *d) +{ + unsigned int imr; + @@ -1652,9 +1652,10 @@ + ar231x_read_reg(AR531X_IMR); /* flush write buffer */ +} + -+static struct irq_chip ar5312_misc_intr_controller = { -+ .irq_mask = ar5312_misc_intr_disable, -+ .irq_unmask = ar5312_misc_intr_enable, ++static struct irq_chip ar5312_misc_irq_chip = { ++ .name = AR5312-MISC, ++ .irq_unmask = ar5312_misc_irq_unmask, ++ .irq_mask = ar5312_misc_irq_mask, +}; + + @@ -1695,8 +1696,8 @@ + ar231x_irq_dispatch = ar5312_irq_dispatch; + for (i = 0; i AR531X_MISC_IRQ_COUNT; i++) { + int irq = AR531X_MISC_IRQ_BASE + i; -+ irq_set_chip_and_handler(irq, ar5312_misc_intr_controller, -+ handle_level_irq); ++ irq_set_chip_and_handler(irq, ar5312_misc_irq_chip, ++ handle_level_irq); + } + setup_irq(AR531X_MISC_IRQ_AHB_PROC, ar5312_ahb_proc_interrupt); + setup_irq(AR5312_IRQ_MISC_INTRS, cascade); @@ -2154,7 +2155,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,661 @@ +@@ -0,0 +1,663 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -2278,7 +2279,7 @@ + ar231x_write_reg(AR2315_GPIO_INT, reg); +} + -+static void ar2315_gpio_intr_enable(struct irq_data *d) ++static void ar2315_gpio_irq_unmask(struct irq_data *d) +{ + unsigned int gpio = d-irq - AR531X_GPIO_IRQ_BASE; + @@ -2291,7 +2292,7 @@ + ar2315_set_gpiointmask(gpio, 3); +} + -+static void ar2315_gpio_intr_disable(struct irq_data *d) ++static void ar2315_gpio_irq_mask(struct irq_data *d) +{ + unsigned int gpio = d-irq - AR531X_GPIO_IRQ_BASE; + @@ -2300,13 +2301,14 @@ + ar2315_set_gpiointmask(gpio, 0); +} + -+static struct irq_chip ar2315_gpio_intr_controller = { -+ .irq_mask = ar2315_gpio_intr_disable, -+ .irq_unmask = ar2315_gpio_intr_enable, ++static struct irq_chip ar2315_gpio_irq_chip = { ++ .name = AR2315-GPIO, ++ .irq_unmask = ar2315_gpio_irq_unmask, ++ .irq_mask = ar2315_gpio_irq_mask, +}; + +static void -+ar2315_misc_intr_enable(struct irq_data *d) ++ar2315_misc_irq_unmask(struct irq_data *d) +{ + unsigned int imr; + @@ -2337,7 +2339,7 @@ +} + +static void -+ar2315_misc_intr_disable(struct irq_data *d) ++ar2315_misc_irq_mask(struct irq_data *d) +{ + unsigned int imr; + @@ -2367,9 +2369,10 @@ + ar231x_write_reg(AR2315_IMR, imr); +} + -+static struct irq_chip ar2315_misc_intr_controller = { -+ .irq_mask = ar2315_misc_intr_disable, -+ .irq_unmask = ar2315_misc_intr_enable, ++static struct irq_chip ar2315_misc_irq_chip = { ++ .name = AR2315-MISC, ++ .irq_unmask = ar2315_misc_irq_unmask, ++ .irq_mask = ar2315_misc_irq_mask, +}; + +static irqreturn_t ar2315_ahb_proc_handler(int cpl, void *dev_id) @@ -2405,12 +2408,12 @@ + gpiointval = ar231x_read_reg(AR2315_GPIO_DI); + for (i = 0; i AR531X_MISC_IRQ_COUNT; i++) { + int irq = AR531X_MISC_IRQ_BASE + i; -+ irq_set_chip_and_handler(irq, ar2315_misc_intr_controller, ++ irq_set_chip_and_handler(irq, ar2315_misc_irq_chip, + handle_level_irq); + } + for (i = 0; i AR531X_GPIO_IRQ_COUNT; i++) { + int irq = AR531X_GPIO_IRQ_BASE + i; -+ irq_set_chip_and_handler(irq, ar2315_gpio_intr_controller, ++ irq_set_chip_and_handler(irq, ar2315_gpio_irq_chip, + handle_level_irq); + } + setup_irq(AR531X_MISC_IRQ_GPIO, cascade); -- 1.8.1.5
[OpenWrt-Devel] [PATCH v2 05/18] atheros[ar2315-wdt]: update I/O handling
* Pass iomem and IRQ via platform device resources * Remap iomem and use iowrite32 accessor function Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 17 +++- .../linux/atheros/patches-3.10/130-watchdog.patch | 45 -- 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 3169827..28c93be 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -2134,7 +2134,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,624 @@ +@@ -0,0 +1,639 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -2524,9 +2524,24 @@ + .num_resources = ARRAY_SIZE(ar2315_spiflash_res) +}; + ++static struct resource ar2315_wdt_res[] = { ++ { ++ .flags = IORESOURCE_MEM, ++ .start = AR2315_WD, ++ .end = AR2315_WD + 8 - 1, ++ }, ++ { ++ .flags = IORESOURCE_IRQ, ++ .start = AR531X_MISC_IRQ_WATCHDOG, ++ .end = AR531X_MISC_IRQ_WATCHDOG, ++ } ++}; ++ +static struct platform_device ar2315_wdt = { + .id = 0, + .name = ar2315-wdt, ++ .resource = ar2315_wdt_res, ++ .num_resources = ARRAY_SIZE(ar2315_wdt_res) +}; + +/* diff --git a/target/linux/atheros/patches-3.10/130-watchdog.patch b/target/linux/atheros/patches-3.10/130-watchdog.patch index 06c8d44..13eca59 100644 --- a/target/linux/atheros/patches-3.10/130-watchdog.patch +++ b/target/linux/atheros/patches-3.10/130-watchdog.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/drivers/watchdog/ar2315-wtd.c -@@ -0,0 +1,186 @@ +@@ -0,0 +1,209 @@ +/* + * 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 @@ -35,23 +35,32 @@ +#include linux/io.h +#include linux/uaccess.h + -+#include ar231x_platform.h -+#include ar2315_regs.h -+#include ar231x.h -+ +#define DRIVER_NAME ar2315-wdt + +#define CLOCK_RATE 4000 +#define HEARTBEAT(x) (x 1 || x 90 ? 20 : x) + ++#define WDT_REG_TIMER 0x00 ++#define WDT_REG_CTRL 0x04 ++ ++#define WDT_CTRL_ACT_NONE 0x /* No action */ ++#define WDT_CTRL_ACT_NMI 0x0001 /* NMI on watchdog */ ++#define WDT_CTRL_ACT_RESET0x0002 /* reset on watchdog */ ++ +static int wdt_timeout = 20; +static int started; +static int in_use; ++static void __iomem *wdt_base; ++ ++static inline void ar2315_wdt_wr(unsigned reg, u32 val) ++{ ++ iowrite32(val, wdt_base + reg); ++} + +static void +ar2315_wdt_enable(void) +{ -+ ar231x_write_reg(AR2315_WD, wdt_timeout * CLOCK_RATE); ++ ar2315_wdt_wr(WDT_REG_TIMER, wdt_timeout * CLOCK_RATE); +} + +static ssize_t @@ -89,8 +98,8 @@ + dev_crit(pdev-dev, watchdog expired, rebooting system\n); + emergency_restart(); + } else { -+ ar231x_write_reg(AR2315_WDC, 0); -+ ar231x_write_reg(AR2315_WD, 0); ++ ar2315_wdt_wr(WDT_REG_CTRL, 0); ++ ar2315_wdt_wr(WDT_REG_TIMER, 0); + } + return IRQ_HANDLED; +} @@ -147,10 +156,25 @@ +static int +ar2315_wdt_probe(struct platform_device *dev) +{ ++ struct resource *mem_res, *irq_res; + int ret = 0; + -+ ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, -+IRQF_DISABLED, DRIVER_NAME, dev); ++ if (wdt_base) ++ return -EBUSY; ++ ++ irq_res = platform_get_resource(dev, IORESOURCE_IRQ, 0); ++ if (!irq_res) { ++ dev_err(dev-dev, no IRQ resource\n); ++ return -ENOENT; ++ } ++ ++ mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0); ++ wdt_base = devm_ioremap_resource(dev-dev, mem_res); ++ if (IS_ERR(wdt_base)) ++ return PTR_ERR(wdt_base); ++ ++ ret = devm_request_irq(dev-dev, irq_res-start, ar2315_wdt_interrupt, ++ IRQF_DISABLED, DRIVER_NAME, dev); + if (ret) { + dev_err(dev-dev, failed to register inetrrupt\n); + goto out; @@ -168,7 +192,6 @@ +ar2315_wdt_remove(struct platform_device *dev) +{ + misc_deregister(ar2315_wdt_miscdev); -+ free_irq(AR531X_MISC_IRQ_WATCHDOG, NULL); + return 0; +} + -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 09/18] atheros: move AR2315 misc IRQ dispatching to separate function
Align code with AR5312 realization. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 47 -- .../atheros/patches-3.10/105-ar2315_pci.patch | 15 +++ 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index bc6d5d8..bf7e30c 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -2154,7 +2154,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,656 @@ +@@ -0,0 +1,661 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -,6 +,28 @@ + do_IRQ(AR531X_GPIO_IRQ_BASE + bit); +} + ++static void ++ar2315_misc_irq_dispatch(void) ++{ ++ unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) ++ ar231x_read_reg(AR2315_IMR); ++ ++ if (misc_intr AR2315_ISR_SPI) ++ do_IRQ(AR531X_MISC_IRQ_SPI); ++ else if (misc_intr AR2315_ISR_TIMER) ++ do_IRQ(AR531X_MISC_IRQ_TIMER); ++ else if (misc_intr AR2315_ISR_AHB) ++ do_IRQ(AR531X_MISC_IRQ_AHB_PROC); ++ else if (misc_intr AR2315_ISR_GPIO) ++ ar2315_gpio_irq(); ++ else if (misc_intr AR2315_ISR_UART0) ++ do_IRQ(AR531X_MISC_IRQ_UART0); ++ else if (misc_intr AR2315_ISR_WD) { ++ ar231x_write_reg(AR2315_ISR, AR2315_ISR_WD); ++ do_IRQ(AR531X_MISC_IRQ_WATCHDOG); ++ } else ++ do_IRQ(AR531X_MISC_IRQ_NONE); ++} + +/* + * Called when an interrupt is received, this function @@ -2240,26 +2262,9 @@ + do_IRQ(AR2315_IRQ_WLAN0_INTRS); + else if (pending CAUSEF_IP4) + do_IRQ(AR2315_IRQ_ENET0_INTRS); -+ else if (pending CAUSEF_IP2) { -+ unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) -+ ar231x_read_reg(AR2315_IMR); -+ -+ if (misc_intr AR2315_ISR_SPI) -+ do_IRQ(AR531X_MISC_IRQ_SPI); -+ else if (misc_intr AR2315_ISR_TIMER) -+ do_IRQ(AR531X_MISC_IRQ_TIMER); -+ else if (misc_intr AR2315_ISR_AHB) -+ do_IRQ(AR531X_MISC_IRQ_AHB_PROC); -+ else if (misc_intr AR2315_ISR_GPIO) -+ ar2315_gpio_irq(); -+ else if (misc_intr AR2315_ISR_UART0) -+ do_IRQ(AR531X_MISC_IRQ_UART0); -+ else if (misc_intr AR2315_ISR_WD) { -+ ar231x_write_reg(AR2315_ISR, AR2315_ISR_WD); -+ do_IRQ(AR531X_MISC_IRQ_WATCHDOG); -+ } else -+ do_IRQ(AR531X_MISC_IRQ_NONE); -+ } else if (pending CAUSEF_IP7) ++ else if (pending CAUSEF_IP2) ++ ar2315_misc_irq_dispatch(); ++ else if (pending CAUSEF_IP7) + do_IRQ(AR531X_IRQ_CPU_CLOCK); +} + diff --git a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch index 733d6ad..8b080d8 100644 --- a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch +++ b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch @@ -257,8 +257,8 @@ + default y --- a/arch/mips/ar231x/ar2315.c +++ b/arch/mips/ar231x/ar2315.c -@@ -65,6 +65,27 @@ static inline void ar2315_gpio_irq(void) - do_IRQ(AR531X_GPIO_IRQ_BASE + bit); +@@ -88,6 +88,28 @@ ar2315_misc_irq_dispatch(void) + do_IRQ(AR531X_MISC_IRQ_NONE); } +#ifdef CONFIG_ATHEROS_AR2315_PCI @@ -282,10 +282,11 @@ + } +} +#endif /* CONFIG_ATHEROS_AR2315_PCI */ - ++ /* * Called when an interrupt is received, this function -@@ -83,6 +104,10 @@ ar2315_irq_dispatch(void) + * determines exactly which interrupt it was, and it +@@ -105,6 +127,10 @@ ar2315_irq_dispatch(void) do_IRQ(AR2315_IRQ_WLAN0_INTRS); else if (pending CAUSEF_IP4) do_IRQ(AR2315_IRQ_ENET0_INTRS); @@ -293,6 +294,6 @@ + else if (pending CAUSEF_IP5) + ar2315_pci_irq(AR2315_IRQ_LCBUS_PCI); +#endif - else if (pending CAUSEF_IP2) { - unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) -ar231x_read_reg(AR2315_IMR); + else if (pending CAUSEF_IP2) + ar2315_misc_irq_dispatch(); + else if (pending CAUSEF_IP7) -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 07/18] atheros[ar231x-eth]: move driver to atheros subdirectory
Move driver code to respective vendor subdirectory and fix config symbol name. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/config-3.10 | 2 +- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 59 +++--- .../patches-3.10/220-enet_micrel_workaround.patch | 4 +- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/target/linux/atheros/config-3.10 b/target/linux/atheros/config-3.10 index ccbb592..08c4087 100644 --- a/target/linux/atheros/config-3.10 +++ b/target/linux/atheros/config-3.10 @@ -100,7 +100,7 @@ CONFIG_MTD_REDBOOT_PARTS=y CONFIG_MVSWITCH_PHY=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y -CONFIG_NET_VENDOR_AR231X=y +CONFIG_NET_AR231X=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_PCI=y diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index a0c4115..5f743b4 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -1,37 +1,38 @@ a/drivers/net/ethernet/Kconfig -+++ b/drivers/net/ethernet/Kconfig -@@ -22,6 +22,7 @@ source drivers/net/ethernet/adaptec/Kco - source drivers/net/ethernet/aeroflex/Kconfig - source drivers/net/ethernet/alteon/Kconfig - source drivers/net/ethernet/amd/Kconfig -+source drivers/net/ethernet/ar231x/Kconfig - source drivers/net/ethernet/apple/Kconfig - source drivers/net/ethernet/atheros/Kconfig - source drivers/net/ethernet/cadence/Kconfig a/drivers/net/ethernet/Makefile -+++ b/drivers/net/ethernet/Makefile -@@ -9,6 +9,7 @@ obj-$(CONFIG_GRETH) += aeroflex/ - obj-$(CONFIG_NET_VENDOR_ALTEON) += alteon/ - obj-$(CONFIG_NET_VENDOR_AMD) += amd/ - obj-$(CONFIG_NET_VENDOR_APPLE) += apple/ -+obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x/ - obj-$(CONFIG_NET_VENDOR_ATHEROS) += atheros/ - obj-$(CONFIG_NET_CADENCE) += cadence/ - obj-$(CONFIG_NET_BFIN) += adi/ /dev/null -+++ b/drivers/net/ethernet/ar231x/Kconfig -@@ -0,0 +1,5 @@ -+config NET_VENDOR_AR231X -+ tristate AR231X Ethernet support +--- a/drivers/net/ethernet/atheros/Makefile b/drivers/net/ethernet/atheros/Makefile +@@ -7,3 +7,4 @@ obj-$(CONFIG_ATL2) += atlx/ + obj-$(CONFIG_ATL1E) += atl1e/ + obj-$(CONFIG_ATL1C) += atl1c/ + obj-$(CONFIG_ALX) += alx/ ++obj-$(CONFIG_NET_AR231X) += ar231x/ +--- a/drivers/net/ethernet/atheros/Kconfig b/drivers/net/ethernet/atheros/Kconfig +@@ -5,7 +5,7 @@ + config NET_VENDOR_ATHEROS + bool Atheros devices + default y +- depends on PCI ++ depends on (PCI || ATHEROS_AR231X) + ---help--- + If you have a network (Ethernet) card belonging to this class, say Y + and read the Ethernet-HOWTO, available from +@@ -85,4 +85,10 @@ config ALX + To compile this driver as a module, choose M here. The module + will be called alx. + ++config NET_AR231X ++ tristate Atheros AR231X built-in Ethernet support + depends on ATHEROS_AR231X + help +Support for the AR231x/531x ethernet controller ++ + endif # NET_VENDOR_ATHEROS --- /dev/null -+++ b/drivers/net/ethernet/ar231x/Makefile b/drivers/net/ethernet/atheros/ar231x/Makefile @@ -0,0 +1 @@ -+obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o ++obj-$(CONFIG_NET_AR231X) += ar231x.o --- /dev/null -+++ b/drivers/net/ethernet/ar231x/ar231x.c b/drivers/net/ethernet/atheros/ar231x/ar231x.c @@ -0,0 +1,1249 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. @@ -1283,7 +1284,7 @@ +} + --- /dev/null -+++ b/drivers/net/ethernet/ar231x/ar231x.h b/drivers/net/ethernet/atheros/ar231x/ar231x.h @@ -0,0 +1,287 @@ +/* + * ar231x.h: Linux driver for the Atheros AR231x Ethernet device. diff --git a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch index ada0a76..cc3a74e 100644 --- a/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch +++ b/target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch @@ -1,5 +1,5 @@ a/drivers/net/ethernet/ar231x/ar231x.c -+++ b/drivers/net/ethernet/ar231x/ar231x.c +--- a/drivers/net/ethernet/atheros/ar231x/ar231x.c b/drivers/net/ethernet/atheros/ar231x/ar231x.c @@ -148,6 +148,7 @@ static int ar231x_mdiobus_write(struct m static int ar231x_mdiobus_reset(struct mii_bus *bus); static int ar231x_mdiobus_probe(struct net_device *dev); -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 06/18] atheros[ar231x-eth]: update MAC and PHY reset method
Pass reset_set and reset_clear callback functions pointers via platform_data instead of reset register address. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 49 ++ .../atheros/patches-3.10/110-ar2313_ethernet.patch | 24 --- .../patches-3.10/220-enet_micrel_workaround.patch | 6 +-- 3 files changed, 54 insertions(+), 25 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 28c93be..ab5e6bb 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -388,7 +388,7 @@ +} --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar231x_platform.h -@@ -0,0 +1,83 @@ +@@ -0,0 +1,84 @@ +#ifndef __AR531X_PLATFORM_H +#define __AR531X_PLATFORM_H + @@ -463,7 +463,8 @@ + * Platform device information for the Ethernet MAC + */ +struct ar231x_eth { -+ u32 reset_base; ++ void (*reset_set)(u32); ++ void (*reset_clear)(u32); + u32 reset_mac; + u32 reset_phy; + u32 phy_base; @@ -1549,7 +1550,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar5312.c -@@ -0,0 +1,582 @@ +@@ -0,0 +1,600 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -1799,6 +1800,22 @@ + +/* end of gpiolib */ + ++static void ar5312_device_reset_set(u32 mask) ++{ ++ u32 val; ++ ++ val = ar231x_read_reg(AR531X_RESET); ++ ar231x_write_reg(AR531X_RESET, val | mask); ++} ++ ++static void ar5312_device_reset_clear(u32 mask) ++{ ++ u32 val; ++ ++ val = ar231x_read_reg(AR531X_RESET); ++ ar231x_write_reg(AR531X_RESET, val ~mask); ++} ++ +static struct physmap_flash_data ar5312_flash_data = { + .width = 2, +}; @@ -1810,7 +1827,8 @@ +}; + +static struct ar231x_eth ar5312_eth0_data = { -+ .reset_base = AR531X_RESET, ++ .reset_set = ar5312_device_reset_set, ++ .reset_clear = ar5312_device_reset_clear, + .reset_mac = AR531X_RESET_ENET0, + .reset_phy = AR531X_RESET_EPHY0, + .phy_base = KSEG1ADDR(AR531X_ENET0), @@ -1818,7 +1836,8 @@ +}; + +static struct ar231x_eth ar5312_eth1_data = { -+ .reset_base = AR531X_RESET, ++ .reset_set = ar5312_device_reset_set, ++ .reset_clear = ar5312_device_reset_clear, + .reset_mac = AR531X_RESET_ENET1, + .reset_phy = AR531X_RESET_EPHY1, + .phy_base = KSEG1ADDR(AR531X_ENET1), @@ -2134,7 +2153,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,639 @@ +@@ -0,0 +1,655 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -2493,9 +2512,25 @@ + +/* end of gpiolib */ + ++static void ar2315_device_reset_set(u32 mask) ++{ ++ u32 val; ++ ++ val = ar231x_read_reg(AR2315_RESET); ++ ar231x_write_reg(AR2315_RESET, val | mask); ++} ++ ++static void ar2315_device_reset_clear(u32 mask) ++{ ++ u32 val; ++ ++ val = ar231x_read_reg(AR2315_RESET); ++ ar231x_write_reg(AR2315_RESET, val ~mask); ++} + +static struct ar231x_eth ar2315_eth_data = { -+ .reset_base = AR2315_RESET, ++ .reset_set = ar2315_device_reset_set, ++ .reset_clear = ar2315_device_reset_clear, + .reset_mac = AR2315_RESET_ENET0, + .reset_phy = AR2315_RESET_EPHY0, + .phy_base = KSEG1ADDR(AR2315_ENET0), diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index 5532a5f..a0c4115 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -32,7 +32,7 @@ +obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/ar231x/ar231x.c -@@ -0,0 +1,1254 @@ +@@ -0,0 +1,1249 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -289,12 +289,6 @@ + return -ENXIO; + } + -+ sp-int_regs = ioremap_nocache(virt_to_phys(sp-cfg-reset_base), 4); -+ if (!sp-int_regs) { -+ printk(Can't remap INTERRUPT registers\n); -+ return -ENXIO; -+ } -+ + strncpy(sp-name, Atheros AR231x, sizeof(sp-name) - 1); + sp-name[sizeof(sp-name) - 1] = '\0'; + memcpy(dev-dev_addr, sp-cfg-macaddr, 6); @@ -609,13 +603,13 @@ + unsigned int ethsal, ethsah; + unsigned int flags; + -+ *sp-int_regs |= sp-cfg-reset_mac; ++ sp-cfg-reset_set(sp-cfg-reset_mac); + mdelay(10); -+ *sp-int_regs = ~sp-cfg-reset_mac; ++ sp-cfg-reset_clear(sp-cfg-reset_mac); + mdelay(10); -+ *sp-int_regs |= sp-cfg-reset_phy; ++ sp-cfg-reset_set(sp-cfg-reset_phy); + mdelay(10); -+ *sp-int_regs = ~sp-cfg-reset_phy; ++
[OpenWrt-Devel] [PATCH v2 12/18] atheros: use irq_set_chained_handler()
Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 34 +++--- .../atheros/patches-3.10/105-ar2315_pci.patch | 6 ++-- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 6e3d633..b702d2b 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -1583,7 +1583,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar5312.c -@@ -0,0 +1,602 @@ +@@ -0,0 +1,596 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -1623,8 +1623,7 @@ +#include devices.h +#include ar5312.h + -+static void -+ar5312_misc_irq_dispatch(void) ++static void ar5312_misc_irq_handler(unsigned irq, struct irq_desc *desc) +{ + unsigned int ar231x_misc_intrs = ar231x_read_reg(AR531X_ISR) + ar231x_read_reg(AR531X_IMR); @@ -1656,7 +1655,7 @@ + else if (pending CAUSEF_IP5) + do_IRQ(AR5312_IRQ_WLAN1_INTRS); + else if (pending CAUSEF_IP6) -+ ar5312_misc_irq_dispatch(); ++ do_IRQ(AR5312_IRQ_MISC_INTRS); + else if (pending CAUSEF_IP7) + do_IRQ(AR531X_IRQ_CPU_CLOCK); +} @@ -1714,11 +1713,6 @@ +}; + + -+static struct irqaction cascade = { -+ .handler = no_action, -+ .name= cascade, -+}; -+ +void __init ar5312_irq_init(void) +{ + int i; @@ -1733,7 +1727,7 @@ + handle_level_irq); + } + setup_irq(AR531X_MISC_IRQ_AHB_PROC, ar5312_ahb_proc_interrupt); -+ setup_irq(AR5312_IRQ_MISC_INTRS, cascade); ++ irq_set_chained_handler(AR5312_IRQ_MISC_INTRS, ar5312_misc_irq_handler); +} + +static u32 @@ -2188,7 +2182,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,621 @@ +@@ -0,0 +1,615 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -2230,7 +2224,7 @@ + +static u32 gpiointmask, gpiointval; + -+static inline void ar2315_gpio_irq(void) ++static void ar2315_gpio_irq_handler(unsigned irq, struct irq_desc *desc) +{ + u32 pend; + int bit = -1; @@ -2256,8 +2250,7 @@ + do_IRQ(AR531X_GPIO_IRQ_BASE + bit); +} + -+static void -+ar2315_misc_irq_dispatch(void) ++static void ar2315_misc_irq_handler(unsigned irq, struct irq_desc *desc) +{ + unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) + ar231x_read_reg(AR2315_IMR); @@ -2269,7 +2262,7 @@ + else if (misc_intr AR2315_ISR_AHB) + do_IRQ(AR2315_MISC_IRQ_AHB); + else if (misc_intr AR2315_ISR_GPIO) -+ ar2315_gpio_irq(); ++ do_IRQ(AR2315_MISC_IRQ_GPIO); + else if (misc_intr AR2315_ISR_UART0) + do_IRQ(AR2315_MISC_IRQ_UART0); + else if (misc_intr AR2315_ISR_WD) { @@ -2297,7 +2290,7 @@ + else if (pending CAUSEF_IP4) + do_IRQ(AR2315_IRQ_ENET0_INTRS); + else if (pending CAUSEF_IP2) -+ ar2315_misc_irq_dispatch(); ++ do_IRQ(AR2315_IRQ_MISC_INTRS); + else if (pending CAUSEF_IP7) + do_IRQ(AR531X_IRQ_CPU_CLOCK); +} @@ -2382,11 +2375,6 @@ + .name = ar2315_ahb_proc_interrupt, +}; + -+static struct irqaction cascade = { -+ .handler= no_action, -+ .name = cascade, -+}; -+ +void +ar2315_irq_init(void) +{ @@ -2407,9 +2395,9 @@ + irq_set_chip_and_handler(irq, ar2315_gpio_irq_chip, + handle_level_irq); + } -+ setup_irq(AR2315_MISC_IRQ_GPIO, cascade); ++ irq_set_chained_handler(AR2315_MISC_IRQ_GPIO, ar2315_gpio_irq_handler); + setup_irq(AR2315_MISC_IRQ_AHB, ar2315_ahb_proc_interrupt); -+ setup_irq(AR2315_IRQ_MISC_INTRS, cascade); ++ irq_set_chained_handler(AR2315_IRQ_MISC_INTRS, ar2315_misc_irq_handler); +} + +static u32 diff --git a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch index 95db399..20bf669 100644 --- a/target/linux/atheros/patches-3.10/105-ar2315_pci.patch +++ b/target/linux/atheros/patches-3.10/105-ar2315_pci.patch @@ -257,7 +257,7 @@ + default y --- a/arch/mips/ar231x/ar2315.c +++ b/arch/mips/ar231x/ar2315.c -@@ -88,6 +88,28 @@ ar2315_misc_irq_dispatch(void) +@@ -87,6 +87,28 @@ static void ar2315_misc_irq_handler(unsi do_IRQ(AR2315_MISC_IRQ_NONE); } @@ -286,7 +286,7 @@ /* * Called when an interrupt is received, this function * determines exactly which interrupt it was, and it -@@ -105,6 +127,10 @@ ar2315_irq_dispatch(void) +@@ -104,6 +126,10 @@ ar2315_irq_dispatch(void)
[OpenWrt-Devel] [PATCH v2 11/18] atheros: simplify AR2315 misc IRQ (un)masking
Currently AR5312 misc IRQ numbers are used for AR2315+ chips, what cause us to use switch-case to map IRQ number to ISR bit. Introduce AR2315 specific misc IRQs set and simplify interrupt (un)mask operation. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 124 + .../atheros/patches-3.10/105-ar2315_pci.patch | 2 +- 2 files changed, 52 insertions(+), 74 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 9e38c04..6e3d633 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -714,7 +714,7 @@ +#endif /* __ASM_MIPS_MACH_ATHEROS_WAR_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar2315_regs.h -@@ -0,0 +1,597 @@ +@@ -0,0 +1,614 @@ +/* + * Register definitions for AR2315+ + * @@ -740,6 +740,23 @@ +#define AR2315_IRQ_LCBUS_PCI(MIPS_CPU_IRQ_BASE+5) /* C0_CAUSE: 0x2000 */ +#define AR2315_IRQ_WLAN0_POLL (MIPS_CPU_IRQ_BASE+6) /* C0_CAUSE: 0x4000 */ + ++ ++/* ++ * Miscellaneous interrupts, which share IP2. ++ */ ++#define AR2315_MISC_IRQ_NONE (AR531X_MISC_IRQ_BASE+0) ++#define AR2315_MISC_IRQ_UART0 (AR531X_MISC_IRQ_BASE+1) ++#define AR2315_MISC_IRQ_I2C_RSVD (AR531X_MISC_IRQ_BASE+2) ++#define AR2315_MISC_IRQ_SPI (AR531X_MISC_IRQ_BASE+3) ++#define AR2315_MISC_IRQ_AHB (AR531X_MISC_IRQ_BASE+4) ++#define AR2315_MISC_IRQ_APB (AR531X_MISC_IRQ_BASE+5) ++#define AR2315_MISC_IRQ_TIMER (AR531X_MISC_IRQ_BASE+6) ++#define AR2315_MISC_IRQ_GPIO (AR531X_MISC_IRQ_BASE+7) ++#define AR2315_MISC_IRQ_WATCHDOG (AR531X_MISC_IRQ_BASE+8) ++#define AR2315_MISC_IRQ_IR_RSVD (AR531X_MISC_IRQ_BASE+9) ++#define AR2315_MISC_IRQ_COUNT 10 ++ ++ +/* + * Address map + */ @@ -1314,7 +1331,7 @@ +#endif /* __AR2315_REG_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar5312_regs.h -@@ -0,0 +1,233 @@ +@@ -0,0 +1,249 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -1341,6 +1358,22 @@ +#define AR5312_IRQ_MISC_INTRS (MIPS_CPU_IRQ_BASE+6) /* C0_CAUSE: 0x4000 */ + + ++/* ++ * Miscellaneous interrupts, which share IP6. ++ */ ++#define AR531X_MISC_IRQ_NONE (AR531X_MISC_IRQ_BASE+0) ++#define AR531X_MISC_IRQ_TIMER (AR531X_MISC_IRQ_BASE+1) ++#define AR531X_MISC_IRQ_AHB_PROC (AR531X_MISC_IRQ_BASE+2) ++#define AR531X_MISC_IRQ_AHB_DMA (AR531X_MISC_IRQ_BASE+3) ++#define AR531X_MISC_IRQ_GPIO (AR531X_MISC_IRQ_BASE+4) ++#define AR531X_MISC_IRQ_UART0 (AR531X_MISC_IRQ_BASE+5) ++#define AR531X_MISC_IRQ_UART0_DMA (AR531X_MISC_IRQ_BASE+6) ++#define AR531X_MISC_IRQ_WATCHDOG (AR531X_MISC_IRQ_BASE+7) ++#define AR531X_MISC_IRQ_LOCAL (AR531X_MISC_IRQ_BASE+8) ++#define AR531X_MISC_IRQ_SPI (AR531X_MISC_IRQ_BASE+9) ++#define AR531X_MISC_IRQ_COUNT 10 ++ ++ +/* Address Map */ +#define AR531X_WLAN00x1800 +#define AR531X_WLAN10x1850 @@ -2155,7 +2188,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,663 @@ +@@ -0,0 +1,621 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -2230,20 +2263,20 @@ + ar231x_read_reg(AR2315_IMR); + + if (misc_intr AR2315_ISR_SPI) -+ do_IRQ(AR531X_MISC_IRQ_SPI); ++ do_IRQ(AR2315_MISC_IRQ_SPI); + else if (misc_intr AR2315_ISR_TIMER) -+ do_IRQ(AR531X_MISC_IRQ_TIMER); ++ do_IRQ(AR2315_MISC_IRQ_TIMER); + else if (misc_intr AR2315_ISR_AHB) -+ do_IRQ(AR531X_MISC_IRQ_AHB_PROC); ++ do_IRQ(AR2315_MISC_IRQ_AHB); + else if (misc_intr AR2315_ISR_GPIO) + ar2315_gpio_irq(); + else if (misc_intr AR2315_ISR_UART0) -+ do_IRQ(AR531X_MISC_IRQ_UART0); ++ do_IRQ(AR2315_MISC_IRQ_UART0); + else if (misc_intr AR2315_ISR_WD) { + ar231x_write_reg(AR2315_ISR, AR2315_ISR_WD); -+ do_IRQ(AR531X_MISC_IRQ_WATCHDOG); ++ do_IRQ(AR2315_MISC_IRQ_WATCHDOG); + } else -+ do_IRQ(AR531X_MISC_IRQ_NONE); ++ do_IRQ(AR2315_MISC_IRQ_NONE); +} + +/* @@ -2313,28 +2346,7 @@ + unsigned int imr; + + imr = ar231x_read_reg(AR2315_IMR); -+ switch (d-irq) { -+ case AR531X_MISC_IRQ_SPI: -+ imr |= AR2315_ISR_SPI; -+ break; -+ case AR531X_MISC_IRQ_TIMER: -+ imr |= AR2315_ISR_TIMER; -+ break; -+ case AR531X_MISC_IRQ_AHB_PROC: -+ imr |= AR2315_ISR_AHB; -+ break; -+ case AR531X_MISC_IRQ_GPIO: -+
[OpenWrt-Devel] [PATCH v2 13/18] atheros: simplify gpiolib realization
Each SoCs generation has own independent gpiolib realization, so we have no reason to keep these realizations in semiuniversal form. Following modifications are made: * Remove valid_mask field * Remove ar231x_gpio_chip structure * Rename AR2315_GPIO_CR to AR2315_GPIO_DIR * Fix count of AR5312 GPIOs * Simplify gpio_chip methods realization Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 234 ++ 1 file changed, 57 insertions(+), 177 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index b702d2b..8fbd250 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -1050,12 +1050,12 @@ + */ +#define AR2315_GPIO_DI (AR2315_DSLBASE + 0x0088) +#define AR2315_GPIO_DO (AR2315_DSLBASE + 0x0090) -+#define AR2315_GPIO_CR (AR2315_DSLBASE + 0x0098) ++#define AR2315_GPIO_DIR (AR2315_DSLBASE + 0x0098) +#define AR2315_GPIO_INT (AR2315_DSLBASE + 0x00a0) + -+#define AR2315_GPIO_CR_M(x)(1 (x)) /* mask for i/o */ -+#define AR2315_GPIO_CR_O(x)(1 (x)) /* output */ -+#define AR2315_GPIO_CR_I(x)(0) /* input */ ++#define AR2315_GPIO_DIR_M(x) (1 (x)) /* mask for i/o */ ++#define AR2315_GPIO_DIR_O(x) (1 (x)) /* output */ ++#define AR2315_GPIO_DIR_I(x) (0) /* input */ + +#define AR2315_GPIO_INT_S(x) (x) /* interrupt enable */ +#define AR2315_GPIO_INT_M (0x3F) /* mask for int */ @@ -1583,7 +1583,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar5312.c -@@ -0,0 +1,596 @@ +@@ -0,0 +1,540 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -1730,100 +1730,46 @@ + irq_set_chained_handler(AR5312_IRQ_MISC_INTRS, ar5312_misc_irq_handler); +} + -+static u32 -+ar5312_gpio_set_output(u32 mask, u32 val) -+{ -+ u32 reg; -+ -+ reg = ar231x_read_reg(AR531X_GPIO_CR); -+ reg |= mask; -+ reg = ~val; -+ ar231x_write_reg(AR531X_GPIO_CR, reg); -+ return reg; -+} -+ -+static u32 -+ar5312_gpio_get(u32 valid_mask) -+{ -+ u32 reg; -+ reg = ar231x_read_reg(AR531X_GPIO_DI); -+ reg = valid_mask; -+ return reg; -+} -+ -+static u32 -+ar5312_gpio_set(u32 mask, u32 value) -+{ -+ u32 reg; -+ reg = ar231x_read_reg(AR531X_GPIO_DO); -+ reg = ~mask; -+ reg |= value; -+ ar231x_write_reg(AR531X_GPIO_DO, reg); -+ return reg; -+} -+ +/* -+ * gpiolib implementations. Original mask based methods preserved ++ * gpiolib implementations + */ +static int +ar5312_gpio_get_value(struct gpio_chip *chip, unsigned gpio) +{ -+ struct ar231x_gpio_chip *gpch = -+ container_of(chip, struct ar231x_gpio_chip, chip); -+ u32 mask = 1 gpio; -+ u32 rett; -+ if (!(gpch-valid_mask mask)) -+ return 0; -+ rett = ar5312_gpio_get(gpch-valid_mask); -+ return !!(rett mask); ++ return (ar231x_read_reg(AR531X_GPIO_DI) gpio) 1; +} + +static void +ar5312_gpio_set_value(struct gpio_chip *chip, unsigned gpio, int value) +{ -+ struct ar231x_gpio_chip *gpch = -+ container_of(chip, struct ar231x_gpio_chip, chip); -+ u32 mask = 1 gpio; -+ if (!(gpch-valid_mask mask)) -+ return; -+ ar5312_gpio_set(mask, (!!value) * mask); ++ u32 reg = ar231x_read_reg(AR531X_GPIO_DO); ++ reg = value ? reg | (1 gpio) : reg ~(1 gpio); ++ ar231x_write_reg(AR531X_GPIO_DO, reg); +} + +static int +ar5312_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) +{ -+ struct ar231x_gpio_chip *gpch = -+ container_of(chip, struct ar231x_gpio_chip, chip); -+ u32 mask = 1 gpio; -+ if (!(gpch-valid_mask mask)) -+ return -ENXIO; -+ ar5312_gpio_set_output(mask, 0); ++ ar231x_mask_reg(AR531X_GPIO_CR, 0, 1 gpio); + return 0; +} ++ +static int +ar5312_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int value) +{ -+ struct ar231x_gpio_chip *gpch = -+ container_of(chip, struct ar231x_gpio_chip, chip); -+ u32 mask = 1 gpio; -+ if (!(gpch-valid_mask mask)) -+ return -ENXIO; -+ ar5312_gpio_set_output(mask, mask); -+ ar5312_gpio_set(mask, (!!value) * mask); ++ ar231x_mask_reg(AR531X_GPIO_CR, 1 gpio, 0); ++ ar5312_gpio_set_value(chip, gpio, value); + return 0; +} + -+static struct ar231x_gpio_chip ar5312_gpio_chip = { -+ .valid_mask = (1 22) - 1, -+ .chip = { -+ .label = ar5312-gpio, -+ .direction_input= ar5312_gpio_direction_input, -+
[OpenWrt-Devel] [PATCH v2 14/18] atheros[ar231x-eth]: pass phys address of I/O memory via platform res
Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch| 20 ++-- .../atheros/patches-3.10/110-ar2313_ethernet.patch | 19 --- .../patches-3.10/220-enet_micrel_workaround.patch| 6 +++--- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 8fbd250..b9a88a1 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -1805,7 +1805,7 @@ + .reset_clear = ar5312_device_reset_clear, + .reset_mac = AR531X_RESET_ENET0, + .reset_phy = AR531X_RESET_EPHY0, -+ .phy_base = KSEG1ADDR(AR531X_ENET0), ++ .phy_base = AR531X_ENET0, + .config = ar231x_board, +}; + @@ -1814,7 +1814,7 @@ + .reset_clear = ar5312_device_reset_clear, + .reset_mac = AR531X_RESET_ENET1, + .reset_phy = AR531X_RESET_EPHY1, -+ .phy_base = KSEG1ADDR(AR531X_ENET1), ++ .phy_base = AR531X_ENET1, + .config = ar231x_board, +}; + @@ -1936,12 +1936,12 @@ + switch (ar231x_devtype) { + case DEV_TYPE_AR5312: + ar5312_eth0_data.macaddr = config-enet0_mac; -+ ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET0), -+ AR5312_IRQ_ENET0_INTRS, ar5312_eth0_data); ++ ar231x_add_ethernet(0, AR531X_ENET0, AR5312_IRQ_ENET0_INTRS, ++ ar5312_eth0_data); + + ar5312_eth1_data.macaddr = config-enet1_mac; -+ ar231x_add_ethernet(1, KSEG1ADDR(AR531X_ENET1), -+ AR5312_IRQ_ENET1_INTRS, ar5312_eth1_data); ++ ar231x_add_ethernet(1, AR531X_ENET1, AR5312_IRQ_ENET1_INTRS, ++ ar5312_eth1_data); + + if (!ar231x_board.radio) + return 0; @@ -1960,7 +1960,7 @@ + ar5312_eth1_data.phy_base = ar5312_eth0_data.phy_base; + ar5312_eth1_data.reset_phy = ar5312_eth0_data.reset_phy; + ar5312_eth1_data.macaddr = config-enet0_mac; -+ ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET1), ++ ar231x_add_ethernet(0, AR531X_ENET1, + AR5312_IRQ_ENET1_INTRS, ar5312_eth1_data); + + if (!ar231x_board.radio) @@ -2409,7 +2409,7 @@ + .reset_clear = ar2315_device_reset_clear, + .reset_mac = AR2315_RESET_ENET0, + .reset_phy = AR2315_RESET_EPHY0, -+ .phy_base = KSEG1ADDR(AR2315_ENET0), ++ .phy_base = AR2315_ENET0, + .config = ar231x_board, +}; + @@ -2523,8 +2523,8 @@ + ar2315_init_gpio_leds(); + platform_device_register(ar2315_wdt); + platform_device_register(ar2315_spiflash); -+ ar231x_add_ethernet(0, KSEG1ADDR(AR2315_ENET0), AR2315_IRQ_ENET0_INTRS, -+ ar2315_eth_data); ++ ar231x_add_ethernet(0, AR2315_ENET0, AR2315_IRQ_ENET0_INTRS, ++ ar2315_eth_data); + ar231x_add_wmac(0, AR2315_WLAN0, AR2315_IRQ_WLAN0_INTRS); + + return 0; diff --git a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch index 5f743b4..0e158d4 100644 --- a/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch @@ -33,7 +33,7 @@ +obj-$(CONFIG_NET_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c -@@ -0,0 +1,1249 @@ +@@ -0,0 +1,1246 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -257,8 +257,7 @@ + tasklet_init(sp-rx_tasklet, rx_tasklet_func, (unsigned long) dev); + tasklet_disable(sp-rx_tasklet); + -+ sp-eth_regs = ioremap_nocache(virt_to_phys(ar_eth_base), -+ sizeof(*sp-eth_regs)); ++ sp-eth_regs = ioremap_nocache(ar_eth_base, sizeof(*sp-eth_regs)); + if (!sp-eth_regs) { + printk(Can't remap eth registers\n); + return -ENXIO; @@ -269,26 +268,24 @@ + * even though the MAC might be on ENET1. + * Needto remap PHY regs separately in this case + */ -+ if (virt_to_phys(ar_eth_base) == virt_to_phys(sp-phy_regs)) ++ if (ar_eth_base == sp-cfg-phy_base) + sp-phy_regs = sp-eth_regs; + else { -+ sp-phy_regs = -+ ioremap_nocache(virt_to_phys(sp-cfg-phy_base), -+ sizeof(*sp-phy_regs)); ++ sp-phy_regs = ioremap_nocache(sp-cfg-phy_base, ++ sizeof(*sp-phy_regs)); + if (!sp-phy_regs) { + printk(Can't remap phy registers\n); + return -ENXIO; + } + } + -+ sp-dma_regs = -+
[OpenWrt-Devel] [PATCH v2 16/18] atheros[uart]: use 32-bit aligned I/O
Use 32-bit aligned I/O and update base UART address (remove +3 offset). Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch| 6 +++--- target/linux/atheros/patches-3.10/101-early-printk-support.patch | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 4fdf435..b9d3719 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -766,7 +766,7 @@ +#define AR2315_LOCAL0x1040 /* LOCAL BUS MMR */ +#define AR2315_ENET00x1050 /* ETHERNET MMR */ +#define AR2315_DSLBASE 0x1100 /* RESET CONTROL MMR */ -+#define AR2315_UART00x1113 /* UART MMR */ ++#define AR2315_UART00x1110 /* UART MMR */ +#define AR2315_SPI_MMR 0x1130 /* SPI FLASH MMR */ +#define AR2315_PCIEXT 0x8000 /* pci external */ + @@ -1385,7 +1385,7 @@ +#define AR531X_FLASHCTL 0x1840 +#define AR531X_APBBASE0x1c00 +#define AR531X_FLASH0x1e00 -+#define AR531X_UART00xbc03 /* UART MMR */ ++#define AR531X_UART00xbc00 /* UART MMR */ + +/* + * AR531X_NUM_ENET_MAC defines the number of ethernet MACs that @@ -3007,7 +3007,7 @@ + memset(s, 0, sizeof(s)); + + s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; -+ s.iotype = UPIO_MEM; ++ s.iotype = UPIO_MEM32; + s.irq = irq; + s.regshift = 2; + s.mapbase = mapbase; diff --git a/target/linux/atheros/patches-3.10/101-early-printk-support.patch b/target/linux/atheros/patches-3.10/101-early-printk-support.patch index 3daa011..be68025 100644 --- a/target/linux/atheros/patches-3.10/101-early-printk-support.patch +++ b/target/linux/atheros/patches-3.10/101-early-printk-support.patch @@ -21,12 +21,12 @@ +static inline void prom_uart_wr(void __iomem *base, unsigned reg, + unsigned char ch) +{ -+ __raw_writeb(ch, base + 4 * reg); ++ __raw_writel(ch, base + 4 * reg); +} + +static inline unsigned char prom_uart_rr(void __iomem *base, unsigned reg) +{ -+ return __raw_readb(base + 4 * reg); ++ return __raw_readl(base + 4 * reg); +} + +void prom_putchar(unsigned char ch) -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 17/18] atheros[uart]: pass only physical I/O mem address to 8250 driver
Pass only physical address to 8250 serial port driver and set flag to remap I/O memory inside the driver. Also fix AR5312 UART base address definition, which seems specified already mapped. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index b9d3719..611d7cc 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -1384,8 +1384,8 @@ +#define AR531X_SDRAMCTL 0x1830 +#define AR531X_FLASHCTL 0x1840 +#define AR531X_APBBASE0x1c00 ++#define AR531X_UART00x1c00 /* UART MMR */ +#define AR531X_FLASH0x1e00 -+#define AR531X_UART00xbc00 /* UART MMR */ + +/* + * AR531X_NUM_ENET_MAC defines the number of ethernet MACs that @@ -2126,7 +2126,7 @@ + ar231x_write_reg(AR531X_WD_CTRL, AR531X_WD_CTRL_IGNORE_EXPIRATION); + + _machine_restart = ar5312_restart; -+ ar231x_serial_setup(KSEG1ADDR(AR531X_UART0), AR531X_MISC_IRQ_UART0, ++ ar231x_serial_setup(AR531X_UART0, AR531X_MISC_IRQ_UART0, + ar5312_sys_frequency()); +} + @@ -2686,7 +2686,7 @@ + ar231x_write_reg(AR2315_WDC, AR2315_WDC_IGNORE_EXPIRATION); + + _machine_restart = ar2315_restart; -+ ar231x_serial_setup(KSEG1ADDR(AR2315_UART0), AR2315_MISC_IRQ_UART0, ++ ar231x_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0, + ar2315_apb_frequency()); +} --- /dev/null @@ -2859,7 +2859,7 @@ +#endif --- /dev/null +++ b/arch/mips/ar231x/devices.c -@@ -0,0 +1,181 @@ +@@ -0,0 +1,180 @@ +#include linux/kernel.h +#include linux/init.h +#include linux/serial.h @@ -3006,13 +3006,12 @@ + + memset(s, 0, sizeof(s)); + -+ s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; ++ s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP; + s.iotype = UPIO_MEM32; + s.irq = irq; + s.regshift = 2; + s.mapbase = mapbase; + s.uartclk = uartclk; -+ s.membase = (void __iomem *)s.mapbase; + + early_serial_setup(s); +} -- 1.8.1.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 15/18] atheros[ar231x-eth]: pass PHY I/O memory via device resources
Pass PHY I/O memory region via platform resources and remap them unconditionally. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 57 ++ .../atheros/patches-3.10/110-ar2313_ethernet.patch | 48 +++--- .../patches-3.10/220-enet_micrel_workaround.patch | 8 +-- 3 files changed, 72 insertions(+), 41 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index b9a88a1..4fdf435 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -388,7 +388,7 @@ +} --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar231x_platform.h -@@ -0,0 +1,84 @@ +@@ -0,0 +1,83 @@ +#ifndef __AR531X_PLATFORM_H +#define __AR531X_PLATFORM_H + @@ -467,7 +467,6 @@ + void (*reset_clear)(u32); + u32 reset_mac; + u32 reset_phy; -+ u32 phy_base; + struct ar231x_board_config *config; + char *macaddr; +}; @@ -714,7 +713,7 @@ +#endif /* __ASM_MIPS_MACH_ATHEROS_WAR_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar2315_regs.h -@@ -0,0 +1,614 @@ +@@ -0,0 +1,617 @@ +/* + * Register definitions for AR2315+ + * @@ -771,6 +770,9 @@ +#define AR2315_SPI_MMR 0x1130 /* SPI FLASH MMR */ +#define AR2315_PCIEXT 0x8000 /* pci external */ + ++/* MII registers offset inside Ethernet MMR region */ ++#define AR2315_ENET0_MII (AR2315_ENET0 + 0x14) ++ +/* + * Reset Register + */ @@ -1331,7 +1333,7 @@ +#endif /* __AR2315_REG_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar5312_regs.h -@@ -0,0 +1,249 @@ +@@ -0,0 +1,253 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -1401,6 +1403,10 @@ +#define AR5212_AR5312_REV7 0x0057 /* AR5312 WMAC (AP30-040) */ +#define AR5212_AR2313_REV8 0x0058 /* AR2313 WMAC (AP43-030) */ + ++/* MII registers offset inside Ethernet MMR region */ ++#define AR531X_ENET0_MII (AR531X_ENET0 + 0x14) ++#define AR531X_ENET1_MII (AR531X_ENET1 + 0x14) ++ +/* + * AR531X_NUM_WMAC defines the number of Wireless MACs that\ + * should be considered available. @@ -1805,7 +1811,6 @@ + .reset_clear = ar5312_device_reset_clear, + .reset_mac = AR531X_RESET_ENET0, + .reset_phy = AR531X_RESET_EPHY0, -+ .phy_base = AR531X_ENET0, + .config = ar231x_board, +}; + @@ -1814,7 +1819,6 @@ + .reset_clear = ar5312_device_reset_clear, + .reset_mac = AR531X_RESET_ENET1, + .reset_phy = AR531X_RESET_EPHY1, -+ .phy_base = AR531X_ENET1, + .config = ar231x_board, +}; + @@ -1936,11 +1940,13 @@ + switch (ar231x_devtype) { + case DEV_TYPE_AR5312: + ar5312_eth0_data.macaddr = config-enet0_mac; -+ ar231x_add_ethernet(0, AR531X_ENET0, AR5312_IRQ_ENET0_INTRS, ++ ar231x_add_ethernet(0, AR531X_ENET0, eth0_mii, ++ AR531X_ENET0_MII, AR5312_IRQ_ENET0_INTRS, + ar5312_eth0_data); + + ar5312_eth1_data.macaddr = config-enet1_mac; -+ ar231x_add_ethernet(1, AR531X_ENET1, AR5312_IRQ_ENET1_INTRS, ++ ar231x_add_ethernet(1, AR531X_ENET1, eth1_mii, ++ AR531X_ENET1_MII, AR5312_IRQ_ENET1_INTRS, + ar5312_eth1_data); + + if (!ar231x_board.radio) @@ -1957,11 +1963,11 @@ + */ + case DEV_TYPE_AR2312: + case DEV_TYPE_AR2313: -+ ar5312_eth1_data.phy_base = ar5312_eth0_data.phy_base; + ar5312_eth1_data.reset_phy = ar5312_eth0_data.reset_phy; + ar5312_eth1_data.macaddr = config-enet0_mac; -+ ar231x_add_ethernet(0, AR531X_ENET1, -+ AR5312_IRQ_ENET1_INTRS, ar5312_eth1_data); ++ ar231x_add_ethernet(1, AR531X_ENET1, eth0_mii, ++ AR531X_ENET0_MII, AR5312_IRQ_ENET1_INTRS, ++ ar5312_eth1_data); + + if (!ar231x_board.radio) + return 0; @@ -2126,7 +2132,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,557 @@ +@@ -0,0 +1,556 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive @@ -2409,7 +2415,6 @@ + .reset_clear = ar2315_device_reset_clear, + .reset_mac = AR2315_RESET_ENET0, + .reset_phy = AR2315_RESET_EPHY0, -+ .phy_base = AR2315_ENET0, + .config = ar231x_board, +}; + @@ -2523,8 +2528,8 @@ + ar2315_init_gpio_leds(); + platform_device_register(ar2315_wdt); + platform_device_register(ar2315_spiflash); -+ ar231x_add_ethernet(0,
[OpenWrt-Devel] [PATCH v2 18/18] atheros: update macroses names
Use AR2315_ prefix for macroses specific to AR2315/AR2316/AR2317 chips, use AR5312_ prefix for macroses specific to AR5312/AR2312/AR2313 chips, and use AR231X_ prefix for common macroses. This patch should not cause any functional changes, only make clear which macros is common and which macros is specific. Signed-off-by: Sergey Ryazanov ryazanov@gmail.com --- target/linux/atheros/patches-3.10/100-board.patch | 528 ++--- .../patches-3.10/101-early-printk-support.patch| 2 +- .../atheros/patches-3.10/105-ar2315_pci.patch | 22 +- 3 files changed, 276 insertions(+), 276 deletions(-) diff --git a/target/linux/atheros/patches-3.10/100-board.patch b/target/linux/atheros/patches-3.10/100-board.patch index 611d7cc..4a9f31b 100644 --- a/target/linux/atheros/patches-3.10/100-board.patch +++ b/target/linux/atheros/patches-3.10/100-board.patch @@ -42,7 +42,7 @@ +++ b/arch/mips/ar231x/Platform @@ -0,0 +1,6 @@ +# -+# Atheros AR5312/AR2312 WiSoC ++# Atheros AR531X/AR231X WiSoC +# +platform-$(CONFIG_ATHEROS_AR231X) += ar231x/ +cflags-$(CONFIG_ATHEROS_AR231X)+= -I$(srctree)/arch/mips/include/asm/mach-ar231x @@ -131,7 +131,7 @@ +check_board_data(u8 *flash_limit, u8 *addr, bool broken) +{ + /* config magic found */ -+ if (*((u32 *)addr) == AR531X_BD_MAGIC) ++ if (*((u32 *)addr) == AR231X_BD_MAGIC) + return 1; + + if (!broken) @@ -362,7 +362,7 @@ + */ + +/* -+ * Prom setup file for ar531x ++ * Prom setup file for ar231x + */ + +#include linux/init.h @@ -389,8 +389,8 @@ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/ar231x_platform.h @@ -0,0 +1,83 @@ -+#ifndef __AR531X_PLATFORM_H -+#define __AR531X_PLATFORM_H ++#ifndef __ASM_MACH_AR231X_PLATFORM_H ++#define __ASM_MACH_AR231X_PLATFORM_H + +/* + * This is board-specific data that is stored in a fixed location in flash. @@ -400,7 +400,7 @@ + */ +struct ar231x_boarddata { + u32 magic; /* board data is valid */ -+#define AR531X_BD_MAGIC 0x35333131 /* 5311, for all 531x platforms */ ++#define AR231X_BD_MAGIC 0x35333131 /* 5311, for all 531x/231x platforms */ + u16 cksum; /* checksum (starting with BD_REV 2) */ + u16 rev; /* revision of this struct */ +#define BD_REV 4 @@ -471,12 +471,12 @@ + char *macaddr; +}; + -+#endif /* __AR531X_PLATFORM_H */ ++#endif /* __ASM_MACH_AR231X_PLATFORM_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/cpu-feature-overrides.h @@ -0,0 +1,84 @@ +/* -+ * Atheros SoC specific CPU feature overrides ++ * Atheros AR231x/AR531x SoC specific CPU feature overrides + * + * Copyright (C) 2008 Gabor Juhos juh...@openwrt.org + * @@ -489,11 +489,11 @@ + * by the Free Software Foundation. + * + */ -+#ifndef __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H -+#define __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H ++#ifndef __ASM_MACH_AR231X_CPU_FEATURE_OVERRIDES_H ++#define __ASM_MACH_AR231X_CPU_FEATURE_OVERRIDES_H + +/* -+ * The ATHEROS SoCs have MIPS 4Kc/4KEc core. ++ * The Atheros AR531x/AR231x SoCs have MIPS 4Kc/4KEc core. + */ +#define cpu_has_tlb 1 +#define cpu_has_4kex 1 @@ -558,7 +558,7 @@ +/* #define cpu_dcache_line_size() ? */ +/* #define cpu_icache_line_size() ? */ + -+#endif /* __ASM_MACH_ATHEROS_CPU_FEATURE_OVERRIDES_H */ ++#endif /* __ASM_MACH_AR231X_CPU_FEATURE_OVERRIDES_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h @@ -0,0 +1,79 @@ @@ -571,8 +571,8 @@ + * Copyright (C) 2007 Felix Fietkau n...@openwrt.org + * + */ -+#ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H -+#define __ASM_MACH_GENERIC_DMA_COHERENCE_H ++#ifndef __ASM_MACH_AR231X_DMA_COHERENCE_H ++#define __ASM_MACH_AR231X_DMA_COHERENCE_H + +#define PCI_DMA_OFFSET0x2000 + @@ -640,12 +640,12 @@ +#endif +} + -+#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */ ++#endif /* __ASM_MACH_AR231X_DMA_COHERENCE_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/gpio.h @@ -0,0 +1,30 @@ -+#ifndef _ATHEROS_GPIO_H_ -+#define _ATHEROS_GPIO_H_ ++#ifndef __ASM_MACH_AR231X_GPIO_H ++#define __ASM_MACH_AR231X_GPIO_H + +#include ar231x.h + @@ -662,27 +662,27 @@ +/* Returns IRQ to attach for gpio. Unchecked function */ +static inline int gpio_to_irq(unsigned gpio) +{ -+ return AR531X_GPIO_IRQ(gpio); ++ return AR231X_GPIO_IRQ(gpio); +} + +/* Returns gpio for IRQ attached. Unchecked function */ +static inline int irq_to_gpio(unsigned irq) +{ -+ return irq - AR531X_GPIO_IRQ(0); ++ return irq - AR231X_GPIO_IRQ(0); +} + +#include asm-generic/gpio.h /* cansleep wrappers */ + -+#endif ++#endif/* __ASM_MACH_AR231X_GPIO_H */ --- /dev/null +++ b/arch/mips/include/asm/mach-ar231x/reset.h @@ -0,0 +1,6 @@ -+#ifndef __AR531X_RESET_H -+#define __AR531X_RESET_H ++#ifndef __ASM_MACH_AR231X_RESET_H ++#define __ASM_MACH_AR231X_RESET_H + -+void
Re: [OpenWrt-Devel] [PATCH 00/17] atheros: I/O cleanups
2014-07-14 21:05 GMT+04:00 Sergey Ryazanov ryazanov@gmail.com: 2014-07-14 14:31 GMT+04:00 Karl Palsson ka...@tweak.net.au: I've tried to test this on an ar2317, but the series isn't applying cleanly to today's trunk. I got the first one to succeed, with some fuzz, the second applied cleanly, but the third failed, and I stopped trying. You right. I downloaded patches from patchwork, tried to apply them and got the same result. The explanation was quite simple - I missed one (first) patch. Now I sent v2 with this patch and whole series seems applied cleanly. Karl, could you test this new version? Cheers, Karl P 2014-07-12 17:33 GMT+04:00 Sergey Ryazanov ryazanov@gmail.com: Main goals of this series: * Simplify interface between arch code and SoC drivers * Simplify internal realization of arch code * Make code consistent with mainstream kernel rules and practice Forgot to say, that this series extensively tested with FON2202 (ar2315 based) and D-Link DWL-2100AP (ar2313 based), but tests are not done with AR2317/8 and AR5312, since I have no access to such boards now :( -- BR, Sergey ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel