Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 3247

Going from non-FDT to FDT - The changes i made (no replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 3247

Trending Articles