Modify

Opened 8 years ago

Last modified 4 years ago

#7478 accepted enhancement

add support for Senao EAP7660D board

Reported by: daniel.golle@… Owned by: juhosg
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: senao engenius ar71xx Cc: juhosg@…

Description

After about a week of hacking on it, I finished writing some lines of code here and there to support the EAP7660D board by Senao.
The board can be found in the EnGenius products EOR-7530 and EOR-7535
CPU: Atheros AR7161
Flash: STMicroelectronics M25P64
Ethernet: Marvell 88E1116 Gigabit Phy
WiFi: 2x Atheros 5413 mini-pci module

Attachments (1)

eap7660d-backfire.patch (7.2 KB) - added by daniel.golle@… 8 years ago.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by daniel.golle@…

comment:1 Changed 8 years ago by daniel.golle@…

+M88E1116:
Setup M88E1116 Phy for 0
M88E1116: Port 0, Phy Found, Reset completed
M88E1116: unit 0 phy addr 14 M88E1116: reg0 1000
M88E1116:
Setup M88E1116 Phy for 1
M88E1116:
No phy found for unit 1
Ethernet eth0: MAC address 00:03:7f:10:6d:4f
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.100

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version UNKNOWN - built 22:15:01, Mar 17 2010

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: eap7660d
RAM: 0x80000000-0x84000000, [0x80053330-0x80fe1000] available
FLASH: 0xbf000000 - 0xbf7f0000, 128 blocks of 0x00010000 bytes each.

Executing boot script in 2.000 seconds - enter C to abort

C
RedBoot> load -r -v -b 0x80060000 openwrt-ar71xx-vmlinux-initramfs.bin
do_load, mode_str_set = 0
do_load, fileio_mounted = 0
Using default protocol (TFTP)
do_load, raw = 1, base_addr_set = 1
|
Raw file loaded 0x80060000-0x804df2c3, assumed entry at 0x80060000
RedBoot> exec -c "board=EAP7660D"
Now booting linux kernel:

Base address 0x80050000 Entry 0x80060000
Cmdline : board=EAP7660D

Linux Entry?!
Linux version 2.6.32.14 (daniel@myhost) (gcc version 4.3.3 (GCC) ) #1 Wed Jun 16 01:42:36 CEST 2010
bootconsole [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2, CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
Determined physical RAM map:

memory: 04000000 @ 00000000 (usable)

Initrd not found or empty - disabling initrd
Zone PFN ranges:

Normal 0x00000000 -> 0x00004000

Movable zone start PFN for each node
early_node_map[1] active PFN ranges

0: 0x00000000 -> 0x00004000

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 board=EAP7660D ethaddr=00.03.7f.10.6d.4f
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=0007fff2
Readback ErrCtl register=0007fff2
Memory: 59792k/65536k available (2044k kernel code, 5668k reserved, 388k data, 2172k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:56
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is Senao EAP7660D
registering PCI controller with io_map_base unset
bio: create slab <bio-0> at 0
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
PCI: mapping irq 48 to pin1@0000:00:11.0
PCI: mapping irq 49 to pin1@0000:00:12.0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY) �© 2001-2006 Red Hat, Inc.
yaffs Jun 16 2010 01:28:07 Installing.
msgmni has been set to 116
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: m25p64 (8192 Kbytes)
Searching for RedBoot partition table in spi0.0 at offset 0x7e0000
6 RedBoot partitions found on MTD device spi0.0
Creating 6 MTD partitions on "spi0.0":
0x000000000000-0x000000050000 : "RedBoot"
0x000000050000-0x000000130000 : "kernel"
0x000000130000-0x0000007e0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=360000, len=480000
0x000000360000-0x0000007e0000 : "rootfs_data"
0x0000007e0000-0x0000007ef000 : "FIS directory"
0x0000007ef000-0x0000007f0000 : "RedBoot config"
0x0000007f0000-0x000000800000 : "boardconfig"
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@…>
All bugs added by David S. Miller <davem@…>
Freeing unused kernel memory: 2172k freed
gpio-buttons driver version 0.1.2
Button Hotplug driver version 0.3.1

  • preinit -

Press the [f] key and hit [enter] to enter failsafe mode
eth0: link up (100Mbps/Full duplex)

  • regular preinit -
  • init -

Please press Enter to activate this console. NET: Registered protocol family 10
lo: Disabled Privacy Extensions
eth0: link down
ADDRCONF(NETDEV_UP): eth0: link is not ready
device eth0 entered promiscuous mode
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (969 buckets, 3876 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
eth0: link up (100Mbps/Full duplex)
br-lan: port 1(eth0) entering forwarding state
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
xt_time: kernel timezone is -0000
IMQ driver loaded successfully.

Hooking IMQ before NAT on PREROUTING.
Hooking IMQ after NAT on POSTROUTING.

Ebtables v2.0 registered
ip6_tables: (C) 2000-2006 Netfilter Core Team
ath_hal: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
ath_hal: 2009-05-08 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, RF2425, REGOPS_FUNC, XR)
ath_pci: trunk
wlan: trunk
wlan: mac acl policy registered
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
PCI: Enabling device 0000:00:11.0 (0000 -> 0002)
Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_pci: wifi0: Atheros 5413: mem=0x10000000, irq=48
PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi1: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi1: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi1: H/W encryption support: WEP AES AES_CCM TKIP
ath_pci: wifi1: Atheros 5413: mem=0x10010000, irq=49

comment:2 Changed 8 years ago by juhosg

  • Component changed from packages to kernel
  • Owner changed from developers to juhosg
  • Status changed from new to accepted

First of all, can you rebase your patch against trunk? In theory the Backfire branch can get bug-fixes only, so i'm not sure if i will be allowed to apply it against that.
More comments below...

Index: target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig	(revision 21809)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig	(working copy)
@@ -215,6 +215,15 @@
 	select AR71XX_DEV_USB
 	default n
 
+config AR71XX_MACH_EAP7660D
+	bool "Senao EAP7660D support"
+	select AR71XX_DEV_M25P80
+	select AR71XX_DEV_AP91_ETH

You don't have to select AR71XX_DEV_AP91_ETH if you don't use the ap91_eth_init() function.

+	select AR71XX_DEV_AP91_PCI if PCI

Similarly, the ap91_pci stuff is needed by the boards, which are based on the AP91 reference board. You should use the PB42 specific PCI code instead.

+	select AR71XX_DEV_GPIO_BUTTONS
+	select AR71XX_DEV_LEDS_GPIO

Why do you select them, if you don't use the LEDs and buttons?

+	default n
+
 endmenu
 
 config AR71XX_DEV_M25P80
Index: target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c	(revision 0)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-eap7660d.c	(revision 0)
@@ -0,0 +1,102 @@
+/*
+ *  Senao EAP7660D board support
+ *
+ *  Copyright (C) 2010 Daniel Golle <daniel.golle@gmail.com>
+ *  partly based on mach-ap83.c
+ *  Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/mmc/host.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/mmc_spi.h>
+#include "dev-m25p80.h"

Move this include to ...

+
+#include <asm/mach-ar71xx/ar71xx.h>
+
+#include <asm/mach-ar71xx/pci.h>
+
+#include "machtype.h"
+#include "devices.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"

... here please.

+
+#define EAP7660D_PHYMASK	BIT(20)
+
+#if 0 
+/* buttons and leds are hidden inside an outdoor case, so i don't worry bout them for now */

Other users may want to use them, so it would be better to remove the #if 0 directive.

+#define EAP7660D_GPIO_USER_LED	4
+#define EAP7660D_GPIO_RESET_BTN	7
+#define EAP7660D_GPIO_WPS_BTN	8
+#define EAP7660D_BUTTONS_POLL_INTERVAL	20
+
+static struct gpio_led eap7660d_leds_gpio[] __initdata = {
+	{
+		.name		= "eap7660d:yellow:user",
+		.gpio		= EAP7660D_GPIO_USER_LED,
+		.active_low	= 0,
+	},
+};
+
+static struct gpio_button eap7660d_gpio_buttons[] __initdata = {
+	{
+		.desc		= "reset",
+		.type		= EV_KEY,
+		.code		= BTN_0,
+		.threshold	= 3,
+		.gpio		= EAP7660D_GPIO_RESET_BTN,
+		.active_low	= 1,
+	},
+	{
+		.desc		= "wps",
+		.type		= EV_KEY,
+		.code		= BTN_1,
+		.threshold	= 3,
+		.gpio		= EAP7660D_GPIO_WDS_BTN,

It seems that you did not compile this part at all. :p

+		.active_low	= 1,
+	}
+
+};
+#endif
+
+static struct ar71xx_pci_irq eap7660d_pci_irqs[] __initdata = {
+        {
+                .slot   = 0,
+                .pin    = 1,
+                .irq    = AR71XX_PCI_IRQ_DEV0,
+        }, {
+                .slot   = 1,
+                .pin    = 1,
+                .irq    = AR71XX_PCI_IRQ_DEV1,
+        }
+};
+
+
+
+static void __init eap7660d_setup(void)
+{
+	ar71xx_add_device_mdio(~EAP7660D_PHYMASK);
+	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+	ar71xx_eth0_data.phy_mask = EAP7660D_PHYMASK;
+	ar71xx_add_device_eth(0);
+	ar71xx_add_device_m25p80(NULL);
+#if 0
+	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(eap7660d_leds_gpio),
+					eap7660d_leds_gpio);
+
+	ar71xx_add_device_gpio_buttons(-1, EAP7660D_BUTTONS_POLL_INTERVAL,
+					ARRAY_SIZE(eap7660d_gpio_buttons),
+					eap7660d_gpio_buttons);
+#endif

Ditto.

+	ar71xx_pci_init(ARRAY_SIZE(eap7660d_pci_irqs), eap7660d_pci_irqs);

You can use the pb42_pci_init() instead, and you can remove the eap7660d_pci_irqs definition as well.

+}
+
+MIPS_MACHINE(AR71XX_MACH_EAP7660D, "EAP7660D", "Senao EAP7660D",
+	     eap7660d_setup);
Index: target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/Makefile	(revision 21809)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Makefile	(working copy)
@@ -33,6 +33,7 @@
 obj-$(CONFIG_AR71XX_MACH_DIR_600_A1)	+= mach-dir-600-a1.o
 obj-$(CONFIG_AR71XX_MACH_DIR_615_C1)	+= mach-dir-615-c1.o
 obj-$(CONFIG_AR71XX_MACH_DIR_825_B1)	+= mach-dir-825-b1.o
+obj-$(CONFIG_AR71XX_MACH_EAP7660D)	+= mach-eap7660d.o
 obj-$(CONFIG_AR71XX_MACH_MZK_W04NU)	+= mach-mzk-w04nu.o
 obj-$(CONFIG_AR71XX_MACH_MZK_W300NH)	+= mach-mzk-w300nh.o
 obj-$(CONFIG_AR71XX_MACH_PB42)		+= mach-pb42.o
Index: target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h	(revision 21809)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h	(working copy)
@@ -54,6 +54,7 @@
 	AR71XX_MACH_WRT160NL,	/* Linksys WRT160NL */
 	AR71XX_MACH_WRT400N,	/* Linksys WRT400N */
 	AR71XX_MACH_WZR_HP_G300NH, /* Buffalo WZR-HP-G300NH */
+	AR71XX_MACH_EAP7660D,	/* Senao EAP7660D */
 };
 
 #endif /* _AR71XX_MACHTYPE_H */
Index: target/linux/ar71xx/image/Makefile
===================================================================
--- target/linux/ar71xx/image/Makefile	(revision 21809)
+++ target/linux/ar71xx/image/Makefile	(working copy)
@@ -425,6 +425,10 @@
 	$(call Image/Build/Template/$(fs_64k)/$(1),Cameo7240,dir-600-a1,board=DIR-600-A1,"AP91-AR7240-RT-090223-00")
 endef
 
+define Image/Build/Profile/EAP7660D
+	$(call Image/Build/Template/$(fs_128k)/$(1),PB4X,eap7660d,board=EAP7660D)
+endef
+
 define Image/Build/Profile/FR54RTR
 	$(call Image/Build/Template/$(fs_64k)/$(1),Cameo7240,fr-54rtr,board=DIR-600-A1,"AP91-AR7240-RT-090223-01")
 endef
@@ -545,6 +549,7 @@
 	$(call Image/Build/Profile/DIR600A1,$(1))
 	$(call Image/Build/Profile/DIR615C1,$(1))
 	$(call Image/Build/Profile/DIR825B1,$(1))
+	$(call Image/Build/Profile/EAP7660D,$(1))
 	$(call Image/Build/Profile/FR54RTR,$(1))
 	$(call Image/Build/Profile/MZKW04NU,$(1))
 	$(call Image/Build/Profile/MZKW300NH,$(1))
Index: target/linux/ar71xx/base-files/lib/ar71xx.sh
===================================================================
--- target/linux/ar71xx/base-files/lib/ar71xx.sh	(revision 21809)
+++ target/linux/ar71xx/base-files/lib/ar71xx.sh	(working copy)
@@ -16,6 +16,9 @@
 	*AP83)
 		name="ap83"
 		;;
+	*EAP7660D)
+		name="eap7660d"
+		;;
 	*AW-NR580)
 		name="aw-nr580"
 		;;
Index: target/linux/ar71xx/base-files/etc/defconfig/eap7660d/network
===================================================================
--- target/linux/ar71xx/base-files/etc/defconfig/eap7660d/network	(revision 0)
+++ target/linux/ar71xx/base-files/etc/defconfig/eap7660d/network	(revision 0)
@@ -0,0 +1,12 @@
+config interface loopback
+	option ifname	lo
+	option proto	static
+	option ipaddr	127.0.0.1
+	option netmask	255.0.0.0
+
+config interface lan
+	option ifname	eth0
+	option type	bridge
+	option proto	static
+	option ipaddr	192.168.1.1
+	option netmask	255.255.255.0
Index: target/linux/ar71xx/config-2.6.32
===================================================================
--- target/linux/ar71xx/config-2.6.32	(revision 21809)
+++ target/linux/ar71xx/config-2.6.32	(working copy)
@@ -23,6 +23,7 @@
 CONFIG_AR71XX_MACH_DIR_600_A1=y
 CONFIG_AR71XX_MACH_DIR_615_C1=y
 CONFIG_AR71XX_MACH_DIR_825_B1=y
+CONFIG_AR71XX_MACH_EAP7660D=y
 CONFIG_AR71XX_MACH_MZK_W04NU=y
 CONFIG_AR71XX_MACH_MZK_W300NH=y
 CONFIG_AR71XX_MACH_PB42=y
@@ -190,6 +191,7 @@
 CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PHYLIB=y
+CONFIG_MARVELL_PHY=y
 # CONFIG_PMC_MSP is not set
 # CONFIG_PMC_YOSEMITE is not set
 # CONFIG_PNX8550_JBS is not set

comment:3 Changed 8 years ago by daniel.golle@…

As discussed on openwrt-devel@…, changes to madwifi/ath5k are needed to load correct MAC and EEPROM content. Depending on the actual wifi modules soldered onto the board, platform_data for ath5k or ath9k might be present, therefore I suggested to generalize the existing struct ath9k_platform_data to utilize this infrastructure for both, ath5k/madwifi and ath9k, and use ap94-pci in mach-eap7660d.c accordingly.

comment:4 Changed 8 years ago by nico

  • Milestone changed from Backfire 10.03.1 to Kamikaze
  • Version changed from Backfire 10.03 to Trunk

comment:5 Changed 7 years ago by daniel.golle@…

as all needed changes are in trunk now, could we backport stuff into backfire and to be released with 10.03.1?

comment:6 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as accepted .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.