From owner-freebsd-mips@freebsd.org Mon May 8 22:48:42 2017 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49028D63801 for ; Mon, 8 May 2017 22:48:42 +0000 (UTC) (envelope-from mike@wolman.co.uk) Received: from avasout07.plus.net (avasout07.plus.net [84.93.230.235]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0DCC0B for ; Mon, 8 May 2017 22:48:40 +0000 (UTC) (envelope-from mike@wolman.co.uk) Received: from [192.168.3.50] ([80.229.66.11]) by avasout07 with smtp id Hyod1v0040EahWw01yoeTh; Mon, 08 May 2017 23:48:38 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.2 cv=HP2zLslv c=1 sm=1 tr=0 a=sNOkzuqjfbpz3c/qSHODpA==:117 a=sNOkzuqjfbpz3c/qSHODpA==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=jdP34snFAAAA:8 a=UmSUZ3ptAAAA:8 a=LJ5NkaWEAAAA:8 a=bt8Zh30PAAAA:8 a=6I5d2MoRAAAA:8 a=4I05h4SrAAAA:8 a=wTo6f-YwqaNFsHBk16YA:9 a=fcP3pWA5dMFIvHfX:21 a=6LHz0lEwGjbsYHm2:21 a=QEXdDO2ut3YA:10 a=A3VBoO50a3AA:10 a=pGLkceISAAAA:8 a=IIX2BFdiAAAA:8 a=NzaaHTVrWpQkoAVHW9AA:9 a=Cn0qkoJbwpY_EikI:21 a=0kFzuWWxYPwBwSAv:21 a=l5uy2G6aoEpcAj2U:21 a=_W_S_7VecoQA:10 a=jlphF6vWLdwq7oh3TaWq:22 a=FyGKTEvU35uc88vWBdgE:22 a=eH83O4KjmLCfbRe1EArK:22 a=IjZwj45LgO3ly-622nXo:22 a=SXYKVUms7l59yVxtnTo9:22 a=6kGIvZw6iX1k4Y-7sg4_:22 a=rHg00LAlvzXsuODty-Nv:22 Subject: Re: onion omega2+ To: freebsd-mips@freebsd.org References: <694efc3a-e183-35a1-a0bf-9a9c0d708826@wolman.co.uk> From: Mike Wolman Message-ID: Date: Mon, 8 May 2017 23:48:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 22:48:42 -0000 More info in case anyone can point me in the right direction. I have found: https://forum.openwrt.org/viewtopic.php?id=53865 I have tried changing how lzma compresses the kernel by adding -d20 to the build scripts eg: /usr/local/bin/lzma e /home/mike/omega2/src/../root/mipsel_ap/boot/kernel.MT7628_FDT/kernel \ /home/mike/omega2/src/../tftpboot/kernel.MT7628_FDT.lzma -d20 This did not work. Looking at the onion omega conf I see that it uses mkuzip and not lzma with the following settings: X_FSIMAGE_CMD="mkuzip" X_FSIMAGE_ARGS="-L -d -s 65536 -v" X_FSIMAGE_SUFFIX=".ulzma" So tried the following: mkuzip -L -d -s 65536 -v -o kernel.MT7628_FDT.ulzma kernel.MT7628_FDT mkimage -A mips -O linux -T kernel -C lzma \ -a 0x80001000 -e 0x80001100 \ -n "FreeBSD" -d kernel.MT7628_FDT.lzma kernel.MT7628_FDT.ulzma.uImage But this did not work either. On 08/05/2017 19:41, Aleksandr Rybalko wrote: > Hi Mike! > > I see you have no "OK" after "Uncompressing Kernel Image ...", so > first point uboot decompressor fail. > Why fail? Because you have wrong base address in image: > Load Address: fffffff2 > Entry Point: fffffff2 > MIPS32 machines have RAM mapped to 0x80000000 address, so adding its > size, you will get max address (if 16MB, it will be 0x81000000), but > you uboot image was created with 0xfffffff2. > > Even more, unpacked kernel expects it will be called at 0x80001100. so > if you have ELF kernel (file with ELF header, like every executable) > that file have to be loaded at (0x80001100 - ELF_HEADER_SIZE). > In most cases it will be 0x80001100 - 0x100 = 0x80001000. But sometime > (I did not found why) it can be 0x20, you can find it by looking at > .text section in readelf -S. > > So if you have kernel with entry point 0x80001100 and .text segment > offset 0x100, you have to create uboot image with load address > 0x80001000 and entry point 0x80001100. > > If that step successful you will get: > /Uncompressing Kernel Image/ ... OK > Starting kernel ... > > Last line mean, uboot did jump into kernel code. > > Good luck. > > 2017-05-07 18:20 GMT+03:00 Mike Wolman >: > > Hi, > > I am trying to get FreeBSD working on this board - I think I am > almost there in getting it working but need some help please. > > I have followed instructions from the freebsd-wifi-build and > *think* I have got everything correct - I am trying to do this on > a CURRENT setup: > > FreeBSD f64-current.mw.office 12.0-CURRENT FreeBSD 12.0-CURRENT #0 > r317887: Sun May 7 03:20:34 UTC 2017 > mike@f64-current.mw.office:/usr/obj/usr/src/sys/GENERIC-NODEBUG amd64 > > > $ cat ~/.freebsd-wifi-build-settings.cfg > X_SKIP_MORE_STUFF=YES > X_EXTRA_SRC_CONF=~/omega2/src.conf > > $ cat ~/omega2/src.conf > WITHOUT_CLANG=YES > WITHOUT_CLANG_FULL=YES > > get dts files from thread > http://community.onion.io/topic/1099/openwrt-on-the-omega-2/8 > > > > cd ~/omega2/src/sys/gnu/dts/mips > fetch > https://raw.githubusercontent.com/WereCatf/source/image/target/linux/ramips/dts/OMEGA2.dtsi > > fetch > https://raw.githubusercontent.com/WereCatf/source/image/target/linux/ramips/dts/OMEGA2.dts > > fetch > https://raw.githubusercontent.com/WereCatf/source/image/target/linux/ramips/dts/OMEGA2P.dts > > > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink buildworld > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink buildkernel > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink installworld > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink installkernel > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink distribution > > > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink mfsroot > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink fsimage > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > ../freebsd-wifi-build/build/bin/build ralink uboot > > > Create flash: > > X_FLASH=kernel.MT7628_FDT.lzma.flash > dd if=/dev/zero bs=$(( 0x200000 )) count=1 of=${X_FLASH} > dd if=kernel.MT7628_FDT.lzma.uImage of=${X_FLASH} conv=notrunc > dd if= mfsroot-ralink.img.lzma >> ${X_FLASH} > > > $ readelf -h kernel.MT7628_FDT | grep Entry > Entry point address: 0x80001100 > > > > > Now on the omega over serial - I didnt get the network expansion > doc thing so am doing stuff with usb rather than tftp > > I am not 100% sure about the 0x80001100 and the fatload and have > tried this > > Omega2 # fatload usb 0:1 0x80001100 /kernel.MT7628_FDT.lzma.flash > * > * > Reading file "/kernel.MT7628_FDT.lzma.flash" > * > ** > ** > ** > ****** > ********************************************************************************************************************************************* > ****** > * > FAT: 2108463 Bytes read > Omega2 # bootm 0x80001100 > ## Booting image at 80001100 ... > Image Name: FreeBSD > Image Type: MIPS Linux Kernel Image (lzma compressed) > Data Size: 1365122 Bytes = 1.3 MB > Load Address: fffffff2 > Entry Point: fffffff2 > Verifying Checksum ... OK > Uncompressing Kernel Image ... > > > At this point nothing happens and console hangs - note in > OMEGA2.dtsithe console is set to ttyS0: > > bootargs = "console=ttyS0,115200"; > > > > > I have also tried with just kernel.MT7628_FDT and > kernel.MT7628_FDT.lzma but both fail: > > Omega2 # fatload usb 0:1 0x80001100 /kernel.MT7628_FDT.lzma.uImage > * > * > Reading file "/kernel.MT7628_FDT.lzma.uImage" > * > ** > ** > ****** > ****************************************************************************************************************************** > ********** > * > FAT: 1365186 Bytes read > Omega2 # bootm 0x80001100 > ## Booting image at 80001100 ... > Image Name: FreeBSD > Image Type: MIPS Linux Kernel Image (lzma compressed) > Data Size: 1365122 Bytes = 1.3 MB > Load Address: fffffff2 > Entry Point: fffffff2 > Verifying Checksum ... OK > Uncompressing Kernel Image ... > > > A few comments on the hardware for anyone who wants to get one: > > Get the expansion dock with serial port access - the power dock > does not provide serial access - i think it is possible to use an > ftdi ttl serial chip/cable but have not tried. > > Stupidly I forgot this only has wifi access so you are not able to > tftp boot this without getting the ethernet network expansion but > loading stuff up from a usb memory stick is seem fine from u-boot. > > I do not think that it is possible to boot from the SD card on the > Omega2+ - which is a shame. > > Thanks for reading, > > Mike. > > > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > > To unsubscribe, send any mail to > "freebsd-mips-unsubscribe@freebsd.org > " > > > > > -- > WBW > ------- > Rybalko Aleksandr > >