aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorDinh Nguyen <Dinh.Nguyen@freescale.com>2010-11-15 12:29:59 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2010-11-24 04:09:04 -0500
commitc0abefd30b2c9db015df4914a95d268ecdb39b00 (patch)
tree810c6f6e8e00604a78379424a6aae2140d7fadd5 /arch/arm/mach-mx5
parent374daa4f9019f75da1addb3f31a22df1966a5baa (diff)
ARM: imx: Add core definitions for MX53
Add iomux, clocks, and memory map for Freescale's MX53 SoC. Add cpu_is_mx53 function to common.h. Add 3 more banks of gpio's to mxc_gpio_ports. Add MX53 phys offset address. Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/Makefile2
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c (renamed from arch/arm/mach-mx5/clock-mx51.c)59
-rw-r--r--arch/arm/mach-mx5/cpu.c43
-rw-r--r--arch/arm/mach-mx5/crm_regs.h6
-rw-r--r--arch/arm/mach-mx5/devices.c27
-rw-r--r--arch/arm/mach-mx5/mm.c17
6 files changed, 129 insertions, 25 deletions
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
index 462f177eddfe..026cd850df28 100644
--- a/arch/arm/mach-mx5/Makefile
+++ b/arch/arm/mach-mx5/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Object file lists. 5# Object file lists.
6obj-y := cpu.o mm.o clock-mx51.o devices.o 6obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o
7 7
8obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o 8obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
9obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o 9obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
diff --git a/arch/arm/mach-mx5/clock-mx51.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 8ac36d882927..ca4f9d58cfeb 100644
--- a/arch/arm/mach-mx5/clock-mx51.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -33,6 +33,7 @@ static struct clk pll1_main_clk;
33static struct clk pll1_sw_clk; 33static struct clk pll1_sw_clk;
34static struct clk pll2_sw_clk; 34static struct clk pll2_sw_clk;
35static struct clk pll3_sw_clk; 35static struct clk pll3_sw_clk;
36static struct clk mx53_pll4_sw_clk;
36static struct clk lp_apm_clk; 37static struct clk lp_apm_clk;
37static struct clk periph_apm_clk; 38static struct clk periph_apm_clk;
38static struct clk ahb_clk; 39static struct clk ahb_clk;
@@ -131,6 +132,8 @@ static inline void __iomem *_get_pll_base(struct clk *pll)
131 return MX51_DPLL2_BASE; 132 return MX51_DPLL2_BASE;
132 else if (pll == &pll3_sw_clk) 133 else if (pll == &pll3_sw_clk)
133 return MX51_DPLL3_BASE; 134 return MX51_DPLL3_BASE;
135 else if (pll == &mx53_pll4_sw_clk)
136 return MX53_DPLL4_BASE;
134 else 137 else
135 BUG(); 138 BUG();
136 139
@@ -514,7 +517,10 @@ static int _clk_max_enable(struct clk *clk)
514 517
515 /* Handshake with MAX when LPM is entered. */ 518 /* Handshake with MAX when LPM is entered. */
516 reg = __raw_readl(MXC_CCM_CLPCR); 519 reg = __raw_readl(MXC_CCM_CLPCR);
517 reg &= ~MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS; 520 if (cpu_is_mx51())
521 reg &= ~MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS;
522 else if (cpu_is_mx53())
523 reg &= ~MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS;
518 __raw_writel(reg, MXC_CCM_CLPCR); 524 __raw_writel(reg, MXC_CCM_CLPCR);
519 525
520 return 0; 526 return 0;
@@ -528,7 +534,10 @@ static void _clk_max_disable(struct clk *clk)
528 534
529 /* No Handshake with MAX when LPM is entered as its disabled. */ 535 /* No Handshake with MAX when LPM is entered as its disabled. */
530 reg = __raw_readl(MXC_CCM_CLPCR); 536 reg = __raw_readl(MXC_CCM_CLPCR);
531 reg |= MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS; 537 if (cpu_is_mx51())
538 reg |= MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS;
539 else if (cpu_is_mx53())
540 reg &= ~MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS;
532 __raw_writel(reg, MXC_CCM_CLPCR); 541 __raw_writel(reg, MXC_CCM_CLPCR);
533} 542}
534 543
@@ -739,6 +748,14 @@ static struct clk pll3_sw_clk = {
739 .disable = _clk_pll_disable, 748 .disable = _clk_pll_disable,
740}; 749};
741 750
751/* PLL4 SW supplies to LVDS Display Bridge(LDB) */
752static struct clk mx53_pll4_sw_clk = {
753 .parent = &osc_clk,
754 .set_rate = _clk_pll_set_rate,
755 .enable = _clk_pll_enable,
756 .disable = _clk_pll_disable,
757};
758
742/* Low-power Audio Playback Mode clock */ 759/* Low-power Audio Playback Mode clock */
743static struct clk lp_apm_clk = { 760static struct clk lp_apm_clk = {
744 .parent = &osc_clk, 761 .parent = &osc_clk,
@@ -1053,7 +1070,7 @@ DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET,
1053 .clk = &c, \ 1070 .clk = &c, \
1054 }, 1071 },
1055 1072
1056static struct clk_lookup lookups[] = { 1073static struct clk_lookup mx51_lookups[] = {
1057 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) 1074 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
1058 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) 1075 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
1059 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 1076 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
@@ -1084,6 +1101,14 @@ static struct clk_lookup lookups[] = {
1084 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) 1101 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk)
1085}; 1102};
1086 1103
1104static struct clk_lookup mx53_lookups[] = {
1105 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
1106 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
1107 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
1108 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
1109 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
1110};
1111
1087static void clk_tree_init(void) 1112static void clk_tree_init(void)
1088{ 1113{
1089 u32 reg; 1114 u32 reg;
@@ -1114,8 +1139,8 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
1114 ckih2_reference = ckih2; 1139 ckih2_reference = ckih2;
1115 oscillator_reference = osc; 1140 oscillator_reference = osc;
1116 1141
1117 for (i = 0; i < ARRAY_SIZE(lookups); i++) 1142 for (i = 0; i < ARRAY_SIZE(mx51_lookups); i++)
1118 clkdev_add(&lookups[i]); 1143 clkdev_add(&mx51_lookups[i]);
1119 1144
1120 clk_tree_init(); 1145 clk_tree_init();
1121 1146
@@ -1138,3 +1163,27 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
1138 MX51_MXC_INT_GPT); 1163 MX51_MXC_INT_GPT);
1139 return 0; 1164 return 0;
1140} 1165}
1166
1167int __init mx53_clocks_init(unsigned long ckil, unsigned long osc,
1168 unsigned long ckih1, unsigned long ckih2)
1169{
1170 int i;
1171
1172 external_low_reference = ckil;
1173 external_high_reference = ckih1;
1174 ckih2_reference = ckih2;
1175 oscillator_reference = osc;
1176
1177 for (i = 0; i < ARRAY_SIZE(mx53_lookups); i++)
1178 clkdev_add(&mx53_lookups[i]);
1179
1180 clk_tree_init();
1181
1182 clk_enable(&cpu_clk);
1183 clk_enable(&main_bus_clk);
1184
1185 /* System timer */
1186 mxc_timer_init(&gpt_clk, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR),
1187 MX53_INT_GPT);
1188 return 0;
1189}
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
index 061ab701b6d9..8c9a29e322dc 100644
--- a/arch/arm/mach-mx5/cpu.c
+++ b/arch/arm/mach-mx5/cpu.c
@@ -97,24 +97,31 @@ static int __init post_cpu_init(void)
97 unsigned int reg; 97 unsigned int reg;
98 void __iomem *base; 98 void __iomem *base;
99 99
100 if (!cpu_is_mx51()) 100 if (cpu_is_mx51() || cpu_is_mx53()) {
101 return 0; 101 if (cpu_is_mx51())
102 102 base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR);
103 base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR); 103 else
104 __raw_writel(0x0, base + 0x40); 104 base = MX53_IO_ADDRESS(MX53_AIPS1_BASE_ADDR);
105 __raw_writel(0x0, base + 0x44); 105
106 __raw_writel(0x0, base + 0x48); 106 __raw_writel(0x0, base + 0x40);
107 __raw_writel(0x0, base + 0x4C); 107 __raw_writel(0x0, base + 0x44);
108 reg = __raw_readl(base + 0x50) & 0x00FFFFFF; 108 __raw_writel(0x0, base + 0x48);
109 __raw_writel(reg, base + 0x50); 109 __raw_writel(0x0, base + 0x4C);
110 110 reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
111 base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR); 111 __raw_writel(reg, base + 0x50);
112 __raw_writel(0x0, base + 0x40); 112
113 __raw_writel(0x0, base + 0x44); 113 if (cpu_is_mx51())
114 __raw_writel(0x0, base + 0x48); 114 base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR);
115 __raw_writel(0x0, base + 0x4C); 115 else
116 reg = __raw_readl(base + 0x50) & 0x00FFFFFF; 116 base = MX53_IO_ADDRESS(MX53_AIPS2_BASE_ADDR);
117 __raw_writel(reg, base + 0x50); 117
118 __raw_writel(0x0, base + 0x40);
119 __raw_writel(0x0, base + 0x44);
120 __raw_writel(0x0, base + 0x48);
121 __raw_writel(0x0, base + 0x4C);
122 reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
123 __raw_writel(reg, base + 0x50);
124 }
118 125
119 return 0; 126 return 0;
120} 127}
diff --git a/arch/arm/mach-mx5/crm_regs.h b/arch/arm/mach-mx5/crm_regs.h
index c776b9af0624..51ff9bb02379 100644
--- a/arch/arm/mach-mx5/crm_regs.h
+++ b/arch/arm/mach-mx5/crm_regs.h
@@ -18,6 +18,9 @@
18#define MX51_CORTEXA8_BASE MX51_IO_ADDRESS(MX51_ARM_BASE_ADDR) 18#define MX51_CORTEXA8_BASE MX51_IO_ADDRESS(MX51_ARM_BASE_ADDR)
19#define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR) 19#define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR)
20 20
21/*MX53*/
22#define MX53_DPLL4_BASE MX53_IO_ADDRESS(MX53_PLL3_BASE_ADDR)
23
21/* PLL Register Offsets */ 24/* PLL Register Offsets */
22#define MXC_PLL_DP_CTL 0x00 25#define MXC_PLL_DP_CTL 0x00
23#define MXC_PLL_DP_CONFIG 0x04 26#define MXC_PLL_DP_CONFIG 0x04
@@ -380,7 +383,8 @@
380/* Define the bits in register CLPCR */ 383/* Define the bits in register CLPCR */
381#define MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS (0x1 << 23) 384#define MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS (0x1 << 23)
382#define MXC_CCM_CLPCR_BYPASS_SCC_LPM_HS (0x1 << 22) 385#define MXC_CCM_CLPCR_BYPASS_SCC_LPM_HS (0x1 << 22)
383#define MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 21) 386#define MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 21)
387#define MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 25)
384#define MXC_CCM_CLPCR_BYPASS_SDMA_LPM_HS (0x1 << 20) 388#define MXC_CCM_CLPCR_BYPASS_SDMA_LPM_HS (0x1 << 20)
385#define MXC_CCM_CLPCR_BYPASS_EMI_LPM_HS (0x1 << 19) 389#define MXC_CCM_CLPCR_BYPASS_EMI_LPM_HS (0x1 << 19)
386#define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18) 390#define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18)
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c
index 4c7be87a7c9d..d926203023ec 100644
--- a/arch/arm/mach-mx5/devices.c
+++ b/arch/arm/mach-mx5/devices.c
@@ -160,9 +160,36 @@ static struct mxc_gpio_port mxc_gpio_ports[] = {
160 .irq_high = MX51_MXC_INT_GPIO4_HIGH, 160 .irq_high = MX51_MXC_INT_GPIO4_HIGH,
161 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3 161 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3
162 }, 162 },
163 {
164 .chip.label = "gpio-4",
165 .base = MX53_IO_ADDRESS(MX53_GPIO5_BASE_ADDR),
166 .irq = MX53_INT_GPIO5_LOW,
167 .irq_high = MX53_INT_GPIO5_HIGH,
168 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 4
169 },
170 {
171 .chip.label = "gpio-5",
172 .base = MX53_IO_ADDRESS(MX53_GPIO6_BASE_ADDR),
173 .irq = MX53_INT_GPIO6_LOW,
174 .irq_high = MX53_INT_GPIO6_HIGH,
175 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 5
176 },
177 {
178 .chip.label = "gpio-6",
179 .base = MX53_IO_ADDRESS(MX53_GPIO7_BASE_ADDR),
180 .irq = MX53_INT_GPIO7_LOW,
181 .irq_high = MX53_INT_GPIO7_HIGH,
182 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 6
183 },
163}; 184};
164 185
165int __init imx51_register_gpios(void) 186int __init imx51_register_gpios(void)
166{ 187{
188 return mxc_gpio_init(mxc_gpio_ports, 4);
189}
190
191int __init imx53_register_gpios(void)
192{
167 return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports)); 193 return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports));
168} 194}
195
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 01dff26c1007..2822d0e6f23a 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -63,3 +63,20 @@ void __init mx51_init_irq(void)
63 tzic_init_irq(tzic_virt); 63 tzic_init_irq(tzic_virt);
64 imx51_register_gpios(); 64 imx51_register_gpios();
65} 65}
66
67int imx53_register_gpios(void);
68
69void __init mx53_init_irq(void)
70{
71 unsigned long tzic_addr;
72 void __iomem *tzic_virt;
73
74 tzic_addr = MX53_TZIC_BASE_ADDR;
75
76 tzic_virt = ioremap(tzic_addr, SZ_16K);
77 if (!tzic_virt)
78 panic("unable to map TZIC interrupt controller\n");
79
80 tzic_init_irq(tzic_virt);
81 imx53_register_gpios();
82}