summaryrefslogtreecommitdiff
path: root/src/cpu/samsung
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/samsung')
-rw-r--r--src/cpu/samsung/exynos5250/cpu.c2
-rw-r--r--src/cpu/samsung/exynos5420/clock.c7
-rw-r--r--src/cpu/samsung/exynos5420/cpu.c4
3 files changed, 4 insertions, 9 deletions
diff --git a/src/cpu/samsung/exynos5250/cpu.c b/src/cpu/samsung/exynos5250/cpu.c
index 2354be1352..9a44409402 100644
--- a/src/cpu/samsung/exynos5250/cpu.c
+++ b/src/cpu/samsung/exynos5250/cpu.c
@@ -140,7 +140,7 @@ static void cpu_enable(device_t dev)
u32 lcdbase = get_fb_base_kb() * KiB;
ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB - FB_SIZE_KB);
- mmio_resource(dev, 1, lcdbase / KiB, (fb_size + KiB - 1) / KiB);
+ mmio_resource(dev, 1, lcdbase / KiB, CEIL_DIV(fb_size, KiB));
exynos_displayport_init(dev, lcdbase, fb_size);
diff --git a/src/cpu/samsung/exynos5420/clock.c b/src/cpu/samsung/exynos5420/clock.c
index 34d3fb58dc..7ecb717d75 100644
--- a/src/cpu/samsung/exynos5420/clock.c
+++ b/src/cpu/samsung/exynos5420/clock.c
@@ -40,11 +40,6 @@ static struct st_epll_con_val epll_div[] = {
{ 180633600, 0, 45, 3, 1, 10381 }
};
-static inline unsigned long div_round_up(unsigned int n, unsigned int d)
-{
- return (n + d - 1) / d;
-}
-
/* exynos5: return pll clock frequency */
unsigned long get_pll_clk(int pllreg)
{
@@ -346,7 +341,7 @@ int clock_set_dwmci(enum periph_id peripheral)
if (!sclk) {
return -1;
}
- div = div_round_up(sclk, freq);
+ div = CEIL_DIV(sclk, freq);
set_mmc_clk(device_index, div);
return 0;
}
diff --git a/src/cpu/samsung/exynos5420/cpu.c b/src/cpu/samsung/exynos5420/cpu.c
index 5ff345eaa8..176a3f2595 100644
--- a/src/cpu/samsung/exynos5420/cpu.c
+++ b/src/cpu/samsung/exynos5420/cpu.c
@@ -140,7 +140,7 @@ static void exynos_displayport_init(device_t dev, u32 lcdbase,
dcache_clean_invalidate_by_mva(lower, upper - lower);
mmu_config_range(lower / MiB, (upper - lower) / MiB, DCACHE_OFF);
- mmio_resource(dev, 1, lcdbase/KiB, (fb_size + KiB - 1)/KiB);
+ mmio_resource(dev, 1, lcdbase/KiB, CEIL_DIV(fb_size, KiB));
}
static void tps65090_thru_ec_fet_disable(int index)
@@ -160,7 +160,7 @@ static void cpu_enable(device_t dev)
u32 lcdbase = get_fb_base_kb() * KiB;
ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB - FB_SIZE_KB);
- mmio_resource(dev, 1, lcdbase / KiB, (fb_size + KiB - 1) / KiB);
+ mmio_resource(dev, 1, lcdbase / KiB, CEIL_DIV(fb_size, KiB));
/*
* Disable LCD FETs before we do anything with the display.