From e3deec949df7ddad13b24103b2a70d9ceaa73ecc Mon Sep 17 00:00:00 2001 From: Szymon Dziok Date: Sun, 25 Sep 2016 23:11:21 +0200 Subject: HDD6330: Implement ATA power on/off. This should fix some errors, panics in some individual cases. Change-Id: I27ce41f0563378e03371724f8b044404c6e69b76 --- firmware/target/arm/philips/power-hdd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'firmware/target') diff --git a/firmware/target/arm/philips/power-hdd.c b/firmware/target/arm/philips/power-hdd.c index d38c6de2b4..05ada4b674 100644 --- a/firmware/target/arm/philips/power-hdd.c +++ b/firmware/target/arm/philips/power-hdd.c @@ -99,14 +99,31 @@ unsigned int power_input_status(void) void ide_power_enable(bool on) { +#if defined(PHILIPS_HDD6330) + if (on) + { + GPIO_SET_BITWISE(GPIOC_OUTPUT_VAL, 0x08); + DEV_EN |= DEV_IDE0; + } + else + { + DEV_EN &= ~DEV_IDE0; + GPIO_CLEAR_BITWISE(GPIOC_OUTPUT_VAL, 0x08); + } +#else (void)on; /* We do nothing */ +#endif } bool ide_powered(void) { +#if defined(PHILIPS_HDD6330) + return ((GPIOC_INPUT_VAL & 0x08) != 0); +#else /* pretend we are always powered - we don't turn it off */ return true; +#endif } void power_off(void) -- cgit v1.2.3