Welcome! Log In Create A New Profile

Advanced

Debian on Mirabox (Armada 370)

Posted by LeggoMyEggo 
Debian on Mirabox (Armada 370)
November 11, 2017 09:01AM
It's been a while since I have posted, lurked mostly with nothing new to add. Picked up a Globalscale Mirabox cheaply and have tried to load bodhi Debian on it. Not sure what env's to use on the stock u-boot to get Debian-4.12.4-mvebu-tld-1 to boot from the external micro sd slot (mmcblk0).

Globalscale Mirabox specs:
1.2Ghz Marvell Armada CPU ARMADA 370 ARM v7 compliant
802.11b/g/n Wifi with Marvell 88W8787 and Bluetooth 3.0
1GB DDR3
1 GB NAND Flash
2 each 10/100/1000 Ethernet Ports
2 each USB 3.0 host
1 microsd card slot/reader, 1 additional Mini PCIe slot for expansion (internal)
For additional 2x2, 3x3, 4x4 WiFi Radios, or 3G modules
3 LED controlled by GPIO, reset button
external power supply
Port for JTAG and Debugging options

Stock uEnv's:


BootROM 1.08
Booting from SPI flash
DDR3 Training Sequence - Ver 4.4.0
DDR3 Training Sequence - Ended Successfully
Status = MV_OK
BootROM: Image checksum verification PASSED

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_
        | | | |___|  _ \ / _ \ / _ \| __|
        | |_| |___| |_) | (_) | (_) | |_
         \___/    |____/ \___/ \___/ \__|
 ** LOADER **


U-Boot 2009.08 (Jul 15 2015 - 21:57:33)Marvell version: 1.1.2 NQ
U-Boot Addressing:
       Code:            00600000:006AFFF0
       BSS:             006F7240
       Stack:           0x5fff70
       PageTable:       0x8e0000
       Heap address:    0x900000:0xe00000
Board: DB-88F6710-BP
SoC:   MV6710 A1
CPU:   Marvell PJ4B v7 UP (Rev 1) LE
       CPU @ 1200Mhz, L2 @ 600Mhz
       DDR @ 600Mhz, TClock @ 200Mhz
       DDR 16Bit Width, FastPath Memory Access
PEX 0: Detected No Link.
PEX 1: Root Complex Interface, Detected Link X1
DRAM:   1 GB
       CS 0: base 0x00000000 size 512 MB
       CS 1: base 0x20000000 size 512 MB
       Addresses 14M - 0M are saved for the U-Boot usage.
SF: Detected MX25L1605D with page size 256, total 2097152 bytes
FPU not initialized
USB 0: Host Mode
USB 1: Host Mode
Modules/Interfaces Detected:
       RGMII0 Phy
       RGMII1 Phy
       PEX0 (Lane 0)
       SATA0 (Lane 2)
       SATA1 (Lane 3)
MMC:   MRVL_MMC: 0
Net:   egiga0 [PRIME], egiga1
flag =  ff
Hit any key to stop autoboot:  0


Marvell>> printenv
bootdelay=3
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
console=console=ttyS0,115200
sata_delay_reset=0
enaExtDisk=no
MALLOC_len=5
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:10.4.50.254:255.255.255.0:KW40:eth0:none
image_name=uImage
load_addr=0x02000000
standalone=fsload $load_addr $image_name;setenv bootargs $console $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm $load_addr;
ethmtu=1500
eth1mtu=1500
mvNetConfig=mv_net_config=1,(XX:XX:XX:XX:XX:XX,0:1:2:3:4),mtu=1500
usb0Mode=host
usb1Mode=host
usbActive=2
yuk_ethaddr=XX:XX:XX:XX:XX:XX
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
eeeEnable=no
ethact=egiga0
bootcmd=usb start; fatload usb 0 0x6400000 uimage_3.2.36.v9; bootm 0x6400000
ethaddr=XX:XX:XX:XX:XX:XX
eth1addr=XX:XX:XX:XX:XX:XX
stdin=serial
stdout=serial
stderr=serial
enaMonExt=no
pexMode=RC
setL2CacheWT=no
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
realboot=mmcinfo;fatload mmc 0 0x6400000 uImage; bootm 0x6400000
realboot1=run realboot
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
bootargs=console=ttyS0,115200 root=/dev/mtdblock0 rw ip=10.4.50.165:10.4.50.5:10.4.50.254:255.255.255.0:KW40:eth0:none

Environment size: 1255/65532 bytes

The device successfully boots on the stock 3.2.36 Debian Wheezy 4 Gb rootfs which is on a micro-sd card internal on the motherboard and is considered a USB drive (not sure why internal is USB and external is MMC).

Am assuming because of stock u-boot being so old, it does not support separate dtb. Regardless of separate embedded dtb vs separate, not sure what memory areas to load uImage, uInitrd into during boot.

Can anybody provide some guidance as to uEnv's to try? Any help would be appreciated.

LME

--------------------------
Moderator edit: modified thread subject to make it easier to find.

LeggoMyEggo's Google Plus Profile



Edited 3 time(s). Last edit at 03/21/2019 03:28AM by bodhi.
Re: Bodhi Debian on Mirabox
November 11, 2017 03:16PM
LeggoMyEggo,

Good to see you posting again!


> The device successfully boots on the stock 3.2.36
> Debian Wheezy 4 Gb rootfs which is on a micro-sd
> card internal on the motherboard and is considered
> a USB drive (not sure why internal is USB and
> external is MMC).

It is an internal USB card reader.

>
> Am assuming because of stock u-boot being so old,
> it does not support separate dtb. Regardless of
> separate embedded dtb vs separate, not sure what
> memory areas to load uImage, uInitrd into during
> boot.
>

You can boot with Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2 on that SD card. And most likely you need to embed the DTB in uImage (/boot/dts/armada-370-mirabox.dtb).

However, first verify whether they have ported the FDT. At serial consle prompt:

help
fdt

If no FDT capability, try booting with our usual Kirkwood addresses:

load_initrd_addr=0x1100000
load_uimage_addr=0x800000

But looking at the envs. If 0x6400000 is the stock address, there might be a reason, so if the standard addresses above fail to boot, we want to use 0x6400000 as the next try. This box has so much RAM that these addresses could be anywehere :) except for some stock u-boot quirks that we'll see in the boot log when you attempt.
Quote

bootm 0x6400000

The stock bootargs and bootcmd need to be adjusted,

setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv bootcmd 'usb start; ext2load usb 0:1 0x800000 /boot/uImage;  ext2load usb 0:1 0x1100000 /boot/uInitrd; bootm 0x800000 0x1100000'

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 11/12/2017 04:23AM by bodhi.
Re: Bodhi Debian on Mirabox
November 12, 2017 03:19AM
bodhi Wrote:
-------------------------------------------------------

> However, first verify whether they have ported
> the FDT. At serial consle prompt:
>
>
> help
> fdt
>

I typed 'fdt' at the Marvell>> command prompt and it said the command does not exist.

Marvell>> help
?       - alias for 'help'
SatR    - Sample At Reset sub-system

autoscr - DEPRECATED - use "source" command instead
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
bubt    - bubt  - Burn an image on the Boot SPI Flash.

chpart  - change active partition
cmp     - memory compare
cmpm    - cmpm  - Compare Memory

coninfo - print console devices and information
cp      - memory copy
cpumap  - cpumap - Display CPU memory mapping settings.

crc32   - checksum calculation
date    - get/set/reset date & time
ddrPhyRead- ddrPhyRead - Read DDR PHY register

ddrPhyWrite- ddrPhyWrite - Write DDR PHY register

dhcp    - boot image via network using DHCP/TFTP protocol
diskboot- diskboot- boot from IDE device

dma     - dma   - Perform DMA using the XOR engine

echo    - echo args to console
eeprom  - EEPROM sub-system
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fi      - fi    - Find value in the memory.

fsinfo  - print information about filesystems
fsload  - load binary file from a filesystem image
g       - g     - start application at cached address 'addr'(default addr 0x40000)

go      - start application at address 'addr'
help    - print online help
i2c     - I2C sub-system
ide     - ide     - IDE sub-system

iminfo  - print header information for application image
imxtract- extract a part of a multi-image
ir      - ir    - reading and changing MV internal register values.

itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
ls      - list files in a directory (default /)
map     - map   - Diasplay address decode windows

md      - memory display
me      - me    - PCI master enable

mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mp      - mp    - map PCI BAR

mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
pciePhyRead- phyRead    - Read PCI-E Phy register

pciePhyWrite- pciePhyWrite      - Write PCI-E Phy register

phyRead - phyRead       - Read Phy register

phyWrite- phyWrite      - Write Phy register

ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
rcvr    - rcvr  - Satrt recovery process (Distress Beacon with TFTP server)

reset   - Perform RESET of the CPU
resetenv- resetenv      - earse environment sector to reset all variables to default.

run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
se      - se    - PCI Slave enable

setenv  - set environment variables
sf      - SPI flash sub-system
sg      - sg    - scanning the PHYs status

showvar - print local hushshell variables
sleep   - delay execution for some time
source  - run script from memory
sp      - sp    - Scan PCI bus.

sspi    - SPI utility commands
switchCountersRead- switchCntPrint      - Read switch port counters.

switchPhyRegRead- - Read switch register

switchPhyRegWrite- - Write switch register

switchRegRead- switchRegRead    - Read switch register

switchRegWrite- switchRegWrite  - Write switch register

temp    - temp  - Display the device temprature.

test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
training- training      - prints the results of the DDR3 Training.

ts_report- ts_report    - report touch screen cooridate

ts_test - ts_test       - test touch screen

ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor version
whoAmI  - - reading CPU ID

> And most likely you need to embedded the DTB in uImage (/boot/dts/armada-370-mirabox.dtb).

One small issue with embedding the armada-370-mirabox.dtb in uImage, the Linux-4.12.4-mvebu-tld-1 file does not exist in the boot directory of the premade Debian rootfs ('Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2') nor is it in the linux update ('linux-4.12.4-mvebu-tld-1-bodhi.tar.bz2'). How do I embed dtb using mkimage without that file?

Good to be back BTW.

LeggoMyEggo's Google Plus Profile



Edited 1 time(s). Last edit at 11/12/2017 03:30AM by LeggoMyEggo.
Re: Bodhi Debian on Mirabox
November 12, 2017 04:01AM
LeggoMyEggo,

> One small issue with embedding the
> armada-370-mirabox.dtb in uImage, the
> Linux-4.12.4-mvebu-tld-1 file does not exist in
> the boot directory of the premade Debian rootfs
> ('Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2')
> nor is it in the linux update
> ('linux-4.12.4-mvebu-tld-1-bodhi.tar.bz2'). How
> do I embed dtb using mkimage without that file?

Yes it is in both.

In 'Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2', after you extract it to a USB drive, it is in

cd <USB rootfs drive mountpoint>
ls -l  boot/dts/*mira*

-rw-r--r-- 1 root root 13202 Jul 29 22:47 boot/dts/armada-370-mirabox.dtb


Or in the kernel tarball, after you have extracted it:

tar -xjf linux-4.10.9-mvebu-tld-1-bodhi.tar.bz2
tar tf linux-dtb-4.12.4-mvebu-tld-1.tar | grep mira

dts/armada-370-mirabox.dtb

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 11/12/2017 04:21AM by bodhi.
Re: Bodhi Debian on Mirabox
November 12, 2017 08:54AM
Yes, the proper dtb file is most definitely in both bz2 files.

BUT, in order to use this command "mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.12.4-mvebu-tld-1 -d zImage.fdt uImage" to embed dtb in uImage, I need the 'Linux-4.12.4-mvebu-tld-1' file which I cannot find anywhere. Have I overlooked it?

LeggoMyEggo's Google Plus Profile
Re: Bodhi Debian on Mirabox
November 12, 2017 12:44PM
That's not a file, it's the name that will be given to the image:
Usage: mkimage -l image
          -l ==> list image header information
       mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
          -A ==> set architecture to 'arch'
          -O ==> set operating system to 'os'
          -T ==> set image type to 'type'
          -C ==> set compression type 'comp'
          -a ==> set load address to 'addr' (hex)
          -e ==> set entry point to 'ep' (hex)
          -n ==> set image name to 'name'        <-----------------------
          -d ==> use image data from 'datafile'
          -x ==> set XIP (execute in place)
       mkimage [-D dtc_options] [-f fit-image.its|-F] fit-image
          -D => set options for device tree compiler
          -f => input filename for FIT source
Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)
       mkimage -V ==> print version information and exit

root@debian:/boot# strings uImage | grep tld
Linux-4.8.3-kirkwood-tld-1

-JT
Re: Bodhi Debian on Mirabox
November 12, 2017 03:26PM
LeggoMyEggo,

The commands are the same for Kirkwood box
Generate the uImage with DTB embedded inside: 
cd /media/sdb1/boot
cp -a zImage-4.12.1-kirkwood-tld-1  zImage.fdt
cat dts/kirkwood-goflexnet.dtb  >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.12.1-kirkwood-tld-1 -d zImage.fdt  uImage
sync

So substitute 4.12.1-kirkwood-tld-1 with 4.12.4-mvebu-tld-1, we have

cd /media/sdb1/boot
cp -a zImage-4.12.4-mvebu-tld-1  zImage.fdt
cat dts/armada-370-mirabox.dtb  >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.12.4-mvebu-tld-1 -d zImage.fdt  uImage
sync

Note: My instruction for the Zyxel NAS326 did not not mention this, because the NAS326 stock uboot is newer and supports FDT.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 03, 2019 10:22PM
Hi Leggo :)

Do you have the stock mtds backup for this box? I'm trying go restore stock for this box.

https://forum.doozan.com/read.php?3,43214,79634#msg-79634

Your u-boot is much newer, so I hope it will correct/fix previous u-boot problem in one shot :)

U-Boot 2009.08 (Jul 15 2015 - 21:57:33)Marvell version: 1.1.2 NQ

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 03/03/2019 10:35PM by bodhi.
Re: Bodhi Debian on Mirabox
March 04, 2019 09:33AM
Bodhi,

I am away from my Mirabox right now so can't get the mtd's directly off of it but the links at this website should be able to get you what you need:

Reflashing Globalscale Mirabox Filesystem

Just checked and the google docs archive is still active.

LME

Edit: Globalscale still has an active archive of files for the Mirabox here: Downloads Mirabox at Globalscale FTP. Looks like if you have the v9 Mirabox (I guess that is what I have), there is the 2015 uboot version available.

LeggoMyEggo's Google Plus Profile



Edited 2 time(s). Last edit at 03/04/2019 09:40AM by LeggoMyEggo.
Re: Bodhi Debian on Mirabox
March 04, 2019 02:41PM
Thanks Leggo! I'll let you know how it goes.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 04, 2019 05:44PM
Hi Leggo,

I'm downloading the FTP files. But looks like there is no indication of where the U-Boot GPL source is on that site?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 04, 2019 08:00PM
bodhi Wrote:
-------------------------------------------------------
> Hi Leggo,
>
> I'm downloading the FTP files. But looks like
> there is no indication of where the U-Boot GPL
> source is on that site?

Globalscale is so piss poor with support that your observation would not surprise me.

Read the reviews of their latest offering, the Espressobin, and lots of complaints about lack of kernel support beyond the buggy initial offering. I guess that is why many probably run Armbian.

I had to chuckle when I read the post where they were reintroducing the Sheevaplug in a 64 bit version. No SATA and USB 2.0! This isn't 2011 anymore. One would think that a company that markets to developers and hackers would be more forthright with things like source code, updated u-boot and kernels. But how Globalscale continues in it's current manner just boggles my mind.

LeggoMyEggo's Google Plus Profile
Re: Bodhi Debian on Mirabox
March 04, 2019 08:31PM
> Read the reviews of their latest offering, the
> Espressobin, and lots of complaints about lack of
> kernel support beyond the buggy initial offering.
> I guess that is why many probably run Armbian.

They probably hope it will be somebody else like Armbian will provide free community supports :)

I've read Espressobin runs too hot and needs a heat sink.

> I had to chuckle when I read the post where they
> were reintroducing the Sheevaplug in a 64 bit
> version. No SATA and USB 2.0! This isn't 2011
> anymore.

Agree. No SATA (or eSATA if on a small plug from factor) is a big miss. Not qualified as a NAS.

> One would think that a company that
> markets to developers and hackers would be more
> forthright with things like source code, updated
> u-boot and kernels. But how Globalscale continues
> in it's current manner just boggles my mind.

All we need a GPL source file to go with whatever they build and publish. There is no excuse not to make it available :)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 04, 2019 11:17PM
Thanks Leggo,

This procedure works!

> Reflashing
> Globalscale Mirabox Filesystem


Apparently they reuse the dreamplug rootfs in this rescue.

root@dreamplug-debian:~# uname -a
Linux dreamplug-debian 3.4.2 #6 Wed Nov 14 09:11:34 EST 2012 armv7l GNU/Linux

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 05, 2019 05:08AM
But that UBI rootfs rootfs-debian6.0-gti-mirabox-v5-0-1-120924.img probably no good!

The formatting went fine.

root@dreamplug-debian:/media/usb2# ubiformat /dev/mtd2 -f rootfs-debian6.0-gti-mirabox-v5-0-1-120924.img 
ubiformat: mtd2 (nand), size 1065353216 bytes (1016.0 MiB), 2032 eraseblocks of 524288 bytes (512.0 KiB), min. I/O size 4096 bytes
libscan: scanning eraseblock 2031 -- 100 % complete  
ubiformat: 2024 eraseblocks have valid erase counter, mean value is 12
ubiformat: bad eraseblocks: 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031
ubiformat: flashing eraseblock 727 -- 100 % complete  
ubiformat: formatting eraseblock 2031 -- 100 % complete

Reboot.

It booted until the error (dmesg showed the volume was not found).

UBI error: ubi_read_volume_table: the layout volume was not found
UBI error: ubi_init: cannot attach mtd2
0 - Base 0x00000000 , Size = 0x20000000.


Something is missing in that procedure (it also contains some syntax error in the posted commands). I'll have to refresh my memory about this UBI error.

UPDATE:

The reason:
UBI error: vtbl_check: bad CRC at record 23: 0xf185979f, not 0xffffffff
UBI error: vtbl_check: bad CRC at record 23: 0xf185979f, not 0xffffffff
UBI error: process_lvol: both volume tables are corrupted
UBI error: ubi_init: cannot attach mtd2

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 03/05/2019 05:32AM by bodhi.
Re: Bodhi Debian on Mirabox
March 05, 2019 07:07AM
bodhi Wrote:
-------------------------------------------------------
> But that UBI rootfs
> rootfs-debian6.0-gti-mirabox-v5-0-1-120924.img
> probably no good!

> It booted until the error (dmesg showed the volume
> was not found).
>
>
> UBI error: ubi_read_volume_table: the layout
> volume was not found
> UBI error: ubi_init: cannot attach mtd2
> 0 - Base 0x00000000 , Size = 0x20000000.
>
>
>
> Something is missing in that procedure (it also
> contains some syntax error in the posted
> commands). I'll have to refresh my memory about
> this UBI error.

Globalscale strikes again......Drats! :(

LeggoMyEggo's Google Plus Profile
Re: Bodhi Debian on Mirabox
March 05, 2019 03:40PM
> Globalscale strikes again......Drats! :(

:))

I'll try again a few more times. If it does not work, I'll just install SD card in internal slot and be done with this as a rescue system for now.

If somehow we can get GPL source for u-boot, USB 3.0 booting would be possible (as in other Armada 38x boxes). Or perhaps I can look into the other Marvell a38x u-boots to see if they have a37x supports.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 06, 2019 03:08AM
Leggo,

Yup. It is garbage :) try again and got the same error.

Did you do any thing extra to get the USB host for internal SD card activated? I don't see it even I have 2 SD cards plugged in both slots. I can only see the external SD.

I've noticed there is an env: usbActive. I tried a few values 0..4 and not seeing the internal card.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 06, 2019 04:28AM
bodhi Wrote:
-------------------------------------------------------
> Did you do any thing extra to get the USB host for
> internal SD card activated?

I thought that the internal SD card was actually a chip embedded on the device. IIRC, it's 4GB? I hope I am not confusing devices but I think this is the one where it would only initialize once per reset cycle, that is, you could only initialize the drive once, if the boot failed for some reason or you had a wrong boot command you would need to reset the board to start over.

Yep, same observation about the Mirabox with the USB 3.0 ports, they were not usable for booting as they were not recognized by uboot. They were only recognized after the rootfs had booted and could load the USB 3.0 drivers.

I finally ended up moving the latest available Globalscale rootfs to the SD card so I could have more space. Wheezy was the last available from GS.

Board on paper has a lot of potential but software definitely limits it.

LeggoMyEggo's Google Plus Profile



Edited 2 time(s). Last edit at 03/06/2019 04:37AM by LeggoMyEggo.
Re: Bodhi Debian on Mirabox
March 06, 2019 04:37AM
Leggo,

> I thought that the internal SD card was actually a
> chip embedded on the device. IIRC, it's 4GB? I
> hope I am not confusing devices but I think this
> is the one where it would only initialize once per
> reset cycle, that is, you could only initialize
> the drive once, if the boot failed for some reason
> or you had a wrong boot command you would need to
> reset the board to start over.

It seems we have a differrent version of this box. Mine has a real internal SD card slot. I inserted a another microSD card in it.

>
> What also sucked about the Mirabox was the USB 3.0
> ports were not usable for booting as they were not
> recognized by uboot, they were only recognized
> after the rootfs had booted and could load the USB
> 3.0 drivers.

Yes. This u-boot is so old that USB 3.0 is out of the question.

>
> I finally ended up moving the latest available
> Globalscale rootfs to the SD card so I could have
> more space. Wheezy was the last available from
> GS.
>
> Board on paper has a lot of potential but software
> definitely limits it.

If I could run a customed build uboot on it, then everything will be great just like we have for Kirkwood/OXNAS boxes.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bodhi Debian on Mirabox
March 14, 2019 02:28AM
Finally finished a new kernel for Mirabox! The old stock bootloader on this box has caused me a lot of stops and starts to figure out why it kept crashing.

Stock bootloader (2009.08 Marvell) uses a non-standard address for the device, so it needs to be configured using a few old settings in the kernel for debugging with UART. This has some commonality with a few other Armda 370 boxes in that they also use this old boot loader: U-Boot 2009.08 (Sep 16 2012 - 22:50:06)Marvell version: 1.1.2 NQ.

root@Mirabox:~# myinfo 
Mirabox
Globalscale Mirabox
Linux version 4.20.6-mvebu-mirabox-tld-12 (root@tldDebianVM) (gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)) #6 SMP PREEMPT Wed Mar 13 14:43:16 PDT 2019
Debian 9.4
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:4M(u-boot),4M(linux),-(filesystem) earlyprintk=serial
uboot_version=U-Boot 2009.08 (Sep 16 2012 - 22:50:06)Marvell version: 1.1.2 NQ
--- System Stats:
/dev/sda: Generic STORAGE DEVICE: S.M.A.R.T. not available
/dev/sdb: Generic STORAGE DEVICE: S.M.A.R.T. not available

This kernel 4.20.6-mvebu-mirabox-tld-12 is configured with some minor differences from the MVEBU kernel for other boxes. I had to move a few files system driver (F2FS, OrangeFS, JFFS2) to initrd (to make them loadable modules) to make the kernel size smaller.

This can be installed on the armhf rootfs Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2. Or even the armel rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 would work.

Will upload it with instruction for installation, and more testing by others before I release.

--------------
Moderator: edited to remove the 4MB limitation mentioned previously. This is not true. Stock u-boot does not limit the kernel image size to 4MB.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 06/22/2019 09:58PM by bodhi.
Debian on Mirabox -- Installation
March 14, 2019 04:52PM
Download new kernel at Dropbox


linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2

md5sum
8cf3d08dee09d000cf8b50b2df2f4047
sha256sum
fc4eb7a66e2af7f17f31041581fa6d106ba3da22ec643ab80a24aa352084f201

This tarball contains 6 files:

Quote

linux-image-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
linux-headers-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
zImage-4.20.6-mvebu-mirabox-tld-12
config-4.20.6-mvebu-mirabox-tld-12
linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar
linux-4.20.6-mvebu-tld-1.patch


Installation


I. Install with Serial console

A. Prepare rootfs on SD card

1. Download rootfs Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2 from the release thread and extract rootfs to an SD card (at least 4GB). See the release thread for instruction how to create rootfs.

2. Copy the download Mirabox kernel tarball linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2 to rootfs

Mount the rootfs. Assuming the rootfs is mounted at /media/sdd1. Extract kernel files

mkdir -p /media/sdd1/usr/src/mirabox
cd /media/sdd1/usr/src/mirabox
tar xf linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2

3. Make Mirabox uImage for first boot

cd /media/sdd1/usr/src/mirabox
tar -xvf linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar dts/armada-370-mirabox.dtb
cp zImage-4.20.6-mvebu-mirabox-tld-12 zImage.fdt
cp -a zImage-4.20.6-mvebu-mirabox-tld-12 zImage.fdt
cat dts/armada-370-mirabox.dtb >> zImage.fdt 
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.20.6-mvebu-mirabox-tld-12 -d zImage.fdt uImage

4. Copy Mirabox uImage to rootfs boot folder

cd /media/sdd1/boot
cp -a uImage uImage.bak
cp -a /media/sdd1/usr/src/mirabox/uImage .
sync


B. Boot the Mirabox with new kernel

1. Plug in the new SD roots to the external SD slot. Connect serial console. Power up and interrupt serial console at count down. And

printenv
Copy and paste the list of the envs from above command in a notepad. And then,
setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 $mtdparts ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs"'
setenv bootcmd_stock 'echo Booting Stock...; nand read 0x6400000 0x400000 0x400000; run set_bootargs_stock; bootm 0x6400000'
setenv load_image_addr 0x6400000
setenv load_initrd_addr 0x8400000
setenv load_uImage 'ext2load usb 1:1 $load_image_addr /boot/uImage'
setenv load_uInitrd 'ext2load usb 1:1 $load_initrd_addr /boot/uInitrd'
setenv set_bootargs_debian 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:4M(u-boot),4M(linux),-(filesystem) earlyprintk=serial'
setenv bootcmd_debian 'echo Booting Debian... ; usb start; run load_uImage; run load_uInitrd; run set_bootargs_debian; bootm $load_image_addr $load_initrd_addr'
setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'

And then go ahead with booting to Debian
boot

2. Login using SSH or serial console with root/root credential

Find the Mirabox dynamic IP address in the network. Or try to ping its hostname
ping debian.local

Log in and check what kernel is running.
uname -a
Expect Output:
Linux debian 4.20.6-mvebu-mirabox-tld-12 #6 SMP PREEMPT Wed Mar 13 14:43:16 PDT 2019 armv7l GNU/Linux

At this point the system is running with the new kernel 4.20.6-mvebu-mirabox-tld-12, but with older rootfs.

3. Install full kernel

cd /boot
cp -a uImage uImage.mirabox.bak
cp -a uInitrd uInitrd.bak    
dpkg -i /usr/src/mirabox/linux-image-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb 
tar xf /usr/src/mirabox/linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar 
cp -a /usr/src/mirabox/zImage-4.20.6-mvebu-mirabox-tld-12 .
cp -a zImage-4.20.6-mvebu-mirabox-tld-12 zImage.fdt 
cat dts/armada-370-mirabox.dtb >> zImage.fdt 
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.20.6-mvebu-mirabox-tld-12 -d zImage.fdt uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.20.6-mvebu-mirabox-tld-12 -d initrd.img-4.20.6-mvebu-mirabox-tld-12 uInitrd

4. Setup envs for booting Debian permanently

a. Check NAND mtds
cat /proc/mtd
Expected Output:
dev:    size   erasesize  name
mtd0: 00400000 00080000 "u-boot"
mtd1: 00400000 00080000 "linux"
mtd2: 3f800000 00080000 "filesystem"

b. Set up envs area

echo "/dev/mtd0 0x100000 0x00080000 0x00080000" > /etc/fw_env.config

c. Do a sanilty check and then set the envs permanently

fw_setenv test_xxxx yes
fw_printenv test_xxxx
fw_printenv
Expected Output: If you can list the envs and they look like the envs listed in Step B.1 (with the additional test_xxxx env just set), then it's all checked out. If there is any error at this point then please stop and post question.

Go ahead set these permanently.
fw_setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 $mtdparts ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs"'
fw_setenv bootcmd_stock 'echo Booting Stock...; nand read 0x6400000 0x400000 0x400000; run set_bootargs_stock; bootm 0x6400000'
fw_setenv load_image_addr 0x6400000
fw_setenv load_initrd_addr 0x8400000
fw_setenv load_uImage 'ext2load usb 1:1 $load_image_addr /boot/uImage'
fw_setenv load_uInitrd 'ext2load usb 1:1 $load_initrd_addr /boot/uInitrd'
fw_setenv set_bootargs_debian 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:4M(u-boot),4M(linux),-(filesystem) earlyprintk=serial'
fw_setenv bootcmd_debian 'echo Booting Debian... ; usb start; run load_uImage; run load_uInitrd; run set_bootargs_debian; bootm $load_image_addr $load_initrd_addr'
fw_setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'

And then print them again
fw_printenv
Copy and paster the envs to a notepad, for safe keeing.

5. Reboot

You are readdy to reboot the system.
sync
shutdown -r now

II. Install from Stock OS

TBD

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 03/17/2019 04:55PM by bodhi.
Re: Debian on Mirabox -- Installation
March 17, 2019 04:56PM
Please see the installation instruction for Mirabox in the post right above:

https://forum.doozan.com/read.php?2,41809,80659#msg-80659

-bodhi
===========================
Forum Wiki
bodhi's corner
Mirabox Fix
Re: Debian on Mirabox -- Installation
June 22, 2019 08:53PM
How to fix the stock fs? I tried the to flash it under debian (Linux debian 4.20.6-mvebu-mirabox-tld-12 #6 SMP PREEMPT Wed Mar 13 14:43:16 PDT 2019 armv7l GNU/Linux )
root@debian:/mnt# ubiformat /dev/mtd2 --flash-image=rootfs-debian6.0-gti-mirabox-v5-0-1-120924.img
ubiformat: mtd2 (nand), size 1065353216 bytes (1016.0 MiB), 2032 eraseblocks of 524288 bytes (512.0 KiB), min. I/O size 4096 bytes
libscan: scanning eraseblock 2031 -- 100 % complete
ubiformat: 2024 eraseblocks are supposedly empty
ubiformat: 8 bad eraseblocks found, numbers: 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031
ubiformat: flashing eraseblock 727 -- 100 % complete
ubiformat: formatting eraseblock 2031 -- 100 % complete

I also tried

https://www.frozentux.net/2013/05/reflashing-globalscale-mirabox-filesystem/

Also failed at boot... (same kernel panic...)

I noticed bodhi also had "bad eraseblocks: 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031", I guess these are marked by the bad software...
Re: Debian on Mirabox -- Installation
June 22, 2019 09:54PM
Any instructions to install openwrt as rescue system?



Edited 1 time(s). Last edit at 06/22/2019 09:55PM by daviddyer.
Re: Debian on Mirabox -- Installation
June 22, 2019 09:54PM
Mirabox Fix,

I gave up on rootfs-debian6.0-gti-mirabox-v5-0-1-120924.img. This apparently has problem. Not worth using.

Note about what I said before

Quote

Stock bootloader (2009.08 Marvell) limits the kernel uImage size to 4 MB, and it also uses a non-standard address for the device, so it needs to be configured using a few old settings in the kernel for debugging with UART. This has some commonality with a few other Armda 370 boxes in that they also use this old boot loader: U-Boot 2009.08 (Sep 16 2012 - 22:50:06)Marvell version: 1.1.2 NQ.

I have since found out that it was not true about 4MB limitation. The kernel file can be much bigger, no problem. The real problem was "non-standard address for the device". So I had to compiled a special custom kernel for this box (with a very sighlty different configuration).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Mirabox -- Installation
June 22, 2019 10:28PM
daviddyer Wrote:
-------------------------------------------------------
> Any instructions to install openwrt as rescue
> system?

There is a Mirabox sysupgrade file for OpenWrt:

https://downloads.openwrt.org/releases/17.01.4/targets/mvebu/generic/lede-17.01.4-mvebu-globalscale-mirabox-squashfs-sysupgrade.bin

But I have not tried that.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: