diff options
author | David Hendricks <dhendrix@chromium.org> | 2013-06-15 19:22:06 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2013-07-10 21:50:23 +0200 |
commit | eb9517cce9dfdc042ca1a9a2d7f6dd14d6d4fafc (patch) | |
tree | 35a8c86a5679cf0688fc2d84ac7ae4788f22f342 /src/cpu/samsung/exynos5420 | |
parent | ff7c8e82d10a48f7d123755b33bef9ffbf01d90d (diff) |
exynos5420: add I2C8-10 to clock_get_periph_rate()
This adds entries for I2C8-10 to giant switch statement in
clock_get_periph_rate(). It also eliminates the I2C peripheral's
usage of clk_bit_info since it's confusing and error-prone.
Change-Id: I30dfc4c9a03fbf16d08e44e074189fb9021edb6d
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Reviewed-on: http://review.coreboot.org/3676
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/cpu/samsung/exynos5420')
-rw-r--r-- | src/cpu/samsung/exynos5420/clock.c | 16 | ||||
-rw-r--r-- | src/cpu/samsung/exynos5420/periph.h | 3 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/cpu/samsung/exynos5420/clock.c b/src/cpu/samsung/exynos5420/clock.c index 1df4abad6c..8799149627 100644 --- a/src/cpu/samsung/exynos5420/clock.c +++ b/src/cpu/samsung/exynos5420/clock.c @@ -47,14 +47,7 @@ static struct clk_bit_info clk_bit_info[PERIPH_ID_COUNT] = { {4, 12, 16}, {-1, -1, -1}, {-1, -1, -1}, - {-1, 24, 0}, - {-1, 24, 0}, - {-1, 24, 0}, - {-1, 24, 0}, - {-1, 24, 0}, - {-1, 24, 0}, - {-1, 24, 0}, - {-1, 24, 0}, + [PERIPH_ID_DPHPD] {24, 0, -1}, {24, 0, -1}, {24, 0, -1}, @@ -200,9 +193,12 @@ unsigned long clock_get_periph_rate(enum periph_id peripheral) case PERIPH_ID_I2C5: case PERIPH_ID_I2C6: case PERIPH_ID_I2C7: + case PERIPH_ID_I2C8: + case PERIPH_ID_I2C9: + case PERIPH_ID_I2C10: sclk = get_pll_clk(MPLL); - sub_div = ((readl(&clk->div_top1) >> bit_info->div_bit) & 0x7) + 1; - div = ((readl(&clk->div_top0) >> bit_info->prediv_bit) & 0x7) + 1; + sub_div = ((readl(&clk->div_top1) >> 24) & 0x7) + 1; + div = (readl(&clk->div_top0) & 0x7) + 1; return (sclk / sub_div) / div; default: printk(BIOS_DEBUG, "%s: invalid peripheral %d", __func__, peripheral); diff --git a/src/cpu/samsung/exynos5420/periph.h b/src/cpu/samsung/exynos5420/periph.h index 39816624c2..94f150e6dd 100644 --- a/src/cpu/samsung/exynos5420/periph.h +++ b/src/cpu/samsung/exynos5420/periph.h @@ -53,6 +53,9 @@ enum periph_id { PERIPH_ID_I2C5, PERIPH_ID_I2C6, PERIPH_ID_I2C7, + PERIPH_ID_I2C8, + PERIPH_ID_I2C9, + PERIPH_ID_I2C10, PERIPH_ID_DPHPD, /* eDP hot plug detect */ PERIPH_ID_PWM0, PERIPH_ID_PWM1, |