Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272832
b: refs/heads/master
c: ae4fa7f
h: refs/heads/master
v: v3
  • Loading branch information
Sascha Hauer committed Aug 24, 2011
1 parent b24d8c6 commit db8f674
Show file tree
Hide file tree
Showing 20 changed files with 160 additions and 202 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: c52c983551ba3fb991f91eff4d924a375b0f9b83
refs/heads/master: ae4fa7f66e542ef5c7662ceabfaaa33283eb4216
4 changes: 1 addition & 3 deletions trunk/arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ machine-$(CONFIG_ARCH_LPC32XX) := lpc32xx
machine-$(CONFIG_ARCH_MMP) := mmp
machine-$(CONFIG_ARCH_MSM) := msm
machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0
machine-$(CONFIG_ARCH_MX1) := imx
machine-$(CONFIG_ARCH_MX2) := imx
machine-$(CONFIG_ARCH_MX25) := imx
machine-$(CONFIG_ARCH_IMX_V4_V5) := imx
machine-$(CONFIG_ARCH_MX3) := imx
machine-$(CONFIG_ARCH_MX5) := mx5
machine-$(CONFIG_ARCH_MXS) := mxs
Expand Down
50 changes: 17 additions & 33 deletions trunk/arch/arm/mach-imx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ config IMX_HAVE_DMA_V1
# Some usages assume that having one of them implies not having (e.g.) ARCH_MX2.
# To easily distinguish good and reviewed from unreviewed usages new (and IMHO
# more sensible) names are used: SOC_IMX31 and SOC_IMX35
config ARCH_MX1
bool

config MACH_MX21
bool

config ARCH_MX25
bool

config MACH_MX27
bool

config ARCH_MX31
bool

Expand All @@ -13,13 +25,15 @@ config ARCH_MX35

config SOC_IMX1
bool
select ARCH_MX1
select CPU_ARM920T
select IMX_HAVE_DMA_V1
select IMX_HAVE_IOMUX_V1
select MXC_AVIC

config SOC_IMX21
bool
select MACH_MX21
select CPU_ARM926T
select ARCH_MXC_AUDMUX_V1
select IMX_HAVE_DMA_V1
Expand All @@ -28,13 +42,15 @@ config SOC_IMX21

config SOC_IMX25
bool
select ARCH_MX25
select CPU_ARM926T
select ARCH_MXC_AUDMUX_V2
select ARCH_MXC_IOMUX_V3
select MXC_AVIC

config SOC_IMX27
bool
select MACH_MX27
select CPU_ARM926T
select ARCH_MXC_AUDMUX_V1
select IMX_HAVE_DMA_V1
Expand All @@ -59,7 +75,7 @@ config SOC_IMX35
select MXC_AVIC


if ARCH_MX1
if ARCH_IMX_V4_V5

comment "MX1 platforms:"
config MACH_MXLADS
Expand Down Expand Up @@ -87,30 +103,6 @@ config MACH_APF9328
help
Say Yes here if you are using the Armadeus APF9328 development board

endif

if ARCH_MX2

choice
prompt "CPUs:"
default MACH_MX21

config MACH_MX21
bool "i.MX21 support"
help
This enables support for Freescale's MX2 based i.MX21 processor.

config MACH_MX27
bool "i.MX27 support"
help
This enables support for Freescale's MX2 based i.MX27 processor.

endchoice

endif

if MACH_MX21

comment "MX21 platforms:"

config MACH_MX21ADS
Expand All @@ -124,10 +116,6 @@ config MACH_MX21ADS
Include support for MX21ADS platform. This includes specific
configurations for the board and its peripherals.

endif

if ARCH_MX25

comment "MX25 platforms:"

config MACH_MX25_3DS
Expand Down Expand Up @@ -174,10 +162,6 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD

endchoice

endif

if MACH_MX27

comment "MX27 platforms:"

config MACH_MX27ADS
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-imx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ obj-$(CONFIG_IMX_HAVE_DMA_V1) += dma-v1.o
obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o
obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o

obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o ehci-imx25.o cpu-imx25.o
obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o ehci-imx25.o

obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o
obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o ehci-imx27.o
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/arm/mach-imx/clock-imx25.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ DEFINE_CLOCK(audmux_clk, 0, CCM_CGCR1, 0, NULL, NULL, NULL);
DEFINE_CLOCK(csi_clk, 0, CCM_CGCR1, 4, get_rate_csi, NULL, &csi_per_clk);
DEFINE_CLOCK(can1_clk, 0, CCM_CGCR1, 2, get_rate_ipg, NULL, NULL);
DEFINE_CLOCK(can2_clk, 1, CCM_CGCR1, 3, get_rate_ipg, NULL, NULL);
DEFINE_CLOCK(iim_clk, 0, CCM_CGCR1, 26, NULL, NULL, NULL);

#define _REGISTER_CLOCK(d, n, c) \
{ \
Expand Down Expand Up @@ -311,7 +310,6 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
/* i.mx25 has the i.mx35 type sdma */
_REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
_REGISTER_CLOCK(NULL, "iim", iim_clk)
};

int __init mx25_clocks_init(void)
Expand All @@ -336,10 +334,6 @@ int __init mx25_clocks_init(void)
/* Clock source for gpt is ahb_div */
__raw_writel(__raw_readl(CRM_BASE+0x64) & ~(1 << 5), CRM_BASE + 0x64);

clk_enable(&iim_clk);
imx_print_silicon_rev("i.MX25", mx25_revision());
clk_disable(&iim_clk);

mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54);

return 0;
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-imx/clock-imx27.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,6 @@ int __init mx27_clocks_init(unsigned long fref)
clk_enable(&gpio_clk);
clk_enable(&emi_clk);
clk_enable(&iim_clk);
imx_print_silicon_rev("i.MX27", mx27_revision());
clk_disable(&iim_clk);

#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
clk_enable(&uart1_clk);
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-imx/clock-imx31.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,11 @@ int __init mx31_clocks_init(unsigned long fref)
clk_enable(&gpt_clk);
clk_enable(&emi_clk);
clk_enable(&iim_clk);
mx31_revision();
clk_disable(&iim_clk);

clk_enable(&serial_pll_clk);

mx31_read_cpu_rev();

if (mx31_revision() >= IMX_CHIP_REVISION_2_0) {
reg = __raw_readl(MXC_CCM_PMCR1);
/* No PLL restart on DVFS switch; enable auto EMI handshake */
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-imx/clock-imx35.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,7 @@ int __init mx35_clocks_init()
__raw_writel(cgr3, CCM_BASE + CCM_CGR3);

clk_enable(&iim_clk);
imx_print_silicon_rev("i.MX35", mx35_revision());
clk_disable(&iim_clk);
mx35_read_cpu_rev();

#ifdef CONFIG_MXC_USE_EPIT
epit_timer_init(&epit1_clk,
Expand Down
41 changes: 0 additions & 41 deletions trunk/arch/arm/mach-imx/cpu-imx25.c

This file was deleted.

28 changes: 15 additions & 13 deletions trunk/arch/arm/mach-imx/cpu-imx27.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

#include <mach/hardware.h>

static int mx27_cpu_rev = -1;
static int mx27_cpu_partnumber;
static int cpu_silicon_rev = -1;
static int cpu_partnumber;

#define SYS_CHIP_ID 0x00 /* The offset of CHIP ID register */

static int mx27_read_cpu_rev(void)
static void query_silicon_parameter(void)
{
u32 val;
/*
Expand All @@ -42,18 +42,20 @@ static int mx27_read_cpu_rev(void)
val = __raw_readl(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR
+ SYS_CHIP_ID));

mx27_cpu_partnumber = (int)((val >> 12) & 0xFFFF);

switch (val >> 28) {
case 0:
return IMX_CHIP_REVISION_1_0;
cpu_silicon_rev = IMX_CHIP_REVISION_1_0;
break;
case 1:
return IMX_CHIP_REVISION_2_0;
cpu_silicon_rev = IMX_CHIP_REVISION_2_0;
break;
case 2:
return IMX_CHIP_REVISION_2_1;
cpu_silicon_rev = IMX_CHIP_REVISION_2_1;
break;
default:
return IMX_CHIP_REVISION_UNKNOWN;
cpu_silicon_rev = IMX_CHIP_REVISION_UNKNOWN;
}
cpu_partnumber = (int)((val >> 12) & 0xFFFF);
}

/*
Expand All @@ -63,12 +65,12 @@ static int mx27_read_cpu_rev(void)
*/
int mx27_revision(void)
{
if (mx27_cpu_rev == -1)
mx27_cpu_rev = mx27_read_cpu_rev();
if (cpu_silicon_rev == -1)
query_silicon_parameter();

if (mx27_cpu_partnumber != 0x8821)
if (cpu_partnumber != 0x8821)
return -EINVAL;

return mx27_cpu_rev;
return cpu_silicon_rev;
}
EXPORT_SYMBOL(mx27_revision);
49 changes: 22 additions & 27 deletions trunk/arch/arm/mach-imx/cpu-imx31.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,45 @@
#include <linux/io.h>
#include <mach/hardware.h>
#include <mach/iim.h>
#include <mach/common.h>

static int mx31_cpu_rev = -1;
unsigned int mx31_cpu_rev;
EXPORT_SYMBOL(mx31_cpu_rev);

static struct {
u8 srev;
const char *name;
const char *v;
unsigned int rev;
} mx31_cpu_type[] = {
{ .srev = 0x00, .name = "i.MX31(L)", .rev = IMX_CHIP_REVISION_1_0 },
{ .srev = 0x10, .name = "i.MX31", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x11, .name = "i.MX31L", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x12, .name = "i.MX31", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x13, .name = "i.MX31L", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x14, .name = "i.MX31", .rev = IMX_CHIP_REVISION_1_2 },
{ .srev = 0x15, .name = "i.MX31L", .rev = IMX_CHIP_REVISION_1_2 },
{ .srev = 0x28, .name = "i.MX31", .rev = IMX_CHIP_REVISION_2_0 },
{ .srev = 0x29, .name = "i.MX31L", .rev = IMX_CHIP_REVISION_2_0 },
} mx31_cpu_type[] __initdata = {
{ .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = IMX_CHIP_REVISION_1_0 },
{ .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = IMX_CHIP_REVISION_1_1 },
{ .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = IMX_CHIP_REVISION_1_2 },
{ .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = IMX_CHIP_REVISION_1_2 },
{ .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = IMX_CHIP_REVISION_2_0 },
{ .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = IMX_CHIP_REVISION_2_0 },
};

static int mx31_read_cpu_rev(void)
void __init mx31_read_cpu_rev(void)
{
u32 i, srev;

/* read SREV register from IIM module */
srev = __raw_readl(MX31_IO_ADDRESS(MX31_IIM_BASE_ADDR + MXC_IIMSREV));
srev &= 0xff;

for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
if (srev == mx31_cpu_type[i].srev) {
imx_print_silicon_rev(mx31_cpu_type[i].name,
mx31_cpu_type[i].rev);
return mx31_cpu_type[i].rev;
}
printk(KERN_INFO
"CPU identified as %s, silicon rev %s\n",
mx31_cpu_type[i].name, mx31_cpu_type[i].v);

imx_print_silicon_rev("i.MX31", IMX_CHIP_REVISION_UNKNOWN);
return IMX_CHIP_REVISION_UNKNOWN;
}
mx31_cpu_rev = mx31_cpu_type[i].rev;
return;
}

int mx31_revision(void)
{
if (mx31_cpu_rev == -1)
mx31_cpu_rev = mx31_read_cpu_rev();
mx31_cpu_rev = IMX_CHIP_REVISION_UNKNOWN;

return mx31_cpu_rev;
printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev);
}
EXPORT_SYMBOL(mx31_revision);
Loading

0 comments on commit db8f674

Please sign in to comment.