diff options
author | Tony Lindgren <tony@atomide.com> | 2006-04-02 12:46:26 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-04-02 12:46:26 -0400 |
commit | 0dc5e77c46c6b02e8286f17544d93d614c0cb892 (patch) | |
tree | b3dc7f9205cfd3a289279a54decac77ebecd98d7 /arch/arm | |
parent | 670c104ae8e7bcc28be0289a16dac2ddfb88b285 (diff) |
[ARM] 3454/1: ARM: OMAP: 6/8 Update framebuffer low-level init code, take 2
Patch from Tony Lindgren
Update OMAP framebuffer low-level init code from linux-omap tree
by Imre Deak.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-omap/dma.c | 6 | ||||
-rw-r--r-- | arch/arm/plat-omap/fb.c | 80 |
2 files changed, 86 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index a4e5ac77f6df..5dac4230360d 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -1258,6 +1258,11 @@ void omap_stop_lcd_dma(void) | |||
1258 | omap_writew(w, OMAP1610_DMA_LCD_CTRL); | 1258 | omap_writew(w, OMAP1610_DMA_LCD_CTRL); |
1259 | } | 1259 | } |
1260 | 1260 | ||
1261 | int omap_lcd_dma_ext_running(void) | ||
1262 | { | ||
1263 | return lcd_dma.ext_ctrl && lcd_dma.active; | ||
1264 | } | ||
1265 | |||
1261 | /*----------------------------------------------------------------------------*/ | 1266 | /*----------------------------------------------------------------------------*/ |
1262 | 1267 | ||
1263 | static int __init omap_init_dma(void) | 1268 | static int __init omap_init_dma(void) |
@@ -1389,6 +1394,7 @@ EXPORT_SYMBOL(omap_free_lcd_dma); | |||
1389 | EXPORT_SYMBOL(omap_enable_lcd_dma); | 1394 | EXPORT_SYMBOL(omap_enable_lcd_dma); |
1390 | EXPORT_SYMBOL(omap_setup_lcd_dma); | 1395 | EXPORT_SYMBOL(omap_setup_lcd_dma); |
1391 | EXPORT_SYMBOL(omap_stop_lcd_dma); | 1396 | EXPORT_SYMBOL(omap_stop_lcd_dma); |
1397 | EXPORT_SYMBOL(omap_lcd_dma_ext_running); | ||
1392 | EXPORT_SYMBOL(omap_set_lcd_dma_b1); | 1398 | EXPORT_SYMBOL(omap_set_lcd_dma_b1); |
1393 | EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer); | 1399 | EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer); |
1394 | EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller); | 1400 | EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller); |
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c new file mode 100644 index 000000000000..305e9b990b71 --- /dev/null +++ b/arch/arm/plat-omap/fb.c | |||
@@ -0,0 +1,80 @@ | |||
1 | #include <linux/config.h> | ||
2 | #include <linux/module.h> | ||
3 | #include <linux/kernel.h> | ||
4 | #include <linux/init.h> | ||
5 | #include <linux/platform_device.h> | ||
6 | #include <linux/bootmem.h> | ||
7 | |||
8 | #include <asm/hardware.h> | ||
9 | #include <asm/io.h> | ||
10 | #include <asm/mach-types.h> | ||
11 | #include <asm/mach/map.h> | ||
12 | |||
13 | #include <asm/arch/board.h> | ||
14 | #include <asm/arch/sram.h> | ||
15 | #include <asm/arch/omapfb.h> | ||
16 | |||
17 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) | ||
18 | |||
19 | static struct omapfb_platform_data omapfb_config; | ||
20 | |||
21 | static u64 omap_fb_dma_mask = ~(u32)0; | ||
22 | |||
23 | static struct platform_device omap_fb_device = { | ||
24 | .name = "omapfb", | ||
25 | .id = -1, | ||
26 | .dev = { | ||
27 | .dma_mask = &omap_fb_dma_mask, | ||
28 | .coherent_dma_mask = ~(u32)0, | ||
29 | .platform_data = &omapfb_config, | ||
30 | }, | ||
31 | .num_resources = 0, | ||
32 | }; | ||
33 | |||
34 | /* called from map_io */ | ||
35 | void omapfb_reserve_mem(void) | ||
36 | { | ||
37 | const struct omap_fbmem_config *fbmem_conf; | ||
38 | |||
39 | omapfb_config.fbmem.fb_sram_start = omap_fb_sram_start; | ||
40 | omapfb_config.fbmem.fb_sram_size = omap_fb_sram_size; | ||
41 | |||
42 | fbmem_conf = omap_get_config(OMAP_TAG_FBMEM, struct omap_fbmem_config); | ||
43 | |||
44 | if (fbmem_conf != NULL) { | ||
45 | /* indicate that the bootloader already initialized the | ||
46 | * fb device, so we'll skip that part in the fb driver | ||
47 | */ | ||
48 | omapfb_config.fbmem.fb_sdram_start = fbmem_conf->fb_sdram_start; | ||
49 | omapfb_config.fbmem.fb_sdram_size = fbmem_conf->fb_sdram_size; | ||
50 | if (fbmem_conf->fb_sdram_size) { | ||
51 | pr_info("Reserving %u bytes SDRAM for frame buffer\n", | ||
52 | fbmem_conf->fb_sdram_size); | ||
53 | reserve_bootmem(fbmem_conf->fb_sdram_start, | ||
54 | fbmem_conf->fb_sdram_size); | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | |||
59 | static inline int omap_init_fb(void) | ||
60 | { | ||
61 | const struct omap_lcd_config *conf; | ||
62 | |||
63 | conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config); | ||
64 | if (conf == NULL) | ||
65 | return 0; | ||
66 | |||
67 | omapfb_config.lcd = *conf; | ||
68 | |||
69 | return platform_device_register(&omap_fb_device); | ||
70 | } | ||
71 | |||
72 | arch_initcall(omap_init_fb); | ||
73 | |||
74 | #else | ||
75 | |||
76 | void omapfb_reserve_mem(void) {} | ||
77 | |||
78 | #endif | ||
79 | |||
80 | |||