linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <mike@compulab.co.il>
To: Sukumar Ghorai <s-ghorai@ti.com>
Cc: tony@atomide.com, sakoman@gmail.com, linux-omap@vger.kernel.org,
	linux-mtd@lists.infradead.org, Artem.Bityutskiy@nokia.com
Subject: Re: [PATCH 3/3] omap3 nand: fix issue in board file to detect the nand
Date: Wed, 12 May 2010 11:30:17 +0300	[thread overview]
Message-ID: <4BEA6719.1050400@compulab.co.il> (raw)
In-Reply-To: <1273652243-6303-4-git-send-email-s-ghorai@ti.com>

[Sukumar Ghorai wrote:
> From: Sukumar Ghorai <s-ghorai@ti.com>
> 
> Board file modified to pass the GMPC phys_base address to nand driver. This is
> required to adopt the _prob function as in omap2.c
> 
> Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
> ---
>  arch/arm/mach-omap2/board-cm-t35.c         |   10 ++++++++++
>  arch/arm/mach-omap2/board-devkit8000.c     |    9 +++++++++
>  arch/arm/mach-omap2/board-omap3beagle.c    |    9 +++++++++
>  arch/arm/mach-omap2/board-omap3touchbook.c |    9 +++++++++
>  arch/arm/mach-omap2/board-overo.c          |    8 ++++++++
>  5 files changed, 45 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
> index fb23122..73a32bd
> --- a/arch/arm/mach-omap2/board-cm-t35.c
> +++ b/arch/arm/mach-omap2/board-cm-t35.c
> @@ -240,6 +240,16 @@ static struct platform_device cm_t35_nand_device = {
>  
>  static void __init cm_t35_init_nand(void)
>  {
> +	struct device *dev = &cm_t35_nand_device.dev;
> +	int err = 0;
> +
> +	err = gpmc_cs_request(cm_t35_nand_data.cs,
> +					NAND_IO_SIZE, &cm_t35_nand_data.phys_base);
> +	if (err < 0) {
> +		dev_err(dev, "Cannot request GPMC CS\n");
> +		return;
> +	}
> +	
>  	if (platform_device_register(&cm_t35_nand_device) < 0)
>  		pr_err("CM-T35: Unable to register NAND device\n");

Why won't you use gpmc_nand_init instead of platform_device_register? 
With gpmc_nand_init there would be no need to request NAND CS in the 
board files. Besides, if you convert the boards to use gpmc_nand_init at 
the first place, it would simplify further patches.

>  }
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
> index be50d18..86358e3
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
> @@ -578,6 +578,9 @@ static void __init devkit8000_flash_init(void)
>  	u8 cs = 0;
>  	u8 nandcs = GPMC_CS_NUM + 1;
>  
> +	struct device *dev = &devkit8000_nand_device.dev;
> +	int err = 0;
> +
>  	/* find out the chip-select on which NAND exists */
>  	while (cs < GPMC_CS_NUM) {
>  		u32 ret = 0;
> @@ -599,6 +602,12 @@ static void __init devkit8000_flash_init(void)
>  
>  	if (nandcs < GPMC_CS_NUM) {
>  		devkit8000_nand_data.cs = nandcs;
> +		err = gpmc_cs_request(devkit8000_nand_data.cs,
> +					NAND_IO_SIZE, &devkit8000_nand_data.phys_base);
> +		if (err < 0) {
> +			dev_err(dev, "Cannot request GPMC CS\n");
> +			return;
> +		}
>  
>  		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
>  		if (platform_device_register(&devkit8000_nand_device) < 0)
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index becaebe..d54719d
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -374,6 +374,9 @@ static void __init omap3beagle_flash_init(void)
>  	u8 cs = 0;
>  	u8 nandcs = GPMC_CS_NUM + 1;
>  
> +	struct device *dev = &omap3beagle_nand_device.dev;
> +	int err = 0;
> +
>  	/* find out the chip-select on which NAND exists */
>  	while (cs < GPMC_CS_NUM) {
>  		u32 ret = 0;
> @@ -395,6 +398,12 @@ static void __init omap3beagle_flash_init(void)
>  
>  	if (nandcs < GPMC_CS_NUM) {
>  		omap3beagle_nand_data.cs = nandcs;
> +		err = gpmc_cs_request(omap3beagle_nand_data.cs,
> +						NAND_IO_SIZE, &omap3beagle_nand_data.phys_base);
> +		if (err < 0) {
> +			dev_err(dev, "Cannot request GPMC CS\n");
> +			return;
> +		}
>  
>  		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
>  		if (platform_device_register(&omap3beagle_nand_device) < 0)
> diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
> index d6f1b12..088a704
> --- a/arch/arm/mach-omap2/board-omap3touchbook.c
> +++ b/arch/arm/mach-omap2/board-omap3touchbook.c
> @@ -456,6 +456,9 @@ static void __init omap3touchbook_flash_init(void)
>  	u8 cs = 0;
>  	u8 nandcs = GPMC_CS_NUM + 1;
>  
> +	struct device *dev = &omap3touchbook_nand_device.dev;
> +	int err = 0;
> +
>  	/* find out the chip-select on which NAND exists */
>  	while (cs < GPMC_CS_NUM) {
>  		u32 ret = 0;
> @@ -477,6 +480,12 @@ static void __init omap3touchbook_flash_init(void)
>  
>  	if (nandcs < GPMC_CS_NUM) {
>  		omap3touchbook_nand_data.cs = nandcs;
> +		err = gpmc_cs_request(omap3touchbook_nand_data.cs,
> +					NAND_IO_SIZE, &omap3touchbook_nand_data.phys_base);
> +		if (err < 0) {
> +			dev_err(dev, "Cannot request GPMC CS\n");
> +			return;
> +		}
>  
>  		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
>  		if (platform_device_register(&omap3touchbook_nand_device) < 0)
> diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
> index d843a0a..d6658b5
> --- a/arch/arm/mach-omap2/board-overo.c
> +++ b/arch/arm/mach-omap2/board-overo.c
> @@ -236,6 +236,8 @@ static void __init overo_flash_init(void)
>  {
>  	u8 cs = 0;
>  	u8 nandcs = GPMC_CS_NUM + 1;
> +	struct device *dev = &overo_nand_device.dev;
> +	int err = 0;
>  
>  	/* find out the chip-select on which NAND exists */
>  	while (cs < GPMC_CS_NUM) {
> @@ -258,6 +260,12 @@ static void __init overo_flash_init(void)
>  
>  	if (nandcs < GPMC_CS_NUM) {
>  		overo_nand_data.cs = nandcs;
> +		err = gpmc_cs_request(overo_nand_data.cs,
> +						NAND_IO_SIZE, &overo_nand_data.phys_base);
> +		if (err < 0) {
> +			dev_err(dev, "Cannot request GPMC CS\n");
> +			return;
> +		}
>  
>  		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
>  		if (platform_device_register(&overo_nand_device) < 0)


-- 
Sincerely yours,
Mike.

       reply	other threads:[~2010-05-12  8:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[Sukumar Ghorai <s-ghorai@ti.com>
     [not found] ` <1273652243-6303-1-git-send-email-s-ghorai@ti.com>
     [not found]   ` <1273652243-6303-2-git-send-email-s-ghorai@ti.com>
     [not found]     ` <1273652243-6303-3-git-send-email-s-ghorai@ti.com>
     [not found]       ` <1273652243-6303-4-git-send-email-s-ghorai@ti.com>
2010-05-12  8:30         ` Mike Rapoport [this message]
     [not found] <Sukumar Ghorai <s-ghorai@ti.com>
2010-05-12  9:48 ` [PATCH 0/3] omap3 nand: cleanup exiting platform related code Sukumar Ghorai
2010-05-12  9:48   ` [PATCH 1/3] omap3: GPMC register definition at common location Sukumar Ghorai
2010-05-12  9:48     ` [PATCH 2/3] omap3 nand: cleanup for not to use GPMC virtual address Sukumar Ghorai
2010-05-12  9:48       ` [PATCH 3/3] omap3 nand: fix issue in board file to detect the nand Sukumar Ghorai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BEA6719.1050400@compulab.co.il \
    --to=mike@compulab.co.il \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=s-ghorai@ti.com \
    --cc=sakoman@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).