aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-10-17 14:21:34 -0400
committerTony Lindgren <tony@atomide.com>2012-10-17 14:21:34 -0400
commit6832c95599e1a04f4b56b533718d1cda4689aec2 (patch)
tree3faf1a2a744245501c1743c909527d83bbb6666a /arch
parent46cddc01aa6a017193ae7320ef8bfc8242782a66 (diff)
parent3e6ece13d966a20a38ee7adfac452a47455ccd7a (diff)
Merge branch 'omap-for-v3.8/cleanup-headers-dss' into omap-for-v3.8/cleanup-headers
Conflicts: arch/arm/mach-omap2/board-omap3logic.c arch/arm/mach-omap2/gpmc.c drivers/media/platform/omap/omap_vout.c drivers/media/platform/omap/omap_vout_vrfb.c
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c5
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpllcore.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c2
-rw-r--r--arch/arm/mach-omap2/clkt34xx_dpll3m2.c1
-rw-r--r--arch/arm/mach-omap2/control.c4
-rw-r--r--arch/arm/mach-omap2/display.c38
-rw-r--r--arch/arm/mach-omap2/gpmc.c1
-rw-r--r--arch/arm/mach-omap2/io.c2
-rw-r--r--arch/arm/mach-omap2/pm34xx.c1
-rw-r--r--arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h2
-rw-r--r--arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h2
-rw-r--r--arch/arm/mach-omap2/sdram-nokia.c2
-rw-r--r--arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h2
-rw-r--r--arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h2
-rw-r--r--arch/arm/mach-omap2/sdrc.c17
-rw-r--r--arch/arm/mach-omap2/sdrc.h146
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c1
-rw-r--r--arch/arm/plat-omap/fb.c61
-rw-r--r--arch/arm/plat-omap/include/plat/sdrc.h164
-rw-r--r--arch/arm/plat-omap/include/plat/vrfb.h66
20 files changed, 250 insertions, 271 deletions
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 5cfade235bb4..6f58cad5bf74 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -34,9 +34,6 @@
34#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36 36
37#include "gpmc-smsc911x.h"
38#include "gpmc.h"
39#include <plat/sdrc.h>
40#include <plat/usb.h> 37#include <plat/usb.h>
41 38
42#include "common.h" 39#include "common.h"
@@ -44,6 +41,8 @@
44#include "hsmmc.h" 41#include "hsmmc.h"
45#include "control.h" 42#include "control.h"
46#include "common-board-devices.h" 43#include "common-board-devices.h"
44#include "gpmc.h"
45#include "gpmc-smsc911x.h"
47 46
48#define OMAP3LOGIC_SMSC911X_CS 1 47#define OMAP3LOGIC_SMSC911X_CS 1
49 48
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
index 4ae439222085..35076592189e 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
@@ -27,13 +27,13 @@
27 27
28#include <plat/clock.h> 28#include <plat/clock.h>
29#include <plat/sram.h> 29#include <plat/sram.h>
30#include <plat/sdrc.h>
31 30
32#include "clock.h" 31#include "clock.h"
33#include "clock2xxx.h" 32#include "clock2xxx.h"
34#include "opp2xxx.h" 33#include "opp2xxx.h"
35#include "cm2xxx_3xxx.h" 34#include "cm2xxx_3xxx.h"
36#include "cm-regbits-24xx.h" 35#include "cm-regbits-24xx.h"
36#include "sdrc.h"
37 37
38/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ 38/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
39 39
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index 3524f0e7b6d5..0cf63e7c6102 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -35,7 +35,6 @@
35 35
36#include <plat/clock.h> 36#include <plat/clock.h>
37#include <plat/sram.h> 37#include <plat/sram.h>
38#include <plat/sdrc.h>
39 38
40#include "soc.h" 39#include "soc.h"
41#include "clock.h" 40#include "clock.h"
@@ -43,6 +42,7 @@
43#include "opp2xxx.h" 42#include "opp2xxx.h"
44#include "cm2xxx_3xxx.h" 43#include "cm2xxx_3xxx.h"
45#include "cm-regbits-24xx.h" 44#include "cm-regbits-24xx.h"
45#include "sdrc.h"
46 46
47const struct prcm_config *curr_prcm_set; 47const struct prcm_config *curr_prcm_set;
48const struct prcm_config *rate_table; 48const struct prcm_config *rate_table;
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
index 7c6da2f731dc..aff6ca4fd3a4 100644
--- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
+++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
@@ -23,7 +23,6 @@
23 23
24#include <plat/clock.h> 24#include <plat/clock.h>
25#include <plat/sram.h> 25#include <plat/sram.h>
26#include <plat/sdrc.h>
27 26
28#include "clock.h" 27#include "clock.h"
29#include "clock3xxx.h" 28#include "clock3xxx.h"
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index d1ff8399a222..bf2be5c5468d 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3 System Control Module register access 2 * OMAP2/3 System Control Module register access
3 * 3 *
4 * Copyright (C) 2007 Texas Instruments, Inc. 4 * Copyright (C) 2007, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007 Nokia Corporation 5 * Copyright (C) 2007 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
@@ -15,8 +15,6 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <plat/sdrc.h>
19
20#include "soc.h" 18#include "soc.h"
21#include "iomap.h" 19#include "iomap.h"
22#include "common.h" 20#include "common.h"
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 1011995f150a..28f508724a56 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -284,6 +284,35 @@ err:
284 return ERR_PTR(r); 284 return ERR_PTR(r);
285} 285}
286 286
287static enum omapdss_version __init omap_display_get_version(void)
288{
289 if (cpu_is_omap24xx())
290 return OMAPDSS_VER_OMAP24xx;
291 else if (cpu_is_omap3630())
292 return OMAPDSS_VER_OMAP3630;
293 else if (cpu_is_omap34xx()) {
294 if (soc_is_am35xx()) {
295 return OMAPDSS_VER_AM35xx;
296 } else {
297 if (omap_rev() < OMAP3430_REV_ES3_0)
298 return OMAPDSS_VER_OMAP34xx_ES1;
299 else
300 return OMAPDSS_VER_OMAP34xx_ES3;
301 }
302 } else if (omap_rev() == OMAP4430_REV_ES1_0)
303 return OMAPDSS_VER_OMAP4430_ES1;
304 else if (omap_rev() == OMAP4430_REV_ES2_0 ||
305 omap_rev() == OMAP4430_REV_ES2_1 ||
306 omap_rev() == OMAP4430_REV_ES2_2)
307 return OMAPDSS_VER_OMAP4430_ES2;
308 else if (cpu_is_omap44xx())
309 return OMAPDSS_VER_OMAP4;
310 else if (soc_is_omap54xx())
311 return OMAPDSS_VER_OMAP5;
312 else
313 return OMAPDSS_VER_UNKNOWN;
314}
315
287int __init omap_display_init(struct omap_dss_board_info *board_data) 316int __init omap_display_init(struct omap_dss_board_info *board_data)
288{ 317{
289 int r = 0; 318 int r = 0;
@@ -291,9 +320,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
291 int i, oh_count; 320 int i, oh_count;
292 const struct omap_dss_hwmod_data *curr_dss_hwmod; 321 const struct omap_dss_hwmod_data *curr_dss_hwmod;
293 struct platform_device *dss_pdev; 322 struct platform_device *dss_pdev;
323 enum omapdss_version ver;
294 324
295 /* create omapdss device */ 325 /* create omapdss device */
296 326
327 ver = omap_display_get_version();
328
329 if (ver == OMAPDSS_VER_UNKNOWN) {
330 pr_err("DSS not supported on this SoC\n");
331 return -ENODEV;
332 }
333
334 board_data->version = ver;
297 board_data->dsi_enable_pads = omap_dsi_enable_pads; 335 board_data->dsi_enable_pads = omap_dsi_enable_pads;
298 board_data->dsi_disable_pads = omap_dsi_disable_pads; 336 board_data->dsi_disable_pads = omap_dsi_disable_pads;
299 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; 337 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index f14bd3f55218..9472541a4d8d 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -31,7 +31,6 @@
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32 32
33#include <plat/cpu.h> 33#include <plat/cpu.h>
34#include <plat/sdrc.h>
35#include <plat/omap_device.h> 34#include <plat/omap_device.h>
36 35
37#include "soc.h" 36#include "soc.h"
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 42a4b9c08aaa..f71e51bfbe2a 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -26,7 +26,6 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <plat/sram.h> 28#include <plat/sram.h>
29#include <plat/sdrc.h>
30#include <plat/serial.h> 29#include <plat/serial.h>
31#include <plat/omap-pm.h> 30#include <plat/omap-pm.h>
32#include <plat/omap_hwmod.h> 31#include <plat/omap_hwmod.h>
@@ -43,6 +42,7 @@
43#include "clock2xxx.h" 42#include "clock2xxx.h"
44#include "clock3xxx.h" 43#include "clock3xxx.h"
45#include "clock44xx.h" 44#include "clock44xx.h"
45#include "sdrc.h"
46 46
47/* 47/*
48 * The machine specific code may provide the extra mapping besides the 48 * The machine specific code may provide the extra mapping besides the
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 001eff290cdb..bbe15cb1b874 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -38,7 +38,6 @@
38#include <plat/sram.h> 38#include <plat/sram.h>
39#include "clockdomain.h" 39#include "clockdomain.h"
40#include "powerdomain.h" 40#include "powerdomain.h"
41#include <plat/sdrc.h>
42#include <plat/prcm.h> 41#include <plat/prcm.h>
43#include <plat-omap/dma-omap.h> 42#include <plat-omap/dma-omap.h>
44 43
diff --git a/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h b/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
index 8bfaf342a028..1ee58c281a31 100644
--- a/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
+++ b/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
@@ -11,7 +11,7 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM 11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
12#define __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM 12#define __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
13 13
14#include <plat/sdrc.h> 14#include "sdrc.h"
15 15
16/* Hynix H8MBX00U0MER-0EM */ 16/* Hynix H8MBX00U0MER-0EM */
17static struct omap_sdrc_params h8mbx00u0mer0em_sdrc_params[] = { 17static struct omap_sdrc_params h8mbx00u0mer0em_sdrc_params[] = {
diff --git a/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
index a391b4939f74..85cccc004c06 100644
--- a/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
+++ b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
@@ -14,7 +14,7 @@
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
15#define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 15#define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
16 16
17#include <plat/sdrc.h> 17#include "sdrc.h"
18 18
19/* Micron MT46H32M32LF-6 */ 19/* Micron MT46H32M32LF-6 */
20/* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */ 20/* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 845c4fd2b125..5e5702cd410d 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -19,9 +19,9 @@
19 19
20#include "common.h" 20#include "common.h"
21#include <plat/clock.h> 21#include <plat/clock.h>
22#include <plat/sdrc.h>
23 22
24#include "sdram-nokia.h" 23#include "sdram-nokia.h"
24#include "sdrc.h"
25 25
26/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */ 26/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */
27struct sdram_timings { 27struct sdram_timings {
diff --git a/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h b/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
index cd4352917022..003f7bf4e2e3 100644
--- a/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
+++ b/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
@@ -11,7 +11,7 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM 11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM
12#define __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM 12#define __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM
13 13
14#include <plat/sdrc.h> 14#include "sdrc.h"
15 15
16/* Numonyx M65KXXXXAM */ 16/* Numonyx M65KXXXXAM */
17static struct omap_sdrc_params m65kxxxxam_sdrc_params[] = { 17static struct omap_sdrc_params m65kxxxxam_sdrc_params[] = {
diff --git a/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
index 0e518a72831f..8dc3de5ebb5b 100644
--- a/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
+++ b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
@@ -14,7 +14,7 @@
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
15#define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 15#define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
16 16
17#include <plat/sdrc.h> 17#include "sdrc.h"
18 18
19/* Qimonda HYB18M512160AF-6 */ 19/* Qimonda HYB18M512160AF-6 */
20static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = { 20static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = {
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index e3d345f46409..761a781a99c5 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -27,7 +27,6 @@
27#include <plat/clock.h> 27#include <plat/clock.h>
28#include <plat/sram.h> 28#include <plat/sram.h>
29 29
30#include <plat/sdrc.h>
31#include "sdrc.h" 30#include "sdrc.h"
32 31
33static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1; 32static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1;
@@ -160,19 +159,3 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
160 sdrc_write_reg(l, SDRC_POWER); 159 sdrc_write_reg(l, SDRC_POWER);
161 omap2_sms_save_context(); 160 omap2_sms_save_context();
162} 161}
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/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h
index b3f83799e6cf..69c4b329452e 100644
--- a/arch/arm/mach-omap2/sdrc.h
+++ b/arch/arm/mach-omap2/sdrc.h
@@ -2,12 +2,14 @@
2#define __ARCH_ARM_MACH_OMAP2_SDRC_H 2#define __ARCH_ARM_MACH_OMAP2_SDRC_H
3 3
4/* 4/*
5 * OMAP2 SDRC register definitions 5 * OMAP2/3 SDRC/SMS macros and prototypes
6 * 6 *
7 * Copyright (C) 2007 Texas Instruments, Inc. 7 * Copyright (C) 2007-2008, 2012 Texas Instruments, Inc.
8 * Copyright (C) 2007 Nokia Corporation 8 * Copyright (C) 2007-2008 Nokia Corporation
9 * 9 *
10 * Written by Paul Walmsley 10 * Paul Walmsley
11 * Tony Lindgren
12 * Richard Woodruff
11 * 13 *
12 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 15 * it under the terms of the GNU General Public License version 2 as
@@ -15,8 +17,6 @@
15 */ 17 */
16#undef DEBUG 18#undef DEBUG
17 19
18#include <plat/sdrc.h>
19
20#ifndef __ASSEMBLER__ 20#ifndef __ASSEMBLER__
21 21
22#include <linux/io.h> 22#include <linux/io.h>
@@ -50,6 +50,58 @@ static inline u32 sms_read_reg(u16 reg)
50{ 50{
51 return __raw_readl(OMAP_SMS_REGADDR(reg)); 51 return __raw_readl(OMAP_SMS_REGADDR(reg));
52} 52}
53
54
55/**
56 * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
57 * @rate: SDRC clock rate (in Hz)
58 * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
59 * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
60 * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
61 * @mr: Value to program to SDRC_MR for this rate
62 *
63 * This structure holds a pre-computed set of register values for the
64 * SDRC for a given SDRC clock rate and SDRAM chip. These are
65 * intended to be pre-computed and specified in an array in the board-*.c
66 * files. The structure is keyed off the 'rate' field.
67 */
68struct omap_sdrc_params {
69 unsigned long rate;
70 u32 actim_ctrla;
71 u32 actim_ctrlb;
72 u32 rfr_ctrl;
73 u32 mr;
74};
75
76#ifdef CONFIG_SOC_HAS_OMAP2_SDRC
77void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
78 struct omap_sdrc_params *sdrc_cs1);
79#else
80static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
81 struct omap_sdrc_params *sdrc_cs1) {};
82#endif
83
84int omap2_sdrc_get_params(unsigned long r,
85 struct omap_sdrc_params **sdrc_cs0,
86 struct omap_sdrc_params **sdrc_cs1);
87void omap2_sms_save_context(void);
88void omap2_sms_restore_context(void);
89
90struct memory_timings {
91 u32 m_type; /* ddr = 1, sdr = 0 */
92 u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
93 u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
94 u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
95 u32 base_cs; /* base chip select to use for calculations */
96};
97
98extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
99struct omap_sdrc_params *rx51_get_sdram_timings(void);
100
101u32 omap2xxx_sdrc_dll_is_unlocked(void);
102u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
103
104
53#else 105#else
54#define OMAP242X_SDRC_REGADDR(reg) \ 106#define OMAP242X_SDRC_REGADDR(reg) \
55 OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg)) 107 OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg))
@@ -57,6 +109,7 @@ static inline u32 sms_read_reg(u16 reg)
57 OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg)) 109 OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg))
58#define OMAP34XX_SDRC_REGADDR(reg) \ 110#define OMAP34XX_SDRC_REGADDR(reg) \
59 OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg)) 111 OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg))
112
60#endif /* __ASSEMBLER__ */ 113#endif /* __ASSEMBLER__ */
61 114
62/* Minimum frequency that the SDRC DLL can lock at */ 115/* Minimum frequency that the SDRC DLL can lock at */
@@ -74,4 +127,85 @@ static inline u32 sms_read_reg(u16 reg)
74 */ 127 */
75#define SDRC_MPURATE_LOOPS 96 128#define SDRC_MPURATE_LOOPS 96
76 129
130/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
131
132#define SDRC_SYSCONFIG 0x010
133#define SDRC_CS_CFG 0x040
134#define SDRC_SHARING 0x044
135#define SDRC_ERR_TYPE 0x04C
136#define SDRC_DLLA_CTRL 0x060
137#define SDRC_DLLA_STATUS 0x064
138#define SDRC_DLLB_CTRL 0x068
139#define SDRC_DLLB_STATUS 0x06C
140#define SDRC_POWER 0x070
141#define SDRC_MCFG_0 0x080
142#define SDRC_MR_0 0x084
143#define SDRC_EMR2_0 0x08c
144#define SDRC_ACTIM_CTRL_A_0 0x09c
145#define SDRC_ACTIM_CTRL_B_0 0x0a0
146#define SDRC_RFR_CTRL_0 0x0a4
147#define SDRC_MANUAL_0 0x0a8
148#define SDRC_MCFG_1 0x0B0
149#define SDRC_MR_1 0x0B4
150#define SDRC_EMR2_1 0x0BC
151#define SDRC_ACTIM_CTRL_A_1 0x0C4
152#define SDRC_ACTIM_CTRL_B_1 0x0C8
153#define SDRC_RFR_CTRL_1 0x0D4
154#define SDRC_MANUAL_1 0x0D8
155
156#define SDRC_POWER_AUTOCOUNT_SHIFT 8
157#define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
158#define SDRC_POWER_CLKCTRL_SHIFT 4
159#define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
160#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
161
162/*
163 * These values represent the number of memory clock cycles between
164 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
165 * rows per device, and include a subtraction of a 50 cycle window in the
166 * event that the autorefresh command is delayed due to other SDRC activity.
167 * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
168 * counter reaches 0.
169 *
170 * These represent optimal values for common parts, it won't work for all.
171 * As long as you scale down, most parameters are still work, they just
172 * become sub-optimal. The RFR value goes in the opposite direction. If you
173 * don't adjust it down as your clock period increases the refresh interval
174 * will not be met. Setting all parameters for complete worst case may work,
175 * but may cut memory performance by 2x. Due to errata the DLLs need to be
176 * unlocked and their value needs run time calibration. A dynamic call is
177 * need for that as no single right value exists acorss production samples.
178 *
179 * Only the FULL speed values are given. Current code is such that rate
180 * changes must be made at DPLLoutx2. The actual value adjustment for low
181 * frequency operation will be handled by omap_set_performance()
182 *
183 * By having the boot loader boot up in the fastest L4 speed available likely
184 * will result in something which you can switch between.
185 */
186#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1)
187#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
188#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
189#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
190#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
191
192
193/*
194 * SMS register access
195 */
196
197#define OMAP242X_SMS_REGADDR(reg) \
198 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
199#define OMAP243X_SMS_REGADDR(reg) \
200 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
201#define OMAP343X_SMS_REGADDR(reg) \
202 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
203
204/* SMS register offsets - read/write with sms_{read,write}_reg() */
205
206#define SMS_SYSCONFIG 0x010
207/* REVISIT: fill in other SMS registers here */
208
209
210
77#endif 211#endif
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 73e55e485329..f7074ff1d084 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -26,7 +26,6 @@
26 26
27#include <plat/clock.h> 27#include <plat/clock.h>
28#include <plat/sram.h> 28#include <plat/sram.h>
29#include <plat/sdrc.h>
30 29
31#include "soc.h" 30#include "soc.h"
32#include "iomap.h" 31#include "iomap.h"
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index bcbb9d5dc293..f868caeedfd6 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -33,6 +33,67 @@
33#include <mach/hardware.h> 33#include <mach/hardware.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <plat/cpu.h>
37
38#ifdef CONFIG_OMAP2_VRFB
39
40/*
41 * The first memory resource is the register region for VRFB,
42 * the rest are VRFB virtual memory areas for each VRFB context.
43 */
44
45static const struct resource omap2_vrfb_resources[] = {
46 DEFINE_RES_MEM_NAMED(0x68008000u, 0x40, "vrfb-regs"),
47 DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
48 DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
49 DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
50 DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
51};
52
53static const struct resource omap3_vrfb_resources[] = {
54 DEFINE_RES_MEM_NAMED(0x6C000180u, 0xc0, "vrfb-regs"),
55 DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
56 DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
57 DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
58 DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
59 DEFINE_RES_MEM_NAMED(0xe0000000u, 0x4000000, "vrfb-area-4"),
60 DEFINE_RES_MEM_NAMED(0xe4000000u, 0x4000000, "vrfb-area-5"),
61 DEFINE_RES_MEM_NAMED(0xe8000000u, 0x4000000, "vrfb-area-6"),
62 DEFINE_RES_MEM_NAMED(0xec000000u, 0x4000000, "vrfb-area-7"),
63 DEFINE_RES_MEM_NAMED(0xf0000000u, 0x4000000, "vrfb-area-8"),
64 DEFINE_RES_MEM_NAMED(0xf4000000u, 0x4000000, "vrfb-area-9"),
65 DEFINE_RES_MEM_NAMED(0xf8000000u, 0x4000000, "vrfb-area-10"),
66 DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"),
67};
68
69static int __init omap_init_vrfb(void)
70{
71 struct platform_device *pdev;
72 const struct resource *res;
73 unsigned int num_res;
74
75 if (cpu_is_omap24xx()) {
76 res = omap2_vrfb_resources;
77 num_res = ARRAY_SIZE(omap2_vrfb_resources);
78 } else if (cpu_is_omap34xx()) {
79 res = omap3_vrfb_resources;
80 num_res = ARRAY_SIZE(omap3_vrfb_resources);
81 } else {
82 return 0;
83 }
84
85 pdev = platform_device_register_resndata(NULL, "omapvrfb", -1,
86 res, num_res, NULL, 0);
87
88 if (IS_ERR(pdev))
89 return PTR_ERR(pdev);
90 else
91 return 0;
92}
93
94arch_initcall(omap_init_vrfb);
95#endif
96
36#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 97#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
37 98
38static bool omapfb_lcd_configured; 99static bool omapfb_lcd_configured;
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
deleted file mode 100644
index 36d6a7666216..000000000000
--- a/arch/arm/plat-omap/include/plat/sdrc.h
+++ /dev/null
@@ -1,164 +0,0 @@
1#ifndef ____ASM_ARCH_SDRC_H
2#define ____ASM_ARCH_SDRC_H
3
4/*
5 * OMAP2/3 SDRC/SMS register definitions
6 *
7 * Copyright (C) 2007-2008 Texas Instruments, Inc.
8 * Copyright (C) 2007-2008 Nokia Corporation
9 *
10 * Tony Lindgren
11 * Paul Walmsley
12 * Richard Woodruff
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19
20/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
21
22#define SDRC_SYSCONFIG 0x010
23#define SDRC_CS_CFG 0x040
24#define SDRC_SHARING 0x044
25#define SDRC_ERR_TYPE 0x04C
26#define SDRC_DLLA_CTRL 0x060
27#define SDRC_DLLA_STATUS 0x064
28#define SDRC_DLLB_CTRL 0x068
29#define SDRC_DLLB_STATUS 0x06C
30#define SDRC_POWER 0x070
31#define SDRC_MCFG_0 0x080
32#define SDRC_MR_0 0x084
33#define SDRC_EMR2_0 0x08c
34#define SDRC_ACTIM_CTRL_A_0 0x09c
35#define SDRC_ACTIM_CTRL_B_0 0x0a0
36#define SDRC_RFR_CTRL_0 0x0a4
37#define SDRC_MANUAL_0 0x0a8
38#define SDRC_MCFG_1 0x0B0
39#define SDRC_MR_1 0x0B4
40#define SDRC_EMR2_1 0x0BC
41#define SDRC_ACTIM_CTRL_A_1 0x0C4
42#define SDRC_ACTIM_CTRL_B_1 0x0C8
43#define SDRC_RFR_CTRL_1 0x0D4
44#define SDRC_MANUAL_1 0x0D8
45
46#define SDRC_POWER_AUTOCOUNT_SHIFT 8
47#define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
48#define SDRC_POWER_CLKCTRL_SHIFT 4
49#define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
50#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
51
52/*
53 * These values represent the number of memory clock cycles between
54 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
55 * rows per device, and include a subtraction of a 50 cycle window in the
56 * event that the autorefresh command is delayed due to other SDRC activity.
57 * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
58 * counter reaches 0.
59 *
60 * These represent optimal values for common parts, it won't work for all.
61 * As long as you scale down, most parameters are still work, they just
62 * become sub-optimal. The RFR value goes in the opposite direction. If you
63 * don't adjust it down as your clock period increases the refresh interval
64 * will not be met. Setting all parameters for complete worst case may work,
65 * but may cut memory performance by 2x. Due to errata the DLLs need to be
66 * unlocked and their value needs run time calibration. A dynamic call is
67 * need for that as no single right value exists acorss production samples.
68 *
69 * Only the FULL speed values are given. Current code is such that rate
70 * changes must be made at DPLLoutx2. The actual value adjustment for low
71 * frequency operation will be handled by omap_set_performance()
72 *
73 * By having the boot loader boot up in the fastest L4 speed available likely
74 * will result in something which you can switch between.
75 */
76#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1)
77#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
78#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
79#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
80#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
81
82
83/*
84 * SMS register access
85 */
86
87#define OMAP242X_SMS_REGADDR(reg) \
88 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
89#define OMAP243X_SMS_REGADDR(reg) \
90 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
91#define OMAP343X_SMS_REGADDR(reg) \
92 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
93
94/* SMS register offsets - read/write with sms_{read,write}_reg() */
95
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 */
101
102
103#ifndef __ASSEMBLER__
104
105/**
106 * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
107 * @rate: SDRC clock rate (in Hz)
108 * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
109 * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
110 * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
111 * @mr: Value to program to SDRC_MR for this rate
112 *
113 * This structure holds a pre-computed set of register values for the
114 * SDRC for a given SDRC clock rate and SDRAM chip. These are
115 * intended to be pre-computed and specified in an array in the board-*.c
116 * files. The structure is keyed off the 'rate' field.
117 */
118struct omap_sdrc_params {
119 unsigned long rate;
120 u32 actim_ctrla;
121 u32 actim_ctrlb;
122 u32 rfr_ctrl;
123 u32 mr;
124};
125
126#ifdef CONFIG_SOC_HAS_OMAP2_SDRC
127void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
128 struct omap_sdrc_params *sdrc_cs1);
129#else
130static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
131 struct omap_sdrc_params *sdrc_cs1) {};
132#endif
133
134int omap2_sdrc_get_params(unsigned long r,
135 struct omap_sdrc_params **sdrc_cs0,
136 struct omap_sdrc_params **sdrc_cs1);
137void omap2_sms_save_context(void);
138void omap2_sms_restore_context(void);
139
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
145
146struct memory_timings {
147 u32 m_type; /* ddr = 1, sdr = 0 */
148 u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
149 u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
150 u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
151 u32 base_cs; /* base chip select to use for calculations */
152};
153
154extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
155struct omap_sdrc_params *rx51_get_sdram_timings(void);
156
157u32 omap2xxx_sdrc_dll_is_unlocked(void);
158u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
159
160#endif /* CONFIG_ARCH_OMAP2 */
161
162#endif /* __ASSEMBLER__ */
163
164#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 */