summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsselvar2 <susendra.selvaraj@intel.com>2016-06-09 21:20:08 +0530
committerchrome-bot <chrome-bot@chromium.org>2016-07-26 17:32:33 -0700
commitbba272a8776c61f308aafa5ed7d8bbd1f99f5282 (patch)
treeed429676818be996b2f44e5807ed37e5e9dbfcc1
parent085c20557c1f0b936a27b945185e620fdf47c36d (diff)
downloadvboot-bba272a8776c61f308aafa5ed7d8bbd1f99f5282.tar.gz
apollolake: Find GPIO bank offset for write protect pin
Specify function to find GPIO bank offset for write protect pin in Broxton. BUG=chrome-os-partner:55604 BRANCH=none TEST=verify crossystem output with and without WP screw. Change-Id: Ied41f31e59e0dfc699fbcd1b6bb8688f1fea549c Signed-off-by: sselvar2 <susendra.selvaraj@intel.com> Reviewed-on: https://chromium-review.googlesource.com/358124 Commit-Ready: Aaron Durbin <adurbin@chromium.org> Tested-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--host/arch/x86/lib/crossystem_arch.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c
index f9ce01f6..d7e89fe1 100644
--- a/host/arch/x86/lib/crossystem_arch.c
+++ b/host/arch/x86/lib/crossystem_arch.c
@@ -493,6 +493,7 @@ static int FindGpioChipOffsetByLabel(unsigned *gpio_num, unsigned *offset,
char filename[128];
char chiplabel[128];
int match = 0;
+ unsigned controller_offset = 0;
dir = opendir(GPIO_BASE_PATH);
if (!dir) {
@@ -500,16 +501,21 @@ static int FindGpioChipOffsetByLabel(unsigned *gpio_num, unsigned *offset,
}
while(0 != (ent = readdir(dir))) {
- if (1 == sscanf(ent->d_name, "gpiochip%u", offset)) {
+ if (1 == sscanf(ent->d_name, "gpiochip%u", &controller_offset)) {
/*
* Read the file at gpiochip<O>/label to get the identifier
* for this bank of GPIOs.
*/
snprintf(filename, sizeof(filename), "%s/gpiochip%u/label",
- GPIO_BASE_PATH, *offset);
+ GPIO_BASE_PATH, controller_offset);
if (ReadFileString(chiplabel, sizeof(chiplabel), filename)) {
- if (!strncasecmp(chiplabel, name, strlen(name)))
+ if (!strncasecmp(chiplabel, name, strlen(name))) {
+ /*
+ * Store offset when chip label is matched.
+ */
+ *offset = controller_offset;
match++;
+ }
}
}
}
@@ -629,6 +635,10 @@ static const struct GpioChipset chipsets_supported[] = {
{ "PCH-LP", FindGpioChipOffset },
{ "INT3437:00", FindGpioChipOffsetByLabel },
{ "INT344B:00", FindGpioChipOffsetByLabel },
+ { "INT3452:00", FindGpioChipOffsetByLabel }, /* INT3452 are for Apollolake */
+ { "INT3452:01", FindGpioChipOffsetByLabel },
+ { "INT3452:02", FindGpioChipOffsetByLabel },
+ { "INT3452:03", FindGpioChipOffsetByLabel },
{ "BayTrail", BayTrailFindGpioChipOffset },
{ "Braswell", BraswellFindGpioChipOffset },
{ NULL },