From 75f431a8edfe4215d1a6d0bc505e28c629e6d6fd Mon Sep 17 00:00:00 2001 From: huang lin Date: Fri, 23 Jan 2015 14:48:42 +0800 Subject: rk3288: set the rk808 BUCK default inductor current to max value Our use of the bucks may exceed their default maximum inductor current. Just set it to the highest possible value for every buck we configure to avoid problems... the kernel can later fine-tune the values further if needed. (Also some slight grammar updates while I'm in there.) BRANCH=veyron TEST=Build and Boot on Jerry BUG=None Change-Id: If8258cf4feefe191604365405bff1f20c8ab8746 Signed-off-by: Stefan Reinauer Original-Commit-Id: 065a163bb902b8c96d05bfef6ed4885aa20f31cc Original-Change-Id: I3801cabeb93d7bf7ecc02db0e69d4932c9394db9 Original-Signed-off-by: huang lin Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/242785 Original-Reviewed-by: Douglas Anderson Reviewed-on: http://review.coreboot.org/9655 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/soc/rockchip/rk3288/rk808.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/soc/rockchip/rk3288/rk808.c b/src/soc/rockchip/rk3288/rk808.c index b763454903..d375f46483 100644 --- a/src/soc/rockchip/rk3288/rk808.c +++ b/src/soc/rockchip/rk3288/rk808.c @@ -54,6 +54,8 @@ #define RTC_CTRL_GET_TIME (1 << 6) #define RTC_CTRL_RTC_READSEL (1 << 7) +#define DCDC_ILMAX 0x90 + static int rk808_read(uint8_t reg, uint8_t *value) { return i2c_readb(CONFIG_PMIC_BUS, RK808_ADDR, reg, value); @@ -118,7 +120,7 @@ void rk808_configure_buck(int buck, int millivolts) switch (buck) { case 1: case 2: - /*base on 725mv, use 25mv step */ + /* 25mV steps. base = 29 * 25mV = 725 */ vsel = (div_round_up(millivolts, 25) - 29) * 2 + 1; assert(vsel <= 0x3f); buck_reg = BUCK1SEL + 4 * (buck - 1); @@ -129,8 +131,9 @@ void rk808_configure_buck(int buck, int millivolts) buck_reg = BUCK4SEL; break; default: - die("fault buck index!"); + die("Unknown buck index!"); } + rk808_clrsetbits(DCDC_ILMAX, 0, 3 << ((buck - 1) * 2)); rk808_clrsetbits(buck_reg, 0x3f, vsel); rk808_clrsetbits(DCDC_EN, 0, 1 << (buck - 1)); } -- cgit v1.2.3