From owner-freebsd-embedded@FreeBSD.ORG Thu Aug 22 07:20:56 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E6D679BB; Thu, 22 Aug 2013 07:20:55 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x236.google.com (mail-ea0-x236.google.com [IPv6:2a00:1450:4013:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 162362498; Thu, 22 Aug 2013 07:20:54 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id o10so725237eaj.27 for ; Thu, 22 Aug 2013 00:20:53 -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=6cY7zwUt/t+8P9W09wD56mJ5GT5oKEyYuFqL0z6DK+Q=; b=NUO3Dm6sGVxyTmfrJuMW6YwV+eNdm+2S7mvo9Jjf2iT0qQWnVKjHDwQGrsReD0WECn s/bGikczipdZPjFJRjc6kbdARITqLx7xuamlYjZImyR5wBBwZDkamS6YU8pWjLEJkDks WuTWI11yl/z2FtFADcxepQEhDSyJF10U98Z4nYo7r9CAnDTYfRHY6DDCkwbnnMCpfsVe mt0HtpvULduPVdqbQnMpGybpiepdwRBB5zh1N1RXOzLvI13jCUOG9B9B4c+LrTPqKkTk s9XFhejUJcBUdqn4aOPn47QUdP/225f9t4SX1nwsg5sdSrMP3nRoGu0HZqtnyL+h+3ct 9ZKg== MIME-Version: 1.0 X-Received: by 10.15.75.73 with SMTP id k49mr16298241eey.36.1377156053137; Thu, 22 Aug 2013 00:20:53 -0700 (PDT) Received: by 10.14.105.137 with HTTP; Thu, 22 Aug 2013 00:20:52 -0700 (PDT) In-Reply-To: References: <20130729151943.70ce473e14d88588337e57ba@ddteam.net> <51F7983C.5090309@dat.pl> Date: Thu, 22 Aug 2013 00:20:52 -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: Thu, 22 Aug 2013 07:20:56 -0000 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. But weirdly enough, it still created the kernel file out of this run: kernel.AP91.lzma.uImage And I've provided that instead of regular kernel.gz in generating final image but loading that did not yield any different results. It still fails pretty much the same way. ar7240> urescue 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.5:58512 Received 5811199 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..0x9F5EFFFF: ............................................................................ done Erased 76 sectors writing to address 0x9f130000, length 0x004c0000 ... Firmware update complete. Resetting... U-Boot 1.1.4.2-s564 (Jul 19 2012 - 10:41:56) 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 ... Bad Magic Number ar7240> Thanks, Hiren