Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2017 10:20:40 +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:  <128807.28836.qm@web101715.mail.ssk.yahoo.co.jp>
In-Reply-To: <fda8b792-f6c4-d0fb-5a99-d190cc3a4f39@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> <410144.69078.qm@web101716.mail.ssk.yahoo.co.jp> <fda8b792-f6c4-d0fb-5a99-d190cc3a4f39@wolman.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Mike=0A=0AIn FreeBSD is use serial0 dts item to console.=0A=0AI think go=
od to use this at start.=0A=0Afreebsd/sys/gnu/dts/mips/MT7628.dts=0A=0A----=
- Original Message -----=0A> From: Mike Wolman <mike@wolman.co.uk>=0A> To: =
Mori Hiroki <yamori813@yahoo.co.jp>; "freebsd-mips@freebsd.org" <freebsd-mi=
ps@freebsd.org>=0A> Cc: =0A> Date: 2017/5/9, Tue 09:25=0A> Subject: Re: oni=
on omega2+=0A> =0A> Hi Mori,=0A> =0A> I grabbed the dts files from:=0A> =0A=
> https://github.com/WereCatf/source/tree/image/target/linux/ramips/dts=0A>=
 https://github.com/WereCatf/source/blob/image/target/linux/ramips/dts/OMEG=
A2P.dts=0A> https://github.com/WereCatf/source/blob/image/target/linux/rami=
ps/dts/OMEGA2.dtsi=0A> =0A> If this is of any use from the default linux in=
stall on the flash:=0A> =0A> root@Omega-12BF:/proc# cat /proc/mtd=0A> dev:=
=A0 =A0 size=A0  erasesize=A0 name=0A> mtd0: 00030000 00010000 "u-boot"=0A>=
 mtd1: 00010000 00010000 "u-boot-env"=0A> mtd2: 00010000 00010000 "factory"=
=0A> mtd3: 01fb0000 00010000 "firmware"=0A> mtd4: 00148842 00010000 "kernel=
"=0A> mtd5: 01e677be 00010000 "rootfs"=0A> mtd6: 01950000 00010000 "rootfs_=
data"=0A> =0A> =0A> btw after posting i spotted and error in what i did wit=
h:=0A> =0A> mkimage -A mips -O linux -T kernel -C lzma \=0A> =A0 =A0 -a 0x8=
0001000 -e 0x80001100 \=0A> =A0 =A0 -n "FreeBSD" -d kernel.MT7628_FDT.lzma=
=0A> kernel.MT7628_FDT.ulzma.uImage=0A> =0A> I have redone this using the c=
orrect compressed kernel ie:=0A> =0A> mkimage -A mips -O linux -T kernel -C=
 lzma \=0A> =A0 =A0 -a 0x80001000 -e 0x80001100 \=0A> =A0 =A0 -n "FreeBSD" =
-d kernel.MT7628_FDT.ulzma=0A> kernel.MT7628_FDT.ulzma.uImage=0A> =0A> =0A>=
 But this didnt work.=0A> =0A> =0A> =0A> On 09/05/2017 01:17, Mori Hiroki w=
rote:=0A>>  Hi.=0A>> =0A>>  I think if U-Boot work memory make broken then=
=0A>>  Uncompressing Kernel Image is NG.=0A>> =0A>>  Some ARM U-Boot is use=
 top address in work memory.=0A>>  If this case your kernel start address t=
o move to=0A>>  after work memory. But I never see in MIPS.=0A>> =0A>>  And=
 What is set FDT_DTS_FILE=A0 in 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 have 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>=
 \=0A>>>  /home/mike/omega2/src/../tftpboot/kernel.MT7628_FDT.lzma -d20=0A>=
>> =0A>>>  This did not work.=0A>>> =0A>>> =0A>>>  Looking at the onion ome=
ga conf I see that it uses mkuzip and not lzma=0A>>>  with the following se=
ttings:=0A>>> =0A>>>  X_FSIMAGE_CMD=3D"mkuzip"=0A>>>  X_FSIMAGE_ARGS=3D"-L =
-d -s 65536 -v"=0A>>>  X_FSIMAGE_SUFFIX=3D".ulzma"=0A>>> =0A>>>  So tried t=
he following:=0A>>> =0A>>>  mkuzip -L -d -s 65536 -v -o kernel.MT7628_FDT.u=
lzma kernel.MT7628_FDT=0A>>> =0A>>>  mkimage -A mips -O linux -T kernel -C =
lzma \=0A>>> =A0 =A0  -a 0x80001000 -e 0x80001100 \=0A>>> =A0 =A0  -n "Free=
BSD" -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>>>> =A0  Hi Mike!=0A>>>> =0A=
>>>> =A0  I see you have no "OK" after "Uncompressing Kernel =0A> Image=0A>=
>>  ...", so=0A>>>> =A0  first point uboot decompressor fail.=0A>>>> =A0  W=
hy fail? Because you have wrong base address in image:=0A>>>> =A0 =A0  Load=
 Address: fffffff2=0A>>>> =A0 =A0  Entry Point:=A0 fffffff2=0A>>>> =A0  MIP=
S32 machines have RAM mapped to 0x80000000 address, so adding =0A> its=0A>>=
>> =A0  size, you will get max address (if 16MB, it will be 0x81000000), =
=0A> but=0A>>>> =A0  you uboot image was created with 0xfffffff2.=0A>>>> =
=0A>>>> =A0  Even more, unpacked kernel expects it will be called at =0A> 0=
x80001100. so=0A>>>> =A0  if you have ELF kernel (file with ELF header, lik=
e every =0A> executable)=0A>>>> =A0  that file have to be loaded at (0x8000=
1100 - ELF_HEADER_SIZE).=0A>>>> =A0  In most cases it will be 0x80001100 - =
0x100 =3D 0x80001000. But =0A> sometime=0A>>>> =A0  (I did not found why) i=
t can be 0x20, you can find it by looking =0A> at=0A>>>> =A0  .text section=
 in readelf -S.=0A>>>> =0A>>>> =A0  So if you have kernel with entry point =
0x80001100 and .text =0A> segment=0A>>>> =A0  offset 0x100, you have to cre=
ate uboot image with load address=0A>>>> =A0  0x80001000 and entry point 0x=
80001100.=0A>>>> =0A>>>> =A0  If that step successful you will get:=0A>>>> =
=A0  /Uncompressing Kernel Image/ ... OK=0A>>>> =A0  Starting kernel ...=0A=
>>>> =0A>>>> =A0  Last line mean, uboot did jump into kernel code.=0A>>>> =
=0A>>>> =A0  Good luck.=0A>>>> =0A>>>> =A0  2017-05-07 18:20 GMT+03:00 Mike=
 Wolman <mike@wolman.co.uk=0A>>>> =A0  <mailto:mike@wolman.co.uk>>:=0A>>>> =
=0A>>>> =A0 =A0 =A0  Hi,=0A>>>> =0A>>>> =A0 =A0 =A0  I am trying to get Fre=
eBSD working on this board - I think I =0A> am=0A>>>> =A0 =A0 =A0  almost t=
here in getting it working but need some help please.=0A>>>> =0A>>>> =A0 =
=A0 =A0  I have followed instructions from the freebsd-wifi-build and=0A>>>=
> =A0 =A0 =A0  *think* I have got everything correct - I am trying to do =
=0A> this on=0A>>>> =A0 =A0 =A0  a CURRENT setup:=0A>>>> =0A>>>> =A0 =A0 =
=A0  FreeBSD f64-current.mw.office 12.0-CURRENT FreeBSD =0A> 12.0-CURRENT #=
0=0A>>>> =A0 =A0 =A0  r317887: Sun May=A0 7 03:20:34 UTC 2017=0A>>>> =A0 =
=A0 =A0 =0A> mike@f64-current.mw.office:/usr/obj/usr/src/sys/GENERIC-NODEBU=
G amd64=0A>>>> =0A>>>> =0A>>>> =A0 =A0 =A0  $ cat ~/.freebsd-wifi-build-set=
tings.cfg=0A>>>> =A0 =A0 =A0  X_SKIP_MORE_STUFF=3DYES=0A>>>> =A0 =A0 =A0  X=
_EXTRA_SRC_CONF=3D~/omega2/src.conf=0A>>>> =0A>>>> =A0 =A0 =A0  $ cat ~/ome=
ga2/src.conf=0A>>>> =A0 =A0 =A0  WITHOUT_CLANG=3DYES=0A>>>> =A0 =A0 =A0  WI=
THOUT_CLANG_FULL=3DYES=0A>>>> =0A>>>> =A0 =A0 =A0  get dts files from threa=
d=0A>>>> =A0 =A0 =A0 http://community.onion.io/topic/1099/openwrt-on-the-om=
ega-2/8=0A>>>> =A0 =A0 =A0 =0A> <http://community.onion.io/topic/1099/openw=
rt-on-the-omega-2/8>=0A>>>> =0A>>>> =0A>>>> =A0 =A0 =A0  cd ~/omega2/src/sy=
s/gnu/dts/mips=0A>>>> =A0 =A0 =A0  fetch=0A>>>> =A0 =A0 =A0 =0A>>> =0A> htt=
ps://raw.githubusercontent.com/WereCatf/source/image/target/linux/ramips/dt=
s/OMEGA2.dtsi=0A>>>> =A0 =A0 =A0 =0A>>> =0A> <https://raw.githubusercontent=
.com/WereCatf/source/image/target/linux/ramips/dts/OMEGA2.dtsi>=0A>>>> =A0 =
=A0 =A0  fetch=0A>>>> =A0 =A0 =A0 =0A>>> =0A> https://raw.githubusercontent=
.com/WereCatf/source/image/target/linux/ramips/dts/OMEGA2.dts=0A>>>> =A0 =
=A0 =A0 =0A>>> =0A> <https://raw.githubusercontent.com/WereCatf/source/imag=
e/target/linux/ramips/dts/OMEGA2.dts>=0A>>>> =A0 =A0 =A0  fetch=0A>>>> =A0 =
=A0 =A0 =0A>>> =0A> https://raw.githubusercontent.com/WereCatf/source/image=
/target/linux/ramips/dts/OMEGA2P.dts=0A>>>> =A0 =A0 =A0 =0A>>> =0A> <https:=
//raw.githubusercontent.com/WereCatf/source/image/target/linux/ramips/dts/O=
MEGA2P.dts>=0A>>>> =A0 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_=
FDT=0A>>>> =A0 =A0 =A0  ../freebsd-wifi-build/build/bin/build ralink buildw=
orld=0A>>>> =A0 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>=
>>> =A0 =A0 =A0  ../freebsd-wifi-build/build/bin/build ralink buildkernel=
=0A>>>> =A0 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>>>> =
=A0 =A0 =A0  ../freebsd-wifi-build/build/bin/build ralink installworld=0A>>=
>> =A0 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>>>> =A0 =
=A0 =A0  ../freebsd-wifi-build/build/bin/build ralink installkernel=0A>>>> =
=A0 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>>>> =A0 =A0 =
=A0  ../freebsd-wifi-build/build/bin/build ralink distribution=0A>>>> =0A>>=
>> =0A>>>> =A0 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>>=
>> =A0 =A0 =A0  ../freebsd-wifi-build/build/bin/build ralink mfsroot=0A>>>>=
 =A0 =A0 =A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>>>> =A0 =A0=
 =A0  ../freebsd-wifi-build/build/bin/build ralink fsimage=0A>>>> =A0 =A0 =
=A0  X_DTS_FILE=3DOMEGA2P.dts KERNCONF=3DMT7628_FDT=0A>>>> =A0 =A0 =A0  ../=
freebsd-wifi-build/build/bin/build ralink uboot=0A>>>> =0A>>>> =0A>>>> =A0 =
=A0 =A0  Create flash:=0A>>>> =0A>>>> =A0 =A0 =A0  X_FLASH=3Dkernel.MT7628_=
FDT.lzma.flash=0A>>>> =A0 =A0 =A0  dd if=3D/dev/zero bs=3D$(( 0x200000 )) c=
ount=3D1 of=3D${X_FLASH}=0A>>>> =A0 =A0 =A0  dd if=3Dkernel.MT7628_FDT.lzma=
.uImage of=3D${X_FLASH} =0A> conv=3Dnotrunc=0A>>>> =A0 =A0 =A0  dd if=3D mf=
sroot-ralink.img.lzma >> ${X_FLASH}=0A>>>> =0A>>>> =0A>>>> =A0 =A0 =A0  $ r=
eadelf -h kernel.MT7628_FDT | grep Entry=0A>>>> =A0 =A0 =A0 =A0  Entry poin=
t address:=A0 =A0 =A0 =A0 =A0 =A0 =A0  0x80001100=0A>>>> =0A>>>> =0A>>>> =
=0A>>>> =0A>>>> =A0 =A0 =A0  Now on the omega over serial - I didnt get the=
 network =0A> expansion=0A>>>> =A0 =A0 =A0  doc thing so am doing stuff wit=
h usb rather than tftp=0A>>>> =0A>>>> =A0 =A0 =A0  I am not 100% sure about=
 the 0x80001100 and the fatload and =0A> have=0A>>>> =A0 =A0 =A0  tried thi=
s=0A>>>> =0A>>>> =A0 =A0 =A0  Omega2 # fatload usb 0:1 0x80001100 =0A> /ker=
nel.MT7628_FDT.lzma.flash=0A>>>> =A0 =A0 =A0  *=0A>>>> =A0 =A0 =A0  *=0A>>>=
> =A0 =A0 =A0  Reading file "/kernel.MT7628_FDT.lzma.flash"=0A>>>> =A0 =A0 =
=A0  *=0A>>>> =A0 =A0 =A0  **=0A>>>> =A0 =A0 =A0  **=0A>>>> =A0 =A0 =A0  **=
=0A>>>> =A0 =A0 =A0  ******=0A>>>> =A0 =A0 =A0 =0A>>> =0A> ****************=
***************************************************************************=
**************************************************=0A>>>> =A0 =A0 =A0  ****=
**=0A>>>> =A0 =A0 =A0  *=0A>>>> =A0 =A0 =A0  FAT: 2108463 Bytes read=0A>>>>=
 =A0 =A0 =A0  Omega2 # bootm 0x80001100=0A>>>> =A0 =A0 =A0  ## Booting imag=
e at 80001100 ...=0A>>>> =A0 =A0 =A0 =A0 =A0 Image Name:=A0  FreeBSD=0A>>>>=
 =A0 =A0 =A0 =A0 =A0 Image Type:=A0  MIPS Linux Kernel Image (lzma compress=
ed)=0A>>>> =A0 =A0 =A0 =A0 =A0 Data Size:=A0 =A0 1365122 Bytes =3D=A0 1.3 M=
B=0A>>>> =A0 =A0 =A0 =A0 =A0 Load Address: fffffff2=0A>>>> =A0 =A0 =A0 =A0 =
=A0 Entry Point:=A0 fffffff2=0A>>>> =A0 =A0 =A0 =A0 =A0 Verifying Checksum =
... OK=0A>>>> =A0 =A0 =A0 =A0 =A0 Uncompressing Kernel Image ...=0A>>>> =0A=
>>>> =0A>>>> =A0 =A0 =A0  At this point nothing happens and console hangs -=
 note in=0A>>>> =A0 =A0 =A0  OMEGA2.dtsithe console is set to ttyS0:=0A>>>>=
 =0A>>>> =A0 =A0 =A0  bootargs =3D "console=3DttyS0,115200";=0A>>>> =0A>>>>=
 =0A>>>> =0A>>>> =0A>>>> =A0 =A0 =A0  I have also tried with just kernel.MT=
7628_FDT and=0A>>>> =A0 =A0 =A0  kernel.MT7628_FDT.lzma but both fail:=0A>>=
>> =0A>>>> =A0 =A0 =A0  Omega2 # fatload usb 0:1 0x80001100 =0A> /kernel.MT=
7628_FDT.lzma.uImage=0A>>>> =A0 =A0 =A0  *=0A>>>> =A0 =A0 =A0  *=0A>>>> =A0=
 =A0 =A0  Reading file "/kernel.MT7628_FDT.lzma.uImage"=0A>>>> =A0 =A0 =A0 =
 *=0A>>>> =A0 =A0 =A0  **=0A>>>> =A0 =A0 =A0  **=0A>>>> =A0 =A0 =A0  ******=
=0A>>>> =A0 =A0 =A0 =0A>>> =0A> *******************************************=
***************************************************************************=
********=0A>>>> =A0 =A0 =A0  **********=0A>>>> =A0 =A0 =A0  *=0A>>>> =A0 =
=A0 =A0  FAT: 1365186 Bytes read=0A>>>> =A0 =A0 =A0  Omega2 # bootm 0x80001=
100=0A>>>> =A0 =A0 =A0  ## Booting image at 80001100 ...=0A>>>> =A0 =A0 =A0=
 =A0 =A0 Image Name:=A0  FreeBSD=0A>>>> =A0 =A0 =A0 =A0 =A0 Image Type:=A0 =
 MIPS Linux Kernel Image (lzma compressed)=0A>>>> =A0 =A0 =A0 =A0 =A0 Data =
Size:=A0 =A0 1365122 Bytes =3D=A0 1.3 MB=0A>>>> =A0 =A0 =A0 =A0 =A0 Load Ad=
dress: fffffff2=0A>>>> =A0 =A0 =A0 =A0 =A0 Entry Point:=A0 fffffff2=0A>>>> =
=A0 =A0 =A0 =A0 =A0 Verifying Checksum ... OK=0A>>>> =A0 =A0 =A0 =A0 =A0 Un=
compressing Kernel Image ...=0A>>>> =0A>>>> =0A>>>> =A0 =A0 =A0  A few comm=
ents on the hardware for anyone who wants to get =0A> one:=0A>>>> =0A>>>> =
=A0 =A0 =A0  Get the expansion dock with serial port access - the power =0A=
> dock=0A>>>> =A0 =A0 =A0  does not provide serial access - i think it is p=
ossible to =0A> use an=0A>>>> =A0 =A0 =A0  ftdi ttl serial chip/cable but h=
ave not tried.=0A>>>> =0A>>>> =A0 =A0 =A0  Stupidly I forgot this only has =
wifi access so you are not =0A> able to=0A>>>> =A0 =A0 =A0  tftp boot this =
without getting the ethernet network expansion =0A> but=0A>>>> =A0 =A0 =A0 =
 loading stuff up from a usb memory stick is seem fine from =0A> u-boot.=0A=
>>>> =0A>>>> =A0 =A0 =A0  I do not think that it is possible to boot from t=
he SD card =0A> on the=0A>>>> =A0 =A0 =A0  Omega2+ - which is a shame.=0A>>=
>> =0A>>>> =A0 =A0 =A0  Thanks for reading,=0A>>>> =0A>>>> =A0 =A0 =A0  Mik=
e.=0A>>>> =0A>>>> =0A>>>> =0A>>>> =A0 =A0 =A0  ____________________________=
___________________=0A>>>> =A0 =A0 =A0 freebsd-mips@freebsd.org =0A> <mailt=
o:freebsd-mips@freebsd.org>mailing=0A>>>  list=0A>>>> =A0 =A0 =A0 https://l=
ists.freebsd.org/mailman/listinfo/freebsd-mips=0A>>>> =A0 =A0 =A0 =0A> <htt=
ps://lists.freebsd.org/mailman/listinfo/freebsd-mips>=0A>>>> =A0 =A0 =A0  T=
o unsubscribe, send any mail to=0A>>>> =A0 =A0 =A0  "freebsd-mips-unsubscri=
be@freebsd.org=0A>>>> =A0 =A0 =A0  <mailto:freebsd-mips-unsubscribe@freebsd=
.org>"=0A>>>> =0A>>>> =0A>>>> =0A>>>> =0A>>>> =A0  --=0A>>>> =A0  WBW=0A>>>=
> =A0  -------=0A>>>> =A0  Rybalko Aleksandr <ray@ddteam.net =0A> <mailto:r=
ay@ddteam.net>>=0A>>>> =0A>>>  ____________________________________________=
___=0A>>>  freebsd-mips@freebsd.org mailing list=0A>>>  https://lists.freeb=
sd.org/mailman/listinfo/freebsd-mips=0A>>>  To unsubscribe, send any mail t=
o=0A>>>  "freebsd-mips-unsubscribe@freebsd.org"=0A>>> =0A> 



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