From owner-freebsd-mips@freebsd.org Tue May 9 09:13:02 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 7B7DBD653E1 for ; Tue, 9 May 2017 09:13:02 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-yb0-x22f.google.com (mail-yb0-x22f.google.com [IPv6:2607:f8b0:4002:c09::22f]) (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 4D0BFDE6 for ; Tue, 9 May 2017 09:13:01 +0000 (UTC) (envelope-from ray@ddteam.net) Received: by mail-yb0-x22f.google.com with SMTP id p143so17773041yba.2 for ; Tue, 09 May 2017 02:13:01 -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=0R7FvKiuAa51zPovI5lecsATcV8g8j92k+pnpyp1iYU=; b=dOeXQrwBtQBvpcnA0BaDnny0KduLN+p4g2ebdTOG3Q0DIStIMWkkGysYOx4GW3OCSD eM3WH0WMA9IbKUXpk5yCBdjx0IeioIty/C6I4OtBfWHdbxQ2ZZpnG58328HpVnXk8Wx2 aFMjOoUPLBttH47SvMU5Qifh1ENSTlr2ov2KZxuGuu/TdieSwVKHl7l6TPgz7fbJ3duu HDv7u4tDSx8jEy9vpl8g8VoW868haw0o+/1pCIgWi4R6QT5zyZwuw3EvHvNw2Pc4xzT/ 4/aZQg4B2r2+REyCuEttQRsqcHubV3Fofw/AZZtJFboJQXYlInXfTbYMK6RZwaDE5a7n BWWA== 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=0R7FvKiuAa51zPovI5lecsATcV8g8j92k+pnpyp1iYU=; b=UVz0Vlz6qbPmrYOJYRrxJodpoLJp8i3ut69Op3i2B31+OS4tZj4tQ49bjOrRU4AF5i UnGUDU9LDXeS2+bxb4TiNIF5Y1o+OcKsAmoCm9eJcoY/6tNz6zjKCCd82gZ/D88RA2Ba 72ZflNSstM3DKIDN5TinMQXuiQ1ueCkM2A08Qmz4DCSDAY5eZZro3mFVKfaMFbILpSeJ HbDF/O/jpqabCK/rbf4Ey6DJdjzUY/uxrVNgiJXDkKbCyeaZ9aBceTCyEI3tIP/iMPTJ 5VEJOgrDRJNSOnZ/ONkXyg4De+e+t/dcgSa/1qIh/fUsky56IaaOxxROo3vjEaul4fE1 eNMQ== X-Gm-Message-State: AODbwcDz7Qq3cF3yAgZ3Bty0qg+FOyzz4w0UcCfHDuPEdK/whoTjo5AT nAAu1jHebMCrCuOfvi2omJE/K8Kgng== X-Received: by 10.37.160.65 with SMTP id x59mr14064101ybh.115.1494321180179; Tue, 09 May 2017 02:13:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.161.194 with HTTP; Tue, 9 May 2017 02:12:59 -0700 (PDT) In-Reply-To: <651873.78746.qm@web101702.mail.ssk.yahoo.co.jp> References: <694efc3a-e183-35a1-a0bf-9a9c0d708826@wolman.co.uk> <410144.69078.qm@web101716.mail.ssk.yahoo.co.jp> <128807.28836.qm@web101715.mail.ssk.yahoo.co.jp> <2d555385-8258-fd75-e4a3-a1e59bf86314@wolman.co.uk> <651873.78746.qm@web101702.mail.ssk.yahoo.co.jp> From: Aleksandr Rybalko Date: Tue, 9 May 2017 12:12:59 +0300 Message-ID: Subject: Re: onion omega2+ To: Mori Hiroki Cc: Mike Wolman , "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: Tue, 09 May 2017 09:13:02 -0000 Fix things in order :) Currently you have problem with LZMA, serial port later. So, find version of lzma used to build linux firmware, MIPS routers world use about 5 incompatible versions. One of them, you can find here: http://project.zrouter.org/hg/zrouter/file/9ac53695a44d/tools/oldlzma 2017-05-09 7:03 GMT+03:00 Mori Hiroki : > Hi Mike > > Could you show u-boot printenv command result. > > Thanks > > > ----- Original Message ----- > > From: Mike Wolman > > To: Mori Hiroki ; "freebsd-mips@freebsd.org" < > freebsd-mips@freebsd.org> > > Cc: > > Date: 2017/5/9, Tue 10:30 > > Subject: Re: onion omega2+ > > > > Hi Mori, > > > > When I compiled the world/kernel etc I used: > > > > X_DTS_FILE=OMEGA2P.dts KERNCONF=MT7628_FDT > > ../freebsd-wifi-build/build/bin/build ralink buildkernel > > > > I checked the serial stuff was the same as the other configs in: > > https://github.com/freebsd/freebsd-wifi-build/ > > and they looked the same. > > > > The OMEGA2.dtsi file has: > > > > chosen { > > bootargs = "console=ttyS0,115200"; > > }; > > > > > > And mt7628an.dtsi has: serial0 = &uartlite; > > > > I dont think im getting as far as worrying about the serial console at > > the moment and need to get the kernel to uncompress first. > > > > Mike. > > > > > > On 09/05/2017 02:20, Mori Hiroki wrote: > >> Hi Mike > >> > >> In FreeBSD is use serial0 dts item to console. > >> > >> I think good to use this at start. > >> > >> freebsd/sys/gnu/dts/mips/MT7628.dts > >> > >> ----- Original Message ----- > >>> From: Mike Wolman > >>> To: Mori Hiroki ; > > "freebsd-mips@freebsd.org" > >>> Cc: > >>> Date: 2017/5/9, Tue 09:25 > >>> Subject: Re: onion omega2+ > >>> > >>> Hi Mori, > >>> > >>> I grabbed the dts files from: > >>> > >>> https://github.com/WereCatf/source/tree/image/target/linux/ramips/dts > >>> > > https://github.com/WereCatf/source/blob/image/target/ > linux/ramips/dts/OMEGA2P.dts > >>> > > https://github.com/WereCatf/source/blob/image/target/ > linux/ramips/dts/OMEGA2.dtsi > >>> > >>> If this is of any use from the default linux install on the flash: > >>> > >>> root@Omega-12BF:/proc# cat /proc/mtd > >>> dev: size erasesize name > >>> mtd0: 00030000 00010000 "u-boot" > >>> mtd1: 00010000 00010000 "u-boot-env" > >>> mtd2: 00010000 00010000 "factory" > >>> mtd3: 01fb0000 00010000 "firmware" > >>> mtd4: 00148842 00010000 "kernel" > >>> mtd5: 01e677be 00010000 "rootfs" > >>> mtd6: 01950000 00010000 "rootfs_data" > >>> > >>> > >>> btw after posting i spotted and error in what i did with: > >>> > >>> 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 > >>> > >>> I have redone this using the correct compressed kernel ie: > >>> > >>> mkimage -A mips -O linux -T kernel -C lzma \ > >>> -a 0x80001000 -e 0x80001100 \ > >>> -n "FreeBSD" -d kernel.MT7628_FDT.ulzma > >>> kernel.MT7628_FDT.ulzma.uImage > >>> > >>> > >>> But this didnt work. > >>> > >>> > >>> > >>> On 09/05/2017 01:17, Mori Hiroki wrote: > >>>> Hi. > >>>> > >>>> I think if U-Boot work memory make broken then > >>>> Uncompressing Kernel Image is NG. > >>>> > >>>> Some ARM U-Boot is use top address in work memory. > >>>> If this case your kernel start address to move to > >>>> after work memory. But I never see in MIPS. > >>>> > >>>> And What is set FDT_DTS_FILE in your kernel configuration ? > >>>> > >>>> ----- Original Message ----- > >>>> > >>>>> From: Mike Wolman > >>>>> To: freebsd-mips@freebsd.org > >>>>> Cc: > >>>>> Date: 2017/5/9, Tue 07:48 > >>>>> Subject: Re: onion omega2+ > >>>>> > >>>>> > >>>>> 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 > >>>>>> > >>> > > linux/ramips/dts/OMEGA2.dtsi> > >>>>>> fetch > >>>>>> > >>> > > https://raw.githubusercontent.com/WereCatf/source/image/ > target/linux/ramips/dts/OMEGA2.dts > >>>>>> > >>> > > linux/ramips/dts/OMEGA2.dts> > >>>>>> fetch > >>>>>> > >>> > > https://raw.githubusercontent.com/WereCatf/source/image/ > target/linux/ramips/dts/OMEGA2P.dts > >>>>>> > >>> > > 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 >>> > > >>>>> _______________________________________________ > >>>>> 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" > >>>>> > > > _______________________________________________ > 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