Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2017 09:17:58 +0900 (JST)
From:      Mori Hiroki <yamori813@yahoo.co.jp>
To:        Mike Wolman <mike@wolman.co.uk>, "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   Re: onion omega2+
Message-ID:  <410144.69078.qm@web101716.mail.ssk.yahoo.co.jp>
In-Reply-To: <e92bc818-485f-d9fc-da2b-776bae2b0916@wolman.co.uk>
References:  <694efc3a-e183-35a1-a0bf-9a9c0d708826@wolman.co.uk> <CAJ1Oi8G%2BvTMBX4Ey=H=2WruXDjXjcyte5_n8T3VDdL=h8m7%2BVw@mail.gmail.com> <e92bc818-485f-d9fc-da2b-776bae2b0916@wolman.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi.=0A=0AI think if U-Boot work memory make broken then=A0=0AUncompressing =
Kernel Image is NG.=0A=0ASome ARM U-Boot is use top address in work memory.=
=0AIf this case your kernel start address=A0to move to=0Aafter work memory.=
=A0But I never see in MIPS.=A0=0A=0AAnd What is set=A0FDT_DTS_FILE =A0in=A0=
your kernel configuration ?=0A=0A----- Original Message -----=0A=0A> From: =
Mike Wolman <mike@wolman.co.uk>=0A> To: freebsd-mips@freebsd.org=0A> Cc: =
=0A> Date: 2017/5/9, Tue 07:48=0A> Subject: Re: onion omega2+=0A> =0A> =0A>=
 More info in case anyone can point me in the right direction.=0A> =0A> I h=
ave found:=0A> =0A> https://forum.openwrt.org/viewtopic.php?id=3D53865=0A>; =
=0A> I have tried changing how lzma compresses the kernel by adding -d20 to=
 =0A> the build scripts eg:=0A> =0A> /usr/local/bin/lzma e =0A> /home/mike/=
omega2/src/../root/mipsel_ap/boot/kernel.MT7628_FDT/kernel \=0A> /home/mike=
/omega2/src/../tftpboot/kernel.MT7628_FDT.lzma -d20=0A> =0A> This did not w=
ork.=0A> =0A> =0A> Looking at the onion omega conf I see that it uses mkuzi=
p and not lzma =0A> with the following settings:=0A> =0A> X_FSIMAGE_CMD=3D"=
mkuzip"=0A> X_FSIMAGE_ARGS=3D"-L -d -s 65536 -v"=0A> X_FSIMAGE_SUFFIX=3D".u=
lzma"=0A> =0A> So tried the following:=0A> =0A> mkuzip -L -d -s 65536 -v -o=
 kernel.MT7628_FDT.ulzma kernel.MT7628_FDT=0A> =0A> mkimage -A mips -O linu=
x -T kernel -C lzma \=0A> =A0  -a 0x80001000 -e 0x80001100 \=0A> =A0  -n "F=
reeBSD" -d kernel.MT7628_FDT.lzma =0A> kernel.MT7628_FDT.ulzma.uImage=0A> =
=0A> =0A> But this did not work either.=0A> =0A> =0A> =0A> On 08/05/2017 19=
:41, Aleksandr Rybalko wrote:=0A>>  Hi Mike!=0A>> =0A>>  I see you have no =
"OK" after "Uncompressing Kernel Image =0A> ...", so =0A>>  first point ubo=
ot decompressor fail.=0A>>  Why fail? Because you have wrong base address i=
n image:=0A>> =A0  Load Address: fffffff2=0A>> =A0  Entry Point:=A0 fffffff=
2=0A>>  MIPS32 machines have RAM mapped to 0x80000000 address, so adding it=
s =0A>>  size, you will get max address (if 16MB, it will be 0x81000000), b=
ut =0A>>  you uboot image was created with 0xfffffff2.=0A>> =0A>>  Even mor=
e, unpacked kernel expects it will be called at 0x80001100. so =0A>>  if yo=
u have ELF kernel (file with ELF header, like every executable) =0A>>  that=
 file have to be loaded at (0x80001100 - ELF_HEADER_SIZE).=0A>>  In most ca=
ses it will be 0x80001100 - 0x100 =3D 0x80001000. But sometime =0A>>  (I di=
d not found why) it can be 0x20, you can find it by looking at =0A>>  .text=
 section in readelf -S.=0A>> =0A>>  So if you have kernel with entry point =
0x80001100 and .text segment =0A>>  offset 0x100, you have to create uboot =
image with load address =0A>>  0x80001000 and entry point 0x80001100.=0A>> =
=0A>>  If that step successful you will get:=0A>>  /Uncompressing Kernel Im=
age/ ... OK=0A>>  Starting kernel ...=0A>> =0A>>  Last line mean, uboot did=
 jump into kernel code.=0A>> =0A>>  Good luck.=0A>> =0A>>  2017-05-07 18:20=
 GMT+03:00 Mike Wolman <mike@wolman.co.uk =0A>>  <mailto:mike@wolman.co.uk>=
>:=0A>> =0A>> =A0 =A0  Hi,=0A>> =0A>> =A0 =A0  I am trying to get FreeBSD w=
orking on this board - I think I am=0A>> =A0 =A0  almost there in getting i=
t working but need some help please.=0A>> =0A>> =A0 =A0  I have followed in=
structions from the freebsd-wifi-build and=0A>> =A0 =A0  *think* I have got=
 everything correct - I am trying to do this on=0A>> =A0 =A0  a CURRENT set=
up:=0A>> =0A>> =A0 =A0  FreeBSD f64-current.mw.office 12.0-CURRENT FreeBSD =
12.0-CURRENT #0=0A>> =A0 =A0  r317887: Sun May=A0 7 03:20:34 UTC 2017=0A>> =
=A0 =A0 mike@f64-current.mw.office:/usr/obj/usr/src/sys/GENERIC-NODEBUG amd=
64=0A>> =0A>> =0A>> =A0 =A0  $ cat ~/.freebsd-wifi-build-settings.cfg=0A>> =
=A0 =A0  X_SKIP_MORE_STUFF=3DYES=0A>> =A0 =A0  X_EXTRA_SRC_CONF=3D~/omega2/=
src.conf=0A>> =0A>> =A0 =A0  $ cat ~/omega2/src.conf=0A>> =A0 =A0  WITHOUT_=
CLANG=3DYES=0A>> =A0 =A0  WITHOUT_CLANG_FULL=3DYES=0A>> =0A>> =A0 =A0  get =
dts files from thread=0A>> =A0 =A0 http://community.onion.io/topic/1099/ope=
nwrt-on-the-omega-2/8=0A>> =A0 =A0  <http://community.onion.io/topic/1099/o=
penwrt-on-the-omega-2/8>=0A>> =0A>> =0A>> =A0 =A0  cd ~/omega2/src/sys/gnu/=
dts/mips=0A>> =A0 =A0  fetch=0A>> =A0 =A0 =0A> https://raw.githubuserconten=
t.com/WereCatf/source/image/target/linux/ramips/dts/OMEGA2.dtsi=0A>> =A0 =
=A0 =0A> <https://raw.githubusercontent.com/WereCatf/source/image/target/li=
nux/ramips/dts/OMEGA2.dtsi>=0A>> =A0 =A0  fetch=0A>> =A0 =A0 =0A> https://r=
aw.githubusercontent.com/WereCatf/source/image/target/linux/ramips/dts/OMEG=
A2.dts=0A>> =A0 =A0 =0A> <https://raw.githubusercontent.com/WereCatf/source=
/image/target/linux/ramips/dts/OMEGA2.dts>=0A>> =A0 =A0  fetch=0A>> =A0 =A0=
 =0A> https://raw.githubusercontent.com/WereCatf/source/image/target/linux/=
ramips/dts/OMEGA2P.dts=0A>> =A0 =A0 =0A> <https://raw.githubusercontent.com=
/WereCatf/source/image/target/linux/ramips/dts/OMEGA2P.dts>=0A>> =0A>> =A0 =
=A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>> =A0 =A0  ../freebs=
d-wifi-build/build/bin/build ralink buildworld=0A>> =A0 =A0  X_DTS_FILE=3DO=
MEGA2P.dts KERNCONF=3DMT7628_FDT=0A>> =A0 =A0  ../freebsd-wifi-build/build/=
bin/build ralink buildkernel=0A>> =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCON=
F=3DMT7628_FDT=0A>> =A0 =A0  ../freebsd-wifi-build/build/bin/build ralink i=
nstallworld=0A>> =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A=
>> =A0 =A0  ../freebsd-wifi-build/build/bin/build ralink installkernel=0A>>=
 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>> =A0 =A0  ../f=
reebsd-wifi-build/build/bin/build ralink distribution=0A>> =0A>> =0A>> =A0 =
=A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>> =A0 =A0  ../freebs=
d-wifi-build/build/bin/build ralink mfsroot=0A>> =A0 =A0  X_DTS_FILE=3DOMEG=
A2P.dts KERNCONF=3DMT7628_FDT=0A>> =A0 =A0  ../freebsd-wifi-build/build/bin=
/build ralink fsimage=0A>> =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7=
628_FDT=0A>> =A0 =A0  ../freebsd-wifi-build/build/bin/build ralink uboot=0A=
>> =0A>> =0A>> =A0 =A0  Create flash:=0A>> =0A>> =A0 =A0  X_FLASH=3Dkernel.=
MT7628_FDT.lzma.flash=0A>> =A0 =A0  dd if=3D/dev/zero bs=3D$(( 0x200000 )) =
count=3D1 of=3D${X_FLASH}=0A>> =A0 =A0  dd if=3Dkernel.MT7628_FDT.lzma.uIma=
ge of=3D${X_FLASH} conv=3Dnotrunc=0A>> =A0 =A0  dd if=3D mfsroot-ralink.img=
.lzma >> ${X_FLASH}=0A>> =0A>> =0A>> =A0 =A0  $ readelf -h kernel.MT7628_FD=
T | grep Entry=0A>> =A0 =A0 =A0  Entry point address:=A0 =A0 =A0 =A0 =A0 =
=A0 =A0  0x80001100=0A>> =0A>> =0A>> =0A>> =0A>> =A0 =A0  Now on the omega =
over serial - I didnt get the network expansion=0A>> =A0 =A0  doc thing so =
am doing stuff with usb rather than tftp=0A>> =0A>> =A0 =A0  I am not 100% =
sure about the 0x80001100 and the fatload and have=0A>> =A0 =A0  tried this=
=0A>> =0A>> =A0 =A0  Omega2 # fatload usb 0:1 0x80001100 /kernel.MT7628_FDT=
.lzma.flash=0A>> =A0 =A0  *=0A>> =A0 =A0  *=0A>> =A0 =A0  Reading file "/ke=
rnel.MT7628_FDT.lzma.flash"=0A>> =A0 =A0  *=0A>> =A0 =A0  **=0A>> =A0 =A0  =
**=0A>> =A0 =A0  **=0A>> =A0 =A0  ******=0A>> =A0 =A0 =0A> ****************=
***************************************************************************=
**************************************************=0A>> =A0 =A0  ******=0A>=
> =A0 =A0  *=0A>> =A0 =A0  FAT: 2108463 Bytes read=0A>> =A0 =A0  Omega2 # b=
ootm 0x80001100=0A>> =A0 =A0  ## Booting image at 80001100 ...=0A>> =A0 =A0=
 =A0 =A0 Image Name:=A0  FreeBSD=0A>> =A0 =A0 =A0 =A0 Image Type:=A0  MIPS =
Linux Kernel Image (lzma compressed)=0A>> =A0 =A0 =A0 =A0 Data Size:=A0 =A0=
 1365122 Bytes =3D=A0 1.3 MB=0A>> =A0 =A0 =A0 =A0 Load Address: fffffff2=0A=
>> =A0 =A0 =A0 =A0 Entry Point:=A0 fffffff2=0A>> =A0 =A0 =A0 =A0 Verifying =
Checksum ... OK=0A>> =A0 =A0 =A0 =A0 Uncompressing Kernel Image ...=0A>> =
=0A>> =0A>> =A0 =A0  At this point nothing happens and console hangs - note=
 in=0A>> =A0 =A0  OMEGA2.dtsithe console is set to ttyS0:=0A>> =0A>> =A0 =
=A0  bootargs =3D "console=3DttyS0,115200";=0A>> =0A>> =0A>> =0A>> =0A>> =
=A0 =A0  I have also tried with just kernel.MT7628_FDT and=0A>> =A0 =A0  ke=
rnel.MT7628_FDT.lzma but both fail:=0A>> =0A>> =A0 =A0  Omega2 # fatload us=
b 0:1 0x80001100 /kernel.MT7628_FDT.lzma.uImage=0A>> =A0 =A0  *=0A>> =A0 =
=A0  *=0A>> =A0 =A0  Reading file "/kernel.MT7628_FDT.lzma.uImage"=0A>> =A0=
 =A0  *=0A>> =A0 =A0  **=0A>> =A0 =A0  **=0A>> =A0 =A0  ******=0A>> =A0 =A0=
 =0A> *********************************************************************=
*********************************************************=0A>> =A0 =A0  ***=
*******=0A>> =A0 =A0  *=0A>> =A0 =A0  FAT: 1365186 Bytes read=0A>> =A0 =A0 =
 Omega2 # bootm 0x80001100=0A>> =A0 =A0  ## Booting image at 80001100 ...=
=0A>> =A0 =A0 =A0 =A0 Image Name:=A0  FreeBSD=0A>> =A0 =A0 =A0 =A0 Image Ty=
pe:=A0  MIPS Linux Kernel Image (lzma compressed)=0A>> =A0 =A0 =A0 =A0 Data=
 Size:=A0 =A0 1365122 Bytes =3D=A0 1.3 MB=0A>> =A0 =A0 =A0 =A0 Load Address=
: fffffff2=0A>> =A0 =A0 =A0 =A0 Entry Point:=A0 fffffff2=0A>> =A0 =A0 =A0 =
=A0 Verifying Checksum ... OK=0A>> =A0 =A0 =A0 =A0 Uncompressing Kernel Ima=
ge ...=0A>> =0A>> =0A>> =A0 =A0  A few comments on the hardware for anyone =
who wants to get one:=0A>> =0A>> =A0 =A0  Get the expansion dock with seria=
l port access - the power dock=0A>> =A0 =A0  does not provide serial access=
 - i think it is possible to use an=0A>> =A0 =A0  ftdi ttl serial chip/cabl=
e but have not tried.=0A>> =0A>> =A0 =A0  Stupidly I forgot this only has w=
ifi access so you are not able to=0A>> =A0 =A0  tftp boot this without gett=
ing the ethernet network expansion but=0A>> =A0 =A0  loading stuff up from =
a usb memory stick is seem fine from u-boot.=0A>> =0A>> =A0 =A0  I do not t=
hink that it is possible to boot from the SD card on the=0A>> =A0 =A0  Omeg=
a2+ - which is a shame.=0A>> =0A>> =A0 =A0  Thanks for reading,=0A>> =0A>> =
=A0 =A0  Mike.=0A>> =0A>> =0A>> =0A>> =A0 =A0  ____________________________=
___________________=0A>> =A0 =A0 freebsd-mips@freebsd.org <mailto:freebsd-m=
ips@freebsd.org>mailing =0A> list=0A>> =A0 =A0 https://lists.freebsd.org/ma=
ilman/listinfo/freebsd-mips=0A>> =A0 =A0  <https://lists.freebsd.org/mailma=
n/listinfo/freebsd-mips>=0A>> =A0 =A0  To unsubscribe, send any mail to=0A>=
> =A0 =A0  "freebsd-mips-unsubscribe@freebsd.org=0A>> =A0 =A0  <mailto:free=
bsd-mips-unsubscribe@freebsd.org>"=0A>> =0A>> =0A>> =0A>> =0A>>  -- =0A>>  =
WBW=0A>>  -------=0A>>  Rybalko Aleksandr <ray@ddteam.net <mailto:ray@ddtea=
m.net>>=0A>> =0A> =0A> _______________________________________________=0A> =
freebsd-mips@freebsd.org mailing list=0A> https://lists.freebsd.org/mailman=
/listinfo/freebsd-mips=0A> To unsubscribe, send any mail to =0A> "freebsd-m=
ips-unsubscribe@freebsd.org"=0A> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?410144.69078.qm>