Re: [OpenWrt-Devel] [RFC] mac80211: update to wireless-testing 2015-03-09

2015-03-12 Thread Bryan Forbes
Hey Daniel,

Very cool! I took a look at bumping hostapd to a newer snapshot from master and 
I gave up because the patch refresh got really hairy and I didn’t have the time 
to figure it out (I barely had time for the mac80211 update). When you say 
“current release” of hostapd, do you mean a newer snapshot of master? The 
newest release that I can see on the hostapd website is 2.3 released on 
2014-10-09 and OpenWRT uses a snapshot of master from 2014-10-25. I just want 
to make sure we’re all on the same page.

 On Mar 10, 2015, at 5:26 PM, Daniel Golle dan...@makrotopia.org wrote:
 
 Hi Bryan,
 
 On Tue, Mar 10, 2015 at 12:15:31PM -0500, Bryan Forbes wrote:
 I have been working on an update to mac80211 for about a month now. I 
 announced it on the developer forums, but it turns out this is the place I 
 should have been talking about it. The initial work I did was to update 
 mac80211 to wireless-testing master-2015-02-09, but since then I have 
 updated to master-2015-03-09. All of the work I have done can be found on 
 github:
 
 https://github.com/bryanforbes/openwrt/tree/bryan-2015-03-09
 
 Nice work! Highly appreciated!
 
 I reckon hostapd should be bumped as well, but that can also be after
 the compat-wireless bump... I already did that locally, but didn't
 yes finally decide on how to package 802.11s and SAE support, i.e.
 have wpad-mesh and wpa_supplicant-mesh with dependency on libopenssl
 and including 802.11 and SAE support, but being otherwise identical
 to their -mini versions. And include SAE support in -full only if
 OpenSSL is the selected SSL provider as the build fails with internal
 crypto.
 See
 http://patchwork.ozlabs.org/patch/435311/
 http://patchwork.ozlabs.org/patch/435312/
 
 A good way would also be to bump hostapd to the current release and
 package the mesh and SAE stuff afterwards...
 
 
 Cheers
 
 
 Daniel
 

--
Bryan Forbes
http://www.reigndropsfall.net

GPG Fingerprint
3D7D B728 713A BB7B B8B1  5B61 3888 17E0 70CA 0F3D



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] lldpd: add support for 'readonly_mode'

2015-03-12 Thread Alexandru Ardelean
Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 package/network/services/lldpd/files/lldpd.init | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/network/services/lldpd/files/lldpd.init 
b/package/network/services/lldpd/files/lldpd.init
index 2b1b223..40f2611 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -24,6 +24,7 @@ start() {
local lldp_class
local lldp_location
local lldp_description
+   local readonly_mode
 
config_load 'lldpd'
config_get_bool enable_cdp 'config' 'enable_cdp' 0
@@ -33,6 +34,7 @@ start() {
config_get lldp_class 'config' 'lldp_class'
config_get lldp_location 'config' 'lldp_location'
config_get lldp_description 'config' 'lldp_description' 
$(find_release_info)
+   config_get_bool readonly_mode 'config' 'readonly_mode' 0
 
local ifaces
config_get ifaces 'config' 'interface'
@@ -50,6 +52,7 @@ start() {
[ $enable_fdp -gt 0 ]  append args '-f'
[ $enable_sonmp -gt 0 ]  append args '-s'
[ $enable_edp -gt 0 ]  append args '-e'
+   [ $readonly_mode -gt 0 ]  append args '-r'
 
mkdir -p /var/run/lldp
chown lldp:lldp /var/run/lldp
-- 
2.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: Fix failsafe switch workaround for RT5350 introduced in r42179.

2015-03-12 Thread John Crispin


On 10/03/2015 20:16, Vittorio G (VittGam) wrote:
 Il 10.03.2015 14:18 John Crispin ha scritto:
 hi

 can you send a version that has the pattern shown below please

 and 0 1 2 3 4 5 6 is wrong, exclude the wan port from the list please.

 John


 
 The problem is that it's not easy to determine what number the LAN or
 WAN port(s) is/are. On many routers a LAN port can be 0, but on the
 HT-TM02 there is only one port and it is 4. So the current 0 6 is
 effectively soft-bricking the HT-TM02 if failsafe is needed and one
 doesn't have a serial adapter... That's why I proposed to just enable
 all ports for failsafe.
 
 board=$(ramips_board_name)

 board_config_update
 ports=0 6
 case $board in
 my_board_name)
 ports=0 1 2 3 4 5 6
 ;;
 esac
 swconfig dev rt305x set enable_vlan 1
 swconfig dev rt305x vlan 1 set ports $ports
 swconfig dev rt305x port 6 set untag 0
 swconfig dev rt305x set apply 1
 vconfig add eth0 1
 
 This needs to be better addressed somehow, without replicating the port
 layout here for every router that does not have port 0 exposed at all.

we can hook this up with the board detect code. i'll put it on my todo
list. might take a bit till i find the time
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] How to Custom admin page on openwrt ?

2015-03-12 Thread Claudio Thomas

On 12.03.2015 08:24, Tymon wrote:

 *Hi all,*

 *   As we all known, the default method to access the router's
 administration web page(Luci)  is to type http://192.168.1.1
 http://192.168.1.1/ on the browser. I am curious about how can the
 router recognize thehttp://192.168.1.1 http://192.168.1.1/as its
 accessible site ?
 *

This is defined in the webserver configuration, like in
/etc/config/uhttpd. By default the server reacts on every request the it
receives, independently what IP the server has (0.0.0.0).

 *   More interesting thing is I used to see someone
 typeadmin.myrouter on browser(just in LAN network, the router did
 not connect WAN to the internet), and he successfully accessed the
 administration web page(Luci) on his openwrt router.
 *

For this you need 3 things:
a) You need a DNS-Server on which you must configure an manage your
domain (like *.myrouter). To run it on your router would be probably the
easiest way.
b) You need make shure that your clients use your DNS-Server to resolve
domainnames to IP-addresses. Normaly this is done be running a
DHCP-Server on your router and configure it that way, so that every
client that receives an IP from it also receive the IP of the DNS server
to use (which should be the IP address from a) )
c) Your clients must be configured to use DHCP server to get a network
and IP configuration.

Doing so your computer (client) will get after boot the
network-configuration (IP-address, network-mask, DNS-server
IP-addresses...) from your DHCP Server. When starting your webbrowser on
your computer and typing http://admin.myrouter; the web-browser will
query the DNS-server. The DNS-server will respond with an IP-address
(like 192.168.1.1). So that your web-browser finally knows to which
ip-address it  will send its HTTP-request. Your OpenWrt router will
receive the request and show you the login-mask.

 *   Thus my question is how can I make the OpenWrt router like him
 ? Do I need to modified the code of cgi ?*

 *   Any hint will be appreciated!*‍

No, you will not need to change the code of the cgi.

Best regards,
Claudio

-- 
Working on OpenWrt CC for Xmodus GSM Router XM1710E
http://www.xmodus-systems.de/openwrt

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


[OpenWrt-Devel] Squid: Configuring Intercept Mode

2015-03-12 Thread Ronaldo Afonso
  Hi,

  I'm trying to configure my Squid with the intercept mode in OpenWRT, but
I checked the /etc/init.d/squid init script and it's preventing me from
inserting a string for option http_port ...


validate_squid_section() {
uci_validate_section squid squid ${1} \
'config_file:string' \
'http_port:port:3128' \
'coredump_dir:string' \
'visible_hostname:string:OpenWrt' \
'pinger_enable:string:off'
}

  How can I configure Squid for intercepting HTTP requests without
clients configuration ?

  I have tried changing 'http_port:port:3128' for 'http_port:string:3128',
but I'm not sure if that is the best or right way to do that.

  Thanks in advance ...

-- 
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] How to Custom admin page on openwrt ?

2015-03-12 Thread Claudio Thomas
On 12.03.2015 09:45, Tymon wrote:

 Thank you for your answer, Claudio Thomas:

   I use the default utility called dnsmasq ( a light-weigh
 dns server and dhcp server) on openwrt 12.09.
   Of course the dhcp-server function is enabled and
 PC-wireless client can get the ip address normally.
   
   Now I can see dns is 192.168.1.1 (just the router) on my
 PC network configuration, thus I need to modify
   the dnsmasq configuration so that it can map the domain
 name (e.g. admin.myrouter.com--192.168.1.1)  I type on browser ?

Hi Tymon,
again: The service that can map from a domain (like admin.myrouter.com)
to an IP-address (like 192.168.1.1) is a DNS-Server (like bind9). In
your case there is probably no DNS-server in the world that knows
admin.myrouter.com. Thats why you don't get the IP to that domain.
Because no server in the world knows this domain YOU must find a
solution so that 1 server in the world knows this domain: your own
DNS-server with a zone file for myrouter.com.

The dnsmasq does only forward and cache the queries, but does not has
the option (so far I know) to manage your own domain. You need to set up
a dnsserver and create a zone file where the mapping for all hostnames
for the domain myrouter.com are defined.

Sorry, but it is not possible to explain how to set up a DNS-server by
mail. But there are many DNS-server howtos on the net (like in the
openwrt wiki http://wiki.openwrt.org/doc/howto/dns.bind). In small
chunks: remove dnsmasq + install binddns-server, enable forwarding, add
a master-zone entry in the named.conf, define your zone file and start
your dns-server (bind).

PS: be carefull when using domain-names that (could) really exist in the
internet. In your case only use *.com domains if this domain belongs to
you. admin.myrouter.com coudl be a bad idea, admin.myrouter would
probably be better.

Best regards,
Claudio

-- 
Working on OpenWrt CC for Xmodus GSM Router XM1710E
http://www.xmodus-systems.de/openwrt

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


Re: [OpenWrt-Devel] [PATCH 1/1] kernel: refined one of 514-yaffs-3.6-use-delayed-work-instead-of-write_super.patch

2015-03-12 Thread John Crispin
the bit which i am missing here is how do you enable YAFFS_HAS_WRITE_SUPER ?

On 02/03/2015 06:11, ngc wrote:
 Modified 514-yaffs-3.6-use-delayed-work-instead-of-write_super.patch
 which was included old trunk, to fit the current trunk kernel.
 This needs to support the behavior when yaffs_auto_checkpoint is set '2',
 in 3.6.x and later.
 
 I got worked with linux-3.14.x on ARM.
 
 signed-off-by: n...@ff.iij4u.or.jp
 ――
 --- 
 a/target/linux/generic/patches-3.14/514-yaffs-3.6-use-delayed-work-instead-of-write_super.patch
1970-01-01 09:00:00.0 +0900
 +++ 
 b/target/linux/generic/patches-3.14/514-yaffs-3.6-use-delayed-work-instead-of-write_super.patch
2015-03-02 13:40:46.0 +0900
 @@ -0,0 +1,147 @@
 +diff -Nurp a/fs/yaffs2/yaffs_linux.h b/fs/yaffs2/yaffs_linux.h
 +--- a/fs/yaffs2/yaffs_linux.h2015-01-07 11:47:43.0 +0900
  b/fs/yaffs2/yaffs_linux.h2015-03-02 13:38:08.0 +0900
 +@@ -18,6 +18,10 @@
 + 
 + #include yportenv.h
 + 
 ++#ifndef YAFFS_HAS_WRITE_SUPER
 ++#include linux/workqueue.h
 ++#endif
 ++
 + struct yaffs_linux_context {
 + struct list_head context_list;  /* List of these we have mounted */
 + struct yaffs_dev *dev;
 +@@ -32,6 +36,9 @@ struct yaffs_linux_context {
 + struct task_struct *readdir_process;
 + unsigned mount_id;
 + int dirty;
 ++#ifndef YAFFS_HAS_WRITE_SUPER
 ++struct delayed_work sb_sync_dwork;  /* superblock write-out work */
 ++#endif
 + };
 + 
 + #define yaffs_dev_to_lc(dev) ((struct yaffs_linux_context 
 *)((dev)-os_context))
 +diff -Nurp a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c
 +--- a/fs/yaffs2/yaffs_vfs.c  2015-02-26 09:41:02.0 +0900
  b/fs/yaffs2/yaffs_vfs.c  2015-03-02 13:35:59.0 +0900
 +@@ -357,9 +357,72 @@ static inline void i_gid_write(struct in
 + }
 + #endif
 + 
 ++
 ++#ifdef YAFFS_HAS_WRITE_SUPER
 ++
 ++static inline void yaffs_init_sb_sync_dwork(struct yaffs_LinuxContext *ylc) 
 {}
 ++static inline void yaffs_cancel_sb_sync_dwork(struct super_block *sb) {}
 ++
 ++#else   /* YAFFS_HAS_WRITE_SUPER */
 ++
 ++#if (LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 17))
 ++static void yaffs_write_super(struct super_block *sb);
 ++#else
 ++static int yaffs_write_super(struct super_block *sb);
 ++#endif
 ++
 ++/* this is defined in mm/page-writeback.c */
 ++extern unsigned int dirty_writeback_interval;
 ++
 ++static inline struct yaffs_linux_context *
 ++yaffs_sb_to_ylc(struct super_block *sb)
 ++{
 ++struct yaffs_dev *ydev;
 ++struct yaffs_linux_context *ylc;
 ++
 ++ydev = yaffs_super_to_dev(sb);
 ++ylc = yaffs_dev_to_lc(ydev);
 ++return ylc;
 ++}
 ++
 ++static inline struct super_block *yaffs_work_to_sb(struct work_struct *work)
 ++{
 ++struct delayed_work *dwork;
 ++struct yaffs_linux_context *ylc;
 ++
 ++dwork = container_of(work, struct delayed_work, work);
 ++ylc = container_of(dwork, struct yaffs_linux_context, sb_sync_dwork);
 ++return ylc-super;
 ++}
 ++
 ++static void yaffs_sb_sync_dwork_func(struct work_struct *work)
 ++{
 ++struct super_block *sb = yaffs_work_to_sb(work);
 ++
 ++yaffs_write_super(sb);
 ++}
 ++
 ++static void yaffs_init_sb_sync_dwork(struct yaffs_linux_context *ylc)
 ++{
 ++INIT_DELAYED_WORK(ylc-sb_sync_dwork, yaffs_sb_sync_dwork_func);
 ++}
 ++
 ++static void yaffs_cancel_sb_sync_dwork(struct super_block *sb)
 ++{
 ++struct yaffs_linux_context *ylc = yaffs_sb_to_ylc(sb);
 ++
 ++cancel_delayed_work_sync(ylc-sb_sync_dwork);
 ++}
 ++
 ++#endif  /* YAFFS_HAS_WRITE_SUPER */
 ++
 ++
 + static void yaffs_set_super_dirty_val(struct yaffs_dev *dev, int val)
 + {
 + struct yaffs_linux_context *lc = yaffs_dev_to_lc(dev);
 ++#ifndef YAFFS_HAS_WRITE_SUPER
 ++int prev_dirty = lc-dirty;
 ++#endif
 + 
 + if (lc)
 + lc-dirty = val;
 +@@ -372,6 +435,11 @@ static void yaffs_set_super_dirty_val(st
 + sb-s_dirt = val;
 + }
 + #endif
 ++#ifndef YAFFS_HAS_WRITE_SUPER
 ++if ( val  (val != prev_dirty) )
 ++queue_delayed_work(system_long_wq, lc-sb_sync_dwork,
 ++   msecs_to_jiffies( dirty_writeback_interval * 10 ));
 ++#endif
 + 
 + }
 + 
 +@@ -2255,6 +2323,8 @@ static void yaffs_put_super(struct super
 + 
 + yaffs_flush_super(sb, 1);
 + 
 ++yaffs_cancel_sb_sync_dwork(sb);
 ++
 + yaffs_deinitialise(dev);
 + 
 + yaffs_gross_unlock(dev);
 +@@ -2570,8 +2640,6 @@ static int yaffs_do_sync_fs(struct super
 + return 0;
 + }
 + 
 +-
 +-#ifdef YAFFS_HAS_WRITE_SUPER
 + #if (LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 17))
 + static void yaffs_write_super(struct super_block *sb)
 + #else
 +@@ -2590,7 +2658,6 @@ static int yaffs_write_super(struct supe
 + return 0;
 + #endif
 + }
 +-#endif
 + 
 + #if (LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 17))
 + static int yaffs_sync_fs(struct super_block *sb, int wait)
 +@@ -2883,6 +2950,8 @@ static struct super_block *yaffs_interna
 + context-dev = dev;
 + 

Re: [OpenWrt-Devel] [PATCH] uClibc: fix syscall() for syscalls with 6 arguments on PowerPC

2015-03-12 Thread John Crispin
i bet you had a lot of fun tracking down this one :)

i've just added it to my local queue


On 11/03/2015 20:27, Matthias Schiffer wrote:
 Patch from the uClibc master.
 
 Fixes the package fastd on PowerPC.
 
 Signed-off-by: Matthias Schiffer mschif...@universe-factory.net
 ---
  toolchain/uClibc/patches-0.9.33.2/470-powerpc_syscall6.patch | 10 ++
  1 file changed, 10 insertions(+)
  create mode 100644 
 toolchain/uClibc/patches-0.9.33.2/470-powerpc_syscall6.patch
 
 diff --git a/toolchain/uClibc/patches-0.9.33.2/470-powerpc_syscall6.patch 
 b/toolchain/uClibc/patches-0.9.33.2/470-powerpc_syscall6.patch
 new file mode 100644
 index 000..9511dcc
 --- /dev/null
 +++ b/toolchain/uClibc/patches-0.9.33.2/470-powerpc_syscall6.patch
 @@ -0,0 +1,10 @@
 +--- a/libc/sysdeps/linux/powerpc/syscall.S
  b/libc/sysdeps/linux/powerpc/syscall.S
 +@@ -30,6 +30,7 @@ syscall:
 + mr 5,6
 + mr 6,7
 + mr 7,8
 ++mr 8,9
 + sc
 + bnslr;
 + 
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] 回复: How to Custom admin page on openwrt ?

2015-03-12 Thread Ben Mulvihill
Surely it is possible to do this using dnsmasq? I have something
like this in my /etc/config/dhcp file:

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
list rebind_domain 'site2'
list server '/site2/10.121.1.1'
option local '/site1/'
option domain 'site'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'

My local domain is 'site1', so I can access my router
in a browser at the address 'myrouter.site1' , which
it I have understood correctly is what you are 
trying to do, right?
(Note that I also have a vpn to another local network
with domain 'site2', and can access the router there
at 'myotherrouter.site2')

Check the various configuration options I use in the 
dnsmasq documentation, because it is some time since
I set this up and I don't remember the details.
The 'server' and 'rebind_domain' are for the vpn,
so you shouldn't need those.

Or have I misunderstood the question?

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


[OpenWrt-Devel] Ubiquiti AirOS7 is based on openwrt r40432

2015-03-12 Thread Nemesis
Hi all,

I went at this URL:
https://www.ubnt.com/download/?group=nanobeam-ac

Clicked on GPL Archive, downloaded it, extracted it, and took a look
in it and found out a readme file which states:

that the archive contains all GPL related sources and modifications made
by Ubiquiti Networks on original OpenWRT-r40432 sources.

So out of pure curiosity, I used some git trickeries and hacks to make a
clean diff of the two, then decided to upload it on github so everyone
can see it easily.

Here it is:
https://github.com/ninuxorg/openwrt-modified-by-ubiquiti/compare/0f06f302caa1d53bf0e1550aaadf738166c53c26...master

Anybody else has studied this code and found out anything interesting?

Best regards
Federico Capoano
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] toolchain: The glorious return of glibc, ver 2.21

2015-03-12 Thread John Crispin
Hi Jeff,

i am merging the whole lot now with a small change

On 11/03/2015 18:17, Jeff Waugh wrote:
   prompt Preferred standard C++ library
 - default USE_LIBSTDCXX if USE_EGLIBC
 + default USE_LIBSTDCXX if USE_GLIBC || USE_EGLIBC

i will make eglibc select USE_GLIBC and then change all USE_EGLIBC
instances to USE_GLIBC which will make it easier to drop eglibc later on.
John
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Ubiquiti AirOS7 is based on openwrt r40432

2015-03-12 Thread Bastian Bittorf
* Nemesis neme...@ninux.org [12.03.2015 14:08]:
 Anybody else has studied this code and found out anything interesting?

8-)))

see, they use an acient php from:
http://museum.php.net/php2/

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


[OpenWrt-Devel] [PATCH] lldpd: make LLDP-MED, DOT1 and DOT3 extensions disable-able

2015-03-12 Thread Alexandru Ardelean
The names for the config options were taken from lldpd's
configure.ac file.

Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 package/network/services/lldpd/Config.in | 16 
 package/network/services/lldpd/Makefile  |  3 +++
 2 files changed, 19 insertions(+)

diff --git a/package/network/services/lldpd/Config.in 
b/package/network/services/lldpd/Config.in
index c7d4795..a416490 100644
--- a/package/network/services/lldpd/Config.in
+++ b/package/network/services/lldpd/Config.in
@@ -21,8 +21,24 @@ config LLDPD_WITH_SONMP
default y
prompt Enable support for the SynOptics Network Management Protocol
 
+config LLDPD_WITH_LLDPMED
+   bool
+   prompt Enable LLDP-MED extension
+   default y
+
+config LLDPD_WITH_DOT1
+   bool
+   prompt Enable Dot1 extension (VLAN stuff)
+   default y
+
+config LLDPD_WITH_DOT3
+   bool
+   prompt Enable Dot3 extension (PHY stuff)
+   default y
+
 config LLDPD_WITH_JSON
bool
prompt Enable JSON output for the LLDP Command-Line Interface
default n
+
 endmenu
diff --git a/package/network/services/lldpd/Makefile 
b/package/network/services/lldpd/Makefile
index 5a1921e..6f97f45 100644
--- a/package/network/services/lldpd/Makefile
+++ b/package/network/services/lldpd/Makefile
@@ -85,6 +85,9 @@ CONFIGURE_ARGS += \
$(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
$(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
$(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
+   $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
+   $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
+   $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
$(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
$(if $(CONFIG_LLDPD_WITH_JSON),--with-json=json-c)
 
-- 
2.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Why OpenWrt sucks?

2015-03-12 Thread José Vázquez
2015-03-09 23:28 GMT+01:00, David Lang da...@lang.hm:
 On Mon, 9 Mar 2015, José Vázquez wrote:

 OpenWRT is a linux distro oriented to networking so the kernel and
 drivers are important, but you must not forget that the init process
 (procd and related after AA) is one of the cores of this distro and
 makes it work. The most relevant packages are oriented to networking,
 but with the feeds you can make anything that you want, making it very
 versatile.
 Also we must take in mind that OpenWRT works with GPL drivers and code
 (only few are proprietary); I think that one of the main advantages of
 use them is that anybody can contribute, and IMHO, are easy to
 maintain.
 One of the performance penalties come with the network drivers: while
 proprietary drivers are tightly coupled with the hardware, the drivers
 developed by OpenWRT guys and collaborators should not be so
 complicated because when the kernel version is changed they can
 generate a lot of problems and headaches, while more generic drivers
 do not take advantage of all the hardware features, overloading the
 cpu with tasks that in stock firmwares are managed by specific
 subsystems that are faster for those specific tasks.

 there is no reason why the open drivers need to be slower than the
 proprietary
 ones. History has shown that with sufficient information, the open drivers
 end
 up being as fast, or faster than the proprietary ones. But it does take time
 and
 cooperation with the manufacturer to do this with the latest hardware.

 Open drivers can be modified along with the kernel to take advantage of the

 newest features in the kernel. Proprietary drivers are either written for
 one
 specific kernel, or with a shim layer that limits how well the driver can
 work
 with future kernels.

 David Lang

Sorry, big mistake. :(
You are right, open source drivers do not mean bad and/or incomplete drivers.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ipset: add ipmark support

2015-03-12 Thread Jeroen Louwes
Below you'll find a patch to add ipmark module support to ipset.
Changeset 44671 already bumped ipset to version 6.24, but it's still
compiled without ipmark support. This is a requirement for mwan3 v1.6.

Signed-off-by: Jeroen Louwes jeroen.lou...@gmail.com

---

diff --git a/package/network/utils/ipset/Makefile
b/package/network/utils/ipset/Makefile
index 9a8f346..14a47af 100644
--- a/package/network/utils/ipset/Makefile
+++ b/package/network/utils/ipset/Makefile
@@ -45,6 +45,7 @@ IPSET_MODULES:= \
ipset/ip_set_bitmap_ipmac \
ipset/ip_set_bitmap_port \
ipset/ip_set_hash_ip \
+   ipset/ip_set_hash_ipmark \
ipset/ip_set_hash_ipport \
ipset/ip_set_hash_ipportip \
ipset/ip_set_hash_ipportnet \
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 26/33] atheros: v3.18: cleanup includes

2015-03-12 Thread Sergey Ryazanov
Remove odd and add missed includes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 49 +++---
 .../patches-3.18/101-early-printk-support.patch|  3 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |  4 +-
 .../atheros/patches-3.18/107-ar5312_gpio.patch | 10 ++---
 .../atheros/patches-3.18/108-ar2315_gpio.patch | 16 +++
 .../atheros/patches-3.18/110-ar2313_ethernet.patch | 24 +--
 .../linux/atheros/patches-3.18/120-spiflash.patch  |  4 +-
 .../linux/atheros/patches-3.18/130-watchdog.patch  |  4 +-
 .../atheros/patches-3.18/330-board_leds.patch  | 14 +++
 9 files changed, 53 insertions(+), 75 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 643014f..14ba5c3 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -77,7 +77,7 @@
 +obj-$(CONFIG_SOC_AR2315) += ar2315.o
 --- /dev/null
 +++ b/arch/mips/ath25/board.c
-@@ -0,0 +1,244 @@
+@@ -0,0 +1,235 @@
 +/*
 + * 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
@@ -89,17 +89,8 @@
 + * Copyright (C) 2006-2009 Felix Fietkau n...@openwrt.org
 + */
 +
-+#include generated/autoconf.h
 +#include linux/init.h
-+#include linux/module.h
-+#include linux/types.h
-+#include linux/string.h
-+#include linux/platform_device.h
-+#include linux/kernel.h
-+#include linux/random.h
-+#include linux/etherdevice.h
-+#include linux/irq.h
-+#include linux/io.h
++#include linux/interrupt.h
 +#include asm/irq_cpu.h
 +#include asm/reboot.h
 +#include asm/bootinfo.h
@@ -1102,7 +1093,7 @@
 +#endif /* __ASM_MACH_ATH25_AR2315_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312_regs.h
-@@ -0,0 +1,225 @@
+@@ -0,0 +1,223 @@
 +/*
 + * 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
@@ -1116,8 +1107,6 @@
 +#ifndef __ASM_MACH_ATH25_AR5312_REGS_H
 +#define __ASM_MACH_ATH25_AR5312_REGS_H
 +
-+#include asm/addrspace.h
-+
 +/*
 + * IRQs
 + */
@@ -1330,7 +1319,7 @@
 +#endif/* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,401 @@
+@@ -0,0 +1,396 @@
 +/*
 + * 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
@@ -1347,22 +1336,17 @@
 + * Platform devices for Atheros SoCs
 + */
 +
-+#include generated/autoconf.h
 +#include linux/init.h
-+#include linux/module.h
-+#include linux/types.h
-+#include linux/string.h
-+#include linux/mtd/physmap.h
-+#include linux/platform_device.h
 +#include linux/kernel.h
 +#include linux/bitops.h
 +#include linux/irqdomain.h
++#include linux/interrupt.h
++#include linux/platform_device.h
++#include linux/mtd/physmap.h
 +#include linux/reboot.h
 +#include asm/bootinfo.h
 +#include asm/reboot.h
 +#include asm/time.h
-+#include linux/irq.h
-+#include linux/io.h
 +
 +#include ath25_platform.h
 +
@@ -1734,7 +1718,7 @@
 +}
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315.c
-@@ -0,0 +1,312 @@
+@@ -0,0 +1,307 @@
 +/*
 + * 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
@@ -1751,21 +1735,16 @@
 + * Platform devices for Atheros SoCs
 + */
 +
-+#include generated/autoconf.h
 +#include linux/init.h
-+#include linux/module.h
-+#include linux/types.h
-+#include linux/string.h
-+#include linux/platform_device.h
 +#include linux/kernel.h
 +#include linux/bitops.h
 +#include linux/irqdomain.h
++#include linux/interrupt.h
++#include linux/platform_device.h
 +#include linux/reboot.h
 +#include asm/bootinfo.h
 +#include asm/reboot.h
 +#include asm/time.h
-+#include linux/irq.h
-+#include linux/io.h
 +
 +#include ath25_platform.h
 +
@@ -2127,10 +2106,12 @@
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.h
-@@ -0,0 +1,41 @@
+@@ -0,0 +1,43 @@
 +#ifndef __ATH25_DEVICES_H
 +#define __ATH25_DEVICES_H
 +
++#include linux/cpu.h
++
 +#define ATH25_REG_MS(_val, _field)(((_val)  _field##_M)  _field##_S)
 +
 +#define ATH25_IRQ_CPU_CLOCK   (MIPS_CPU_IRQ_BASE + 7) /* C0_CAUSE: 0x8000 */
@@ -2171,11 +2152,9 @@
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.c
-@@ -0,0 +1,127 @@
+@@ -0,0 +1,125 @@
 +#include linux/kernel.h
 +#include linux/init.h
-+#include linux/serial.h
-+#include linux/serial_core.h
 +#include linux/serial_8250.h
 +#include linux/platform_device.h
 +#include asm/bootinfo.h
diff --git a/target/linux/atheros/patches-3.18/101-early-printk-support.patch 
b/target/linux/atheros/patches-3.18/101-early-printk-support.patch
index 6ad1455..d193031 100644
--- a/target/linux/atheros/patches-3.18/101-early-printk-support.patch
+++ 

[OpenWrt-Devel] [PATCH 23/33] atheros: v3.18: switch to IRQ domain

2015-03-12 Thread Sergey Ryazanov
Rework MISC and PCI IRQ controllers code to use IRQ domains and bitops.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/config-3.18   |   1 +
 target/linux/atheros/patches-3.18/100-board.patch  | 232 -
 .../patches-3.18/101-early-printk-support.patch|   2 +-
 .../atheros/patches-3.18/102-ar5312_gpio.patch |   4 +-
 .../atheros/patches-3.18/103-ar2315_gpio.patch |  14 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |  79 ---
 6 files changed, 196 insertions(+), 136 deletions(-)

diff --git a/target/linux/atheros/config-3.18 b/target/linux/atheros/config-3.18
index 77d1498..a275a6f 100644
--- a/target/linux/atheros/config-3.18
+++ b/target/linux/atheros/config-3.18
@@ -87,6 +87,7 @@ CONFIG_IMAGE_CMDLINE_HACK=y
 CONFIG_INITRAMFS_SOURCE=
 CONFIG_IP17XX_PHY=y
 CONFIG_IRQ_CPU=y
+CONFIG_IRQ_DOMAIN=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_WORK=y
 CONFIG_LEDS_GPIO=y
diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 9e4434c..7dd0b7a 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
-@@ -96,6 +96,19 @@ config AR7
+@@ -96,6 +96,20 @@ config AR7
  Support for the Texas Instruments AR7 System-on-a-Chip
  family: TNETD7100, 7200 and 7300.
  
@@ -10,6 +10,7 @@
 +  select CSRC_R4K
 +  select DMA_NONCOHERENT
 +  select IRQ_CPU
++  select IRQ_DOMAIN
 +  select SYS_HAS_CPU_MIPS32_R1
 +  select SYS_SUPPORTS_BIG_ENDIAN
 +  select SYS_SUPPORTS_32BIT_KERNEL
@@ -20,7 +21,7 @@
  config ATH79
bool Atheros AR71XX/AR724X/AR913X based boards
select ARCH_REQUIRE_GPIOLIB
-@@ -834,6 +847,7 @@ config MIPS_PARAVIRT
+@@ -834,6 +848,7 @@ config MIPS_PARAVIRT
  
  endchoice
  
@@ -668,15 +669,15 @@
 +/*
 + * Miscellaneous interrupts, which share IP2.
 + */
-+#define AR2315_MISC_IRQ_UART0 (AR231X_MISC_IRQ_BASE+0)
-+#define AR2315_MISC_IRQ_I2C_RSVD  (AR231X_MISC_IRQ_BASE+1)
-+#define AR2315_MISC_IRQ_SPI   (AR231X_MISC_IRQ_BASE+2)
-+#define AR2315_MISC_IRQ_AHB   (AR231X_MISC_IRQ_BASE+3)
-+#define AR2315_MISC_IRQ_APB   (AR231X_MISC_IRQ_BASE+4)
-+#define AR2315_MISC_IRQ_TIMER (AR231X_MISC_IRQ_BASE+5)
-+#define AR2315_MISC_IRQ_GPIO  (AR231X_MISC_IRQ_BASE+6)
-+#define AR2315_MISC_IRQ_WATCHDOG  (AR231X_MISC_IRQ_BASE+7)
-+#define AR2315_MISC_IRQ_IR_RSVD   (AR231X_MISC_IRQ_BASE+8)
++#define AR2315_MISC_IRQ_UART0 0
++#define AR2315_MISC_IRQ_I2C_RSVD  1
++#define AR2315_MISC_IRQ_SPI   2
++#define AR2315_MISC_IRQ_AHB   3
++#define AR2315_MISC_IRQ_APB   4
++#define AR2315_MISC_IRQ_TIMER 5
++#define AR2315_MISC_IRQ_GPIO  6
++#define AR2315_MISC_IRQ_WATCHDOG  7
++#define AR2315_MISC_IRQ_IR_RSVD   8
 +#define AR2315_MISC_IRQ_COUNT 9
 +
 +/*
@@ -1149,15 +1150,15 @@
 +/*
 + * Miscellaneous interrupts, which share IP6.
 + */
-+#define AR5312_MISC_IRQ_TIMER (AR231X_MISC_IRQ_BASE+0)
-+#define AR5312_MISC_IRQ_AHB_PROC  (AR231X_MISC_IRQ_BASE+1)
-+#define AR5312_MISC_IRQ_AHB_DMA   (AR231X_MISC_IRQ_BASE+2)
-+#define AR5312_MISC_IRQ_GPIO  (AR231X_MISC_IRQ_BASE+3)
-+#define AR5312_MISC_IRQ_UART0 (AR231X_MISC_IRQ_BASE+4)
-+#define AR5312_MISC_IRQ_UART0_DMA (AR231X_MISC_IRQ_BASE+5)
-+#define AR5312_MISC_IRQ_WATCHDOG  (AR231X_MISC_IRQ_BASE+6)
-+#define AR5312_MISC_IRQ_LOCAL (AR231X_MISC_IRQ_BASE+7)
-+#define AR5312_MISC_IRQ_SPI   (AR231X_MISC_IRQ_BASE+8)
++#define AR5312_MISC_IRQ_TIMER 0
++#define AR5312_MISC_IRQ_AHB_PROC  1
++#define AR5312_MISC_IRQ_AHB_DMA   2
++#define AR5312_MISC_IRQ_GPIO  3
++#define AR5312_MISC_IRQ_UART0 4
++#define AR5312_MISC_IRQ_UART0_DMA 5
++#define AR5312_MISC_IRQ_WATCHDOG  6
++#define AR5312_MISC_IRQ_LOCAL 7
++#define AR5312_MISC_IRQ_SPI   8
 +#define AR5312_MISC_IRQ_COUNT 9
 +
 +/*
@@ -1353,7 +1354,7 @@
 +#endif/* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,474 @@
+@@ -0,0 +1,492 @@
 +/*
 + * 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
@@ -1378,6 +1379,8 @@
 +#include linux/mtd/physmap.h
 +#include linux/platform_device.h
 +#include linux/kernel.h
++#include linux/bitops.h
++#include linux/irqdomain.h
 +#include linux/reboot.h
 +#include linux/leds.h
 +#include linux/gpio.h
@@ -1394,6 +1397,7 @@
 +#include ar5312_regs.h
 +
 +static void __iomem *ar5312_rst_base;
++static struct irq_domain *ar5312_misc_irq_domain;
 +
 +static inline u32 ar5312_rst_reg_read(u32 reg)
 +{
@@ -1435,40 +1439,36 @@
 +
 +static void ar5312_misc_irq_handler(unsigned irq, struct 

[OpenWrt-Devel] [PATCH 21/33] atheros: v3.18: remap flash for boardconfig parsing

2015-03-12 Thread Sergey Ryazanov
Rework boardconfig handling code to honestly remap flash memory region.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 137 ++---
 .../atheros/patches-3.18/102-ar5312_gpio.patch |   2 +-
 .../atheros/patches-3.18/103-ar2315_gpio.patch |  10 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |   2 +-
 4 files changed, 74 insertions(+), 77 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index c0e935e..7ba8153 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -77,7 +77,7 @@
 +obj-$(CONFIG_SOC_AR2315) += ar2315.o
 --- /dev/null
 +++ b/arch/mips/ath25/board.c
-@@ -0,0 +1,234 @@
+@@ -0,0 +1,244 @@
 +/*
 + * 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
@@ -112,57 +112,55 @@
 +
 +void (*ath25_irq_dispatch)(void);
 +
-+static inline bool check_radio_magic(u8 *addr)
++static inline bool check_radio_magic(const void __iomem *addr)
 +{
 +  addr += 0x7a; /* offset for flash magic */
-+  return (addr[0] == 0x5a)  (addr[1] == 0xa5);
++  return (__raw_readb(addr) == 0x5a)  (__raw_readb(addr + 1) == 0xa5);
 +}
 +
-+static inline bool check_notempty(u8 *addr)
++static inline bool check_notempty(const void __iomem *addr)
 +{
-+  return *(u32 *)addr != 0x;
++  return __raw_readl(addr) != 0x;
 +}
 +
-+static inline bool check_board_data(u8 *flash_limit, u8 *addr, bool broken)
++static inline bool check_board_data(const void __iomem *addr, bool broken)
 +{
 +  /* config magic found */
-+  if (*((u32 *)addr) == ATH25_BD_MAGIC)
++  if (__raw_readl(addr) == ATH25_BD_MAGIC)
 +  return true;
 +
 +  if (!broken)
 +  return false;
 +
++  /* broken board data detected, use radio data to find the
++   * offset, user will fix this */
++
++  if (check_radio_magic(addr + 0x1000))
++  return true;
 +  if (check_radio_magic(addr + 0xf8))
-+  ath25_board.radio = addr + 0xf8;
-+  if ((addr  flash_limit + 0x1) 
-+  check_radio_magic(addr + 0x1))
-+  ath25_board.radio = addr + 0x1;
-+
-+  if (ath25_board.radio) {
-+  /* broken board data detected, use radio data to find the
-+   * offset, user will fix this */
 +  return true;
-+  }
 +
 +  return false;
 +}
 +
-+static u8 * __init find_board_config(u8 *flash_limit, bool broken)
++static const void __iomem * __init find_board_config(const void __iomem 
*limit,
++   const bool broken)
 +{
-+  u8 *addr;
-+  u8 *begin = flash_limit - 0x1000;
-+  u8 *end = flash_limit - 0x3;
++  const void __iomem *addr;
++  const void __iomem *begin = limit - 0x1000;
++  const void __iomem *end = limit - 0x3;
 +
 +  for (addr = begin; addr = end; addr -= 0x1000)
-+  if (check_board_data(flash_limit, addr, broken))
++  if (check_board_data(addr, broken))
 +  return addr;
 +
 +  return NULL;
 +}
 +
-+static u8 * __init find_radio_config(u8 *flash_limit, u8 *bcfg)
++static const void __iomem * __init find_radio_config(const void __iomem 
*limit,
++   const void __iomem *bcfg)
 +{
-+  u8 *rcfg, *begin, *end;
++  const void __iomem *rcfg, *begin, *end;
 +
 +  /*
 +   * Now find the start of Radio Configuration data, using heuristics:
@@ -170,36 +168,44 @@
 +   * at a time until we find non-0x.
 +   */
 +  begin = bcfg + 0x1000;
-+  end = flash_limit;
++  end = limit;
 +  for (rcfg = begin; rcfg  end; rcfg += 0x1000)
 +  if (check_notempty(rcfg)  check_radio_magic(rcfg))
 +  return rcfg;
 +
 +  /* AR2316 relocates radio config to new location */
 +  begin = bcfg + 0xf8;
-+  end = flash_limit - 0x1000 + 0xf8;
++  end = limit - 0x1000 + 0xf8;
 +  for (rcfg = begin; rcfg  end; rcfg += 0x1000)
 +  if (check_notempty(rcfg)  check_radio_magic(rcfg))
 +  return rcfg;
 +
-+  pr_warn(WARNING: Could not find Radio Configuration data\n);
-+
 +  return NULL;
 +}
 +
-+int __init ath25_find_config(u8 *flash_limit)
++/*
++ * NB: Search region size could be larger than the actual flash size,
++ * but this shouldn't be a problem here, because the flash
++ * will simply be mapped multiple times.
++ */
++int __init ath25_find_config(phys_addr_t base, unsigned long size)
 +{
++  const void __iomem *flash_base, *flash_limit;
 +  struct ath25_boarddata *config;
 +  unsigned int rcfg_size;
 +  int broken_boarddata = 0;
-+  u8 *bcfg, *rcfg;
++  const void __iomem 

[OpenWrt-Devel] [PATCH 01/33] atheros: add v3.18 support

2015-03-12 Thread Sergey Ryazanov
Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/{config-3.14 = config-3.18}  | 10 +++---
 .../atheros/{patches-3.14 = patches-3.18}/100-board.patch |  4 ++--
 .../101-early-printk-support.patch |  2 +-
 .../{patches-3.14 = patches-3.18}/102-ar5312_gpio.patch   |  4 ++--
 .../{patches-3.14 = patches-3.18}/103-ar2315_gpio.patch   |  4 ++--
 .../{patches-3.14 = patches-3.18}/105-ar2315_pci.patch|  2 +-
 .../{patches-3.14 = patches-3.18}/110-ar2313_ethernet.patch   |  0
 .../atheros/{patches-3.14 = patches-3.18}/120-spiflash.patch  |  8 
 .../atheros/{patches-3.14 = patches-3.18}/130-watchdog.patch  |  4 ++--
 .../140-redboot_boardconfig.patch  |  0
 .../141-redboot_partition_scan.patch   |  0
 .../142-redboot_various_erase_size_fix.patch   |  0
 .../{patches-3.14 = patches-3.18}/210-reset_button.patch  |  0
 .../220-enet_micrel_workaround.patch   |  0
 14 files changed, 21 insertions(+), 17 deletions(-)
 copy target/linux/atheros/{config-3.14 = config-3.18} (94%)
 copy target/linux/atheros/{patches-3.14 = patches-3.18}/100-board.patch (99%)
 copy target/linux/atheros/{patches-3.14 = 
patches-3.18}/101-early-printk-support.patch (97%)
 copy target/linux/atheros/{patches-3.14 = patches-3.18}/102-ar5312_gpio.patch 
(98%)
 copy target/linux/atheros/{patches-3.14 = patches-3.18}/103-ar2315_gpio.patch 
(98%)
 copy target/linux/atheros/{patches-3.14 = patches-3.18}/105-ar2315_pci.patch 
(99%)
 copy target/linux/atheros/{patches-3.14 = 
patches-3.18}/110-ar2313_ethernet.patch (100%)
 copy target/linux/atheros/{patches-3.14 = patches-3.18}/120-spiflash.patch 
(98%)
 copy target/linux/atheros/{patches-3.14 = patches-3.18}/130-watchdog.patch 
(98%)
 copy target/linux/atheros/{patches-3.14 = 
patches-3.18}/140-redboot_boardconfig.patch (100%)
 copy target/linux/atheros/{patches-3.14 = 
patches-3.18}/141-redboot_partition_scan.patch (100%)
 copy target/linux/atheros/{patches-3.14 = 
patches-3.18}/142-redboot_various_erase_size_fix.patch (100%)
 copy target/linux/atheros/{patches-3.14 = 
patches-3.18}/210-reset_button.patch (100%)
 copy target/linux/atheros/{patches-3.14 = 
patches-3.18}/220-enet_micrel_workaround.patch (100%)

diff --git a/target/linux/atheros/config-3.14 b/target/linux/atheros/config-3.18
similarity index 94%
copy from target/linux/atheros/config-3.14
copy to target/linux/atheros/config-3.18
index 7df31e9..f795430 100644
--- a/target/linux/atheros/config-3.14
+++ b/target/linux/atheros/config-3.18
@@ -4,6 +4,7 @@ CONFIG_AR8216_PHY=y
 CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
 CONFIG_ARCH_DISCARD_MEMBLOCK=y
 CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+# CONFIG_ARCH_HAS_SG_CHAIN is not set
 CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
@@ -25,6 +26,7 @@ CONFIG_CPU_HAS_SYNC=y
 CONFIG_CPU_MIPS32=y
 CONFIG_CPU_MIPS32_R1=y
 CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
 CONFIG_CPU_R4K_CACHE_TLB=y
 CONFIG_CPU_R4K_FPU=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
@@ -49,12 +51,14 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_HARDWARE_WATCHPOINTS=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
+CONFIG_HAS_IOPORT_MAP=y
 # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
 CONFIG_HAVE_ARCH_JUMP_LABEL=y
 CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
 CONFIG_HAVE_ARCH_TRACEHOOK=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_BPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_C_RECORDMCOUNT=y
@@ -62,11 +66,11 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
 CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
 CONFIG_HAVE_DMA_API_DEBUG=y
 CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
 CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_IDE=y
 CONFIG_HAVE_MEMBLOCK=y
@@ -91,7 +95,6 @@ CONFIG_MIPS=y
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_MIPS_MACHINE is not set
-CONFIG_MIPS_MT_DISABLED=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MTD_AR2315=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -106,6 +109,7 @@ CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_AR231X=y
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+# CONFIG_NO_IOPORT_MAP is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_PCI=y
 CONFIG_PCI_AR2315=y
diff --git a/target/linux/atheros/patches-3.14/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
similarity index 99%
copy from target/linux/atheros/patches-3.14/100-board.patch
copy to target/linux/atheros/patches-3.18/100-board.patch
index 32b6dc8..1dba78d 100644
--- a/target/linux/atheros/patches-3.14/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -1,6 +1,6 @@
 --- 

[OpenWrt-Devel] [PATCH 31/33] atheros: remove odd board check during image build

2015-03-12 Thread Sergey Ryazanov
Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/image/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/linux/atheros/image/Makefile 
b/target/linux/atheros/image/Makefile
index a31bf6a..86f2d44 100644
--- a/target/linux/atheros/image/Makefile
+++ b/target/linux/atheros/image/Makefile
@@ -51,12 +51,10 @@ define Image/Build
-p0x15:0x2a:::rootfs:$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) 
\
$(BIN_DIR)/$(IMG_PREFIX)-wpe53g-$(1).bin
 
-  ifeq ($(BOARD),atheros)
-sh $(TOPDIR)/scripts/combined-image.sh \
$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma \
$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
$(BIN_DIR)/$(IMG_PREFIX)-combined.$(1).img
-  endif
 endef
 
 $(eval $(call BuildImage))
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 28/33] atheros: v3.18: renumber backported patches

2015-03-12 Thread Sergey Ryazanov
Move first 3 patches to 0xx numbers range to denote that this is
backported code and they should be removed when we update
kernel to version = 3.19

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/{100-board.patch = 010-board.patch}| 0
 .../{101-early-printk-support.patch = 020-early-printk-support.patch}| 0
 .../atheros/patches-3.18/{105-ar2315_pci.patch = 030-ar2315_pci.patch}   | 0
 3 files changed, 0 insertions(+), 0 deletions(-)
 rename target/linux/atheros/patches-3.18/{100-board.patch = 010-board.patch} 
(100%)
 rename target/linux/atheros/patches-3.18/{101-early-printk-support.patch = 
020-early-printk-support.patch} (100%)
 rename target/linux/atheros/patches-3.18/{105-ar2315_pci.patch = 
030-ar2315_pci.patch} (100%)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/010-board.patch
similarity index 100%
rename from target/linux/atheros/patches-3.18/100-board.patch
rename to target/linux/atheros/patches-3.18/010-board.patch
diff --git a/target/linux/atheros/patches-3.18/101-early-printk-support.patch 
b/target/linux/atheros/patches-3.18/020-early-printk-support.patch
similarity index 100%
rename from target/linux/atheros/patches-3.18/101-early-printk-support.patch
rename to target/linux/atheros/patches-3.18/020-early-printk-support.patch
diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/030-ar2315_pci.patch
similarity index 100%
rename from target/linux/atheros/patches-3.18/105-ar2315_pci.patch
rename to target/linux/atheros/patches-3.18/030-ar2315_pci.patch
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 08/33] atheros: v3.18: update names and declarations

2015-03-12 Thread Sergey Ryazanov
Sync functions, variables and enums names with upstream. Mostly replace
'ar231x_' prefix by 'ath25_'.

No functional changes, except few 'int' - 'unsigned' changes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 416 ++---
 .../patches-3.18/101-early-printk-support.patch|   2 +-
 .../atheros/patches-3.18/102-ar5312_gpio.patch |   4 +-
 .../atheros/patches-3.18/103-ar2315_gpio.patch |   8 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |  10 +-
 .../atheros/patches-3.18/210-reset_button.patch|   4 +-
 6 files changed, 211 insertions(+), 233 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index b224c35..41786b9 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -110,7 +110,7 @@
 +#include ar5312.h
 +#include ar2315.h
 +
-+void (*ar231x_irq_dispatch)(void);
++void (*ath25_irq_dispatch)(void);
 +
 +static inline bool check_radio_magic(u8 *addr)
 +{
@@ -126,19 +126,19 @@
 +static inline bool check_board_data(u8 *flash_limit, u8 *addr, bool broken)
 +{
 +  /* config magic found */
-+  if (*((u32 *)addr) == AR231X_BD_MAGIC)
++  if (*((u32 *)addr) == ATH25_BD_MAGIC)
 +  return true;
 +
 +  if (!broken)
 +  return false;
 +
 +  if (check_radio_magic(addr + 0xf8))
-+  ar231x_board.radio = addr + 0xf8;
++  ath25_board.radio = addr + 0xf8;
 +  if ((addr  flash_limit + 0x1) 
 +  check_radio_magic(addr + 0x1))
-+  ar231x_board.radio = addr + 0x1;
++  ath25_board.radio = addr + 0x1;
 +
-+  if (ar231x_board.radio) {
++  if (ath25_board.radio) {
 +  /* broken board data detected, use radio data to find the
 +   * offset, user will fix this */
 +  return true;
@@ -187,9 +187,9 @@
 +  return NULL;
 +}
 +
-+int __init ar231x_find_config(u8 *flash_limit)
++int __init ath25_find_config(u8 *flash_limit)
 +{
-+  struct ar231x_boarddata *config;
++  struct ath25_boarddata *config;
 +  unsigned int rcfg_size;
 +  int broken_boarddata = 0;
 +  u8 *bcfg, *rcfg;
@@ -198,8 +198,8 @@
 +  u8 *mac_addr;
 +  u32 offset;
 +
-+  ar231x_board.config = NULL;
-+  ar231x_board.radio = NULL;
++  ath25_board.config = NULL;
++  ath25_board.radio = NULL;
 +  /* Copy the board and radio data to RAM, because accessing the mapped
 +   * memory of the flash directly after booting is not safe */
 +
@@ -218,11 +218,11 @@
 +  }
 +
 +  board_data = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL);
-+  ar231x_board.config = (struct ar231x_boarddata *)board_data;
++  ath25_board.config = (struct ath25_boarddata *)board_data;
 +  memcpy(board_data, bcfg, 0x100);
 +  if (broken_boarddata) {
 +  pr_warn(WARNING: broken board data detected\n);
-+  config = ar231x_board.config;
++  config = ath25_board.config;
 +  if (is_zero_ether_addr(config-enet0_mac)) {
 +  pr_info(Fixing up empty mac addresses\n);
 +  config-reset_config_gpio = 0x;
@@ -237,8 +237,8 @@
 +  /* Radio config starts 0x100 bytes after board config, regardless
 +   * of what the physical layout on the flash chip looks like */
 +
-+  if (ar231x_board.radio)
-+  rcfg = (u8 *)ar231x_board.radio;
++  if (ath25_board.radio)
++  rcfg = (u8 *)ath25_board.radio;
 +  else
 +  rcfg = find_radio_config(flash_limit, bcfg);
 +
@@ -246,7 +246,7 @@
 +  return -ENODEV;
 +
 +  radio_data = board_data + 0x100 + ((rcfg - bcfg)  0xfff);
-+  ar231x_board.radio = radio_data;
++  ath25_board.radio = radio_data;
 +  offset = radio_data - board_data;
 +  pr_info(Radio config found at offset 0x%x (0x%x)\n, rcfg - bcfg,
 +  offset);
@@ -256,13 +256,13 @@
 +  mac_addr = radio_data[0x1d * 2];
 +  if (is_broadcast_ether_addr(mac_addr)) {
 +  pr_info(Radio MAC is blank; using board-data\n);
-+  ether_addr_copy(mac_addr, ar231x_board.config-wlan0_mac);
++  ether_addr_copy(mac_addr, ath25_board.config-wlan0_mac);
 +  }
 +
 +  return 0;
 +}
 +
-+static void ar231x_halt(void)
++static void ath25_halt(void)
 +{
 +  local_irq_disable();
 +  while (1)
@@ -271,11 +271,11 @@
 +
 +void __init plat_mem_setup(void)
 +{
-+  _machine_halt = ar231x_halt;
-+  pm_power_off = ar231x_halt;
++  _machine_halt = ath25_halt;
++  pm_power_off = ath25_halt;
 +
-+  ar5312_plat_setup();
-+  ar2315_plat_setup();
++  ar5312_plat_mem_setup();
++  ar2315_plat_mem_setup();
 +
 +  /* Disable data watchpoints */
 +  write_c0_watchlo0(0);
@@ -283,13 +283,13 @@
 +
 +asmlinkage void 

[OpenWrt-Devel] [PATCH 09/33] atheros: v3.18: change calls logic

2015-03-12 Thread Sergey Ryazanov
Check SoC family (AR5312+ or AR2315+) before call instead of checking it
inside the called function. Also convert ar{5312,2315}_init_device()
function to void, since they both return zero and nobody care about
return value.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 98 --
 .../atheros/patches-3.18/102-ar5312_gpio.patch |  4 +-
 .../atheros/patches-3.18/103-ar2315_gpio.patch |  4 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |  2 +-
 4 files changed, 41 insertions(+), 67 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 41786b9..c28a1d8 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -77,7 +77,7 @@
 +obj-$(CONFIG_SOC_AR2315) += ar2315.o
 --- /dev/null
 +++ b/arch/mips/ath25/board.c
-@@ -0,0 +1,229 @@
+@@ -0,0 +1,234 @@
 +/*
 + * 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
@@ -274,8 +274,10 @@
 +  _machine_halt = ath25_halt;
 +  pm_power_off = ath25_halt;
 +
-+  ar5312_plat_mem_setup();
-+  ar2315_plat_mem_setup();
++  if (is_ar5312())
++  ar5312_plat_mem_setup();
++  else
++  ar2315_plat_mem_setup();
 +
 +  /* Disable data watchpoints */
 +  write_c0_watchlo0(0);
@@ -288,8 +290,10 @@
 +
 +void __init plat_time_init(void)
 +{
-+  ar5312_plat_time_init();
-+  ar2315_plat_time_init();
++  if (is_ar5312())
++  ar5312_plat_time_init();
++  else
++  ar2315_plat_time_init();
 +}
 +
 +unsigned int __cpuinit get_c0_compare_int(void)
@@ -303,13 +307,14 @@
 +  mips_cpu_irq_init();
 +
 +  /* Initialize interrupt controllers */
-+  ar5312_arch_init_irq();
-+  ar2315_arch_init_irq();
++  if (is_ar5312())
++  ar5312_arch_init_irq();
++  else
++  ar2315_arch_init_irq();
 +}
-+
 --- /dev/null
 +++ b/arch/mips/ath25/prom.c
-@@ -0,0 +1,37 @@
+@@ -0,0 +1,40 @@
 +/*
 + * 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
@@ -337,11 +342,14 @@
 +#include asm/addrspace.h
 +#include ar5312.h
 +#include ar2315.h
++#include devices.h
 +
 +void __init prom_init(void)
 +{
-+  ar5312_prom_init();
-+  ar2315_prom_init();
++  if (is_ar5312())
++  ar5312_prom_init();
++  else
++  ar2315_prom_init();
 +}
 +
 +void __init prom_free_prom_memory(void)
@@ -1478,7 +1486,7 @@
 +#endif/* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,467 @@
+@@ -0,0 +1,450 @@
 +/*
 + * 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
@@ -1606,9 +1614,6 @@
 +{
 +  int i;
 +
-+  if (!is_ar5312())
-+  return;
-+
 +  ath25_irq_dispatch = ar5312_irq_dispatch;
 +  for (i = 0; i  AR5312_MISC_IRQ_COUNT; i++) {
 +  int irq = AR231X_MISC_IRQ_BASE + i;
@@ -1719,15 +1724,12 @@
 +  return (char *)KSEG1ADDR(AR5312_FLASH + 0x80);
 +}
 +
-+int __init ar5312_init_devices(void)
++void __init ar5312_init_devices(void)
 +{
 +  struct ath25_boarddata *config;
 +  u32 fctl = 0;
 +  u8 *c;
 +
-+  if (!is_ar5312())
-+  return 0;
-+
 +  /* Locate board/radio config data */
 +  ath25_find_config(ar5312_flash_limit());
 +  config = ath25_board.config;
@@ -1788,7 +1790,7 @@
 + ar5312_eth1_data);
 +
 +  if (!ath25_board.radio)
-+  return 0;
++  return;
 +
 +  if (!(config-flags  BD_WLAN0))
 +  break;
@@ -1808,7 +1810,7 @@
 + ar5312_eth1_data);
 +
 +  if (!ath25_board.radio)
-+  return 0;
++  return;
 +  break;
 +  default:
 +  break;
@@ -1816,8 +1818,6 @@
 +
 +  if (config-flags  BD_WLAN1)
 +  ath25_add_wmac(1, AR5312_WLAN1, AR5312_IRQ_WLAN1_INTRS);
-+
-+  return 0;
 +}
 +
 +static void ar5312_restart(char *command)
@@ -1901,9 +1901,6 @@
 +
 +void __init ar5312_plat_time_init(void)
 +{
-+  if (!is_ar5312())
-+  return;
-+
 +  mips_hpt_frequency = ar5312_cpu_frequency() / 2;
 +}
 +
@@ -1913,9 +1910,6 @@
 +  u32 memsize, memcfg, bank0AC, bank1AC;
 +  u32 devid;
 +
-+  if (!is_ar5312())
-+  return;
-+
 +  /* Detect memory size */
 +  memcfg = ar231x_read_reg(AR5312_MEM_CFG1);
 +  bank0AC = (memcfg  MEM_CFG1_AC0)  MEM_CFG1_AC0_S;
@@ -1933,9 +1927,6 @@
 +
 +void __init ar5312_plat_mem_setup(void)
 +{
-+  if 

[OpenWrt-Devel] [PATCH 12/33] atheros: v3.18: relocate PCI host DMA base definition

2015-03-12 Thread Sergey Ryazanov
Put AR2315_PCI_HOST_SDRAM_BASEADDR macro to DMA header, since this is
arbitrary value and not some hw specific constant. Also this relocation
decouples dma from HW specific header.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch | 19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 2099514..1e9245e 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -497,7 +497,7 @@
 +#endif /* __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/dma-coherence.h
-@@ -0,0 +1,76 @@
+@@ -0,0 +1,82 @@
 +/*
 + * 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
@@ -511,7 +511,13 @@
 +#define __ASM_MACH_ATH25_DMA_COHERENCE_H
 +
 +#include linux/device.h
-+#include ar2315_regs.h
++
++/*
++ * We need some arbitrary non-zero value to be programmed to the BAR1 register
++ * of PCI host controller to enable DMA. The same value should be used as the
++ * offset to calculate the physical address of DMA buffer for PCI devices.
++ */
++#define AR2315_PCI_HOST_SDRAM_BASEADDR0x2000
 +
 +static inline dma_addr_t ath25_dev_offset(struct device *dev)
 +{
@@ -623,7 +629,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ar2315_regs.h
-@@ -0,0 +1,608 @@
+@@ -0,0 +1,601 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -1217,13 +1223,6 @@
 +#define AR2315_IRCFG_SEQ_END_WIN_THRESH   0x001f
 +#define AR2315_IRCFG_NUM_BACKOFF_WORDS0x01e0
 +
-+/*
-+ * We need some arbitrary non-zero value to be programmed to the BAR1 register
-+ * of PCI host controller to enable DMA. The same value should be used as the
-+ * offset to calculate the physical address of DMA buffer for PCI devices.
-+ */
-+#define AR2315_PCI_HOST_SDRAM_BASEADDR0x2000
-+
 +/* ??? access BAR */
 +#define AR2315_PCI_HOST_MBAR0 0x1000
 +/* RAM access BAR */
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 17/33] atheros: v3.18: pass PCI IRQ and I/O mem via resources

2015-03-12 Thread Sergey Ryazanov
Pass PCI IRQ and I/O memory ranges via platform device resources, this
change makes PCI controller driver independed from arch headers, so
also remove few includes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 .../atheros/patches-3.18/105-ar2315_pci.patch  | 71 +-
 1 file changed, 56 insertions(+), 15 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
index 904e60f..267053c 100644
--- a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
@@ -10,7 +10,7 @@
  obj-$(CONFIG_MIPS_PCI_VIRTIO) += pci-virtio-guest.o
 --- /dev/null
 +++ b/arch/mips/pci/pci-ar2315.c
-@@ -0,0 +1,482 @@
+@@ -0,0 +1,494 @@
 +/*
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
@@ -60,9 +60,6 @@
 +#include linux/irq.h
 +#include linux/io.h
 +#include asm/paccess.h
-+#include ath25_platform.h
-+#include ar231x.h
-+#include ar2315_regs.h
 +
 +/*
 + * PCI Bus Interface Registers
@@ -175,6 +172,7 @@
 +struct ar2315_pci_ctrl {
 +  void __iomem *cfg_mem;
 +  void __iomem *mmr_mem;
++  unsigned irq;
 +  struct pci_controller pci_ctrl;
 +  struct resource mem_res;
 +  struct resource io_res;
@@ -393,8 +391,8 @@
 +  irq_set_chip_data(irq, apc);
 +  }
 +
-+  irq_set_chained_handler(AR2315_IRQ_LCBUS_PCI, ar2315_pci_irq_handler);
-+  irq_set_handler_data(AR2315_IRQ_LCBUS_PCI, apc);
++  irq_set_chained_handler(apc-irq, ar2315_pci_irq_handler);
++  irq_set_handler_data(apc-irq, apc);
 +
 +  /* Clear any pending Abort or external Interrupts
 +   * and enable interrupt processing */
@@ -407,23 +405,37 @@
 +{
 +  struct ar2315_pci_ctrl *apc;
 +  struct device *dev = pdev-dev;
-+  int err;
++  struct resource *res;
++  int irq, err;
 +
 +  apc = devm_kzalloc(dev, sizeof(*apc), GFP_KERNEL);
 +  if (!apc)
 +  return -ENOMEM;
 +
-+  apc-mmr_mem = devm_ioremap_nocache(dev, AR2315_PCI, AR2315_PCI_SIZE);
-+  if (!apc-mmr_mem)
-+  return -ENOMEM;
++  irq = platform_get_irq(pdev, 0);
++  if (irq  0)
++  return -EINVAL;
++  apc-irq = irq;
++
++  res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
++ ar2315-pci-ctrl);
++  apc-mmr_mem = devm_ioremap_resource(dev, res);
++  if (IS_ERR(apc-mmr_mem))
++  return PTR_ERR(apc-mmr_mem);
++
++  res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
++ ar2315-pci-ext);
++  if (!res)
++  return -EINVAL;
 +
 +  apc-mem_res.name = AR2315 PCI mem space;
-+  apc-mem_res.start = AR2315_PCIEXT;
-+  apc-mem_res.end = AR2315_PCIEXT + AR2315_PCIEXT_SZ - 1;
++  apc-mem_res.parent = res;
++  apc-mem_res.start = res-start;
++  apc-mem_res.end = res-end;
 +  apc-mem_res.flags = IORESOURCE_MEM;
 +
 +  /* Remap PCI config space */
-+  apc-cfg_mem = devm_ioremap_nocache(dev, AR2315_PCIEXT,
++  apc-cfg_mem = devm_ioremap_nocache(dev, res-start,
 +  AR2315_PCI_CFG_SIZE);
 +  if (!apc-cfg_mem) {
 +  dev_err(dev, failed to remap PCI config space\n);
@@ -519,7 +531,34 @@
else if (pending  CAUSEF_IP2)
do_IRQ(AR2315_IRQ_MISC_INTRS);
else if (pending  CAUSEF_IP7)
-@@ -427,4 +431,31 @@ void __init ar2315_arch_init(void)
+@@ -423,8 +427,60 @@ void __init ar2315_plat_mem_setup(void)
+   _machine_restart = ar2315_restart;
+ }
+ 
++#ifdef CONFIG_PCI_AR2315
++static struct resource ar2315_pci_res[] = {
++  {
++  .name = ar2315-pci-ctrl,
++  .flags = IORESOURCE_MEM,
++  .start = AR2315_PCI,
++  .end = AR2315_PCI + AR2315_PCI_SIZE - 1,
++  },
++  {
++  .name = ar2315-pci-ext,
++  .flags = IORESOURCE_MEM,
++  .start = AR2315_PCIEXT,
++  .end = AR2315_PCIEXT + AR2315_PCIEXT_SZ - 1,
++  },
++  {
++  .name = ar2315-pci,
++  .flags = IORESOURCE_IRQ,
++  .start = AR2315_IRQ_LCBUS_PCI,
++  .end = AR2315_IRQ_LCBUS_PCI,
++  },
++};
++#endif
++
+ void __init ar2315_arch_init(void)
  {
ath25_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0,
   ar2315_apb_frequency());
@@ -547,7 +586,9 @@
 +  (AR2315_IF_PCI_CLK_OUTPUT_CLK 
 +   AR2315_IF_PCI_CLK_SHIFT));
 +
-+  platform_device_register_simple(ar2315-pci, -1, NULL, 0);
++  platform_device_register_simple(ar2315-pci, -1,
++  ar2315_pci_res,
++  ARRAY_SIZE(ar2315_pci_res));
 +  }
 

[OpenWrt-Devel] [PATCH 16/33] atheros: v3.18: remap PCI controller MMR memory

2015-03-12 Thread Sergey Ryazanov
Honestly remap PCI controller MMR and use accessor functions to interact
with registers.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  |   3 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  | 135 +
 2 files changed, 88 insertions(+), 50 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index e90cd63..b6b37d1 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -629,7 +629,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ar2315_regs.h
-@@ -0,0 +1,510 @@
+@@ -0,0 +1,511 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -675,6 +675,7 @@
 +#define AR2315_SPI_READ 0x0800  /* SPI FLASH */
 +#define AR2315_WLAN00x1000  /* Wireless MMR */
 +#define AR2315_PCI  0x1010  /* PCI MMR */
++#define AR2315_PCI_SIZE   0x1000
 +#define AR2315_SDRAMCTL 0x1030  /* SDRAM MMR */
 +#define AR2315_LOCAL0x1040  /* LOCAL BUS MMR */
 +#define AR2315_ENET00x1050  /* ETHERNET MMR */
diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
index 02074dd..904e60f 100644
--- a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
@@ -10,7 +10,7 @@
  obj-$(CONFIG_MIPS_PCI_VIRTIO) += pci-virtio-guest.o
 --- /dev/null
 +++ b/arch/mips/pci/pci-ar2315.c
-@@ -0,0 +1,445 @@
+@@ -0,0 +1,482 @@
 +/*
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
@@ -67,11 +67,11 @@
 +/*
 + * PCI Bus Interface Registers
 + */
-+#define AR2315_PCI_1MS_REG(AR2315_PCI + 0x0008)
++#define AR2315_PCI_1MS_REG0x0008
 +
 +#define AR2315_PCI_1MS_MASK   0x3 /* # of AHB clk cycles in 1ms */
 +
-+#define AR2315_PCI_MISC_CONFIG(AR2315_PCI + 0x000c)
++#define AR2315_PCI_MISC_CONFIG0x000c
 +
 +#define AR2315_PCIMISC_TXD_EN 0x0001  /* Enable TXD for fragments */
 +#define AR2315_PCIMISC_CFG_SEL0x0002  /* Mem or Config cycles 
*/
@@ -87,38 +87,38 @@
 +#define AR2315_PCICACHE_DIS   0x1000  /* PCI external access cache
 +   * disable */
 +
-+#define AR2315_PCI_OUT_TSTAMP (AR2315_PCI + 0x0010)
++#define AR2315_PCI_OUT_TSTAMP 0x0010
 +
-+#define AR2315_PCI_UNCACHE_CFG(AR2315_PCI + 0x0014)
++#define AR2315_PCI_UNCACHE_CFG0x0014
 +
-+#define AR2315_PCI_IN_EN  (AR2315_PCI + 0x0100)
++#define AR2315_PCI_IN_EN  0x0100
 +
 +#define AR2315_PCI_IN_EN0 0x01/* Enable chain 0 */
 +#define AR2315_PCI_IN_EN1 0x02/* Enable chain 1 */
 +#define AR2315_PCI_IN_EN2 0x04/* Enable chain 2 */
 +#define AR2315_PCI_IN_EN3 0x08/* Enable chain 3 */
 +
-+#define AR2315_PCI_IN_DIS (AR2315_PCI + 0x0104)
++#define AR2315_PCI_IN_DIS 0x0104
 +
 +#define AR2315_PCI_IN_DIS00x01/* Disable chain 0 */
 +#define AR2315_PCI_IN_DIS10x02/* Disable chain 1 */
 +#define AR2315_PCI_IN_DIS20x04/* Disable chain 2 */
 +#define AR2315_PCI_IN_DIS30x08/* Disable chain 3 */
 +
-+#define AR2315_PCI_IN_PTR (AR2315_PCI + 0x0200)
++#define AR2315_PCI_IN_PTR 0x0200
 +
-+#define AR2315_PCI_OUT_EN (AR2315_PCI + 0x0400)
++#define AR2315_PCI_OUT_EN 0x0400
 +
 +#define AR2315_PCI_OUT_EN00x01/* Enable chain 0 */
 +
-+#define AR2315_PCI_OUT_DIS(AR2315_PCI + 0x0404)
++#define AR2315_PCI_OUT_DIS0x0404
 +
 +#define AR2315_PCI_OUT_DIS0   0x01/* Disable chain 0 */
 +
-+#define AR2315_PCI_OUT_PTR(AR2315_PCI + 0x0408)
++#define AR2315_PCI_OUT_PTR0x0408
 +
 +/* PCI interrupt status (write one to clear) */
-+#define AR2315_PCI_ISR(AR2315_PCI + 0x0500)
++#define AR2315_PCI_ISR0x0500
 +
 +#define AR2315_PCI_INT_TX 0x0001  /* Desc In Completed */
 +#define AR2315_PCI_INT_TXOK   0x0002  /* Desc In OK */
@@ -134,20 +134,20 @@
 +#define AR2315_PCI_INT_ABORT  0x0400  /* PCI bus abort event */
 +
 +/* PCI interrupt mask */
-+#define AR2315_PCI_IMR(AR2315_PCI + 0x0504)
++#define AR2315_PCI_IMR0x0504
 +
 +/* Global PCI interrupt enable */
-+#define AR2315_PCI_IER(AR2315_PCI + 0x0508)
++#define AR2315_PCI_IER0x0508
 +
 +#define AR2315_PCI_IER_DISABLE0x00/* disable pci 
interrupts */
 +#define AR2315_PCI_IER_ENABLE 0x01/* enable pci 

[OpenWrt-Devel] [PATCH 13/33] atheros: v3.18: rearrange PCI regs definitions

2015-03-12 Thread Sergey Ryazanov
Move PCI controller configuration registers from generic header to
driver source. No functional changes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  |  93 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  | 104 -
 2 files changed, 104 insertions(+), 93 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 1e9245e..e90cd63 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -629,7 +629,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ar2315_regs.h
-@@ -0,0 +1,601 @@
+@@ -0,0 +1,510 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -670,16 +670,6 @@
 +#define AR2315_MISC_IRQ_COUNT 9
 +
 +/*
-+ * PCI interrupts, which share IP5
-+ * Keep ordered according to AR2315_PCI_INT_XXX bits
-+ */
-+#define AR2315_PCI_IRQ_BASE   0x50
-+#define AR2315_PCI_IRQ_EXT(AR2315_PCI_IRQ_BASE+0)
-+#define AR2315_PCI_IRQ_ABORT  (AR2315_PCI_IRQ_BASE+1)
-+#define AR2315_PCI_IRQ_COUNT  2
-+#define AR2315_PCI_IRQ_SHIFT  25  /* in AR2315_PCI_INT_STATUS */
-+
-+/*
 + * Address map
 + */
 +#define AR2315_SPI_READ 0x0800  /* SPI FLASH */
@@ -1035,80 +1025,6 @@
 +#define SDRAM_BANKADDR_BITS_S   3
 +
 +/*
-+ * PCI Bus Interface Registers
-+ */
-+#define AR2315_PCI_1MS_REG  (AR2315_PCI + 0x0008)
-+#define AR2315_PCI_1MS_MASK 0x3   /* # of AHB clk cycles in 1ms */
-+
-+#define AR2315_PCI_MISC_CONFIG  (AR2315_PCI + 0x000c)
-+#define AR2315_PCIMISC_TXD_EN   0x0001  /* Enable TXD for fragments */
-+#define AR2315_PCIMISC_CFG_SEL  0x0002  /* mem or config cycles */
-+#define AR2315_PCIMISC_GIG_MASK 0x000C  /* bits 31-30 for pci req */
-+#define AR2315_PCIMISC_RST_MODE 0x0030
-+#define AR2315_PCIRST_INPUT 0x  /* 4:5=0 rst is input */
-+#define AR2315_PCIRST_LOW   0x0010  /* 4:5=1 rst to GND */
-+#define AR2315_PCIRST_HIGH  0x0020  /* 4:5=2 rst to VDD */
-+#define AR2315_PCIGRANT_EN  0x  /* 6:7=0 early grant en */
-+#define AR2315_PCIGRANT_FRAME   0x0040  /* 6:7=1 grant waits 4 frame 
*/
-+#define AR2315_PCIGRANT_IDLE0x0080  /* 6:7=2 grant waits 4 idle */
-+#define AR2315_PCIGRANT_GAP 0x  /* 6:7=2 grant waits 4 idle */
-+#define AR2315_PCICACHE_DIS 0x1000  /* PCI external access cache
-+   * disable */
-+
-+#define AR2315_PCI_OUT_TSTAMP   (AR2315_PCI + 0x0010)
-+
-+#define AR2315_PCI_UNCACHE_CFG  (AR2315_PCI + 0x0014)
-+
-+#define AR2315_PCI_IN_EN(AR2315_PCI + 0x0100)
-+#define AR2315_PCI_IN_EN0   0x01/* Enable chain 0 */
-+#define AR2315_PCI_IN_EN1   0x02/* Enable chain 1 */
-+#define AR2315_PCI_IN_EN2   0x04/* Enable chain 2 */
-+#define AR2315_PCI_IN_EN3   0x08/* Enable chain 3 */
-+
-+#define AR2315_PCI_IN_DIS   (AR2315_PCI + 0x0104)
-+#define AR2315_PCI_IN_DIS0  0x01/* Disable chain 0 */
-+#define AR2315_PCI_IN_DIS1  0x02/* Disable chain 1 */
-+#define AR2315_PCI_IN_DIS2  0x04/* Disable chain 2 */
-+#define AR2315_PCI_IN_DIS3  0x08/* Disable chain 3 */
-+
-+#define AR2315_PCI_IN_PTR   (AR2315_PCI + 0x0200)
-+
-+#define AR2315_PCI_OUT_EN   (AR2315_PCI + 0x0400)
-+#define AR2315_PCI_OUT_EN0  0x01/* Enable chain 0 */
-+
-+#define AR2315_PCI_OUT_DIS  (AR2315_PCI + 0x0404)
-+#define AR2315_PCI_OUT_DIS0 0x01/* Disable chain 0 */
-+
-+#define AR2315_PCI_OUT_PTR  (AR2315_PCI + 0x0408)
-+
-+#define AR2315_PCI_ISR  (AR2315_PCI + 0x0500)   /* write one to clr */
-+#define AR2315_PCI_INT_TX   0x0001  /* Desc In Completed */
-+#define AR2315_PCI_INT_TXOK 0x0002  /* Desc In OK */
-+#define AR2315_PCI_INT_TXERR0x0004  /* Desc In ERR */
-+#define AR2315_PCI_INT_TXEOL0x0008  /* Desc In End-of-List */
-+#define AR2315_PCI_INT_RX   0x0010  /* Desc Out Completed */
-+#define AR2315_PCI_INT_RXOK 0x0020  /* Desc Out OK */
-+#define AR2315_PCI_INT_RXERR0x0040  /* Desc Out ERR */
-+#define AR2315_PCI_INT_RXEOL0x0080  /* Desc Out EOL */
-+#define AR2315_PCI_INT_TXOOD0x0200  /* Desc In Out-of-Desc */
-+#define AR2315_PCI_INT_DESCMASK 0x  /* Desc Mask */
-+#define AR2315_PCI_INT_EXT  0x0200  /* Extern PCI INTA */
-+#define AR2315_PCI_INT_ABORT0x0400  /* PCI bus abort event */
-+
-+#define AR2315_PCI_IMR  (AR2315_PCI + 0x0504)  /* mask _PCI_ISR bits 
*/
-+
-+#define AR2315_PCI_IER  (AR2315_PCI + 0x0508)  /* global PCI int en */
-+#define 

[OpenWrt-Devel] [PATCH 25/33] atheros: v3.18: rearrange code between patches

2015-03-12 Thread Sergey Ryazanov
Cleanup board patch by moving code to specific patches, and factor out
leds to separate patch. No functional changes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 331 +
 .../patches-3.18/101-early-printk-support.patch|   4 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |   8 +-
 .../atheros/patches-3.18/107-ar5312_gpio.patch |  34 ++-
 .../atheros/patches-3.18/108-ar2315_gpio.patch |  64 +++-
 .../atheros/patches-3.18/110-ar2313_ethernet.patch | 295 ++
 .../linux/atheros/patches-3.18/120-spiflash.patch  |  40 +++
 .../linux/atheros/patches-3.18/130-watchdog.patch  |  39 +++
 .../atheros/patches-3.18/330-board_leds.patch  | 116 
 9 files changed, 587 insertions(+), 344 deletions(-)
 create mode 100644 target/linux/atheros/patches-3.18/330-board_leds.patch

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 7dd0b7a..643014f 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
-@@ -96,6 +96,20 @@ config AR7
+@@ -96,6 +96,19 @@ config AR7
  Support for the Texas Instruments AR7 System-on-a-Chip
  family: TNETD7100, 7200 and 7300.
  
@@ -14,14 +14,13 @@
 +  select SYS_HAS_CPU_MIPS32_R1
 +  select SYS_SUPPORTS_BIG_ENDIAN
 +  select SYS_SUPPORTS_32BIT_KERNEL
-+  select ARCH_REQUIRE_GPIOLIB
 +  help
 +Support for AR231x and AR531x based boards
 +
  config ATH79
bool Atheros AR71XX/AR724X/AR913X based boards
select ARCH_REQUIRE_GPIOLIB
-@@ -834,6 +848,7 @@ config MIPS_PARAVIRT
+@@ -834,6 +847,7 @@ config MIPS_PARAVIRT
  
  endchoice
  
@@ -354,7 +353,7 @@
 +}
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ath25_platform.h
-@@ -0,0 +1,84 @@
+@@ -0,0 +1,73 @@
 +#ifndef __ASM_MACH_ATH25_PLATFORM_H
 +#define __ASM_MACH_ATH25_PLATFORM_H
 +
@@ -427,17 +426,6 @@
 +  const char *radio;
 +};
 +
-+/*
-+ * Platform device information for the Ethernet MAC
-+ */
-+struct ar231x_eth {
-+  void (*reset_set)(u32);
-+  void (*reset_clear)(u32);
-+  u32 reset_mac;
-+  u32 reset_phy;
-+  char *macaddr;
-+};
-+
 +#endif /* __ASM_MACH_ATH25_PLATFORM_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
@@ -640,7 +628,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315_regs.h
-@@ -0,0 +1,479 @@
+@@ -0,0 +1,471 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -700,9 +688,6 @@
 +#define AR2315_PCI_EXT_BASE   0x8000  /* PCI external */
 +#define AR2315_PCI_EXT_SIZE   0x4000
 +
-+/* MII registers offset inside Ethernet MMR region */
-+#define AR2315_ENET0_MII_BASE (AR2315_ENET0_BASE + 0x14)
-+
 +/*
 + * Cold reset register
 + */
@@ -968,11 +953,6 @@
 +#define AR2315_AMBACLK_CLK_DIV_M  0x000c
 +#define AR2315_AMBACLK_CLK_DIV_S  2
 +
-+/* GPIO MMR base address */
-+#define AR2315_GPIO   0x0088
-+
-+#define AR2315_RESET_GPIO   5
-+
 +/*
 + *  PCI Clock Control
 + */
@@ -1122,7 +1102,7 @@
 +#endif /* __ASM_MACH_ATH25_AR2315_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312_regs.h
-@@ -0,0 +1,229 @@
+@@ -0,0 +1,225 @@
 +/*
 + * 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
@@ -1191,10 +1171,6 @@
 +#define AR5312_AR5312_REV7  0x0057  /* AR5312 WMAC (AP30-040) */
 +#define AR5312_AR2313_REV8  0x0058  /* AR2313 WMAC (AP43-030) */
 +
-+/* MII registers offset inside Ethernet MMR region */
-+#define AR5312_ENET0_MII_BASE (AR5312_ENET0_BASE + 0x14)
-+#define AR5312_ENET1_MII_BASE (AR5312_ENET1_BASE + 0x14)
-+
 +/* Reset/Timer Block Address Map */
 +#define AR5312_TIMER  0x /* countdown timer */
 +#define AR5312_RELOAD 0x0004 /* timer reload value */
@@ -1354,7 +1330,7 @@
 +#endif/* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,492 @@
+@@ -0,0 +1,401 @@
 +/*
 + * 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
@@ -1382,8 +1358,6 @@
 +#include linux/bitops.h
 +#include linux/irqdomain.h
 +#include linux/reboot.h
-+#include linux/leds.h
-+#include linux/gpio.h
 +#include asm/bootinfo.h
 +#include asm/reboot.h
 +#include asm/time.h
@@ -1495,10 +1469,6 @@
 +
 +  if (pending  CAUSEF_IP2)
 +  do_IRQ(AR5312_IRQ_WLAN0);
-+  else if (pending  CAUSEF_IP3)
-+  do_IRQ(AR5312_IRQ_ENET0);
-+  else if (pending  CAUSEF_IP4)
-+  do_IRQ(AR5312_IRQ_ENET1);
 +  else if (pending  CAUSEF_IP5)
 +  do_IRQ(AR5312_IRQ_WLAN1);
 +  else if (pending  CAUSEF_IP6)
@@ -1530,22 

[OpenWrt-Devel] [PATCH 22/33] atheros: v3.18: update register names

2015-03-12 Thread Sergey Ryazanov
Make register names more consistent, mostly add appropriate prefix
(AR5312_ or AR2315_) or _BASE suffix. Also add macro to simplify mask
and shift operation.

No functional changes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 381 ++---
 .../patches-3.18/101-early-printk-support.patch|   4 +-
 .../atheros/patches-3.18/102-ar5312_gpio.patch |   4 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |  16 +-
 4 files changed, 201 insertions(+), 204 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 7ba8153..9e4434c 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -639,7 +639,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315_regs.h
-@@ -0,0 +1,481 @@
+@@ -0,0 +1,479 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -659,11 +659,11 @@
 +/*
 + * IRQs
 + */
-+#define AR2315_IRQ_MISC_INTRS   (MIPS_CPU_IRQ_BASE+2) /* C0_CAUSE: 0x0400 */
-+#define AR2315_IRQ_WLAN0_INTRS  (MIPS_CPU_IRQ_BASE+3) /* C0_CAUSE: 0x0800 */
-+#define AR2315_IRQ_ENET0_INTRS  (MIPS_CPU_IRQ_BASE+4) /* C0_CAUSE: 0x1000 */
-+#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 */
++#define AR2315_IRQ_MISC   (MIPS_CPU_IRQ_BASE + 2) /* C0_CAUSE: 
0x0400 */
++#define AR2315_IRQ_WLAN0  (MIPS_CPU_IRQ_BASE + 3) /* C0_CAUSE: 0x0800 */
++#define AR2315_IRQ_ENET0  (MIPS_CPU_IRQ_BASE + 4) /* C0_CAUSE: 0x1000 */
++#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.
@@ -684,22 +684,23 @@
 + */
 +#define AR2315_SPI_READ_BASE  0x0800  /* SPI flash */
 +#define AR2315_SPI_READ_SIZE  0x0100
-+#define AR2315_WLAN00x1000  /* Wireless MMR */
-+#define AR2315_PCI  0x1010  /* PCI MMR */
++#define AR2315_WLAN0_BASE 0x1000  /* Wireless MMR */
++#define AR2315_PCI_BASE   0x1010  /* PCI MMR */
 +#define AR2315_PCI_SIZE   0x1000
 +#define AR2315_SDRAMCTL_BASE  0x1030  /* SDRAM MMR */
 +#define AR2315_SDRAMCTL_SIZE  0x0020
 +#define AR2315_LOCAL_BASE 0x1040  /* Local bus MMR */
-+#define AR2315_ENET00x1050  /* ETHERNET MMR */
++#define AR2315_ENET0_BASE 0x1050  /* Ethernet MMR */
 +#define AR2315_RST_BASE   0x1100  /* Reset control MMR */
 +#define AR2315_RST_SIZE   0x0100
-+#define AR2315_UART00x1110  /* UART MMR */
-+#define AR2315_SPI_MMR  0x1130  /* SPI FLASH MMR */
-+#define AR2315_PCIEXT   0x8000  /* pci external */
-+#define AR2315_PCIEXT_SZ  0x4000
++#define AR2315_UART0_BASE 0x1110  /* UART MMR */
++#define AR2315_SPI_MMR_BASE   0x1130  /* SPI flash MMR */
++#define AR2315_SPI_MMR_SIZE   0x0010
++#define AR2315_PCI_EXT_BASE   0x8000  /* PCI external */
++#define AR2315_PCI_EXT_SIZE   0x4000
 +
 +/* MII registers offset inside Ethernet MMR region */
-+#define AR2315_ENET0_MII  (AR2315_ENET0 + 0x14)
++#define AR2315_ENET0_MII_BASE (AR2315_ENET0_BASE + 0x14)
 +
 +/*
 + * Cold reset register
@@ -870,12 +871,12 @@
 +#define AR2315_TIMER  0x0030
 +#define AR2315_RELOAD 0x0034
 +
-+#define AR2315_WD 0x0038
-+#define AR2315_WDC0x003c
++#define AR2315_WDT_TIMER  0x0038
++#define AR2315_WDT_CTRL   0x003c
 +
-+#define AR2315_WDC_IGNORE_EXPIRATION  0x
-+#define AR2315_WDC_NMI0x0001  /* NMI on 
watchdog */
-+#define AR2315_WDC_RESET  0x0002  /* reset on watchdog */
++#define AR2315_WDT_CTRL_IGNORE0x  /* ignore expiration */
++#define AR2315_WDT_CTRL_NMI   0x0001  /* NMI on watchdog */
++#define AR2315_WDT_CTRL_RESET 0x0002  /* reset on watchdog */
 +
 +/*
 + * CPU Performance Counters
@@ -908,10 +909,10 @@
 +#define AR2315_AHB_ERR3   0x005c  /* hrdata */
 +#define AR2315_AHB_ERR4   0x0060  /* status */
 +
-+#define AHB_ERROR_DET 1 /* AHB Error has been detected,  */
-+/* write 1 to clear all bits in ERR0 */
-+#define AHB_ERROR_OVR 2 /* AHB Error overflow has been detected  */
-+#define AHB_ERROR_WDT 4 /* AHB Error due to wdt instead of hresp */
++#define AR2315_AHB_ERROR_DET  1 /* AHB Error has been detected,  */
++/* write 1 to clear all bits in ERR0 */
++#define AR2315_AHB_ERROR_OVR  2 /* AHB Error overflow 

[OpenWrt-Devel] [PATCH 18/33] atheros: v3.18: cleanup register headers

2015-03-12 Thread Sergey Ryazanov
AFAIK, no one AR2315+ chip (AR2315, AR2316, AR2317, AR2318) does not
contain IR block, so remove IR registers definitions. Also remove few
unused macroses.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch | 64 +++
 1 file changed, 6 insertions(+), 58 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index b6b37d1..f4f79d8 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -629,7 +629,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ar2315_regs.h
-@@ -0,0 +1,511 @@
+@@ -0,0 +1,470 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -852,17 +852,6 @@
 +#define AR2315_GISR_ETHERNET  0x0040
 +
 +/*
-+ * Interrupt routing from IO to the processor IP bits
-+ * Define our inter mask and level
-+ */
-+#define AR2315_INTR_MISCIO  SR_IBIT3
-+#define AR2315_INTR_WLAN0   SR_IBIT4
-+#define AR2315_INTR_ENET0   SR_IBIT5
-+#define AR2315_INTR_LOCALPCISR_IBIT6
-+#define AR2315_INTR_WMACPOLLSR_IBIT7
-+#define AR2315_INTR_COMPARE SR_IBIT8
-+
-+/*
 + * Timers
 + */
 +#define AR2315_TIMER(AR2315_DSLBASE + 0x0030)
@@ -1110,40 +1099,10 @@
 +#define AR2315_LB_INT_EN(AR2315_LOCAL + 0x0508)
 +#define AR2315_LB_MBOX  (AR2315_LOCAL + 0x0600)
 +
-+/*
-+ * IR Interface Registers
-+ */
-+#define AR2315_IR_PKTDATA (AR2315_IR + 0x)
-+
-+#define AR2315_IR_PKTLEN  (AR2315_IR + 0x07fc) /* 0 - 63 */
-+
-+#define AR2315_IR_CONTROL (AR2315_IR + 0x0800)
-+#define AR2315_IRCTL_TX   0x  /* use as 
tranmitter */
-+#define AR2315_IRCTL_RX   0x0001  /* use as receiver  
 */
-+#define AR2315_IRCTL_SAMPLECLK_MASK   0x3ffe  /* Sample clk divisor */
-+#define AR2315_IRCTL_SAMPLECLK_SHFT   1
-+#define AR2315_IRCTL_OUTPUTCLK_MASK   0x03ffc000  /* Output clk div */
-+#define AR2315_IRCTL_OUTPUTCLK_SHFT   14
-+
-+#define AR2315_IR_STATUS  (AR2315_IR + 0x0804)
-+#define AR2315_IRSTS_RX   0x0001  /* receive in 
progress */
-+#define AR2315_IRSTS_TX   0x0002  /* transmit in 
progress */
-+
-+#define AR2315_IR_CONFIG  (AR2315_IR + 0x0808)
-+#define AR2315_IRCFG_INVIN0x0001  /* invert in polarity */
-+#define AR2315_IRCFG_INVOUT   0x0002  /* invert out polarity */
-+#define AR2315_IRCFG_SEQ_START_WIN_SEL0x0004  /* 1 = 28, 0 = 7 
*/
-+#define AR2315_IRCFG_SEQ_START_THRESH 0x00f0
-+#define AR2315_IRCFG_SEQ_END_UNIT_SEL 0x0100
-+#define AR2315_IRCFG_SEQ_END_UNIT_THRESH 0x7e00
-+#define AR2315_IRCFG_SEQ_END_WIN_SEL  0x8000
-+#define AR2315_IRCFG_SEQ_END_WIN_THRESH   0x001f
-+#define AR2315_IRCFG_NUM_BACKOFF_WORDS0x01e0
-+
 +#endif /* __ASM_MACH_ATH25_AR2315_REGS_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ar5312_regs.h
-@@ -0,0 +1,235 @@
+@@ -0,0 +1,224 @@
 +/*
 + * 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
@@ -1184,6 +1143,10 @@
 +
 +/*
 + * Address Map
++ *
++ * The AR5312 supports 2 enet MACS, even though many reference boards only
++ * actually use 1 of them (i.e. Only MAC 0 is actually connected to an enet
++ * PHY or PHY switch. The AR2312 supports 1 enet MAC.
 + */
 +#define AR5312_WLAN00x1800
 +#define AR5312_WLAN10x1850
@@ -1196,15 +1159,6 @@
 +#define AR5312_FLASH0x1e00
 +
 +/*
-+ * AR5312_NUM_ENET_MAC defines the number of ethernet MACs that
-+ * should be considered available.  The AR5312 supports 2 enet MACS,
-+ * even though many reference boards only actually use 1 of them
-+ * (i.e. Only MAC 0 is actually connected to an enet PHY or PHY switch.
-+ * The AR2312 supports 1 enet MAC.
-+ */
-+#define AR5312_NUM_ENET_MAC 2
-+
-+/*
 + * Need these defines to determine true number of ethernet MACs
 + */
 +#define AR5312_AR5312_REV2  0x0052  /* AR5312 WMAC (AP31) */
@@ -1215,12 +1169,6 @@
 +#define AR5312_ENET0_MII  (AR5312_ENET0 + 0x14)
 +#define AR5312_ENET1_MII  (AR5312_ENET1 + 0x14)
 +
-+/*
-+ * AR5312_NUM_WMAC defines the number of Wireless MACs that\
-+ * should be considered available.
-+ */
-+#define AR5312_NUM_WMAC 2
-+
 +/* Reset/Timer Block Address Map */
 +#define AR5312_RESETTMR   (AR5312_APBBASE  + 0x3000)
 +#define AR5312_TIMER  (AR5312_RESETTMR + 0x) /* countdown timer */
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 20/33] atheros: v3.18: make registers headers local

2015-03-12 Thread Sergey Ryazanov
There are no external users (last one was PCI driver) for these headers,
so move them to arch directory. Few macroses from ar231x.h header moved
to devices.h and file was removed.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 36 --
 .../patches-3.18/101-early-printk-support.patch|  4 +--
 .../atheros/patches-3.18/210-reset_button.patch|  3 +-
 3 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index afb8217..c0e935e 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -628,7 +628,7 @@
 +
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ath25/ar2315_regs.h
 b/arch/mips/ath25/ar2315_regs.h
 @@ -0,0 +1,480 @@
 +/*
 + * Register definitions for AR2315+
@@ -,7 +,7 @@
 +
 +#endif /* __ASM_MACH_ATH25_AR2315_REGS_H */
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ath25/ar5312_regs.h
 b/arch/mips/ath25/ar5312_regs.h
 @@ -0,0 +1,227 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -1377,10 +1377,10 @@
 +#include linux/io.h
 +
 +#include ath25_platform.h
-+#include ar5312_regs.h
-+#include ar231x.h
++
 +#include devices.h
 +#include ar5312.h
++#include ar5312_regs.h
 +
 +static void __iomem *ar5312_rst_base;
 +
@@ -1863,10 +1863,10 @@
 +#include linux/io.h
 +
 +#include ath25_platform.h
-+#include ar2315_regs.h
-+#include ar231x.h
++
 +#include devices.h
 +#include ar2315.h
++#include ar2315_regs.h
 +
 +static void __iomem *ar2315_rst_base;
 +
@@ -2336,26 +2336,15 @@
 +
 +#endif
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ath25/ar231x.h
-@@ -0,0 +1,13 @@
-+#ifndef __ASM_MACH_ATH25_AR231X_H
-+#define __ASM_MACH_ATH25_AR231X_H
-+
-+#include linux/types.h
-+#include linux/io.h
 b/arch/mips/ath25/devices.h
+@@ -0,0 +1,44 @@
++#ifndef __ATH25_DEVICES_H
++#define __ATH25_DEVICES_H
 +
 +#define AR231X_MISC_IRQ_BASE  0x20
 +#define AR231X_GPIO_IRQ_BASE  0x30
 +
-+/* Software's idea of interrupts handled by CPU Interrupt Controller */
-+#define AR231X_IRQ_CPU_CLOCK  (MIPS_CPU_IRQ_BASE+7) /* C0_CAUSE: 0x8000 */
-+
-+#endif/* __ASM_MACH_ATH25_AR231X_H */
 /dev/null
-+++ b/arch/mips/ath25/devices.h
-@@ -0,0 +1,39 @@
-+#ifndef __ATH25_DEVICES_H
-+#define __ATH25_DEVICES_H
++#define AR231X_IRQ_CPU_CLOCK  (MIPS_CPU_IRQ_BASE + 7) /* C0_CAUSE: 0x8000 */
 +
 +enum ath25_soc_type {
 +  /* handled by ar5312.c */
@@ -2395,7 +2384,7 @@
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.c
-@@ -0,0 +1,192 @@
+@@ -0,0 +1,191 @@
 +#include linux/kernel.h
 +#include linux/init.h
 +#include linux/serial.h
@@ -2405,7 +2394,6 @@
 +#include asm/bootinfo.h
 +
 +#include ath25_platform.h
-+#include ar231x.h
 +#include devices.h
 +#include ar5312.h
 +#include ar2315.h
diff --git a/target/linux/atheros/patches-3.18/101-early-printk-support.patch 
b/target/linux/atheros/patches-3.18/101-early-printk-support.patch
index 367069d..5fb510d 100644
--- a/target/linux/atheros/patches-3.18/101-early-printk-support.patch
+++ b/target/linux/atheros/patches-3.18/101-early-printk-support.patch
@@ -14,9 +14,9 @@
 +#include linux/serial_reg.h
 +#include asm/addrspace.h
 +
-+#include asm/mach-ath25/ar2315_regs.h
-+#include asm/mach-ath25/ar5312_regs.h
 +#include devices.h
++#include ar2315_regs.h
++#include ar5312_regs.h
 +
 +static inline void prom_uart_wr(void __iomem *base, unsigned reg,
 +  unsigned char ch)
diff --git a/target/linux/atheros/patches-3.18/210-reset_button.patch 
b/target/linux/atheros/patches-3.18/210-reset_button.patch
index 0f7315b..34ef46b 100644
--- a/target/linux/atheros/patches-3.18/210-reset_button.patch
+++ b/target/linux/atheros/patches-3.18/210-reset_button.patch
@@ -11,14 +11,13 @@
  
 --- /dev/null
 +++ b/arch/mips/ath25/reset.c
-@@ -0,0 +1,58 @@
+@@ -0,0 +1,57 @@
 +#include linux/init.h
 +#include linux/slab.h
 +#include linux/platform_device.h
 +#include linux/gpio_keys.h
 +#include linux/input.h
 +#include ath25_platform.h
-+#include ar231x.h
 +#include devices.h
 +
 +static int __init
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 29/33] atheros: switch to 3.18

2015-03-12 Thread Sergey Ryazanov
Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/atheros/Makefile b/target/linux/atheros/Makefile
index 3983ff7..170d4af 100644
--- a/target/linux/atheros/Makefile
+++ b/target/linux/atheros/Makefile
@@ -11,7 +11,7 @@ BOARD:=atheros
 BOARDNAME:=Atheros AR231x/AR5312
 FEATURES:=squashfs low_mem
 
-KERNEL_PATCHVER:=3.14
+KERNEL_PATCHVER:=3.18
 
 include $(INCLUDE_DIR)/target.mk
 
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 15/33] atheros: v3.18: add context container for PCI driver

2015-03-12 Thread Sergey Ryazanov
Add container and place all context specific variables and structure to
it.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 .../atheros/patches-3.18/105-ar2315_pci.patch  | 123 -
 1 file changed, 70 insertions(+), 53 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
index c3456ed..02074dd 100644
--- a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
@@ -10,7 +10,7 @@
  obj-$(CONFIG_MIPS_PCI_VIRTIO) += pci-virtio-guest.o
 --- /dev/null
 +++ b/arch/mips/pci/pci-ar2315.c
-@@ -0,0 +1,428 @@
+@@ -0,0 +1,445 @@
 +/*
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
@@ -172,10 +172,22 @@
 +/* ??? access BAR */
 +#define AR2315_PCI_HOST_MBAR2 0x3000
 +
-+static void __iomem *ar2315_pci_cfg_mem;
++struct ar2315_pci_ctrl {
++  void __iomem *cfg_mem;
++  struct pci_controller pci_ctrl;
++  struct resource mem_res;
++  struct resource io_res;
++};
++
++static inline struct ar2315_pci_ctrl *ar2315_pci_bus_to_apc(struct pci_bus 
*bus)
++{
++  struct pci_controller *hose = bus-sysdata;
++
++  return container_of(hose, struct ar2315_pci_ctrl, pci_ctrl);
++}
 +
-+static int ar2315_pci_cfg_access(int devfn, int where, int size, u32 *ptr,
-+   bool write)
++static int ar2315_pci_cfg_access(struct ar2315_pci_ctrl *apc, unsigned devfn,
++   int where, int size, u32 *ptr, bool write)
 +{
 +  int func = PCI_FUNC(devfn);
 +  int dev = PCI_SLOT(devfn);
@@ -195,7 +207,7 @@
 +
 +  mb();   /* PCI must see space change before we begin */
 +
-+  value = __raw_readl(ar2315_pci_cfg_mem + addr);
++  value = __raw_readl(apc-cfg_mem + addr);
 +
 +  isr = ar231x_read_reg(AR2315_PCI_ISR);
 +  if (isr  AR2315_PCI_INT_ABORT)
@@ -203,7 +215,7 @@
 +
 +  if (write) {
 +  value = (value  ~(mask  sh)) | *ptr  sh;
-+  __raw_writel(value, ar2315_pci_cfg_mem + addr);
++  __raw_writel(value, apc-cfg_mem + addr);
 +  isr = ar231x_read_reg(AR2315_PCI_ISR);
 +  if (isr  AR2315_PCI_INT_ABORT)
 +  goto exit_err;
@@ -226,32 +238,40 @@
 +  PCIBIOS_SUCCESSFUL;
 +}
 +
-+static inline int ar2315_pci_local_cfg_rd(unsigned devfn, int where, u32 *val)
++static inline int ar2315_pci_local_cfg_rd(struct ar2315_pci_ctrl *apc,
++unsigned devfn, int where, u32 *val)
 +{
-+  return ar2315_pci_cfg_access(devfn, where, sizeof(u32), val, false);
++  return ar2315_pci_cfg_access(apc, devfn, where, sizeof(u32), val,
++   false);
 +}
 +
-+static inline int ar2315_pci_local_cfg_wr(unsigned devfn, int where, u32 val)
++static inline int ar2315_pci_local_cfg_wr(struct ar2315_pci_ctrl *apc,
++unsigned devfn, int where, u32 val)
 +{
-+  return ar2315_pci_cfg_access(devfn, where, sizeof(u32), val, true);
++  return ar2315_pci_cfg_access(apc, devfn, where, sizeof(u32), val,
++   true);
 +}
 +
-+static int ar2315_pci_cfg_read(struct pci_bus *bus, unsigned int devfn,
-+ int where, int size, u32 *value)
++static int ar2315_pci_cfg_read(struct pci_bus *bus, unsigned devfn, int where,
++ int size, u32 *value)
 +{
++  struct ar2315_pci_ctrl *apc = ar2315_pci_bus_to_apc(bus);
++
 +  if (PCI_SLOT(devfn) == AR2315_PCI_HOST_SLOT)
 +  return PCIBIOS_DEVICE_NOT_FOUND;
 +
-+  return ar2315_pci_cfg_access(devfn, where, size, value, 0);
++  return ar2315_pci_cfg_access(apc, devfn, where, size, value, false);
 +}
 +
-+static int ar2315_pci_cfg_write(struct pci_bus *bus, unsigned int devfn,
-+  int where, int size, u32 value)
++static int ar2315_pci_cfg_write(struct pci_bus *bus, unsigned devfn, int 
where,
++  int size, u32 value)
 +{
++  struct ar2315_pci_ctrl *apc = ar2315_pci_bus_to_apc(bus);
++
 +  if (PCI_SLOT(devfn) == AR2315_PCI_HOST_SLOT)
 +  return PCIBIOS_DEVICE_NOT_FOUND;
 +
-+  return ar2315_pci_cfg_access(devfn, where, size, value, 1);
++  return ar2315_pci_cfg_access(apc, devfn, where, size, value, true);
 +}
 +
 +static struct pci_ops ar2315_pci_ops = {
@@ -259,49 +279,26 @@
 +  .write  = ar2315_pci_cfg_write,
 +};
 +
-+static struct resource ar2315_mem_resource = {
-+  .name   = ar2315-pci-mem,
-+  .start  = AR2315_PCIEXT,
-+  .end= AR2315_PCIEXT + AR2315_PCIEXT_SZ - 1,
-+  .flags  = IORESOURCE_MEM,
-+};
-+
-+/* PCI controller does not support I/O ports */
-+static struct resource ar2315_io_resource = {
-+  .name   = 

[OpenWrt-Devel] [PATCH 14/33] atheros: v3.18: move PCI enable code to arch

2015-03-12 Thread Sergey Ryazanov
Move PCI host interface enable code to arch, since it touches generic
SoC registers outside the PCI MMR region.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 .../atheros/patches-3.18/105-ar2315_pci.patch  | 44 +++---
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
index 0d79a3b..c3456ed 100644
--- a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
@@ -10,7 +10,7 @@
  obj-$(CONFIG_MIPS_PCI_VIRTIO) += pci-virtio-guest.o
 --- /dev/null
 +++ b/arch/mips/pci/pci-ar2315.c
-@@ -0,0 +1,447 @@
+@@ -0,0 +1,428 @@
 +/*
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
@@ -378,7 +378,6 @@
 +static int ar2315_pci_probe(struct platform_device *pdev)
 +{
 +  struct device *dev = pdev-dev;
-+  u32 reg;
 +  int res;
 +
 +  /* Remap PCI config space */
@@ -389,24 +388,6 @@
 +  return -ENOMEM;
 +  }
 +
-+  /* Reset PCI DMA logic */
-+  reg = ar231x_mask_reg(AR2315_RESET, 0, AR2315_RESET_PCIDMA);
-+  msleep(20);
-+  reg = ~AR2315_RESET_PCIDMA;
-+  ar231x_write_reg(AR2315_RESET, reg);
-+  msleep(20);
-+
-+  ar231x_mask_reg(AR2315_ENDIAN_CTL, 0,
-+  AR2315_CONFIG_PCIAHB | AR2315_CONFIG_PCIAHB_BRIDGE);
-+
-+  ar231x_write_reg(AR2315_PCICLK, AR2315_PCICLK_PLLC_CLKM |
-+   (AR2315_PCICLK_IN_FREQ_DIV_6  AR2315_PCICLK_DIV_S));
-+  ar231x_mask_reg(AR2315_AHB_ARB_CTL, 0, AR2315_ARB_PCI);
-+  ar231x_mask_reg(AR2315_IF_CTL, AR2315_IF_PCI_CLK_MASK | AR2315_IF_MASK,
-+  AR2315_IF_PCI | AR2315_IF_PCI_HOST |
-+  AR2315_IF_PCI_INTR | (AR2315_IF_PCI_CLK_OUTPUT_CLK 
-+AR2315_IF_PCI_CLK_SHIFT));
-+
 +  /* Reset the PCI bus by setting bits 5-4 in PCI_MCFG */
 +  ar231x_mask_reg(AR2315_PCI_MISC_CONFIG, AR2315_PCIMISC_RST_MODE,
 +  AR2315_PCIRST_LOW);
@@ -484,13 +465,34 @@
else if (pending  CAUSEF_IP2)
do_IRQ(AR2315_IRQ_MISC_INTRS);
else if (pending  CAUSEF_IP7)
-@@ -427,4 +431,10 @@ void __init ar2315_arch_init(void)
+@@ -427,4 +431,31 @@ void __init ar2315_arch_init(void)
  {
ath25_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0,
   ar2315_apb_frequency());
 +
 +#ifdef CONFIG_PCI_AR2315
 +  if (ath25_soc == ATH25_SOC_AR2315) {
++  /* Reset PCI DMA logic */
++  ar231x_mask_reg(AR2315_RESET, 0, AR2315_RESET_PCIDMA);
++  msleep(20);
++  ar231x_mask_reg(AR2315_RESET, AR2315_RESET_PCIDMA, 0);
++  msleep(20);
++
++  /* Configure endians */
++  ar231x_mask_reg(AR2315_ENDIAN_CTL, 0, AR2315_CONFIG_PCIAHB |
++  AR2315_CONFIG_PCIAHB_BRIDGE);
++
++  /* Configure as PCI host with DMA */
++  ar231x_write_reg(AR2315_PCICLK, AR2315_PCICLK_PLLC_CLKM |
++   (AR2315_PCICLK_IN_FREQ_DIV_6 
++AR2315_PCICLK_DIV_S));
++  ar231x_mask_reg(AR2315_AHB_ARB_CTL, 0, AR2315_ARB_PCI);
++  ar231x_mask_reg(AR2315_IF_CTL, AR2315_IF_PCI_CLK_MASK |
++  AR2315_IF_MASK, AR2315_IF_PCI |
++  AR2315_IF_PCI_HOST | AR2315_IF_PCI_INTR |
++  (AR2315_IF_PCI_CLK_OUTPUT_CLK 
++   AR2315_IF_PCI_CLK_SHIFT));
++
 +  platform_device_register_simple(ar2315-pci, -1, NULL, 0);
 +  }
 +#endif
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 00/33] atheros: switch to 3.18 and rename to ath25

2015-03-12 Thread Sergey Ryazanov
This series adds linux 3.18 support, then step-by-step converts patches
to upstream ath25 version and then renames target to ath25.

Actually 2/3 of these patches could be merged to single huge patch
entitled 'backport ath25', but I took this step-by-step way to preserve
logic and history of conversion process.

Sergey Ryazanov (33):
  atheros: add v3.18 support
  atheros: v3.18: rename ATHEROS_AR231X symbol to ATH25
  atheros: v3.18: rename kernel platform to ath25
  atheros: v3.18: rename platform header
  atheros: v3.18: remove odd header reset.h
  atheros: v3.18: remove eth platform device unused field
  atheros: v3.18: cleanup cpu-feature-overrides.h
  atheros: v3.18: update names and declarations
  atheros: v3.18: change calls logic
  atheros: v3.18: rearrange interrupt handling functions
  atheros: v3.18: rework early initialization
  atheros: v3.18: relocate PCI host DMA base definition
  atheros: v3.18: rearrange PCI regs definitions
  atheros: v3.18: move PCI enable code to arch
  atheros: v3.18: add context container for PCI driver
  atheros: v3.18: remap PCI controller MMR memory
  atheros: v3.18: pass PCI IRQ and I/O mem via resources
  atheros: v3.18: cleanup register headers
  atheros: v3.18: remap main SoC MMR memory
  atheros: v3.18: make registers headers local
  atheros: v3.18: remap flash for boardconfig parsing
  atheros: v3.18: update register names
  atheros: v3.18: switch to IRQ domain
  atheros: v3.18: move GPIO patches behind PCI
  atheros: v3.18: rearrange code between patches
  atheros: v3.18: cleanup includes
  atheros: v3.18: non-functional cleanup
  atheros: v3.18: renumber backported patches
  atheros: switch to 3.18
  atheros: remove linux 3.14
  atheros: remove odd board check during image build
  Rename 'atheros' target to 'ath25'
  ath25: set myself as maintainer

 package/kernel/mac80211/Makefile   |6 +-
 package/kernel/wrt55agv2-spidevs/Makefile  |2 +-
 .../patches-3.14/404-mtd-cybertan-trx-parser.patch |2 +-
 target/linux/{atheros = ath25}/Makefile   |5 +-
 .../base-files/etc/config/system   |0
 .../base-files/etc/hotplug.d/button/00-button  |0
 .../base-files/etc/uci-defaults/01_leds|0
 .../base-files/etc/uci-defaults/02_network |0
 .../lib/preinit/15_preinit_iface_atheros   |0
 .../base-files/lib/upgrade/platform.sh |0
 .../{atheros/config-3.14 = ath25/config-3.18} |   13 +-
 target/linux/{atheros = ath25}/image/Makefile |2 -
 target/linux/ath25/patches-3.18/010-board.patch| 2189 
 .../patches-3.18/020-early-printk-support.patch}   |   26 +-
 .../linux/ath25/patches-3.18/030-ar2315_pci.patch  |  613 +
 .../patches-3.18/107-ar5312_gpio.patch}|   54 +-
 .../patches-3.18/108-ar2315_gpio.patch}|   98 +-
 .../patches-3.18}/110-ar2313_ethernet.patch|  301 ++-
 .../patches-3.18}/120-spiflash.patch   |   48 +-
 .../patches-3.18}/130-watchdog.patch   |   45 +-
 .../patches-3.18}/140-redboot_boardconfig.patch|0
 .../patches-3.18}/141-redboot_partition_scan.patch |0
 .../142-redboot_various_erase_size_fix.patch   |0
 .../patches-3.18}/210-reset_button.patch   |   15 +-
 .../patches-3.18}/220-enet_micrel_workaround.patch |0
 .../linux/ath25/patches-3.18/330-board_leds.patch  |  116 +
 target/linux/atheros/patches-3.14/100-board.patch  | 2768 
 .../atheros/patches-3.14/105-ar2315_pci.patch  |  403 ---
 .../430-mtd-add-myloader-partition-parser.patch|2 +-
 .../430-mtd-add-myloader-partition-parser.patch|2 +-
 .../430-mtd-add-myloader-partition-parser.patch|2 +-
 31 files changed, 3450 insertions(+), 3262 deletions(-)
 rename target/linux/{atheros = ath25}/Makefile (84%)
 rename target/linux/{atheros = ath25}/base-files/etc/config/system (100%)
 rename target/linux/{atheros = 
ath25}/base-files/etc/hotplug.d/button/00-button (100%)
 rename target/linux/{atheros = ath25}/base-files/etc/uci-defaults/01_leds 
(100%)
 rename target/linux/{atheros = ath25}/base-files/etc/uci-defaults/02_network 
(100%)
 rename target/linux/{atheros = 
ath25}/base-files/lib/preinit/15_preinit_iface_atheros (100%)
 rename target/linux/{atheros = ath25}/base-files/lib/upgrade/platform.sh 
(100%)
 rename target/linux/{atheros/config-3.14 = ath25/config-3.18} (93%)
 rename target/linux/{atheros = ath25}/image/Makefile (98%)
 create mode 100644 target/linux/ath25/patches-3.18/010-board.patch
 rename target/linux/{atheros/patches-3.14/101-early-printk-support.patch = 
ath25/patches-3.18/020-early-printk-support.patch} (72%)
 create mode 100644 target/linux/ath25/patches-3.18/030-ar2315_pci.patch
 rename target/linux/{atheros/patches-3.14/102-ar5312_gpio.patch = 
ath25/patches-3.18/107-ar5312_gpio.patch} (80%)
 rename target/linux/{atheros/patches-3.14/103-ar2315_gpio.patch = 

[OpenWrt-Devel] [PATCH 06/33] atheros: v3.18: remove eth platform device unused field

2015-03-12 Thread Sergey Ryazanov
Ethernet controller driver don't use boarddata directly, so remove
corresponding field from its platform device structure.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch   | 10 +++---
 target/linux/atheros/patches-3.18/102-ar5312_gpio.patch |  4 ++--
 target/linux/atheros/patches-3.18/103-ar2315_gpio.patch |  4 ++--
 target/linux/atheros/patches-3.18/105-ar2315_pci.patch  |  2 +-
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index e86bb48..abf1964 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -349,7 +349,7 @@
 +}
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ath25_platform.h
-@@ -0,0 +1,85 @@
+@@ -0,0 +1,84 @@
 +#ifndef __ASM_MACH_ATH25_PLATFORM_H
 +#define __ASM_MACH_ATH25_PLATFORM_H
 +
@@ -430,7 +430,6 @@
 +  void (*reset_clear)(u32);
 +  u32 reset_mac;
 +  u32 reset_phy;
-+  struct ar231x_board_config *config;
 +  char *macaddr;
 +};
 +
@@ -1499,7 +1498,7 @@
 +#endif/* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,476 @@
+@@ -0,0 +1,474 @@
 +/*
 + * 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
@@ -1675,7 +1674,6 @@
 +  .reset_clear = ar5312_device_reset_clear,
 +  .reset_mac = AR5312_RESET_ENET0,
 +  .reset_phy = AR5312_RESET_EPHY0,
-+  .config = ar231x_board,
 +};
 +
 +static struct ar231x_eth ar5312_eth1_data = {
@@ -1683,7 +1681,6 @@
 +  .reset_clear = ar5312_device_reset_clear,
 +  .reset_mac = AR5312_RESET_ENET1,
 +  .reset_phy = AR5312_RESET_EPHY1,
-+  .config = ar231x_board,
 +};
 +
 +static struct platform_device ar5312_physmap_flash = {
@@ -1978,7 +1975,7 @@
 +
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315.c
-@@ -0,0 +1,431 @@
+@@ -0,0 +1,430 @@
 +/*
 + * 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
@@ -2148,7 +2145,6 @@
 +  .reset_clear = ar2315_device_reset_clear,
 +  .reset_mac = AR2315_RESET_ENET0,
 +  .reset_phy = AR2315_RESET_EPHY0,
-+  .config = ar231x_board,
 +};
 +
 +static struct resource ar2315_spiflash_res[] = {
diff --git a/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch 
b/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch
index 2860c54..8bc9689 100644
--- a/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch
+++ b/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch
@@ -10,7 +10,7 @@
  config SOC_AR2315
 --- a/arch/mips/ath25/ar5312.c
 +++ b/arch/mips/ath25/ar5312.c
-@@ -192,6 +192,22 @@ static struct platform_device ar5312_phy
+@@ -190,6 +190,22 @@ static struct platform_device ar5312_phy
.num_resources = 1,
  };
  
@@ -33,7 +33,7 @@
  #ifdef CONFIG_LEDS_GPIO
  static struct gpio_led ar5312_leds[] = {
{ .name = wlan, .gpio = 0, .active_low = 1, },
-@@ -282,6 +298,8 @@ int __init ar5312_init_devices(void)
+@@ -280,6 +296,8 @@ int __init ar5312_init_devices(void)
  
platform_device_register(ar5312_physmap_flash);
  
diff --git a/target/linux/atheros/patches-3.18/103-ar2315_gpio.patch 
b/target/linux/atheros/patches-3.18/103-ar2315_gpio.patch
index cd3baf5..9b55d37 100644
--- a/target/linux/atheros/patches-3.18/103-ar2315_gpio.patch
+++ b/target/linux/atheros/patches-3.18/103-ar2315_gpio.patch
@@ -8,7 +8,7 @@
default y
 --- a/arch/mips/ath25/ar2315.c
 +++ b/arch/mips/ath25/ar2315.c
-@@ -212,6 +212,34 @@ static struct platform_device ar2315_wdt
+@@ -211,6 +211,34 @@ static struct platform_device ar2315_wdt
.num_resources = ARRAY_SIZE(ar2315_wdt_res)
  };
  
@@ -43,7 +43,7 @@
  /*
   * NB: We use mapping size that is larger than the actual flash size,
   * but this shouldn't be a problem here, because the flash will simply
-@@ -277,6 +305,7 @@ ar2315_init_devices(void)
+@@ -276,6 +304,7 @@ ar2315_init_devices(void)
ar231x_find_config(ar2315_flash_limit());
ar2315_eth_data.macaddr = ar231x_board.config-enet0_mac;
  
diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
index 6e398dc..d86e9b7 100644
--- a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
@@ -382,7 +382,7 @@
else if (pending  CAUSEF_IP2)
do_IRQ(AR2315_IRQ_MISC_INTRS);
else if (pending  CAUSEF_IP7)
-@@ -458,3 +462,18 @@ ar2315_plat_setup(void)
+@@ -457,3 +461,18 @@ ar2315_plat_setup(void)
ar231x_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0,
ar2315_apb_frequency());
  }
-- 
2.0.4
___
openwrt-devel 

[OpenWrt-Devel] [PATCH 02/33] atheros: v3.18: rename ATHEROS_AR231X symbol to ATH25

2015-03-12 Thread Sergey Ryazanov
This patch starts upsteam ath25 code backporting.

No functional changes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 .../patches-3.14/404-mtd-cybertan-trx-parser.patch |  2 +-
 target/linux/atheros/config-3.18   |  2 +-
 target/linux/atheros/patches-3.18/100-board.patch  | 24 +++---
 .../patches-3.18/101-early-printk-support.patch|  2 +-
 .../atheros/patches-3.18/102-ar5312_gpio.patch |  2 +-
 .../atheros/patches-3.18/103-ar2315_gpio.patch |  2 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |  2 +-
 .../atheros/patches-3.18/110-ar2313_ethernet.patch |  4 ++--
 .../linux/atheros/patches-3.18/130-watchdog.patch  |  2 +-
 .../430-mtd-add-myloader-partition-parser.patch|  2 +-
 .../430-mtd-add-myloader-partition-parser.patch|  2 +-
 .../430-mtd-add-myloader-partition-parser.patch|  2 +-
 12 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/target/linux/ar71xx/patches-3.14/404-mtd-cybertan-trx-parser.patch 
b/target/linux/ar71xx/patches-3.14/404-mtd-cybertan-trx-parser.patch
index 7995abb..eb7c774 100644
--- a/target/linux/ar71xx/patches-3.14/404-mtd-cybertan-trx-parser.patch
+++ b/target/linux/ar71xx/patches-3.14/404-mtd-cybertan-trx-parser.patch
@@ -12,7 +12,7 @@
 +
  config MTD_MYLOADER_PARTS
tristate MyLoader partition parsing
-   depends on ADM5120 || ATHEROS_AR231X || ATHEROS_AR71XX || ATH79
+   depends on ADM5120 || ATH25 || ATHEROS_AR71XX || ATH79
 --- a/drivers/mtd/Makefile
 +++ b/drivers/mtd/Makefile
 @@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AR7_PARTS)  += ar7part.o
diff --git a/target/linux/atheros/config-3.18 b/target/linux/atheros/config-3.18
index f795430..77d1498 100644
--- a/target/linux/atheros/config-3.18
+++ b/target/linux/atheros/config-3.18
@@ -12,7 +12,7 @@ CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
 CONFIG_ARCH_REQUIRE_GPIOLIB=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ATHEROS_AR231X=y
+CONFIG_ATH25=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_CEVT_R4K=y
 CONFIG_CLONE_BACKWARDS=y
diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 1dba78d..b7a5f2d 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -1,10 +1,10 @@
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
-@@ -154,6 +154,19 @@ config BCM63XX
-   help
-Support for BCM63XX based boards
+@@ -96,6 +96,19 @@ config AR7
+ Support for the Texas Instruments AR7 System-on-a-Chip
+ family: TNETD7100, 7200 and 7300.
  
-+config ATHEROS_AR231X
++config ATH25
 +  bool Atheros 231x/531x SoC support
 +  select CEVT_R4K
 +  select CSRC_R4K
@@ -17,9 +17,9 @@
 +  help
 +Support for AR231x and AR531x based boards
 +
- config MIPS_COBALT
-   bool Cobalt Server
-   select CEVT_R4K
+ config ATH79
+   bool Atheros AR71XX/AR724X/AR913X based boards
+   select ARCH_REQUIRE_GPIOLIB
 @@ -834,6 +847,7 @@ config MIPS_PARAVIRT
  
  endchoice
@@ -44,20 +44,20 @@
 +#
 +# Atheros AR531X/AR231X WiSoC
 +#
-+platform-$(CONFIG_ATHEROS_AR231X)  += ar231x/
-+cflags-$(CONFIG_ATHEROS_AR231X)+= 
-I$(srctree)/arch/mips/include/asm/mach-ar231x
-+load-$(CONFIG_ATHEROS_AR231X)  += 0x80041000
++platform-$(CONFIG_ATH25)  += ar231x/
++cflags-$(CONFIG_ATH25)+= 
-I$(srctree)/arch/mips/include/asm/mach-ar231x
++load-$(CONFIG_ATH25)  += 0x80041000
 --- /dev/null
 +++ b/arch/mips/ar231x/Kconfig
 @@ -0,0 +1,9 @@
 +config SOC_AR5312
 +  bool Atheros 5312/2312+ support
-+  depends on ATHEROS_AR231X
++  depends on ATH25
 +  default y
 +
 +config SOC_AR2315
 +  bool Atheros 2315+ support
-+  depends on ATHEROS_AR231X
++  depends on ATH25
 +  default y
 --- /dev/null
 +++ b/arch/mips/ar231x/Makefile
diff --git a/target/linux/atheros/patches-3.18/101-early-printk-support.patch 
b/target/linux/atheros/patches-3.18/101-early-printk-support.patch
index 665091f..38560dd 100644
--- a/target/linux/atheros/patches-3.18/101-early-printk-support.patch
+++ b/target/linux/atheros/patches-3.18/101-early-printk-support.patch
@@ -60,7 +60,7 @@
  obj-$(CONFIG_SOC_AR2315) += ar2315.o
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
-@@ -164,6 +164,7 @@ config ATHEROS_AR231X
+@@ -106,6 +106,7 @@ config ATH25
select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_32BIT_KERNEL
select ARCH_REQUIRE_GPIOLIB
diff --git a/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch 
b/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch
index b84ff31..09a2acb 100644
--- a/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch
+++ b/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch
@@ -3,7 +3,7 @@
 @@ -1,6 +1,7 @@
  config SOC_AR5312
bool Atheros 5312/2312+ support
-   depends on ATHEROS_AR231X
+   depends on ATH25
 +  select GPIO_AR5312
 

[OpenWrt-Devel] [PATCH 03/33] atheros: v3.18: rename kernel platform to ath25

2015-03-12 Thread Sergey Ryazanov
Rename platform source directory and asm includes directory.

No functional changes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 116 ++---
 .../patches-3.18/101-early-printk-support.patch|  10 +-
 .../atheros/patches-3.18/102-ar5312_gpio.patch |   8 +-
 .../atheros/patches-3.18/103-ar2315_gpio.patch |   8 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |   8 +-
 .../atheros/patches-3.18/210-reset_button.patch|   6 +-
 6 files changed, 78 insertions(+), 78 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index b7a5f2d..5ecc37c 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -24,31 +24,31 @@
  
  endchoice
  
-+source arch/mips/ar231x/Kconfig
++source arch/mips/ath25/Kconfig
  source arch/mips/alchemy/Kconfig
  source arch/mips/ath79/Kconfig
  source arch/mips/bcm47xx/Kconfig
 --- a/arch/mips/Kbuild.platforms
 +++ b/arch/mips/Kbuild.platforms
-@@ -6,6 +6,7 @@ platforms += ath79
+@@ -2,6 +2,7 @@
+ 
+ platforms += alchemy
+ platforms += ar7
++platforms += ath25
+ platforms += ath79
  platforms += bcm47xx
  platforms += bcm63xx
- platforms += cavium-octeon
-+platforms += ar231x
- platforms += cobalt
- platforms += dec
- platforms += emma
 --- /dev/null
-+++ b/arch/mips/ar231x/Platform
 b/arch/mips/ath25/Platform
 @@ -0,0 +1,6 @@
 +#
 +# Atheros AR531X/AR231X WiSoC
 +#
-+platform-$(CONFIG_ATH25)  += ar231x/
-+cflags-$(CONFIG_ATH25)+= 
-I$(srctree)/arch/mips/include/asm/mach-ar231x
++platform-$(CONFIG_ATH25)  += ath25/
++cflags-$(CONFIG_ATH25)+= 
-I$(srctree)/arch/mips/include/asm/mach-ath25
 +load-$(CONFIG_ATH25)  += 0x80041000
 --- /dev/null
-+++ b/arch/mips/ar231x/Kconfig
 b/arch/mips/ath25/Kconfig
 @@ -0,0 +1,9 @@
 +config SOC_AR5312
 +  bool Atheros 5312/2312+ support
@@ -60,7 +60,7 @@
 +  depends on ATH25
 +  default y
 --- /dev/null
-+++ b/arch/mips/ar231x/Makefile
 b/arch/mips/ath25/Makefile
 @@ -0,0 +1,13 @@
 +#
 +# This file is subject to the terms and conditions of the GNU General Public
@@ -76,7 +76,7 @@
 +obj-$(CONFIG_SOC_AR5312) += ar5312.o
 +obj-$(CONFIG_SOC_AR2315) += ar2315.o
 --- /dev/null
-+++ b/arch/mips/ar231x/board.c
 b/arch/mips/ath25/board.c
 @@ -0,0 +1,229 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -308,7 +308,7 @@
 +}
 +
 --- /dev/null
-+++ b/arch/mips/ar231x/prom.c
 b/arch/mips/ath25/prom.c
 @@ -0,0 +1,37 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -348,10 +348,10 @@
 +{
 +}
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/ar231x_platform.h
 b/arch/mips/include/asm/mach-ath25/ar231x_platform.h
 @@ -0,0 +1,85 @@
-+#ifndef __ASM_MACH_AR231X_PLATFORM_H
-+#define __ASM_MACH_AR231X_PLATFORM_H
++#ifndef __ASM_MACH_ATH25_PLATFORM_H
++#define __ASM_MACH_ATH25_PLATFORM_H
 +
 +#include linux/etherdevice.h
 +
@@ -434,9 +434,9 @@
 +  char *macaddr;
 +};
 +
-+#endif /* __ASM_MACH_AR231X_PLATFORM_H */
++#endif /* __ASM_MACH_ATH25_PLATFORM_H */
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/cpu-feature-overrides.h
 b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
 @@ -0,0 +1,84 @@
 +/*
 + *  Atheros AR231x/AR531x SoC specific CPU feature overrides
@@ -452,8 +452,8 @@
 + *  by the Free Software Foundation.
 + *
 + */
-+#ifndef __ASM_MACH_AR231X_CPU_FEATURE_OVERRIDES_H
-+#define __ASM_MACH_AR231X_CPU_FEATURE_OVERRIDES_H
++#ifndef __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H
++#define __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H
 +
 +/*
 + * The Atheros AR531x/AR231x SoCs have MIPS 4Kc/4KEc core.
@@ -521,9 +521,9 @@
 +/* #define cpu_dcache_line_size() ? */
 +/* #define cpu_icache_line_size() ? */
 +
-+#endif /* __ASM_MACH_AR231X_CPU_FEATURE_OVERRIDES_H */
++#endif /* __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H */
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h
 b/arch/mips/include/asm/mach-ath25/dma-coherence.h
 @@ -0,0 +1,76 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
@@ -534,8 +534,8 @@
 + * Copyright (C) 2007  Felix Fietkau n...@openwrt.org
 + *
 + */
-+#ifndef __ASM_MACH_AR231X_DMA_COHERENCE_H
-+#define __ASM_MACH_AR231X_DMA_COHERENCE_H
++#ifndef __ASM_MACH_ATH25_DMA_COHERENCE_H
++#define __ASM_MACH_ATH25_DMA_COHERENCE_H
 +
 +#include linux/device.h
 +#include ar2315_regs.h
@@ -600,12 +600,12 @@
 +#endif
 +}
 +
-+#endif /* __ASM_MACH_AR231X_DMA_COHERENCE_H */
++#endif /* __ASM_MACH_ATH25_DMA_COHERENCE_H */
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ar231x/gpio.h
 b/arch/mips/include/asm/mach-ath25/gpio.h
 @@ -0,0 +1,16 @@
-+#ifndef __ASM_MACH_AR231X_GPIO_H
-+#define __ASM_MACH_AR231X_GPIO_H
++#ifndef __ASM_MACH_ATH25_GPIO_H
++#define 

[OpenWrt-Devel] [PATCH 04/33] atheros: v3.18: rename platform header

2015-03-12 Thread Sergey Ryazanov
Rename ar231x_platform.h to ath25_platform.h

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch   | 10 +-
 target/linux/atheros/patches-3.18/105-ar2315_pci.patch  |  2 +-
 target/linux/atheros/patches-3.18/110-ar2313_ethernet.patch |  2 +-
 target/linux/atheros/patches-3.18/210-reset_button.patch|  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 5ecc37c..9ad21ed 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -105,7 +105,7 @@
 +#include asm/bootinfo.h
 +#include asm/time.h
 +
-+#include ar231x_platform.h
++#include ath25_platform.h
 +#include devices.h
 +#include ar5312.h
 +#include ar2315.h
@@ -348,7 +348,7 @@
 +{
 +}
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ath25/ar231x_platform.h
 b/arch/mips/include/asm/mach-ath25/ath25_platform.h
 @@ -0,0 +1,85 @@
 +#ifndef __ASM_MACH_ATH25_PLATFORM_H
 +#define __ASM_MACH_ATH25_PLATFORM_H
@@ -1542,7 +1542,7 @@
 +#include linux/irq.h
 +#include linux/io.h
 +
-+#include ar231x_platform.h
++#include ath25_platform.h
 +#include ar5312_regs.h
 +#include ar231x.h
 +#include devices.h
@@ -2021,7 +2021,7 @@
 +#include linux/irq.h
 +#include linux/io.h
 +
-+#include ar231x_platform.h
++#include ath25_platform.h
 +#include ar2315_regs.h
 +#include ar231x.h
 +#include devices.h
@@ -2593,7 +2593,7 @@
 +#include linux/platform_device.h
 +#include asm/bootinfo.h
 +
-+#include ar231x_platform.h
++#include ath25_platform.h
 +#include ar231x.h
 +#include devices.h
 +#include ar5312.h
diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
index e5a8a52..6e398dc 100644
--- a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
@@ -60,7 +60,7 @@
 +#include linux/irq.h
 +#include linux/io.h
 +#include asm/paccess.h
-+#include ar231x_platform.h
++#include ath25_platform.h
 +#include ar231x.h
 +#include ar2315_regs.h
 +
diff --git a/target/linux/atheros/patches-3.18/110-ar2313_ethernet.patch 
b/target/linux/atheros/patches-3.18/110-ar2313_ethernet.patch
index 69d22ed..d1b2df4 100644
--- a/target/linux/atheros/patches-3.18/110-ar2313_ethernet.patch
+++ b/target/linux/atheros/patches-3.18/110-ar2313_ethernet.patch
@@ -1265,7 +1265,7 @@
 +#include linux/interrupt.h
 +#include generated/autoconf.h
 +#include linux/bitops.h
-+#include ar231x_platform.h
++#include ath25_platform.h
 +
 +/* probe link timer - 5 secs */
 +#define LINK_TIMER(5*HZ)
diff --git a/target/linux/atheros/patches-3.18/210-reset_button.patch 
b/target/linux/atheros/patches-3.18/210-reset_button.patch
index 7eee86a..8ba58ed 100644
--- a/target/linux/atheros/patches-3.18/210-reset_button.patch
+++ b/target/linux/atheros/patches-3.18/210-reset_button.patch
@@ -17,7 +17,7 @@
 +#include linux/platform_device.h
 +#include linux/gpio_keys.h
 +#include linux/input.h
-+#include ar231x_platform.h
++#include ath25_platform.h
 +#include ar231x.h
 +#include devices.h
 +
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 27/33] atheros: v3.18: non-functional cleanup

2015-03-12 Thread Sergey Ryazanov
To finally sync code with upsream cleanup registers headers, and update
several comments and kernel config symbols descriptions. No functional
changes.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 701 +
 .../patches-3.18/101-early-printk-support.patch|   5 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |   6 +-
 .../atheros/patches-3.18/107-ar5312_gpio.patch |   4 +-
 .../atheros/patches-3.18/108-ar2315_gpio.patch |  12 +-
 .../atheros/patches-3.18/110-ar2313_ethernet.patch |   6 +-
 6 files changed, 321 insertions(+), 413 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 14ba5c3..03332b6 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -5,7 +5,7 @@
  family: TNETD7100, 7200 and 7300.
  
 +config ATH25
-+  bool Atheros 231x/531x SoC support
++  bool Atheros AR231x/AR531x SoC support
 +  select CEVT_R4K
 +  select CSRC_R4K
 +  select DMA_NONCOHERENT
@@ -15,19 +15,19 @@
 +  select SYS_SUPPORTS_BIG_ENDIAN
 +  select SYS_SUPPORTS_32BIT_KERNEL
 +  help
-+Support for AR231x and AR531x based boards
++Support for Atheros AR231x and Atheros AR531x based boards
 +
  config ATH79
bool Atheros AR71XX/AR724X/AR913X based boards
select ARCH_REQUIRE_GPIOLIB
-@@ -834,6 +847,7 @@ config MIPS_PARAVIRT
- 
+@@ -835,6 +848,7 @@ config MIPS_PARAVIRT
  endchoice
  
-+source arch/mips/ath25/Kconfig
  source arch/mips/alchemy/Kconfig
++source arch/mips/ath25/Kconfig
  source arch/mips/ath79/Kconfig
  source arch/mips/bcm47xx/Kconfig
+ source arch/mips/bcm63xx/Kconfig
 --- a/arch/mips/Kbuild.platforms
 +++ b/arch/mips/Kbuild.platforms
 @@ -2,6 +2,7 @@
@@ -51,12 +51,12 @@
 +++ b/arch/mips/ath25/Kconfig
 @@ -0,0 +1,9 @@
 +config SOC_AR5312
-+  bool Atheros 5312/2312+ support
++  bool Atheros AR5312/AR2312+ SoC support
 +  depends on ATH25
 +  default y
 +
 +config SOC_AR2315
-+  bool Atheros 2315+ support
++  bool Atheros AR2315+ SoC support
 +  depends on ATH25
 +  default y
 --- /dev/null
@@ -77,7 +77,7 @@
 +obj-$(CONFIG_SOC_AR2315) += ar2315.o
 --- /dev/null
 +++ b/arch/mips/ath25/board.c
-@@ -0,0 +1,235 @@
+@@ -0,0 +1,234 @@
 +/*
 + * 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
@@ -266,8 +266,7 @@
 +static void ath25_halt(void)
 +{
 +  local_irq_disable();
-+  while (1)
-+  ;
++  unreachable();
 +}
 +
 +void __init plat_mem_setup(void)
@@ -329,7 +328,7 @@
 + */
 +
 +/*
-+ * Prom setup file for ar231x
++ * Prom setup file for AR5312/AR231x SoCs
 + */
 +
 +#include linux/init.h
@@ -619,7 +618,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315_regs.h
-@@ -0,0 +1,471 @@
+@@ -0,0 +1,410 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -680,174 +679,128 @@
 +#define AR2315_PCI_EXT_SIZE   0x4000
 +
 +/*
-+ * Cold reset register
++ * Configuration registers
 + */
++
++/* Cold reset register */
 +#define AR2315_COLD_RESET 0x
 +
-+#define AR2315_RESET_COLD_AHB  0x0001
-+#define AR2315_RESET_COLD_APB  0x0002
-+#define AR2315_RESET_COLD_CPU  0x0004
-+#define AR2315_RESET_COLD_CPUWARM  0x0008
-+#define AR2315_RESET_SYSTEM   \
-+  (RESET_COLD_CPU |\
-+   RESET_COLD_APB |\
-+   RESET_COLD_AHB)   /* full system */
-+#define AR2317_RESET_SYSTEM0x0010
++#define AR2315_RESET_COLD_AHB 0x0001
++#define AR2315_RESET_COLD_APB 0x0002
++#define AR2315_RESET_COLD_CPU 0x0004
++#define AR2315_RESET_COLD_CPUWARM 0x0008
++#define AR2315_RESET_SYSTEM   (RESET_COLD_CPU |\
++   RESET_COLD_APB |\
++   RESET_COLD_AHB)  /* full system */
++#define AR2317_RESET_SYSTEM   0x0010
 +
-+/*
-+ * Reset register
-+ */
++/* Reset register */
 +#define AR2315_RESET  0x0004
 +
-+/* warm reset WLAN0 MAC */
-+#define AR2315_RESET_WARM_WLAN0_MAC0x0001
-+/* warm reset WLAN0 BaseBand */
-+#define AR2315_RESET_WARM_WLAN0_BB 0x0002
-+/* warm reset MPEG-TS */
-+#define AR2315_RESET_MPEGTS_RSVD   0x0004
-+/* warm reset PCI ahb/dma */
-+#define AR2315_RESET_PCIDMA0x0008
-+/* warm reset memory controller */
-+#define AR2315_RESET_MEMCTL0x0010
-+/* warm reset local bus */
-+#define AR2315_RESET_LOCAL 0x0020
-+/* warm reset I2C bus */
-+#define AR2315_RESET_I2C_RSVD  0x0040
-+/* warm reset SPI interface */
-+#define AR2315_RESET_SPI   

[OpenWrt-Devel] [PATCH 32/33] Rename 'atheros' target to 'ath25'

2015-03-12 Thread Sergey Ryazanov
Rename 'atheros' target to more precise 'ath25'.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 package/kernel/mac80211/Makefile| 6 +++---
 package/kernel/wrt55agv2-spidevs/Makefile   | 2 +-
 target/linux/{atheros = ath25}/Makefile| 2 +-
 target/linux/{atheros = ath25}/base-files/etc/config/system| 0
 .../{atheros = ath25}/base-files/etc/hotplug.d/button/00-button| 0
 target/linux/{atheros = ath25}/base-files/etc/uci-defaults/01_leds | 0
 .../linux/{atheros = ath25}/base-files/etc/uci-defaults/02_network | 0
 .../base-files/lib/preinit/15_preinit_iface_atheros | 0
 target/linux/{atheros = ath25}/base-files/lib/upgrade/platform.sh  | 0
 target/linux/{atheros = ath25}/config-3.18 | 0
 target/linux/{atheros = ath25}/image/Makefile  | 0
 target/linux/{atheros = ath25}/patches-3.18/010-board.patch| 0
 .../{atheros = ath25}/patches-3.18/020-early-printk-support.patch  | 0
 target/linux/{atheros = ath25}/patches-3.18/030-ar2315_pci.patch   | 0
 target/linux/{atheros = ath25}/patches-3.18/107-ar5312_gpio.patch  | 0
 target/linux/{atheros = ath25}/patches-3.18/108-ar2315_gpio.patch  | 0
 .../linux/{atheros = ath25}/patches-3.18/110-ar2313_ethernet.patch | 0
 target/linux/{atheros = ath25}/patches-3.18/120-spiflash.patch | 0
 target/linux/{atheros = ath25}/patches-3.18/130-watchdog.patch | 0
 .../{atheros = ath25}/patches-3.18/140-redboot_boardconfig.patch   | 0
 .../patches-3.18/141-redboot_partition_scan.patch   | 0
 .../patches-3.18/142-redboot_various_erase_size_fix.patch   | 0
 target/linux/{atheros = ath25}/patches-3.18/210-reset_button.patch | 0
 .../patches-3.18/220-enet_micrel_workaround.patch   | 0
 target/linux/{atheros = ath25}/patches-3.18/330-board_leds.patch   | 0
 25 files changed, 5 insertions(+), 5 deletions(-)
 rename target/linux/{atheros = ath25}/Makefile (97%)
 rename target/linux/{atheros = ath25}/base-files/etc/config/system (100%)
 rename target/linux/{atheros = 
ath25}/base-files/etc/hotplug.d/button/00-button (100%)
 rename target/linux/{atheros = ath25}/base-files/etc/uci-defaults/01_leds 
(100%)
 rename target/linux/{atheros = ath25}/base-files/etc/uci-defaults/02_network 
(100%)
 rename target/linux/{atheros = 
ath25}/base-files/lib/preinit/15_preinit_iface_atheros (100%)
 rename target/linux/{atheros = ath25}/base-files/lib/upgrade/platform.sh 
(100%)
 rename target/linux/{atheros = ath25}/config-3.18 (100%)
 rename target/linux/{atheros = ath25}/image/Makefile (100%)
 rename target/linux/{atheros = ath25}/patches-3.18/010-board.patch (100%)
 rename target/linux/{atheros = 
ath25}/patches-3.18/020-early-printk-support.patch (100%)
 rename target/linux/{atheros = ath25}/patches-3.18/030-ar2315_pci.patch (100%)
 rename target/linux/{atheros = ath25}/patches-3.18/107-ar5312_gpio.patch 
(100%)
 rename target/linux/{atheros = ath25}/patches-3.18/108-ar2315_gpio.patch 
(100%)
 rename target/linux/{atheros = ath25}/patches-3.18/110-ar2313_ethernet.patch 
(100%)
 rename target/linux/{atheros = ath25}/patches-3.18/120-spiflash.patch (100%)
 rename target/linux/{atheros = ath25}/patches-3.18/130-watchdog.patch (100%)
 rename target/linux/{atheros = 
ath25}/patches-3.18/140-redboot_boardconfig.patch (100%)
 rename target/linux/{atheros = 
ath25}/patches-3.18/141-redboot_partition_scan.patch (100%)
 rename target/linux/{atheros = 
ath25}/patches-3.18/142-redboot_various_erase_size_fix.patch (100%)
 rename target/linux/{atheros = ath25}/patches-3.18/210-reset_button.patch 
(100%)
 rename target/linux/{atheros = 
ath25}/patches-3.18/220-enet_micrel_workaround.patch (100%)
 rename target/linux/{atheros = ath25}/patches-3.18/330-board_leds.patch (100%)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index e487fe7..6623c5a 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -534,7 +534,7 @@ endef
 define KernelPackage/ath
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros common driver part
-  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_atheros 
+kmod-mac80211
+  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 
+kmod-mac80211
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
   MENU:=1
 endef
@@ -547,7 +547,7 @@ define KernelPackage/ath5k
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 5xxx wireless cards support
   URL:=http://linuxwireless.org/en/users/Drivers/ath5k
-  DEPENDS+= @PCI_SUPPORT||@TARGET_atheros +kmod-ath
+  DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
   AUTOLOAD:=$(call AutoProbe,ath5k)
 endef
@@ -1556,7 +1556,7 @@ config-$(call config_package,ath9k-htc) += ATH9K_HTC
 config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
 
 config-$(call 

[OpenWrt-Devel] [PATCH 33/33] ath25: set myself as maintainer

2015-03-12 Thread Sergey Ryazanov
Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/ath25/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ath25/Makefile b/target/linux/ath25/Makefile
index b1baa2e..ae867e9 100644
--- a/target/linux/ath25/Makefile
+++ b/target/linux/ath25/Makefile
@@ -10,6 +10,7 @@ ARCH:=mips
 BOARD:=ath25
 BOARDNAME:=Atheros AR231x/AR5312
 FEATURES:=squashfs low_mem
+MAINTAINER:=Sergey Ryazanov ryazanov@gmail.com
 
 KERNEL_PATCHVER:=3.18
 
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 07/33] atheros: v3.18: cleanup cpu-feature-overrides.h

2015-03-12 Thread Sergey Ryazanov
Remove mention of undefined features.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch | 22 +-
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index abf1964..b224c35 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -436,7 +436,7 @@
 +#endif /* __ASM_MACH_ATH25_PLATFORM_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
-@@ -0,0 +1,84 @@
+@@ -0,0 +1,64 @@
 +/*
 + *  Atheros AR231x/AR531x SoC specific CPU feature overrides
 + *
@@ -466,13 +466,6 @@
 +#define cpu_has_fpu   0
 +#define cpu_has_32fpr 0
 +#define cpu_has_counter   1
-+/* #define cpu_has_watch  ? */
-+/* #define cpu_has_divec  ? */
-+/* #define cpu_has_vce? */
-+/* #define cpu_has_cache_cdex_p   ? */
-+/* #define cpu_has_cache_cdex_s   ? */
-+/* #define cpu_has_prefetch   ? */
-+/* #define cpu_has_mcheck ? */
 +#define cpu_has_ejtag 1
 +
 +#if !defined(CONFIG_SOC_AR5312)
@@ -490,13 +483,6 @@
 +#define cpu_has_mips3d0
 +#define cpu_has_smartmips 0
 +
-+/* #define cpu_has_vtag_icache? */
-+/* #define cpu_has_dc_aliases ? */
-+/* #define cpu_has_ic_fills_f_dc  ? */
-+/* #define cpu_has_pindexed_dcache? */
-+
-+/* #define cpu_icache_snoops_remote_store ? */
-+
 +#define cpu_has_mips32r1  1
 +
 +#if !defined(CONFIG_SOC_AR5312)
@@ -509,17 +495,11 @@
 +#define cpu_has_dsp   0
 +#define cpu_has_mipsmt0
 +
-+/* #define cpu_has_nofpuex? */
 +#define cpu_has_64bits0
 +#define cpu_has_64bit_zero_reg0
 +#define cpu_has_64bit_gp_regs 0
 +#define cpu_has_64bit_addresses   0
 +
-+/* #define cpu_has_inclusive_pcaches  ? */
-+
-+/* #define cpu_dcache_line_size() ? */
-+/* #define cpu_icache_line_size() ? */
-+
 +#endif /* __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/dma-coherence.h
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 05/33] atheros: v3.18: remove odd header reset.h

2015-03-12 Thread Sergey Ryazanov
This header provides prototype for function without realization and
users.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch | 9 -
 1 file changed, 9 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 9ad21ed..e86bb48 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -621,15 +621,6 @@
 +
 +#endif/* __ASM_MACH_ATH25_GPIO_H */
 --- /dev/null
-+++ b/arch/mips/include/asm/mach-ath25/reset.h
-@@ -0,0 +1,6 @@
-+#ifndef __ASM_MACH_ATH25_RESET_H
-+#define __ASM_MACH_ATH25_RESET_H
-+
-+void ar231x_disable_reset_button(void);
-+
-+#endif /* __ASM_MACH_ATH25_RESET_H */
 /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/war.h
 @@ -0,0 +1,25 @@
 +/*
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 11/33] atheros: v3.18: rework early initialization

2015-03-12 Thread Sergey Ryazanov
Do not use prom_init() callback, do memory initialization in
plat_mem_setup() callback and move serial port configuration to
arch_initcall stage.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 71 +++---
 .../atheros/patches-3.18/105-ar2315_pci.patch  | 20 ++
 2 files changed, 40 insertions(+), 51 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index 1e39990..2099514 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -314,7 +314,7 @@
 +}
 --- /dev/null
 +++ b/arch/mips/ath25/prom.c
-@@ -0,0 +1,40 @@
+@@ -0,0 +1,26 @@
 +/*
 + * 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
@@ -332,24 +332,10 @@
 + */
 +
 +#include linux/init.h
-+#include generated/autoconf.h
-+#include linux/kernel.h
-+#include linux/string.h
-+#include linux/mm.h
-+#include linux/bootmem.h
-+
 +#include asm/bootinfo.h
-+#include asm/addrspace.h
-+#include ar5312.h
-+#include ar2315.h
-+#include devices.h
 +
 +void __init prom_init(void)
 +{
-+  if (is_ar5312())
-+  ar5312_prom_init();
-+  else
-+  ar2315_prom_init();
 +}
 +
 +void __init prom_free_prom_memory(void)
@@ -1486,7 +1472,7 @@
 +#endif/* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,450 @@
+@@ -0,0 +1,449 @@
 +/*
 + * 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
@@ -1904,8 +1890,7 @@
 +  mips_hpt_frequency = ar5312_cpu_frequency() / 2;
 +}
 +
-+void __init
-+ar5312_prom_init(void)
++void __init ar5312_plat_mem_setup(void)
 +{
 +  u32 memsize, memcfg, bank0AC, bank1AC;
 +  u32 devid;
@@ -1923,20 +1908,20 @@
 +  devid = AR5312_REV_WMAC_MIN_S;
 +  devid = AR5312_REV_CHIP;
 +  ath25_board.devid = (u16)devid;
-+}
 +
-+void __init ar5312_plat_mem_setup(void)
-+{
 +  /* Clear any lingering AHB errors */
 +  ar231x_read_reg(AR5312_PROCADDR);
 +  ar231x_read_reg(AR5312_DMAADDR);
 +  ar231x_write_reg(AR5312_WD_CTRL, AR5312_WD_CTRL_IGNORE_EXPIRATION);
 +
 +  _machine_restart = ar5312_restart;
++}
++
++void __init ar5312_arch_init(void)
++{
 +  ath25_serial_setup(AR5312_UART0, AR5312_MISC_IRQ_UART0,
 + ar5312_sys_frequency());
 +}
-+
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315.c
 @@ -0,0 +1,401 @@
@@ -2294,10 +2279,11 @@
 +  mips_hpt_frequency = ar2315_cpu_frequency() / 2;
 +}
 +
-+void __init
-+ar2315_prom_init(void)
++void __init ar2315_plat_mem_setup(void)
 +{
-+  u32 memsize, memcfg, devid;
++  u32 memsize, memcfg;
++  u32 devid;
++  u32 config;
 +
 +  memcfg = ar231x_read_reg(AR2315_MEM_CFG);
 +  memsize   = 1 + ((memcfg  SDRAM_DATA_WIDTH_M)  SDRAM_DATA_WIDTH_S);
@@ -2324,11 +2310,6 @@
 +  break;
 +  }
 +  ath25_board.devid = devid;
-+}
-+
-+void __init ar2315_plat_mem_setup(void)
-+{
-+  u32 config;
 +
 +  /* Clear any lingering AHB errors */
 +  config = read_c0_config();
@@ -2338,6 +2319,10 @@
 +  ar231x_write_reg(AR2315_WDC, AR2315_WDC_IGNORE_EXPIRATION);
 +
 +  _machine_restart = ar2315_restart;
++}
++
++void __init ar2315_arch_init(void)
++{
 +  ath25_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0,
 + ar2315_apb_frequency());
 +}
@@ -2352,8 +2337,8 @@
 +void ar2315_arch_init_irq(void);
 +void ar2315_init_devices(void);
 +void ar2315_plat_time_init(void);
-+void ar2315_prom_init(void);
 +void ar2315_plat_mem_setup(void);
++void ar2315_arch_init(void);
 +
 +#else
 +
@@ -2369,11 +2354,11 @@
 +{
 +}
 +
-+static inline void ar2315_prom_init(void)
++static inline void ar2315_plat_mem_setup(void)
 +{
 +}
 +
-+static inline void ar2315_plat_mem_setup(void)
++static inline void ar2315_arch_init(void)
 +{
 +}
 +
@@ -2391,8 +2376,8 @@
 +void ar5312_arch_init_irq(void);
 +void ar5312_init_devices(void);
 +void ar5312_plat_time_init(void);
-+void ar5312_prom_init(void);
 +void ar5312_plat_mem_setup(void);
++void ar5312_arch_init(void);
 +
 +#else
 +
@@ -2408,11 +2393,11 @@
 +{
 +}
 +
-+static inline void ar5312_prom_init(void)
++static inline void ar5312_plat_mem_setup(void)
 +{
 +}
 +
-+static inline void ar5312_plat_mem_setup(void)
++static inline void ar5312_arch_init(void)
 +{
 +}
 +
@@ -2504,7 +2489,7 @@
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.c
-@@ -0,0 +1,180 @@
+@@ -0,0 +1,192 @@
 +#include linux/kernel.h
 +#include linux/init.h
 +#include linux/serial.h
@@ -2685,3 +2670,15 @@
 +}
 +
 +device_initcall(ath25_register_devices);
++
++static int __init ath25_arch_init(void)
++{
++  if (is_ar5312())
++  ar5312_arch_init();
++  else
++  

[OpenWrt-Devel] [PATCH 10/33] atheros: v3.18: rearrange interrupt handling functions

2015-03-12 Thread Sergey Ryazanov
No functional changes, just change functions order in source file.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 142 ++---
 .../atheros/patches-3.18/105-ar2315_pci.patch  |   2 +-
 2 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index c28a1d8..1e39990 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -1526,6 +1526,25 @@
 +#include devices.h
 +#include ar5312.h
 +
++static irqreturn_t ar5312_ahb_err_handler(int cpl, void *dev_id)
++{
++  u32 proc1 = ar231x_read_reg(AR5312_PROC1);
++  u32 proc_addr = ar231x_read_reg(AR5312_PROCADDR); /* clears error */
++  u32 dma1 = ar231x_read_reg(AR5312_DMA1);
++  u32 dma_addr = ar231x_read_reg(AR5312_DMAADDR);   /* clears error */
++
++  pr_emerg(AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x 
DMA1=0x%8.8x\n,
++   proc_addr, proc1, dma_addr, dma1);
++
++  machine_restart(AHB error); /* Catastrophic failure */
++  return IRQ_HANDLED;
++}
++
++static struct irqaction ar5312_ahb_err_interrupt  = {
++  .handler = ar5312_ahb_err_handler,
++  .name= ar5312-ahb-error,
++};
++
 +static void ar5312_misc_irq_handler(unsigned irq, struct irq_desc *desc)
 +{
 +  unsigned int ar231x_misc_intrs = ar231x_read_reg(AR5312_ISR) 
@@ -1544,26 +1563,6 @@
 +  spurious_interrupt();
 +}
 +
-+static void ar5312_irq_dispatch(void)
-+{
-+  int pending = read_c0_status()  read_c0_cause();
-+
-+  if (pending  CAUSEF_IP2)
-+  do_IRQ(AR5312_IRQ_WLAN0_INTRS);
-+  else if (pending  CAUSEF_IP3)
-+  do_IRQ(AR5312_IRQ_ENET0_INTRS);
-+  else if (pending  CAUSEF_IP4)
-+  do_IRQ(AR5312_IRQ_ENET1_INTRS);
-+  else if (pending  CAUSEF_IP5)
-+  do_IRQ(AR5312_IRQ_WLAN1_INTRS);
-+  else if (pending  CAUSEF_IP6)
-+  do_IRQ(AR5312_IRQ_MISC_INTRS);
-+  else if (pending  CAUSEF_IP7)
-+  do_IRQ(AR231X_IRQ_CPU_CLOCK);
-+  else
-+  spurious_interrupt();
-+}
-+
 +/* Enable the specified AR5312_MISC_IRQ interrupt */
 +static void ar5312_misc_irq_unmask(struct irq_data *d)
 +{
@@ -1591,25 +1590,26 @@
 +  .irq_mask   = ar5312_misc_irq_mask,
 +};
 +
-+static irqreturn_t ar5312_ahb_err_handler(int cpl, void *dev_id)
++static void ar5312_irq_dispatch(void)
 +{
-+  u32 proc1 = ar231x_read_reg(AR5312_PROC1);
-+  u32 proc_addr = ar231x_read_reg(AR5312_PROCADDR); /* clears error */
-+  u32 dma1 = ar231x_read_reg(AR5312_DMA1);
-+  u32 dma_addr = ar231x_read_reg(AR5312_DMAADDR);   /* clears error */
-+
-+  pr_emerg(AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x DMAADDR=0x%8.8x 
DMA1=0x%8.8x\n,
-+   proc_addr, proc1, dma_addr, dma1);
++  int pending = read_c0_status()  read_c0_cause();
 +
-+  machine_restart(AHB error); /* Catastrophic failure */
-+  return IRQ_HANDLED;
++  if (pending  CAUSEF_IP2)
++  do_IRQ(AR5312_IRQ_WLAN0_INTRS);
++  else if (pending  CAUSEF_IP3)
++  do_IRQ(AR5312_IRQ_ENET0_INTRS);
++  else if (pending  CAUSEF_IP4)
++  do_IRQ(AR5312_IRQ_ENET1_INTRS);
++  else if (pending  CAUSEF_IP5)
++  do_IRQ(AR5312_IRQ_WLAN1_INTRS);
++  else if (pending  CAUSEF_IP6)
++  do_IRQ(AR5312_IRQ_MISC_INTRS);
++  else if (pending  CAUSEF_IP7)
++  do_IRQ(AR231X_IRQ_CPU_CLOCK);
++  else
++  spurious_interrupt();
 +}
 +
-+static struct irqaction ar5312_ahb_err_interrupt  = {
-+  .handler = ar5312_ahb_err_handler,
-+  .name= ar5312-ahb-error,
-+};
-+
 +void __init ar5312_arch_init_irq(void)
 +{
 +  int i;
@@ -1979,6 +1979,22 @@
 +#include devices.h
 +#include ar2315.h
 +
++static irqreturn_t ar2315_ahb_err_handler(int cpl, void *dev_id)
++{
++  ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET);
++  ar231x_read_reg(AR2315_AHB_ERR1);
++
++  pr_emerg(AHB fatal error\n);
++  machine_restart(AHB error); /* Catastrophic failure */
++
++  return IRQ_HANDLED;
++}
++
++static struct irqaction ar2315_ahb_err_interrupt  = {
++  .handler= ar2315_ahb_err_handler,
++  .name   = ar2315-ahb-error,
++};
++
 +static void ar2315_misc_irq_handler(unsigned irq, struct irq_desc *desc)
 +{
 +  unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) 
@@ -2002,30 +2018,6 @@
 +  spurious_interrupt();
 +}
 +
-+/*
-+ * Called when an interrupt is received, this function
-+ * determines exactly which interrupt it was, and it
-+ * invokes the appropriate handler.
-+ *
-+ * Implicitly, we also define interrupt priority by
-+ * choosing which to dispatch first.
-+ */
-+static void ar2315_irq_dispatch(void)
-+{
-+  int pending = read_c0_status()  read_c0_cause();
-+
-+  

[OpenWrt-Devel] [PATCH 19/33] atheros: v3.18: remap main SoC MMR memory

2015-03-12 Thread Sergey Ryazanov
Honestly remap main SoC MMR mem and use accessor functions to
interact with registers. Now registers defined relatively to base
address (e.g. SDRAM controller base address).

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/100-board.patch  | 409 -
 .../atheros/patches-3.18/102-ar5312_gpio.patch |   8 +-
 .../atheros/patches-3.18/103-ar2315_gpio.patch |   8 +-
 .../atheros/patches-3.18/105-ar2315_pci.patch  |  30 +-
 4 files changed, 252 insertions(+), 203 deletions(-)

diff --git a/target/linux/atheros/patches-3.18/100-board.patch 
b/target/linux/atheros/patches-3.18/100-board.patch
index f4f79d8..afb8217 100644
--- a/target/linux/atheros/patches-3.18/100-board.patch
+++ b/target/linux/atheros/patches-3.18/100-board.patch
@@ -629,7 +629,7 @@
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ar2315_regs.h
-@@ -0,0 +1,470 @@
+@@ -0,0 +1,480 @@
 +/*
 + * Register definitions for AR2315+
 + *
@@ -676,10 +676,12 @@
 +#define AR2315_WLAN00x1000  /* Wireless MMR */
 +#define AR2315_PCI  0x1010  /* PCI MMR */
 +#define AR2315_PCI_SIZE   0x1000
-+#define AR2315_SDRAMCTL 0x1030  /* SDRAM MMR */
-+#define AR2315_LOCAL0x1040  /* LOCAL BUS MMR */
++#define AR2315_SDRAMCTL_BASE  0x1030  /* SDRAM MMR */
++#define AR2315_SDRAMCTL_SIZE  0x0020
++#define AR2315_LOCAL_BASE 0x1040  /* Local bus MMR */
 +#define AR2315_ENET00x1050  /* ETHERNET MMR */
-+#define AR2315_DSLBASE  0x1100  /* RESET CONTROL MMR */
++#define AR2315_RST_BASE   0x1100  /* Reset control MMR */
++#define AR2315_RST_SIZE   0x0100
 +#define AR2315_UART00x1110  /* UART MMR */
 +#define AR2315_SPI_MMR  0x1130  /* SPI FLASH MMR */
 +#define AR2315_PCIEXT   0x8000  /* pci external */
@@ -691,7 +693,7 @@
 +/*
 + * Cold reset register
 + */
-+#define AR2315_COLD_RESET   (AR2315_DSLBASE + 0x)
++#define AR2315_COLD_RESET 0x
 +
 +#define AR2315_RESET_COLD_AHB  0x0001
 +#define AR2315_RESET_COLD_APB  0x0002
@@ -706,7 +708,7 @@
 +/*
 + * Reset register
 + */
-+#define AR2315_RESET(AR2315_DSLBASE + 0x0004)
++#define AR2315_RESET  0x0004
 +
 +/* warm reset WLAN0 MAC */
 +#define AR2315_RESET_WARM_WLAN0_MAC0x0001
@@ -736,7 +738,7 @@
 +/*
 + * AHB master arbitration control
 + */
-+#define AR2315_AHB_ARB_CTL  (AR2315_DSLBASE + 0x0008)
++#define AR2315_AHB_ARB_CTL0x0008
 +
 +/* CPU, default */
 +#define AR2315_ARB_CPU 0x0001
@@ -756,7 +758,7 @@
 +/*
 + * Config Register
 + */
-+#define AR2315_ENDIAN_CTL   (AR2315_DSLBASE + 0x000c)
++#define AR2315_ENDIAN_CTL 0x000c
 +
 +/* EC - AHB bridge endianess */
 +#define AR2315_CONFIG_AHB  0x0001
@@ -789,14 +791,14 @@
 +/*
 + * NMI control
 + */
-+#define AR2315_NMI_CTL  (AR2315_DSLBASE + 0x0010)
++#define AR2315_NMI_CTL0x0010
 +
 +#define AR2315_NMI_EN  1
 +
 +/*
 + * Revision Register - Initial value is 0x3010 (WMAC 3.0, AR231X 1.0).
 + */
-+#define AR2315_SREV (AR2315_DSLBASE + 0x0014)
++#define AR2315_SREV   0x0014
 +
 +#define AR2315_REV_MAJ 0x00f0
 +#define AR2315_REV_MAJ_S   4
@@ -807,7 +809,7 @@
 +/*
 + * Interface Enable
 + */
-+#define AR2315_IF_CTL   (AR2315_DSLBASE + 0x0018)
++#define AR2315_IF_CTL 0x0018
 +
 +#define AR2315_IF_MASK 0x0007
 +#define AR2315_IF_DISABLED 0
@@ -829,9 +831,9 @@
 + * APB Interrupt control
 + */
 +
-+#define AR2315_ISR  (AR2315_DSLBASE + 0x0020)
-+#define AR2315_IMR  (AR2315_DSLBASE + 0x0024)
-+#define AR2315_GISR (AR2315_DSLBASE + 0x0028)
++#define AR2315_ISR0x0020
++#define AR2315_IMR0x0024
++#define AR2315_GISR   0x0028
 +
 +#define AR2315_ISR_UART0  0x0001   /* high speed UART */
 +#define AR2315_ISR_I2C_RSVD   0x0002   /* I2C bus */
@@ -854,10 +856,11 @@
 +/*
 + * Timers
 + */
-+#define AR2315_TIMER(AR2315_DSLBASE + 0x0030)
-+#define AR2315_RELOAD   (AR2315_DSLBASE + 0x0034)
-+#define AR2315_WD   (AR2315_DSLBASE + 0x0038)
-+#define AR2315_WDC  (AR2315_DSLBASE + 0x003c)
++#define AR2315_TIMER  0x0030
++#define AR2315_RELOAD 0x0034
++
++#define AR2315_WD 0x0038
++#define AR2315_WDC0x003c
 +
 +#define AR2315_WDC_IGNORE_EXPIRATION  0x
 +#define AR2315_WDC_NMI0x0001  /* NMI on 
watchdog */
@@ -866,8 +869,8 @@
 +/*
 + * CPU Performance Counters
 + */

[OpenWrt-Devel] [PATCH 24/33] atheros: v3.18: move GPIO patches behind PCI

2015-03-12 Thread Sergey Ryazanov
Move GPIO patches behind PCI patch, since they are not yet merged
upstream.

Signed-off-by: Sergey Ryazanov ryazanov@gmail.com
---
 target/linux/atheros/patches-3.18/105-ar2315_pci.patch| 6 +++---
 .../patches-3.18/{102-ar5312_gpio.patch = 107-ar5312_gpio.patch} | 0
 .../patches-3.18/{103-ar2315_gpio.patch = 108-ar2315_gpio.patch} | 8 +---
 3 files changed, 8 insertions(+), 6 deletions(-)
 rename target/linux/atheros/patches-3.18/{102-ar5312_gpio.patch = 
107-ar5312_gpio.patch} (100%)
 rename target/linux/atheros/patches-3.18/{103-ar2315_gpio.patch = 
108-ar2315_gpio.patch} (98%)

diff --git a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch 
b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
index 4de4f3a..8e3dfa1 100644
--- a/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.18/105-ar2315_pci.patch
@@ -524,9 +524,9 @@
 +}
 --- a/arch/mips/ath25/Kconfig
 +++ b/arch/mips/ath25/Kconfig
-@@ -9,3 +9,10 @@ config SOC_AR2315
+@@ -7,3 +7,10 @@ config SOC_AR2315
+   bool Atheros 2315+ support
depends on ATH25
-   select GPIO_AR2315
default y
 +
 +config PCI_AR2315
@@ -548,7 +548,7 @@
else if (pending  CAUSEF_IP2)
do_IRQ(AR2315_IRQ_MISC);
else if (pending  CAUSEF_IP7)
-@@ -460,10 +464,62 @@ void __init ar2315_plat_mem_setup(void)
+@@ -429,10 +433,62 @@ void __init ar2315_plat_mem_setup(void)
_machine_restart = ar2315_restart;
  }
  
diff --git a/target/linux/atheros/patches-3.18/102-ar5312_gpio.patch 
b/target/linux/atheros/patches-3.18/107-ar5312_gpio.patch
similarity index 100%
rename from target/linux/atheros/patches-3.18/102-ar5312_gpio.patch
rename to target/linux/atheros/patches-3.18/107-ar5312_gpio.patch
diff --git a/target/linux/atheros/patches-3.18/103-ar2315_gpio.patch 
b/target/linux/atheros/patches-3.18/108-ar2315_gpio.patch
similarity index 98%
rename from target/linux/atheros/patches-3.18/103-ar2315_gpio.patch
rename to target/linux/atheros/patches-3.18/108-ar2315_gpio.patch
index 4b81171..d85fc15 100644
--- a/target/linux/atheros/patches-3.18/103-ar2315_gpio.patch
+++ b/target/linux/atheros/patches-3.18/108-ar2315_gpio.patch
@@ -1,14 +1,16 @@
 --- a/arch/mips/ath25/Kconfig
 +++ b/arch/mips/ath25/Kconfig
-@@ -7,4 +7,5 @@ config SOC_AR5312
+@@ -7,6 +7,7 @@ config SOC_AR5312
  config SOC_AR2315
bool Atheros 2315+ support
depends on ATH25
 +  select GPIO_AR2315
default y
+ 
+ config PCI_AR2315
 --- a/arch/mips/ath25/ar2315.c
 +++ b/arch/mips/ath25/ar2315.c
-@@ -236,6 +236,32 @@ static struct platform_device ar2315_wdt
+@@ -240,6 +240,32 @@ static struct platform_device ar2315_wdt
.num_resources = ARRAY_SIZE(ar2315_wdt_res)
  };
  
@@ -41,7 +43,7 @@
  #ifdef CONFIG_LEDS_GPIO
  static struct gpio_led ar2315_leds[6];
  static struct gpio_led_platform_data ar2315_led_data = {
-@@ -286,6 +312,11 @@ void __init ar2315_init_devices(void)
+@@ -290,6 +316,11 @@ void __init ar2315_init_devices(void)
ath25_find_config(AR2315_SPI_READ_BASE, AR2315_SPI_READ_SIZE);
ar2315_eth_data.macaddr = ath25_board.config-enet0_mac;
  
-- 
2.0.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ?????? How toCustom admin page on openwrt ?

2015-03-12 Thread Tymon
strange, how can the cgi or uhttp translate myrouter.site1 to gateway ip(i.e. 
your router, default is 192.168.1.1) ?
 
--
Regards,

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


 




-- Original message --
From: Ben Mulvihill; 
Sendtime: Thursday, Mar 12, 2015 6:27 PM
To: Tymon; 
Cc: Claudio Thomas; openwrt-devel; 
Subject: Re: [OpenWrt-Devel] ??  How toCustom  admin page on openwrt ?



Surely it is possible to do this using dnsmasq? I have something
like this in my /etc/config/dhcp file:

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
list rebind_domain 'site2'
list server '/site2/10.121.1.1'
option local '/site1/'
option domain 'site'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'

My local domain is 'site1', so I can access my router
in a browser at the address 'myrouter.site1' , which
it I have understood correctly is what you are 
trying to do, right?
(Note that I also have a vpn to another local network
with domain 'site2', and can access the router there
at 'myotherrouter.site2')

Check the various configuration options I use in the 
dnsmasq documentation, because it is some time since
I set this up and I don't remember the details.
The 'server' and 'rebind_domain' are for the vpn,
so you shouldn't need those.

Or have I misunderstood the question?

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


Re: [OpenWrt-Devel] [PATCH 1/2] toolchain: The glorious return of glibc, ver 2.21

2015-03-12 Thread John Crispin


On 12/03/2015 20:22, Mirko Vogt wrote:
 On 03/11/2015 06:17 PM, Jeff Waugh wrote:
 It's the eglibc packaging with a bit of spit-polishing. And testing. :-)

 Signed-off-by: Jeff Waugh j...@bethesignal.org
 [..]
 
 On 03/11/2015 06:02 PM, Jeff Waugh wrote:
 With
 those applied, a default (VoCore, mipsel) build completes
 successfully.
 
 Please don't just compile test. Right now /usr/lib is not added as a
 searchable path for so-libs which renders it pretty much unusable.
 That was what the now missing patch 200-add-dl-search-paths.patch dealt
 with.
 
   mirko

already fixed :) i will push jeffs patch with a few minor fixes in the
next hour or so

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] [PATCH 1/2] toolchain: The glorious return of glibc, ver 2.21

2015-03-12 Thread Mirko Vogt
On 03/11/2015 06:17 PM, Jeff Waugh wrote:
 It's the eglibc packaging with a bit of spit-polishing. And testing. :-)
 
 Signed-off-by: Jeff Waugh j...@bethesignal.org
 [..]

On 03/11/2015 06:02 PM, Jeff Waugh wrote:
 With
 those applied, a default (VoCore, mipsel) build completes
 successfully.

Please don't just compile test. Right now /usr/lib is not added as a
searchable path for so-libs which renders it pretty much unusable.
That was what the now missing patch 200-add-dl-search-paths.patch dealt
with.

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


[OpenWrt-Devel] [PATCH] rules.mk: add newline definition

2015-03-12 Thread Alexandru Ardelean
To be used for stuff like $(subst $(space),$(newline),$(SOME_VAR))

Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 rules.mk | 5 +
 1 file changed, 5 insertions(+)

diff --git a/rules.mk b/rules.mk
index 078ebe3..e61cc3f 100644
--- a/rules.mk
+++ b/rules.mk
@@ -30,6 +30,11 @@ define sep
 
 endef
 
+define newline
+
+
+endef
+
 _SINGLE=export MAKEFLAGS=$(space);
 CFLAGS:=
 ARCH:=$(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(call 
qstrip,$(CONFIG_ARCH)
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Xilinx Zynq zedboard integration

2015-03-12 Thread Roman Yeryomin
Hi!

Sorry I was not replying. Was busy changing my day job.

So... your board is configured to use some rsa boot, what is probably
is some signed image. And u-boot environment is real mess :)
I suggest you to try configuring to use regular nandboot. AFAIK, you
can just type nandboot (or whichever storage you use) in u-boot
console, not changing the environment.

Regards,
Roman

On 22 January 2015 at 02:55, Javier Domingo Cansino javier...@gmail.com wrote:
 Ok, I have narrowed the problem to something with the compilation of the
 kernel. I think it's more an incompatibility between xilinx and linux
 patches, because the kernel fails to boot even if build by hand from the
 build_dir.

 I will try to split the patch in more digestible parts, and see if I catch
 the error... Or maybe disable the openwrt patches and see where they can be
 colliding.

 On Wed, Jan 21, 2015 at 1:24 AM, Javier Domingo Cansino
 javier...@gmail.com wrote:

 After hitting against this wall for a lot, I found a bug in my few lines
 of code, I was creating the uImage file from vmlinux instead of from
 zImage[1].

 I am still doing something wrong, because substituting the uImage
 generated from buildroot in the SD card (and leaving the rest of the files),
 makes at least the kernel boot, although crashes in sec 0.00, at least
 prints booting.

 I have discovered that after Starting kernel ... there should be a
 Uncompressing Linux... done, booting the kernel. line. So I am still doing
 something wrong on the uImage generation, and I don't know what.

 Moreover, I have compiled the uImage like the following, and it get's to
 the kernel panic at least:
 make -j9 HOSTCC=/usr/bin/gcc HOSTCFLAGS= ARCH=arm  CROSS_COMPILE=
 /home/javier/proyectos/master/master-sce/buildroot/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-
 LOADADDR=0x8000 uImage

 If you could tell me which should be the Image/BuildKernel part, I would
 be really appreciate it.

 target/linux/zynq/image/Makefile
 ===

 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk

 define Build/Compile
  $(call Build/Compile/Default, zynq_zed.dtb)
 endef

 define Image/BuildKernel/Initramfs
  (cd $(TARGET_DIR); \
   find . | cpio -o -H newc | gzip -9 $(KDIR)/zedboard-rootfs.cpio.gz )
  mkimage -A arm -T ramdisk -C none -d $(KDIR)/zedboard-rootfs.cpio.gz \
   $(BIN_DIR)/zedboard-uramdisk.image.gz
 endef

 define Image/BuildKernel
  mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 \
  -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
  -d $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/zedboard-uImage
 endef

 define Image/Prepare
  $(LINUX_DIR)/scripts/dtc/dtc -O dtb \
   $(LINUX_DIR)/arch/arm/boot/dts/zynq-zed.dts  $(BIN_DIR)/zedboard.dtb
 endef

 $(eval $(call BuildImage))

 ===

 [1] Bug I should have found a lot of time ago:
 https://github.com/txomon/openwrt/commit/5e882bc2f14580f62a6ad78ddc57033d207261f9

 Cheers

 On Sun, Jun 29, 2014 at 1:35 PM, Javier Domingo Cansino
 javier...@gmail.com wrote:

 I have manually executed the boot sequence in the uboot, and the result
 is that it fails on the command bootm loados. Any idea on how to debug what
 can be wrong?

 Cheers and I will keep searching,

 Javier Domingo Cansino

 zynq-uboot fatload mmc 0 0x300 uImage
 reading uImage
 4582152 bytes read in 405 ms (10.8 MiB/s)
 zynq-uboot fatload mmc 0 0x2A0 devicetree.dtb
 reading devicetree.dtb
 2739 bytes read in 15 ms (177.7 KiB/s)
 zynq-uboot fatload mmc 0 0x200 uramdisk.image.gz
 reading uramdisk.image.gz
 796339 bytes read in 87 ms (8.7 MiB/s)
 zynq-uboot help bootm
 bootm - boot application image from memory

 Usage:
 bootm [addr [arg ...]]
 - boot application image stored in memory
 passing arguments 'arg ...'; when booting a Linux kernel,
 'arg' can be the address of an initrd image
 When booting a Linux kernel which requires a flat device-tree
 a third argument is required which is the address of the
 device-tree blob. To boot that kernel without an initrd image,
 use a '-' for the second argument. If you do not pass a third
 a bd_info struct will be passed instead

 For the new multi component uImage format (FIT) addresses
 must be extened to include component or configuration unit name:
 addr:subimg_uname - direct component image specification
 addr#conf_uname   - configuration specification
 Use iminfo command to get the list of existing component
 images and configurations.

 Sub-commands to do part of the bootm sequence.  The sub-commands must be
 issued in the order below (it's ok to not issue all sub-commands):
 start [addr [arg ...]]
 loados  - load OS image
 ramdisk - relocate initrd, set env initrd_start/initrd_end
 fdt - relocate flat device tree
 cmdline - OS specific command line processing/setup
 bdt - OS specific bd_t 

Re: [OpenWrt-Devel] Ubiquiti AirOS7 is based on openwrt r40432

2015-03-12 Thread Nemesis
On 03/12/2015 02:12 PM, Bastian Bittorf wrote:
 * Nemesis neme...@ninux.org [12.03.2015 14:08]:
 Anybody else has studied this code and found out anything interesting?
 8-)))

 see, they use an acient php from:
 http://museum.php.net/php2/

I've noticed, why is that?

I also noticed some mysql stuff, what do they use it for?

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


Re: [OpenWrt-Devel] Xilinx Zynq zedboard integration

2015-03-12 Thread Javier Domingo Cansino
Hey!! How long!!!

I have narrowed down the problem to the kernel, as it doesn't even do an
early_printk. I compiled manually the kernel from Xilinx's latest tag, and
substituted it in the SD (leaving the rest of openwrt generated files: fs,
uboot and FSBL), and managed to print some traces till crashing. Therefore,
the problem is the uImage.

John updated kernels a while ago, and I thought that as Xilinx is
submitting patches upstream, maybe there was already enough support
upstream (in one of the latest releases) to avoid a patch. I tested that
but didn't get it working, so I will at the end really need to dissect the
latest Xilinx diff to know the problem.

I haven't been in the kernel world for a long time (and never been good
really) so I will need my time to be able to cleanly divide the patches.
Also, I had thought about the other method, disabling openwrt patches to
find out the problem, but at the end the Xilinx diffs would be needed.

The Xilinx code basically focuses on it's main architectures. Microblaze,
PowerPC and arm now. I could be leaving the microblaze / powerPC out of the
quiz, but I would still need to know what is failing. They have some
driver, as the icap one, and some support for their devices.

If you wish to, I can upload the latest relevant diff I can obtain to
github and we can iterate over it.



On Thu, Mar 12, 2015 at 11:00 PM Roman Yeryomin leroi.li...@gmail.com
wrote:

 Hi!

 Sorry I was not replying. Was busy changing my day job.

 So... your board is configured to use some rsa boot, what is probably
 is some signed image. And u-boot environment is real mess :)
 I suggest you to try configuring to use regular nandboot. AFAIK, you
 can just type nandboot (or whichever storage you use) in u-boot
 console, not changing the environment.

 Regards,
 Roman

 On 22 January 2015 at 02:55, Javier Domingo Cansino javier...@gmail.com
 wrote:
  Ok, I have narrowed the problem to something with the compilation of the
  kernel. I think it's more an incompatibility between xilinx and linux
  patches, because the kernel fails to boot even if build by hand from the
  build_dir.
 
  I will try to split the patch in more digestible parts, and see if I
 catch
  the error... Or maybe disable the openwrt patches and see where they can
 be
  colliding.
 
  On Wed, Jan 21, 2015 at 1:24 AM, Javier Domingo Cansino
  javier...@gmail.com wrote:
 
  After hitting against this wall for a lot, I found a bug in my few lines
  of code, I was creating the uImage file from vmlinux instead of from
  zImage[1].
 
  I am still doing something wrong, because substituting the uImage
  generated from buildroot in the SD card (and leaving the rest of the
 files),
  makes at least the kernel boot, although crashes in sec 0.00, at
 least
  prints booting.
 
  I have discovered that after Starting kernel ... there should be a
  Uncompressing Linux... done, booting the kernel. line. So I am still
 doing
  something wrong on the uImage generation, and I don't know what.
 
  Moreover, I have compiled the uImage like the following, and it get's to
  the kernel panic at least:
  make -j9 HOSTCC=/usr/bin/gcc HOSTCFLAGS= ARCH=arm  CROSS_COMPILE=
  /home/javier/proyectos/master/master-sce/buildroot/output/
 host/usr/bin/arm-buildroot-linux-uclibcgnueabi-
  LOADADDR=0x8000 uImage
 
  If you could tell me which should be the Image/BuildKernel part, I would
  be really appreciate it.
 
  target/linux/zynq/image/Makefile
  ===
 
  include $(TOPDIR)/rules.mk
  include $(INCLUDE_DIR)/image.mk
 
  define Build/Compile
   $(call Build/Compile/Default, zynq_zed.dtb)
  endef
 
  define Image/BuildKernel/Initramfs
   (cd $(TARGET_DIR); \
find . | cpio -o -H newc | gzip -9 $(KDIR)/zedboard-rootfs.cpio.gz
 )
   mkimage -A arm -T ramdisk -C none -d $(KDIR)/zedboard-rootfs.cpio.gz
 \
$(BIN_DIR)/zedboard-uramdisk.image.gz
  endef
 
  define Image/BuildKernel
   mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 \
   -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
   -d $(LINUX_DIR)/arch/arm/boot/zImage
 $(BIN_DIR)/zedboard-uImage
  endef
 
  define Image/Prepare
   $(LINUX_DIR)/scripts/dtc/dtc -O dtb \
$(LINUX_DIR)/arch/arm/boot/dts/zynq-zed.dts 
 $(BIN_DIR)/zedboard.dtb
  endef
 
  $(eval $(call BuildImage))
 
  ===
 
  [1] Bug I should have found a lot of time ago:
  https://github.com/txomon/openwrt/commit/5e882bc2f14580f62a6ad78ddc5703
 3d207261f9
 
  Cheers
 
  On Sun, Jun 29, 2014 at 1:35 PM, Javier Domingo Cansino
  javier...@gmail.com wrote:
 
  I have manually executed the boot sequence in the uboot, and the result
  is that it fails on the command bootm loados. Any idea on how to debug
 what
  can be wrong?
 
  Cheers and I will keep searching,
 
  Javier Domingo Cansino
 
  zynq-uboot fatload mmc 0 0x300 uImage
  reading uImage
  4582152 bytes read in 405 ms (10.8 MiB/s)
  zynq-uboot fatload mmc 0 0x2A0 devicetree.dtb
  reading devicetree.dtb
  

[OpenWrt-Devel] ?????? How to Custom admin page on openwrt ?

2015-03-12 Thread Tymon
That's great, I will have a try on my testbed in my home. And I agree with you 
that admin.myrouter is a proper domain name for my case. 
--
Regards,

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


 




--  --
??: Claudio Thomasc...@xmodus-systems.de; 
: 2015??3??12??(??) 5:14
??: Tymonbanglang.hu...@foxmail.com; 
: openwrt-developenwrt-devel@lists.openwrt.org; 
: Re: [OpenWrt-Devel] How to Custom  admin page on openwrt ?



On 12.03.2015 09:45, Tymon wrote:

   
Thank you for your answer, Claudio Thomas:
   
   
 I use the default utility called dnsmasq ( a 
light-weigh dns server and dhcp server) on openwrt 12.09.
 Of course the dhcp-server function is enabled and 
PC-wireless client can get the ip address normally.
 
 Now I can see dns is 192.168.1.1 (just the router) 
on my PC network configuration, thus I need to modify
 the dnsmasq configuration so that it can map the 
domain name (e.g. admin.myrouter.com--192.168.1.1)  I type on browser 
?
   
   
  Hi Tymon,
 again: The service that can map from a domain (like 
admin.myrouter.com) to an IP-address (like 192.168.1.1) is a DNS-Server 
(like bind9). In your case there is probably no DNS-server in the world 
that knows admin.myrouter.com. Thats why you don't get the IP to that 
domain.
 Because no server in the world knows this domain YOU must find a 
solution so that 1 server in the world knows this domain: your own 
DNS-server with a zone file for myrouter.com.
 
 The dnsmasq does only forward and cache the queries, but does not has 
the option (so far I know) to manage your own domain. You need to set up a 
dnsserver and create a zone file where the mapping for all hostnames for 
the domain myrouter.com are defined.
 
 Sorry, but it is not possible to explain how to set up a DNS-server by 
mail. But there are many DNS-server howtos on the net (like in the openwrt  
 wiki). In small chunks: remove dnsmasq + install binddns-server, 
enable forwarding, add a master-zone entry in the named.conf, define your 
zone file and start your dns-server (bind).
 
 PS: be carefull when using domain-names that (could) really exist in 
the internet. In your case only use *.com domains if this domain belongs to 
you. admin.myrouter.com coudl be a bad idea, admin.myrouter would 
probably be better.
 
 Best regards,
 Claudio
 
 -- 
 Working on OpenWrt CC for Xmodus GSM Router   XM1710E___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] DS-Lite interface is not coming up.

2015-03-12 Thread Sekhar Avutu
I have UCI configuration

config interface 'wan'
option proto 'dslite'
option ip6addr '2001::100'
option peeraddr '2001::200'
option ipaddr '192.168.0.2'
option netmask '255.255.255.0'

in /etc/config/network.

when i run netifd, the dslite interface is not up.

In the script dslite.sh, at this line
( proto_add_host_dependency $cfg :: $tunlink )
control is returning.

Please help me.

Thanks and regards
Sekhar Avutu
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] 回复: How to Custom admin page on openwrt ?

2015-03-12 Thread Conor O'Gorman

default hostname is OpenWrt from system config.
default domain is lan from dhcp config.

Hence OpenWrt.lan should work.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] toolchain: The glorious return of glibc, ver 2.21

2015-03-12 Thread Jeff Waugh
On Fri, Mar 13, 2015 at 6:25 AM, John Crispin blo...@openwrt.org wrote:
 Please don't just compile test. Right now /usr/lib is not added as a
 searchable path for so-libs which renders it pretty much unusable.
 That was what the now missing patch 200-add-dl-search-paths.patch dealt
 with.

 already fixed :) i will push jeffs patch with a few minor fixes in the
 next hour or so

Aha, had been trying to figure that one out. :-)

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


[OpenWrt-Devel] [PATCH] ralink: MT7621 add i2c controller driver

2015-03-12 Thread wengbj
ralink i2c driver is not working on MT7621 platform. Porting a new drivers from 
MTK's source code.

Signed-off-by: daixj fl.serv...@t-firefly.com
---
 target/linux/ramips/modules.mk |   20 +-
 .../0111-i2c-MIPS-add-mt7621-I2C-driver.patch  |  390 
 2 files changed, 409 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/ramips/patches-3.14/0111-i2c-MIPS-add-mt7621-I2C-driver.patch

diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk
index 550a8c2..d72e0aa 100644
--- a/target/linux/ramips/modules.mk
+++ b/target/linux/ramips/modules.mk
@@ -27,7 +27,7 @@ I2C_RALINK_MODULES:= \
 define KernelPackage/i2c-ralink
   $(call i2c_defaults,$(I2C_RALINK_MODULES),59)
   TITLE:=Ralink I2C Controller
-  DEPENDS:=@TARGET_ramips kmod-i2c-core
+  DEPENDS:=@TARGET_ramips @(!TARGET_ramips_mt7621) kmod-i2c-core
 endef
 
 define KernelPackage/i2c-ralink/description
@@ -36,6 +36,24 @@ endef
 
 $(eval $(call KernelPackage,i2c-ralink))
 
+
+I2C_MT7621_MODULES:= \
+  CONFIG_I2C_MT7621:drivers/i2c/busses/i2c-mt7621
+
+define KernelPackage/i2c-mt7621
+  $(call i2c_defaults,$(I2C_MT7621_MODULES),59)
+  TITLE:=MT7621 I2C Controller
+  DEPENDS:=@TARGET_ramips @TARGET_ramips_mt7621 kmod-i2c-core
+endef
+
+define KernelPackage/i2c-mt7621/description
+ Kernel modules for enable mt7621 i2c controller.
+endef
+
+$(eval $(call KernelPackage,i2c-mt7621))
+
+
+
 define KernelPackage/sound-mt7620
   TITLE:=MT7620 PCM/I2S Alsa Driver
   DEPENDS:=@TARGET_ramips_mt7620 +kmod-sound-soc-core +kmod-regmap
diff --git 
a/target/linux/ramips/patches-3.14/0111-i2c-MIPS-add-mt7621-I2C-driver.patch 
b/target/linux/ramips/patches-3.14/0111-i2c-MIPS-add-mt7621-I2C-driver.patch
new file mode 100644
index 000..5f10a80
--- /dev/null
+++ b/target/linux/ramips/patches-3.14/0111-i2c-MIPS-add-mt7621-I2C-driver.patch
@@ -0,0 +1,390 @@
+Index: linux-3.14.30/drivers/i2c/busses/Kconfig
+===
+--- linux-3.14.30.orig/drivers/i2c/busses/Kconfig  2015-03-11 
16:46:46.963996212 +0800
 linux-3.14.30/drivers/i2c/busses/Kconfig   2015-03-12 10:40:34.849574512 
+0800
+@@ -663,6 +663,10 @@
+   tristate Ralink I2C Controller
+   select OF_I2C
+ 
++config I2C_MT7621
++  tristate Mt7621 I2C Controller
++  select OF_I2C
++
+ config HAVE_S3C2410_I2C
+   bool
+   help
+Index: linux-3.14.30/drivers/i2c/busses/Makefile
+===
+--- linux-3.14.30.orig/drivers/i2c/busses/Makefile 2015-03-11 
16:46:46.967996212 +0800
 linux-3.14.30/drivers/i2c/busses/Makefile  2015-03-11 17:52:43.008121712 
+0800
+@@ -64,6 +64,7 @@
+ obj-$(CONFIG_I2C_PXA) += i2c-pxa.o
+ obj-$(CONFIG_I2C_PXA_PCI) += i2c-pxa-pci.o
+ obj-$(CONFIG_I2C_RALINK)  += i2c-ralink.o
++obj-$(CONFIG_I2C_MT7621)  += i2c-mt7621.o
+ obj-$(CONFIG_I2C_RIIC)+= i2c-riic.o
+ obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o
+ obj-$(CONFIG_I2C_S6000)   += i2c-s6000.o
+Index: linux-3.14.30/drivers/i2c/busses/i2c-mt7621.c
+===
+--- /dev/null  1970-01-01 00:00:00.0 +
 linux-3.14.30/drivers/i2c/busses/i2c-mt7621.c  2015-03-12 
11:45:00.449759139 +0800
+@@ -0,0 +1,358 @@
++/*
++ * drivers/i2c/busses/i2c-mt7621.c
++ *
++ * Copyright (C) 2013 Steven Liu steven_...@mediatek.com
++ *
++ * Improve driver for i2cdetect from i2c-tools to detect i2c devices on the 
bus.
++ * (C) 2014 Sittisak sittis...@hotmail.com
++ *
++ * This software is licensed under the terms of the GNU General Public
++ * License version 2, as published by the Free Software Foundation, and
++ * may be copied, distributed, and modified under those terms.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ */
++
++#include linux/interrupt.h
++#include linux/kernel.h
++#include linux/module.h
++#include linux/reset.h
++#include linux/delay.h
++#include linux/slab.h
++#include linux/init.h
++#include linux/errno.h
++#include linux/platform_device.h
++#include linux/i2c.h
++#include linux/io.h
++#include linux/err.h
++
++#include asm/mach-ralink/ralink_regs.h
++
++#define REG_CONFIG_REG   0x00
++#define REG_CLKDIV_REG   0x04
++#define REG_DEVADDR_REG  0x08
++#define REG_ADDR_REG 0x0C
++#define REG_DATAOUT_REG  0x10
++#define REG_DATAIN_REG   0x14
++#define REG_STATUS_REG   0x18
++#define REG_STARTXFR_REG 0x1C
++#define REG_BYTECNT_REG  0x20
++#define REG_SM0_IS_AUTOMODE  0x28
++#define REG_SM0CTL0  

[OpenWrt-Devel] How to Custom admin page on openwrt ?

2015-03-12 Thread Tymon
Hi all,

   As we all known, the default method to access the router's 
administration web page(Luci)  is to type http://192.168.1.1; on the browser. 
I am curious about how can the router recognize thehttp://192.168.1.1as its 
accessible site ?
   More interesting thing is I used to see someone typeadmin.myrouter on 
browser(just in LAN network, the router did not connect WAN to the internet), 
and he successfully accessed the administration web page(Luci) on his openwrt 
router. 
   Thus my question is how can I make the OpenWrt router like him ? Do I 
need to modified the code of cgi ?

   Any hint will be appreciated!‍


















--
Regards,

banglang huang
___
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] Why OpenWrt sucks?

2015-03-12 Thread John Clark

On Mar 10, 2015, at 7:21 AM, valent.turko...@gmail.com wrote:

 Can anyone explain to me how NDAs come into this? Because I remember
 one discussions with Mikrotik developer who said that they can't
 release their Atheros driver that they developed as open source
 because they signed NDA with Atheros?
 
 Is Atheros giving some secret and proprietary information to
 companies that sign NDA with them? If this is true then we will never
 have as fast performance as companies that sign NDAs.

Yes. The data sheets and code require that those receiving such sign an NDA, 
that is ‘Non Disclosure Agreement’.

So, they are prohibited from passing any information on to others, without 
Qualcom’s permission.

Back in the olden days, chip manufacturers would give at least the data sheets 
away for ‘free’, and if an NDA was required, that was usually a simple document.

Sometime in the late 80’s, especially with PC video chip manufacturers, the 
documentation on how to control the video chips became ‘unavailable’ except if 
one was going to buy millions of chips.

This lead to reverse engineering what the video chips did by tracing code and 
fiddling with registers.

In the case of WIFI one of the claims about why information is not available is 
because of the FCC. Fiddling with the registers may cause the device to operate 
outside of the FCC certification parameters.

Well guess what… blind fiddling can wreak as much havoc as intelligent fiddling…

The other aspect of the NDA + Big Bucks, is that it provides a barrier to new 
companies coming in and competing with the established companies. So, those 
established companies, once they ante up for the Big Bucks, don’t mind that 
barrier.

In my experience Intel has been the best in the last 20 years for getting 
information and design guides out for the ‘cheapest’ usually only an NDA. 
Motorola use to be pretty good when the M68K was king, and even early on with 
the PPC line, but of late with the renaming as Freescale, they have gone down 
the road of NDA, and rather limited ‘outreach’.

The worst has been Broadcom. In the past I’ve had two products that I was 
developing custom applications with get acquired by Broadcom, and while before 
the acquisition, there was good information flow, afterwards, there was no 
information flow.

Qualcom has been similar, in that products they acquire typically ‘disappear’, 
or barriers of use are raised to greater heights. There was a bit of a window 
for Atheros, and I think the Open Source community should be thankful for what 
has been given out. But it is not ‘typical’ Qualcom style to do so, and could 
disappear in a heartbeat.

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


[OpenWrt-Devel] [PATCH 3/3] [rpcd] file: free memory after opendir()

2015-03-12 Thread Luka Perkov
Signed-off-by: Luka Perkov l...@openwrt.org
---
 file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/file.c b/file.c
index 9a3dfd8..31a937d 100644
--- a/file.c
+++ b/file.c
@@ -267,6 +267,8 @@ rpc_file_list(struct ubus_context *ctx, struct ubus_object 
*obj,
blobmsg_close_table(buf, d);
}
 
+   closedir(fd);
+
blobmsg_close_array(buf, c);
ubus_send_reply(ctx, req, buf.head);
blob_buf_free(buf);
-- 
2.3.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel