From: eric@eukrea.com (Eric Bénard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] i.MX35: use the correct IIM register to get CPU revision
Date: Fri, 08 Oct 2010 15:00:47 +0200 [thread overview]
Message-ID: <4CAF15FF.6040404@eukrea.com> (raw)
In-Reply-To: <20101008123102.GH29673@pengutronix.de>
Hi Uwe,
Le 08/10/2010 14:31, Uwe Kleine-K?nig a ?crit :
>> diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
>> index 85884c7..f7cec59 100644
>> --- a/arch/arm/mach-mx3/clock-imx35.c
>> +++ b/arch/arm/mach-mx3/clock-imx35.c
>> @@ -535,6 +535,7 @@ int __init mx35_clocks_init()
>> __raw_writel(cgr2, CCM_BASE + CCM_CGR2);
>> __raw_writel(cgr3, CCM_BASE + CCM_CGR3);
>>
>> + clk_enable(&iim_clk);
>> mx35_read_cpu_rev();
>
> Do you let the clock running on purpose?
>
same as on i.MX31 : the iim clock is kept on.
>> mxc_timer_init(&gpt_clk,
>> diff --git a/arch/arm/mach-mx3/cpu.c b/arch/arm/mach-mx3/cpu.c
>> index db7af50..d00a754 100644
>> --- a/arch/arm/mach-mx3/cpu.c
>> +++ b/arch/arm/mach-mx3/cpu.c
>> @@ -59,31 +59,26 @@ void __init mx31_read_cpu_rev(void)
>> unsigned int mx35_cpu_rev;
>> EXPORT_SYMBOL(mx35_cpu_rev);
>>
>> -#define MX35_ROM_SI_REV 0x40
>> -
>> void __init mx35_read_cpu_rev(void)
>> {
>> - void __iomem *rom = ioremap(MX35_IROM_BASE_ADDR, MX35_IROM_SIZE);
>> u32 rev;
>> char *srev = "unknown";
>>
>> - if (!rom)
>> - return;
>> -
>> - rev = readl(rom + MX35_ROM_SI_REV);
>> + rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
>> switch (rev) {
>> - case 0x1:
>> - mx35_cpu_rev = MX35_CHIP_REV_1_0;
>> + case 0x00:
>> + mx35_cpu_rev = MX3x_CHIP_REV_1_0;
>> srev = "1.0";
>> break;
>> - case 0x2:
>> - mx35_cpu_rev = MX35_CHIP_REV_2_0;
>> + case 0x10:
>> + mx35_cpu_rev = MX3x_CHIP_REV_2_0;
>> srev = "2.0";
>> break;
>> + case 0x11:
>> + mx35_cpu_rev = MX3x_CHIP_REV_2_1;
>> + srev = "2.1";
>> + break;
> Would it make sense here to do:
>
> mx35_cpu_rev = 0x10 + rev;
>
> ?
>
we don't know how future chip will be numbered !
Eric
next prev parent reply other threads:[~2010-10-08 13:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 9:14 [PATCH] i.MX35: Add mx35_revision function to query the silicon revision Sascha Hauer
2010-10-07 18:21 ` Uwe Kleine-König
2010-10-08 6:45 ` Sascha Hauer
2010-10-08 7:34 ` [PATCH 0/3] sdma/dma resources Uwe Kleine-König
2010-10-08 7:34 ` [PATCH 1/3] ARM: mx3: use MX3x_ prefixed version of CHIP_REV_x Uwe Kleine-König
2010-10-08 7:34 ` [PATCH 2/3] ARM: mx35: Add mx35_revision function to query the silicon revision Uwe Kleine-König
2010-10-08 8:02 ` [PATCH] i.MX35: use the correct IIM register to get CPU revision Eric Bénard
2010-10-08 8:11 ` Eric Bénard
2010-10-08 8:18 ` [PATCH v2] " Eric Bénard
2010-10-08 12:26 ` Fabio Estevam
2010-10-08 12:31 ` Uwe Kleine-König
2010-10-08 12:34 ` Sascha Hauer
2010-10-08 13:00 ` Eric Bénard [this message]
2010-10-08 13:07 ` Uwe Kleine-König
2010-10-08 13:57 ` Uwe Kleine-König
2010-10-08 14:00 ` [PATCH v2 1/3] ARM: mx3: use MX3x_ prefixed version of CHIP_REV_x Uwe Kleine-König
2010-10-08 14:00 ` [PATCH v2 2/3] ARM: mx35: Add mx35_revision function to query the silicon revision Uwe Kleine-König
2010-10-08 14:00 ` [PATCH v2 3/3] ARM: imx: fix/define clocks and create devices for imx dma Uwe Kleine-König
2010-10-08 7:34 ` [PATCH " Uwe Kleine-König
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=4CAF15FF.6040404@eukrea.com \
--to=eric@eukrea.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).