[Zrouter-src] ZRouter.org: push to ZRouter boards/D-Link/DSR-1000N/README boar...

zrouter-src at zrouter.org zrouter-src at zrouter.org
Fri Feb 3 15:34:31 UTC 2012


details:   http://zrouter.org/hg/zrouter//rev/da19040d75c5
changeset: 336:da19040d75c5
user:      ray at terran.dlink.ua
date:      Fri Feb 03 17:35:07 2012 +0200
description:
Update D-Link DSR-1000N setup.

diffstat:

 boards/D-Link/DSR-1000N/README                    |  32 +++++++++
 boards/D-Link/DSR-1000N/TODO                      |   2 +
 boards/D-Link/DSR-1000N/board.hints               |  77 ++++++++++++++++++++--
 boards/D-Link/DSR-1000N/board.mk                  |  34 ++++++---
 boards/D-Link/DSR-1000N/files/etc/rc.d/ADAPTATION |  49 ++++++++++++++
 5 files changed, 173 insertions(+), 21 deletions(-)

diffs (293 lines):

diff -r 49c9f1c57ecb -r da19040d75c5 boards/D-Link/DSR-1000N/README
--- a/boards/D-Link/DSR-1000N/README	Tue Jan 31 20:35:12 2012 +0200
+++ b/boards/D-Link/DSR-1000N/README	Fri Feb 03 17:35:07 2012 +0200
@@ -0,0 +1,32 @@
+# Setup
+setenv ipaddr 192.168.0.100
+setenv serverip 192.168.0.90
+
+setenv loadbsd 'tftp 0 DSR-1000N/D-Link_DSR-1000N.zimage'
+setenv flashbsd 'protect off $(linux_start) +$(filesize) ; erase $(linux_start) +$(filesize) ; cp.b $(fileaddr) $(linux_start) $(filesize)'
+setenv bootbsd 'gunzip $(linux_start) 0x300000 $(loadaddr) 0x1000000 ; bootoctlinux 0 numcores=1'
+
+setenv updatebsd 'run loadbsd ; run flashbsd'
+# Autoboot
+setenv bootcmd 'run bootbsd'
+
+saveenv
+
+# Update
+run updatebsd
+
+# Boot
+run bootbsd
+
+
+Switch configured by EEPROM as a portbased VLAN
+
+LAN1 - switch port 0
+LAN2 - switch port 1
+LAN3 - switch port 2
+LAN4 - switch port 3
+WAN1 - switch port 4 
+       switch port 5 - octe1 (name wan1)
+       switch port 8 - octe0 (name lan0)
+WAN2 - ------------- - octe2 (name wan0)
+
diff -r 49c9f1c57ecb -r da19040d75c5 boards/D-Link/DSR-1000N/TODO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DSR-1000N/TODO	Fri Feb 03 17:35:07 2012 +0200
@@ -0,0 +1,2 @@
+1. Fix PCI
+2. Add interrupt support to GPIO
\ No newline at end of file
diff -r 49c9f1c57ecb -r da19040d75c5 boards/D-Link/DSR-1000N/board.hints
--- a/boards/D-Link/DSR-1000N/board.hints	Tue Jan 31 20:35:12 2012 +0200
+++ b/boards/D-Link/DSR-1000N/board.hints	Fri Feb 03 17:35:07 2012 +0200
@@ -1,13 +1,73 @@
 # $FreeBSD$
 # device.hints
 
-hint.switch.0.iface="octe0"
-hint.switch.0.driver="bcm5325_switch"
-hint.switch.1.iface="octe1"
-hint.switch.1.driver="bcm5325_switch"
-hint.switch.2.iface="octe2"
-hint.switch.2.driver="bcm5325_switch"
+# No probe at all
+hint.miibus.0.phymask="0x00000000"
+hint.miibus.1.phymask="0x00000000"
+hint.miibus.3.phymask="0x00000100"
+# bgephy will attach here
 
+hint.floatphy.0.at="miibus0"
+hint.floatphy.0.phyno=0
+hint.floatphy.0.master="switch"
+hint.floatphy.0.master_unit=0
+hint.floatphy.0.master_phys=0x0000001f # Sense PHY0
+hint.floatphy.0.flags=0x00000000
+hint.floatphy.0.speed=1000
+
+# Switch attached to MDIO bus on arge0
+hint.switch.0.at="miibus1"
+hint.switch.0.phyno=30
+
+################## GPIO items ##################
+# Buttons
+# GPIO07 - Reset BTN	IN PU II INT
+hint.gpioreset.0.at="gpiobus0"
+hint.gpioreset.0.pins="0x0080"
+hint.gpioreset.0.name="reset"
+hint.gpioreset.0.flags="0x04a1"
+
+## GPIO8  - WPS BTN	IN PU II INT
+hint.gpiobutton.0.at="gpiobus0"
+hint.gpiobutton.0.pins="0x0100"
+hint.gpiobutton.0.name="wps"
+hint.gpiobutton.0.flags="0x04a1"
+
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.pins="0x0200"
+hint.gpioled.0.name="usb"	# Name of first unit w/o number,
+# to compatibility with devices which have only one
+hint.gpioled.0.flags="0x0140" # invout, pulldown
+
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.pins="0x0400"
+hint.gpioled.1.name="usb2"
+hint.gpioled.1.flags="0x0140" # invout, pulldown
+
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.pins="0x0800"
+hint.gpioled.2.name="wps"
+hint.gpioled.2.flags="0x0140" # invout, pulldown
+
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.pins="0x4000"
+hint.gpioled.3.name="status"	# Default for status
+hint.gpioled.3.flags="0x0140" # invout, pulldown
+
+hint.gpioled.4.at="gpiobus0"
+hint.gpioled.4.pins="0x8000"
+hint.gpioled.4.name="status_orange"
+hint.gpioled.4.flags="0x0140" # invout, pulldown
+
+hint.gpioled.5.at="gpiobus0"
+hint.gpioled.5.pins="0x20000"
+hint.gpioled.5.name="minipci"
+hint.gpioled.5.flags="0x0140" # invout, pulldown
+
+hint.gpioled.6.at="gpiobus0"
+hint.gpioled.6.pins="0x40000"
+hint.gpioled.6.name="minipci2"
+hint.gpioled.6.flags="0x0140" # invout, pulldown
 
 #phys_mapped_flash:
 #640k(bootloader)ro,
@@ -24,11 +84,11 @@
 
 hint.map.1.at="cfid0"
 hint.map.1.start=0x000a0000
-hint.map.1.end=0x009a0000
+hint.map.1.end="search:0x00100000:0x10000:.!/bin/sh"
 hint.map.1.name="kernel"
 
 hint.map.2.at="cfid0"
-hint.map.2.start=0x009a0000
+hint.map.2.start="search:0x00100000:0x10000:.!/bin/sh"
 hint.map.2.end=0x01da0000
 hint.map.2.name="rootfs"
 
@@ -52,3 +112,4 @@
 hint.map.6.end=0x01da0000
 hint.map.6.name="upgrade"
 
+
diff -r 49c9f1c57ecb -r da19040d75c5 boards/D-Link/DSR-1000N/board.mk
--- a/boards/D-Link/DSR-1000N/board.mk	Tue Jan 31 20:35:12 2012 +0200
+++ b/boards/D-Link/DSR-1000N/board.mk	Fri Feb 03 17:35:07 2012 +0200
@@ -10,8 +10,6 @@
 # TODO: size suffixes
 BOARD_FLASH_SIZE=33554432
 
-#?????KERNEL_COMPRESSION=lzma.4.17
-
 ###################################################
 #
 # Vars for kernel config 
@@ -20,16 +18,27 @@
 KERNCONF_OPTIONS+=	OCTEON_VENDOR_D_LINK
 KERNCONF_OPTIONS+=	OCTEON_BOARD_DSR_1000N
 
+KERNCONF_DEVICES+=	brgphy
 KERNCONF_DEVICES+=	switch
 KERNCONF_DEVICES+=	switch_bcm5325
 
 # ident 
 KERNCONF_IDENT=${TARGET_VENDOR}_${TARGET_DEVICE}
+
 # Include usb and SoC usb controller drivers
 WITH_USB=yes
 WITH_IPSEC=yes
 # Builded modules
-KERNCONF_MODULES_OVERRIDE+=ipfw usb/umass usb/uplcom usb/u3g dummynet
+KERNCONF_MODULES_OVERRIDE+=ipfw dummynet zlib
+KERNCONF_MODULES_OVERRIDE+=usb/uplcom usb/u3g usb/umodem usb/ucom
+KERNCONF_MODULES_OVERRIDE+=usb/umass cam
+
+KERNCONF_MODULES_OVERRIDE+=usb/run usb/rum firmware
+KERNCONF_MODULES_OVERRIDE+=wlan wlan_xauth wlan_wep wlan_tkip wlan_acl \
+    wlan_amrr wlan_ccmp wlan_rssadapt
+
+# Additional utilities ????
+WORLD_SUBDIRS_ZROUTER+=target/sbin/upgrade
 
 .if !defined(WITHOUT_WIRELESS)
 KERNCONF_MODULES_OVERRIDE+=wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt
@@ -40,7 +49,7 @@
 KERNCONF_DEVICES+=	wlan_amrr
 KERNCONF_DEVICES+=	wlan_wep
 KERNCONF_DEVICES+=	wlan_ccmp
-KERNCONF_DEVICES+=	wlan_tkip
+#KERNCONF_DEVICES+=	wlan_tkip
 
 KERNCONF_OPTIONS+=	AH_DEBUG
 KERNCONF_OPTIONS+=	ATH_DEBUG
@@ -48,7 +57,7 @@
 KERNCONF_OPTIONS+=	ATH_ENABLE_11N
 KERNCONF_OPTIONS+=	AH_SUPPORT_AR5416
 #KERNCONF_OPTIONS+=	AH_SUPPORT_AR9130
-KERNCONF_OPTIONS+=	AH_RXCFG_SDMAMW_4BYTES
+#KERNCONF_OPTIONS+=	AH_RXCFG_SDMAMW_4BYTES
 # interrupt mitigation not possible on AR9130
 # option		AH_AR5416_INTERRUPT_MITIGATION
 KERNCONF_DEVICES+=	ath
@@ -57,11 +66,6 @@
 KERNCONF_DEVICES+=	ath_rate_sample
 .endif
 
-
-
-# Additional utilities ????
-WORLD_SUBDIRS_ZROUTER+=target/sbin/upgrade
-
 ###################################################
 #
 #       Limits
@@ -78,7 +82,8 @@
 #
 ###################################################
 
-TARGET_PROFILES+=SMALL_ mpd ssh dlink.ua.web dhcp mroute ntpdate dnsmasq racoon openvpn ppp hostap ath nfs_client
+TARGET_PROFILES+=SMALL_ mpd ssh dlink.ua.web dhcp mroute ntpdate dnsmasq \
+    racoon openvpn ppp hostap ath nfs_client net_help
 
 KERNEL_COMPRESSION=oldlzma
 KERNEL_COMPRESSION_TYPE=oldlzma
@@ -86,7 +91,10 @@
 
 MKULZMA_BLOCKSIZE=65536
 
-PACKING_KERNEL_IMAGE?=kernel.kbin.oldlzma.uboot.sync
+# 256K block
+PACKING_KERNEL_ROUND=0x40000
+PACKING_KERNEL_IMAGE?=kernel.strip.gz.sync
 PACKING_ROOTFS_IMAGE?=rootfs_clean.iso.ulzma
 
-NEW_IMAGE_TYPE=split_kernel_rootfs
+NEW_IMAGE_TYPE?=zimage
+
diff -r 49c9f1c57ecb -r da19040d75c5 boards/D-Link/DSR-1000N/files/etc/rc.d/ADAPTATION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DSR-1000N/files/etc/rc.d/ADAPTATION	Fri Feb 03 17:35:07 2012 +0200
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# PROVIDE: ADAPTATION
+
+. /etc/rc.subr
+. /etc/network.subr
+
+name="ADAPTATION"
+start_cmd="adapt_start"
+start_precmd="adapt_prestart"
+start_postcmd="adapt_poststart"
+stop_cmd="adapt_stop"
+
+adapt_prestart()
+{
+	# Switch confugred by own EEPROM
+#	gpioctl -f /dev/gpioc0 -c 10 IN II PU INT
+
+	# Import MAC addresses with known names
+#	kenv LAN_MAC_ADDR=`kenv ethaddr`
+#	kenv WAN_MAC_ADDR=`kenv wanmac`
+
+	ifconfig octe0 name lan0
+	ifconfig octe1 name wan1
+	ifconfig octe2 name wan0
+
+#	ifconfig lan0 ether `kenv LAN_MAC_ADDR`
+#	ifconfig wan0 ether `kenv WAN_MAC_ADDR`
+
+#	hostname `kenv HostName`
+	hostname DSR-1000N
+
+}
+
+adapt_start()
+{
+}
+
+adapt_poststart()
+{
+}
+
+adapt_stop()
+{
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file


More information about the Zrouter-src mailing list