From: Tony Lindgren <tony@atomide.com>
To: Sutharsan Ramamoorthy <sutharsan.ramamoorthy@yahoo.com>
Cc: greg@kroah.com, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org, linux-usb@vger.kernel.org,
david.cross@cypress.com, srmt@cypress.com
Subject: Re: [PATCH] adding gpmc configuration functions, west bridge related
Date: Fri, 14 Jan 2011 12:01:55 -0800 [thread overview]
Message-ID: <20110114200155.GN4957@atomide.com> (raw)
In-Reply-To: <524702.86777.qm@web121609.mail.ne1.yahoo.com>
* Sutharsan Ramamoorthy <sutharsan.ramamoorthy@yahoo.com> [110113 15:22]:
> --- linux-2.6.37_vanilla/arch/arm/mach-omap2/usb-cywb-pnand.c 1969-12-31 16:00:00.000000000 -0800
> +++ linux-2.6.37-gpmc/arch/arm/mach-omap2/usb-cywb-pnand.c 2011-01-12 12:37:23.154716913 -0800
...
> +/*
> + * switch GPMC DATA bus mode
> + */
> +void cywb_gpmc_enable_16bit_bus(bool dbus16_enabled)
> +{
> + u32 tmp32;
> +
> + /*
> + * disable gpmc CS4 operation 1st
> + */
> + tmp32 = gpmc_cs_read_reg(AST_GPMC_CS,
> + GPMC_CS_CONFIG7) & ~GPMC_CONFIG7_CSVALID;
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, tmp32);
> +
> + /*
> + * GPMC NAND data bus can be 8 or 16 bit wide
> + */
> + if (dbus16_enabled) {
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1,
> + (GPMC_CONFIG1_DEVICETYPE(2) |
> + GPMC_CONFIG1_WAIT_PIN_SEL(2) |
> + GPMC_CONFIG1_DEVICESIZE_16));
> + } else {
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1,
> + (GPMC_CONFIG1_DEVICETYPE(2) |
> + GPMC_CONFIG1_WAIT_PIN_SEL(2)));
> + }
> +
> + /*
> + * re-enable astoria CS operation on GPMC
> + */
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7,
> + (tmp32 | GPMC_CONFIG7_CSVALID));
> +}
This should be static, right?
> +int cywb_pnand_platform_retime()
> +{
> + u32 tmp32;
> + struct gpmc_timings timings;
> + int retval = 0;
> +
> +
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1,
> + (GPMC_CONFIG1_DEVICETYPE(2) |
> + GPMC_CONFIG1_WAIT_PIN_SEL(2)));
> +
> + memset(&timings, 0, sizeof(timings));
> +
> + /* cs timing */
> + timings.cs_on = WB_GPMC_CS_T_O_N;
> + timings.cs_wr_off = WB_GPMC_BUSCYC_T;
> + timings.cs_rd_off = WB_GPMC_BUSCYC_T;
> +
> + /* adv timing */
> + timings.adv_on = WB_GPMC_ADV_T_O_N;
> + timings.adv_rd_off = WB_GPMC_BUSCYC_T;
> + timings.adv_wr_off = WB_GPMC_BUSCYC_T;
> +
> + /* oe timing */
> + timings.oe_on = WB_GPMC_OE_T_O_N;
> + timings.oe_off = WB_GPMC_OE_T_O_F_F;
> + timings.access = WB_GPMC_RD_T_A_C_C;
> + timings.rd_cycle = WB_GPMC_BUSCYC_T;
> +
> + /* we timing */
> + timings.we_on = WB_GPMC_WE_T_O_N;
> + timings.we_off = WB_GPMC_WE_T_O_F_F;
> + timings.wr_access = WB_GPMC_WR_T_A_C_C;
> + timings.wr_cycle = WB_GPMC_BUSCYC_T;
> +
> + timings.page_burst_access = WB_GPMC_BUSCYC_T;
> + timings.wr_data_mux_bus = WB_GPMC_BUSCYC_T;
> + gpmc_cs_set_timings(AST_GPMC_CS, &timings);
> +
> + /*
> + * DISABLE cs4, NOTE GPMC REG7 is already configured
> + * at this point by gpmc_cs_request
> + */
> + tmp32 = gpmc_cs_read_reg(AST_GPMC_CS, GPMC_CS_CONFIG7) &
> + ~GPMC_CONFIG7_CSVALID;
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, tmp32);
> +
> + /*
> + * PROGRAM chip select Region, (see OMAP3430 TRM PAGE 1088)
> + */
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7,
> + (AS_CS_MASK | AS_CS_BADDR));
> +
> + /*
> + * by default configure GPMC into 8 bit mode
> + * (to match astoria default mode)
> + */
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1,
> + (GPMC_CONFIG1_DEVICETYPE(2) |
> + GPMC_CONFIG1_WAIT_PIN_SEL(2)));
> +
> + /*
> + * ENABLE astoria cs operation on GPMC
> + */
> + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7,
> + (tmp32 | GPMC_CONFIG7_CSVALID));
> +
> + return retval;
> +
> +}
> +
> +static struct cywb_platform_data cywb_plat = {
> + .retime = cywb_pnand_platform_retime,
> + .config_bus_width = cywb_gpmc_enable_16bit_bus,
> +};
> +
> +static struct platform_device cywb_device = {
> + .name = "west_bridge_dev",
> + .id = -1,
> + .dev = {
> + .platform_data = &cywb_plat,
> + }
> +};
> +
> +#ifdef CONFIG_WESTBRIDGE_ASTORIA
> +void __init usb_cywb_init()
> +{
> + if (platform_device_register(&cywb_device) < 0)
> + dev_err(&cywb_device.dev, "Unable to register cywb-astoria device\n");
> +}
> +#else
> +void __init usb_cywb_init()
> +{
> +}
> +#endif /* CONFIG_WESTBRIDGE_ASTORIA */
Can you also move gpmc_cs_request to this file too?
Regards,
Tony
next prev parent reply other threads:[~2011-01-14 20:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 23:23 [PATCH] adding gpmc configuration functions, west bridge related Sutharsan Ramamoorthy
2011-01-13 23:44 ` Greg KH
2011-01-14 20:01 ` Tony Lindgren [this message]
[not found] <AANLkTim-1+CwW50mPwi6DnQDF680fxjJms7JrEPqsqkv@mail.gmail.com>
2011-01-12 21:36 ` Greg KH
2011-01-12 21:37 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2010-12-21 2:42 Sutharsan R
2010-12-21 4:11 ` Greg KH
2010-12-21 20:46 ` Tony Lindgren
2010-12-17 0:33 Sutharsan
2010-12-17 0:41 ` Greg KH
2010-12-15 19:57 Sutharsan
2010-12-15 20:10 ` Greg KH
2010-12-15 22:11 ` Sutharsan
2010-12-15 22:18 ` Greg KH
2010-12-15 23:03 ` Sutharsan
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=20110114200155.GN4957@atomide.com \
--to=tony@atomide.com \
--cc=david.cross@cypress.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=srmt@cypress.com \
--cc=sutharsan.ramamoorthy@yahoo.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