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

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


details:   http://zrouter.org/hg/zrouter//rev/d94b4723f2d5
changeset: 448:d94b4723f2d5
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Thu Sep 20 15:44:25 2012 +0300
description:
Update board to current state.

diffstat:

 boards/D-Link/DIR-632/GPIO                        |  16 ++++-
 boards/D-Link/DIR-632/board.hints                 |  41 ++++++++---
 boards/D-Link/DIR-632/board.mk                    |  63 ++++++-----------
 boards/D-Link/DIR-632/files/etc/rc.d/ADAPTATION   |  19 +++++-
 boards/D-Link/DIR-632/files/etc/rc.d/bd_switchctl |  45 ++++++++++++
 boards/D-Link/DIR-632/files/etc/rc.d/boardinfo    |  81 +++++++++++++++++++++++
 6 files changed, 211 insertions(+), 54 deletions(-)

diffs (390 lines):

diff -r 76a415b4b32b -r d94b4723f2d5 boards/D-Link/DIR-632/GPIO
--- a/boards/D-Link/DIR-632/GPIO	Thu Sep 20 15:38:37 2012 +0300
+++ b/boards/D-Link/DIR-632/GPIO	Thu Sep 20 15:44:25 2012 +0300
@@ -1,8 +1,22 @@
 
-
+0	LED	WPS
 1	LED	STATUS Yellow
+2
+3
+4
+5
+6	LED	STATUS Green
+7	LED	Internet
+8	BUTTON	Reset
+9	UART
+10	UART
 11	LED	USB
 12 	BUTTON	WPS
+13
+14
+15
+16
+17	LED	Internet Bi
 
 
 
diff -r 76a415b4b32b -r d94b4723f2d5 boards/D-Link/DIR-632/board.hints
--- a/boards/D-Link/DIR-632/board.hints	Thu Sep 20 15:38:37 2012 +0300
+++ b/boards/D-Link/DIR-632/board.hints	Thu Sep 20 15:44:25 2012 +0300
@@ -106,21 +106,33 @@
 
 # 1	LED	STATUS Yellow
 hint.gpioled.1.at="gpiobus0"
-hint.gpioled.1.name="status"
+hint.gpioled.1.name="status_yellow"
 hint.gpioled.1.pins=0x0002
-hint.gpioled.1.flags="0x0102"
+hint.gpioled.1.flags="0x0002"
+
+# 6	LED	STATUS Green
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.name="status"
+hint.gpioled.2.pins=0x0040
+hint.gpioled.2.flags="0x0102"
+
+# 7	LED	Internet
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.name="internet"
+hint.gpioled.3.pins=0x0080
+hint.gpioled.3.flags="0x0102"
+
+# 8 	BUTTON	RESET
+#hint.gpioreset.0.at="gpiobus0"
+#hint.gpioreset.0.pins="0x0100"
+#hint.gpioreset.0.name="reset"
+#hint.gpioreset.0.flags="0x04a1"
 
 # 11	LED	USB
-hint.gpioled.2.at="gpiobus0"
-hint.gpioled.2.name="usb"
-hint.gpioled.2.pins=0x0800
-hint.gpioled.2.flags="0x0102"
-
-# ? 	BUTTON	RESET
-#hint.gpioreset.0.at="gpiobus0"
-#hint.gpioreset.0.pins="0x0400"
-#hint.gpioreset.0.name="reset"
-#hint.gpioreset.0.flags="0x04a1"
+hint.gpioled.4.at="gpiobus0"
+hint.gpioled.4.name="usb"
+hint.gpioled.4.pins=0x0800
+hint.gpioled.4.flags="0x0102"
 
 # 12 	BUTTON	WPS
 hint.gpiobutton.0.at="gpiobus0"
@@ -128,6 +140,11 @@
 hint.gpiobutton.0.name="wps"
 hint.gpiobutton.0.flags="0x04a1"
 
+# 17	LED	Internet
+hint.gpioled.5.at="gpiobus0"
+hint.gpioled.5.name="internet_bi"
+hint.gpioled.5.pins=0x20000
+hint.gpioled.5.flags="0x0002"
 
 # SPI flash
 hint.spi.0.at="nexus0"
diff -r 76a415b4b32b -r d94b4723f2d5 boards/D-Link/DIR-632/board.mk
--- a/boards/D-Link/DIR-632/board.mk	Thu Sep 20 15:38:37 2012 +0300
+++ b/boards/D-Link/DIR-632/board.mk	Thu Sep 20 15:44:25 2012 +0300
@@ -27,12 +27,20 @@
 # Builded modules
 KERNCONF_MODULES_OVERRIDE+=usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib
 
+# 8M
+#KERNCONF_OPTIONS+=	VM_KMEM_SIZE_MAX=8388608
+# 4M
+KERNCONF_OPTIONS+=	VM_KMEM_SIZE_MAX=4194304
+KERNCONF_OPTIONS+=	NBUF=128
+
 # Additional utilities
 WORLD_SUBDIRS_ZROUTER+=target/sbin/upgrade
 
 KERNCONF_OPTIONS+=	ALT_BREAK_TO_DEBUGGER
 KERNCONF_OPTIONS+=	BREAK_TO_DEBUGGER
 
+KERNCONF_OPTIONS+=	KDB
+KERNCONF_OPTIONS+=	DDB
 #KERNCONF_OPTIONS+=	KTR
 #KERNCONF_OPTIONS+=	KTR_ENTRIES=1024
 #KERNCONF_OPTIONS+=	KTR_COMPILE=(KTR_INTR)
@@ -45,9 +53,10 @@
 
 .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_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
@@ -58,56 +67,28 @@
 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_OPTIONS+=	AH_RXCFG_SDMAMW_4BYTES
+KERNCONF_OPTIONS+=	AH_AR5416_INTERRUPT_MITIGATION
 KERNCONF_DEVICES+=	ath
 KERNCONF_DEVICES+=	ath_hal
 KERNCONF_DEVICES+=	ath_pci
 KERNCONF_DEVICES+=	ath_rate_sample
 .endif
 
-
-#.if !defined(WITHOUT_WIRELESS)
-#KERNCONF_OPTIONS+=	IEEE80211_DEBUG
-##KERNCONF_OPTIONS+=	IEEE80211_SUPPORT_MESH
-##KERNCONF_OPTIONS+=	IEEE80211_SUPPORT_TDMA
-#KERNCONF_MODULES_OVERRIDE+=	wlan
-#KERNCONF_MODULES_OVERRIDE+=	wlan_amrr
-#KERNCONF_MODULES_OVERRIDE+=	wlan_wep
-#KERNCONF_MODULES_OVERRIDE+=	wlan_ccmp
-#KERNCONF_MODULES_OVERRIDE+=	wlan_tkip
-#
-#KERNCONF_OPTIONS+=	AH_DEBUG
-#KERNCONF_OPTIONS+=	ATH_DEBUG
-#KERNCONF_OPTIONS+=	AH_SUPPORT_AR5416
-#KERNCONF_OPTIONS+=	AH_RXCFG_SDMAMW_4BYTES
-#KERNCONF_MODULES_OVERRIDE+=	ath
-##KERNCONF_MODULES_OVERRIDE+=	ath_hal
-#KERNCONF_MODULES_OVERRIDE+=	ath_pci
-##KERNCONF_MODULES_OVERRIDE+=	ath_rate_sample
-#.endif
-
-
-
 ###################################################
 #
 #       Limits
 #
 ###################################################
 
-
-
 # Image must not be biggest than GEOM_MAP_P2 (upgrade part.)
 FIRMWARE_IMAGE_SIZE_MAX=0x007a0000
 
-
 ###################################################
 #
 #       Firmware Image Options
@@ -116,20 +97,22 @@
 
 TARGET_PROFILES+= 	\
 	SMALL_		\
-	ath		\
 	dhclient	\
-	dlink.ua.web	\
+	dig_spcdns	\
+	lua_web_ui	\
 	dnsmasq		\
 	hostap		\
 	ipfw		\
-	mroute		\
 	mpd		\
-	net_help	\
-	nfs_client	\
 	ntpdate		\
 	ppp		\
 	racoon		\
-	ssh
+	ssh		\
+	watchdogd
+
+#	ng_igmp_fwd	\
+#	net_help	\
+#	nfs_client	\
 
 KERNEL_COMPRESSION=oldlzma
 KERNEL_COMPRESSION_TYPE=oldlzma
diff -r 76a415b4b32b -r d94b4723f2d5 boards/D-Link/DIR-632/files/etc/rc.d/ADAPTATION
--- a/boards/D-Link/DIR-632/files/etc/rc.d/ADAPTATION	Thu Sep 20 15:38:37 2012 +0300
+++ b/boards/D-Link/DIR-632/files/etc/rc.d/ADAPTATION	Thu Sep 20 15:44:25 2012 +0300
@@ -40,7 +40,10 @@
 #	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
+	RESET_PIN=$(kenv RESET_PIN)
+	WPS_PIN=$(kenv WPS_PIN)
+	gpioctl -f /dev/gpioc0 -c ${RESET_PIN} IN II INT
+	gpioctl -f /dev/gpioc0 -c ${WPS_PIN} IN II INT
 
 	# Import MAC addresses with known names
 #	kenv LAN_MAC_ADDR=`kenv ethaddr`
@@ -48,9 +51,23 @@
 
 	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`
+#	ifconfig wifi0 ether `kenv WLAN_MAC_ADDR`
+
+	# Enable Wireless LED
+	sysctl dev.ath.0.ledpin=1
+	sysctl dev.ath.0.softled=0
+	sysctl dev.ath.0.softled=1
+	sysctl dev.ath.0.ledpin=0
+	sysctl dev.ath.0.softled=0
+	sysctl dev.ath.0.softled=1
+
+	# Preset "Internet" LED to black
+	echo 0 > /dev/led/internet
+	echo 1 > /dev/led/internet_bi
 
 	hostname `kenv HostName`
 
diff -r 76a415b4b32b -r d94b4723f2d5 boards/D-Link/DIR-632/files/etc/rc.d/bd_switchctl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DIR-632/files/etc/rc.d/bd_switchctl	Thu Sep 20 15:44:25 2012 +0300
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# BEFORE: ADAPTATION
+# PROVIDE: bd_switchctl
+# KEYWORD: nojail nostart
+
+. /etc/rc.subr
+. /etc/network.subr
+
+name="bd_switchctl"
+extra_commands="enablelan disablelan"
+enablelan_cmd="enablelan_sub"
+disablelan_cmd="disablelan_sub"
+
+disablelan_sub()
+{
+
+	echo "Disable LAN ports"
+	switchctl /dev/switch0 set reg 0x000 0x0800
+	switchctl /dev/switch0 set reg 0x100 0x0800
+	switchctl /dev/switch0 set reg 0x200 0x0800
+	switchctl /dev/switch0 set reg 0x300 0x0800
+	switchctl /dev/switch0 set reg 0x400 0x0800
+	switchctl /dev/switch0 set reg 0x500 0x0800
+	switchctl /dev/switch0 set reg 0x600 0x0800
+	switchctl /dev/switch0 set reg 0x700 0x0800
+
+}
+
+enablelan_sub()
+{
+	echo "Enable LAN ports"
+	switchctl /dev/switch0 set reg 0x000 0x3100
+	switchctl /dev/switch0 set reg 0x100 0x3100
+	switchctl /dev/switch0 set reg 0x200 0x3100
+	switchctl /dev/switch0 set reg 0x300 0x3100
+	switchctl /dev/switch0 set reg 0x400 0x3100
+	switchctl /dev/switch0 set reg 0x500 0x3100
+	switchctl /dev/switch0 set reg 0x600 0x3100
+	switchctl /dev/switch0 set reg 0x700 0x3100
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file
diff -r 76a415b4b32b -r d94b4723f2d5 boards/D-Link/DIR-632/files/etc/rc.d/boardinfo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DIR-632/files/etc/rc.d/boardinfo	Thu Sep 20 15:44:25 2012 +0300
@@ -0,0 +1,81 @@
+#!/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()
+{
+
+	echo "Disable LAN ports"
+	switchctl /dev/switch0 set reg 0x000 0x0800
+	switchctl /dev/switch0 set reg 0x100 0x0800
+	switchctl /dev/switch0 set reg 0x200 0x0800
+	switchctl /dev/switch0 set reg 0x300 0x0800
+	switchctl /dev/switch0 set reg 0x400 0x0800
+	switchctl /dev/switch0 set reg 0x500 0x0800
+	switchctl /dev/switch0 set reg 0x600 0x0800
+	switchctl /dev/switch0 set reg 0x700 0x0800
+
+	kenv	RESET_PIN=8
+	kenv	WPS_PIN=12
+	kenv	INTERNET_LED=internet_bi
+
+	MAC_ADDR_LIST=$(dd if=/dev/map/MAC bs=64k count=1 2>/dev/null | 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}\""
+
+}
+
+enablelan_sub()
+{
+	echo "Enable LAN ports"
+	switchctl /dev/switch0 set reg 0x000 0x3100
+	switchctl /dev/switch0 set reg 0x100 0x3100
+	switchctl /dev/switch0 set reg 0x200 0x3100
+	switchctl /dev/switch0 set reg 0x300 0x3100
+	switchctl /dev/switch0 set reg 0x400 0x3100
+	switchctl /dev/switch0 set reg 0x500 0x3100
+	switchctl /dev/switch0 set reg 0x600 0x3100
+	switchctl /dev/switch0 set reg 0x700 0x3100
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file


More information about the Zrouter-src mailing list