exynos5420: Fix mmc clock source.

The DWMMC controller internally divided clock by values in CLKSEL registers,
so we must adjust MMC clock for that.

Added a divide function to stdlib.h which should be useful in other contexts.

BUG=none
TEST=emerge-peach_pit chromeos-coreboot-peach_pit # and boots successfully.

Change-Id: I44f55b634cfc6fd81d76631595b6928c862a219f
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66657
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
Hung-Te Lin 2013-08-22 23:56:35 +08:00 committed by ChromeBot
commit 89ed6c9154
2 changed files with 26 additions and 10 deletions

View file

@ -20,4 +20,12 @@ void *malloc(size_t size);
static inline void free(void *ptr) {}
#endif
/* not sure romcc will know how to handle this. */
#ifndef __ROMCC__
static inline unsigned long div_round_up(unsigned int n, unsigned int d)
{
return (n + d - 1) / d;
}
#endif
#endif /* STDLIB_H */