Welcome! Log In Create A New Profile

Advanced

Going from non-FDT to FDT - The changes i made

Posted by JohnW 
Going from non-FDT to FDT - The changes i made
December 29, 2014 03:40PM
Hi!

I recently upgraded my Pogoplug V4 with the 3.17-kernel using the DTB-file.

I'm just going to share in short terms the changes i did to the envs under the main installation.
And then also the changes made later for using the DTB-files offcourse (FDT, which could be used with the 3.17-kernel).

The rootfs i used was:
Debian-3.16.0-kirkwood-tld-2-rootfs-bodhi.tar.bz2
U-Boot envs used:
uboot.2014.07-tld-1.environment.img.bodhi.tar
Kernel upgraded using:
linux-3.17.0-kirkwood-tld-1-bodhi.tar.bz2

After writing the U-Boot envs provided by Bodhi, the following changes were made.
"bootcmd_pogo" is for chainloding the original U-Boot which will get you to the original Pogoplug OS (factory) in case USB/SATA/MMC-boot fails.
"preboot" is for enabling netconsole. Nothing new here really.

arcNumber=3960
machid=f78
ethaddr=00:25:31:05:xx:xx
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
bootcmd_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi
bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; run bootcmd_pogo; reset
preboot=run preboot_nc

When upgrading to 3.17, the following commands were executed to make the necessary changes (keeping it clean and simple):
fw_setenv dtbfile '/boot/dts/kirkwood-pogoplug_v4.dtb'
fw_setenv usb_load_dtb 'ext2load usb $device 0x1c00000 $dtbfile'
fw_setenv mmc_load_dtb 'ext2load mmc $device 0x1c00000 $dtbfile'
fw_setenv sata_load_dtb 'ext2load ide $device 0x1c00000 $dtbfile'
fw_setenv usb_boot 'mw 0x800000 0 1; run usb_load_dtb; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi'
fw_setenv mmc_boot 'mw 0x800000 0 1; run mmc_load_dtb; run mmc_load_uimage; if run mmc_load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi'
fw_setenv sata_boot 'mw 0x800000 0 1; run sata_load_dtb; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi'

And the final product of course...
ipaddr=192.168.0.231
serverip=192.168.0.220
baudrate=115200
bootcmd_mmc=run mmc_init; run set_bootargs_mmc; run mmc_boot
bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot;
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot;
bootdelay=10
console=ttyS0,115200
device=0:1
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mmc_init=mmc rescan
mmc_load_uimage=ext2load mmc $device 0x800000 /boot/uImage
mmc_load_uinitrd=ext2load mmc $device 0x1100000 /boot/uInitrd
mmc_root=/dev/mmcblk0p1
mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
rootdelay=10
rootfstype=ext3
sata_init=ide reset
sata_load_uimage=ext2load ide $device 0x800000 /boot/uImage
sata_load_uinitrd=ext2load ide $device 0x1100000 /boot/uInitrd
sata_root=/dev/sda1
set_bootargs_mmc=setenv bootargs console=$console root=$mmc_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=/dev/sda1
arcNumber=3960
machid=f78
ethaddr=00:25:31:05:xx:xx
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
bootcmd_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi
bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; run bootcmd_pogo; reset
preboot=run preboot_nc
dtbfile=/boot/dts/kirkwood-pogoplug_v4.dtb
usb_load_dtb=ext2load usb $device 0x1c00000 $dtbfile
mmc_load_dtb=ext2load mmc $device 0x1c00000 $dtbfile
sata_load_dtb=ext2load ide $device 0x1c00000 $dtbfile
usb_boot=mw 0x800000 0 1; run usb_load_dtb; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
mmc_boot=mw 0x800000 0 1; run mmc_load_dtb; run mmc_load_uimage; if run mmc_load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
sata_boot=mw 0x800000 0 1; run sata_load_dtb; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi

This was my way of doing it. Just sharing. :-)

/John



Edited 1 time(s). Last edit at 12/29/2014 03:40PM by JohnW.
Re: Going from non-FDT to FDT - The changes i made
December 30, 2014 06:36PM
What do you guys think about this? I was bored so i looked into cleaning up the envs above - they should do absoluely the same, just that they've been packaged a bit. Some parts was a bit repetitive...

I appreciate if you could help me spot some error as i'm a noob when it comes to this. :)

arcNumber=3960
machid=f78
ethaddr=00:25:31:06:xx:xx

ipaddr=192.168.0.231
serverip=192.168.0.220
baudrate=115200

bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; run bootcmd_pogo; reset
bootcmd_usb=usb start; setenv root /dev/sda1; setenv interface usb; run boot;
bootcmd_mmc=mmc rescan; setenv root /dev/mmcblk0p1; setenv interface mmc; run boot;
bootcmd_sata=ide reset; setenv root /dev/sda1; setenv interface ide; run boot;
bootcmd_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi

bootdelay=10
console=ttyS0,115200
device=0:1
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes

load_dtb=ext2load $interface $device 0x1c00000 /boot/dts/kirkwood-pogoplug_v4.dtb
load_uimage=ext2load $interface $device 0x800000 /boot/uImage
load_uinitrd=ext2load $interface $device 0x1100000 /boot/uInitrd

mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
rootdelay=10
rootfstype=ext3

root=undefined
interface=undefined

bootargs=console=$console root=$root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts

start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial

mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
preboot=run preboot_nc

boot=mw 0x800000 0 1; run load_dtb; run load_uimage; if run load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi

NOT TESTED YET!



Edited 2 time(s). Last edit at 12/30/2014 06:49PM by JohnW.
Re: Going from non-FDT to FDT - The changes i made
December 30, 2014 07:34PM
Can somebody tell me why "bootcmd_mmc" isn't closed with a ";" at the end. I added one here , but i'm not sure if it will brake something... Hm.
Re: Going from non-FDT to FDT - The changes i made
December 30, 2014 09:18PM
JohnW Wrote:
-------------------------------------------------------
> Can somebody tell me why "bootcmd_mmc" isn't
> closed with a ";" at the end. I added one here ,
> but i'm not sure if it will brake something... Hm.

John,

It does not matter with or without ; at the end.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Going from non-FDT to FDT - The changes i made
December 30, 2014 09:43PM
Thanks Bodhi! The config above did not work, this one does!

arcNumber=3960
machid=f78
ethaddr=00:25:31:06:xx:xx

ipaddr=192.168.0.231
serverip=192.168.0.220
baudrate=115200

bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; run bootcmd_pogo; reset
bootcmd_usb=usb start; setenv root /dev/sda1; setenv interface usb; run set_bootargs; run boot;
bootcmd_mmc=mmc rescan; setenv root /dev/mmcblk0p1; setenv interface mmc; run set_bootargs; run boot;
bootcmd_sata=ide reset; setenv root /dev/sda1; setenv interface ide; run set_bootargs; run boot;
bootcmd_pogo=if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi

bootdelay=10
console=ttyS0,115200
device=0:1
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes

load_dtb=ext2load $interface $device 0x1c00000 /boot/dts/kirkwood-pogoplug_v4.dtb
load_uimage=ext2load $interface $device 0x800000 /boot/uImage
load_uinitrd=ext2load $interface $device 0x1100000 /boot/uInitrd

mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
rootdelay=10
rootfstype=ext3

root=undefined
interface=undefined

set_bootargs=setenv bootargs console=$console root=$root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts

start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial

mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
preboot=run preboot_nc

boot=mw 0x800000 0 1; run load_dtb; run load_uimage; if run load_uinitrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
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: