Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272831
b: refs/heads/master
c: c52c983
h: refs/heads/master
i:
  272829: c6bf9c9
  272827: e927e12
  272823: 9cb7ef6
  272815: 40a9c9a
  272799: f935582
  272767: e423c38
v: v3
  • Loading branch information
Jason Liu authored and Sascha Hauer committed Aug 26, 2011
1 parent 4045b01 commit b24d8c6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d75a2620dc3e33ce504044c375c443ed7ed4128
refs/heads/master: c52c983551ba3fb991f91eff4d924a375b0f9b83
6 changes: 2 additions & 4 deletions trunk/arch/arm/mach-mx5/clock-mx51-mx53.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,9 +1548,8 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
clk_enable(&main_bus_clk);

clk_enable(&iim_clk);
mx51_revision();
imx_print_silicon_rev("i.MX51", mx51_revision());
clk_disable(&iim_clk);
mx51_display_revision();

/* move usb_phy_clk to 24MHz */
clk_set_parent(&usb_phy1_clk, &osc_clk);
Expand Down Expand Up @@ -1592,9 +1591,8 @@ int __init mx53_clocks_init(unsigned long ckil, unsigned long osc,
clk_enable(&main_bus_clk);

clk_enable(&iim_clk);
mx53_revision();
imx_print_silicon_rev("i.MX53", mx53_revision());
clk_disable(&iim_clk);
mx53_display_revision();

/* Set SDHC parents to be PLL2 */
clk_set_parent(&esdhc1_clk, &pll2_sw_clk);
Expand Down
74 changes: 17 additions & 57 deletions trunk/arch/arm/mach-mx5/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <mach/hardware.h>
#include <asm/io.h>

static int cpu_silicon_rev = -1;
static int mx5_cpu_rev = -1;

#define IIM_SREV 0x24
#define MX50_HW_ADADIG_DIGPROG 0xB0
Expand All @@ -28,11 +28,14 @@ static int get_mx51_srev(void)
void __iomem *iim_base = MX51_IO_ADDRESS(MX51_IIM_BASE_ADDR);
u32 rev = readl(iim_base + IIM_SREV) & 0xff;

if (rev == 0x0)
switch (rev) {
case 0x0:
return IMX_CHIP_REVISION_2_0;
else if (rev == 0x10)
case 0x10:
return IMX_CHIP_REVISION_3_0;
return 0;
default:
return IMX_CHIP_REVISION_UNKNOWN;
}
}

/*
Expand All @@ -45,33 +48,13 @@ int mx51_revision(void)
if (!cpu_is_mx51())
return -EINVAL;

if (cpu_silicon_rev == -1)
cpu_silicon_rev = get_mx51_srev();
if (mx5_cpu_rev == -1)
mx5_cpu_rev = get_mx51_srev();

return cpu_silicon_rev;
return mx5_cpu_rev;
}
EXPORT_SYMBOL(mx51_revision);

void mx51_display_revision(void)
{
int rev;
char *srev;
rev = mx51_revision();

switch (rev) {
case IMX_CHIP_REVISION_2_0:
srev = IMX_CHIP_REVISION_2_0_STRING;
break;
case IMX_CHIP_REVISION_3_0:
srev = IMX_CHIP_REVISION_3_0_STRING;
break;
default:
srev = IMX_CHIP_REVISION_UNKNOWN_STRING;
}
printk(KERN_INFO "CPU identified as i.MX51, silicon rev %s\n", srev);
}
EXPORT_SYMBOL(mx51_display_revision);

#ifdef CONFIG_NEON

/*
Expand Down Expand Up @@ -121,10 +104,10 @@ int mx53_revision(void)
if (!cpu_is_mx53())
return -EINVAL;

if (cpu_silicon_rev == -1)
cpu_silicon_rev = get_mx53_srev();
if (mx5_cpu_rev == -1)
mx5_cpu_rev = get_mx53_srev();

return cpu_silicon_rev;
return mx5_cpu_rev;
}
EXPORT_SYMBOL(mx53_revision);

Expand All @@ -134,7 +117,7 @@ static int get_mx50_srev(void)
u32 rev;

if (!anatop) {
cpu_silicon_rev = -EINVAL;
mx5_cpu_rev = -EINVAL;
return 0;
}

Expand All @@ -159,36 +142,13 @@ int mx50_revision(void)
if (!cpu_is_mx50())
return -EINVAL;

if (cpu_silicon_rev == -1)
cpu_silicon_rev = get_mx50_srev();
if (mx5_cpu_rev == -1)
mx5_cpu_rev = get_mx50_srev();

return cpu_silicon_rev;
return mx5_cpu_rev;
}
EXPORT_SYMBOL(mx50_revision);

void mx53_display_revision(void)
{
int rev;
char *srev;
rev = mx53_revision();

switch (rev) {
case IMX_CHIP_REVISION_1_0:
srev = IMX_CHIP_REVISION_1_0_STRING;
break;
case IMX_CHIP_REVISION_2_0:
srev = IMX_CHIP_REVISION_2_0_STRING;
break;
case IMX_CHIP_REVISION_2_1:
srev = IMX_CHIP_REVISION_2_1_STRING;
break;
default:
srev = IMX_CHIP_REVISION_UNKNOWN_STRING;
}
printk(KERN_INFO "CPU identified as i.MX53, silicon rev %s\n", srev);
}
EXPORT_SYMBOL(mx53_display_revision);

static int __init post_cpu_init(void)
{
unsigned int reg;
Expand Down

0 comments on commit b24d8c6

Please sign in to comment.