veyron: Change VCC10_LCD_PWREN_H to allowed maximum of 2.5V

LDO7 (VCC10_LCD_PWREN_H) is essentially just a glorified GPIO that turns
the real VCC10 regulator on or off. We tried setting it to 3.3V since it
matches the VCC33_SYS voltage on the input of that regulator. However,
we didn't notice that the LDO only supports going up to 2.5V.

This patch changes the voltage to the allowed maximum, which should
still work fine as an enable line (and is the same value used by the
kernel). This removes an assertion error in the ramstage.

Also change the PMIC driver to assert maximum VSEL values based on the
LDO, because the lower-voltage ones support one more setting. (LDO3 is
actually listed to only go up to 0b1111 in the manual, and has a weird
jump from 0b1101 -> 2.2V (skipping over 0b1110) to 0b1111 -> 2.5V. I
don't know if that's a documentation error or what they were smoking
when they designed that, but we don't need to care for now.)

BRANCH=None
BUG=None
TEST=Booted on Pinky, no more ASSERTION FAILED.

Change-Id: I38bf99e38822fd0883fd4d0bd9a1b01143545a95
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 70f3149efbc3aa9a03ab3fd5be99d17d9c5e1c87
Original-Change-Id: I68a3bb882cf25d98aca8922ede2a17e1ef6524de
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/228292
Original-Commit-Queue: Lin Huang <hl@rock-chips.com>
Original-Tested-by: Lin Huang <hl@rock-chips.com>
Original-Reviewed-by: Jerry Parson <jwp@chromium.org>
Reviewed-on: http://review.coreboot.org/9547
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Julius Werner 2014-11-06 14:33:12 -08:00 committed by Patrick Georgi
parent 0353c9f640
commit ef639b2dd3
3 changed files with 4 additions and 3 deletions

View File

@ -91,7 +91,7 @@ static void configure_lcd(void)
writel(IOMUX_LCDC, &rk3288_grf->iomux_lcdc); writel(IOMUX_LCDC, &rk3288_grf->iomux_lcdc);
rk808_configure_switch(PMIC_BUS, 2, 1); /* VCC18_LCD */ rk808_configure_switch(PMIC_BUS, 2, 1); /* VCC18_LCD */
rk808_configure_ldo(PMIC_BUS, 7, 3300); /* VCC10_LCD_PWREN_H */ rk808_configure_ldo(PMIC_BUS, 7, 2500); /* VCC10_LCD_PWREN_H */
rk808_configure_switch(PMIC_BUS, 1, 1); /* VCC33_LCD */ rk808_configure_switch(PMIC_BUS, 1, 1); /* VCC33_LCD */
gpio_output(GPIO(7, A, 0), 0); /* LCDC_BL */ gpio_output(GPIO(7, A, 0), 0); /* LCDC_BL */

View File

@ -121,7 +121,7 @@ static void configure_lcd(void)
break; break;
default: default:
rk808_configure_switch(PMIC_BUS, 2, 1); /* VCC18_LCD */ rk808_configure_switch(PMIC_BUS, 2, 1); /* VCC18_LCD */
rk808_configure_ldo(PMIC_BUS, 7, 3300); /* VCC10_LCD_PWREN_H */ rk808_configure_ldo(PMIC_BUS, 7, 2500); /* VCC10_LCD_PWREN_H */
rk808_configure_switch(PMIC_BUS, 1, 1); /* VCC33_LCD */ rk808_configure_switch(PMIC_BUS, 1, 1); /* VCC33_LCD */
break; break;
} }

View File

@ -60,16 +60,17 @@ void rk808_configure_ldo(uint8_t bus, int ldo, int millivolts)
case 5: case 5:
case 8: case 8:
vsel = div_round_up(millivolts, 100) - 18; vsel = div_round_up(millivolts, 100) - 18;
assert(vsel <= 0x10);
break; break;
case 3: case 3:
case 6: case 6:
case 7: case 7:
vsel = div_round_up(millivolts, 100) - 8; vsel = div_round_up(millivolts, 100) - 8;
assert(vsel <= 0x11);
break; break;
default: default:
die("Unknown LDO index!"); die("Unknown LDO index!");
} }
assert(vsel <= 0x10);
rk808_clrsetbits(bus, LDO_ONSEL(ldo), 0x1f, vsel); rk808_clrsetbits(bus, LDO_ONSEL(ldo), 0x1f, vsel);
rk808_clrsetbits(bus, LDO_EN, 0, 1 << (ldo - 1)); rk808_clrsetbits(bus, LDO_EN, 0, 1 << (ldo - 1));