changeset 174:14f555d30d12

Add Soekris 4501 board
author ray@terran.dlink.ua
date Tue, 05 Jul 2011 12:30:56 +0300
parents 39ddb4b41c29
children 129daaa502a1
files boards/Soekris/4501/README boards/Soekris/4501/board.hints boards/Soekris/4501/board.mk boards/Soekris/4501/files/etc/rc.d/ADAPTATION
diffstat 3 files changed, 138 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/Soekris/4501/board.hints	Tue Jul 05 12:30:56 2011 +0300
@@ -0,0 +1,3 @@
+# $FreeBSD$
+# device.hints
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/Soekris/4501/board.mk	Tue Jul 05 12:30:56 2011 +0300
@@ -0,0 +1,59 @@
+
+###################################################
+#
+# Board used hardware/chip`s
+#
+###################################################
+
+
+SOC_VENDOR=Intel
+SOC_CHIP=i386
+
+
+###################################################
+#
+# Vars for kernel config 
+#
+###################################################
+
+# ident 
+KERNCONF_IDENT=${TARGET_VENDOR}_${TARGET_DEVICE}
+# Include usb and SoC usb controller drivers
+WITH_USB=yes
+WITH_IPSEC=yes
+WITHOUT_WIRELESS=yes
+# Builded modules
+#KERNCONF_MODULES_OVERRIDE+=usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib
+
+# Additional utilities
+#WORLD_SUBDIRS_ZROUTER+=target/sbin/upgrade
+
+
+###################################################
+#
+#       Limits
+#
+###################################################
+
+
+
+
+
+###################################################
+#
+#       Firmware Image Options
+#
+###################################################
+
+TARGET_PROFILES+=SMALL_ mpd ssh dlink.ua.web dhcp mroute ntpdate dnsmasq racoon openvpn ppp nfs_client
+# hostap
+# racoon
+
+32M!=sh -c 'echo $$((32 * 1024 * 1024))'
+ROOTFS_WITH_KERNEL=yes
+ROOTFS_MEDIA_SIZE?=${32M}
+PACKING_KERNEL_IMAGE?=kernel
+PACKING_ROOTFS_IMAGE?=rootfs
+
+IMAGE_SUFFIX=zimage
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/Soekris/4501/files/etc/rc.d/ADAPTATION	Tue Jul 05 12:30:56 2011 +0300
@@ -0,0 +1,76 @@
+#!/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()
+{
+	switchctl /dev/switch0 set vlan 0 vid 1
+	switchctl /dev/switch0 set vlan 0 add 0 u
+	switchctl /dev/switch0 set vlan 0 add 1 u
+	switchctl /dev/switch0 set vlan 0 add 2 u
+	switchctl /dev/switch0 set vlan 0 add 3 u
+	switchctl /dev/switch0 set vlan 0 del 4
+	switchctl /dev/switch0 set vlan 0 add 5 t
+	switchctl /dev/switch0 set vlan 0 add 6 t
+
+	switchctl /dev/switch0 set vlan 1 vid 2
+	switchctl /dev/switch0 set vlan 1 del 0
+	switchctl /dev/switch0 set vlan 1 del 1
+	switchctl /dev/switch0 set vlan 1 del 2
+	switchctl /dev/switch0 set vlan 1 del 3
+	switchctl /dev/switch0 set vlan 1 add 4 u
+	switchctl /dev/switch0 set vlan 1 add 5 t
+	switchctl /dev/switch0 set vlan 1 add 6 t
+
+	switchctl /dev/switch0 set port 0 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 1 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 2 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 3 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 4 pvid 2 flags Untag
+
+	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
+
+	# Import MAC addresses with known names
+	kenv LAN_MAC_ADDR=`kenv ethaddr`
+	kenv WAN_MAC_ADDR=`kenv wanmac`
+
+	ifconfig rt0 up
+	ifconfig vlan1 create vlan 1 vlandev rt0
+	ifconfig vlan1 name lan0
+	ifconfig vlan2 create vlan 2 vlandev rt0
+	ifconfig vlan2 name wan0
+
+	ifconfig lan0 ether `kenv LAN_MAC_ADDR`
+	ifconfig wan0 ether `kenv WAN_MAC_ADDR`
+
+	hostname `kenv HostName`
+
+}
+
+adapt_start()
+{
+}
+
+adapt_poststart()
+{
+}
+
+adapt_stop()
+{
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file