Welcome! Log In Create A New Profile

Advanced

Kirkwood U-boot - Getting all supported Kirkwoods on-board

Posted by WarheadsSE 
bodhi Wrote:
-------------------------------------------------------
> WarheadsSE,
>
> Ah! thanks for that info. I'm wondering could it
> be that the quirky boxes like Pogo V4/Mobile
> suffer similar problem? For the Pogo V4/Mobile, to
> use kwboot you must repeatedly control-C and rerun
> many many times (varied from 3 to 25 times last
> time I counted) before the handshake works :)

Fun fact: kwboot works perfectly fine with my GoFlex Net via a very, very cheap USB-TTY adapter, but completely fails on my Pogoplug Mobile (I did not get it to work). However, when attaching the Pogoplug to my Raspberry Pi, kwboot works perfectly fine. So I guess either my Pogoplug is somewhat faulty or it simply doesn't like my TTY adapter (however, "normal" operation (i.e. catching uboot output) works fine).

bodhi Wrote:
-------------------------------------------------------
> ebbes,
>
> > I will do some more testing and push the code
> to
> > my Github repo (along with precompiled
> binaries)
> > in the next days (when I have more time).
> > Even if I can't get sata to work: the current
> > feature set would still be an improvement over
> > davygravy's current Pogoplug v4 binary.
>
> When you've done, and if you'd like, please do a
> PR on the branch 2013.10-kirkwood.
> Thanks.

Well, hopefully today my Pogoplug Mobile will be equipped with a SATA port (I really want to test SATA :D), but once I find enough time, I'll consider it. Main problem as of now is that my work is based on 2014.01 already, so I would have to adapt some changes (but afaik only a more complex Makefile and a change in boards.cfg is needed).
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 05:49AM
ebbes,

That's Ok. Don't worry about it. I had the patch for 2013.10, too (Just dont have time to look into it yet). I only want to spend more time on getting SATA working.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 09:00AM
For the most part, I have no issues pulling the necessities from PlanetEater's 2014.1 back to 2013.10. Only some Makefile differences, which I simply altered from the GFN in the repo as it is.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 09:02AM
@bodhi
Thoughts on my getting this bugger to chain load? I can't get kwboot to work, as said.

I have copied u-boot.bin to /boot, and ext2load'ed them to 0x800000 and 0x2000000, but `go` results only in a software interrupt and a SoC reset.

(this after one successful boot so that the MCU watchdog is off)
WarheadsSE Wrote:
-------------------------------------------------------
> For the most part, I have no issues pulling the
> necessities from PlanetEater's 2014.1 back to
> 2013.10. Only some Makefile differences, which I
> simply altered from the GFN in the repo as it is.

Yeah, only the makefile differs (is much simpler) and board.cfg has afaik a different format. There don't seem to be other important changes.
By the way: I had some help by someone with great soldering skills (but without SMD capacitors, so they are a bit bigger than they should be :D) and my Pogoplug Mobile now has a working SATA port. I'll see if I can get this to work in UBoot.
Sorry for double-posting, but I just tested a build from yesterday that had SATA enabled. (But I don't know which one of my working branches it's taken from...). No big changes done to SATA code, except disabling second slot (it is completely unpopulated, even on Pogoplug v4, so I think it should be disabled by default in bootloader, too)
Pogov4> ide
ide - IDE sub-system

Usage:
ide reset - reset IDE controller
ide info  - show available IDE devices
ide device [dev] - show or set current device
ide part [dev] - print partition table of one or all IDE devices
ide read  addr blk# cnt
ide write addr blk# cnt - read/write `cnt' blocks starting at block `blk#'
    to/from memory address `addr'
Pogov4> ide reset

Reset IDE: Bus 0: OK Bus 1: not available  
  Device 0: Model: ST3250823AS  Firm: 3.03 Ser#: 5ND0W6F7
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)
Pogov4> ext4ls ide 0:1 /
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
<DIR>       4096 test
         3930736 uImage
Pogov4> ext4load ide 0:1 0x800000 /uImage
3930736 bytes read in 733 ms (5.1 MiB/s)
Pogov4> bootm 0x800000
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.13.5-1-ARCH
   Created:      2014-02-23   9:58:43 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3930672 Bytes = 3.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
Using machid 0xf78 from environment

Starting kernel ...
And yeah, it boots. Okay, kernel panic because I did not set bootargs (didn't find rootfs), but -- to my surprise -- SATA seems to work perfectly in uboot. Now I just need to figure out which branch this build was taken from (or simpler: which branch has 2014.01-00005-g4d45eec-dirty commit in it) and do some further testing before I put my tree on GitHub.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 12:39PM
Yup, sata should work fine, since it is just an mv_sata like the rest.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 12:41PM
Also: re: V4/Mobile SATA .. I have a user that bought a mobile, and attached _both_ SATA ports directly to eSATA port cables, and now has 2x 4x3TB enclosures.
Well, davygravy did have SATA problems that he did not solve, so I assumed I would run into problems, too. See here.

Has your user any directions on which pins to use for the second SATA port? I'm interested :D
The question, however, is whether you really need the second SATA in your bootloader. But I'll see whether everything still works when the second port is enabled. I think I'll push my patches to Github tomorrow along with some binaries for you to test.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 01:12PM
Just don't push binaries to github :)

I have my NSA3xx changes on a branch of my work, so no issues there :)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 03:03PM
ebbes Wrote:
-------------------------------------------------------
> Sorry for double-posting, but I just tested a
> build from yesterday that had SATA enabled. (But I
> don't know which one of my working branches it's
> taken from...). No big changes done to SATA code,
> except disabling second slot (it is completely
> unpopulated, even on Pogoplug v4, so I think it
> should be disabled by default in bootloader, too)
>
> Pogov4> ide
> ide - IDE sub-system
> 
> Usage:
> ide reset - reset IDE controller
> ide info  - show available IDE devices
> ide device [dev] - show or set current device
> ide part [dev] - print partition table of one or
> all IDE devices
> ide read  addr blk# cnt
> ide write addr blk# cnt - read/write `cnt' blocks
> starting at block `blk#'
>     to/from memory address `addr'
> Pogov4> ide reset
> 
> Reset IDE: Bus 0: OK Bus 1: not available  
>   Device 0: Model: ST3250823AS  Firm: 3.03 Ser#:
> 5ND0W6F7
>             Type: Hard Disk
>             Supports 48-bit addressing
>             Capacity: 238475.1 MB = 232.8 GB
> (488397168 x 512)
> Pogov4> ext4ls ide 0:1 /
> <DIR>       4096 .
> <DIR>       4096 ..
> <DIR>      16384 lost+found
> <DIR>       4096 test
>          3930736 uImage
> Pogov4> ext4load ide 0:1 0x800000 /uImage
> 3930736 bytes read in 733 ms (5.1 MiB/s)
> Pogov4> bootm 0x800000
> ## Booting kernel from Legacy Image at 00800000
> ...
>    Image Name:   Linux-3.13.5-1-ARCH
>    Created:      2014-02-23   9:58:43 UTC
>    Image Type:   ARM Linux Kernel Image
> (uncompressed)
>    Data Size:    3930672 Bytes = 3.7 MiB
>    Load Address: 00008000
>    Entry Point:  00008000
>    Verifying Checksum ... OK
>    Loading Kernel Image ... OK
> Using machid 0xf78 from environment
> 
> Starting kernel ...
>
> And yeah, it boots. Okay, kernel panic because I
> did not set bootargs (didn't find rootfs), but --
> to my surprise -- SATA seems to work perfectly in
> uboot. Now I just need to figure out which branch
> this build was taken from (or simpler: which
> branch has 2014.01-00005-g4d45eec-dirty commit in
> it) and do some further testing before I put my
> tree on GitHub.

:) Now that's cool :)

After you put it out to you GitHub, please let us know. I will get the changes, merge it locally and test it on my Pogo V4. Davygravy ran into problem that he never got time to pursue further. We have more people inerested and coorporating, hopefully we will get this solved!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 03:13PM
WarheadsSE Wrote:
-------------------------------------------------------
> @bodhi
> Thoughts on my getting this bugger to chain load?
> I can't get kwboot to work, as said.
>
> I have copied u-boot.bin to /boot, and ext2load'ed
> them to 0x800000 and 0x2000000, but `go` results
> only in a software interrupt and a SoC reset.
>
> (this after one successful boot so that the MCU
> watchdog is off)

I've learned that chain loading u-Boot really does not work reliably, and running in RAM is impossible when the old U-Boot is way too old comparing to the new one under test (that's what you're seeing). I'll report back if I can think of something.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 04:08PM
I wonder if I could create a uImage out of it and then bootm that...
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 05, 2014 08:49PM
Nope.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 06, 2014 01:21AM
> WarheadsSE Wrote:

> > (this after one successful boot so that the MCU
> > watchdog is off)

I've missed this! is that UART booting?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 06, 2014 03:45AM
Okay, I finally pushed my branch to Github.
See https://github.com/ebbes/u-boot-pogoplugv4. It's based on 2014.01, I don't know whether everything will behave well on older releases of U-Boot.

If someone else should want to test it: I attached a build. Don't flash it to NAND if you don't know what you're doing (although this image is prepared to be flashed and works just fine on my Pogoplug Mobile with SATA). I strongly suggest that you try it first with UART booting, it works best with kwboot from u-boot/tools as it can patch the image for correct UART booting on the fly. If you don't have a kwboot binary: Just download U-Boot sources, extract them, cd to u-boot/tools and call
gcc -o kwboot kwboot.c
Then you can boot the image via
./kwboot -b uboot.mtd0.kwb -p -t -B 115200 /dev/ttyUSB0
Look out for -p option which patches image in memory before sending it to the device. Also note that I had no success in booting with one of my TTY adapters, the device doesn't seem to like every adapter.
By the way: SHA1 is 34f3929d802ecff9ea95f3489e253a1f57cdf28a



Edited 1 time(s). Last edit at 03/06/2014 03:54AM by ebbes.
Attachments:
open | download - uboot.mtd0.kwb (512 KB)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 07, 2014 11:19AM
Here is the output when I tried the uboot on my seagate backup plus 1TB
when I did a ide reset it shows "ide_preinit failed"

83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]


U-Boot 2014.01-pogoplugv4 (Mar 05 2014 - 20:11:39)
Pogoplug v4/Mobile

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   kwsdio: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
Pogov4> ide
ide - IDE sub-system

Usage:
ide reset - reset IDE controller
ide info  - show available IDE devices
ide device [dev] - show or set current device
ide part [dev] - print partition table of one or all IDE devices
ide read  addr blk# cnt
ide write addr blk# cnt - read/write `cnt' blocks starting at block `blk#'
    to/from memory address `addr'
Pogov4> ide reset

Reset IDE: ide_preinit failed
Pogov4>
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 07, 2014 03:27PM
markweng,

Did you plug it in the SATA port directly or use an external power source?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 07, 2014 06:01PM
I plug it in the SATA port directly
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 07, 2014 06:16PM
That's what I am seeing too, with the HDD plugged in directly to SATA port:
Reset IDE: ide_preinit failed

With the another 2.5" HDD using eSATA enclosure (i.e. external power source), it does work with the ide reset. The HDD was initialized OK.

My conclusion: there is some board settings that need to be adjusted. Could it be that there is not enough power draw to the SATA port? or some timing parameter that must be changed to allow enough time for the disk to spin up.

I should mention that I'm running my own build for u-Boot 2014.01, with the patch extracted from ebbes GitHub for PogoV4, and applied to the original 2014.10 source tree.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 03/07/2014 06:24PM by bodhi.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 07, 2014 07:56PM
When I tried another uboot from Malc
http://forum.doozan.com/read.php?3,15091

Ide reset is OK. so should not be the power problem.
Hope this help.

 99 % [....................................]
[Type Ctrl-\ + c to quit]


U-Boot 1.1.4 (Feb 12 2014 - 19:25:05) Cloud Engines 1.1.2 (3.4.27) MW1402121924 SATA PHYADDR=0

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFBE0

Soc: 88F6192 A1 (DDR2)
CPU running @ 800Mhz L2 running @ 400Mhz
SysClock = 200Mhz , TClock = 166Mhz

DRAM CAS Latency = 3 tRP = 3 tRAS = 8 tRCD=3
DRAM CS[0] base 0x00000000   size 128MB
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)
CLOUD ENGINES BOARD: PPV4A3

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
Net:   egiga0 [PRIME]
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
egiga0 no link
Using egiga0 device
## Warning: gatewayip needed but not set
## Warning: gatewayip needed but not set
ping failed; host 198.19.81.98 is not alive
Hit any key to stop autoboot:  0
UB>>


UB>> ide reset

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: ST1000LM024 HN-M101MBB                   Firm: 2BA30001 Ser#: S30CJ9ADB07860
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 07, 2014 09:20PM
markweng Wrote:
-------------------------------------------------------
> When I tried another uboot from Malc
> http
> ://forum.doozan.com/read.php?3,15091

>
> Ide reset is OK. so should not be the power
> problem.
> Hope this help.

Agreed. But you are running modified stock Marvell uBoot from Malc. Not the latest from mainline u-Boot source tree. It's most likely the timing problem, IMO.

So perhaps the waittime was adjusted in Marvell code.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 07, 2014 09:29PM
bodhi Wrote:
-------------------------------------------------------
> Agreed. But you are running modified stock Marvell
> uBoot from Malc. Not the latest from mainline
> u-Boot source tree. It's most likely the timing
> problem, IMO.
>
> So perhaps the waittime was adjusted in Marvell
> code.


I don't know the coding much, but I do willing to test any new uboot come up.
I can very easy to get the UART booting work.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 08, 2014 10:03AM
It works with all the drives I was testing... Problem is I only have a Pogoplug Mobile with SATA cable soldered. Power is always drawn through USB as I didn't have a SATA power connector to solder onto the board.

So as of now we can't rule out whether this is just a timing issue or some sort of power issue. Is the hard drive spinning (or starts spinning) when you power on the device? "ide_preinit failed" is also the error message you receive when no drive is attached at all.
ide_preinit is defined in drivers/block/mvsata_ide.c, this is also the place to look for timing. Interesting is
	u32 timeleft = 10000; /* wait at most 10 ms for SATA reset to complete */

	/* Hard reset */
	writel(MVSATA_EDMA_CMD_ATA_RST, &port->edma_cmd);
	udelay(25); /* taken from original marvell port */
	writel(0, &port->edma_cmd);
So maybe 10000 is to low for Pogoplug v4 (while 25 should be correct).
Another option might be to put some debug information into ide_preinit and/or mvsata_ide_initialize_port and see what exactly happens (there are unfortunately no #ifdef DEBUG switches predefined :-( ).

Concerning power: As these problems only seem to occur with hard drives directly attached to Pogoplug v4 SATA power (could you please try the same hard drive via external power and internal power?) my guess would be that the pogoplug might use SATA staggered spin-up feature (See https://en.wikipedia.org/wiki/Serial_ATA#Power_connectors) If that is the case, then some GPIO would have to be written to in order to start the drive. Could someone verify whether pin 11 of the power connector (see wikipedia) is shorted to GND? If so, we could definitely rule this power problem out.

EDIT:
Looking into the (horrible) Marvell U-Boot, I found some interesting things:
- There is actually a reference to staggered spin-up, but to me it looks like it is not really needed (I hope someone checks this with a multimeter, see above...)
- mvsata_ide_initialize_port in mainline U-Boot implements _channelHardReset and _establishSataComm in Marvell's U-Boot (board/mv_feroceon/mv_hal/sata/CoreDriver/mvSata.c). However, implementation of the first one is much simpler. And timings are different, too: 25 µs delay after hard resetting link is a common timing. However, Marvell's U-Boot waits 20 ms for SATA reset to complete (not just 10 as in mainline U-Boot (it is u32 timeleft in snipped I posted above)). Furthermore, Marvell uses a hack that retries establishing the connection (with a different method) 5 times after the first try failed. It is commented with
/* Fix for 88SX60X1 FEr #10 - retry SATA communication if failed 5 times */
/* this workaround applied for all devices for simplicity and robustness */
88SX60X1 doesn't seem to be Kirkwood afaik, so I think we can ignore this bit.

So some options worth trying could be:
  • increasing timeleft from 10000 to 20000
  • some additional timeout after writel(0, &port->edma_cmd); (Marvell's U-Boot does this in certain cases)
  • modify mvsata_ide_initialize_port to closely match Marvell's U-Boot implementation

EDIT²: At least in my Pogoplug Mobile, Pin 11 is connected to GND using an (unpopulated) resistor, so no further component is available for staggered spin-up. This would rule out that theory (unless the v4's PCB layout differs significantly here).
bodhi, could you please test your failing drive inside your eSata-box?

EDIT³: Compare those outputs:
markweng's drive:
Model: ST1000LM024 HN-M101MBB                   Firm: 2BA30001 Ser#: S30CJ9ADB07860
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
my drive:
  Device 0: Model: SAMSUNG HN-M101MBB Firm: 2AR10001 Ser#: S2R8J1KBB00967
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
Fun fact: same drives, but my firmware revision is older (before Seagate bought Samsung HDD), so it's really weird that my drive works while yours doesn't.
Please test the uboot in attachment, it has timeout increased to 20000 µs and prints (very few) debug messages.



Edited 3 time(s). Last edit at 03/08/2014 11:48AM by ebbes.
Attachments:
open | download - uboot.mtd0.kwb (512 KB)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 08, 2014 12:28PM
ebbes Wrote:
-------------------------------------------------------

> Please test the uboot in attachment, it has
> timeout increased to 20000 µs and prints (very
> few) debug messages.
The hard driver is conneted directly into SATA port.
I don't feel the hard driver is running

U-Boot 2014.01-pogoplugv4-dirty (Mar 08 2014 - 18:40:46)
Pogoplug v4/Mobile

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   kwsdio: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
Pogov4> ide
ide - IDE sub-system

Usage:
ide reset - reset IDE controller
ide info  - show available IDE devices
ide device [dev] - show or set current device
ide part [dev] - print partition table of one or all IDE devices
ide read  addr blk# cnt
ide write addr blk# cnt - read/write `cnt' blocks starting at block `blk#'
    to/from memory address `addr'
Pogov4> ide reset

Reset IDE: ebbes debug: timeout is increased by factor 2.
ebbes debug: mvsata_ide_initialize_port timed out.
ebbes debug: timeout is increased by factor 2.
ebbes debug: mvsata_ide_initialize_port timed out.
ide_preinit failed
Pogov4>
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 08, 2014 12:45PM
Okay, I tried to change the initialization sequence to more closely match Marvell U-Boot. Please try this file.
But if you don't feel like the drive is rotating, then maybe staggered spin-up is still a valid option...
Attachments:
open | download - uboot.mtd0.kwb (512 KB)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 08, 2014 12:52PM
ebbes Wrote:
-------------------------------------------------------
> Okay, I tried to change the initialization
> sequence to more closely match Marvell U-Boot.
> Please try this file.
> But if you don't feel like the drive is rotating,
> then maybe staggered spin-up is still a valid
> option...

here is output, I still don't feel the hard driver is rotating

99 % [....................................]
[Type Ctrl-\ + c to quit]


U-Boot 2014.01-pogoplugv4-dirty (Mar 08 2014 - 19:39:24)
Pogoplug v4/Mobile

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   kwsdio: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
Pogov4> ide reset

Reset IDE: ebbes debug: timeout is increased by factor 2.
ebbes debug: timeout is increased by factor 2.
ide_preinit failed
Pogov4>
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 08, 2014 03:26PM
Okay, not cool.
One more thing you could try: Power on the Pogoplug (or complete UART booting) without the hard drive attached. Once you are at the Pogo4> prompt, plug the hard drive in and try ide reset. If that works, it might be a valid workaround. If not, then I'll have to start digging deeper into the Marvell SATA driver.
Since the driver seems to use only self-defined functions and it looks like it doesn't need many uboot functions, it might be possible to port it over to recent u-boot. This might actually work. But it's extremely complex and I don't think it's worth the trouble.



Edited 1 time(s). Last edit at 03/08/2014 03:42PM by ebbes.
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 08, 2014 03:28PM
ebbes,

> u32 timeleft = 10000; /* wait at most 10 ms for SATA reset to complete */
I've tried different numbers from 25 to 100ms. It had no effect.

> then some GPIO would have to be written to in
> order to start the drive
This would be very nasty to hunt for this in Marvell U-Boot!

> Looking into the (horrible) Marvell U-Boot
Could not agree more! I'd briefly looked at this code a few months ago, and felt that I did not have enough free time to extract what they did in mvSata.c.

> - mvsata_ide_initialize_port in mainline U-Boot
The reset sequence in current U-Boot is quite clear and simple that it does not have a lot of moving parts that could go wrong.

> Another option might be to put some debug
> information into ide_preinit and/or
> mvsata_ide_initialize_port and see what exactly
> happens.
I think this is what we need to do to compare the failed case and successful case.

> bodhi, could you please test your failing drive
> inside your eSata-box?
I've tried this. The drive in eSata enclosure is 2.5", so I took it out and plugged in the SATA slot. And it behave the same way.

… Could there might be a bug in the Pogo Mobile/V4 controller, and Marvell coded U-Boot to work around it. At first, I thought it could be the difference in SATA I and SATA II. But that theory was shot when I tried that same SATA II drive mentioned above, in the SATA slot, and in enclosure.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kirkwood U-boot - Getting all supported Kirkwoods on-board
March 08, 2014 03:41PM
bodhi Wrote:
-------------------------------------------------------
> > bodhi, could you please test your failing drive
> > inside your eSata-box?
> I've tried this. The drive in eSata enclosure is
> 2.5", so I took it out and plugged in the SATA
> slot. And it behave the same way.
>
> … Could there might be a bug in the Pogo
> Mobile/V4 controller, and Marvell coded U-Boot to
> work around it. At first, I thought it could be
> the difference in SATA I and SATA II. But that
> theory was shot when I tried that same SATA II
> drive mentioned above, in the SATA slot, and in
> enclosure.
Sorry, I don't quite understand what's exactly going on: Does your drive work in external drive but not when plugged in directly or does it work either way?

And yes, it's gonna be a big bug hunt. The more I look into the code, the more horrifying it gets. And yes, there are tons of workarounds for some bugs. Problem is: I don't know which ones are active and/or neccessary for this device. I'll see if I can compile this U-Boot (last time I tried it failed), I need some more debug output...
EDIT: okay, with Malc's patches, compiling works. Let's see if I can reveal its secrets...



Edited 1 time(s). Last edit at 03/08/2014 03:48PM by ebbes.
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: