aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c14
-rw-r--r--arch/arm/mach-omap2/board-rx51.c3
-rw-r--r--arch/arm/mach-omap2/display.c53
-rw-r--r--arch/arm/mach-omap2/sdrc.c16
-rw-r--r--arch/arm/plat-omap/common.c2
-rw-r--r--arch/arm/plat-omap/fb.c66
-rw-r--r--arch/arm/plat-omap/include/plat/sdrc.h7
-rw-r--r--arch/arm/plat-omap/include/plat/vram.h43
-rw-r--r--arch/arm/plat-omap/include/plat/vrfb.h66
9 files changed, 112 insertions, 158 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index c22e111bcd00..46f4fc982766 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -16,7 +16,6 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <asm/mach-types.h> 17#include <asm/mach-types.h>
18#include <video/omapdss.h> 18#include <video/omapdss.h>
19#include <plat/vram.h>
20#include <linux/platform_data/spi-omap2-mcspi.h> 19#include <linux/platform_data/spi-omap2-mcspi.h>
21 20
22#include "board-rx51.h" 21#include "board-rx51.h"
@@ -87,17 +86,4 @@ static int __init rx51_video_init(void)
87} 86}
88 87
89subsys_initcall(rx51_video_init); 88subsys_initcall(rx51_video_init);
90
91void __init rx51_video_mem_init(void)
92{
93 /*
94 * GFX 864x480x32bpp
95 * VID1/2 1280x720x32bpp double buffered
96 */
97 omap_vram_set_sdram_vram(PAGE_ALIGN(864 * 480 * 4) +
98 2 * PAGE_ALIGN(1280 * 720 * 4 * 2), 0);
99}
100
101#else
102void __init rx51_video_mem_init(void) { }
103#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */ 89#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 7bbb05d9689b..6e0de6f83278 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -34,8 +34,6 @@
34 34
35#define RX51_GPIO_SLEEP_IND 162 35#define RX51_GPIO_SLEEP_IND 162
36 36
37extern void rx51_video_mem_init(void);
38
39static struct gpio_led gpio_leds[] = { 37static struct gpio_led gpio_leds[] = {
40 { 38 {
41 .name = "sleep_ind", 39 .name = "sleep_ind",
@@ -112,7 +110,6 @@ static void __init rx51_init(void)
112 110
113static void __init rx51_reserve(void) 111static void __init rx51_reserve(void)
114{ 112{
115 rx51_video_mem_init();
116 omap_reserve(); 113 omap_reserve();
117} 114}
118 115
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 1011995f150a..282c814ea2e2 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -100,17 +100,20 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = {
100 { "dss_hdmi", "omapdss_hdmi", -1 }, 100 { "dss_hdmi", "omapdss_hdmi", -1 },
101}; 101};
102 102
103static void __init omap4_hdmi_mux_pads(enum omap_hdmi_flags flags) 103static void __init omap4_tpd12s015_mux_pads(void)
104{ 104{
105 u32 reg;
106 u16 control_i2c_1;
107
108 omap_mux_init_signal("hdmi_cec", 105 omap_mux_init_signal("hdmi_cec",
109 OMAP_PIN_INPUT_PULLUP); 106 OMAP_PIN_INPUT_PULLUP);
110 omap_mux_init_signal("hdmi_ddc_scl", 107 omap_mux_init_signal("hdmi_ddc_scl",
111 OMAP_PIN_INPUT_PULLUP); 108 OMAP_PIN_INPUT_PULLUP);
112 omap_mux_init_signal("hdmi_ddc_sda", 109 omap_mux_init_signal("hdmi_ddc_sda",
113 OMAP_PIN_INPUT_PULLUP); 110 OMAP_PIN_INPUT_PULLUP);
111}
112
113static void __init omap4_hdmi_mux_pads(enum omap_hdmi_flags flags)
114{
115 u32 reg;
116 u16 control_i2c_1;
114 117
115 /* 118 /*
116 * CONTROL_I2C_1: HDMI_DDC_SDA_PULLUPRESX (bit 28) and 119 * CONTROL_I2C_1: HDMI_DDC_SDA_PULLUPRESX (bit 28) and
@@ -161,8 +164,10 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
161 164
162int __init omap_hdmi_init(enum omap_hdmi_flags flags) 165int __init omap_hdmi_init(enum omap_hdmi_flags flags)
163{ 166{
164 if (cpu_is_omap44xx()) 167 if (cpu_is_omap44xx()) {
165 omap4_hdmi_mux_pads(flags); 168 omap4_hdmi_mux_pads(flags);
169 omap4_tpd12s015_mux_pads();
170 }
166 171
167 return 0; 172 return 0;
168} 173}
@@ -284,6 +289,35 @@ err:
284 return ERR_PTR(r); 289 return ERR_PTR(r);
285} 290}
286 291
292static enum omapdss_version __init omap_display_get_version(void)
293{
294 if (cpu_is_omap24xx())
295 return OMAPDSS_VER_OMAP24xx;
296 else if (cpu_is_omap3630())
297 return OMAPDSS_VER_OMAP3630;
298 else if (cpu_is_omap34xx()) {
299 if (soc_is_am35xx()) {
300 return OMAPDSS_VER_AM35xx;
301 } else {
302 if (omap_rev() < OMAP3430_REV_ES3_0)
303 return OMAPDSS_VER_OMAP34xx_ES1;
304 else
305 return OMAPDSS_VER_OMAP34xx_ES3;
306 }
307 } else if (omap_rev() == OMAP4430_REV_ES1_0)
308 return OMAPDSS_VER_OMAP4430_ES1;
309 else if (omap_rev() == OMAP4430_REV_ES2_0 ||
310 omap_rev() == OMAP4430_REV_ES2_1 ||
311 omap_rev() == OMAP4430_REV_ES2_2)
312 return OMAPDSS_VER_OMAP4430_ES2;
313 else if (cpu_is_omap44xx())
314 return OMAPDSS_VER_OMAP4;
315 else if (soc_is_omap54xx())
316 return OMAPDSS_VER_OMAP5;
317 else
318 return OMAPDSS_VER_UNKNOWN;
319}
320
287int __init omap_display_init(struct omap_dss_board_info *board_data) 321int __init omap_display_init(struct omap_dss_board_info *board_data)
288{ 322{
289 int r = 0; 323 int r = 0;
@@ -291,9 +325,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
291 int i, oh_count; 325 int i, oh_count;
292 const struct omap_dss_hwmod_data *curr_dss_hwmod; 326 const struct omap_dss_hwmod_data *curr_dss_hwmod;
293 struct platform_device *dss_pdev; 327 struct platform_device *dss_pdev;
328 enum omapdss_version ver;
294 329
295 /* create omapdss device */ 330 /* create omapdss device */
296 331
332 ver = omap_display_get_version();
333
334 if (ver == OMAPDSS_VER_UNKNOWN) {
335 pr_err("DSS not supported on this SoC\n");
336 return -ENODEV;
337 }
338
339 board_data->version = ver;
297 board_data->dsi_enable_pads = omap_dsi_enable_pads; 340 board_data->dsi_enable_pads = omap_dsi_enable_pads;
298 board_data->dsi_disable_pads = omap_dsi_disable_pads; 341 board_data->dsi_disable_pads = omap_dsi_disable_pads;
299 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; 342 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index e3d345f46409..4282e6e967d6 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -160,19 +160,3 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
160 sdrc_write_reg(l, SDRC_POWER); 160 sdrc_write_reg(l, SDRC_POWER);
161 omap2_sms_save_context(); 161 omap2_sms_save_context();
162} 162}
163
164void omap2_sms_write_rot_control(u32 val, unsigned ctx)
165{
166 sms_write_reg(val, SMS_ROT_CONTROL(ctx));
167}
168
169void omap2_sms_write_rot_size(u32 val, unsigned ctx)
170{
171 sms_write_reg(val, SMS_ROT_SIZE(ctx));
172}
173
174void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx)
175{
176 sms_write_reg(val, SMS_ROT_PHYSICAL_BA(ctx));
177}
178
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 111315a69354..d21ed18355ae 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -17,7 +17,6 @@
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18 18
19#include <plat/common.h> 19#include <plat/common.h>
20#include <plat/vram.h>
21#include <linux/platform_data/dsp-omap.h> 20#include <linux/platform_data/dsp-omap.h>
22#include <plat/dma.h> 21#include <plat/dma.h>
23 22
@@ -25,7 +24,6 @@
25 24
26void __init omap_reserve(void) 25void __init omap_reserve(void)
27{ 26{
28 omap_vram_reserve_sdram_memblock();
29 omap_dsp_reserve_sdram_memblock(); 27 omap_dsp_reserve_sdram_memblock();
30 omap_secure_ram_reserve_memblock(); 28 omap_secure_ram_reserve_memblock();
31 omap_barrier_reserve_memblock(); 29 omap_barrier_reserve_memblock();
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index bcbb9d5dc293..6df0c215fdb4 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -29,10 +29,72 @@
29#include <linux/memblock.h> 29#include <linux/memblock.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/omapfb.h> 31#include <linux/omapfb.h>
32#include <linux/dma-mapping.h>
32 33
33#include <mach/hardware.h> 34#include <mach/hardware.h>
34#include <asm/mach/map.h> 35#include <asm/mach/map.h>
35 36
37#include <plat/cpu.h>
38
39#ifdef CONFIG_OMAP2_VRFB
40
41/*
42 * The first memory resource is the register region for VRFB,
43 * the rest are VRFB virtual memory areas for each VRFB context.
44 */
45
46static const struct resource omap2_vrfb_resources[] = {
47 DEFINE_RES_MEM_NAMED(0x68008000u, 0x40, "vrfb-regs"),
48 DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
49 DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
50 DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
51 DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
52};
53
54static const struct resource omap3_vrfb_resources[] = {
55 DEFINE_RES_MEM_NAMED(0x6C000180u, 0xc0, "vrfb-regs"),
56 DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
57 DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
58 DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
59 DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
60 DEFINE_RES_MEM_NAMED(0xe0000000u, 0x4000000, "vrfb-area-4"),
61 DEFINE_RES_MEM_NAMED(0xe4000000u, 0x4000000, "vrfb-area-5"),
62 DEFINE_RES_MEM_NAMED(0xe8000000u, 0x4000000, "vrfb-area-6"),
63 DEFINE_RES_MEM_NAMED(0xec000000u, 0x4000000, "vrfb-area-7"),
64 DEFINE_RES_MEM_NAMED(0xf0000000u, 0x4000000, "vrfb-area-8"),
65 DEFINE_RES_MEM_NAMED(0xf4000000u, 0x4000000, "vrfb-area-9"),
66 DEFINE_RES_MEM_NAMED(0xf8000000u, 0x4000000, "vrfb-area-10"),
67 DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"),
68};
69
70static int __init omap_init_vrfb(void)
71{
72 struct platform_device *pdev;
73 const struct resource *res;
74 unsigned int num_res;
75
76 if (cpu_is_omap24xx()) {
77 res = omap2_vrfb_resources;
78 num_res = ARRAY_SIZE(omap2_vrfb_resources);
79 } else if (cpu_is_omap34xx()) {
80 res = omap3_vrfb_resources;
81 num_res = ARRAY_SIZE(omap3_vrfb_resources);
82 } else {
83 return 0;
84 }
85
86 pdev = platform_device_register_resndata(NULL, "omapvrfb", -1,
87 res, num_res, NULL, 0);
88
89 if (IS_ERR(pdev))
90 return PTR_ERR(pdev);
91 else
92 return 0;
93}
94
95arch_initcall(omap_init_vrfb);
96#endif
97
36#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 98#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
37 99
38static bool omapfb_lcd_configured; 100static bool omapfb_lcd_configured;
@@ -45,7 +107,7 @@ static struct platform_device omap_fb_device = {
45 .id = -1, 107 .id = -1,
46 .dev = { 108 .dev = {
47 .dma_mask = &omap_fb_dma_mask, 109 .dma_mask = &omap_fb_dma_mask,
48 .coherent_dma_mask = ~(u32)0, 110 .coherent_dma_mask = DMA_BIT_MASK(32),
49 .platform_data = &omapfb_config, 111 .platform_data = &omapfb_config,
50 }, 112 },
51 .num_resources = 0, 113 .num_resources = 0,
@@ -81,7 +143,7 @@ static struct platform_device omap_fb_device = {
81 .id = -1, 143 .id = -1,
82 .dev = { 144 .dev = {
83 .dma_mask = &omap_fb_dma_mask, 145 .dma_mask = &omap_fb_dma_mask,
84 .coherent_dma_mask = ~(u32)0, 146 .coherent_dma_mask = DMA_BIT_MASK(32),
85 .platform_data = &omapfb_config, 147 .platform_data = &omapfb_config,
86 }, 148 },
87 .num_resources = 0, 149 .num_resources = 0,
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
index 36d6a7666216..c68bab29cfc5 100644
--- a/arch/arm/plat-omap/include/plat/sdrc.h
+++ b/arch/arm/plat-omap/include/plat/sdrc.h
@@ -94,9 +94,6 @@
94/* SMS register offsets - read/write with sms_{read,write}_reg() */ 94/* SMS register offsets - read/write with sms_{read,write}_reg() */
95 95
96#define SMS_SYSCONFIG 0x010 96#define SMS_SYSCONFIG 0x010
97#define SMS_ROT_CONTROL(context) (0x180 + 0x10 * context)
98#define SMS_ROT_SIZE(context) (0x184 + 0x10 * context)
99#define SMS_ROT_PHYSICAL_BA(context) (0x188 + 0x10 * context)
100/* REVISIT: fill in other SMS registers here */ 97/* REVISIT: fill in other SMS registers here */
101 98
102 99
@@ -137,10 +134,6 @@ int omap2_sdrc_get_params(unsigned long r,
137void omap2_sms_save_context(void); 134void omap2_sms_save_context(void);
138void omap2_sms_restore_context(void); 135void omap2_sms_restore_context(void);
139 136
140void omap2_sms_write_rot_control(u32 val, unsigned ctx);
141void omap2_sms_write_rot_size(u32 val, unsigned ctx);
142void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx);
143
144#ifdef CONFIG_ARCH_OMAP2 137#ifdef CONFIG_ARCH_OMAP2
145 138
146struct memory_timings { 139struct memory_timings {
diff --git a/arch/arm/plat-omap/include/plat/vram.h b/arch/arm/plat-omap/include/plat/vram.h
deleted file mode 100644
index 4d65b7d06e6c..000000000000
--- a/arch/arm/plat-omap/include/plat/vram.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * VRAM manager for OMAP
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __OMAP_VRAM_H__
22#define __OMAP_VRAM_H__
23
24#include <linux/types.h>
25
26extern int omap_vram_add_region(unsigned long paddr, size_t size);
27extern int omap_vram_free(unsigned long paddr, size_t size);
28extern int omap_vram_alloc(size_t size, unsigned long *paddr);
29extern int omap_vram_reserve(unsigned long paddr, size_t size);
30extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
31 unsigned long *largest_free_block);
32
33#ifdef CONFIG_OMAP2_VRAM
34extern void omap_vram_set_sdram_vram(u32 size, u32 start);
35
36extern void omap_vram_reserve_sdram_memblock(void);
37#else
38static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { }
39
40static inline void omap_vram_reserve_sdram_memblock(void) { }
41#endif
42
43#endif
diff --git a/arch/arm/plat-omap/include/plat/vrfb.h b/arch/arm/plat-omap/include/plat/vrfb.h
deleted file mode 100644
index 3792bdea2f6d..000000000000
--- a/arch/arm/plat-omap/include/plat/vrfb.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * VRFB Rotation Engine
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __OMAP_VRFB_H__
22#define __OMAP_VRFB_H__
23
24#define OMAP_VRFB_LINE_LEN 2048
25
26struct vrfb {
27 u8 context;
28 void __iomem *vaddr[4];
29 unsigned long paddr[4];
30 u16 xres;
31 u16 yres;
32 u16 xoffset;
33 u16 yoffset;
34 u8 bytespp;
35 bool yuv_mode;
36};
37
38#ifdef CONFIG_OMAP2_VRFB
39extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
40extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
41extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
42 u8 bytespp);
43extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
44extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
45extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
46 u16 width, u16 height,
47 unsigned bytespp, bool yuv_mode);
48extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
49extern void omap_vrfb_restore_context(void);
50
51#else
52static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
53static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
54static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
55 u8 bytespp) {}
56static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
57 { return 0; }
58static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
59 { return 0; }
60static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
61 u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
62static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
63 { return 0; }
64static inline void omap_vrfb_restore_context(void) {}
65#endif
66#endif /* __VRFB_H */