Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 2013 15:04:13 -0700
From:      hiren panchasara <hiren.panchasara@gmail.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        freebsd-embedded <freebsd-embedded@freebsd.org>, ray@freebsd.org
Subject:   Re: Making Picostation m2HP work
Message-ID:  <CALCpEUFbk-0eE_HQRhF48YA7KgiyW=AB9G8F0UC3Uwti977m4A@mail.gmail.com>
In-Reply-To: <CALCpEUHu0FONekw%2BF4bvef-qLjmtwMso31GJpJd5BP_6JsH0fQ@mail.gmail.com>
References:  <CALCpEUHxqyZb1Y5WqsuxjvwY2Pd_xN2%2BoTgsew0DwdRMC6=5Nw@mail.gmail.com> <CALCpEUGbk8mCFqOUp6WxfdcH-kveudG-f4S0muUg4aYy0uqBtA@mail.gmail.com> <CAJ-VmomsSBSs9QumGc6z=aYQ0OUqjGcxBnnsy%2B1NR_F83KUzxg@mail.gmail.com> <CALCpEUG4FR2qugb-ZYHG%2BJ7xcOL34edkPx41yOwU7qK-BynGOw@mail.gmail.com> <CAJ-VmokPNDgkdziRFr3-MnDZudskGb0ykRk9jfY1nWhrxBZEKw@mail.gmail.com> <CAB=2f8yPSSpOZBwOv8Xr5=OtM%2BMq0-h-%2B9-tKTgjR7LvCfX6jQ@mail.gmail.com> <CALCpEUFi6qr8Cox9PpzmkPk69gb0hrhM1vepE81gqot2cVy7tQ@mail.gmail.com> <CAJ-VmonxVF6GQXEZod9XajAK00i9ZP6=s3SSCDEL%2BJR6kgLVWQ@mail.gmail.com> <CALCpEUHEPRDAiCZ2-hFwD1sPPQHqmNVA=E8sJREm5qmB%2BxF5cA@mail.gmail.com> <CAJ-VmokDUhJxN7oWOr0t7T1Zq-Odf43mM9qO%2B5TDyv1DnKAJuQ@mail.gmail.com> <CALCpEUGC1NrWfNZ5%2BfAnbaCvFVpKNCOMZ9Yh6XFYFBqCWehE0Q@mail.gmail.com> <20130729151943.70ce473e14d88588337e57ba@ddteam.net> <CALCpEUEXGrazTbMUUA5jkarr8vH_a9TU-QUy9=w7TFU8ND8B_Q@mail.gmail.com> <CALCpEUGMAHwFEYKPJGyOMx9fNxnqJ=6s2VABGSyCOb-XZz_Fdg@mail.gmail.com> <51F7983C.5090309@dat.pl> <CAKYr3zw-b3f4URh3K5ysStein_P%2BSuKmg8QHmw_UWjnx%2BBNwyA@mail.gmail.com> <CAKYr3zze4LHu3y8go-Q57yZWzFDuUVTow3JBNcOPw5y5bm0RGw@mail.gmail.com> <CALCpEUF8TJUG=5QBQ214P6LKCVCPmmaLR62jCbhDvqqG55Ybdw@mail.gmail.com> <CAJ-Vmo=Tv6v21p%2BetOGpsY4eJZBypGB_18e8r6FQnCdAaj0RKg@mail.gmail.com> <CAKYr3zwY5ezYCQZ5iF-LCG%2Bii_fLoUn9T7xK%2Bfa4WkOfdMsbAA@mail.gmail.com> <CALCpEUGRZ9PW1SkNLEsNqaB83zNx=oA-j4WH7TYu%2Bywi-5s5%2BQ@mail.gmail.com> <CAB=2f8wnCNTrY62wD9OBT-b6ZhwiNvyoR418Kc0uf9M5xDb-LQ@mail.gmail.com> <CALCpEUF7RQ0Ev-CwEukP38Su0mji8woe2QCAQV3PXBDw=d%2BiqA@mail.gmail.com> <CALCpEUHyqyq2WShNfu1ARFGHH6s6yPeojkq3M5Dfg0veaSy7KQ@mail.gmail.com> <CAJ-Vmokh4uSy2RkNoyGnYbm9k0B3YBD96B7Kvn5b8zJgU0KVkg@mail.gmail.com> <CALCpEUFXrdST43Nz2m-y__htXjLdmds8B5_JV2P9oFtGCEAr1g@mail.gmail.com> <CALCpEUHu0FONekw%2BF4bvef-qLjmtwMso31GJpJd5BP_6JsH0fQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <adrian@freebsd.org>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<PerfCount,WatchRegs,MIPS16,EJTAG>
  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: <MIPS32 root nexus>
nexus0: failed to add child: arge0
clock0: <Generic MIPS32 ticker> on nexus0
Timecounter "MIPS32" frequency 195000000 Hz quality 800
Event timer "MIPS32" frequency 195000000 Hz quality 800
argemdio0: <Atheros AR71xx built-in ethernet interface, MDIO controller> at
mem 0x19000000-0x19000fff on nexus0
mdio0: <MDIO> on argemdio0
mdioproxy0: <MII/MDIO proxy, MDIO side> on mdio0
arswitch0: <Atheros AR7240 Ethernet Switch> 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: <PCI bus> on pcib0
pci0: <network> at device 0.0 (no driver attached)
arge0: <Atheros AR71xx built-in ethernet interface> at mem
0x19000000-0x19000fff irq 2 on nexus0
miiproxy0: <MII/MDIO proxy, MII side> 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: <Atheros AR71xx built-in ethernet interface> 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: <AR71XX SPI> at mem 0x1f000000-0x1f00000f on nexus0
spibus0: <spibus bus> on spi0
mx25l0: <M25Pxx Flash Family> at cs 0 on spibus0
mx25l0: w25q64, sector 65536 bytes, 128 sectors
ar71xx_wdog0: <Atheros AR71XX watchdog timer> 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:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      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)
  <empty line>    Abort manual input

mountroot>


Now,  will look into why "Mounting from ufs:/dev/map/rootfs.uncompress
failed with error 19."

cheers,
Hiren



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALCpEUFbk-0eE_HQRhF48YA7KgiyW=AB9G8F0UC3Uwti977m4A>