[Zrouter-src] ZRouter.org: push to ZRouter boards/D-Link/DIR-825/README boards...

zrouter-src at zrouter.org zrouter-src at zrouter.org
Thu Sep 20 12:54:16 UTC 2012


details:   http://zrouter.org/hg/zrouter//rev/3ad22be7578b
changeset: 449:3ad22be7578b
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Thu Sep 20 15:45:48 2012 +0300
description:
Update to use new profiles. +Cleanup.

diffstat:

 boards/D-Link/DIR-825/README                    |  18 +++++-
 boards/D-Link/DIR-825/board.hints               |  74 +++++++++++++++++++-----
 boards/D-Link/DIR-825/board.mk                  |  43 ++++++++++----
 boards/D-Link/DIR-825/files/etc/rc.d/ADAPTATION |   3 +-
 boards/D-Link/DIR-825/files/etc/rc.d/boardinfo  |  70 +++++++++++++++++++++++
 5 files changed, 178 insertions(+), 30 deletions(-)

diffs (330 lines):

diff -r d94b4723f2d5 -r 3ad22be7578b boards/D-Link/DIR-825/README
--- a/boards/D-Link/DIR-825/README	Thu Sep 20 15:44:25 2012 +0300
+++ b/boards/D-Link/DIR-825/README	Thu Sep 20 15:45:48 2012 +0300
@@ -5,4 +5,20 @@
 64k(Config),	0xbf040000 - 0xbf050000
 1024k(vmlinux),	0xbf050000 - 0xbf150000
 5184k(rootfs),	0xbf150000 - 0xbf660000
-64k(caldata)	0xbf7f0000 - 0xbf800000
\ No newline at end of file
+64k(caldata)	0xbf7f0000 - 0xbf800000
+
+
+GPIO
+0	LED	USB
+1	LED	Status Orange
+2	LED	Power Blue
+3	Button	Reset
+4	LED	WPS Blue
+5	I2C	SDA
+6	LED	Internet Orange
+7	I2C	SCK
+8	Button	WPS
+9	UART	RX
+10	UART	TX
+11	LED	Internet Blue
+mask 0x9ff
diff -r d94b4723f2d5 -r 3ad22be7578b boards/D-Link/DIR-825/board.hints
--- a/boards/D-Link/DIR-825/board.hints	Thu Sep 20 15:44:25 2012 +0300
+++ b/boards/D-Link/DIR-825/board.hints	Thu Sep 20 15:45:48 2012 +0300
@@ -1,6 +1,6 @@
-hint.arge.0.media=1000
+hint.arge.0.media=1000	# RGMII
 hint.arge.0.fduplex=1
-hint.arge.1.media=1000
+hint.arge.1.media=100	# RMII
 hint.arge.1.fduplex=1
 
 # No probe at all
@@ -20,7 +20,7 @@
 
 # compatible value, device with 4M/8M/16M of flash, may found it on same
 # location, because flash just aliased to upper segments
-hint.ath.0.eepromdata=0x1fff1000
+#hint.ath.0.eepromdata=0x1fff1000
 
 # ath0 - slot 17
 hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000
@@ -33,14 +33,34 @@
 hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware"
 hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware"
 
+# GPIO specific configuration block
 
-# (1 | (1<<1) | (1<<6) | (1<<7) | (1<<17) | (1<<13) | (1<<14) | (1<<15) | (1<<16)
-#  000011 11100000 11000011
-# Output: 0,1,6,7,13,14,15,16,17
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x00000000
+hint.gpio.0.function_clear=0x00000000
 
-# 0	LED	WPS
+# These are the GPIO LEDs and buttons which can be software controlled.
+hint.gpio.0.pinmask=0x000009ff
+
+# GPIO I2C bus
+hint.gpioiic.0.at="gpiobus0"
+hint.gpioiic.0.pins=0x00a0
+hint.gpioiic.0.sda=0
+hint.gpioiic.0.scl=1
+
+# I2C bus
+# Don't be strict about I2C protocol - the relaxed semantics are required
+# by the realtek switch PHY.
+hint.iicbus.0.strict=0
+
+# Bit bang bus - override default delay
+#hint.iicbb.0.udelay=3
+
+# 0	LED	USB Blue
 hint.gpioled.0.at="gpiobus0"
-hint.gpioled.0.name="wps"
+hint.gpioled.0.name="usb"
 hint.gpioled.0.pins=0x0001
 hint.gpioled.0.flags="0x0102"
 
@@ -50,24 +70,45 @@
 hint.gpioled.1.pins=0x0002
 hint.gpioled.1.flags="0x0102"
 
-# 11	LED	USB
+# 2	LED	USB
 hint.gpioled.2.at="gpiobus0"
-hint.gpioled.2.name="usb"
-hint.gpioled.2.pins=0x0800
+hint.gpioled.2.name="status_bi"
+hint.gpioled.2.pins=0x0004
 hint.gpioled.2.flags="0x0102"
 
-# ? 	BUTTON	RESET
+# 4	LED	WPS
+hint.gpioled.4.at="gpiobus0"
+hint.gpioled.4.name="wps"
+hint.gpioled.4.pins=0x0010
+hint.gpioled.4.flags="0x0102"
+
+# 6	LED	Internet Orange
+hint.gpioled.5.at="gpiobus0"
+hint.gpioled.5.name="internet_bi"
+hint.gpioled.5.pins=0x0040
+hint.gpioled.5.flags="0x0102"
+
+# 11	LED	Internet Blue
+hint.gpioled.6.at="gpiobus0"
+hint.gpioled.6.name="internet"
+hint.gpioled.6.pins=0x0800
+hint.gpioled.6.flags="0x0102"
+
+# 3 	BUTTON	RESET
 #hint.gpioreset.0.at="gpiobus0"
-#hint.gpioreset.0.pins="0x0400"
+#hint.gpioreset.0.pins="0x0004"
 #hint.gpioreset.0.name="reset"
 #hint.gpioreset.0.flags="0x04a1"
 
-# 12 	BUTTON	WPS
+# 8 	BUTTON	WPS
 hint.gpiobutton.0.at="gpiobus0"
-hint.gpiobutton.0.pins="0x1000"
+hint.gpiobutton.0.pins="0x0100"
 hint.gpiobutton.0.name="wps"
 hint.gpiobutton.0.flags="0x04a1"
 
+#5	I2C	SDA
+#7	I2C	SCK
+
 hint.mx25l.0.at="spibus0"
 hint.mx25l.0.cs=0
 
@@ -84,7 +125,7 @@
 
 hint.map.2.at="flash/spi0"
 hint.map.2.start=0x00050000
-hint.map.2.end=0x007e0000
+hint.map.2.end=0x007b0000
 hint.map.2.name="upgrade"
 
 hint.map.3.at="flash/spi0"
@@ -115,3 +156,4 @@
 hint.map.7.name="ART"
 #hint.map.7.readonly=1
 
+
diff -r d94b4723f2d5 -r 3ad22be7578b boards/D-Link/DIR-825/board.mk
--- a/boards/D-Link/DIR-825/board.mk	Thu Sep 20 15:44:25 2012 +0300
+++ b/boards/D-Link/DIR-825/board.mk	Thu Sep 20 15:45:48 2012 +0300
@@ -47,29 +47,33 @@
 
 
 .if !defined(WITHOUT_WIRELESS)
-KERNCONF_MODULES_OVERRIDE+=wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt
-KERNCONF_OPTIONS+=	IEEE80211_DEBUG
+#KERNCONF_MODULES_OVERRIDE+=wlan wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt ath ath_pci
+#KERNCONF_MODULES_OVERRIDE+=wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt
+#KERNCONF_OPTIONS+=	IEEE80211_DEBUG
 KERNCONF_OPTIONS+=	IEEE80211_SUPPORT_MESH
 KERNCONF_OPTIONS+=	IEEE80211_SUPPORT_TDMA
+KERNCONF_OPTIONS+=	IEEE80211_AMPDU_AGE
 KERNCONF_DEVICES+=	wlan
 KERNCONF_DEVICES+=	wlan_amrr
 KERNCONF_DEVICES+=	wlan_wep
 KERNCONF_DEVICES+=	wlan_ccmp
 KERNCONF_DEVICES+=	wlan_tkip
+KERNCONF_DEVICES+=	wlan_xauth
+KERNCONF_DEVICES+=	wlan_acl
+KERNCONF_DEVICES+=	wlan_rssadapt
+
+KERNCONF_OPTIONS+=	AH_RXCFG_SDMAMW_4BYTES
+KERNCONF_OPTIONS+=	AH_AR5416_INTERRUPT_MITIGATION
 
 KERNCONF_OPTIONS+=	AR71XX_ATH_EEPROM
 KERNCONF_OPTIONS+=	ATH_EEPROM_FIRMWARE
 KERNCONF_DEVICES+=	firmware
 
-KERNCONF_OPTIONS+=	AH_DEBUG
-KERNCONF_OPTIONS+=	ATH_DEBUG
-KERNCONF_OPTIONS+=	ATH_DIAGAPI
+#KERNCONF_OPTIONS+=	AH_DEBUG
+#KERNCONF_OPTIONS+=	ATH_DEBUG
+#KERNCONF_OPTIONS+=	ATH_DIAGAPI
 KERNCONF_OPTIONS+=	ATH_ENABLE_11N
 KERNCONF_OPTIONS+=	AH_SUPPORT_AR5416
-#KERNCONF_OPTIONS+=	AH_SUPPORT_AR9130
-KERNCONF_OPTIONS+=	AH_RXCFG_SDMAMW_4BYTES
-# interrupt mitigation not possible on AR9130
-# option		AH_AR5416_INTERRUPT_MITIGATION
 KERNCONF_DEVICES+=	ath
 KERNCONF_DEVICES+=	ath_hal
 KERNCONF_DEVICES+=	ath_pci
@@ -108,7 +112,7 @@
 
 
 # Image must not be biggest than GEOM_MAP_P2 (upgrade part.)
-FIRMWARE_IMAGE_SIZE_MAX=0x007a0000
+FIRMWARE_IMAGE_SIZE_MAX=0x007b0000
 
 
 ###################################################
@@ -117,8 +121,23 @@
 #
 ###################################################
 
-TARGET_PROFILES+=SMALL_ mpd ssh dlink.ua.web dhcp mroute ntpdate dnsmasq racoon openvpn ppp hostap ath
-# nfs_client
+TARGET_PROFILES+= 	\
+	SMALL_		\
+	dhclient	\
+	lua_web_ui	\
+	dnsmasq		\
+	hostap		\
+	ipfw		\
+	mpd		\
+	net_help	\
+	nfs_client	\
+	ntpdate		\
+	ppp		\
+	racoon		\
+	ssh		\
+	watchdogd
+
+
 
 KERNEL_COMPRESSION=oldlzma
 KERNEL_COMPRESSION_TYPE=oldlzma
diff -r d94b4723f2d5 -r 3ad22be7578b boards/D-Link/DIR-825/files/etc/rc.d/ADAPTATION
--- a/boards/D-Link/DIR-825/files/etc/rc.d/ADAPTATION	Thu Sep 20 15:44:25 2012 +0300
+++ b/boards/D-Link/DIR-825/files/etc/rc.d/ADAPTATION	Thu Sep 20 15:45:48 2012 +0300
@@ -40,7 +40,7 @@
 #	switchctl /dev/switch0 set port 5 pvid 1 flags Tag
 #	switchctl /dev/switch0 set port 6 pvid 1 flags Tag
 
-	gpioctl -f /dev/gpioc0 -c 10 IN II PU INT
+#	gpioctl -f /dev/gpioc0 -c 10 IN II PU INT
 
 	# Import MAC addresses with known names
 #	kenv LAN_MAC_ADDR=`kenv ethaddr`
@@ -48,6 +48,7 @@
 
 	ifconfig arge0 name lan0
 	ifconfig arge1 name wan0
+	ifconfig ath0 name wifi0
 
 	ifconfig lan0 ether `kenv LAN_MAC_ADDR`
 	ifconfig wan0 ether `kenv WAN_MAC_ADDR`
diff -r d94b4723f2d5 -r 3ad22be7578b boards/D-Link/DIR-825/files/etc/rc.d/boardinfo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DIR-825/files/etc/rc.d/boardinfo	Thu Sep 20 15:45:48 2012 +0300
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# BEFORE: ADAPTATION
+# PROVIDE: boardinfo
+
+. /etc/rc.subr
+. /etc/network.subr
+
+name="boardinfo"
+start_cmd="boardinfo_start"
+extra_commands="enablelan"
+enablelan_cmd="enablelan_sub"
+
+# Empty set of MAC addresses
+MAC0=
+MAC1=
+MAC2=
+MAC3=
+MAC4=
+MAC5=
+MAC6=
+MAC7=
+# Who wants more?
+
+assign_macs()
+{
+	MAC0=$1; shift;
+	MAC1=$1; shift;
+	MAC2=$1; shift;
+	MAC3=$1; shift;
+	MAC4=$1; shift;
+	MAC5=$1; shift;
+	MAC6=$1; shift;
+	MAC7=$1; shift;
+}
+
+
+boardinfo_start()
+{
+
+	kenv	RESET_PIN=8
+	kenv	WPS_PIN=12
+	kenv	INTERNET_LED=internet_bi
+	# GPIO H/W and driver do not support inversion, so define it
+	kenv	RESET_PIN_INVERT=1
+	kenv	WPS_PIN_INVERT=1
+	kenv	INTERNET_LED_INVERT=1
+
+	# XXX: found where is it :)
+#	MAC_ADDR_LIST=$(dd if=/dev/map/MAC bs=64k count=1 2>/dev/null | lua /usr/sbin/base_mac.lua 3)
+	MAC_ADDR_LIST=$(echo "84:c9:b2:4a:4c:de" | lua /usr/sbin/base_mac.lua 3)
+	assign_macs ${MAC_ADDR_LIST}
+
+	kenv BASE_MAC_ADDR="${MAC0}"
+	kenv LAN_MAC_ADDR="${MAC0}"
+	kenv WAN_MAC_ADDR="${MAC1}"
+	kenv WLAN_MAC_ADDR="${MAC2}"
+	echo "Using default board MAC address \"${MAC0}\""
+	kldload if_ath
+	kldload if_ath_pci
+
+}
+
+enablelan_sub()
+{
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file


More information about the Zrouter-src mailing list