diff options
author | Julius Werner <jwerner@chromium.org> | 2013-08-29 14:17:36 -0700 |
---|---|---|
committer | Isaac Christensen <isaac.christensen@se-eng.com> | 2014-08-14 01:43:11 +0200 |
commit | fa938c7508627c0dfcf03960957ef8631fc53f02 (patch) | |
tree | 369a6f41d6a4a152ec933b08e869d6bb527adac4 /src/cpu/samsung/exynos5420/fimd.c | |
parent | 755615a12310469b34fc4804bcf2622eb587949c (diff) | |
download | coreboot-fa938c7508627c0dfcf03960957ef8631fc53f02.tar.xz |
exynos5: Refactor crazy old U-Boot base address macros away
All this samsung_get_base_address_of_device_with_a_really_long_name()
boilerplate makes my eyes bleed... I think there are so much cleaner
ways to do this. Unfortunately changing this ends up touching nearly
every Exynos5 file, but I hope you agree that it's worth it (and the
sooner we get it over with, the better... I can't bring myself to make
another device fit into that ugly scheme).
This also removes the redundant EXYNOS5 base address definitions from
the 5420 directory when there are EXYNOS5420 ones, to avoid complete
confusion. The new scheme tries to use EXYNOS5 for base addresses and
exynos5 for types that are common between the two processors, and
EXYNOS5420/exynos5420 for things that have changes (although I probably
didn't catch all differences).
Change-Id: I87e58434490ed55a9bbe743af1f9bf2520dec13f
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/167579
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: ron minnich <rminnich@chromium.org>
(cherry picked from commit 66c87693352c248eec029c1ce83fb295059e6b5b)
Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com>
Reviewed-on: http://review.coreboot.org/6632
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/cpu/samsung/exynos5420/fimd.c')
-rw-r--r-- | src/cpu/samsung/exynos5420/fimd.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src/cpu/samsung/exynos5420/fimd.c b/src/cpu/samsung/exynos5420/fimd.c index b94148a6b1..1e51712e53 100644 --- a/src/cpu/samsung/exynos5420/fimd.c +++ b/src/cpu/samsung/exynos5420/fimd.c @@ -20,31 +20,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <console/console.h> -#include <arch/io.h> #include <delay.h> -#include "timer.h" +#include <arch/io.h> +#include <console/console.h> #include "clk.h" -#include "cpu.h" -#include "periph.h" #include "dp.h" #include "fimd.h" +#include "periph.h" #include "sysreg.h" - -/* left here because it's a counterexample of good style. u-boot - * likes to call a function to get a base address. To get that they - * walk the device tree several times. It's costly. So they turn a - * known-at-build-time constant into a bunch of function calls. What - * to do about this inefficiency? Fix the inefficiency? No, scarf - * variables away in global memory of course, and remove all hope of - * optimization. Bad idea. - * - * the u-boot sources that define fimd base are ... bizarre. I'm going - * with a hardcoded hack until we get this working. FIXME. - * - * static struct exynos_fb *fimd_ctrl * = - * (void *)0x14400000; //samsung_get_base_fimd(); - */ +#include "timer.h" /* fairly useful debugging stuff. */ #if 0 @@ -70,7 +54,6 @@ static inline unsigned long fradl(void *v) { /* not sure where we want this so ... */ static unsigned long get_lcd_clk(void) { - struct exynos5420_clock *clk = samsung_get_base_clock(); u32 pclk, sclk; unsigned int sel; unsigned int ratio; @@ -81,7 +64,7 @@ static unsigned long get_lcd_clk(void) * 0: SCLK_RPLL * 1: SCLK_SPLL */ - sel = lreadl(&clk->clk_src_disp10); + sel = lreadl(&exynos_clock->clk_src_disp10); sel &= (1 << 4); if (sel){ @@ -94,7 +77,7 @@ static unsigned long get_lcd_clk(void) * CLK_DIV_DISP10 * FIMD1_RATIO [3:0] */ - ratio = lreadl(&clk->clk_div_disp10); + ratio = lreadl(&exynos_clock->clk_div_disp10); ratio = ratio & 0xf; pclk = sclk / (ratio + 1); @@ -325,7 +308,6 @@ void exynos_fimd_window_off(unsigned int win_id) static void exynos5_set_system_display(void) { - struct exynos5_sysreg *sysreg = samsung_get_base_sysreg(); unsigned int cfg = 0; /* @@ -333,9 +315,9 @@ static void exynos5_set_system_display(void) * 0: MIE/MDNIE * 1: FIMD Bypass */ - cfg = lreadl(&sysreg->disp1blk_cfg); + cfg = lreadl(&exynos_sysreg->disp1blk_cfg); cfg |= (1 << 15); - lwritel(cfg, &sysreg->disp1blk_cfg); + lwritel(cfg, &exynos_sysreg->disp1blk_cfg); } void exynos_fimd_lcd_init(vidinfo_t *vid) |