From: Tony Lindgren <tony@atomide.com>
To: Vimal Singh <vimal.newwork@gmail.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards
Date: Wed, 18 Nov 2009 09:03:09 -0800 [thread overview]
Message-ID: <20091118170308.GK29266@atomide.com> (raw)
In-Reply-To: <ce9ab5790911180726q7eb27bc8g98c5f151d4e80362@mail.gmail.com>
* Vimal Singh <vimal.newwork@gmail.com> [091118 07:25]:
> On Fri, Nov 13, 2009 at 2:10 AM, Tony Lindgren <tony@atomide.com> wrote:
> > * Vimal Singh <vimal.newwork@gmail.com> [091110 02:08]:
> >> From 42f080e0915bbce1509fc8ab3773569fec0a44f1 Mon Sep 17 00:00:00 2001
> >> From: Vimal Singh <vimalsingh@ti.com>
> >> Date: Tue, 10 Nov 2009 11:39:39 +0530
> >> Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards
> >>
>
> [...]
>
> >> + if (!(__raw_readw(fpga_map_addr + REG_FPGA_REV)))
> >> + /* we dont have an DEBUG FPGA??? */
> >> + /* Depend on #defines!! default to strata boot return param */
> >> + return 0x0;
> >
> > Should iounmap before returning, or goto unmap.
>
> will correct it in next version.
>
> >
> >
> >> + /* S8-DIP-OFF = 1, S8-DIP-ON = 0 */
> >> + cs = __raw_readw(fpga_map_addr + REG_FPGA_DIP_SWITCH_INPUT2) & 0xf;
> >> +
> >> + /* ES2.0 SDP's onwards 4 dip switches are provided for CS */
> >> + if (omap_rev() >= OMAP3430_REV_ES1_0)
> >> + /* change (S8-1:4=DS-2:0) to (S8-4:1=DS-2:0) */
> >> + cs = ((cs & 8) >> 3) | ((cs & 4) >> 1) |
> >> + ((cs & 2) << 1) | ((cs & 1) << 3);
> >> + else
> >> + /* change (S8-1:3=DS-2:0) to (S8-3:1=DS-2:0) */
> >> + cs = ((cs & 4) >> 2) | (cs & 2) | ((cs & 1) << 2);
> >> +
> >> + iounmap(fpga_map_addr);
> >> + return cs;
> >> +}
> >> +
> >> +/**
> >> + * sdp3430_flash_init - Identify devices connected to GPMC and register.
> >> + *
> >> + * @return - void.
> >> + */
> >> +void __init sdp_flash_init(void)
> >> +{
> >> + u8 cs = 0;
> >> + u8 nandcs = GPMC_CS_NUM + 1;
> >> + u8 onenandcs = GPMC_CS_NUM + 1;
> >> + u8 idx;
> >> + unsigned char *config_sel = NULL;
> >> +
> >> + /* REVISIT: Is this return correct idx for 2430 SDP?
> >> + * for which cs configuration matches for 2430 SDP?
> >> + */
> >> + idx = get_gpmc0_type();
> >> + if (idx >= MAX_SUPPORTED_GPMC_CONFIG) {
> >> + printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs);
> >> + return;
> >> + }
> >> + config_sel = (unsigned char *)(chip_sel_sdp[idx]);
> >> +
> >> + /* Configure start address and size of NOR device */
> >> + if (omap_rev() >= OMAP3430_REV_ES1_0) {
> >> + sdp_nor_resource.start = FLASH_BASE_SDPV2;
> >> + sdp_nor_resource.end = FLASH_BASE_SDPV2
> >> + + FLASH_SIZE_SDPV2 - 1;
> >> + } else {
> >> + sdp_nor_resource.start = FLASH_BASE_SDPV1;
> >> + sdp_nor_resource.end = FLASH_BASE_SDPV1
> >> + + FLASH_SIZE_SDPV1 - 1;
> >> + }
> >
> > This should be done with gpmc_cs_request using the chip select and size.
> > Please see gpmc_smc91x_init() for an example.
>
> I do not think this should be done with 'gpmc_cs_request'. NOR flashes
> have been treated somehow differently.
Can you please specify what the issue using gpmc_cs_request is?
To me it seems that if you're not doing gpmc_cs_request, the gpmc can
be in uninitialized state. I don't think we want to build our kernel
assuming some hardcoded GPMC settings from the bootloader.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-11-18 17:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 10:08 [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards Vimal Singh
2009-11-12 20:40 ` Tony Lindgren
2009-11-18 15:26 ` Vimal Singh
2009-11-18 17:03 ` Tony Lindgren [this message]
2009-11-19 8:35 ` Vimal Singh
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=20091118170308.GK29266@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=vimal.newwork@gmail.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.