changeset 149:6388ced87f3c

Add new board DIR-620Sec, pseudo name for DIR-620 but w/o Wireless and w/ secure channel software (racoon2/openvpn/ssh)
author ray@terran.dlink.ua
date Thu, 09 Jun 2011 00:19:23 +0300
parents dc09175b760b
children a86dd7697e9e
files boards/D-Link/DIR-620Sec/README boards/D-Link/DIR-620Sec/board.hints boards/D-Link/DIR-620Sec/board.mk boards/D-Link/DIR-620Sec/files/etc/rc.d/ADAPTATION
diffstat 3 files changed, 278 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DIR-620Sec/board.hints	Thu Jun 09 00:19:23 2011 +0300
@@ -0,0 +1,128 @@
+# $FreeBSD$
+# device.hints
+hint.obio.0.at="nexus0"
+hint.obio.0.maddr=0x10000000
+hint.obio.0.msize=0x10000000
+
+hint.nvram.0.base=0x1f030000
+hint.nvram.0.maxsize=0x2000
+hint.nvram.0.flags=9 # 1 = No check, 2 = Format U-Boot
+hint.nvram.1.base=0x1f032000
+hint.nvram.1.maxsize=0x4000
+hint.nvram.1.flags=9 # 1 = No check, 2 = Format U-Boot
+
+# on-board Ralink Frame Engine
+#hint.rt.0.at="nexus0"
+#hint.rt.0.maddr=0x12000000
+#hint.rt.0.msize=0x200000
+#hint.rt.0.irq=9
+hint.rt.0.macaddr="00:18:e7:d5:83:90"
+
+# uart0
+#hint.uart.0.at="obio0"
+#hint.uart.0.maddr=0x10000C00
+#hint.uart.0.msize=0x100
+#hint.uart.0.irq=12
+#hint.uart.0.flags="0x30"
+
+# uart1
+#hint.uart.1.at="obio0"
+#hint.uart.1.maddr=0x10000500
+#hint.uart.1.msize=0x100
+#hint.uart.1.irq=5
+hint.uart.1.flags="0x30"
+
+# Configure SYSCTL_GPIOMODE to pass FUART pins to GPIO
+# original:
+# hint.rt305x_sysctl.0.gpiomode=0x000283
+# required:
+hint.rt305x_sysctl.0.gpiomode=0x00029f
+
+# gpio
+# XXX DEBUG WPS BTN as a reset
+hint.gpioreset.0.at="gpiobus0"
+hint.gpioreset.0.pins="0x4000"
+hint.gpioreset.0.name="wps"
+hint.gpioreset.0.flags="0x0581"
+
+## GPIO0  - WPS BTN	IN II IO
+hint.gpiobutton.0.at="gpiobus0"
+hint.gpiobutton.0.pins="0x01"
+hint.gpiobutton.0.name="wps"
+hint.gpiobutton.0.flags="0x0581"
+
+#GPIO8  SECU_LED_OR
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.pins="0x0100"
+hint.gpioled.0.name="status_red"
+hint.gpioled.0.flags="0x0002"
+
+#GPIO9  STATUS
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.pins="0x0200"
+hint.gpioled.1.name="status"
+hint.gpioled.1.flags="0x0002"
+
+#GPIO11 SECU_LED
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.pins="0x0800"
+hint.gpioled.2.name="wps"
+hint.gpioled.2.flags="0x0182"
+
+#GPIO12 POWER
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.pins="0x1000"
+hint.gpioled.3.name="power"
+hint.gpioled.3.flags="0x0182"
+
+hint.cfi.0.width=2
+hint.cfi.0.shift=2
+
+#0x00000000-0x00030000 : "Bootloader"
+#0x00030000-0x00040000 : "Factory"
+#0x00040000-0x00070000 : "Config"
+#0x00070000-0x000b0000 : "Language"
+#0x000b0000-0x001a0000 : "Kernel"
+#0x001a0000-0x01000000 : "RootFS"
+
+hint.map.0.at="cfid0"
+hint.map.0.start=0x00000000
+hint.map.0.end=0x00030000
+hint.map.0.name="bootloader"
+hint.map.0.readonly=1
+
+hint.map.1.at="cfid0"
+hint.map.1.start=0x00030000
+hint.map.1.end=0x00040000
+hint.map.1.name="linuxconfig"
+
+hint.map.2.at="cfid0"
+hint.map.2.start=0x00040000
+hint.map.2.end=0x00050000
+hint.map.2.name="factory"
+
+hint.map.3.at="cfid0"
+hint.map.3.start=0x00050000
+hint.map.3.end=0x007e0000
+hint.map.3.name="upgrade"
+
+hint.map.4.at="cfid0"
+hint.map.4.name="kernel"
+hint.map.4.start=0x00050000
+hint.map.4.end="search:0x00100000:0x10000:.!/bin/sh"
+
+hint.map.5.at="cfid0"
+hint.map.5.name="rootfs"
+hint.map.5.start="search:0x00100000:0x10000:.!/bin/sh"
+hint.map.5.end=0x007e0000
+
+hint.map.6.at="cfid0"
+hint.map.6.start=0x007e0000
+hint.map.6.end=0x00800000
+hint.map.6.name="config"
+
+
+hint.rt.0.phymask=0x1f
+hint.rt.0.media=100
+hint.rt.0.fduplex=1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DIR-620Sec/board.mk	Thu Jun 09 00:19:23 2011 +0300
@@ -0,0 +1,74 @@
+
+###################################################
+#
+# Board used hardware/chip`s
+#
+###################################################
+
+
+SOC_VENDOR=Ralink
+SOC_CHIP=RT3052F
+# Maybe used for kernel config and maybe multiple e.g. "cfi nand"
+BOARD_FLASH_TYPE=cfi
+# TODO: size suffixes
+BOARD_FLASH_SIZE=8388608
+
+
+###################################################
+#
+# 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
+#
+###################################################
+
+
+
+# Image must not be biggest than GEOM_MAP_P2 (upgrade part.)
+FIRMWARE_IMAGE_SIZE_MAX=0x007a0000
+
+
+###################################################
+#
+#       Firmware Image Options
+#
+###################################################
+
+TARGET_PROFILES+=SMALL_ mpd ssh dlink.ua.web dhcp mroute ntpdate dnsmasq racoon openvpn
+# hostap
+# nfs_client
+# racoon
+
+KERNEL_COMPRESSION=oldlzma
+KERNEL_COMPRESSION_TYPE=oldlzma
+UBOOT_KERNEL_COMPRESSION_TYPE=lzma
+
+MKULZMA_BLOCKSIZE=65536
+
+PACKING_KERNEL_IMAGE?=kernel.oldlzma.uboot
+PACKING_ROOTFS_IMAGE?=rootfs.iso.ulzma
+
+# 64k
+PACKING_KERNEL_ROUND?=0x10000
+
+PACKING_ROOTFS_METHOD?=	tar.gz
+
+IMAGE_SUFFIX=zimage
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DIR-620Sec/files/etc/rc.d/ADAPTATION	Thu Jun 09 00:19:23 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 14 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