summaryrefslogtreecommitdiffstats
path: root/op-pwrctl/power_control_obj.c
diff options
context:
space:
mode:
authorYi Li <adamliyi@msn.com>2016-12-16 16:06:50 +0800
committerPatrick Williams <patrick@stwcx.xyz>2016-12-19 13:31:20 +0000
commit39df4035c0dc3cb3ae8131b93ae9641e0d1e7f83 (patch)
treeb20ded70c71e1e23123536a7d43c912bdb7ac37f /op-pwrctl/power_control_obj.c
parent51e0b89808b44838722f5572375f7e546897a41b (diff)
downloadblackbird-skeleton-39df4035c0dc3cb3ae8131b93ae9641e0d1e7f83.tar.gz
blackbird-skeleton-39df4035c0dc3cb3ae8131b93ae9641e0d1e7f83.zip
Fix wrong reset pin setting
When power on or power off host, the way to set reset pins based on pin polarity is not correct. This makes PCIE devices not working properly. This patch fixed bug introduced by commit: https://github.com/openbmc/skeleton/commit/3ab5436 and https://github.com/openbmc/skeleton/commit/0475f65 The relationship between expected reset pin state and pgood state looks like: pgood polarilty reset_pin(expected) 1 0 1 0 0 0 1 1 0 0 1 1 Related with openbmc/openbmc#876 Change-Id: Id0b36c15ed645c29f3ccc2aa507e50b31a718bb9 Signed-off-by: Yi Li <adamliyi@msn.com>
Diffstat (limited to 'op-pwrctl/power_control_obj.c')
-rw-r--r--op-pwrctl/power_control_obj.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/op-pwrctl/power_control_obj.c b/op-pwrctl/power_control_obj.c
index f6cfdbc..9cf8ce4 100644
--- a/op-pwrctl/power_control_obj.c
+++ b/op-pwrctl/power_control_obj.c
@@ -91,9 +91,9 @@ poll_pgood(gpointer user_data)
continue;
}
- reset_state = pgood_state ^ !g_power_gpio.reset_pols[i];
- g_print("PowerControl: setting reset %s to %d\n", reset_out->name,
- (int)reset_state);
+ reset_state = pgood_state ^ g_power_gpio.reset_pols[i];
+ g_print("PowerControl: pgood: %d, setting reset %s to %d\n",
+ (int)pgood_state, reset_out->name, (int)reset_state);
gpio_write(reset_out, reset_state);
gpio_close(reset_out);
}
@@ -121,9 +121,9 @@ poll_pgood(gpointer user_data)
continue;
}
- reset_state = pgood_state ^ !g_power_gpio.pci_reset_pols[i];
- g_print("PowerControl: setting pci reset %s to %d\n", pci_reset_out->name,
- (int)reset_state);
+ reset_state = pgood_state ^ g_power_gpio.pci_reset_pols[i];
+ g_print("PowerControl: pgood: %d, setting pci reset %s to %d\n",
+ (int)pgood_state, pci_reset_out->name, (int)reset_state);
gpio_write(pci_reset_out, reset_state);
gpio_close(pci_reset_out);
}
@@ -203,9 +203,9 @@ on_boot_progress(GDBusConnection *connection,
continue;
}
- reset_state = pgood_state ^ !g_power_gpio.pci_reset_pols[i];
- g_print("PowerControl: setting pci reset %s to %d\n", pci_reset_out->name,
- (int)reset_state);
+ reset_state = pgood_state ^ g_power_gpio.pci_reset_pols[i];
+ g_print("PowerControl: pgood: %d, setting pci reset %s to %d\n",
+ (int)pgood_state, pci_reset_out->name, (int)reset_state);
gpio_write(pci_reset_out, reset_state);
gpio_close(pci_reset_out);
g_print("Released pci reset: %s - %s\n", pci_reset_out->name, boot_progress);
OpenPOWER on IntegriCloud