changeset 87:96b52a080f89

NQ-901 begin
author ray@terran.dlink.ua
date Mon, 14 Feb 2011 18:02:36 +0200
parents 95d3b08a9da4
children 1699a849f644
files Makefile RUN_NQ-900.sh RUN_NQ-901.sh boards/NorthQ/NQ-901/README boards/NorthQ/NQ-901/board.hints boards/NorthQ/NQ-901/board.mk profiles/SMALL_/profile.mk share/mk/zrouter.base.tools.mk socs/Ralink/RT3052F/soc.mk
diffstat 8 files changed, 357 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Feb 14 01:48:51 2011 +0200
+++ b/Makefile	Mon Feb 14 18:02:36 2011 +0200
@@ -53,6 +53,13 @@
 	echo "cpu	${KERNCONF_CPU}" >> ${KERNEL_CONFIG_FILE}
 	echo "hints	\"${KERNEL_HINTS_FILE}\"" >> ${KERNEL_CONFIG_FILE}
 	echo "# makeoptions section" >> ${KERNEL_CONFIG_FILE}
+	if [ "x${KERNCONF_MODULES_OVERRIDE}" = "xnone" ] ; then \
+		echo "makeoptions	MODULES_OVERRIDE=\"\""  >> ${KERNEL_CONFIG_FILE} ; \
+	else \
+		if [ "x${KERNCONF_MODULES_OVERRIDE}" != "x" ] ; then \
+		echo "makeoptions	MODULES_OVERRIDE=\"${KERNCONF_MODULES_OVERRIDE}\""  >> ${KERNEL_CONFIG_FILE} ; \
+		fi ; \
+	fi
 .for makeoption in ${KERNCONF_MAKEOPTIONS}
 	echo "makeoptions	${makeoption}" >> ${KERNEL_CONFIG_FILE}
 .endfor
@@ -68,6 +75,9 @@
 .for device in ${KERNCONF_DEVICES}
 	echo "device	${device}" >> ${KERNEL_CONFIG_FILE}
 .endfor
+.for nodevice in ${KERNCONF_NODEVICES}
+	echo "nodevice	${nodevice}" >> ${KERNEL_CONFIG_FILE}
+.endfor
 
 # Generate .hints file
 # TODO: generate hints on MAP partiotion list, GPIO usege list 
@@ -142,6 +152,9 @@
 _WORLD_BUILD_ENV+="WITHOUT_NIS=yes"
 _WORLD_INSTALL_ENV+="WITHOUT_NIS=yes"
 
+_WORLD_BUILD_ENV+="WITHOUT_BLUETOOTH=yes"
+_WORLD_INSTALL_ENV+="WITHOUT_BLUETOOTH=yes"
+
 _WORLD_BUILD_ENV+="WITHOUT_KERBEROS=yes"
 _WORLD_BUILD_ENV+="WITHOUT_KERBEROS_SUPPORT=yes"
 _WORLD_INSTALL_ENV+="WITHOUT_KERBEROS=yes"
@@ -202,10 +215,13 @@
 .endfor
 
 FREEBSD_BUILD_ENV_VARS!=(MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_WORLD_BUILD_ENV} -C ${FREEBSD_SRC_TREE} buildenvvars)
-FREEBSD_BUILD_ENV_VARS_SECOND!=${FREEBSD_BUILD_ENV_VARS}
+#.warning ${FREEBSD_BUILD_ENV_VARS}
+#FREEBSD_BUILD_ENV_VARS_SECOND!=${FREEBSD_BUILD_ENV_VARS}
+#.warning ${FREEBSD_BUILD_ENV_VARS_SECOND}
 
 # Import buildenvvars into our namespace with suffix FREEBSD_BUILD_ENV_
-.for var in ${FREEBSD_BUILD_ENV_VARS_SECOND}
+#.for var in ${FREEBSD_BUILD_ENV_VARS_SECOND}
+.for var in ${FREEBSD_BUILD_ENV_VARS}
 FREEBSD_BUILD_ENV_${var}
 .endfor
 
@@ -275,6 +291,7 @@
 IMAGE_BUILD_PATHS=${ZTOOLS_PATH}:${FREEBSD_BUILD_ENV_PATH}
 
 .include "share/mk/zrouter.local.tools.mk"
+.include "share/mk/zrouter.base.tools.mk"
 
 ROOTFS_RMLIST= \
     \\( \\( -type f -or -type l \\) -and \
--- a/RUN_NQ-900.sh	Mon Feb 14 01:48:51 2011 +0200
+++ b/RUN_NQ-900.sh	Mon Feb 14 18:02:36 2011 +0200
@@ -16,5 +16,5 @@
 export __MAKE_CONF
 export SRCCONF
 
-make TARGET_VENDOR=NorthQ TARGET_DEVICE=NQ-900 FREEBSD_SRC_TREE=${FREEBSD_SRC_TREE} TARGET_PROFILES="SMALL_ zhttpd" kernel_bin_oldlzma world-build world-install fwimage 2>&1 | tee $0.${DATE}.log
+make TARGET_VENDOR=NorthQ TARGET_DEVICE=NQ-900 FREEBSD_SRC_TREE=${FREEBSD_SRC_TREE} TARGET_PROFILES="SMALL_ zhttpd" makefs_cd9660 kernel-install kernel_bin_oldlzma world-build world-install fwimage 2>&1 | tee $0.${DATE}.log
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RUN_NQ-901.sh	Mon Feb 14 18:02:36 2011 +0200
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+HOST=`hostname`
+echo "'${HOST}'"
+if [ "x${HOST}" = "xrnote.ddteam.net" ] ; then
+FREEBSD_SRC_TREE=/usr/home/ray/work/@HG/http_my_ddteam_net_hg_BASE_/head/
+else
+FREEBSD_SRC_TREE=/usr/1/MIPS_FreeBSD/HEAD/head
+fi
+DATE=`date +%Y-%m-%d_%H:%M`
+
+
+__MAKE_CONF=/dev/null
+SRCCONF=/dev/null
+
+export __MAKE_CONF
+export SRCCONF
+
+make TARGET_VENDOR=NorthQ TARGET_DEVICE=NQ-901 FREEBSD_SRC_TREE=${FREEBSD_SRC_TREE} TARGET_PROFILES="SMALL_ zhttpd" makefs_cd9660 kernel-install kernel_bin_oldlzma world-build world-install fwimage 2>&1 | tee $0.${DATE}.log
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/NorthQ/NQ-901/board.hints	Mon Feb 14 18:02:36 2011 +0200
@@ -0,0 +1,125 @@
+# $FreeBSD$
+# device.hints
+hint.obio.0.at="nexus0"
+hint.obio.0.maddr=0x10000000
+hint.obio.0.msize=0x10000000
+
+hint.nvram.0.sig=0xe5e60a74
+hint.nvram.0.base=0x1f030000
+hint.nvram.0.maxsize=0x2000
+hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic
+hint.nvram.1.sig=0x5a045e94
+hint.nvram.1.base=0x1f032000
+hint.nvram.1.maxsize=0x4000
+hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic
+
+# 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"
+
+
+# gpio
+# 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"
+
+# GPIO7  - MODE SW AP	IN II IO
+hint.gpiobutton.1.at="gpiobus0"
+hint.gpiobutton.1.pins="0x80"
+hint.gpiobutton.1.name="mode_ap"
+hint.gpiobutton.1.flags="0x0581"
+
+# GPIO8  - ST LEDRED	OUT	/* 2pin BiDir RED/BLUE LED */
+# GPIO9  - ST LEDBLUE	OUT
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.pins="0x100"
+hint.gpioled.0.name="status_red"
+hint.gpioled.0.flags="0x0002"
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.pins="0x200"
+#hint.gpioled.1.name="status_blue"
+hint.gpioled.1.name="status"
+hint.gpioled.1.flags="0x0002"
+
+# GPIO10 - RST BTN	IN II IO
+hint.gpiobutton.2.at="gpiobus0"
+hint.gpiobutton.2.pins="0x400"
+hint.gpiobutton.2.name="reset"
+hint.gpiobutton.2.flags="0x0581"
+
+# GPIO11 - MODE SW CL	IN II IO
+hint.gpiobutton.3.at="gpiobus0"
+hint.gpiobutton.3.pins="0x800"
+hint.gpiobutton.3.name="mode_wlan_client"
+hint.gpiobutton.3.flags="0x0581"
+
+# GPIO14 - WPS LED	OUT II IO
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.pins="0x4000"
+hint.gpioled.2.name="wps"
+hint.gpioled.2.flags="0x0182"
+
+
+
+#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="factory"
+
+hint.map.2.at="cfid0"
+hint.map.2.start=0x00040000
+hint.map.2.end=0x00800000
+hint.map.2.name="upgrade"
+
+hint.map.3.at="cfid0"
+hint.map.3.start=0x00040000
+hint.map.3.end=0x00050000
+hint.map.3.name="config"
+
+hint.map.4.at="cfid0"
+hint.map.4.start=0x00050000
+hint.map.4.end=0x00150000
+hint.map.4.name="kernel"
+
+hint.map.5.at="cfid0"
+hint.map.5.start=0x00150000
+hint.map.5.end=0x00800000
+hint.map.5.name="rootfs"
+
+
+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/NorthQ/NQ-901/board.mk	Mon Feb 14 18:02:36 2011 +0200
@@ -0,0 +1,61 @@
+###################################################
+#
+# 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
+
+KERNEL_COMPRESSION=lzma.4.17
+KERNEL_COMPRESSION_TYPE=oldlzma
+
+###################################################
+#
+# Vars for kernel config 
+#
+###################################################
+
+# ident 
+KERNCONF_IDENT=${TARGET_VENDOR}_${TARGET_DEVICE}
+# Include usb and SoC usb controller drivers
+WITH_USB=yes
+# Builded modules
+#KERNCONF_MAKEOPTIONS+=	"MODULES_OVERRIDE=\"ipfw libalias dummynet usb/umass usb/uplcom usb/u3g\""
+KERNCONF_MODULES_OVERRIDE+=wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt random if_bridge bridgestp msdosfs md ipfw dummynet libalias geom/geom_label geom/geom_uncompress ufs usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib
+
+# Additional utilities
+#WORLD_SUBDIRS_ZROUTER+=target/sbin/upgrade
+
+
+# Flash mapping
+# ifndef GEOM_MAP_P0_PARENT then GEOM_MAP_P0_PARENT=cfid0
+#GEOM_MAP_P0_NAME=uboot
+#GEOM_MAP_P0_START=0x00000000
+#GEOM_MAP_P0_END=0x00030000
+#GEOM_MAP_P0_ATTR=RO
+
+
+
+
+###################################################
+#
+#       Limits
+#
+###################################################
+
+
+# 3Mb max size, since CFE loaded at 0xa0300000
+#KERNEL_SIZE_MAX=3145728
+# KERNEL_COMPRESSED_SIZE_MAX is unknown, limit between kernel and rootfs float 
+# (splited by HDR0 key, TRX header)
+
+# Image must not be biggest than GEOM_MAP_P4 (upgrade part.)
+FIRMWARE_IMAGE_SIZE_MAX=0x007b0000
+
--- a/profiles/SMALL_/profile.mk	Mon Feb 14 01:48:51 2011 +0200
+++ b/profiles/SMALL_/profile.mk	Mon Feb 14 18:02:36 2011 +0200
@@ -134,6 +134,7 @@
 libfetch \
 libradius \
 libarchive \
+libmp \
 libnetgraph \
 libpam/libpam \
 libpam/modules/pam_unix \
--- a/share/mk/zrouter.base.tools.mk	Mon Feb 14 01:48:51 2011 +0200
+++ b/share/mk/zrouter.base.tools.mk	Mon Feb 14 18:02:36 2011 +0200
@@ -2,11 +2,17 @@
 fstype=cd9660
 TDIR=/tmp/makefs_${fstype}_test
 
+#makefs_${fstype}:
+#	# Test if makefs accept ${fstype} filesystem
+#	STATUS=`mkdir -p ${TDIR}/fsroot \
+#	touch ${TDIR}/fsroot/test.file \
+#	makefs -t ${fstype} ${TDIR}/fsroot.${fstype} ${TDIR}/fsroot || echo MAKEFS_FAIL=${fstype} \
+#	rm -rf ${TDIR}`
+#	echo ${STATUS}
+
+
 makefs_${fstype}:
-	# Test if makefs accept ${fstype} filesystem
-	STATUS=`mkdir -p ${TDIR}/fsroot \
-	touch ${TDIR}/fsroot/test.file \
-	makefs -t ${fstype} ${TDIR}/fsroot.${fstype} ${TDIR}/fsroot || echo MAKEFS_FAIL=${fstype} \
-	rm -rf ${TDIR}`
-	echo ${STATUS}
+	cd ${FREEBSD_SRC_TREE}/usr.sbin/makefs && make DESTDIR=${ZTOOLS_PATH}
+	mkdir -p ${ZTOOLS_PATH}
+	cd ${FREEBSD_SRC_TREE}/usr.sbin/makefs && install -s -m 555 makefs ${ZTOOLS_PATH}
 
--- a/socs/Ralink/RT3052F/soc.mk	Mon Feb 14 01:48:51 2011 +0200
+++ b/socs/Ralink/RT3052F/soc.mk	Mon Feb 14 18:02:36 2011 +0200
@@ -1,3 +1,120 @@
+
+
+.warning "Ralink/RT3052F SoC"
+
+
+
+#XXX testing
+LZMA=lzma
+KERNEL_PATH=/usr/obj/kernel
+
+
+#SOC_KERNCONF=BCM5354
+#SOC_KERNHINTS=BCM5354.hints
+
+TARGET=			mips
+TARGET_ARCH=		mipsel
+
+KERNCONF_MACHINE=	${TARGET} ${TARGET_ARCH}
+KERNCONF_IDENT?=	RT3052F
+KERNCONF_CPU=		CPU_MIPS4KC
+KERNCONF_OPTIONS+=	ISA_MIPS32
+KERNCONF_FILES+=	"../rt305x/files.rt305x"
+KERNCONF_HINTS=		"RT3052F.hints"
+
+
+KERNCONF_MAKEOPTIONS+=	"MIPS_LITTLE_ENDIAN=defined"
+
+
+# XXX Maybe project definitions, maybe only board
+
+KERNCONF_MAKEOPTIONS+=	"INLINE_LIMIT=768"
+KERNCONF_MAKEOPTIONS+=	"KERNLOADADDR=0x80001000"
+KERNCONF_OPTIONS+=		MAXUSERS=3
+KERNCONF_OPTIONS+=		MAXFILES=512
+#KERNCONF_OPTIONS+=		NMBCLUSTERS=1024
+KERNCONF_OPTIONS+=		NSFBUFS=256
+KERNCONF_OPTIONS+=		SHMALL=128
+KERNCONF_OPTIONS+=		MSGBUF_SIZE=65536
+
+# Options for making kernel smallest 
+KERNCONF_OPTIONS+=		NO_SYSCTL_DESCR
+KERNCONF_OPTIONS+=		NO_FFS_SNAPSHOT
+KERNCONF_OPTIONS+=		SCSI_NO_SENSE_STRINGS
+KERNCONF_OPTIONS+=		SCSI_NO_OP_STRINGS
+#KERNCONF_OPTIONS+=		MUTEX_NOINLINE
+KERNCONF_OPTIONS+=		RWLOCK_NOINLINE
+KERNCONF_OPTIONS+=		SX_NOINLINE
+KERNCONF_OPTIONS+=		NO_SWAPPING
 
 
-.warning "Ralink/RT3052F SoC"
\ No newline at end of file
+# Don't build any modules yet.
+#KERNCONF_MAKEOPTIONS+=	MODULES_OVERRIDE="wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt random if_bridge bridgestp msdosfs md ipfw dummynet libalias geom/geom_label geom/geom_uncompress ufs usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib"
+
+# Debug definitions
+KERNCONF_OPTIONS+=		DDB
+KERNCONF_OPTIONS+=		KDB
+
+# Board definitions
+KERNCONF_OPTIONS+=	INET
+KERNCONF_OPTIONS+= 	TMPFS
+KERNCONF_OPTIONS+= 	CD9660
+KERNCONF_OPTIONS+= 	GEOM_LABEL
+KERNCONF_OPTIONS+= 	SCHED_ULE
+KERNCONF_OPTIONS+= 	NFSCLIENT
+KERNCONF_OPTIONS+= 	NFS_ROOT
+KERNCONF_OPTIONS+= 	PSEUDOFS
+KERNCONF_OPTIONS+=	IPFIREWALL_DEFAULT_TO_ACCEPT
+KERNCONF_OPTIONS+= 	ZERO_COPY_SOCKETS
+KERNCONF_OPTIONS+=	_KPOSIX_PRIORITY_SCHEDULING
+KERNCONF_OPTIONS+=		ROOTDEVNAME=\\\"cd9660:/dev/map/rootfs.uncompress\\\"
+
+KERNCONF_NODEVICES+=	uart_ns8250
+KERNCONF_DEVICES+=	random
+KERNCONF_DEVICES+=	loop
+KERNCONF_DEVICES+=	pty
+KERNCONF_DEVICES+=	ether
+KERNCONF_DEVICES+=	bpf
+KERNCONF_DEVICES+=	vlan
+KERNCONF_DEVICES+=	uart
+KERNCONF_DEVICES+=	tun
+
+KERNCONF_DEVICES+=	wlan
+
+
+KERNCONF_DEVICES+=	gpio
+KERNCONF_DEVICES+=	gpioled
+
+KERNCONF_DEVICES+=	cfi
+KERNCONF_DEVICES+=	cfid
+
+KERNCONF_DEVICES+=	nvram2env
+KERNCONF_DEVICES+=	geom_map
+KERNCONF_DEVICES+=	geom_uncompress
+
+
+KERNCONF_OPTIONS+=	SCSI_DELAY=1000
+
+.if defined(WITH_IPSEC)
+KERNCONF_OPTIONS+=         IPSEC
+KERNCONF_OPTIONS+=         IPSEC_NAT_T
+
+KERNCONF_DEVICES+=		random
+KERNCONF_DEVICES+=		enc
+#KERNCONF_DEVICES+=		gif
+KERNCONF_DEVICES+=		ipsec
+KERNCONF_DEVICES+=		crypto
+#KERNCONF_DEVICES+=		cryptodev	# /dev/crypto for access to h/w
+
+##KERNCONF_DEVICES+=		rndtest		# FIPS 140-2 entropy tester
+.endif
+
+
+.if defined(WITH_USB)
+#KERNCONF_OPTIONS+=		USB_EHCI_BIG_ENDIAN_DESC # XXX
+#KERNCONF_OPTIONS+=		USB_DEBUG
+#KERNCONF_OPTIONS+=		USB_VERBOSE
+KERNCONF_DEVICES+=	usb			# USB Bus (required)
+KERNCONF_DEVICES+=	dotg			# DWC like USB OTG Controller driver
+.endif
+