Quantcast

cubox i4x4 hard drive seen in D-I but not in installed system.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

cubox i4x4 hard drive seen in D-I but not in installed system.

peter green-2
I have just bought a cubox i4x4 and installed Debian Jessie on it using
D-I (concatenatable netboot). I am using a SD card for the rootfs and
plan to use a hard drive to store chroots.

Unfortunately while I can see the hard drive in D-I I can't see it after
installing. The ahci_imx module seems to be loaded but sda doesn't
appear in /dev.

I upgraded to the kernel from backports. This made no difference.

Any idea how to go about troubleshooting this issue? the box isn't much
use to me if I can't make the hard drive work.

When trying to debug I wondered if the wrong dtb was being used.
Unfortunately I can't seem to figure out what puts the dtb in /boot and
how it selects which dtb to use.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cubox i4x4 hard drive seen in D-I but not in installed system.

peter green-2
On 13/12/16 19:59, peter green wrote:

> I have just bought a cubox i4x4 and installed Debian Jessie on it
> using D-I (concatenatable netboot). I am using a SD card for the
> rootfs and plan to use a hard drive to store chroots.
>
> Unfortunately while I can see the hard drive in D-I I can't see it
> after installing. The ahci_imx module seems to be loaded but sda
> doesn't appear in /dev.
>
> I upgraded to the kernel from backports. This made no difference.
>
> Any idea how to go about troubleshooting this issue? the box isn't
> much use to me if I can't make the hard drive work.
Ok, after some discussions on irc I discovered some more.

It seems that the system sees the port but fails to detect the drive.

[    2.694758] ahci-imx 2200000.sata: fsl,transmit-level-mV value 1104,
using 00000044
[    2.694778] ahci-imx 2200000.sata: fsl,transmit-boost-mdB value 0,
using 00000000
[    2.694791] ahci-imx 2200000.sata: fsl,transmit-atten-16ths value 9,
using 00002000
[    2.694802] ahci-imx 2200000.sata: fsl,receive-eq-mdB not specified,
using 05000000
[    2.698172] ahci-imx 2200000.sata: SSS flag set, parallel bus scan
disabled
[    2.698208] ahci-imx 2200000.sata: AHCI 0001.0300 32 slots 1 ports 3
Gbps 0x1 impl platform mode
[    2.698223] ahci-imx 2200000.sata: flags: ncq sntf stag pm led clo
only pmp pio slum part ccc apst
[    2.699973] scsi host0: ahci-imx
[    3.014679] ahci-imx 2200000.sata: no device found, disabling link.
[    3.014690] ahci-imx 2200000.sata: pass .hotplug=1 to enable hotplug

However if I unload and reload the driver then it sees the drive
successfully.

I would guess at this point either a race condition or a power glitch
(maybe powering the HDD off one of the USB ports wasn't such a good idea).

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cubox i4x4 hard drive seen in D-I but not in installed system.

peter green-2
On 13/12/16 21:42, peter green wrote:
>
> I would guess at this point either a race condition or a power glitch
> (maybe powering the HDD off one of the USB ports wasn't such a good
> idea).
>
OK, I found that adding  ahci-imx.hotplug=1 to the kernel command line
made it work.

Checking the schematic I notice that the USB ports seem to have power
control, I wonder if they are power-cycled at some point during the boot
process.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cubox i4x4 hard drive seen in D-I but not in installed system.

Gunnar Wolf via nm
peter green dijo [Tue, Dec 13, 2016 at 10:05:12PM +0000]:

> On 13/12/16 21:42, peter green wrote:
> >
> >I would guess at this point either a race condition or a power glitch
> >(maybe powering the HDD off one of the USB ports wasn't such a good idea).
> >
> OK, I found that adding  ahci-imx.hotplug=1 to the kernel command line made
> it work.
>
> Checking the schematic I notice that the USB ports seem to have power
> control, I wonder if they are power-cycled at some point during the boot
> process.

I have a CuBox-i 4 (not 4x4). It's currently in stable use, and have
not fiddled with it for long (and right now, it sits 7000Km away from
me), but if I recall correctly, any USB media needed for the boot
process (i.e. a keyboard) has to be inserted in the lower port. I know
the issue seems completely different from yours, but this might be an
important point to get your issue properly solved.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cubox i4x4 hard drive seen in D-I but not in installed system.

peter green-2
On 20/12/16 12:50, Gunnar Wolf wrote:
>
> I have a CuBox-i 4 (not 4x4). It's currently in stable use, and have
> not fiddled with it for long (and right now, it sits 7000Km away from
> me), but if I recall correctly, any USB media needed for the boot
> process (i.e. a keyboard) has to be inserted in the lower port. I know
> the issue seems completely different from yours, but this might be an
> important point to get your issue properly solved.
>    
Just tried moving the power cable for my HDD to the lower port, that
made no difference.

I then tried plugging the power cable for hard drive into a HTC phone
charger. That made the drive show up without needing to use the
"hotplug" option.

So it seems this is indeed a timing issue between power up of the USB
port and initialisation of the SATA interface either because USB init is
being sequenced after SATA init or because the hard drive takes some
time from power up to being ready to talk on the SATA interface.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cubox i4x4 hard drive seen in D-I but not in installed system.

Vagrant Cascadian-5
In reply to this post by peter green-2
On 2016-12-13, peter green wrote:

> On 13/12/16 21:42, peter green wrote:
>> I would guess at this point either a race condition or a power glitch
>> (maybe powering the HDD off one of the USB ports wasn't such a good
>> idea).
>>
> OK, I found that adding  ahci-imx.hotplug=1 to the kernel command line
> made it work.
>
> Checking the schematic I notice that the USB ports seem to have power
> control, I wonder if they are power-cycled at some point during the boot
> process.
Had a similar issue on a Cubox-I4pro, and your ahci-imx.hotplug=1
workaround also worked for me.

Maybe it's not loading the USB drivers in the initramfs... or maybe it's
just a race condition.

A different (more cumbersome) workaround is making sure all the drivers
are available in the initramfs. I use this from time to time when adding
support to debian for new arm systems. Why it worked in this case seems
surprising... but... well...

/etc/initramfs-tools/hooks/all-drivers:
 
  #!/bin/sh
  # must be marked executable, e.g. chmod +x
 
  PREREQS=""
 
  prereqs() { echo "$PREREQS"; }
 
  case "$1" in
      prereqs)
      prereqs
      exit 0
      ;;
  esac
 
  . /usr/share/initramfs-tools/hook-functions
 
  copy_modules_dir kernel/drivers
 

lsmod from initramfs shell where it failed to mount the rootfs on sata:

  Module                  Size  Used by    Tainted: G  
  ci_hdrc_imx             6936  0
  ci_hdrc                35216  1 ci_hdrc_imx
  extcon_core            13223  1 ci_hdrc
  ahci_imx                6207  0
  ehci_hcd               64996  1 ci_hdrc
  libahci_platform        6494  1 ahci_imx
  libahci                23377  2 ahci_imx,libahci_platform
  udc_core               26444  1 ci_hdrc
  libata                192873  3 ahci_imx,libahci_platform,libahci
  usbcore               195888  2 ci_hdrc,ehci_hcd
  sdhci_esdhc_imx        12147  0
  sdhci_pltfm             3338  1 sdhci_esdhc_imx
  scsi_mod              187963  1 libata
  sdhci                  39324  2 sdhci_esdhc_imx,sdhci_pltfm
  usb_common              3659  3 ci_hdrc,udc_core,usbcore
  i2c_imx                15436  0
  usbmisc_imx             6594  1 ci_hdrc_imx
  anatop_regulator        4712  1
  phy_mxs_usb             6386  2
  at803x                  4176  0

lsmod on a successfully booted system:

  Module                  Size  Used by
  snd_soc_imx_spdif       1954  0
  sg                     23603  0
  snd_soc_fsl_spdif      16193  2
  imx_pcm_dma             1244  1 snd_soc_fsl_spdif
  snd_soc_core          144850  3 snd_soc_fsl_spdif,imx_pcm_dma,snd_soc_imx_spdif
  snd_pcm_dmaengine       3583  1 snd_soc_core
  snd_pcm                83374  2 snd_pcm_dmaengine,snd_soc_core
  snd_timer              20317  1 snd_pcm
  snd                    55403  3 snd_timer,snd_soc_core,snd_pcm
  soundcore               5571  1 snd
  ip_tables              12425  0
  x_tables               14826  1 ip_tables
  autofs4                32792  2
  ext4                  551118  2
  crc16                   1274  1 ext4
  jbd2                   94046  1 ext4
  crc32c_generic          1862  2
  fscrypto               15747  1 ext4
  ecb                     2191  0
  mbcache                 5508  3 ext4
  dm_mod                103345  7
  sd_mod                 32731  3
  brcmfmac              240005  0
  brcmutil                5789  1 brcmfmac
  cfg80211              475128  1 brcmfmac
  rfkill                 16819  2 cfg80211
  imx_ipuv3_crtc         10746  0
  ahci_imx                6207  2
  libahci_platform        6494  1 ahci_imx
  libahci                23377  2 libahci_platform,ahci_imx
  libata                192873  3 libahci_platform,libahci,ahci_imx
  ci_hdrc_imx             6936  0
  imx_ipu_v3             75709  1 imx_ipuv3_crtc
  ci_hdrc                35216  1 ci_hdrc_imx
  scsi_mod              187963  3 sd_mod,libata,sg
  extcon_core            13223  1 ci_hdrc
  ehci_hcd               64996  1 ci_hdrc
  udc_core               26444  1 ci_hdrc
  i2c_imx                15436  0
  sdhci_esdhc_imx        12147  0
  sdhci_pltfm             3338  1 sdhci_esdhc_imx
  usbcore               195888  3 ehci_hcd,brcmfmac,ci_hdrc
  sdhci                  39324  2 sdhci_pltfm,sdhci_esdhc_imx
  usbmisc_imx             6594  1 ci_hdrc_imx
  usb_common              3659  3 udc_core,usbcore,ci_hdrc
  ir_lirc_codec           5112  0
  anatop_regulator        4712  1
  phy_mxs_usb             6386  2
  imx2_wdt                4189  0
  dw_hdmi_imx             3203  0
  dw_hdmi                14062  1 dw_hdmi_imx
  imxdrm                  5486  1 imx_ipuv3_crtc
  drm_kms_helper        117326  4 imx_ipuv3_crtc,dw_hdmi,imxdrm
  lirc_dev                8715  1 ir_lirc_codec
  etnaviv                66053  0
  pwm_imx                 3678  1
  drm                   276288  7 imx_ipuv3_crtc,etnaviv,dw_hdmi,dw_hdmi_imx,imxdrm,drm_kms_helper
  evdev                  12740  0
  leds_pwm                3220  0
  gpio_ir_recv            3212  0
  at803x                  4176  0


live well,
  vagrant

signature.asc (847 bytes) Download Attachment
Loading...