Hi Hans, On Mon, 10 November 2014 Hans de Goede wrote: > On 11/08/2014 08:34 PM, Bruno Prémont wrote: > > Since updating my cubietruck to u-boot-2014.10 the SATA hard drive > > connected to it performs emergency head parking around the time > > uboot hands over control to kernel (or kernel is booting). > > > > The same issue also exists during reboot. > > Right, during reboot there unfortunately is nothing we can do to avoid this > afaik. Although there is one thing which you could try, edit: > > linux/drivers/ata/libahci_platform.c > > Around line 500 you should find the following in there: > > static void ahci_host_stop(struct ata_host *host) > { > struct ahci_host_priv *hpriv = host->private_data; > > ahci_platform_disable_resources(hpriv); > } > > Try commenting out the ahci_platform_disable_resources() call, I'm not sure > if this gets called at reboot / shutdown, but if it does then it could be > the culprit, although I think the real problem is that the SoC at reset > tri-states all its gpio-s.
I don't care too much about the linux shutdown/reboot as the patch I included does a good job there. (also useful on my x86 Acer TM660 laptop!) I might retry getting it upstream (a few years ago I sent one with DMI match for just my laptop, but it was not applied). With a few devices affected, and that cross-platform, applying it would make some more sense. > > Looking at the changes in u-boot-2014.10 SATA support has been added. > > > > It looks like u-boot is setting up SATA then kernel is doing the same, > > killing SATA power while reconfiguring the AHCI or SATApower GPIO. > > Hmm, good one, I think we can avoid this from happening with the following > patch: > > diff --git a/arch/arm/boot/dts/sunxi-common-regulators.dtsi > b/arch/arm/boot/dts/sunxi-common-regulators.dtsi > index c9c5b10..a950671 100644 > --- a/arch/arm/boot/dts/sunxi-common-regulators.dtsi > +++ b/arch/arm/boot/dts/sunxi-common-regulators.dtsi > @@ -44,6 +44,7 @@ > regulator-name = "ahci-5v"; > regulator-min-microvolt = <5000000>; > regulator-max-microvolt = <5000000>; > + regulator-boot-on; > enable-active-high; > gpio = <&pio 1 8 0>; > status = "disabled"; > > Can you try applying this, then do "make dtbs" in your kernel sources > dir and copy the new cubietruck dtb file to your sdcard, and give things > a spin ? Works like a charm! Does it have any impact when: - u-boot does not support SATA/AHCI - u-boot does not initialize SATA/AHCI - there is no SATA drive connected? Reported-and-Tested-by: Bruno Prémont <bonb...@linux-vserver.org> Thanks, Bruno -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.