Hi,
On 11/08/2014 08:34 PM, Bruno Prémont wrote:
> Hi,
>
> 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.
> 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 ?
Regards,
Hans