[coreboot-gerrit] Patch set updated for coreboot: 4dc8123 veyron: Add "backlight" GPIO to coreboot table
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Tue Apr 14 13:33:33 CEST 2015
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9652
-gerrit
commit 4dc8123f1cca59cc065b5b35c0959f8fb6b6df8b
Author: Julius Werner <jwerner at chromium.org>
Date: Wed Jan 21 15:28:07 2015 -0800
veyron: Add "backlight" GPIO to coreboot table
This patch adds a new "backlight" output GPIO to the coreboot table in
order to avoid redundantly defining that GPIO in the payload.
BRANCH=veyron
BUG=chrome-os-partner:34713
TEST=Tested together with corresponding depthcharge CL.
Change-Id: Ia997beb1a400136ad65d8f0217781c9782f6e8a5
Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
Original-Commit-Id: 04ce4c23573cf926aeef3d817d3ab00835f897c7
Original-Change-Id: I69b3c7ac6be4b9723b6a0dfecef5e1c4ea681aff
Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/242400
Original-Tested-by: Lin Huang <hl at rock-chips.com>
Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
src/mainboard/google/veyron_jerry/board.h | 1 +
src/mainboard/google/veyron_jerry/chromeos.c | 8 ++++++++
src/mainboard/google/veyron_jerry/mainboard.c | 6 +++---
src/mainboard/google/veyron_mighty/board.h | 1 +
src/mainboard/google/veyron_mighty/chromeos.c | 8 ++++++++
src/mainboard/google/veyron_mighty/mainboard.c | 6 +++---
src/mainboard/google/veyron_pinky/board.h | 1 +
src/mainboard/google/veyron_pinky/chromeos.c | 8 ++++++++
src/mainboard/google/veyron_pinky/mainboard.c | 6 +++---
src/mainboard/google/veyron_speedy/board.h | 1 +
src/mainboard/google/veyron_speedy/chromeos.c | 8 ++++++++
src/mainboard/google/veyron_speedy/mainboard.c | 6 +++---
12 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/src/mainboard/google/veyron_jerry/board.h b/src/mainboard/google/veyron_jerry/board.h
index be96ce7..3d567de 100644
--- a/src/mainboard/google/veyron_jerry/board.h
+++ b/src/mainboard/google/veyron_jerry/board.h
@@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
+#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
/* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */
diff --git a/src/mainboard/google/veyron_jerry/chromeos.c b/src/mainboard/google/veyron_jerry/chromeos.c
index 069b28b..d509a01 100644
--- a/src/mainboard/google/veyron_jerry/chromeos.c
+++ b/src/mainboard/google/veyron_jerry/chromeos.c
@@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
+ /* Backlight: GPIO active high (output) */
+ gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
+ gpios->gpios[count].polarity = ACTIVE_HIGH;
+ gpios->gpios[count].value = -1;
+ strncpy((char *)gpios->gpios[count].name, "backlight",
+ GPIO_MAX_NAME_LENGTH);
+ count++;
+
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;
diff --git a/src/mainboard/google/veyron_jerry/mainboard.c b/src/mainboard/google/veyron_jerry/mainboard.c
index d49e4d0..0d814d5 100644
--- a/src/mainboard/google/veyron_jerry/mainboard.c
+++ b/src/mainboard/google/veyron_jerry/mainboard.c
@@ -146,17 +146,17 @@ void mainboard_power_on_backlight(void)
{
switch (board_id()) {
case 2:
- gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}
diff --git a/src/mainboard/google/veyron_mighty/board.h b/src/mainboard/google/veyron_mighty/board.h
index 249552e..280568a 100644
--- a/src/mainboard/google/veyron_mighty/board.h
+++ b/src/mainboard/google/veyron_mighty/board.h
@@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
+#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
/* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */
diff --git a/src/mainboard/google/veyron_mighty/chromeos.c b/src/mainboard/google/veyron_mighty/chromeos.c
index 069b28b..d509a01 100644
--- a/src/mainboard/google/veyron_mighty/chromeos.c
+++ b/src/mainboard/google/veyron_mighty/chromeos.c
@@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
+ /* Backlight: GPIO active high (output) */
+ gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
+ gpios->gpios[count].polarity = ACTIVE_HIGH;
+ gpios->gpios[count].value = -1;
+ strncpy((char *)gpios->gpios[count].name, "backlight",
+ GPIO_MAX_NAME_LENGTH);
+ count++;
+
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;
diff --git a/src/mainboard/google/veyron_mighty/mainboard.c b/src/mainboard/google/veyron_mighty/mainboard.c
index 7eb3f43..2807b7b 100644
--- a/src/mainboard/google/veyron_mighty/mainboard.c
+++ b/src/mainboard/google/veyron_mighty/mainboard.c
@@ -146,17 +146,17 @@ void mainboard_power_on_backlight(void)
{
switch (board_id()) {
case 0:
- gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}
diff --git a/src/mainboard/google/veyron_pinky/board.h b/src/mainboard/google/veyron_pinky/board.h
index bf842c1..8fe102f 100644
--- a/src/mainboard/google/veyron_pinky/board.h
+++ b/src/mainboard/google/veyron_pinky/board.h
@@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
+#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET (board_id() > 0 ? GPIO(0, B, 5) : GPIO(0, B, 2))
/* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */
diff --git a/src/mainboard/google/veyron_pinky/chromeos.c b/src/mainboard/google/veyron_pinky/chromeos.c
index 83ca70b..dd781aa 100644
--- a/src/mainboard/google/veyron_pinky/chromeos.c
+++ b/src/mainboard/google/veyron_pinky/chromeos.c
@@ -101,6 +101,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
+ /* Backlight: GPIO active high (output) */
+ gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
+ gpios->gpios[count].polarity = ACTIVE_HIGH;
+ gpios->gpios[count].value = -1;
+ strncpy((char *)gpios->gpios[count].name, "backlight",
+ GPIO_MAX_NAME_LENGTH);
+ count++;
+
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;
diff --git a/src/mainboard/google/veyron_pinky/mainboard.c b/src/mainboard/google/veyron_pinky/mainboard.c
index 2500250..fd0c60d 100644
--- a/src/mainboard/google/veyron_pinky/mainboard.c
+++ b/src/mainboard/google/veyron_pinky/mainboard.c
@@ -192,17 +192,17 @@ void mainboard_power_on_backlight(void)
case 0:
case 1:
case 2:
- gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}
diff --git a/src/mainboard/google/veyron_speedy/board.h b/src/mainboard/google/veyron_speedy/board.h
index 244cdfb..817aac2 100644
--- a/src/mainboard/google/veyron_speedy/board.h
+++ b/src/mainboard/google/veyron_speedy/board.h
@@ -23,6 +23,7 @@
#include <boardid.h>
#include <gpio.h>
+#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5)
/* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */
diff --git a/src/mainboard/google/veyron_speedy/chromeos.c b/src/mainboard/google/veyron_speedy/chromeos.c
index 069b28b..d509a01 100644
--- a/src/mainboard/google/veyron_speedy/chromeos.c
+++ b/src/mainboard/google/veyron_speedy/chromeos.c
@@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
count++;
+ /* Backlight: GPIO active high (output) */
+ gpios->gpios[count].port = GPIO_BACKLIGHT.raw;
+ gpios->gpios[count].polarity = ACTIVE_HIGH;
+ gpios->gpios[count].value = -1;
+ strncpy((char *)gpios->gpios[count].name, "backlight",
+ GPIO_MAX_NAME_LENGTH);
+ count++;
+
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count;
diff --git a/src/mainboard/google/veyron_speedy/mainboard.c b/src/mainboard/google/veyron_speedy/mainboard.c
index 7eb3f43..2807b7b 100644
--- a/src/mainboard/google/veyron_speedy/mainboard.c
+++ b/src/mainboard/google/veyron_speedy/mainboard.c
@@ -146,17 +146,17 @@ void mainboard_power_on_backlight(void)
{
switch (board_id()) {
case 0:
- gpio_output(GPIO(7, A, 0), 0); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 0); /* BL_EN */
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10);
- gpio_output(GPIO(7, A, 0), 1); /* BL_EN */
+ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break;
}
}
More information about the coreboot-gerrit
mailing list