* [PATCH 0/8] arm: omap: add support for RM-680
@ 2010-12-09 16:39 Aaro Koskinen
2010-12-09 16:39 ` [PATCH 1/8] arm: omap: rename board-rx51-sdram.c to sdram-nokia.c Aaro Koskinen
` (7 more replies)
0 siblings, 8 replies; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
These patches add initial support for Nokia RM-680 board.
Patches 1-7 are just preparation and make board-rx51-sdram.c reusable
by renaming it to sdram-nokia.c etc.
Patch 8 adds a new board and requires updated mach-types from
http://www.arm.linux.org.uk/developer/machines/download.php in order
to compile.
These are based on top of linux-omap/master
(92f446c47b18827e61483787668b0bb5f7a033b6).
...
Aaro Koskinen (8):
arm: omap: rename board-rx51-sdram.c to sdram-nokia.c
arm: omap: add sdram-nokia.h
arm: omap: sdram-nokia: prepare for new memory timings
arm: omap: sdram-nokia: use array to list timings
arm: omap: sdram-nokia: improve error handling
arm: omap: sdram-nokia: delete redundant timing data
arm: omap: sdram-nokia: add 97.6/195.2 MHz timing data
arm: omap: add minimal support for RM-680
arch/arm/mach-omap2/Kconfig | 6 +
arch/arm/mach-omap2/Makefile | 5 +-
arch/arm/mach-omap2/board-rm680.c | 187 ++++++++++++++++++++
arch/arm/mach-omap2/board-rx51.c | 4 +-
.../{board-rx51-sdram.c => sdram-nokia.c} | 102 +++++++++---
arch/arm/mach-omap2/sdram-nokia.h | 12 ++
arch/arm/plat-omap/include/plat/uncompress.h | 1 +
7 files changed, 292 insertions(+), 25 deletions(-)
create mode 100644 arch/arm/mach-omap2/board-rm680.c
rename arch/arm/mach-omap2/{board-rx51-sdram.c => sdram-nokia.c} (66%)
create mode 100644 arch/arm/mach-omap2/sdram-nokia.h
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/8] arm: omap: rename board-rx51-sdram.c to sdram-nokia.c
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 16:39 ` [PATCH 2/8] arm: omap: add sdram-nokia.h Aaro Koskinen
` (6 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
Rename the file and functions so that it can be reused by future Nokia
boards. Based on patches by Juha Keski-Saari.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-omap2/board-rx51.c | 4 +-
.../{board-rx51-sdram.c => sdram-nokia.c} | 34 ++++++++++----------
3 files changed, 20 insertions(+), 20 deletions(-)
rename arch/arm/mach-omap2/{board-rx51-sdram.c => sdram-nokia.c} (85%)
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fbc8739..3a71d19 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -141,7 +141,7 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
board-flash.o
obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
- board-rx51-sdram.o \
+ sdram-nokia.o \
board-rx51-peripherals.o \
board-rx51-video.o \
hsmmc.o
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 6635142..b7df8e3 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -35,7 +35,7 @@
#define RX51_GPIO_SLEEP_IND 162
-struct omap_sdrc_params *rx51_get_sdram_timings(void);
+struct omap_sdrc_params *nokia_get_sdram_timings(void);
extern void rx51_video_mem_init(void);
static struct gpio_led gpio_leds[] = {
@@ -105,7 +105,7 @@ static void __init rx51_init_irq(void)
omap_board_config = rx51_config;
omap_board_config_size = ARRAY_SIZE(rx51_config);
omap3_pm_init_cpuidle(rx51_cpuidle_params);
- sdrc_params = rx51_get_sdram_timings();
+ sdrc_params = nokia_get_sdram_timings();
omap2_init_common_hw(sdrc_params, sdrc_params);
omap_init_irq();
}
diff --git a/arch/arm/mach-omap2/board-rx51-sdram.c b/arch/arm/mach-omap2/sdram-nokia.c
similarity index 85%
rename from arch/arm/mach-omap2/board-rx51-sdram.c
rename to arch/arm/mach-omap2/sdram-nokia.c
index a43b2c5..690202b 100644
--- a/arch/arm/mach-omap2/board-rx51-sdram.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -1,7 +1,7 @@
/*
- * SDRC register values for RX51
+ * SDRC register values for Nokia boards
*
- * Copyright (C) 2008 Nokia Corporation
+ * Copyright (C) 2008, 2010 Nokia Corporation
*
* Lauri Leukkunen <lauri.leukkunen@nokia.com>
*
@@ -43,9 +43,9 @@ struct sdram_timings {
u32 tWTR;
};
-static struct omap_sdrc_params rx51_sdrc_params[4];
+static struct omap_sdrc_params nokia_sdrc_params[4];
-static const struct sdram_timings rx51_timings[] = {
+static const struct sdram_timings memory_timings[] = {
{
.casl = 3,
.tDAL = 33000,
@@ -110,12 +110,12 @@ static int set_sdrc_timing_regval(u32 *regval, int st_bit, int end_bit,
#ifdef DEBUG
#define SDRC_SET_ONE(reg, st, end, field, rate) \
if (set_sdrc_timing_regval((reg), (st), (end), \
- rx51_timings->field, (rate), #field) < 0) \
+ memory_timings->field, (rate), #field) < 0) \
err = -1;
#else
#define SDRC_SET_ONE(reg, st, end, field, rate) \
if (set_sdrc_timing_regval((reg), (st), (end), \
- rx51_timings->field) < 0) \
+ memory_timings->field) < 0) \
err = -1;
#endif
@@ -148,14 +148,14 @@ static int set_sdrc_timing_regval_ps(u32 *regval, int st_bit, int end_bit,
#ifdef DEBUG
#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \
if (set_sdrc_timing_regval_ps((reg), (st), (end), \
- rx51_timings->field, \
+ memory_timings->field, \
(rate), #field) < 0) \
err = -1;
#else
#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \
if (set_sdrc_timing_regval_ps((reg), (st), (end), \
- rx51_timings->field, (rate)) < 0) \
+ memory_timings->field, (rate)) < 0) \
err = -1;
#endif
@@ -184,7 +184,7 @@ static int sdrc_timings(int id, long rate)
SDRC_SET_ONE(&actim_ctrlb, 16, 17, tWTR, l3_rate);
ticks_per_ms = l3_rate;
- rfr = rx51_timings[0].tREF * ticks_per_ms / 1000000;
+ rfr = memory_timings[0].tREF * ticks_per_ms / 1000000;
if (rfr > 65535 + 50)
rfr = 65535;
else
@@ -197,18 +197,18 @@ static int sdrc_timings(int id, long rate)
l = rfr << 8;
rfr_ctrl = l | 0x1; /* autorefresh, reload counter with 1xARCV */
- rx51_sdrc_params[id].rate = rate;
- rx51_sdrc_params[id].actim_ctrla = actim_ctrla;
- rx51_sdrc_params[id].actim_ctrlb = actim_ctrlb;
- rx51_sdrc_params[id].rfr_ctrl = rfr_ctrl;
- rx51_sdrc_params[id].mr = 0x32;
+ nokia_sdrc_params[id].rate = rate;
+ nokia_sdrc_params[id].actim_ctrla = actim_ctrla;
+ nokia_sdrc_params[id].actim_ctrlb = actim_ctrlb;
+ nokia_sdrc_params[id].rfr_ctrl = rfr_ctrl;
+ nokia_sdrc_params[id].mr = 0x32;
- rx51_sdrc_params[id + 1].rate = 0;
+ nokia_sdrc_params[id + 1].rate = 0;
return err;
}
-struct omap_sdrc_params *rx51_get_sdram_timings(void)
+struct omap_sdrc_params *nokia_get_sdram_timings(void)
{
int err;
@@ -216,6 +216,6 @@ struct omap_sdrc_params *rx51_get_sdram_timings(void)
err |= sdrc_timings(1, 83000000);
err |= sdrc_timings(2, 166000000);
- return &rx51_sdrc_params[0];
+ return &nokia_sdrc_params[0];
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/8] arm: omap: add sdram-nokia.h
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
2010-12-09 16:39 ` [PATCH 1/8] arm: omap: rename board-rx51-sdram.c to sdram-nokia.c Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 16:45 ` Nishanth Menon
2010-12-09 16:39 ` [PATCH 3/8] arm: omap: sdram-nokia: prepare for new memory timings Aaro Koskinen
` (5 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
Add a header file for Nokia SDRAM functions. Based on patches by Juha
Keski-Saari.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
arch/arm/mach-omap2/board-rx51.c | 2 +-
arch/arm/mach-omap2/sdram-nokia.c | 1 +
arch/arm/mach-omap2/sdram-nokia.h | 12 ++++++++++++
3 files changed, 14 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/mach-omap2/sdram-nokia.h
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index b7df8e3..7362c91 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -32,10 +32,10 @@
#include "mux.h"
#include "pm.h"
+#include "sdram-nokia.h"
#define RX51_GPIO_SLEEP_IND 162
-struct omap_sdrc_params *nokia_get_sdram_timings(void);
extern void rx51_video_mem_init(void);
static struct gpio_led gpio_leds[] = {
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 690202b..261efc8 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -22,6 +22,7 @@
#include <plat/clock.h>
#include <plat/sdrc.h>
+#include "sdram-nokia.h"
/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */
struct sdram_timings {
diff --git a/arch/arm/mach-omap2/sdram-nokia.h b/arch/arm/mach-omap2/sdram-nokia.h
new file mode 100644
index 0000000..ee63da5
--- /dev/null
+++ b/arch/arm/mach-omap2/sdram-nokia.h
@@ -0,0 +1,12 @@
+/*
+ * SDRC register values for Nokia boards
+ *
+ * Copyright (C) 2010 Nokia
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+struct omap_sdrc_params *nokia_get_sdram_timings(void);
+
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/8] arm: omap: sdram-nokia: prepare for new memory timings
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
2010-12-09 16:39 ` [PATCH 1/8] arm: omap: rename board-rx51-sdram.c to sdram-nokia.c Aaro Koskinen
2010-12-09 16:39 ` [PATCH 2/8] arm: omap: add sdram-nokia.h Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 16:39 ` [PATCH 4/8] arm: omap: sdram-nokia: use array to list timings Aaro Koskinen
` (4 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
Rename the current timings to indicate they're for 166 MHz. Based on
patches by Eduardo Valentin and Juha Keski-Saari.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
---
arch/arm/mach-omap2/sdram-nokia.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 261efc8..97d1673 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -46,7 +46,7 @@ struct sdram_timings {
static struct omap_sdrc_params nokia_sdrc_params[4];
-static const struct sdram_timings memory_timings[] = {
+static const struct sdram_timings nokia_166mhz_timings[] = {
{
.casl = 3,
.tDAL = 33000,
@@ -160,7 +160,8 @@ static int set_sdrc_timing_regval_ps(u32 *regval, int st_bit, int end_bit,
err = -1;
#endif
-static int sdrc_timings(int id, long rate)
+static int sdrc_timings(int id, long rate,
+ const struct sdram_timings *memory_timings)
{
u32 ticks_per_ms;
u32 rfr, l;
@@ -213,9 +214,9 @@ struct omap_sdrc_params *nokia_get_sdram_timings(void)
{
int err;
- err = sdrc_timings(0, 41500000);
- err |= sdrc_timings(1, 83000000);
- err |= sdrc_timings(2, 166000000);
+ err = sdrc_timings(0, 41500000, nokia_166mhz_timings);
+ err |= sdrc_timings(1, 83000000, nokia_166mhz_timings);
+ err |= sdrc_timings(2, 166000000, nokia_166mhz_timings);
return &nokia_sdrc_params[0];
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/8] arm: omap: sdram-nokia: use array to list timings
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
` (2 preceding siblings ...)
2010-12-09 16:39 ` [PATCH 3/8] arm: omap: sdram-nokia: prepare for new memory timings Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 16:39 ` [PATCH 5/8] arm: omap: sdram-nokia: improve error handling Aaro Koskinen
` (3 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
Use an array to make it easier to add new values.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
arch/arm/mach-omap2/sdram-nokia.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 97d1673..1171451 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -44,8 +44,6 @@ struct sdram_timings {
u32 tWTR;
};
-static struct omap_sdrc_params nokia_sdrc_params[4];
-
static const struct sdram_timings nokia_166mhz_timings[] = {
{
.casl = 3,
@@ -67,6 +65,16 @@ static const struct sdram_timings nokia_166mhz_timings[] = {
},
};
+static const struct {
+ long rate;
+ struct sdram_timings const *data;
+} nokia_timings[] = {
+ { 41500000, nokia_166mhz_timings },
+ { 83000000, nokia_166mhz_timings },
+ { 166000000, nokia_166mhz_timings },
+};
+static struct omap_sdrc_params nokia_sdrc_params[ARRAY_SIZE(nokia_timings) + 1];
+
static unsigned long sdrc_get_fclk_period(long rate)
{
/* In picoseconds */
@@ -212,11 +220,12 @@ static int sdrc_timings(int id, long rate,
struct omap_sdrc_params *nokia_get_sdram_timings(void)
{
- int err;
+ int err = 0;
+ int i;
- err = sdrc_timings(0, 41500000, nokia_166mhz_timings);
- err |= sdrc_timings(1, 83000000, nokia_166mhz_timings);
- err |= sdrc_timings(2, 166000000, nokia_166mhz_timings);
+ for (i = 0; i < ARRAY_SIZE(nokia_timings); i++)
+ err |= sdrc_timings(i, nokia_timings[i].rate,
+ nokia_timings[i].data);
return &nokia_sdrc_params[0];
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/8] arm: omap: sdram-nokia: improve error handling
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
` (3 preceding siblings ...)
2010-12-09 16:39 ` [PATCH 4/8] arm: omap: sdram-nokia: use array to list timings Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 16:39 ` [PATCH 6/8] arm: omap: sdram-nokia: delete redundant timing data Aaro Koskinen
` (2 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
Actually check for errors: print an error log and return NULL.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
arch/arm/mach-omap2/sdram-nokia.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 1171451..863586b 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -223,10 +223,14 @@ struct omap_sdrc_params *nokia_get_sdram_timings(void)
int err = 0;
int i;
- for (i = 0; i < ARRAY_SIZE(nokia_timings); i++)
+ for (i = 0; i < ARRAY_SIZE(nokia_timings); i++) {
err |= sdrc_timings(i, nokia_timings[i].rate,
nokia_timings[i].data);
+ if (err)
+ pr_err("%s: error with rate %ld: %d\n", __func__,
+ nokia_timings[i].rate, err);
+ }
- return &nokia_sdrc_params[0];
+ return err ? NULL : nokia_sdrc_params;
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/8] arm: omap: sdram-nokia: delete redundant timing data
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
` (4 preceding siblings ...)
2010-12-09 16:39 ` [PATCH 5/8] arm: omap: sdram-nokia: improve error handling Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 16:39 ` [PATCH 7/8] arm: omap: sdram-nokia: add 97.6/195.2 MHz " Aaro Koskinen
2010-12-09 16:39 ` [PATCH 8/8] arm: omap: add minimal support for RM-680 Aaro Koskinen
7 siblings, 0 replies; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
41.5 MHz SDRAM clock is not usable.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
arch/arm/mach-omap2/sdram-nokia.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 863586b..baf83ec 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -69,7 +69,6 @@ static const struct {
long rate;
struct sdram_timings const *data;
} nokia_timings[] = {
- { 41500000, nokia_166mhz_timings },
{ 83000000, nokia_166mhz_timings },
{ 166000000, nokia_166mhz_timings },
};
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 7/8] arm: omap: sdram-nokia: add 97.6/195.2 MHz timing data
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
` (5 preceding siblings ...)
2010-12-09 16:39 ` [PATCH 6/8] arm: omap: sdram-nokia: delete redundant timing data Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 16:39 ` [PATCH 8/8] arm: omap: add minimal support for RM-680 Aaro Koskinen
7 siblings, 0 replies; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
Introduce 97.6/195.2 MHz memory timing data. Based on patches by Eduardo
Valentin, Igor Dmitriev and Juha Keski-Saari.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
Cc: Igor Dmitriev <ext-dmitriev.igor@nokia.com>
---
arch/arm/mach-omap2/sdram-nokia.c | 44 +++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index baf83ec..14caa22 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -44,6 +44,27 @@ struct sdram_timings {
u32 tWTR;
};
+static const struct sdram_timings nokia_97dot6mhz_timings[] = {
+ {
+ .casl = 3,
+ .tDAL = 30725,
+ .tDPL = 15362,
+ .tRRD = 10241,
+ .tRCD = 20483,
+ .tRP = 15362,
+ .tRAS = 40967,
+ .tRC = 56330,
+ .tRFC = 138266,
+ .tXSR = 204839,
+
+ .tREF = 7798,
+
+ .tXP = 2,
+ .tCKE = 4,
+ .tWTR = 2,
+ },
+};
+
static const struct sdram_timings nokia_166mhz_timings[] = {
{
.casl = 3,
@@ -65,12 +86,35 @@ static const struct sdram_timings nokia_166mhz_timings[] = {
},
};
+static const struct sdram_timings nokia_195dot2mhz_timings[] = {
+ {
+ .casl = 3,
+ .tDAL = 30725,
+ .tDPL = 15362,
+ .tRRD = 10241,
+ .tRCD = 20483,
+ .tRP = 15362,
+ .tRAS = 40967,
+ .tRC = 56330,
+ .tRFC = 138266,
+ .tXSR = 204839,
+
+ .tREF = 7752,
+
+ .tXP = 2,
+ .tCKE = 4,
+ .tWTR = 2,
+ },
+};
+
static const struct {
long rate;
struct sdram_timings const *data;
} nokia_timings[] = {
{ 83000000, nokia_166mhz_timings },
+ { 97600000, nokia_97dot6mhz_timings },
{ 166000000, nokia_166mhz_timings },
+ { 195200000, nokia_195dot2mhz_timings },
};
static struct omap_sdrc_params nokia_sdrc_params[ARRAY_SIZE(nokia_timings) + 1];
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 8/8] arm: omap: add minimal support for RM-680
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
` (6 preceding siblings ...)
2010-12-09 16:39 ` [PATCH 7/8] arm: omap: sdram-nokia: add 97.6/195.2 MHz " Aaro Koskinen
@ 2010-12-09 16:39 ` Aaro Koskinen
2010-12-09 17:03 ` Jamie Iles
7 siblings, 1 reply; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 16:39 UTC (permalink / raw)
To: linux-arm-kernel
Add minimal support for Nokia RM-680 board.
Tested with omap2plus_defconfig.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
arch/arm/mach-omap2/Kconfig | 6 +
arch/arm/mach-omap2/Makefile | 3 +
arch/arm/mach-omap2/board-rm680.c | 187 ++++++++++++++++++++++++++
arch/arm/plat-omap/include/plat/uncompress.h | 1 +
4 files changed, 197 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/board-rm680.c
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b67b1a9..9c317d6 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -221,6 +221,12 @@ config MACH_NOKIA_N8X0
select MACH_NOKIA_N810
select MACH_NOKIA_N810_WIMAX
+config MACH_NOKIA_RM680
+ bool "Nokia RM-680 board"
+ depends on ARCH_OMAP3
+ default y
+ select OMAP_PACKAGE_CBB
+
config MACH_NOKIA_RX51
bool "Nokia RX-51 board"
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 3a71d19..25bc945 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -140,6 +140,9 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
hsmmc.o \
board-flash.o
obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
+obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
+ sdram-nokia.o \
+ hsmmc.o
obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
sdram-nokia.o \
board-rx51-peripherals.o \
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
new file mode 100644
index 0000000..2966314
--- /dev/null
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -0,0 +1,187 @@
+/*
+ * Board support file for Nokia RM-680.
+ *
+ * Copyright (C) 2010 Nokia
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/io.h>
+#include <linux/i2c.h>
+#include <linux/gpio.h>
+#include <linux/init.h>
+#include <linux/i2c/twl.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/consumer.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+
+#include <plat/i2c.h>
+#include <plat/mmc.h>
+#include <plat/usb.h>
+#include <plat/gpmc.h>
+#include <plat/common.h>
+#include <plat/onenand.h>
+
+#include "mux.h"
+#include "hsmmc.h"
+#include "sdram-nokia.h"
+
+static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
+ REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"),
+};
+
+/* Fixed regulator for internal eMMC */
+static struct regulator_init_data rm680_vemmc = {
+ .constraints = {
+ .name = "rm680_vemmc",
+ .min_uV = 2900000,
+ .max_uV = 2900000,
+ .apply_uV = 1,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS
+ | REGULATOR_CHANGE_MODE,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(rm680_vemmc_consumers),
+ .consumer_supplies = rm680_vemmc_consumers,
+};
+
+static struct fixed_voltage_config rm680_vemmc_config = {
+ .supply_name = "VEMMC",
+ .microvolts = 2900000,
+ .gpio = 157,
+ .startup_delay = 150,
+ .enable_high = 1,
+ .init_data = &rm680_vemmc,
+};
+
+static struct platform_device rm680_vemmc_device = {
+ .name = "reg-fixed-voltage",
+ .dev = {
+ .platform_data = &rm680_vemmc_config,
+ },
+};
+
+static struct platform_device *rm680_peripherals_devices[] __initdata = {
+ &rm680_vemmc_device,
+};
+
+/* TWL */
+static struct twl4030_gpio_platform_data rm680_gpio_data = {
+ .gpio_base = OMAP_MAX_GPIO_LINES,
+ .irq_base = TWL4030_GPIO_IRQ_BASE,
+ .irq_end = TWL4030_GPIO_IRQ_END,
+ .pullups = BIT(0),
+ .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15),
+};
+
+static struct twl4030_usb_data rm680_usb_data = {
+ .usb_mode = T2_USB_MODE_ULPI,
+};
+
+static struct twl4030_platform_data rm680_twl_data = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+ .gpio = &rm680_gpio_data,
+ .usb = &rm680_usb_data,
+ /* add rest of the children here */
+};
+
+static struct i2c_board_info __initdata rm680_twl_i2c_board_info[] = {
+ {
+ I2C_BOARD_INFO("twl5031", 0x48),
+ .flags = I2C_CLIENT_WAKE,
+ .irq = INT_34XX_SYS_NIRQ,
+ .platform_data = &rm680_twl_data,
+ },
+};
+
+static void __init rm680_i2c_init(void)
+{
+ omap_register_i2c_bus(1, 2900, rm680_twl_i2c_board_info,
+ ARRAY_SIZE(rm680_twl_i2c_board_info));
+ omap_register_i2c_bus(2, 400, NULL, 0);
+ omap_register_i2c_bus(3, 400, NULL, 0);
+}
+
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
+ defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+static struct omap_onenand_platform_data board_onenand_data[] = {
+ {
+ .gpio_irq = 65,
+ .flags = ONENAND_SYNC_READWRITE,
+ }
+};
+#endif
+
+/* eMMC */
+static struct omap2_hsmmc_info mmc[] __initdata = {
+ {
+ .name = "internal",
+ .mmc = 2,
+ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED,
+ .gpio_cd = -EINVAL,
+ .gpio_wp = -EINVAL,
+ },
+ { /* Terminator */ }
+};
+
+static void __init rm680_peripherals_init(void)
+{
+ platform_add_devices(rm680_peripherals_devices,
+ ARRAY_SIZE(rm680_peripherals_devices));
+ rm680_i2c_init();
+ gpmc_onenand_init(board_onenand_data);
+ omap2_hsmmc_init(mmc);
+}
+
+static void __init rm680_init_irq(void)
+{
+ struct omap_sdrc_params *sdrc_params;
+
+ sdrc_params = nokia_get_sdram_timings();
+ omap2_init_common_hw(sdrc_params, sdrc_params);
+ omap_init_irq();
+ omap_gpio_init();
+}
+
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+ { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#endif
+
+static struct omap_musb_board_data rm680_musb_data = {
+ .interface_type = MUSB_INTERFACE_ULPI,
+ .mode = MUSB_PERIPHERAL,
+ .power = 100,
+};
+
+static void __init rm680_init(void)
+{
+ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+ omap_serial_init();
+ usb_musb_init(&rm680_musb_data);
+ rm680_peripherals_init();
+}
+
+static void __init rm680_map_io(void)
+{
+ omap2_set_globals_3xxx();
+ omap34xx_map_common_io();
+}
+
+MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
+ .boot_params = 0x80000100,
+ .map_io = rm680_map_io,
+ .reserve = omap_reserve,
+ .init_irq = rm680_init_irq,
+ .init_machine = rm680_init,
+ .timer = &omap_timer,
+MACHINE_END
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 229fbf2..7bbc074 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -148,6 +148,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
DEBUG_LL_OMAP3(3, craneboard);
DEBUG_LL_OMAP3(3, igep0020);
DEBUG_LL_OMAP3(3, igep0030);
+ DEBUG_LL_OMAP3(3, nokia_rm680);
DEBUG_LL_OMAP3(3, nokia_rx51);
DEBUG_LL_OMAP3(3, omap3517evm);
DEBUG_LL_OMAP3(3, omap3_beagle);
--
1.5.6.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/8] arm: omap: add sdram-nokia.h
2010-12-09 16:39 ` [PATCH 2/8] arm: omap: add sdram-nokia.h Aaro Koskinen
@ 2010-12-09 16:45 ` Nishanth Menon
0 siblings, 0 replies; 14+ messages in thread
From: Nishanth Menon @ 2010-12-09 16:45 UTC (permalink / raw)
To: linux-arm-kernel
Aaro Koskinen had written, on 12/09/2010 10:39 AM, the following:
[...]
> diff --git a/arch/arm/mach-omap2/sdram-nokia.h b/arch/arm/mach-omap2/sdram-nokia.h
> new file mode 100644
> index 0000000..ee63da5
> --- /dev/null
> +++ b/arch/arm/mach-omap2/sdram-nokia.h
> @@ -0,0 +1,12 @@
> +/*
> + * SDRC register values for Nokia boards
> + *
> + * Copyright (C) 2010 Nokia
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +struct omap_sdrc_params *nokia_get_sdram_timings(void);
> +
Minor comment: Header guard missing. maybe nice to add #ifndef, #def,
#endif.
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 8/8] arm: omap: add minimal support for RM-680
2010-12-09 16:39 ` [PATCH 8/8] arm: omap: add minimal support for RM-680 Aaro Koskinen
@ 2010-12-09 17:03 ` Jamie Iles
2010-12-09 17:11 ` Aaro Koskinen
0 siblings, 1 reply; 14+ messages in thread
From: Jamie Iles @ 2010-12-09 17:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi Aaro,
A couple of small comments below, otherwise looks nice to me.
Jamie
On Thu, Dec 09, 2010 at 06:39:24PM +0200, Aaro Koskinen wrote:
> Add minimal support for Nokia RM-680 board.
>
> Tested with omap2plus_defconfig.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
> ---
[...]
> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
> + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
> +static struct omap_onenand_platform_data board_onenand_data[] = {
> + {
> + .gpio_irq = 65,
> + .flags = ONENAND_SYNC_READWRITE,
> + }
> +};
> +#endif
> +
> +/* eMMC */
> +static struct omap2_hsmmc_info mmc[] __initdata = {
> + {
> + .name = "internal",
> + .mmc = 2,
> + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED,
> + .gpio_cd = -EINVAL,
> + .gpio_wp = -EINVAL,
> + },
> + { /* Terminator */ }
> +};
> +
> +static void __init rm680_peripherals_init(void)
> +{
> + platform_add_devices(rm680_peripherals_devices,
> + ARRAY_SIZE(rm680_peripherals_devices));
> + rm680_i2c_init();
> + gpmc_onenand_init(board_onenand_data);
What happens if CONFIG_MTD_ONENAND_OMAP2=n and
CONFIG_MTD_ONENAND_OMAP2_MODULE=n? Do you need to define board_onenand_data to
NULL if these aren't enabled?
> + omap2_hsmmc_init(mmc);
> +}
> +
> +static void __init rm680_init_irq(void)
> +{
> + struct omap_sdrc_params *sdrc_params;
> +
> + sdrc_params = nokia_get_sdram_timings();
> + omap2_init_common_hw(sdrc_params, sdrc_params);
> + omap_init_irq();
> + omap_gpio_init();
> +}
> +
> +#ifdef CONFIG_OMAP_MUX
> +static struct omap_board_mux board_mux[] __initdata = {
> + { .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +#endif
> +
> +static struct omap_musb_board_data rm680_musb_data = {
> + .interface_type = MUSB_INTERFACE_ULPI,
> + .mode = MUSB_PERIPHERAL,
> + .power = 100,
> +};
> +
> +static void __init rm680_init(void)
> +{
> + omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
The same here as with the onenand data.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 8/8] arm: omap: add minimal support for RM-680
2010-12-09 17:03 ` Jamie Iles
@ 2010-12-09 17:11 ` Aaro Koskinen
2010-12-09 17:29 ` Jamie Iles
0 siblings, 1 reply; 14+ messages in thread
From: Aaro Koskinen @ 2010-12-09 17:11 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Thu, 9 Dec 2010, Jamie Iles wrote:
>> +static void __init rm680_peripherals_init(void)
>> +{
>> + platform_add_devices(rm680_peripherals_devices,
>> + ARRAY_SIZE(rm680_peripherals_devices));
>> + rm680_i2c_init();
>> + gpmc_onenand_init(board_onenand_data);
> What happens if CONFIG_MTD_ONENAND_OMAP2=n and
> CONFIG_MTD_ONENAND_OMAP2_MODULE=n? Do you need to define board_onenand_data to
> NULL if these aren't enabled?
[...]
>> +static void __init rm680_init(void)
>> +{
>> + omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> The same here as with the onenand data.
Check the following commits in linux-omap tree:
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=5403187f83c12c6f4c03547e0cc05bac0310be7b
and
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=7203f8a48bb63015ebe58a6f2a38aec1cb208b9d
A.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 8/8] arm: omap: add minimal support for RM-680
2010-12-09 17:11 ` Aaro Koskinen
@ 2010-12-09 17:29 ` Jamie Iles
2010-12-11 2:07 ` Tony Lindgren
0 siblings, 1 reply; 14+ messages in thread
From: Jamie Iles @ 2010-12-09 17:29 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 09, 2010 at 07:11:28PM +0200, Aaro Koskinen wrote:
> Hi,
>
> On Thu, 9 Dec 2010, Jamie Iles wrote:
> >>+static void __init rm680_peripherals_init(void)
> >>+{
> >>+ platform_add_devices(rm680_peripherals_devices,
> >>+ ARRAY_SIZE(rm680_peripherals_devices));
> >>+ rm680_i2c_init();
> >>+ gpmc_onenand_init(board_onenand_data);
> >What happens if CONFIG_MTD_ONENAND_OMAP2=n and
> >CONFIG_MTD_ONENAND_OMAP2_MODULE=n? Do you need to define board_onenand_data to
> >NULL if these aren't enabled?
> [...]
> >>+static void __init rm680_init(void)
> >>+{
> >>+ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> >The same here as with the onenand data.
>
> Check the following commits in linux-omap tree:
>
> http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=5403187f83c12c6f4c03547e0cc05bac0310be7b
>
> and
>
> http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=7203f8a48bb63015ebe58a6f2a38aec1cb208b9d
Thanks for the pointer! It looks a bit confusing to my eyes but I guess it's
better than lots of ifdeffery.
Jamie
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 8/8] arm: omap: add minimal support for RM-680
2010-12-09 17:29 ` Jamie Iles
@ 2010-12-11 2:07 ` Tony Lindgren
0 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2010-12-11 2:07 UTC (permalink / raw)
To: linux-arm-kernel
* Jamie Iles <jamie@jamieiles.com> [101209 09:29]:
> On Thu, Dec 09, 2010 at 07:11:28PM +0200, Aaro Koskinen wrote:
> >
> > Check the following commits in linux-omap tree:
> >
> > http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=5403187f83c12c6f4c03547e0cc05bac0310be7b
> >
> > and
> >
> > http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=7203f8a48bb63015ebe58a6f2a38aec1cb208b9d
> Thanks for the pointer! It looks a bit confusing to my eyes but I guess it's
> better than lots of ifdeffery.
Queuing these for the next merge window.
Tony
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-12-11 2:07 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-09 16:39 [PATCH 0/8] arm: omap: add support for RM-680 Aaro Koskinen
2010-12-09 16:39 ` [PATCH 1/8] arm: omap: rename board-rx51-sdram.c to sdram-nokia.c Aaro Koskinen
2010-12-09 16:39 ` [PATCH 2/8] arm: omap: add sdram-nokia.h Aaro Koskinen
2010-12-09 16:45 ` Nishanth Menon
2010-12-09 16:39 ` [PATCH 3/8] arm: omap: sdram-nokia: prepare for new memory timings Aaro Koskinen
2010-12-09 16:39 ` [PATCH 4/8] arm: omap: sdram-nokia: use array to list timings Aaro Koskinen
2010-12-09 16:39 ` [PATCH 5/8] arm: omap: sdram-nokia: improve error handling Aaro Koskinen
2010-12-09 16:39 ` [PATCH 6/8] arm: omap: sdram-nokia: delete redundant timing data Aaro Koskinen
2010-12-09 16:39 ` [PATCH 7/8] arm: omap: sdram-nokia: add 97.6/195.2 MHz " Aaro Koskinen
2010-12-09 16:39 ` [PATCH 8/8] arm: omap: add minimal support for RM-680 Aaro Koskinen
2010-12-09 17:03 ` Jamie Iles
2010-12-09 17:11 ` Aaro Koskinen
2010-12-09 17:29 ` Jamie Iles
2010-12-11 2:07 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).