From owner-freebsd-mips@freebsd.org Mon May 8 18:41:32 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 C9191D63F91 for ; Mon, 8 May 2017 18:41:32 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82F341EF2 for ; Mon, 8 May 2017 18:41:32 +0000 (UTC) (envelope-from ray@ddteam.net) Received: by mail-yw0-x22c.google.com with SMTP id l135so33792369ywb.2 for ; Mon, 08 May 2017 11:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddteam-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xWba4dgGt5OduIYEjdqgYhpk3LHmMUlio11K7qPD5Tc=; b=mlufBBqTK3seoGRjijY4Wac8normm4kjB1TYNn3VS8WS0JsCn1qwLiMYm0Aqptkz1E wSCxRcFe7h2LowoZMmaNUryT73tbmFuiQBepbGZCs4y6gLCx5wtf63HsJMWKwyj+8hSx 5m036GvIimRSPbM+9irW54bOQAlqeM4yoPaitdWEcHcsvQpjh4oCxiHCoG/mog7Cy1Ep 9yyJBoBwbBdyNfq9n37U/K9j0OStxHUVklBU99RwtemGFuWgcSf8D8AIaaJN6ett6lzN Z5h+Ye/ACorioGhQq5O+1h1NohCHlDz6LrqatJ13Vwq3qlfBsbrmzZxJdGkum5VxiNpD QuIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xWba4dgGt5OduIYEjdqgYhpk3LHmMUlio11K7qPD5Tc=; b=Dm9iYBcTb4wuG6/pWBJUUrqBDUiNCrxYDlCPdpgaE3OWZc2LW1DWAIi6Euo/Yi6ca8 dZ7EdZu1R2oF58WliNVhcO5rPsQ6NBsLYsOKfVdq+sd65IRIrnmwoJEDK/MWper3iSE8 qG/Hs7j2pQ893hquIO/YaS0UybPUx5DDp0WEveoO4k6h+FRgKw5TI/cGDOSZ7itCawXp UyomUzuo3M1QMy17y74mvUj1H4sOIF+yFWjBYr/73RnUGjk0o+vJOTjUQWW7GdcpMPsj UX0UtZL/W8D6/T0T3eKCZ9Fg4gYJWP4ZxrfHHkA5TXDtyohP9cO+gElrZny4Aze0ZGD3 vnDA== X-Gm-Message-State: AN3rC/4hkmFXnrXLSGvWJYFgnVzChnd1ZKMyT3I/Ok1DJZ47BD/9sAjn FBMtutwCHgBr96WX0oyMGdU59L8z530I X-Received: by 10.13.248.195 with SMTP id i186mr27503441ywf.97.1494268891035; Mon, 08 May 2017 11:41:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.161.194 with HTTP; Mon, 8 May 2017 11:41:30 -0700 (PDT) In-Reply-To: <694efc3a-e183-35a1-a0bf-9a9c0d708826@wolman.co.uk> References: <694efc3a-e183-35a1-a0bf-9a9c0d708826@wolman.co.uk> From: Aleksandr Rybalko Date: Mon, 8 May 2017 21:41:30 +0300 Message-ID: Subject: Re: onion omega2+ To: Mike Wolman Cc: freebsd-mips@freebsd.org Content-Type: text/plain; charset=UTF-8 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 18:41:32 -0000 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:/us > r/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/topi > c/1099/openwrt-on-the-omega-2/8 > > > cd ~/omega2/src/sys/gnu/dts/mips > fetch https://raw.githubusercontent.com/WereCatf/source/image/targ > et/linux/ramips/dts/OMEGA2.dtsi > fetch https://raw.githubusercontent.com/WereCatf/source/image/targ > et/linux/ramips/dts/OMEGA2.dts > fetch https://raw.githubusercontent.com/WereCatf/source/image/targ > et/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