From owner-freebsd-embedded@FreeBSD.ORG Mon Aug 26 22:04:17 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BCDCD8C7; Mon, 26 Aug 2013 22:04:17 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-x22e.google.com (mail-ee0-x22e.google.com [IPv6:2a00:1450:4013:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B91982433; Mon, 26 Aug 2013 22:04:16 +0000 (UTC) Received: by mail-ee0-f46.google.com with SMTP id c13so1883440eek.33 for ; Mon, 26 Aug 2013 15:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=o30F8o0K5YHhYacP0Xd0UmFZzppFivC2FFDYHBVAWpk=; b=HLXtuM8BI/CNKtoI3uf4gzwghx8h9LgqKGe1zGPq60xZWbejJULCKO706njjrYx7L4 zHzWBAqNUM1E2j/2pjsLKPVK2FKqXk7Yb/pBZgJ7lteb6dp9yK3riHoRksrU0xFShRzc mD/w8BIl90043GwFn7HJKsZuonXVfgPe/DbSP9HQgE98Tz+9rIJKBeiGszThkeGH8A67 7UCKlR/BxJSM4U+v/yGv+q0R1mPeV3o5cBLSaURipVwtIEV/ALNIIV7cThkoo3zFFzEN pXIjLcgbUS+itHr6m6K8CSP979XEWs7r8wsYWS8Hk9uWI5G7uBe9zI5ZHRqJnrfcj8Tx H9gQ== MIME-Version: 1.0 X-Received: by 10.14.4.1 with SMTP id 1mr29229110eei.21.1377554653807; Mon, 26 Aug 2013 15:04:13 -0700 (PDT) Received: by 10.14.105.137 with HTTP; Mon, 26 Aug 2013 15:04:13 -0700 (PDT) In-Reply-To: References: <20130729151943.70ce473e14d88588337e57ba@ddteam.net> <51F7983C.5090309@dat.pl> Date: Mon, 26 Aug 2013 15:04:13 -0700 Message-ID: Subject: Re: Making Picostation m2HP work From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-embedded , ray@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2013 22:04:17 -0000 On Mon, Aug 26, 2013 at 2:24 PM, hiren panchasara < hiren.panchasara@gmail.com> wrote: > > > > On Thu, Aug 22, 2013 at 12:20 AM, hiren panchasara < > hiren.panchasara@gmail.com> wrote: > >> >> >> >> On Wed, Aug 21, 2013 at 10:02 PM, Adrian Chadd wrote: >> >>> Right! Nice work! >>> >>> So that tells me that whatever image you've stuffed into the ubiquiti >>> firmware isn't setup right. Did you lzma compress the kernel, then wrap >>> that in mkimage or whatever the u-boot command is, and then pass _that_ >>> output to the ubiquiti firmware builder? >>> >> >> Alright, so as Adrian suggested, I tried to create uboot'ed kernel by >> running: >> >> "# ../build/build/bin/build ap91 uboot" >> >> which basically runs build_uboot which does following: >> >> /usr/local/bin/lzma e ${X_KERNEL} /tftpboot/kernel.${KERNCONF}.lzma || >> exit 1 >> >> # Create the firmware >> mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C lzma \ >> -a ${UBOOT_KERN_LOADADDR} -e ${UBOOT_KERN_STARTADDR} \ >> -n "FreeBSD" -d /tftpboot/kernel.${KERNCONF}.lzma \ >> /tftpboot/kernel.${KERNCONF}.lzma.uImage \ >> || exit 1 >> >> Now, I had to install /usr/ports/devel/uboot-mkimage/ port to get >> "mkimage" binary referenced above. >> >> But as soon as I run "# ../build/build/bin/build ap91 uboot", the laptop >> deadlocks. I have to hard reboot the laptop. I tried it 2 times and it >> stops right when its trying to execute mkimage command listed above. >> >> I am not sure what is the reason behind that. And I see ray@ is the >> maintainer of that port so I am cc'ing him to get some insights too. >> > > That was some issue on my laptop. Trying on another laptop worked. > > I generated final image with kernel.AP91.lzma.uImage inside it instead of > plain kernel.gz > > This is what I am getting now (instead of "bad magic number"): > > > > U-Boot 1.1.4.2-s594 (Dec 5 2012 - 15:23:07) > > Board: Ubiquiti Networks XM board (rev 1.0 e302) > DRAM: 32 MB > Flash: 8 MB > PCIe WLAN Module found (#1). > Net: eth0, eth1 > Hit any key to stop autoboot: 0 > ## Booting image at 9f050000 ... > Image Name: FreeBSD > Created: 2013-08-24 15:28:06 UTC > > Image Type: MIPS Linux Kernel Image (lzma compressed) > Data Size: 131085 Bytes = 128 kB > Load Address: 80050000 > Entry Point: 80050100 > Verifying Checksum ... OK > Uncompressing Kernel Image ... ERROR, LzmaDecode.c, 332 > > Decoding error = 1 > LZMA ERROR 1 - must RESET board to recover > > Resetting... > > Trying to figure out what this means. > Wohoooo... ray@ is the man!!! He has some hacked up version of lzma at http://zrouter.org/hg/zrouter/ and using that lzma for compression, I finally was able to boot: > U-Boot 1.1.4.2-s594 (Dec 5 2012 - 15:23:07) Board: Ubiquiti Networks XM board (rev 1.0 e302) DRAM: 32 MB Flash: 8 MB PCIe WLAN Module found (#1). Net: eth0, eth1 Hit any key to stop autoboot: 0 ar7240> rescu Unknown command 'rescu' - try 'help' ar7240> uresc Setting default IP 192.168.1.20 Starting TFTP server... Using eth0 (192.168.1.20), address: 0x81000000 Waiting for connection: \ Receiving file from 192.168.1.254:57971 Received 5917237 bytes Firmware Version: XS2.ar7240.FreeBSD Setting U-Boot environment variables Un-Protected 1 sectors Erasing Flash.... done Erased 1 sectors Writing to Flash... done Protected 1 sectors Copying partition 'kernel' to flash memory: erasing range 0x9F050000..0x9F12FFFF: .............. done Erased 14 sectors writing to address 0x9f050000, length 0x000e0000 ... Copying partition 'rootfs' to flash memory: erasing range 0x9F130000..0x9F5FFFFF: ............................................................................. done Erased 77 sectors writing to address 0x9f130000, length 0x004d0000 ... Firmware update complete. Resetting... U-Boot 1.1.4.2-s594 (Dec 5 2012 - 15:23:07) Board: Ubiquiti Networks XM board (rev 1.0 e302) DRAM: 32 MB Flash: 8 MB PCIe WLAN Module found (#1). Net: eth0, eth1 Hit any key to stop autoboot: 0 ## Booting image at 9f050000 ... Image Name: FreeBSD Created: 2013-08-26 14:51:52 UTC Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 893021 Bytes = 872.1 kB Load Address: 80050000 Entry Point: 80050100 Verifying Checksum ... OK Uncompressing Kernel Image ... OK Starting kernel ... CPU platform: Atheros AR7241 rev 1 CPU Frequency=390 MHz CPU DDR Frequency=390 MHz CPU AHB Frequency=195 MHz platform frequency: 390000000 CPU reference clock: 5 MHz arguments: a0 = 00000006 a1 = a1f4bfb0 a2 = a1f4c450 a3 = 00000000 Cmd line:argv is invalid Environment: envp is invalid Cache info: picache_stride = 4096 picache_loopcount = 16 pdcache_stride = 4096 pdcache_loopcount = 8 cpu0: MIPS Technologies processor v116.147 MMU: Standard TLB, 16 entries L1 i-cache: 4 ways of 512 sets, 32 bytes per line L1 d-cache: 4 ways of 256 sets, 32 bytes per line Config1=0x9ee3519e Config3=0x20 KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2013 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.0-CURRENT #0 r254676: Thu Aug 22 18:05:52 UTC 2013 hirenp@catchbone-l7.corp.yahoo.com:/usr/home/hirenp/work/freebsd/head/obj/mipseb/mips.mips/usr/home/hirenp/work/freebsd/head/src/sys/AP91 mips gcc version 4.2.1 20070831 patched [FreeBSD] real memory = 16777216 (16384K bytes) avail memory = 12087296 (11MB) random device not loaded; using insecure entropy nexus0: nexus0: failed to add child: arge0 clock0: on nexus0 Timecounter "MIPS32" frequency 195000000 Hz quality 800 Event timer "MIPS32" frequency 195000000 Hz quality 800 argemdio0: at mem 0x19000000-0x19000fff on nexus0 mdio0: on argemdio0 mdioproxy0: on mdio0 arswitch0: on mdio0 arswitch0: attaching PHY 0 failed arswitch0: attaching PHY 1 failed arswitch0: attaching PHY 2 failed arswitch0: attaching PHY 3 failed device_attach: arswitch0 attach returned 6 apb0 at irq 4 on nexus0 uart0: <16550 or compatible> on apb0 uart0: console (115200,n,8,1) pcib0 at irq 0 on nexus0 pcib0: found EEPROM at 0x1fff1000 on 0.0.0 pcib0: EEPROM firmware: 0x1fff1000 @ 4096 bytes pcib0: device EEPROM 'pcib.0.bus.0.0.0.eeprom_firmware' registered pci0: on pcib0 pci0: at device 0.0 (no driver attached) arge0: at mem 0x19000000-0x19000fff irq 2 on nexus0 miiproxy0: on arge0 arge0: can't attach proxy arge0: finishing attachment, phymask 0010, proxy null arge0: unable to attach PHY 4: 6 device_attach: arge0 attach returned 6 arge1: at mem 0x1a000000-0x1a000fff irq 3 on nexus0 arge1: finishing attachment, phymask 0000, proxy null arge1: Ethernet address: 62:73:64:dd:03:41 spi0: at mem 0x1f000000-0x1f00000f on nexus0 spibus0: on spi0 mx25l0: at cs 0 on spibus0 mx25l0: w25q64, sector 65536 bytes, 128 sectors ar71xx_wdog0: on nexus0 ar71xx_wdog0: Previous reset was due to watchdog timeout Timecounters tick every 1.000 msec Trying to mount root from ufs:/dev/map/rootfs.uncompress []... mountroot: waiting for device /dev/map/rootfs.uncompress ... Mounting from ufs:/dev/map/rootfs.uncompress failed with error 19. Loader variables: Manual root filesystem specification: : [options] Mount using filesystem and with the specified (optional) option list. eg. ufs:/dev/da0s1a zfs:tank cd9660:/dev/acd0 ro (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /) ? List valid disk boot devices . Yield 1 second (for background tasks) Abort manual input mountroot> Now, will look into why "Mounting from ufs:/dev/map/rootfs.uncompress failed with error 19." cheers, Hiren