changeset 211:0bbc77ee863b

Add new DIR-320 (this time w/ Ralink RT5350F)
author ray@terran.dlink.ua
date Sat, 15 Oct 2011 02:33:09 +0300
parents e2ecd60d215f
children 3f7f9da14c6c
files boards/D-Link/DIR-320-NRU/README boards/D-Link/DIR-320-NRU/board.hints boards/D-Link/DIR-320-NRU/board.mk boards/D-Link/DIR-320-NRU/files/etc/rc.d/ADAPTATION
diffstat 3 files changed, 288 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DIR-320-NRU/board.hints	Sat Oct 15 02:33:09 2011 +0300
@@ -0,0 +1,138 @@
+# $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=0x10100000
+hint.rt.0.msize=0x10000
+hint.rt.0.irq=3
+
+hint.uart.1.flags="0x30"
+
+# bit2 must be low - give SPI pins[GP3-6] to controller
+hint.rt305x_sysctl.0.gpiomode=0x00029d
+
+hint.spi.0.at="obio0"
+hint.spi.0.maddr=0x10000b00
+hint.spi.0.msize=0x100
+
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
+# gpio
+
+# Buttons
+# GPIO10 - Reset BTN	IN PU II INT
+#hint.gpioreset.0.at="gpiobus0"
+#hint.gpioreset.0.pins="0x0400"
+#hint.gpioreset.0.name="reset"
+#hint.gpioreset.0.flags="0x04a1"
+
+## GPIO0  - WPS BTN	IN PU II INT
+#hint.gpiobutton.0.at="gpiobus0"
+#hint.gpiobutton.0.pins="0x01"
+#hint.gpiobutton.0.name="wps"
+#hint.gpiobutton.0.flags="0x04a1"
+
+# LEDs
+# Power Yellow	8
+# Power Green	9
+# WAN Green	12
+# WAN Yellow	14
+# WPS Orange	11
+# WPS Blue	13
+#GPIO8  STATUS ?
+#hint.gpioled.0.at="gpiobus0"
+#hint.gpioled.0.pins="0x0100"
+#hint.gpioled.0.name="status_yellow"
+#hint.gpioled.0.flags="0x0102"
+
+#GPIO9  STATUS
+#hint.gpioled.1.at="gpiobus0"
+#hint.gpioled.1.pins="0x0200"
+#hint.gpioled.1.name="status"
+#hint.gpioled.1.flags="0x0102"
+
+#GPIO11 WPS Orange
+#hint.gpioled.2.at="gpiobus0"
+#hint.gpioled.2.pins="0x0800"
+#hint.gpioled.2.name="wps_orange"
+#hint.gpioled.2.flags="0x0002"
+
+#GPIO12 WAN Green
+#hint.gpioled.3.at="gpiobus0"
+#hint.gpioled.3.pins="0x1000"
+#hint.gpioled.3.name="wan"
+#hint.gpioled.3.flags="0x0102"
+
+#GPIO13 WPS Blue
+#hint.gpioled.4.at="gpiobus0"
+#hint.gpioled.4.pins="0x2000"
+#hint.gpioled.4.name="wps"
+#hint.gpioled.4.flags="0x0002"
+
+#GPIO14 WAN Yellow
+#hint.gpioled.5.at="gpiobus0"
+#hint.gpioled.5.pins="0x4000"
+#hint.gpioled.5.name="wan_yellow"
+#hint.gpioled.5.flags="0x0102"
+
+
+#0x00000000-0x00030000 : "Bootloader"
+#0x00030000-0x00040000 : "Factory"
+#0x00040000-0x00070000 : "Config"
+#0x00070000-0x000b0000 : "Language"
+#0x000b0000-0x001a0000 : "Kernel"
+#0x001a0000-0x01000000 : "RootFS"
+
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x00000000
+hint.map.0.end=0x00030000
+hint.map.0.name="bootloader"
+hint.map.0.readonly=1
+
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x00030000
+hint.map.1.end=0x00040000
+hint.map.1.name="linuxconfig"
+
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x00040000
+hint.map.2.end=0x00050000
+hint.map.2.name="factory"
+
+hint.map.3.at="flash/spi0"
+hint.map.3.start=0x00050000
+hint.map.3.end=0x007e0000
+hint.map.3.name="upgrade"
+
+hint.map.4.at="flash/spi0"
+hint.map.4.name="kernel"
+hint.map.4.start=0x00050000
+hint.map.4.end="search:0x00100000:0x10000:.!/bin/sh"
+
+hint.map.5.at="flash/spi0"
+hint.map.5.name="rootfs"
+hint.map.5.start="search:0x00100000:0x10000:.!/bin/sh"
+hint.map.5.end=0x007e0000
+
+hint.map.6.at="flash/spi0"
+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-320-NRU/board.mk	Sat Oct 15 02:33:09 2011 +0300
@@ -0,0 +1,74 @@
+
+###################################################
+#
+# Board used hardware/chip`s
+#
+###################################################
+
+
+SOC_VENDOR=Ralink
+SOC_CHIP=RT5350F
+# Maybe used for kernel config and maybe multiple e.g. "cfi nand"
+BOARD_FLASH_TYPE=spi
+# 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 ppp
+# hostap
+# nfs_client
+# racoon
+
+KERNEL_COMPRESSION=gz
+KERNEL_COMPRESSION_TYPE=gz
+UBOOT_KERNEL_COMPRESSION_TYPE=gzip
+
+MKULZMA_BLOCKSIZE=65536
+
+PACKING_KERNEL_IMAGE?=kernel.gzip.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-320-NRU/files/etc/rc.d/ADAPTATION	Sat Oct 15 02:33:09 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