public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Komal Shah <komal_shah802003@yahoo.com>
Cc: linux-omap-open-source@linux.omap.com
Subject: GPMC timings for smc91x on 24xx (WAS: Pending July patches)
Date: Thu, 3 Aug 2006 16:03:37 +0300	[thread overview]
Message-ID: <20060803130336.GA18147@atomide.com> (raw)
In-Reply-To: <20060803120858.53676.qmail@web37909.mail.mud.yahoo.com>

* Komal Shah <komal_shah802003@yahoo.com> [060803 15:09]:
> --- Tony Lindgren <tony@atomide.com> wrote:
> 
> > 
> > Cool, thanks. I'll start digging through these patches, and then
> > tag 2.6.17-omap2 before we pull from Linus' tree.
> > 
> 
> Also, my patches on using gpmc_* apis for board_h4.c was not on the
> list of upstream patches for 2.6.18 window. So, please consider them
> for 2.6.19 :)

In general we want to have everything in sync with the mainline, and be
able to use the mainline tree for omap boards.

The reason I did not send h4 smc91x gpmc yet is that we should update it
to use gpmc_cs_set_timings() to have a nice example available for others :)

Could you try something like the sample code below for h4? You most likely
need to modify the values, but this is how Juha intended the gpmc being used.

static int __init smc91x_set_async_mode(int cs)
{
	struct gpmc_timings t;
	u32 reg;

	memset(&t, 0, sizeof(t));
	t.sync_clk = 0;
	t.cs_on = 0;
	t.adv_on = gpmc_round_ns_to_ticks(1);

	/* Read */
	t.adv_rd_off = t.adv_on + gpmc_round_ns_to_ticks(7);
	t.oe_on = t.adv_rd_off + gpmc_round_ns_to_ticks(1);
	t.access = t.oe_on + gpmc_round_ns_to_ticks(1);
	t.oe_off = t.access + gpmc_round_ns_to_ticks(1);
	t.cs_rd_off = t.oe_off;
	t.rd_cycle = t.cs_rd_off + gpmc_round_ns_to_ticks(1);

	/* Write */
	t.adv_wr_off = t.adv_on + gpmc_round_ns_to_ticks(7);
	t.we_on = t.adv_wr_off + gpmc_round_ns_to_ticks(1);
	t.we_off = t.we_on + gpmc_round_ns_to_ticks(1);
	t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(1);
	t.wr_cycle = t.cs_wr_off + gpmc_round_ns_to_ticks(1);

	reg =	GPMC_CONFIG1_PAGE_LEN(2) |
		GPMC_CONFIG1_WAIT_READ_MON |
		GPMC_CONFIG1_WAIT_WRITE_MON |
		GPMC_CONFIG1_WAIT_PIN_SEL(2) |
		GPMC_CONFIG1_READTYPE_ASYNC |
		GPMC_CONFIG1_WRITETYPE_ASYNC |
		GPMC_CONFIG1_DEVICESIZE_16 |
		GPMC_CONFIG1_DEVICETYPE_NOR |
		GPMC_CONFIG1_MUXADDDATA;

	gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, reg);

	return gpmc_cs_set_timings(cs, &t);
}

Then just do something like:

ret = smc91x_set_async_mode(SMC91X_CS);
if (ret != 0) {
	printk(KERN_ERR "dklfjdkfjdkfj\n");
	return ret;
}

Also, do you have a patch to improve the 2422 vs 2423 detection? It
would be nice to get rid of this in board-h4.c:

/* FIXME: This function should be moved to some other file, gpmc.c? */

/* H4-2420's always used muxed mode, H4-2422's always use non-muxed
 *
 * Note: OMAP-GIT doesn't correctly do is_cpu_omap2422 and
 * is_cpu_omap2423
 *  correctly.  The macro needs to look at production_id not just
 *  hawkeye.
 */
static u32 is_gpmc_muxed(void)
{
	u32 mux;
	mux = get_sysboot_value();
	if ((mux & 0xF) == 0xd)
		return 1;	/* NAND config (could be either) */
	if (mux & 0x2)		/* if mux'ed */
		return 1;
	else
		return 0;
}

Regards,

Tony

  reply	other threads:[~2006-08-03 13:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-01 16:44 Pending July patches Dirk Behme
2006-08-03 11:17 ` Tony Lindgren
2006-08-03 12:08   ` Komal Shah
2006-08-03 13:03     ` Tony Lindgren [this message]
2006-08-03 13:39       ` Need help to understand a #pragma statment Taru Varshney
2006-08-04 11:05     ` Pending July patches Tony Lindgren
2006-08-04 13:20       ` [PATCH] ARM: OMAP: Fix lcd_ams_delta to use new PWL defines Jonathan McDowell
2006-08-07 15:22         ` Tony Lindgren
2006-08-08  8:33           ` mcbsp Arnold
2006-08-08 21:33           ` 2.6.18-rc4 / generic irq etc Jonathan McDowell
2006-08-09  7:26             ` Tony Lindgren
2006-08-04 14:40       ` Pending July patches lamikr
2006-08-07 15:23         ` Tony Lindgren
2006-08-07 23:56           ` lamikr
2006-08-08  1:30             ` andrzej zaborowski
2006-08-10  4:41               ` andrzej zaborowski
2006-08-10  7:32                 ` Tony Lindgren
2006-08-10  8:07                   ` andrzej zaborowski
2006-08-10 10:45                     ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2006-08-03 14:20 GPMC timings for smc91x on 24xx (WAS: Pending July patches) Woodruff, Richard
2006-08-03 15:00 ` Tony Lindgren
2006-08-03 16:00 ` Juha Yrjölä
2006-08-03 15:57 Woodruff, Richard
2006-08-03 16:22 ` Dirk Behme
2006-08-03 18:55 ` tony
2006-08-13 14:42 ` Dirk Behme
2006-08-03 16:23 Woodruff, Richard
2006-08-03 22:37 Woodruff, Richard
2006-08-13 15:49 Woodruff, Richard

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=20060803130336.GA18147@atomide.com \
    --to=tony@atomide.com \
    --cc=komal_shah802003@yahoo.com \
    --cc=linux-omap-open-source@linux.omap.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