veyron: Initialize EC interrupt GPIO and add them to coreboot tables
This patch initializes the GPIO for the Chrome EC interrupt line on Veyron boards and passes its description through the coreboot table, so that payloads with keyboard support can use it to detect pending key presses. BRANCH=none BUG=chrome-os-partner:39514 TEST=Booted Jerry, confirmed that it could still detect keypresses. Confirmed that EC log does not show a huge amount of MKBP polls. Change-Id: I8b426621af088460929cfff0a4b46618e2a86725 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/267344 Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 8ad95d667ef3af3fb217e3c370468dc1d6ec36c9) jwerner: Added Gus, Jaq, Minnie, Nicky and Thea. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/282560
This commit is contained in:
parent
c2e1aa94fa
commit
c858b043a1
9 changed files with 90 additions and 0 deletions
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -93,6 +95,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define GPIO_POWER GPIO(0, A, 5)
|
||||
#define GPIO_RECOVERY GPIO(0, B, 1)
|
||||
#define GPIO_ECINRW GPIO(0, A, 7)
|
||||
#define GPIO_ECIRQ GPIO(7, A, 7)
|
||||
|
||||
void setup_chromeos_gpios(void)
|
||||
{
|
||||
|
|
@ -39,6 +40,7 @@ void setup_chromeos_gpios(void)
|
|||
gpio_input_pullup(GPIO_LID);
|
||||
gpio_input(GPIO_POWER);
|
||||
gpio_input_pullup(GPIO_RECOVERY);
|
||||
gpio_input(GPIO_ECIRQ);
|
||||
}
|
||||
|
||||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
|
|
@ -92,6 +94,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* EC interrupt: GPIO active high */
|
||||
gpios->gpios[count].port = GPIO_ECIRQ.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[count].value = -1;
|
||||
strncpy((char *)gpios->gpios[count].name, "EC interrupt",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Reset: GPIO active high (output) */
|
||||
gpios->gpios[count].port = GPIO_RESET.raw;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue