All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <mike@compulab.co.il>
To: Tony Lindgren <tony@atomide.com>
Cc: "Ghorai, Sukumar" <s-ghorai@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Mike Rapoport <mike@compulab.co.il>
Subject: Re: [PATCH] OMAP: fix gpmc nand setup when no timings supplied
Date: Tue, 27 Apr 2010 10:43:56 +0300	[thread overview]
Message-ID: <4BD695BC.3080109@compulab.co.il> (raw)
In-Reply-To: <20100426181448.GG7225@atomide.com>

Tony Lindgren wrote:
> * Mike Rapoport <mike@compulab.co.il> [100422 01:41]:
>> Ghorai, Sukumar wrote:
>>
>> CM-T35, for instance can be assembled with different NAND flash
>> chips. Besides, boards that use NAND as primary boot device, we
>> anyway depend on proper GPMC configuration in the bootloader chain.
>> Having ability to define GPMC timings in the kernel and keep the
>> settings made by the bootloader adds flexibility level for board
>> designers.
> 
> Not implementing the retime function for GPMC will cause issues
> with PM as you cannot scale the L3 frequency without breaking
> your GPMC timings.

I agree that without retime function scaling the frequency will break 
the GPMC timings. But my point was that there should be an _option_ to 
keep the timings defined by the bootloader rather than enforce board 
files to specify timings.
Since skipping the retime function will break gpmc timings in PM-enabled 
  kernel, we need to implement this option in smarter way. E.g. 
something like:

diff --git a/arch/arm/mach-omap2/gpmc-nand.c 
b/arch/arm/mach-omap2/gpmc-nand.c
index 64d74f0..65ac0d0 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -34,6 +34,12 @@ static struct platform_device gpmc_nand_device = {
  	.resource	= &gpmc_nand_resource,
  };

+static int gpmc_nand_detect_timings(void)
+{
+	/* FIXME: implement timings detection */
+	return -EINVAL;
+}
+
  static int omap2_nand_gpmc_retime(void)
  {
  	struct gpmc_timings t;
@@ -109,6 +115,14 @@ int __init gpmc_nand_init(struct 
omap_nand_platform_data *_nand_data)
  		return err;
  	}

+	if (gpmc_nand_data->keep_timings) {
+		err = gpmc_nand_detect_timings();
+		if (err < 0) {
+			dev_err(dev, "Cannot detect GPMC timings\n");
+			return err;
+		}
+	}
+
  	err = gpmc_nand_setup();
  	if (err < 0) {
  		dev_err(dev, "NAND platform setup failed: %d\n", err);
diff --git a/arch/arm/plat-omap/include/plat/nand.h 
b/arch/arm/plat-omap/include/plat/nand.h
index 6ba88d2..cf05d2d 100644
--- a/arch/arm/plat-omap/include/plat/nand.h
+++ b/arch/arm/plat-omap/include/plat/nand.h
@@ -24,6 +24,7 @@ struct omap_nand_platform_data {
  	void __iomem		*gpmc_cs_baseaddr;
  	void __iomem		*gpmc_baseaddr;
  	int			devsize;
+	bool			keep_timings;
  };

  /* size (4 KiB) for IO mapping */



> Tony


-- 
Sincerely yours,
Mike.

  parent reply	other threads:[~2010-04-27  7:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19  9:50 [PATCH] OMAP: fix gpmc nand setup when no timings supplied Mike Rapoport
2010-04-22  5:19 ` Mike Rapoport
2010-04-22  6:41   ` Ghorai, Sukumar
2010-04-22  6:59     ` Mike Rapoport
2010-04-22  7:59       ` Ghorai, Sukumar
2010-04-22  8:45         ` Mike Rapoport
2010-04-26 18:14           ` Tony Lindgren
2010-04-27  5:07             ` Vimal Singh
2010-04-27  7:43             ` Mike Rapoport [this message]
2010-04-27 14:47               ` Tony Lindgren
2010-04-28 15:05                 ` Bug in omap2_nand_gpmc_retime? (was: Re: [PATCH] OMAP: fix gpmc nand setup when no timings supplied) Mike Rapoport
2010-04-28 15:26                   ` Vimal Singh
2010-04-28 15:40                     ` Bug in omap2_nand_gpmc_retime? Mike Rapoport

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=4BD695BC.3080109@compulab.co.il \
    --to=mike@compulab.co.il \
    --cc=linux-omap@vger.kernel.org \
    --cc=s-ghorai@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.