Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable booting from sata (after u-boot) #1

Open
Artox opened this issue Jul 2, 2019 · 2 comments
Open

enable booting from sata (after u-boot) #1

Artox opened this issue Jul 2, 2019 · 2 comments

Comments

@Artox
Copy link

Artox commented Jul 2, 2019

Hi everybody,
I have noticed that booting from sata drives is not currently enabled in the Helios-4 U-Boot.

There are 2 independent problems:

  1. distro-boot is not set up to try sata drives
  2. there is a bug in detecting SSD
    2a. first drive on each controller is detected twice
@Artox
Copy link
Author

Artox commented Jul 2, 2019

The solution to 1 is rather simple, and implemented in my u-boot fork.

Then however I found that my new SSD was not being detected, so I looked around on Marvells side and found this interesting patch which appears to delay link detection, and gets the ssd detected for me.

Sadly however I then noticed that I see the SSD twice now! That is also a hint for me that maybe spinning drives are seen twice, too (though hard to know if you put in identical ones):

scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: Intenso SSD SATA Rev: R081
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
  Device 0: (0:1) Vendor: ATA Prod.: Intenso SSD SATA Rev: R081
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
  Device 0: (1:0) Vendor: ATA Prod.: ST4000VN008-2DR1 Rev: SC60
            Type: Hard Disk
            Capacity: 1718295.8 MB = 1678.0 GB (3519069872 x 512)
  Device 0: (1:1) Vendor: ATA Prod.: ST4000VN008-2DR1 Rev: SC60
            Type: Hard Disk
            Capacity: 1718295.8 MB = 1678.0 GB (3519069872 x 512)

At this point I have to stop due to time constraints, maybe somebody else wants to pick this up?

@aprayoga
Copy link
Member

aprayoga commented Jul 3, 2019

Hi @Artox , Thanks for the pointer, I need to take a look on that delay link detection.

Actually for problem no 1, you don't need to change BOOT_TARGET_DEVICES_SATA into BOOT_TARGET_DEVICES_SCSI. scsi0 is included in boot_targets. I tested it using Armbian on SATA drive connected to 1st SATA port.

U-Boot SPL 2018.11-00008-g8f200a3d28 (Jul 03 2019 - 08:01:15 +0800)
High speed PHY - Version: 2.0
Detected Device ID 6828
board SerDes lanes topology details:
 | Lane #  | Speed |  Type       |
 --------------------------------
 |   0    |  6   |  SATA0       |
 |   1    |  5   |  USB3 HOST0  |
 |   2    |  6   |  SATA1       |
 |   3    |  6   |  SATA3       |
 |   4    |  6   |  SATA2       |
 |   5    |  5   |  USB3 HOST1  |
 --------------------------------
High speed PHY - Ended Successfully
mv_ddr: mv_ddr-armada-17.10.4
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR Training Sequence - Start scrubbing
DDR3 Training Sequence - End scrubbing
mv_ddr: completed successfully
Trying to boot from SPI


U-Boot 2018.11-00008-g8f200a3d28 (Jul 03 2019 - 08:01:15 +0800)

SoC:   MV88F6828-A0 at 1600 MHz
DRAM:  2 GiB (800 MHz, 32-bit, ECC enabled)
MMC:   mv_sdh: 0
Loading Environment from SPI Flash... SF: Detected w25q32bv with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK
Model: Helios4
Board: Helios4
SCSI:  MVEBU SATA INIT
Target spinup took 0 ms.
Target spinup took 0 ms.
AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq led only pmp fbss pio slum part sxs

Net:
Warning: ethernet@70000 (eth1) using random MAC address - ee:e0:5b:09:22:72
eth1: ethernet@70000
Hit any key to stop autoboot:  0
starting USB...
USB0:   MVEBU XHCI INIT controller @ 0xf10f4000
Register 2000120 NbrPorts 2
Starting the controller
USB XHCI 1.00
USB1:   MVEBU XHCI INIT controller @ 0xf10fc000
Register 2000120 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: device type unknown
... is now current device
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: TOSHIBA MK5065GS Rev: GJ00
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
  Device 0: (0:1) Vendor: ATA Prod.: TOSHIBA MK5065GS Rev: GJ00
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
  Device 0: (1:0) Vendor: ATA Prod.: STEC MACH8 SSD Rev: 1031
            Type: Hard Disk
            Capacity: 57241.8 MB = 55.9 GB (117231408 x 512)
  Device 0: (1:1) Vendor: ATA Prod.: STEC MACH8 SSD Rev: 1031
            Type: Hard Disk
            Capacity: 57241.8 MB = 55.9 GB (117231408 x 512)
Found 4 device(s).

Device 0: (0:0) Vendor: ATA Prod.: TOSHIBA MK5065GS Rev: GJ00
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
... is now current device
Scanning scsi 0:1...
Found U-Boot script /boot/boot.scr
2948 bytes read in 88 ms (32.2 KiB/s)
## Executing script at 03000000
Boot script loaded from scsi
199 bytes read in 54 ms (2.9 KiB/s)
18933 bytes read in 167 ms (110.4 KiB/s)
5408781 bytes read in 223 ms (23.1 MiB/s)
5590368 bytes read in 218 ms (24.5 MiB/s)
## Loading init Ramdisk from Legacy Image at 02880000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5408717 Bytes = 5.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02040000
   Booting using the fdt blob at 0x2040000
   Loading Ramdisk to 0fad7000, end 0ffff7cd ... OK
   reserving fdt memory region: addr=2040000 size=6a000
   Loading Device Tree to 0fa6a000, end 0fad6fff ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

As you can see above, I don't have any problem with SSD detection (well, I think it's worth to mention that the drive is SATA II) but definitely something wrong with the SATA initialization and it seems only 1st controller that is initialized.
When i play around with CONFIG_SYS_SCSI_MAX_SCSI_ID and CONFIG_SYS_SCSI_MAX_LUN value, the device appears even more

=> scsi reset

Reset SCSI
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: TOSHIBA MK5065GS Rev: GJ00
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
  Device 1: (0:1) Vendor: ATA Prod.: TOSHIBA MK5065GS Rev: GJ00
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
  Device 2: (0:2) Vendor: ATA Prod.: TOSHIBA MK5065GS Rev: GJ00
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
  Device 3: (0:3) Vendor: ATA Prod.: TOSHIBA MK5065GS Rev: GJ00
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
Invalid port number 3
Invalid port number 3
Invalid port number 3
Invalid port number 3
Found 4 device(s).
=> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants