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

Pogoplug Pro / v3 - flashing U-Boot / running Debian when internal rootfs isn't accessable (no replies)

$
0
0
I've got a fiew Pogoplug v3 / pro devices which doesn't boot propery.
With serial attached I noticed that U-Boot env is modified.
The stock kernel is booting up but a rootfs cannot be found.

I think a fiew people have modified their boxes in that way because there wasn't any newer U-Boot available and accessing / booting from USB isn't possible in stock U-Boot.
So they used the stock kernel to bring up the USB.
Because I only have these boxes and no rootfs that fits this situation, I decided to go forward in another way.

As you can see, the stock U-boot is up and running:

Stage-1 Bootloader XCE_STAGE1: 1.1: Tue Feb  8 01:40:26 PST 2011
Attempting to set PLLA to 700MHz ...
  plla_ctrl0 : 0x0000000A
  plla_ctrl1 : 0x000E0000
  plla_ctrl2 : 0x001C01A0
  plla_ctrl3 : 0x00000016
PLLA Set

Setup memory, testing
Reading NAND, Image 0
  Hdr len: 0x0001C030
  Hdr CRC: 0x39F6D832
 OK


U-Boot 1.1.2 (Jul 29 2010 - 19:36:07)

U-Boot code: 60D00000 -> 60D1C030  BSS: -> 60D21800
RAM Configuration:
        Bank #0: 60000000 128 MB
SRAM Configuration:
        64KB at 0x50000000
NAND:128 MiB
In:    serial
Out:   serial
Err:   serial
Setting Linux mem= boot arg value
Hit any key to stop autoboot:  0 
CE>>

Now we need network access.
Please change this to your needs:

CE>> setenv ipaddr 192.168.10.245
CE>> setenv serverip 192.168.10.128
CE>> ping 192.168.10.128
Wait GMAC to reset
Wait for PHY reset
PHY is Realtek RTL8211D
Wait for link to come up..........Link up
Wait for auto-negotiation to complete
Link is 1000M
host 192.168.10.128 is alive
CE>>

On the "server" machine, a TFTP is running, serving a prepared uImage (DTB embedded) and uInitrd.
Let's load them:

CE>> tftp 0x60500000 ox820/uImage
Wait GMAC to reset
Wait for PHY reset
PHY is Realtek RTL8211D
Wait for link to come up...........Link up
Wait for auto-negotiation to complete
Link is 1000M
TFTP from server 192.168.10.128; our IP address is 192.168.10.245
Filename 'ox820/uImage'.
Load address: 0x60500000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################################################
done
Bytes transferred = 4289601 (417441 hex)
CE>>

CE>> tftp 0x60e00000 ox820/uInitrd
Wait GMAC to reset
Wait for PHY reset
PHY is Realtek RTL8211D
Wait for link to come up...........Link up
Wait for auto-negotiation to complete
Link is 1000M
TFTP from server 192.168.10.128; our IP address is 192.168.10.245
Filename 'ox820/uInitrd'.
Load address: 0x60e00000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 3874326 (3b1e16 hex)
CE>>

As you cen see, the uImage is quite big but as you'll see, this will boot up.
For this to work, you need do adjust the bootargs:

CE>> setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootfstype=ext4  mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 rootwait mem=128M poweroutage=yes
CE>>

Don't forget to plug a prepared rootfs (Debian Jessie or Wheezy] with the same kernel which was used for creating uImage and uInitrd.

Now let's boot:

CE>> bootm 0x60500000 0x60e00000
CE>>

The kernel and rootfs should be up and running in a fiew time.
Now you can proceed flashing U-Boot and prepare all things to your needs.

As mentioned in another thread (STG-212) there could be some problems
accessing /boot and / or /boot/dts when using the given env file and ext4 rootfs.
On this boxes this doesn't occour only after kernel upgrade, this could happen on first boot (with new U-Boot and rootfs),
so be warned.

A solution is use a seperate (fat formatted) /boot partition.
For this to work, the env has to be changed in the following way:



setenv dtb_file '/dts/ox820-pogoplug-pro.dtb'
setenv load_dtb 'echo loading DTB $dtb_file ...; fatload $bootdev $device 0x62c00000 $dtb_file'
setenv load_initrd 'echo loading uInitrd ...; fatload $bootdev $device 0x60e00000 /uInitrd'
setenv load_uimage 'echo loading uImage ...; fatload $bootdev $device 0x60500000 /uImage'
setenv uenv_read 'echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x60500000 /uEnv.txt; then setenv uenv_loaded 1; fi'


Please note that you have to use the correct DTB for your device, otherwhise it will not boot.

- For Pogoplug v3: "ox820-pogoplug-v3.dtb"
- For Pogoplug Pro: "ox820-pogoplug-pro.dtb"

Viewing all articles
Browse latest Browse all 3247

Trending Articles