onion omega2+
Mike Wolman
mike at wolman.co.uk
Thu May 11 21:39:46 UTC 2017
Well after my confusion trying to create a single flash file and kernel
without the correct mkfwimage tool I have got root mounted from a usb key
A few bits of hardware not working - i dont seem to see the sd card and
also wifi device is missing so need to dig into that but otherwise i
think everything else is there - the freebsd-wifi build is very minumal
so will probally make a larger one.
Need to figure out how to now install kernel into flash to save the
hassle of reseting usb and loading kernel manually each time - also i
can then leave in the rootfs usb key.
USB_STORAGE: 1 Storage Device(s) found
Omega2 # fatload usb 0:1 0x80800000 kernel.MT7628_FDT.lzma.uImage
*
*
Reading file "kernel.MT7628_FDT.lzma.uImage"
*
**
******
**************************************************************************************************************************
************
*
FAT: 1144975 Bytes read
SWAP USB KEY
Omega2 # bootm 0x80800000
## Booting image at 80800000 ...
Image Name: FreeBSD
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1144911 Bytes = 1.1 MB
Load Address: 80001100
Entry Point: 80001100
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80001100) ...
## Giving linux memsize in MB, 128
Starting kernel ...
FDT DTB at: 0x804133c0
CPU clock: 580MHz
Timer clock: 290MHz
UART clock: 40MHz
U-Boot args (from 0 args):
None
Environment:
memsize=128
initrd_start=0x00000000
initrd_size=0x0
flash_start=0x00000000
flash_size=0x2000000
entry: mips_init()
RAM size: 128MB (from FDT)
Cache info:
picache_stride = 4096
picache_loopcount = 16
pdcache_stride = 4096
pdcache_loopcount = 8
max line size = 32
cpu0: MIPS Technologies processor v85.150
MMU: Standard TLB, 32 entries (4K 16K 64K 256K 1M 16M 64M 256M pg sizes)
L1 i-cache: 4 ways of 512 sets, 32 bytes per line
L1 d-cache: 4 ways of 256 sets, 32 bytes per line
L2 cache: disabled
Config1=0xbee3519e<PerfCount,WatchRegs,MIPS16,EJTAG>
Config2=0x80000000
Config3=0x2420<ULRI>
Config7=0x80010400<WII,AR>
Physical memory chunk(s):
0x47b000 - 0x7ffffff, 129519616 bytes (31621 pages)
Maxmem is 0x8000000
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-CURRENT #0 r317887M: Wed May 10 20:49:10 UTC 2017
mike at f64-current.mw.office:/usr/home/mike/omega2/obj/mipsel_ap/mips.mipsel/usr/home/mike/omega2/src/sys/MT7628_FDT
mips
gcc version 4.2.1 20070831 patched [FreeBSD]
Preloaded elf kernel "kernel" at 0x8046e160.
real memory = 134217728 (131072K bytes)
Physical memory chunk(s):
0x0050f000 - 0x07d9ffff, 126423040 bytes (30865 pages)
avail memory = 125616128 (119MB)
arc4random: no preloaded entropy cache
ULE: setup cpu 0
random: entropy device external interface
mem: <memory>
null: <full device, null device, zero device>
openfirm: <Open Firmware control device>
nexus0: <MIPS32 root nexus>
random: harvesting attach, 8 bytes (4 bits) from nexus0
ofwbus0: <Open Firmware Device Tree> on nexus0
palmbus0: <MTK Palmbus> mem 0x10000000-0x101fffff on ofwbus0
simplebus0: <Flattened device tree simple bus> mem 0x600-0x6ff irq 10 on
palmbus0
random: harvesting attach, 8 bytes (4 bits) from simplebus0
random: harvesting attach, 8 bytes (4 bits) from palmbus0
random: harvesting attach, 8 bytes (4 bits) from ofwbus0
cpupic0: <MIPS32 Interrupt Controller> on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from cpupic0
sysc0: <MTK System Controller> mem 0-0xff on palmbus0
random: harvesting attach, 8 bytes (4 bits) from sysc0
pinctrl0: <MTK Pin Controller> on ofwbus0
pinctrl0: GPIO mode start: 0x54054404
Processing 1 pin-config node(s) in pinctrl-0 for i2c at 900
Processing 2 pin-config node(s) in pinctrl-0 for spi at b00
Processing 1 pin-config node(s) in pinctrl-0 for uartlite at c00
Processing 1 pin-config node(s) in pinctrl-0 for uart1 at d00
Processing 1 pin-config node(s) in pinctrl-0 for uart2 at e00
Processing 2 pin-config node(s) in pinctrl-0 for pwm at 5000
Processing 1 pin-config node(s) in pinctrl-0 for pinctrl
Processing 1 pin-config node(s) in pinctrl-0 for sdhci at 10130000
pinctrl0: GPIO mode end : 0x50054044
random: harvesting attach, 8 bytes (4 bits) from pinctrl0
rstctrl0: <MTK Reset Controller> on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from rstctrl0
clkctrl0: <MTK Clock Controller> on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from clkctrl0
intc0: <MTK Interrupt Controller (v2)> mem 0x200-0x2ff irq 8 on palmbus0
random: harvesting attach, 8 bytes (4 bits) from intc0
gpio0: <MTK GPIO Controller (v2)> mem 0-0xff irq 17 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
random: harvesting attach, 8 bytes (4 bits) from gpiobus0
random: harvesting attach, 8 bytes (4 bits) from gpio0
gpio1: <MTK GPIO Controller (v2)> mem 0-0xff irq 18 on simplebus0
gpiobus1: <OFW GPIO bus> on gpio1
random: harvesting attach, 8 bytes (4 bits) from gpiobus1
random: harvesting attach, 8 bytes (4 bits) from gpio1
gpio2: <MTK GPIO Controller (v2)> mem 0-0xff irq 19 on simplebus0
gpiobus2: <OFW GPIO bus> on gpio2
random: harvesting attach, 8 bytes (4 bits) from gpiobus2
random: harvesting attach, 8 bytes (4 bits) from gpio2
cpulist0: <Open Firmware CPU Group> on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from cpulist0
palmbus0: <watchdog at 120> mem 0x120-0x12f irq 7 compat
ralink,mt7628an-wdt (no driver attached)
palmbus0: <memc at 300> mem 0x300-0x3ff irq 9 compat ralink,mt7620a-memc
(no driver attached)
gpioc0: <GPIO controller> on gpio0
random: harvesting attach, 8 bytes (4 bits) from gpioc0
gpioc1: <GPIO controller> on gpio1
random: harvesting attach, 8 bytes (4 bits) from gpioc1
gpioc2: <GPIO controller> on gpio2
random: harvesting attach, 8 bytes (4 bits) from gpioc2
palmbus0: <i2c at 900> mem 0x900-0x9ff compat mediatek,mt7628-i2c (no
driver attached)
palmbus0: <i2s at a00> mem 0xa00-0xaff irq 11 disabled compat
ralink,mt7620a-i2s (no driver attached)
spi0: <MTK SPI Controller (v2)> mem 0xb00-0xbff on palmbus0
spibus0: <OFW SPI bus> on spi0
mx25l0: <M25Pxx Flash Family> at cs 0 mode 0 on spibus0
mx25l0: mx25ll256, sector 65536 bytes, 512 sectors
random: harvesting attach, 8 bytes (4 bits) from mx25l0
spibus0: <unknown card> at cs 1 mode 0
random: harvesting attach, 8 bytes (4 bits) from spibus0
random: harvesting attach, 8 bytes (4 bits) from spi0
uart0: <Non-standard ns8250 class UART with FIFOs> mem 0xc00-0xcff irq
12 on palmbus0
uart0: console (119047,n,8,1)
uart0: fast interrupt
uart0: PPS capture mode: DCD
random: harvesting attach, 8 bytes (4 bits) from uart0
uart1: <Non-standard ns8250 class UART with FIFOs> mem 0xd00-0xdff irq
13 on palmbus0
uart1: fast interrupt
uart1: PPS capture mode: DCD
random: harvesting attach, 8 bytes (4 bits) from uart1
uart2: <Non-standard ns8250 class UART with FIFOs> mem 0xe00-0xeff irq
14 on palmbus0
uart2: fast interrupt
uart2: PPS capture mode: DCD
random: harvesting attach, 8 bytes (4 bits) from uart2
palmbus0: <pwm at 5000> mem 0x5000-0x5fff compat mediatek,mt7628-pwm (no
driver attached)
palmbus0: <pcm at 2000> mem 0x2000-0x27ff irq 15 disabled compat
ralink,mt7620a-pcm (no driver attached)
palmbus0: <gdma at 2800> mem 0x2800-0x2fff irq 16 compat
ralink,mt7620a-gdma (no driver attached)
usbphy0: <MTK USB PHY> mem 0x10120000-0x10123fff on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from usbphy0
ofwbus0: <sdhci at 10130000> mem 0x10130000-0x10133fff irq 0 compat
ralink,mt7620-sdhci (no driver attached)
ehci0: <MTK USB 2.0 Controller> mem 0x101c0000-0x101c0fff irq 1 on ofwbus0
usbus0: EHCI version 1.0
usbus0 on ehci0
ehci0: usbpf: Attached
random: harvesting attach, 8 bytes (4 bits) from usbus0
random: harvesting attach, 8 bytes (4 bits) from ehci0
ohci0: <MTK USB Controller> mem 0x101c1000-0x101c1fff irq 2 on ofwbus0
usbus1 on ohci0
ohci0: usbpf: Attached
random: harvesting attach, 8 bytes (4 bits) from usbus1
random: harvesting attach, 8 bytes (4 bits) from ohci0
rt0: <Ralink RT5350 onChip Ethernet driver> mem 0x10100000-0x1010ffff
irq 3 on ofwbus0
rt0: RT5350 Ethernet MAC (rev 0x00000000)
rt0: use hardcoded 00:18:e7:d5:83:90 macaddr
rt0: bpf attached
rt0: Ethernet address: 00:18:e7:d5:83:90
random: harvesting attach, 8 bytes (4 bits) from rt0
mtkswitch0: <MTK Switch Driver> mem 0x10110000-0x10117fff irq 4 on ofwbus0
miibus0: <MII bus> on mtkswitch0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0: OUI 0x0017a5, model 0x0001, rev. 0
ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
random: harvesting attach, 8 bytes (4 bits) from ukphy0
random: harvesting attach, 8 bytes (4 bits) from miibus0
miibus1: <MII bus> on mtkswitch0
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus1
ukphy1: OUI 0x0017a5, model 0x0001, rev. 0
ukphy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
random: harvesting attach, 8 bytes (4 bits) from ukphy1
random: harvesting attach, 8 bytes (4 bits) from miibus1
miibus2: <MII bus> on mtkswitch0
ukphy2: <Generic IEEE 802.3u media interface> PHY 2 on miibus2
ukphy2: OUI 0x0017a5, model 0x0001, rev. 0
ukphy2: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
random: harvesting attach, 8 bytes (4 bits) from ukphy2
random: harvesting attach, 8 bytes (4 bits) from miibus2
miibus3: <MII bus> on mtkswitch0
ukphy3: <Generic IEEE 802.3u media interface> PHY 3 on miibus3
ukphy3: OUI 0x0017a5, model 0x0001, rev. 0
ukphy3: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
random: harvesting attach, 8 bytes (4 bits) from ukphy3
random: harvesting attach, 8 bytes (4 bits) from miibus3
miibus4: <MII bus> on mtkswitch0
ukphy4: <Generic IEEE 802.3u media interface> PHY 4 on miibus4
ukphy4: OUI 0x0017a5, model 0x0001, rev. 0
ukphy4: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
random: harvesting attach, 8 bytes (4 bits) from ukphy4
random: harvesting attach, 8 bytes (4 bits) from miibus4
etherswitch0: <Switch controller> on mtkswitch0
random: harvesting attach, 8 bytes (4 bits) from etherswitch0
mdio0: <MDIO> on mtkswitch0
random: harvesting attach, 8 bytes (4 bits) from mdio0
random: harvesting attach, 8 bytes (4 bits) from mtkswitch0
ofwbus0: <pcie at 10140000> mem 0x10140000-0x1014ffff irq 5 disabled type
pci compat mediatek,mt7628-pci (no driver attached)
ofwbus0: <wmac at 10300000> mem 0x10300000-0x103fffff irq 6 compat
mediatek,mt7628-wmac (no driver attached)
gpioled0: <GPIO LEDs> on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from gpioled0
ofwbus0: <gpio-keys-polled> compat gpio-keys-polled (no driver attached)
clock0: <Generic MIPS32 ticker> on nexus0
Timecounter "MIPS32" frequency 290000000 Hz quality 800
Event timer "MIPS32" frequency 290000000 Hz quality 800
random: harvesting attach, 8 bytes (4 bits) from clock0
Device configuration finished.
Timecounters tick every 10.000 msec
lo0: bpf attached
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 2048
mtkswitch0port0: link state changed to DOWN
mtkswitch0port1: link state changed to DOWN
mtkswitch0port2: link state changed to DOWN
mtkswitch0port3: link state changed to DOWN
mtkswitch0port4: link state changed to DOWN
GEOM: new disk flash/spi0
usbus0: 480Mbps High Speed USB v2.0
usbus1: 12Mbps Full Speed USB v1.0
flash/spi0: slice 00000000-0002ffff: u-boot (191KB)
flash/spi0: slice 00030000-0003ffff: u-boot-env (63KB)
flash/spi0: slice 00040000-0004ffff: factory (63KB)
flash/spi0: slice 00050000-01ffffff: firmware (32447KB)
ugen1.1: <MediaTek OHCI root HUB> at usbus1
uhub0: <MediaTek OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen0.1: <MediaTek EHCI root HUB> at usbus0
uhub1: <MediaTek EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
Trying to mount root from ufs:md0.uzip []...
Root mount waiting for: usbus1 usbus0
uhub0: 1 port with 1 removable, self powered
random: harvesting attach, 8 bytes (4 bits) from uhub0
uhub1: 1 port with 1 removable, self powered
random: harvesting attach, 8 bytes (4 bits) from uhub1
Root mount waiting for: usbus1
ugen1.2: <JetFlash Mass Storage Device> at usbus1
umass0 on uhub0
umass0: <JetFlash Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2>
on usbus1
umass0:0:0: Attached to scbus0
random: harvesting attach, 8 bytes (4 bits) from umass0
mountroot: waiting for device md0.uzip...
pass0 at umass-sim0 bus 0 scbus0 target 0 lun 0
pass0: <JetFlash Transcend 4GB 8.07> Removable Direct Access SPC-2 SCSI
device
pass0: Serial Number QVHLQ8BR
pass0: 1.000MB/s transfers
GEOM: new disk da0
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <JetFlash Transcend 4GB 8.07> Removable Direct Access SPC-2 SCSI device
da0: Serial Number QVHLQ8BR
da0: 1.000MB/s transfers
da0: 3840MB (7864320 512 byte sectors)
da0: quirks=0x12<NO_6_BYTE,NO_RC16>
da0: Delete methods: <NONE(*),ZERO>
Mounting from ufs:md0.uzip failed with error 19.
Loader variables:
Manual root filesystem specification:
<fstype>:<device> [options]
Mount <device> using filesystem <fstype>
and with the specified (optional) option list.
eg. ufs:/dev/da0s1a
zfs:tank
cd9660:/dev/cd0 ro
(which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)
? List valid disk boot devices
. Yield 1 second (for background tasks)
<empty line> Abort manual input
mountroot> ufs:/dev/da0s1
Trying to mount root from ufs:/dev/da0s1 []...
warning: no time-of-day clock registered, system time will not be set
accurately
start_init: trying /sbin/init
May 11 22:07:41 init: login_getclass: unknown class 'daemon'
*** Mounting /tmp, /var, /etc ...
random: unblocking device.
*** Copying /c/etc -> /etc ...
*** Starting rc2 ...
*** Populating /var ..
*** Loading configuration files ..
*** Restoring from ..
dd: no value specified for if
gunzip: (stdin): unexpected end of file
0 blocks
*** Completed.
*** setting up hostname
*** Load kernel modules
.. bridgestp
kldload: can't load bridgestp: module already loaded or in kernel
.. if_bridge
kldload: can't load if_bridge: No such file or directory
.. random
kldload: can't load random: No such file or directory
*** Setting kern.random.harvest.mask=511
kern.random.harvest.mask: 2047 -> 511
*** bringing up loopback ..
*** Default password/login databases ..
*** Customising sysctl ..
*** Starting networking via /etc/rc.d/base/net
*** Interface: rt0: start
*** Interface: rt0: done
*** Interface: bridge0: start
bridge0: bpf attached
bridge0: Ethernet address: 7e:a3:34:4f:fe:33
rt0: entering promiscuous mode
rt0: promiscuous mode enabled
bridge0: link state changed to UP
*** Interface: bridge0: done
ipfw: setsockopt(IP_FW_XDEL): Protocol not available
*** Done!
FreeBSD/mips (freebsd-wifi) (ttyu0)
login: root
#
# vmstat
procs memory page disks faults cpu
r b w avm fre flt re pi po fr sr fl0 md0 in sy cs us
sy id
0 0 0 49M 103M 52 0 1 0 34 1 0 0 37 3759 93
1 6 94
#
# devinfo
nexus0
ofwbus0
cpulist0
cpupic0
palmbus0
sysc0
intc0
simplebus0
gpio0
gpiobus0
gpioc0
gpio1
gpiobus1
gpioc1
gpio2
gpiobus2
gpioc2
spi0
spibus0
mx25l0
uart0
uart1
uart2
pinctrl0
rstctrl0
clkctrl0
usbphy0
ehci0
usbus0
uhub1
ohci0
usbus1
uhub0
umass0
rt0
mtkswitch0
miibus0
ukphy0
miibus1
ukphy1
miibus2
ukphy2
miibus3
ukphy3
miibus4
ukphy4
etherswitch0
mdio0
gpioled0
clock0
#
On 11/05/2017 20:28, Aleksandr Rybalko wrote:
> IIRC ubnt-mkfwimage/mkfwimage is for those boards which follow Atheros
> rules about packing
> firmware. Not all makers even for Qualcom/Atheros based boards use
> tool like that.
> But you have Mediatek chip (based on old Ralink).
>
> I see you a bit confused with all that. Will try to explain.
>
> You trying to boot machine without flashing anything into onboard NOR
> flash. For that case you can mount from RAM or external source.
> RAM - mfsroot (memory file system).
> External - USB Flash, USB card-reader(SD/MMC/CF/etc) or network(NFS).
> I see USB works fine, and even some drive attached (da0).
> NFS is fine if network have no problems. I see drivers attached, but
> dunno if kernel really can pass traffic out.
>
> So w/o modify internal flash, you have 3 ways MFS, USB drive and NFS.
> * For MFS you need to pack FS into image and compile kernel with
> rootfs pointed into MFS image from memory.
> * For USB drive you have to create simple UFS partition and put MIPS
> binaries you compiled for rootfs. And recompile kernel with rootfs
> pointed into that partition on da0 you have (or you can try to specify
> ufs:/dev/da0s1a on command prompt when kernel can't find rootfs).
> * For NFS you have to setup NFS export with you MIPS rootfs data, and
> recompile kernel with rootfs on NFS.
>
> About flashing image into internal flash, later :-D
>
>
>
> 2017-05-11 20:19 GMT+03:00 Mike Wolman <mike at wolman.co.uk
> <mailto:mike at wolman.co.uk>>:
>
>
> Quick update on where I am with this - basically still trying to
> join the kernel and root fs so the kernel can find a root
> filesystem when boots.
>
> I have tried various ways to combine the kernel and fs image file
> but am not getting much further.
>
> I saw in
> https://github.com/freebsd/freebsd-wifi-build/blob/master/build/bin/build_ubnt
> <https://github.com/freebsd/freebsd-wifi-build/blob/master/build/bin/build_ubnt>
> uses mkfwimage
>
> so also tried that by editing
> ../freebsd-wifi-build/programs/ubnt-mkfwimage/mkfwimage.c:
>
>
> {
> .name = "OMEGA2P",
> .kern_start = 0x80001100,
> .kern_entry = 0x80001100,
> .firmware_max_length= 0x00B00000,
> },
>
>
> This seems to make the image ok:
>
> [mike at f64-current ~/omega2/tftpboot]$
> ../freebsd-wifi-build/programs/ubnt-mkfwimage/mkfwimage -B OMEGA2P
> -v "2" -k kernel.MT7628_FDT.lzma.uImage -r
> /home/mike/omega2/tftpboot/mfsroot-ralink.img.lzma -C 65536 -c
> ../cfgfs-ralink.img -o MT7628_FDT.initial.img
> board = OMEGA2P
> kernel: 1144975 bytes (base 0x80001100)
> rootfs: 10834 bytes
> cfgfs: 65536 bytes
> total: (1221345 bytes)
> root: 10323825 0x8011898f
> cfg: 65536 0x80af1100
> Firmware version: '2'
> Output file: 'MT7628_FDT.initial.img'
> Part count: 3
> kernel: 1144975 bytes (free: 0)
> rootfs: 10834 bytes (free: 10312991)
> cfg: 65536 bytes (free: 0)
> [mike at f64-current ~/omega2/tftpboot]$
>
>
> But this doesnt boot:
>
> Omega2 # fatload usb 0:1 0x80800000 MT7628_FDT.initial.img
> *
> *
> Reading file "MT7628_FDT.initial.img"
> *
> **
> **
> ******
> ***************************************************************************************************************************
> **
> *
> FAT: 1221817 Bytes read
> Omega2 # bootm 0x80800000
> ## Booting image at 80800000 ...
> Bad Magic Number,4F50454E
> Omega2 #
>
>
> I have followed section 8 in
> https://github.com/freebsd/freebsd-wifi-build/blob/master/build/README.user-build
> <https://github.com/freebsd/freebsd-wifi-build/blob/master/build/README.user-build>
>
> with various changes but none seem to get past the kernel booting
> and stopping when it cannot find the root.
>
> One thing in this document I was unsure of is: "assuming that
> 2MByte is allocated to the kernel"
>
> I see nowhere which then indicates to the kernel that the uzip
> filesystem resides past that point in memory so am still confused
> as to how the kernel knows where to find the uzip image file for
> geom to deal with and then finally mount.
>
>
>
> On 11/05/2017 12:32, Aleksandr Rybalko wrote:
>> BTW, Mike, join us on IRC in EFNet network, channel #bsdmips.
>> There is a lot of guys who able to help.
>>
>> 2017-05-11 3:24 GMT+03:00 Mike Wolman <mike at wolman.co.uk
>> <mailto:mike at wolman.co.uk>>:
>>
>>
>> I have re-read this thread (a few times) and redone a kernel
>> now have managed to get u-boot stuff going, calling it a
>> night but I think other than the compression bits I think the
>> rest build stuff should be straight forward and just a matter
>> of sorting out the root filesystem stuff.
>>
>> One thing I dont get is why it seems to be ok booting up
>> without debugging stuff enabled but when turned on it panics
>> but will have another look as maybe it was where I was
>> loading the image file into memory from?
>>
>> Not sure about the flashing of the on board memory and may
>> get a second one as a backup before i attempt that. I
>> wouldnt mind some input on that side of things once I have a
>> image file ready to go as Im not too keen on bricking the device.
>>
>> Thanks again for everyones input, I will do some testing
>> once logged in as a user and see how it goes as a wifi
>> extender and simpler router before having a go with the
>> gpio/spi/iic stuff.
>>
>> Mike.
>>
>>
>> Testing BULK mode...Identifying a storage device...*
>> USB_STORAGE: 1 Storage Device(s) found
>> Omega2 # fatload usb 0:1 0x80800000 kernel.MT7628_FDT.uImage
>> *
>> *
>> Reading file "kernel.MT7628_FDT.uImage"
>> *
>> **
>> ******
>> ******
>> *******************************************************************************************************************************************************************************************
>> ****
>> *
>> FAT: 4491512 Bytes read
>> Omega2 # bootm 0x80800000
>> ## Booting image at 80800000 ...
>> Image Name: FreeBSD
>> Image Type: MIPS Linux Kernel Image (uncompressed)
>> Data Size: 4491448 Bytes = 4.3 MB
>> Load Address: 80001100
>> Entry Point: 80001100
>> Verifying Checksum ... OK
>> OK
>> No initrd
>> ## Transferring control to Linux (at address 80001100) ...
>> ## Giving linux memsize in MB, 128
>>
>> Starting kernel ...
>>
>> FDT DTB at: 0x804133c0
>> CPU clock: 580MHz
>> Timer clock: 290MHz
>> UART clock: 40MHz
>>
>> U-Boot args (from 0 args):
>> None
>> Environment:
>> memsize=128
>> initrd_start=0x00000000
>> initrd_size=0x0
>> flash_start=0x00000000
>> flash_size=0x2000000
>> entry: mips_init()
>> RAM size: 128MB (from FDT)
>> Cache info:
>> picache_stride = 4096
>> picache_loopcount = 16
>> pdcache_stride = 4096
>> pdcache_loopcount = 8
>> max line size = 32
>> cpu0: MIPS Technologies processor v85.150
>> MMU: Standard TLB, 32 entries (4K 16K 64K 256K 1M 16M 64M
>> 256M pg sizes)
>> L1 i-cache: 4 ways of 512 sets, 32 bytes per line
>> L1 d-cache: 4 ways of 256 sets, 32 bytes per line
>> L2 cache: disabled
>> Config1=0xbee3519e<PerfCount,WatchRegs,MIPS16,EJTAG>
>> Config2=0x80000000
>> Config3=0x2420<ULRI>
>> Config7=0x80010400<WII,AR>
>> Physical memory chunk(s):
>> 0x47b000 - 0x7ffffff, 129519616 bytes (31621 pages)
>> Maxmem is 0x8000000
>> KDB: debugger backends: ddb
>> KDB: current backend: ddb
>> Copyright (c) 1992-2017 The FreeBSD Project.
>> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992,
>> 1993, 1994
>> The Regents of the University of California. All
>> rights reserved.
>> FreeBSD is a registered trademark of The FreeBSD Foundation.
>> FreeBSD 12.0-CURRENT #0 r317887M: Wed May 10 20:49:10 UTC 2017
>> mike at f64-current.mw.office:/us
>> <mailto:mike at f64-current.mw.office:/us>r/home/mike/omega2/obj/mipsel_ap/mips.mipsel/usr/home/mike/omega2/src/sys/MT7628_FDT
>> mips
>> gcc version 4.2.1 20070831 patched [FreeBSD]
>> Preloaded elf kernel "kernel" at 0x8046e160.
>> real memory = 134217728 (131072K bytes)
>> Physical memory chunk(s):
>> 0x0050f000 - 0x07d9ffff, 126423040 bytes (30865 pages)
>> avail memory = 125616128 (119MB)
>> arc4random: no preloaded entropy cache
>> ULE: setup cpu 0
>> random: entropy device external interface
>> mem: <memory>
>> null: <full device, null device, zero device>
>> openfirm: <Open Firmware control device>
>> nexus0: <MIPS32 root nexus>
>> random: harvesting attach, 8 bytes (4 bits) from nexus0
>> ofwbus0: <Open Firmware Device Tree> on nexus0
>> palmbus0: <MTK Palmbus> mem 0x10000000-0x101fffff on ofwbus0
>> simplebus0: <Flattened device tree simple bus> mem
>> 0x600-0x6ff irq 10 on palmbus0
>> random: harvesting attach, 8 bytes (4 bits) from simplebus0
>> random: harvesting attach, 8 bytes (4 bits) from palmbus0
>> random: harvesting attach, 8 bytes (4 bits) from ofwbus0
>> cpupic0: <MIPS32 Interrupt Controller> on ofwbus0
>> random: harvesting attach, 8 bytes (4 bits) from cpupic0
>> sysc0: <MTK System Controller> mem 0-0xff on palmbus0
>> random: harvesting attach, 8 bytes (4 bits) from sysc0
>> pinctrl0: <MTK Pin Controller> on ofwbus0
>> pinctrl0: GPIO mode start: 0x54054404
>> Processing 1 pin-config node(s) in pinctrl-0 for i2c at 900
>> Processing 2 pin-config node(s) in pinctrl-0 for spi at b00
>> Processing 1 pin-config node(s) in pinctrl-0 for uartlite at c00
>> Processing 1 pin-config node(s) in pinctrl-0 for uart1 at d00
>> Processing 1 pin-config node(s) in pinctrl-0 for uart2 at e00
>> Processing 2 pin-config node(s) in pinctrl-0 for pwm at 5000
>> Processing 1 pin-config node(s) in pinctrl-0 for pinctrl
>> Processing 1 pin-config node(s) in pinctrl-0 for sdhci at 10130000
>> pinctrl0: GPIO mode end : 0x50054044
>> random: harvesting attach, 8 bytes (4 bits) from pinctrl0
>> rstctrl0: <MTK Reset Controller> on ofwbus0
>> random: harvesting attach, 8 bytes (4 bits) from rstctrl0
>> clkctrl0: <MTK Clock Controller> on ofwbus0
>> random: harvesting attach, 8 bytes (4 bits) from clkctrl0
>> intc0: <MTK Interrupt Controller (v2)> mem 0x200-0x2ff irq 8
>> on palmbus0
>> random: harvesting attach, 8 bytes (4 bits) from intc0
>> gpio0: <MTK GPIO Controller (v2)> mem 0-0xff irq 17 on simplebus0
>> gpiobus0: <OFW GPIO bus> on gpio0
>> random: harvesting attach, 8 bytes (4 bits) from gpiobus0
>> random: harvesting attach, 8 bytes (4 bits) from gpio0
>> gpio1: <MTK GPIO Controller (v2)> mem 0-0xff irq 18 on simplebus0
>> gpiobus1: <OFW GPIO bus> on gpio1
>> random: harvesting attach, 8 bytes (4 bits) from gpiobus1
>> random: harvesting attach, 8 bytes (4 bits) from gpio1
>> gpio2: <MTK GPIO Controller (v2)> mem 0-0xff irq 19 on simplebus0
>> gpiobus2: <OFW GPIO bus> on gpio2
>> random: harvesting attach, 8 bytes (4 bits) from gpiobus2
>> random: harvesting attach, 8 bytes (4 bits) from gpio2
>> cpulist0: <Open Firmware CPU Group> on ofwbus0
>> random: harvesting attach, 8 bytes (4 bits) from cpulist0
>> palmbus0: <watchdog at 120> mem 0x120-0x12f irq 7 compat
>> ralink,mt7628an-wdt (no driver attached)
>> palmbus0: <memc at 300> mem 0x300-0x3ff irq 9 compat
>> ralink,mt7620a-memc (no driver attached)
>> gpioc0: <GPIO controller> on gpio0
>> random: harvesting attach, 8 bytes (4 bits) from gpioc0
>> gpioc1: <GPIO controller> on gpio1
>> random: harvesting attach, 8 bytes (4 bits) from gpioc1
>> gpioc2: <GPIO controller> on gpio2
>> random: harvesting attach, 8 bytes (4 bits) from gpioc2
>> palmbus0: <i2c at 900> mem 0x900-0x9ff compat
>> mediatek,mt7628-i2c (no driver attached)
>> palmbus0: <i2s at a00> mem 0xa00-0xaff irq 11 disabled compat
>> ralink,mt7620a-i2s (no driver attached)
>> spi0: <MTK SPI Controller (v2)> mem 0xb00-0xbff on palmbus0
>> spibus0: <OFW SPI bus> on spi0
>> mx25l0: <M25Pxx Flash Family> at cs 0 mode 0 on spibus0
>> mx25l0: mx25ll256, sector 65536 bytes, 512 sectors
>> random: harvesting attach, 8 bytes (4 bits) from mx25l0
>> spibus0: <unknown card> at cs 1 mode 0
>> random: harvesting attach, 8 bytes (4 bits) from spibus0
>> random: harvesting attach, 8 bytes (4 bits) from spi0
>> uart0: <Non-standard ns8250 class UART with FIFOs> mem
>> 0xc00-0xcff irq 12 on palmbus0
>> uart0: console (119047,n,8,1)
>> uart0: fast interrupt
>> uart0: PPS capture mode: DCD
>> random: harvesting attach, 8 bytes (4 bits) from uart0
>> uart1: <Non-standard ns8250 class UART with FIFOs> mem
>> 0xd00-0xdff irq 13 on palmbus0
>> uart1: fast interrupt
>> uart1: PPS capture mode: DCD
>> random: harvesting attach, 8 bytes (4 bits) from uart1
>> uart2: <Non-standard ns8250 class UART with FIFOs> mem
>> 0xe00-0xeff irq 14 on palmbus0
>> uart2: fast interrupt
>> uart2: PPS capture mode: DCD
>> random: harvesting attach, 8 bytes (4 bits) from uart2
>> palmbus0: <pwm at 5000> mem 0x5000-0x5fff compat
>> mediatek,mt7628-pwm (no driver attached)
>> palmbus0: <pcm at 2000> mem 0x2000-0x27ff irq 15 disabled compat
>> ralink,mt7620a-pcm (no driver attached)
>> palmbus0: <gdma at 2800> mem 0x2800-0x2fff irq 16 compat
>> ralink,mt7620a-gdma (no driver attached)
>> usbphy0: <MTK USB PHY> mem 0x10120000-0x10123fff on ofwbus0
>> random: harvesting attach, 8 bytes (4 bits) from usbphy0
>> ofwbus0: <sdhci at 10130000> mem 0x10130000-0x10133fff irq 0
>> compat ralink,mt7620-sdhci (no driver attached)
>> ehci0: <MTK USB 2.0 Controller> mem 0x101c0000-0x101c0fff irq
>> 1 on ofwbus0
>> usbus0: EHCI version 1.0
>> usbus0 on ehci0
>> ehci0: usbpf: Attached
>> random: harvesting attach, 8 bytes (4 bits) from usbus0
>> random: harvesting attach, 8 bytes (4 bits) from ehci0
>> ohci0: <MTK USB Controller> mem 0x101c1000-0x101c1fff irq 2
>> on ofwbus0
>> usbus1 on ohci0
>> ohci0: usbpf: Attached
>> random: harvesting attach, 8 bytes (4 bits) from usbus1
>> random: harvesting attach, 8 bytes (4 bits) from ohci0
>> rt0: <Ralink RT5350 onChip Ethernet driver> mem
>> 0x10100000-0x1010ffff irq 3 on ofwbus0
>> rt0: RT5350 Ethernet MAC (rev 0x00000000)
>> rt0: use hardcoded 00:18:e7:d5:83:90 macaddr
>> rt0: bpf attached
>> rt0: Ethernet address: 00:18:e7:d5:83:90
>> random: harvesting attach, 8 bytes (4 bits) from rt0
>> mtkswitch0: <MTK Switch Driver> mem 0x10110000-0x10117fff irq
>> 4 on ofwbus0
>> miibus0: <MII bus> on mtkswitch0
>> ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
>> ukphy0: OUI 0x0017a5, model 0x0001, rev. 0
>> ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX,
>> 100baseTX-FDX, auto
>> random: harvesting attach, 8 bytes (4 bits) from ukphy0
>> random: harvesting attach, 8 bytes (4 bits) from miibus0
>> miibus1: <MII bus> on mtkswitch0
>> ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus1
>> ukphy1: OUI 0x0017a5, model 0x0001, rev. 0
>> ukphy1: none, 10baseT, 10baseT-FDX, 100baseTX,
>> 100baseTX-FDX, auto
>> random: harvesting attach, 8 bytes (4 bits) from ukphy1
>> random: harvesting attach, 8 bytes (4 bits) from miibus1
>> miibus2: <MII bus> on mtkswitch0
>> ukphy2: <Generic IEEE 802.3u media interface> PHY 2 on miibus2
>> ukphy2: OUI 0x0017a5, model 0x0001, rev. 0
>> ukphy2: none, 10baseT, 10baseT-FDX, 100baseTX,
>> 100baseTX-FDX, auto
>> random: harvesting attach, 8 bytes (4 bits) from ukphy2
>> random: harvesting attach, 8 bytes (4 bits) from miibus2
>> miibus3: <MII bus> on mtkswitch0
>> ukphy3: <Generic IEEE 802.3u media interface> PHY 3 on miibus3
>> ukphy3: OUI 0x0017a5, model 0x0001, rev. 0
>> ukphy3: none, 10baseT, 10baseT-FDX, 100baseTX,
>> 100baseTX-FDX, auto
>> random: harvesting attach, 8 bytes (4 bits) from ukphy3
>> random: harvesting attach, 8 bytes (4 bits) from miibus3
>> miibus4: <MII bus> on mtkswitch0
>> ukphy4: <Generic IEEE 802.3u media interface> PHY 4 on miibus4
>> ukphy4: OUI 0x0017a5, model 0x0001, rev. 0
>> ukphy4: none, 10baseT, 10baseT-FDX, 100baseTX,
>> 100baseTX-FDX, auto
>> random: harvesting attach, 8 bytes (4 bits) from ukphy4
>> random: harvesting attach, 8 bytes (4 bits) from miibus4
>> etherswitch0: <Switch controller> on mtkswitch0
>> random: harvesting attach, 8 bytes (4 bits) from etherswitch0
>> mdio0: <MDIO> on mtkswitch0
>> random: harvesting attach, 8 bytes (4 bits) from mdio0
>> random: harvesting attach, 8 bytes (4 bits) from mtkswitch0
>> ofwbus0: <pcie at 10140000> mem 0x10140000-0x1014ffff irq 5
>> disabled type pci compat mediatek,mt7628-pci (no driver attached)
>> ofwbus0: <wmac at 10300000> mem 0x10300000-0x103fffff irq 6
>> compat mediatek,mt7628-wmac (no driver attached)
>> gpioled0: <GPIO LEDs> on ofwbus0
>> random: harvesting attach, 8 bytes (4 bits) from gpioled0
>> ofwbus0: <gpio-keys-polled> compat gpio-keys-polled (no
>> driver attached)
>> clock0: <Generic MIPS32 ticker> on nexus0
>> Timecounter "MIPS32" frequency 290000000 Hz quality 800
>> Event timer "MIPS32" frequency 290000000 Hz quality 800
>> random: harvesting attach, 8 bytes (4 bits) from clock0
>> Device configuration finished.
>> Timecounters tick every 10.000 msec
>> lo0: bpf attached
>> tcp_init: net.inet.tcp.tcbhashsize auto tuned to 2048
>> mtkswitch0port0: link state changed to DOWN
>> mtkswitch0port1: link state changed to DOWN
>> mtkswitch0port2: link state changed to DOWN
>> mtkswitch0port3: link state changed to DOWN
>> mtkswitch0port4: link state changed to DOWN
>> GEOM: new disk flash/spi0
>> usbus0: 480Mbps High Speed USB v2.0
>> usbus1: 12Mbps Full Speed USB v1.0
>> flash/spi0: slice 00000000-0002ffff: u-boot (191KB)
>> flash/spi0: slice 00030000-0003ffff: u-boot-env (63KB)
>> flash/spi0: slice 00040000-0004ffff: factory (63KB)
>> flash/spi0: slice 00050000-01ffffff: firmware (32447KB)
>> ugen1.1: <MediaTek OHCI root HUB> at usbus1
>> uhub0: <MediaTek OHCI root HUB, class 9/0, rev 1.00/1.00,
>> addr 1> on usbus1
>> ugen0.1: <MediaTek EHCI root HUB> at usbus0
>> uhub1: <MediaTek EHCI root HUB, class 9/0, rev 2.00/1.00,
>> addr 1> on usbus0
>> Trying to mount root from ufs:md0.uzip []...
>> Root mount waiting for: usbus1 usbus0
>> uhub0: 1 port with 1 removable, self powered
>> random: harvesting attach, 8 bytes (4 bits) from uhub0
>> uhub1: 1 port with 1 removable, self powered
>> random: harvesting attach, 8 bytes (4 bits) from uhub1
>> ugen1.2: <vendor 0x1005 USB Flash Drive> at usbus1
>> umass0 on uhub0
>> umass0: <vendor 0x1005 USB Flash Drive, class 0/0, rev
>> 2.00/1.00, addr 2> on usbus1
>> umass0:0:0: Attached to scbus0
>> random: harvesting attach, 8 bytes (4 bits) from umass0
>> mountroot: waiting for device md0.uzip...
>> (probe0:umass-sim0:0:0:0): Down reving Protocol Version from
>> 2 to 0?
>> pass0 at umass-sim0 bus 0 scbus0 target 0 lun 0
>> pass0: <USB Flash Drive 2.04> Removable Direct Access SCSI device
>> pass0: Serial Number 070B00012340350
>> pass0: 1.000MB/s transfers
>> GEOM: new disk da0
>> da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
>> da0: <USB Flash Drive 2.04> Removable Direct Access SCSI device
>> da0: Serial Number 070B00012340350
>> da0: 1.000MB/s transfers
>> da0: 495MB (1015805 512 byte sectors)
>> da0: quirks=0x2<NO_6_BYTE>
>> da0: Delete methods: <NONE(*),ZERO>
>> (da0:umass-sim0:0:0:0): PREVENT ALLOW MEDIUM REMOVAL not
>> supported.
>> Mounting from ufs:md0.uzip failed with error 19.
>>
>> Loader variables:
>>
>> Manual root filesystem specification:
>> <fstype>:<device> [options]
>> Mount <device> using filesystem <fstype>
>> and with the specified (optional) option list.
>>
>> eg. ufs:/dev/da0s1a
>> zfs:tank
>> cd9660:/dev/cd0 ro
>> (which is equivalent to: mount -t cd9660 -o ro
>> /dev/cd0 /)
>>
>> ? List valid disk boot devices
>> . Yield 1 second (for background tasks)
>> <empty line> Abort manual input
>>
>> mountroot>
>>
>>
>>
>>
>> --
>> WBW
>> -------
>> Rybalko Aleksandr <ray at ddteam.net <mailto:ray at ddteam.net>>
>>
>
>
>
>
> --
> WBW
> -------
> Rybalko Aleksandr <ray at ddteam.net <mailto:ray at ddteam.net>>
>
More information about the freebsd-mips
mailing list