mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
Invert write protect signal
Write protect is active-high, not active-low. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8580 TEST=manual From chroot: dut-control fw_wp_en:on dut-control mfg_mode:on From console: gpioget WRITE_PROTECT 0 WRITE_PROTECT From chroot: dut-control fw_wp_en:on dut-control mfg_mode:off From console: gpioget WRITE_PROTECT 1 WRITE_PROTECT Change-Id: I81c7858cac43c6c9b8630bf7f5aa0f491e6554ad
This commit is contained in:
@@ -78,7 +78,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = {
|
||||
GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SUSACKn"),
|
||||
GPIO_SIGNAL_NOT_IMPLEMENTED("SHUNT_1_5V_DDR"),
|
||||
GPIO_SIGNAL_NOT_IMPLEMENTED("RECOVERYn"),
|
||||
GPIO_SIGNAL_NOT_IMPLEMENTED("WRITE_PROTECTn"),
|
||||
GPIO_SIGNAL_NOT_IMPLEMENTED("WRITE_PROTECT"),
|
||||
GPIO_SIGNAL_NOT_IMPLEMENTED("LIGHTBAR_RESETn"),
|
||||
};
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ enum gpio_signal {
|
||||
GPIO_SHUNT_1_5V_DDR, /* Shunt +1.5V_DDR; may also enable +3V_TP
|
||||
* depending on stuffing. */
|
||||
GPIO_RECOVERYn, /* Recovery signal from servo */
|
||||
GPIO_WRITE_PROTECTn, /* Write protect input */
|
||||
GPIO_WRITE_PROTECT, /* Write protect input */
|
||||
GPIO_LIGHTBAR_RESETn, /* Reset lightbar controllers (Proto1+) */
|
||||
|
||||
/* Number of GPIOs; not an actual GPIO */
|
||||
|
||||
@@ -68,7 +68,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = {
|
||||
power_button_interrupt},
|
||||
{"USB1_STATUSn", LM4_GPIO_E, (1<<7), 0, NULL},
|
||||
{"USB2_STATUSn", LM4_GPIO_E, (1<<1), 0, NULL},
|
||||
{"WRITE_PROTECTn", LM4_GPIO_J, (1<<4), GPIO_INT_BOTH,
|
||||
{"WRITE_PROTECT", LM4_GPIO_J, (1<<4), GPIO_INT_BOTH,
|
||||
power_button_interrupt},
|
||||
/* Outputs; all unasserted by default except for reset signals */
|
||||
{"CPU_PROCHOTn", LM4_GPIO_F, (1<<2), GPIO_OUT_HIGH, NULL},
|
||||
|
||||
@@ -127,7 +127,7 @@ enum gpio_signal {
|
||||
GPIO_RECOVERYn, /* Recovery signal from servo */
|
||||
GPIO_USB1_STATUSn, /* USB charger port 1 status output */
|
||||
GPIO_USB2_STATUSn, /* USB charger port 2 status output */
|
||||
GPIO_WRITE_PROTECTn, /* Write protect input */
|
||||
GPIO_WRITE_PROTECT, /* Write protect input */
|
||||
/* Outputs */
|
||||
GPIO_CPU_PROCHOTn, /* Force CPU to think it's overheated */
|
||||
GPIO_ENABLE_1_5V_DDR, /* Enable +1.5V_DDR supply */
|
||||
|
||||
@@ -71,7 +71,7 @@ static uint8_t *memmap_switches;
|
||||
/* Update status of non-debounced switches */
|
||||
static void update_other_switches(void)
|
||||
{
|
||||
if (gpio_get_level(GPIO_WRITE_PROTECTn) != 0)
|
||||
if (gpio_get_level(GPIO_WRITE_PROTECT) == 0)
|
||||
*memmap_switches |= EC_LPC_SWITCH_WRITE_PROTECT_DISABLED;
|
||||
else
|
||||
*memmap_switches &= ~EC_LPC_SWITCH_WRITE_PROTECT_DISABLED;
|
||||
@@ -265,7 +265,7 @@ int power_button_init(void)
|
||||
/* Enable interrupts, now that we've initialized */
|
||||
gpio_enable_interrupt(GPIO_POWER_BUTTONn);
|
||||
gpio_enable_interrupt(GPIO_LID_SWITCHn);
|
||||
gpio_enable_interrupt(GPIO_WRITE_PROTECTn);
|
||||
gpio_enable_interrupt(GPIO_WRITE_PROTECT);
|
||||
gpio_enable_interrupt(GPIO_RECOVERYn);
|
||||
|
||||
return EC_SUCCESS;
|
||||
|
||||
@@ -30,7 +30,7 @@ static struct persist_state pstate; /* RAM copy of pstate data */
|
||||
/* Return non-zero if the write protect pin is asserted */
|
||||
static int wp_pin_asserted(void)
|
||||
{
|
||||
return gpio_get_level(GPIO_WRITE_PROTECTn) == 0 ? 1 : 0;
|
||||
return gpio_get_level(GPIO_WRITE_PROTECT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user