* ARM: OMAP: Overo: use new gpmc nand infrastructure
@ 2010-04-07 17:35 Steve Sakoman
2010-04-07 17:41 ` Kevin Hilman
0 siblings, 1 reply; 4+ messages in thread
From: Steve Sakoman @ 2010-04-07 17:35 UTC (permalink / raw)
To: linux-omap
From: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
diff --git a/arch/arm/mach-omap2/board-overo.c
b/arch/arm/mach-omap2/board-overo.c
index 8848c7c..ae23633 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -184,6 +184,11 @@ static inline void __init overo_init_smsc911x(void)
static inline void __init overo_init_smsc911x(void) { return; }
#endif
+struct flash_partitions {
+ struct mtd_partition *parts;
+ int nr_parts;
+};
+
static struct mtd_partition overo_nand_partitions[] = {
{
.name = "xloader",
@@ -213,34 +218,80 @@ static struct mtd_partition overo_nand_partitions[] = {
},
};
-static struct omap_nand_platform_data overo_nand_data = {
- .parts = overo_nand_partitions,
- .nr_parts = ARRAY_SIZE(overo_nand_partitions),
- .dma_channel = -1, /* disable DMA in OMAP NAND driver */
+static struct flash_partitions overo_flash_partitions[] = {
+ {
+ /* NOR flash */
+ },
+ {
+ /* OneNAND */
+ },
+ {
+ /* NAND */
+ .parts = overo_nand_partitions,
+ .nr_parts = ARRAY_SIZE(overo_nand_partitions),
+ },
};
-static struct resource overo_nand_resource = {
- .flags = IORESOURCE_MEM,
+#if defined(CONFIG_MTD_NAND_OMAP2) || \
+ defined(CONFIG_MTD_NAND_OMAP2_MODULE)
+
+/* Note that all values in this struct are in nanoseconds */
+static struct gpmc_timings nand_timings = {
+
+ .sync_clk = 0,
+
+ .cs_on = 0,
+ .cs_rd_off = 36,
+ .cs_wr_off = 36,
+
+ .adv_on = 6,
+ .adv_rd_off = 24,
+ .adv_wr_off = 36,
+
+ .we_off = 30,
+ .oe_off = 48,
+
+ .access = 54,
+ .rd_cycle = 72,
+ .wr_cycle = 72,
+
+ .wr_access = 30,
+ .wr_data_mux_bus = 0,
};
-static struct platform_device overo_nand_device = {
- .name = "omap2-nand",
- .id = -1,
- .dev = {
- .platform_data = &overo_nand_data,
- },
- .num_resources = 1,
- .resource = &overo_nand_resource,
+static struct omap_nand_platform_data overo_nand_data = {
+ .nand_setup = NULL,
+ .gpmc_t = &nand_timings,
+ .dma_channel = -1, /* disable DMA in OMAP NAND driver */
+ .dev_ready = NULL,
+ .devsize = 1, /* '0' for 8-bit, '1' for 16-bit device */
};
+static void
+__init board_nand_init(struct flash_partitions overo_nand_parts, u8 cs)
+{
+ overo_nand_data.cs = cs;
+ overo_nand_data.parts = overo_nand_parts.parts;
+ overo_nand_data.nr_parts = overo_nand_parts.nr_parts;
+ overo_nand_data.gpmc_baseaddr = (void *) (OMAP34XX_GPMC_VIRT);
+
+ overo_nand_data.gpmc_cs_baseaddr = (void *)(OMAP34XX_GPMC_VIRT +
+ GPMC_CS0_BASE + cs * GPMC_CS_SIZE);
-static void __init overo_flash_init(void)
+ gpmc_nand_init(&overo_nand_data);
+}
+#else
+static void
+__init board_nand_init(struct flash_partitions overo_nand_parts, u8 cs)
{
+}
+#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
+
+static void
+__init overo_flash_init(struct flash_partitions partition_info[]) {
u8 cs = 0;
u8 nandcs = GPMC_CS_NUM + 1;
- u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
-
/* find out the chip-select on which NAND exists */
while (cs < GPMC_CS_NUM) {
u32 ret = 0;
@@ -260,16 +311,8 @@ static void __init overo_flash_init(void)
return;
}
- if (nandcs < GPMC_CS_NUM) {
- overo_nand_data.cs = nandcs;
- overo_nand_data.gpmc_cs_baseaddr = (void *)
- (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
- overo_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
-
- printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
- if (platform_device_register(&overo_nand_device) < 0)
- printk(KERN_ERR "Unable to register NAND device\n");
- }
+ if (nandcs < GPMC_CS_NUM)
+ board_nand_init(partition_info[2], nandcs);
}
static struct omap2_hsmmc_info mmc[] = {
@@ -425,7 +468,7 @@ static void __init overo_init(void)
overo_i2c_init();
platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
omap_serial_init();
- overo_flash_init();
+ overo_flash_init(overo_flash_partitions);
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
overo_ads7846_init();
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: ARM: OMAP: Overo: use new gpmc nand infrastructure
2010-04-07 17:35 ARM: OMAP: Overo: use new gpmc nand infrastructure Steve Sakoman
@ 2010-04-07 17:41 ` Kevin Hilman
2010-04-07 19:08 ` Steve Sakoman
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hilman @ 2010-04-07 17:41 UTC (permalink / raw)
To: Steve Sakoman; +Cc: linux-omap
Steve Sakoman <steve@sakoman.com> writes:
> From: Steve Sakoman <steve@sakoman.com>
>
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-ENOCHANGELOG
Please add descriptive changelog. Otherwise, looks like a good
cleanup.
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ARM: OMAP: Overo: use new gpmc nand infrastructure
2010-04-07 17:41 ` Kevin Hilman
@ 2010-04-07 19:08 ` Steve Sakoman
2010-04-07 20:33 ` Kevin Hilman
0 siblings, 1 reply; 4+ messages in thread
From: Steve Sakoman @ 2010-04-07 19:08 UTC (permalink / raw)
To: Kevin Hilman, linux-omap
On Wed, Apr 7, 2010 at 10:41 AM, Kevin Hilman
<khilman@deeprootsystems.com> wrote:
> Steve Sakoman <steve@sakoman.com> writes:
>
>> From: Steve Sakoman <steve@sakoman.com>
>>
>> Signed-off-by: Steve Sakoman <steve@sakoman.com>
>
> -ENOCHANGELOG
>
> Please add descriptive changelog. Otherwise, looks like a good
> cleanup.
I assume you looking for something like:
Restores nand functionality after changes in commit
2f70a1e93657bea0baa7d449aa49e44a08582dc8
If so I'll add it after waiting a bit for any other comments. I
assume you are also OK with the similar patch for Beagleboard?
Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ARM: OMAP: Overo: use new gpmc nand infrastructure
2010-04-07 19:08 ` Steve Sakoman
@ 2010-04-07 20:33 ` Kevin Hilman
0 siblings, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2010-04-07 20:33 UTC (permalink / raw)
To: Steve Sakoman; +Cc: linux-omap
Steve Sakoman <sakoman@gmail.com> writes:
> On Wed, Apr 7, 2010 at 10:41 AM, Kevin Hilman
> <khilman@deeprootsystems.com> wrote:
>> Steve Sakoman <steve@sakoman.com> writes:
>>
>>> From: Steve Sakoman <steve@sakoman.com>
>>>
>>> Signed-off-by: Steve Sakoman <steve@sakoman.com>
>>
>> -ENOCHANGELOG
>>
>> Please add descriptive changelog. Otherwise, looks like a good
>> cleanup.
>
> I assume you looking for something like:
>
> Restores nand functionality after changes in commit
> 2f70a1e93657bea0baa7d449aa49e44a08582dc8
Personally, I'd rather see a text summary of the commit (plus commit
ID) so I don't have to follow a commit ID unless I really want the
details. Something like:
"A new GPMC NAND infrastructure was added by commit foo. This patch
updates Overo NAND functionally to work with those changes."
or similar. Since the changelogs become permanent git history, it's
important that they be descriptive and useful long after the initial
commits are done and we've all forgotten about the details.
> If so I'll add it after waiting a bit for any other comments. I
> assume you are also OK with the similar patch for Beagleboard?
Yes, with a good changelog. ;)
-- Kevin (changelog cop) Hilman
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-07 20:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 17:35 ARM: OMAP: Overo: use new gpmc nand infrastructure Steve Sakoman
2010-04-07 17:41 ` Kevin Hilman
2010-04-07 19:08 ` Steve Sakoman
2010-04-07 20:33 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox