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@chromium.org>
Original-Commit-Id: 04ce4c23573cf926aeef3d817d3ab00835f897c7
Original-Change-Id: I69b3c7ac6be4b9723b6a0dfecef5e1c4ea681aff
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/242400
Original-Tested-by: Lin Huang <hl@rock-chips.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/9652
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
Julius Werner 2015-01-21 15:28:07 -08:00 committed by Stefan Reinauer
parent 25f5778f4a
commit 1f0569f01c
12 changed files with 48 additions and 12 deletions

View File

@ -23,6 +23,7 @@
#include <boardid.h> #include <boardid.h>
#include <gpio.h> #include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5) #define GPIO_RESET GPIO(0, B, 5)
/* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */ /* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */

View File

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH); GPIO_MAX_NAME_LENGTH);
count++; 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->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count; gpios->count = count;

View File

@ -141,17 +141,17 @@ void mainboard_power_on_backlight(void)
{ {
switch (board_id()) { switch (board_id()) {
case 2: 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 */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
default: default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */ gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
} }
} }

View File

@ -23,6 +23,7 @@
#include <boardid.h> #include <boardid.h>
#include <gpio.h> #include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5) #define GPIO_RESET GPIO(0, B, 5)
/* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */ /* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */

View File

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH); GPIO_MAX_NAME_LENGTH);
count++; 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->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count; gpios->count = count;

View File

@ -141,17 +141,17 @@ void mainboard_power_on_backlight(void)
{ {
switch (board_id()) { switch (board_id()) {
case 0: 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 */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
default: default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */ gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
} }
} }

View File

@ -23,6 +23,7 @@
#include <boardid.h> #include <boardid.h>
#include <gpio.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)) #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 */ /* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */

View File

@ -101,6 +101,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH); GPIO_MAX_NAME_LENGTH);
count++; 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->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count; gpios->count = count;

View File

@ -187,17 +187,17 @@ void mainboard_power_on_backlight(void)
case 0: case 0:
case 1: case 1:
case 2: 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 */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
default: default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */ gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
} }
} }

View File

@ -23,6 +23,7 @@
#include <boardid.h> #include <boardid.h>
#include <gpio.h> #include <gpio.h>
#define GPIO_BACKLIGHT GPIO(7, A, 0)
#define GPIO_RESET GPIO(0, B, 5) #define GPIO_RESET GPIO(0, B, 5)
/* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */ /* TODO: move setup_chromeos_gpios() here once bootblock code is in mainboard */

View File

@ -100,6 +100,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH); GPIO_MAX_NAME_LENGTH);
count++; 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->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
gpios->count = count; gpios->count = count;

View File

@ -141,17 +141,17 @@ void mainboard_power_on_backlight(void)
{ {
switch (board_id()) { switch (board_id()) {
case 0: 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 */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
default: default:
gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */ gpio_output(GPIO(2, B, 4), 1); /* BL_PWR_EN */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */ gpio_output(GPIO(7, A, 2), 1); /* LCD_BL */
mdelay(10); mdelay(10);
gpio_output(GPIO(7, A, 0), 1); /* BL_EN */ gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
break; break;
} }
} }