Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 08, 2012 10:53PM
Thanks Davy,

I'm sure it would work with your procedure.

I had doubt about "/tmp/flash_erase /dev/mtd0 0 4". And I thought just for educational purpose, someone would analyze whether if it would work or not. IOTW, can this uBoot image be flashed the same way we ususally do with Jeff install script "install_uboot_mtd0.sh"? I guess I just need to study your procedure and see if I understand it first.

-bodhi
Gwapenut
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 11, 2012 01:51AM
Hi Davy
Thanks for all your hard work on this .... I had a look at your dropbox account but could not see any files for PogoPlug Mobile (unless I missed a path in there somewhere). Should we just be using uboot.nandpogoMobile-MMC-mtdparts-NoUSB.kwb.tar.gz from your earlier posting on 21 April? I presume I don't need a UART connection if I am just taking the plunge and flashing nand image to nand.

If I want to install archlinux, I presume I can follow the instructions at http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 but modify the ppv4-install.sh to install your custom image instead. I don't quite understand the comment above about flashing it from within uboot.

Thanks!

davygravy Wrote:
-------------------------------------------------------
> Ooops, I'd accidentally turned off my Pogoplug.
> It's back up now, but I also moved copies to my
> Dropbox account... (see my sig)
>
> As far as auto-installing them...no, they aren't
> incorporated in Jeff's installer.
>
> They do work, but with the SATA not working like
> it should, I just couldn't see them as being
> ready. It _does_ work perfectly w/ the SD card,
> though!
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 12, 2012 01:26AM
@Davy,

Please consider making this uBoot work with Jeff's installation script! As you probably knew, there was a Pogoplug Mobile inventory sale lately, so expect to have more users coming around and looking for uBoot, to install Debian :-)



Edited 1 time(s). Last edit at 09/12/2012 01:26AM by bodhi.
Gwapenut
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 13, 2012 02:43PM
@Bodhi, how much do Jeff's scripts need to be changed to work with this?
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 13, 2012 04:16PM
Gwapenut,

Changing Jeff's script should be straightforward, not a problem. The real concern is the flash_erase and nandwrite steps in the script. We need Davy's confirmation that those statements in Jeff's script will work with Davy's uBoot, or if we need to do additional steps. I'm not sure, so I thought it would be best that Davy would take a look sometime and instruct us. Because if we flash it in the wrong place, we would need JTAG to recover, no fun with that!
Gwapenut
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 13, 2012 04:45PM
Thanks Bodhi, my PP mobile is still in its unopened box until I'm sure I can safely hack it! As you guessed, one of those impulse buys ...
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 13, 2012 05:43PM
dang... I missed it...

How much did you pick up a mobile for?

=====================================================
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 13, 2012 06:20PM
Gwapenut
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
September 17, 2012 03:32AM
For anyone who needs the USB slot on the PP-mobile for something else, I can confirm that it boots OK from a USB hub. This might give you some breathing space until we're sure the version that boots from SD can be safely flashed on the PP-mobile.
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
October 15, 2012 12:24PM
If you need a serial connection on the Pogoplug series 4 you need a to soulder some wires next to the power plug. Shown in picture is Ground (black) TX (white) and a RX (brown)
Attachments:
open | download - PogoPlugV4_Serial.jpg (249.3 KB)
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 08, 2012 04:49PM
@Davy,

Is this UBoot version working for the Pogoplug Mobile? I'd like to try flashing it either with serial or netconsole.

BTW, JR has this for 19.99 currently :-) It's a little bit under powered, but it's a pocket size, small, cheap and has SD. So I think a NAND installed like your MacPlug (http://forum.doozan.com/read.php?4,9422,9545#msg-9422) would be really nice to use in conjunction with an optional large rootfs on SD.

JR link:
http://www.jr.com/pogoplug/pe/PGG_POGOV4A101/


-bodhi
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 09, 2012 04:32PM
It did work! I've installed Davy's UBoot and changed some UBoot envs while in serial console to allow it to boot to Debian. I've also learned that it did not work if we flash this UBoot from Linux command line (after installing ALARM), I think because the different in envs used in ALARM installation caused a checksum error during starting UBoot.

Everything seems to come up OK in dmesg (the hidden unpopulated SATA ports, and the MMC).
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 11, 2012 05:07AM
Quote

I've also learned that it did not work if we flash this UBoot from Linux command line (after installing ALARM).

o_O . Did you pad the uboot binary with nandwrite -p /dev/mtd0 u-boot.kwb ?? The loader expected an aligned image. Sometimes we do this with 'dd':
 dd if=u-boot.kwb of=u-boot.nand bs=512 conv=sync // this align the image to fit in 4 eraseblocks ( 4 * 128 = 512)
In this case we can just write the image without padding it, with nandwrite /dev/mtd0 u-boot.nand

Is the same thing for installing kernel in nand...
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 11, 2012 06:00AM
Thanks pazos,

I believe I did use nandwrite without padding it!

I was not clear about the part that was not working: I saw a "Bad CRC" in serial console when booting up, and UBoot loaded a default environment, so I guessed it must have been the environment that was bad. After that, while in serial console, I changed some envs and did a saveenv, and that fixed the checksum, since I got a clean boot after that. Did I understand it correctly?

- bodhi
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 12, 2012 04:40PM
bodhi Wrote:
-------------------------------------------------------
> It did work!

Bodhi, Excuse my inquiry.
I got my first Pogoplug Mobile (POGO-V4-A1-01) last night and today I have spent on researching how to boot from the SD card, I have tried to flash a uboot with an fedora script (http://fedoraproject.org/wiki/Architectures/ARM/PogoplugUSBDisk), but the result was green blinking LED and no ssh access. I was able to revert to factory status and I have access again. I don't have a usb-serial connection.

I'm getting confused with all the different procedures and models and reading this thread here, I notice links to third party documentation that makes understanding the process more cumbersome.
Anyway, I feel lost now, although in general I'm very adequate with finding information and accomplishing my goals.

You mention that you got this working, would you mind providing a guide with steps and links?
Thank you very much!
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 12, 2012 05:28PM
wilbert-vb Wrote:
-------------------------------------------------------
> bodhi Wrote:
> --------------------------------------------------
> -----
> > It did work!
>
> Bodhi, Excuse my inquiry.
> I got my first Pogoplug Mobile (POGO-V4-A1-01)
> last night and today I have spent on researching
> how to boot from the SD card, I have tried to
> flash a uboot with an fedora script
> (http://fedoraproject.org/wiki/Architectures/ARM/P
> ogoplugUSBDisk), but the result was green blinking
> LED and no ssh access. I was able to revert to
> factory status and I have access again. I don't
> have a usb-serial connection.
>
> I'm getting confused with all the different
> procedures and models and reading this thread
> here, I notice links to third party documentation
> that makes understanding the process more
> cumbersome.
> Anyway, I feel lost now, although in general I'm
> very adequate with finding information and
> accomplishing my goals.
>
> You mention that you got this working, would you
> mind providing a guide with steps and links?
> Thank you very much!

wilbert,

If you don't have serial console, then currently you can only use Arch Linux ARM instruction to install Arch. But that UBoot version does not have ability to boot SD card! With Davy's UBoot version, you can boot with SD card, but you need serial console to flash it. Either way has some drawback. So if SD booting is what you really need, then I would suggest getting a serial module converter and install Davy's UBoot.
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 21, 2012 09:44PM
bodhi Wrote:
> wilbert,
>
> So if SD booting is what you really
> need, then I would suggest getting a serial module
> converter and install Davy's UBoot.

Bodhi, would it be possible to boot Arch Linux ARM from USB drive and after that flash the u-boot partition with code that enables booting from SD card?
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 22, 2012 05:48AM
wilbert-vb Wrote:
-------------------------------------------------------
> Bodhi, would it be possible to boot Arch Linux ARM
> from USB drive and after that flash the u-boot
> partition with code that enables booting from SD
> card?

@wilbert,
At the moment, not possible. From what I can gather and understood, the reason is ALARM uBoot version is quite old (same as from the stock Pogo uBoot), and the uBoot envs checksum in that version is not compatible with one in the new uBoot. The stock uBoot uses blparam, while the new uBoot uses fw_env tools, and the checksum is at a diferrent location). So after you installed Arch, and at command line you then flash the new uBoot with flash_eraseall and nandwrite, you will have to also make sure its envs and checksum at the correct location while doing that, otherwise you won't be able to boot because of Bad CRC error during boot. But I'm not entirely sure, because I have not experimented enough with it to be certain.

I think Davy can help us out and chime in here!



Edited 1 time(s). Last edit at 12/22/2012 05:54AM by bodhi.
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 22, 2012 07:05PM
@davy,

Can you point me to where your Pogov4 uBoot image, and uBot envs image are? I'd like to try flashing it from Linux command line. Thanks!
-bodhi
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 26, 2012 03:44AM
I've confirmed that Davy's uBoot can be flashed to the Pogoplug Mobile from Linux command line. I'm going to describe how I flashed it in this post along with the output of each command, so anybody who is interested and brave enough :-) with a fallback plan (i.e. serial console) can try. But before you do that, please read the entire post, and judge for yourself that whether it makes sense, before attempting.

And please be aware that, as usual, there is no guarantee. It works fine for me, but if you don't have a mean to connect serial console now or future to recover from typo or things that might go badly in your setup, then perhaps you should not do it.

Flashing uBoot and uBoot envs to the PogoMobile from Debian Wheezy

- Download Davy's uBoot image (April 8th 2012)
uboot.nandpogoV4-MMC-mtdparts-noSATA.kwb

- Download Jeff's uBoot envs image
http://download.doozan.com/uboot/files/environment/uboot.environment

- Make sure the tools are in place and the uBoot enviroment definition is at the right place 
(I'm using Debian wheezy and the fw_envs tools is available):

# which flash_erase
/usr/sbin/flash_erase
# which nandwrite
/usr/sbin/nandwrite

# cat /etc/fw_env.config 
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

- Flash uBoot
# flash_erase /dev/mtd0 0 4
Erase Total 4 Units
Performing Flash Erase of length 131072 at offset 0x60000 done

# nandwrite /dev/mtd0 uboot.nandpogoV4-MMC-mtdparts-noSATA.kwb 
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000

- At this point, I believe you can boot with SD card. Because Davy's uBoot is set up for that. 
However, for me to get a warm and fuzzy feeling, I'd like to be a little bit more sure, so I flashed the uBoot envs image from Jeff's script.

- Flash uboot.environment to 0xC0000

# /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done

# /usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.environment 
Writing data to block 6 at offset 0xc0000


- Confirm that all envs are shown without error:

# fw_printenv
ethact=egiga0
bootdelay=3
baudrate=115200
arcNumber=2097
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_init=run usb_scan
usb_device=0:1
usb_root=/dev/sda1
usb_rootfstype=ext2
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset

- Adjust MTD parts

# fw_setenv mtdparts 'mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)'
# fw_printenv mtdparts
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

- Set up netconsole (change serverip and ipaddr to appropriate numbers in your network)

# fw_setenv serverip 192.168.0.220
# fw_setenv ipaddr 192.168.0.230
# fw_setenv if_netconsole 'ping $serverip'
# fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'
# fw_setenv preboot 'run if_netconsole start_netconsole'


- At this point you can only boot with a USB rootfs, since Jeff's uBoot env image did not have MMC boot.

- To boot with SD card, set uBoot envs:

# fw_setenv bootcmd 'usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run mmc_bootcmd'
# fw_setenv mmc_bootcmd 'mmc init; ext2load mmc 0:1 0x00800000 /boot/uImage; if ext2load mmc 0:1 0x01100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'

- If you have a kernel that supportsPogoplug V4 then set arcNumber and machid. 
Warning: don't do this if you're not sure, because it won't boot with a vanilla kernel after the arcNumber changed from 2097.
A vanilla Debian or Arch should boot fine with arcNumber 2097.

# fw_setenv arcNumber 3960
# fw_setenv machid F78

- That's it! good luck, and please post questions or comments, if you have any, before trying.

EDIT: fixed typos.



Edited 3 time(s). Last edit at 12/26/2012 05:09AM by bodhi.
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 28, 2012 01:58PM
Thank you very much for this document, Bodhi!

I noticed that you checked the script for errors, so I waited a few days.
Just now I committed the crime... and netconsole gives me this output:

==========
U-Boot 2011.12 (Apr 08 2012 - 19:03:41)
Cloud Engines-Pogoplug v4/Mobile:MMC version
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot: 10
==========

Which seems to indicate that uboot over netconsole is alive, although I don't get any response when I type (yes I have both readonly and interactive netconsole running)

I have Debian Wheezy on my sd card in /dev/sda1, perhaps I forgot to make /dev/sda1 bootable, because it looks like the boot process is stuck.
Anyway, with this output on my netconsole, I probably figure out what I did wrong.
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 28, 2012 04:40PM
Wilbert, netconsole looks great!

With Jeff's netconsole instruction (I guess that's what you followed), some of us needed to change it slightly in the second command:

nc -l -u -p 6666 &
nc -up 6666 192.168.1.100 6666


And pounding on control-J repeatedly until you see the Pogo V4> prompt :-)



Edited 1 time(s). Last edit at 12/28/2012 04:49PM by bodhi.
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 28, 2012 05:04PM
Yes!

I didn't worry. I assume a type error in my nc command, thank you very much for repeating the correct nc command, Bodhi:

==========
U-Boot 2011.12 (Apr 08 2012 - 19:03:41)
Cloud Engines-Pogoplug v4/Mobile:MMC version
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot: 9
8
7
0
Pogov4>
========
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 28, 2012 05:12PM
Well, I need to study the uboot environment. This will soon be familiar to me, but for now, attached is the boot output:
Attachments:
open | download - boot.txt (1.5 KB)
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 28, 2012 05:57PM
wilbert-vb Wrote:
-------------------------------------------------------
> Yes!
>
> I didn't worry. I assume a type error in my nc
> command, thank you very much for repeating the
> correct nc command, Bodhi:
>
> ==========
> U-Boot 2011.12 (Apr 08 2012 - 19:03:41)
> Cloud Engines-Pogoplug v4/Mobile:MMC version
> arm-none-linux-gnueabi-gcc (Sourcery G++ Lite
> 2009q3-67) 4.4.1
> GNU ld (Sourcery G++ Lite 2009q3-67)
> 2.19.51.20090709
> Hit any key to stop autoboot: 9
> 8
> 7
> 0
> Pogov4>
> ========

Congrats! chance is you will not need serial console for recovery purpose (if you don't mess with UBoot image in NAND). Nice to get netconsole working!
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 31, 2012 10:07AM
Would it be safe to use Bodhi's magical script to install the netconsole enabled uboot on another device, like the PogoPlug-0E, which has the same cpu as the pink PogoPlug?
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 31, 2012 01:52PM
wilbert-vb Wrote:
-------------------------------------------------------
> Would it be safe to use Bodhi's magical script to
> install the netconsole enabled uboot on another
> device, like the
> [url=http://www.amazon.com/New-Media-sharing-devic
> e-black-POGOP21/dp/B005FNDJHS/ref=sr_1_3?s=electro
> nics&ie=UTF8&qid=1356969869&sr=1-3&keywords=pogopl
> ug]PogoPlug-0E[/url], which has the same cpu as
> the
> [url=http://www.amazon.com/Pogoplug-POGO-B01-Media
> -Sharing-Device/dp/B004TDY924/ref=sr_1_5?s=electro
> nics&ie=UTF8&qid=1356969869&sr=1-5&keywords=pogopl
> ug]pink PogoPlug[/url]?

For the Pogo Pink (E02), you don't need to do these manual steps! just run Jeff's install_uboot_mtd0 script to install uBoot, and then clone the same Debian rootfs that you already have. Just make sure to adjust the udev persistent network rules after cloning as described here: [url]http://forum.doozan.com/read.php?2,10934,10935#msg-10935[/url]
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 31, 2012 03:42PM
bodhi Wrote:

> just run Jeff's
> install_uboot_mtd0 script to install uBoot

With Jeff's uboot installed, I only need to do these steps?

- Set up netconsole (change serverip and ipaddr to appropriate numbers in your network)

# fw_setenv serverip 192.168.0.220
# fw_setenv ipaddr 192.168.0.230
# fw_setenv if_netconsole 'ping $serverip'
# fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'
# fw_setenv preboot 'run if_netconsole start_netconsole'
Re: U-Boot w/ MMC/SD-card booting for Pogoplug Series 4
December 31, 2012 11:17PM
Yes, after installing with Jeff's script, uBoot installation is done for the Pogo E02. You would need to setup netconsole with the above setenvs. After booting with the cloned rootfs, only arcNumber is need to be set if you have a rootfs that supports the Pogo E02. If your rootfs does not have Pogo E02 supports, then leave it as 2097.

On the Pogo E02, the LED light can be controlled with arcNumber 2097, but it will be limited, not fully controlled as with the correct arcNumber.
Hi.

I'm in the process of flashing uboot based on Bodhi's instructions on Pogoplug Mobile,
got this little cutie for 19.99$ on Amazon.
My goal is to boot Arch Linux, from sd off course.


I'm a bit new to all of this and got few questions:

1. I couldn't get access to the sd card with fdisk on the original Pogoplug linux, I tried basically almost all the devices under /dev, is this normal ?

2. I'm assuming that I can't revert to stock uboot with just having a revert folder on fat32 usb drive,
as described on Arch Linux installation guide.
Is there's a guide on how to flash and set the original uboot ?
Where can I get the original uboot ? I only found the sources on Pogoplug site.
Can I read it from my device prior flashing the new uboot ?

3. Any advancement made on getting the sata working, meaning maybe the Arch Linux devs would finally adopted this uboot (p.s. I also got the non Mobile device with the esata port).

I'll probably would have more questions after I'll brick my device.

Thanks.
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: