Welcome! Log In Create A New Profile

Advanced

Bodhi Debian on Mirabox

Posted by LeggoMyEggo 
Bodhi Debian on Mirabox
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

LeggoMyEggo's Google Plus Profile



Edited 1 time(s). Last edit at 11/11/2017 09:09AM by LeggoMyEggo.
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
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 22 plus 10?
Message: