Welcome! Log In Create A New Profile

Advanced

New U-Boot option for Pogoplug Series 4/V4

Posted by Malc 
New U-Boot option for Pogoplug Series 4/V4
February 13, 2014 07:10PM
After a couple of years of prevarication, I have finally got around to producing a U-Boot for the Pogo V4 that I'm vaguely happy with.

It is similar to the ALARM version, in that it is based on the stock 1.1.4 sources, but it goes a little further.

Background and Philosophy

What I want is a U-Boot that will reliably load Debian and support the SATA interface in that environment. This mandated using the Pogoplug "open source" U-Boot, and lead me to the conclusion that (for my prejudices and preconceptions) that I need to load the kernel and the initramfs from the on-board flash.

If, for whatever reason, the load fails, I don't want the U-Boot side to do anything special. In those cases, I reckon I want to be involved with fixing the problem (i.e. no automatic loading of any other images). And, because only one of my two devices has the serial port header attached, that means I need netconsole to poke around if things go wrong.

This U-Boot does that: it supports netconsole, USB and IDE/SATA, as well as (obviously) pulling the images from NAND.

Using It
There is a compressed tar file at Box.net / uboot.pogoV4-USB-SATA-Net.tzf. Download that, and untar it (tar xvzf ...) and look at the installer.

Because this is based on the stock U-Boot, it requires blparam to set/get environment variables, not fw_printenv. Basically, the installer tends to assume it's running on the standard Pogoplug OS, but will work in other environments as long as it can find a blparam, a flash_erase and a nandwrite.

Netconsole
The Netconsole setup is similar to that of later U-Boot versions, in that you enable it by setting the variable ncip to the IP address of the console machine, and change the variables stdin, stderr, and stdout.

HOWEVER, the network interface takes a little too long to come up, so the usual trick of putting a ping test in the preboot doesn't work: the interface isn't up, the ping fails, and nothing works. Fortunately, the usb start commands take long enough to execute that the network is usable when it finishes, so the following set of variables works like a charm:
consoleip=198.19.81.98
do_netconsole=run if_netconsole start_netconsole
if_netconsole=ping $consoleip
start_netconsole=setenv ncip $consoleip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version
preboot=usb start; run do_netconsole

(Note that I don't use the serverip variable for this address, because I want to have a separate console from a tftp server; the address I show -- 198.19.81.98 -- is technically reserved for network testing, so should never be used in production. Since I only want the console occasionally, I just add the address to whatever convenient Linux box that may be to hand, using the ifconfig eth0:0 198.19.81.98 syntax).

Building It

At this link Box.net / uboot-pogo-114.patch there is a patch file that should patch against the Pogoplug source at Pogoplug / Opensource / pogomv-u-boot.tar.bz2.

I built it on a Linux Mint (= Ubuntu, = Debian) PC host, following the instructions Here to get an emdebian cross-compiler.

Once compiled, you will have a uboot.bin (which you can tftp and run with the go command) and a couple of files that are suitable for booting (from flash and serial). These are named someting like u-boot-pogomv_200rd_nand.bin and u-boot-pogomv_200rd_uart.bin. The ..._nand.bin file is padded to a multiple of 128KB by:
dd if=u-boot-pogomv_200rd_nand.bin bs=128k conv=sync of=u-boot-pogoV4-USB-SATA-Net.kwb
Re: New U-Boot option for Pogoplug Series 4/V4
February 13, 2014 08:56PM
Malc,

Nice! thanks for sharing.

I've looked at CE source code before, hoping I can extract the part where SATA interface is initialized to create a patch for the latest u-Boot code. That was not easy :) the code is quite different comparing to the current u-Boot code. I shelved the idea since it would take too much time.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: New U-Boot option for Pogoplug Series 4/V4
April 22, 2014 06:24PM
Hi Malc,

I tried to compile this U-Boot using your patch above, applied on top of Pogo CE source. It was compiled natively (I've changed the Makefile to comment out CROSS_COMPLE).

I got this error, any idea why? I'm guessing that I missed an include file somewhere that contains the #define for some of the values.
arm-linux-gnueabi-gcc -DMV_SEC_256K -DMV_BOOTSIZE_16M -DMV_LARGE_PAGE -DRD_88F6192A -DMV_BOOTROM -DCE_BOARDID='"PPV4A3"' -DCE_BOARD_BOOTLED=22 -DCE_BOARD_ERRORLED=24 -DCE_BOARD_HASSATA=1 -DCONFIG_NETCONSOLE -DMW_PATCH_ID=1404212015 -DMV_USB -DCONFIG_CMD_USB -DMV_NAND_BOOT -DMV_NAND -DCFG_DIAG -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x00600000 -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabi/4.6/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv5t -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x00600000 -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabi/4.6/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv5t -Wall -Wstrict-prototypes -DMV_UBOOT -DMV_CPU_LE -DMV_ARM -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/uboot_oss -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_hal -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_hal/sata/CoreDriver/ -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/common  -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/USP -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/ctrlEnv -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/ctrlEnv/sys -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/cpu -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/device -I/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv  -c -o /usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.o /usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1029:2: warning: left shift count is negative [enabled by default]
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1029:2: warning: left shift count is negative [enabled by default]
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1029:2: error: initializer element is not constant
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1029:2: error: (near initialization for ‘sheevaPlugInfo.gppOutEnValLow’)
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1031:2: warning: left shift count is negative [enabled by default]
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1031:2: warning: left shift count is negative [enabled by default]
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1031:2: error: initializer element is not constant
/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.c:1031:2: error: (near initialization for ‘sheevaPlugInfo.gppOutValLow’)
make[1]: *** [/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/mv_kw/kw_family/boardEnv/mvBoardEnvSpec.o] Error 1
make[1]: Leaving directory `/usr/src/pogov4-uboot/pogomv-u-boot-ce/board/mv_feroceon/config_kw'
make: *** [board/mv_feroceon/config_kw/libconfig_kw.a] Error 2

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.6/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv4t --with-float=soft --enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi --target=arm-linux-gnueabi
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14)

Thanks for any insight!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: