linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh: add support FLCTL for ap325rxa board
@ 2008-09-09  8:17 Yoshihiro Shimoda
  2008-10-21  9:11 ` Paul Mundt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2008-09-09  8:17 UTC (permalink / raw)
  To: linux-sh

This patch adds platform_device for sh_flctl driver, NAND Flash
simple partition, and GPIO setting.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
---

 This patch depends on the sh_flctl MTD driver patch.
 http://marc.info/?l=linux-sh&m\x122094731021820&w=2

 arch/sh/boards/board-ap325rxa.c |   52 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index fd16125..4ba3001 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -15,6 +15,7 @@
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/mtd/physmap.h>
+#include <linux/mtd/sh_flctl.h>
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/smc911x.h>
@@ -93,6 +94,38 @@ static struct platform_device ap325rxa_nor_flash_device = {
 	},
 };

+static struct mtd_partition nand_partition_info[] = {
+	{
+		.name	= "nand_data",
+		.offset	= 0,
+		.size	= MTDPART_SIZ_FULL,
+	},
+};
+
+static struct resource nand_flash_resources[] = {
+	[0] = {
+		.start	= 0xa4530000,
+		.end	= 0xa45300ff,
+		.flags	= IORESOURCE_MEM,
+	}
+};
+
+static struct sh_flctl_platform_data nand_flash_data = {
+	.parts		= nand_partition_info,
+	.nr_parts	= ARRAY_SIZE(nand_partition_info),
+	.flcmncr_val	= FCKSEL_E | TYPESEL_SET | NANWF_E,
+	.has_hwecc	= 1,
+};
+
+static struct platform_device nand_flash_device = {
+	.name		= "sh_flctl",
+	.resource	= nand_flash_resources,
+	.num_resources	= ARRAY_SIZE(nand_flash_resources),
+	.dev		= {
+		.platform_data = &nand_flash_data,
+	},
+};
+
 #define FPGA_LCDREG	0xB4100180
 #define FPGA_BKLREG	0xB4100212
 #define FPGA_LCDREG_VAL	0x0018
@@ -101,11 +134,19 @@ static struct platform_device ap325rxa_nor_flash_device = {
 #define PORT_PMCR	0xA4050116
 #define PORT_PRCR	0xA405011C
 #define PORT_PSCR	0xA405011E
+#define PORT_PUCR	0xA4050142
+#define PORT_PVCR	0xA4050144
+#define PORT_PXCR	0xA4050148
 #define PORT_PZCR	0xA405014C
 #define PORT_HIZCRA	0xA4050158
+#define PORT_HIZCRC	0xA405015C
 #define PORT_MSELCRB	0xA4050182
+#define PORT_DRVCRA	0xA405018A
+#define PORT_DRVCRB	0xA405018C
 #define PORT_PSDR	0xA405013E
+#define PORT_PXDR	0xA4050168
 #define PORT_PZDR	0xA405016C
+#define PORT_PSELC	0xA4050152
 #define PORT_PSELD	0xA4050154

 static void ap320_wvga_power_on(void *board_data)
@@ -278,6 +319,7 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
 #ifdef CONFIG_I2C
 	&camera_device,
 #endif
+	&nand_flash_device,
 };

 static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
@@ -312,6 +354,16 @@ static void __init ap325rxa_setup(char **cmdline_p)
 	ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD);
 	ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR);
 	ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR);
+
+	/* FLCTL */
+	ctrl_outw(0, PORT_PUCR);
+	ctrl_outw(0, PORT_PVCR);
+	ctrl_outw(0, PORT_PSELC);
+	ctrl_outw(0, PORT_HIZCRC);
+	ctrl_outw(0xFFFF, PORT_DRVCRA);
+	ctrl_outw(0xFFFF, PORT_DRVCRB);
+	ctrl_outw((ctrl_inw(PORT_PXCR) & 0x3fff) | 0x4000, PORT_PXCR);
+	ctrl_outb(0x80, PORT_PXDR);
 }

 static struct sh_machine_vector mv_ap325rxa __initmv = {
-- 
1.5.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sh: add support FLCTL for ap325rxa board
  2008-09-09  8:17 [PATCH] sh: add support FLCTL for ap325rxa board Yoshihiro Shimoda
@ 2008-10-21  9:11 ` Paul Mundt
  2008-10-22  9:45 ` Yoshihiro Shimoda
  2008-10-22 10:03 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2008-10-21  9:11 UTC (permalink / raw)
  To: linux-sh

On Tue, Sep 09, 2008 at 05:17:42PM +0900, Yoshihiro Shimoda wrote:
> This patch adds platform_device for sh_flctl driver, NAND Flash
> simple partition, and GPIO setting.
> 
> Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>

Now that the sh_flctl MTD driver has been merged, I have applied this
patch.

>  static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
> @@ -312,6 +354,16 @@ static void __init ap325rxa_setup(char **cmdline_p)
>  	ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD);
>  	ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR);
>  	ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR);
> +
> +	/* FLCTL */
> +	ctrl_outw(0, PORT_PUCR);
> +	ctrl_outw(0, PORT_PVCR);
> +	ctrl_outw(0, PORT_PSELC);
> +	ctrl_outw(0, PORT_HIZCRC);
> +	ctrl_outw(0xFFFF, PORT_DRVCRA);
> +	ctrl_outw(0xFFFF, PORT_DRVCRB);
> +	ctrl_outw((ctrl_inw(PORT_PXCR) & 0x3fff) | 0x4000, PORT_PXCR);
> +	ctrl_outb(0x80, PORT_PXDR);
>  }
> 
>  static struct sh_machine_vector mv_ap325rxa __initmv = {

I checked this part in with your original patch, but have since rewrote
it to grab all of the FLCTL pins through the new pinmux code. Please make
sure that it still works for you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sh: add support FLCTL for ap325rxa board
  2008-09-09  8:17 [PATCH] sh: add support FLCTL for ap325rxa board Yoshihiro Shimoda
  2008-10-21  9:11 ` Paul Mundt
@ 2008-10-22  9:45 ` Yoshihiro Shimoda
  2008-10-22 10:03 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2008-10-22  9:45 UTC (permalink / raw)
  To: linux-sh

Paul Mundt wrote:
> On Tue, Sep 09, 2008 at 05:17:42PM +0900, Yoshihiro Shimoda wrote:
>> This patch adds platform_device for sh_flctl driver, NAND Flash
>> simple partition, and GPIO setting.
>>
>> Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
> 
> Now that the sh_flctl MTD driver has been merged, I have applied this
> patch.

Thank you very much.

>>  static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
>> @@ -312,6 +354,16 @@ static void __init ap325rxa_setup(char **cmdline_p)
>>  	ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD);
>>  	ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR);
>>  	ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR);
>> +
>> +	/* FLCTL */
>> +	ctrl_outw(0, PORT_PUCR);
>> +	ctrl_outw(0, PORT_PVCR);
>> +	ctrl_outw(0, PORT_PSELC);
>> +	ctrl_outw(0, PORT_HIZCRC);
>> +	ctrl_outw(0xFFFF, PORT_DRVCRA);
>> +	ctrl_outw(0xFFFF, PORT_DRVCRB);
>> +	ctrl_outw((ctrl_inw(PORT_PXCR) & 0x3fff) | 0x4000, PORT_PXCR);
>> +	ctrl_outb(0x80, PORT_PXDR);
>>  }
>>
>>  static struct sh_machine_vector mv_ap325rxa __initmv = {
> 
> I checked this part in with your original patch, but have since rewrote
> it to grab all of the FLCTL pins through the new pinmux code. Please make
> sure that it still works for you.

I checked that FLCTL worked correctly using today's sh-2.6.git.

Thanks,
Yoshihiro Shimoda

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sh: add support FLCTL for ap325rxa board
  2008-09-09  8:17 [PATCH] sh: add support FLCTL for ap325rxa board Yoshihiro Shimoda
  2008-10-21  9:11 ` Paul Mundt
  2008-10-22  9:45 ` Yoshihiro Shimoda
@ 2008-10-22 10:03 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2008-10-22 10:03 UTC (permalink / raw)
  To: linux-sh

On Wed, Oct 22, 2008 at 06:45:14PM +0900, Yoshihiro Shimoda wrote:
> Paul Mundt wrote:
> >> +	/* FLCTL */
> >> +	ctrl_outw(0, PORT_PUCR);
> >> +	ctrl_outw(0, PORT_PVCR);
> >> +	ctrl_outw(0, PORT_PSELC);
> >> +	ctrl_outw(0, PORT_HIZCRC);
> >> +	ctrl_outw(0xFFFF, PORT_DRVCRA);
> >> +	ctrl_outw(0xFFFF, PORT_DRVCRB);
> >> +	ctrl_outw((ctrl_inw(PORT_PXCR) & 0x3fff) | 0x4000, PORT_PXCR);
> >> +	ctrl_outb(0x80, PORT_PXDR);
> >>  }
> >>
> >>  static struct sh_machine_vector mv_ap325rxa __initmv = {
> > 
> > I checked this part in with your original patch, but have since rewrote
> > it to grab all of the FLCTL pins through the new pinmux code. Please make
> > sure that it still works for you.
> 
> I checked that FLCTL worked correctly using today's sh-2.6.git.
> 
Great, thanks for testing!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-22 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09  8:17 [PATCH] sh: add support FLCTL for ap325rxa board Yoshihiro Shimoda
2008-10-21  9:11 ` Paul Mundt
2008-10-22  9:45 ` Yoshihiro Shimoda
2008-10-22 10:03 ` Paul Mundt

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).