Skip to contentSkip to conversation

mx35_3ds mtd support

PATCH New Michael Grzeschik 3 participants 7 messages Aug 18, 2010 – Aug 20, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover mx35_3ds mtd support

This patchseries includes support for the Spansion 64 NOR Flash and the 2GB Samsung MLC Nand Flash mtd devices on the mx35_3ds platform.

Marc Kleine-Budde (2):
mx35_3ds: add physmap-flash NOR at CS0
mx35_3ds: add NAND flash

 arch/arm/mach-mx3/Kconfig         |    1 +
 arch/arm/mach-mx3/mach-mx35_3ds.c |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
#1 lore raw

PATCH 1/2 mx35_3ds: add physmap-flash NOR at CS0

From: Marc Kleine-Budde <[email protected]>

The mx35_3ds comes with 64 MiByte for NOR flash at CS0, add physmap-flash platform device for it.

---
 arch/arm/mach-mx3/mach-mx35_3ds.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/mach-mx35_3ds.c +24 -0
index 1c30d72..73149b8 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2009 Marc Kleine-Budde, Pengutronix
  *
  * Author: Fabio Estevam <[email protected]>
  *
@@ -27,6 +28,8 @@
 #include <linux/gpio.h>
 #include <linux/fsl_devices.h>
 
+#include <linux/mtd/physmap.h>
+
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
@@ -43,8 +46,29 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
 	.flags = IMXUART_HAVE_RTSCTS,
 };
 
+static struct physmap_flash_data mx35pdk_flash_data = {
+	.width  = 2,
+};
+
+static struct resource mx35pdk_flash_resource = {
+	.start	= MX35_CS0_BASE_ADDR,
+	.end	= MX35_CS0_BASE_ADDR + SZ_64M - 1,
+	.flags	= IORESOURCE_MEM,
+};
+
+static struct platform_device mx35pdk_flash = {
+	.name	= "physmap-flash",
+	.id	= 0,
+	.dev	= {
+		.platform_data  = &mx35pdk_flash_data,
+	},
+	.resource = &mx35pdk_flash_resource,
+	.num_resources = 1,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&mxc_fec_device,
+	&mx35pdk_flash,
 };
 
 static struct pad_desc mx35pdk_pads[] = {
Signature · 1 line
1.7.1
#2 lore raw

PATCH 1/2 mx35_3ds: add physmap-flash NOR at CS0

From: Marc Kleine-Budde <[email protected]>

The mx35_3ds comes with 64 MiByte for NOR flash at CS0, add physmap-flash platform device for it.

---
 arch/arm/mach-mx3/mach-mx35_3ds.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/mach-mx35_3ds.c +24 -0
index 1c30d72..73149b8 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2009 Marc Kleine-Budde, Pengutronix
  *
  * Author: Fabio Estevam <[email protected]>
  *
@@ -27,6 +28,8 @@
 #include <linux/gpio.h>
 #include <linux/fsl_devices.h>
 
+#include <linux/mtd/physmap.h>
+
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
@@ -43,8 +46,29 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
 	.flags = IMXUART_HAVE_RTSCTS,
 };
 
+static struct physmap_flash_data mx35pdk_flash_data = {
+	.width  = 2,
+};
+
+static struct resource mx35pdk_flash_resource = {
+	.start	= MX35_CS0_BASE_ADDR,
+	.end	= MX35_CS0_BASE_ADDR + SZ_64M - 1,
+	.flags	= IORESOURCE_MEM,
+};
+
+static struct platform_device mx35pdk_flash = {
+	.name	= "physmap-flash",
+	.id	= 0,
+	.dev	= {
+		.platform_data  = &mx35pdk_flash_data,
+	},
+	.resource = &mx35pdk_flash_resource,
+	.num_resources = 1,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&mxc_fec_device,
+	&mx35pdk_flash,
 };
 
 static struct pad_desc mx35pdk_pads[] = {
Signature · 1 line
1.7.1
#3 lore raw

PATCH 1/2 mx35_3ds: add physmap-flash NOR at CS0

In reply to Michael Grzeschik

Hello.

Quoted 6 lines · Michael Grzeschik

From: Marc Kleine-Budde <[email protected]>

The mx35_3ds comes with 64 MiByte for NOR flash at CS0, add physmap-flash platform device for it.

[...]

Quoted 4 lines
arch/arm/mach-mx3/mach-mx35_3ds.c +0 -0
index 1c30d72..73149b8 100644

[...]

Quoted 7 lines
arch/arm/mach-mx3/mach-mx35_3ds.c +3 -0
@@ -43,8 +46,29 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
 	.flags = IMXUART_HAVE_RTSCTS,
 };
 
+static struct physmap_flash_data mx35pdk_flash_data = {
+	.width  = 2,
+};

arch/arm/mach-mx3/mach-mx35_3ds.c static const struct imxuart_platform_data uart_pdata __initconst = { · line 61

Quoted 10 lines
arch/arm/mach-mx3/mach-mx35_3ds.c +10 -0
+
+static struct resource mx35pdk_flash_resource = {
+	.start	= MX35_CS0_BASE_ADDR,
+	.end	= MX35_CS0_BASE_ADDR + SZ_64M - 1,
+	.flags	= IORESOURCE_MEM,
+};
+
+static struct platform_device mx35pdk_flash = {
+	.name	= "physmap-flash",
+	.id	= 0,

-1 perhaps as that is probably a single physmap devie on your board?

WBR, Sergei

#4 lore raw

PATCH 1/2 mx35_3ds: add physmap-flash NOR at CS0

Hi Sergei,

Quoted 6 lines · Sergei Shtylyov
Quoted 6 lines
arch/arm/mach-mx3/mach-mx35_3ds.c +6 -0
+	.width  = 2,
+};
+
+static struct resource mx35pdk_flash_resource = {
+	.start	= MX35_CS0_BASE_ADDR,
+	.end	= MX35_CS0_BASE_ADDR + SZ_64M - 1,
Quoted 8 lines

arch/arm/mach-mx3/mach-mx35_3ds.c static const struct imxuart_platform_data uart_pdata __initconst = { · line 61

Quoted 6 lines
arch/arm/mach-mx3/mach-mx35_3ds.c +6 -0
+	.flags	= IORESOURCE_MEM,
+};
+
+static struct platform_device mx35pdk_flash = {
+	.name	= "physmap-flash",
+	.id	= 0,

-1 perhaps as that is probably a single physmap devie on your board?

Generally yes, but we are using command line partition tables and all our bootloader environments pass physmap-flash.0 as identifier, so it's better to keep 0.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#5 lore raw

PATCH 2/2 mx35_3ds: add NAND flash

In reply to Michael Grzeschik

From: Marc Kleine-Budde <[email protected]>

The mx35_3ds comes with 2 GiByte NAND flash, register mxc_nand_device to access it.

---
 arch/arm/mach-mx3/Kconfig         |    1 +
 arch/arm/mach-mx3/mach-mx35_3ds.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/Kconfig +1 -0
index 486c05d..5cee1a5 100644
@@ -141,6 +141,7 @@ config MACH_MX35_3DS
 	bool "Support MX35PDK platform"
 	select ARCH_MX35
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_NAND
 	default n
 	help
 	  Include support for MX35PDK platform. This includes specific
arch/arm/mach-mx3/mach-mx35_3ds.c +8 -0
index 73149b8..b3629e7 100644
@@ -66,6 +66,12 @@ static struct platform_device mx35pdk_flash = {
 	.num_resources = 1,
 };
 
+static const struct mxc_nand_platform_data mx35pdk_nand_board_info __initconst = {
+	.width = 1,
+	.hw_ecc = 1,
+	.flash_bbt = 1,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&mxc_fec_device,
 	&mx35pdk_flash,
@@ -119,6 +125,8 @@ static void __init mxc_board_init(void)
 	imx35_add_imx_uart0(&uart_pdata);
 
 	mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
+
+	imx35_add_mxc_nand(&mx35pdk_nand_board_info);
 }
 
 static void __init mx35pdk_timer_init(void)
Signature · 1 line
1.7.1
#6 lore raw

PATCH 2/2 mx35_3ds: add NAND flash

From: Marc Kleine-Budde <[email protected]>

The mx35_3ds comes with 2 GiByte NAND flash, register mxc_nand_device to access it.

---
 arch/arm/mach-mx3/Kconfig         |    1 +
 arch/arm/mach-mx3/mach-mx35_3ds.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/Kconfig +1 -0
index 486c05d..5cee1a5 100644
@@ -141,6 +141,7 @@ config MACH_MX35_3DS
 	bool "Support MX35PDK platform"
 	select ARCH_MX35
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select IMX_HAVE_PLATFORM_MXC_NAND
 	default n
 	help
 	  Include support for MX35PDK platform. This includes specific
arch/arm/mach-mx3/mach-mx35_3ds.c +8 -0
index 73149b8..b3629e7 100644
@@ -66,6 +66,12 @@ static struct platform_device mx35pdk_flash = {
 	.num_resources = 1,
 };
 
+static const struct mxc_nand_platform_data mx35pdk_nand_board_info __initconst = {
+	.width = 1,
+	.hw_ecc = 1,
+	.flash_bbt = 1,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&mxc_fec_device,
 	&mx35pdk_flash,
@@ -119,6 +125,8 @@ static void __init mxc_board_init(void)
 	imx35_add_imx_uart0(&uart_pdata);
 
 	mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
+
+	imx35_add_mxc_nand(&mx35pdk_nand_board_info);
 }
 
 static void __init mx35pdk_timer_init(void)
Signature · 1 line
1.7.1