From owner-svn-src-head@FreeBSD.ORG Thu Nov 24 04:39:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C010F106566B; Thu, 24 Nov 2011 04:39:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B00AE8FC0A; Thu, 24 Nov 2011 04:39:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO4d1tN077833; Thu, 24 Nov 2011 04:39:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO4d1w0077830; Thu, 24 Nov 2011 04:39:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240439.pAO4d1w0077830@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 04:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227921 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 04:39:01 -0000 Author: adrian Date: Thu Nov 24 04:39:01 2011 New Revision: 227921 URL: http://svn.freebsd.org/changeset/base/227921 Log: Flesh out a geom_map setup, so the kernel can be squeezed _onto_ the device. The default flash layout gives only 1 megabyte for the kernel, gzipped. The uboot firmware running on this device only supports gzip, not lzma, so we actually _do_ have to try and slim the kernel down a bit. But, since I can't actually do that at the present, I'm opting to: * extend the kernel from 1mb to 2mb; * have rootfs fill the rest of that, save 64k; * eventually I'll hide a 64k config partition at the end, between the end of rootfs and the ART (radio configuration data.) The uboot firmware doesn't care about the partition layout. It just expects the kernel application image to sit at 0xbf020000 (right after the 128k uboot image.) The uboot header isn't actually read either - it's "faked" from a "tplink" flash image header. So as long as the map configuration here matches what is being written out via the tplink firmware generator, everything is a-ok. Modified: head/sys/mips/conf/TP-WN1043ND head/sys/mips/conf/TP-WN1043ND.hints Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Thu Nov 24 04:34:04 2011 (r227920) +++ head/sys/mips/conf/TP-WN1043ND Thu Nov 24 04:39:01 2011 (r227921) @@ -20,11 +20,12 @@ options MSDOSFS options GEOM_PART_BSD options GEOM_PART_MBR -# Just make sure the thing boots off of the first attached SCSI device for now! -#options ROOTDEVNAME=\"ufs:da0a\" -# Or an MDROOT for testing. -options MD_ROOT -options MD_ROOT_SIZE=5120 +# uzip - to boot natively from flash device geom_uzip options GEOM_UZIP -options ROOTDEVNAME=\"ufs:/dev/md0.uzip\" + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/TP-WN1043ND.hints ============================================================================== --- head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 04:34:04 2011 (r227920) +++ head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 04:39:01 2011 (r227921) @@ -17,3 +17,57 @@ hint.arge.1.phymask=0x0 # Where the ART is hint.ath.0.eepromaddr=0x1fff1000 + +# +# Define a slightly custom flash layout. + +# The default flash layout: +# +# 128k: uboot +# 1024k: kernel +# 4096k: rootfs +# 2880k: unknown +# 64k: ART +# +# from printenv: +# bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init +# mtdparts=ar9100-nor0:128k(u-boot),1024k(kernel),4096k(rootfs),64k(art) + +# This isn't a lot of space! +# So: +# 128k: uboot +# 2048k: kernel +# 5888k: rootfs +# (todo: 64k: config) +# 64k: ART + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x000200000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00020000 +hint.map.1.end=0x00220000 +hint.map.1.name="kernel" +hint.map.1.readonly=1 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00220000 +#hint.map.2.end=0x007e0000 +hint.map.2.end=0x007f0000 +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +#hint.map.3.at="flash/spi0" +#hint.map.3.start=0x007e0000 +#hint.map.3.end=0x007f0000 +#hint.map.3.name="cfg" +#hint.map.3.readonly=1 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007f0000 +hint.map.4.end=0x00800000 +hint.map.4.name="art" +hint.map.4.readonly=1