veyron: Adapt to new board revisions
This patch adds support for Pinky rev3 (board ID 2) and Jerry rev2: the power button GPIO changed polarity to low, the 5V_DRV pin for USB power was moved to the AP again (welcome back!), and the EMMC_RST_L is now finally on a port with the right IO voltage so we don't need any weird pull-up tricks anymore. Since there are very few Jerry rev1s around, we'll just move it over to the new code directly without introducing board ID differences (also, because I have no idea how they stuffed it this time... is this one actually called rev2?). BRANCH=None BUG=None TEST=Still boots on my Pinky rev2, though that doesn't say much. Change-Id: Id11044cedcaac5a4ae07e696893823925107a6db Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 55344a9518ff04edcef01bcd40817e9e4b613717 Original-Change-Id: Iddee360fbda357ecde4ae5fbb5c3a01fe0c22474 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/229010 Original-Reviewed-by: Lin Huang <hl@rock-chips.com> Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/9551 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
63451c73bd
commit
5016820cc9
|
@ -67,7 +67,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
||||||
|
|
||||||
/* Power:GPIO active high */
|
/* Power:GPIO active high */
|
||||||
gpios->gpios[count].port = GPIO_POWER.raw;
|
gpios->gpios[count].port = GPIO_POWER.raw;
|
||||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||||
gpios->gpios[count].value = gpio_get(GPIO_POWER);
|
gpios->gpios[count].value = gpio_get(GPIO_POWER);
|
||||||
strncpy((char *)gpios->gpios[count].name, "power",
|
strncpy((char *)gpios->gpios[count].name, "power",
|
||||||
GPIO_MAX_NAME_LENGTH);
|
GPIO_MAX_NAME_LENGTH);
|
||||||
|
|
|
@ -42,6 +42,7 @@ static void configure_usb(void)
|
||||||
{
|
{
|
||||||
gpio_output(GPIO(0, B, 3), 1); /* HOST1_PWR_EN */
|
gpio_output(GPIO(0, B, 3), 1); /* HOST1_PWR_EN */
|
||||||
gpio_output(GPIO(0, B, 4), 1); /* USBOTG_PWREN_H */
|
gpio_output(GPIO(0, B, 4), 1); /* USBOTG_PWREN_H */
|
||||||
|
gpio_output(GPIO(7, C, 5), 1); /* 5V_DRV */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void configure_sdmmc(void)
|
static void configure_sdmmc(void)
|
||||||
|
@ -63,12 +64,7 @@ static void configure_emmc(void)
|
||||||
writel(IOMUX_EMMCPWREN, &rk3288_grf->iomux_emmcpwren);
|
writel(IOMUX_EMMCPWREN, &rk3288_grf->iomux_emmcpwren);
|
||||||
writel(IOMUX_EMMCCMD, &rk3288_grf->iomux_emmccmd);
|
writel(IOMUX_EMMCCMD, &rk3288_grf->iomux_emmccmd);
|
||||||
|
|
||||||
/*
|
gpio_output(GPIO(2, B, 1), 1); /* EMMC_RST_L */
|
||||||
* Use a pullup instead of a drive since the output is 3.3V and
|
|
||||||
* really should be 1.8V (oops). The external pulldown will help
|
|
||||||
* bring the voltage down if we only drive with a pullup here.
|
|
||||||
*/
|
|
||||||
gpio_input_pullup(GPIO(7, B, 4)); /* EMMC_RST_L */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void configure_codec(void)
|
static void configure_codec(void)
|
||||||
|
|
|
@ -69,7 +69,8 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
||||||
|
|
||||||
/* Power:GPIO active high */
|
/* Power:GPIO active high */
|
||||||
gpios->gpios[count].port = GPIO_POWER.raw;
|
gpios->gpios[count].port = GPIO_POWER.raw;
|
||||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
gpios->gpios[count].polarity = board_id() > 1 ? ACTIVE_LOW :
|
||||||
|
ACTIVE_HIGH;
|
||||||
gpios->gpios[count].value = gpio_get(GPIO_POWER);
|
gpios->gpios[count].value = gpio_get(GPIO_POWER);
|
||||||
strncpy((char *)gpios->gpios[count].name, "power",
|
strncpy((char *)gpios->gpios[count].name, "power",
|
||||||
GPIO_MAX_NAME_LENGTH);
|
GPIO_MAX_NAME_LENGTH);
|
||||||
|
|
|
@ -47,8 +47,11 @@ static void configure_usb(void)
|
||||||
case 0:
|
case 0:
|
||||||
gpio_output(GPIO(7, B, 3), 1); /* 5V_DRV */
|
gpio_output(GPIO(7, B, 3), 1); /* 5V_DRV */
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
break; /* 5V_DRV moved to EC in rev2 */
|
||||||
default:
|
default:
|
||||||
break; /* 5V_DRV moved to EC after rev1 */
|
gpio_output(GPIO(7, C, 5), 1); /* 5V_DRV, again */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,12 +82,20 @@ static void configure_emmc(void)
|
||||||
writel(IOMUX_EMMCPWREN, &rk3288_grf->iomux_emmcpwren);
|
writel(IOMUX_EMMCPWREN, &rk3288_grf->iomux_emmcpwren);
|
||||||
writel(IOMUX_EMMCCMD, &rk3288_grf->iomux_emmccmd);
|
writel(IOMUX_EMMCCMD, &rk3288_grf->iomux_emmccmd);
|
||||||
|
|
||||||
|
switch (board_id()) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
/*
|
/*
|
||||||
* Use a pullup instead of a drive since the output is 3.3V and
|
* Use a pullup instead of a drive since the output is 3.3V and
|
||||||
* really should be 1.8V (oops). The external pulldown will help
|
* really should be 1.8V (oops). The external pulldown will help
|
||||||
* bring the voltage down if we only drive with a pullup here.
|
* bring the voltage down if we only drive with a pullup here.
|
||||||
*/
|
*/
|
||||||
gpio_input_pullup(GPIO(7, B, 4)); /* EMMC_RST_L */
|
gpio_input_pullup(GPIO(7, B, 4)); /* EMMC_RST_L */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gpio_output(GPIO(2, B, 1), 1); /* EMMC_RST_L */
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void configure_codec(void)
|
static void configure_codec(void)
|
||||||
|
|
Loading…
Reference in New Issue