From: jon-hunter@ti•com (Jon Hunter)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v6 05/10] ARM: OMAP2+: gpmc: find features by ip rev check
Date: Tue, 21 Aug 2012 21:08:39 -0500 [thread overview]
Message-ID: <50343F27.4060101@ti.com> (raw)
In-Reply-To: <0b211272d0d6f9281df7db400cb2d6a968b31222.1345524670.git.afzal@ti.com>
On 08/21/2012 05:45 AM, Afzal Mohammed wrote:
> Newer IP's have wr_access and wr_data_mux_bus fields. Use
> IP revision values to determine availability of these
> fields and hence decide on whether to configure them.
>
> Signed-off-by: Afzal Mohammed <afzal@ti•com>
> ---
> arch/arm/mach-omap2/gpmc.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index 070fac5..68123d0 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -85,6 +85,11 @@
> #define ENABLE_PREFETCH (0x1 << 7)
> #define DMA_MPU_MODE 2
>
> +#define GPMC_REVISION_MAJOR(l) ((l >> 4) & 0xf)
> +
> +#define GPMC_HAS_WR_ACCESS 0x1
> +#define GPMC_HAS_WR_DATA_MUX_BUS 0x2
> +
> /* XXX: Only NAND irq has been considered,currently these are the only ones used
> */
> #define GPMC_NR_IRQ 2
> @@ -131,6 +136,7 @@ static DEFINE_SPINLOCK(gpmc_mem_lock);
> static unsigned int gpmc_cs_map; /* flag for cs which are initialized */
> static int gpmc_ecc_used = -EINVAL; /* cs using ecc engine */
>
> +static unsigned gpmc_capability;
> static void __iomem *gpmc_base;
>
> static struct clk *gpmc_l3_clk;
> @@ -356,10 +362,10 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
> GPMC_SET_ONE(GPMC_CS_CONFIG1, 18, 19, wait_monitoring);
> GPMC_SET_ONE(GPMC_CS_CONFIG1, 25, 26, clk_activation);
>
> - if (cpu_is_omap34xx()) {
> + if (gpmc_capability & GPMC_HAS_WR_DATA_MUX_BUS)
> GPMC_SET_ONE(GPMC_CS_CONFIG6, 16, 19, wr_data_mux_bus);
> + if (gpmc_capability & GPMC_HAS_WR_ACCESS)
> GPMC_SET_ONE(GPMC_CS_CONFIG6, 24, 28, wr_access);
> - }
>
> /* caller is expected to have initialized CONFIG1 to cover
> * at least sync vs async
> @@ -922,6 +928,8 @@ static int __init gpmc_init(void)
> clk_enable(gpmc_l3_clk);
>
> l = gpmc_read_reg(GPMC_REVISION);
> + if (GPMC_REVISION_MAJOR(l) > 0x4)
> + gpmc_capability = GPMC_HAS_WR_ACCESS | GPMC_HAS_WR_DATA_MUX_BUS;
> printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
> /* Set smart idle mode and automatic L3 clock gating */
> l = gpmc_read_reg(GPMC_SYSCONFIG);
>
Reviewed-by: Jon Hunter <jon-hunter@ti•com>
Thanks!
Jon
next prev parent reply other threads:[~2012-08-22 2:08 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 10:41 [PATCH v6 00/10] OMAP-GPMC: generic time calc, prepare for driver Afzal Mohammed
2012-08-21 10:45 ` [PATCH v6 01/10] ARM: OMAP2+: nand: unify init functions Afzal Mohammed
2012-08-21 11:37 ` Igor Grinberg
2012-08-21 10:45 ` [PATCH v6 02/10] ARM: OMAP2+: gpmc: handle additional timings Afzal Mohammed
2012-08-21 10:45 ` [PATCH v6 03/10] ARM: OMAP2+: onenand: refactor for clarity Afzal Mohammed
2012-08-21 10:45 ` [PATCH v6 04/10] ARM: OMAP2+: GPMC: Remove unused OneNAND get_freq() platform function Afzal Mohammed
2012-08-21 10:45 ` [PATCH v6 05/10] ARM: OMAP2+: gpmc: find features by ip rev check Afzal Mohammed
2012-08-22 2:08 ` Jon Hunter [this message]
2012-08-21 10:45 ` [PATCH v6 06/10] ARM: OMAP2+: gpmc: remove cs# in sync clk div calc Afzal Mohammed
2012-08-22 2:11 ` Jon Hunter
2012-08-21 10:45 ` [PATCH v6 07/10] ARM: OMAP2+: gpmc: generic timing calculation Afzal Mohammed
2012-08-23 2:58 ` Jon Hunter
2012-08-24 19:54 ` Tony Lindgren
2012-08-27 11:46 ` Mohammed, Afzal
2012-08-27 10:37 ` Mohammed, Afzal
2012-08-27 20:30 ` Jon Hunter
2012-08-28 12:21 ` Mohammed, Afzal
2012-08-21 10:45 ` [PATCH v6 08/10] ARM: OMAP2+: onenand: " Afzal Mohammed
2012-08-21 10:46 ` [PATCH v6 09/10] ARM: OMAP2+: smc91x: " Afzal Mohammed
2012-08-21 10:46 ` [PATCH v6 10/10] ARM: OMAP2+: tusb6010: " Afzal Mohammed
2012-08-24 19:46 ` Tony Lindgren
2012-08-27 8:34 ` Mohammed, Afzal
2012-09-03 5:34 ` Mohammed, Afzal
2012-09-06 7:39 ` Mohammed, Afzal
2012-09-06 20:43 ` Tony Lindgren
2012-09-11 18:46 ` Tony Lindgren
2012-09-12 9:50 ` Mohammed, Afzal
2012-09-14 10:20 ` Mohammed, Afzal
2012-09-17 8:39 ` Mohammed, Afzal
2012-09-17 22:50 ` Tony Lindgren
2012-09-17 23:10 ` Tony Lindgren
2012-09-19 13:43 ` Mohammed, Afzal
2012-09-07 0:15 ` Paul Walmsley
2012-08-27 12:16 ` [PATCH v6 00/10] OMAP-GPMC: generic time calc, prepare for driver Daniel Mack
2012-08-27 12:38 ` Mohammed, Afzal
2012-08-27 13:30 ` Daniel Mack
2012-08-27 14:01 ` Mohammed, Afzal
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=50343F27.4060101@ti.com \
--to=jon-hunter@ti$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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