diff options
author | Juergen Beisert <j.beisert@pengutronix.de> | 2008-07-05 04:02:56 -0400 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2008-07-05 04:02:56 -0400 |
commit | eea643f7ff04fe17c3ff71d41a9487c0753bd821 (patch) | |
tree | c9c097f8c99c155064c37e619527687ba4286873 /arch/arm/mach-mx2 | |
parent | aa10abd381b9493a88f6b9e111adc79e33d548fa (diff) |
i.MX2 family: Add basic mach support (sources)
This patch adds basic mach support for the mx2 processor family, based
on the original freescale code and adapted to mainline kernel coding
style.
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2')
-rw-r--r-- | arch/arm/mach-mx2/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-mx2/Makefile | 7 | ||||
-rw-r--r-- | arch/arm/mach-mx2/Makefile.boot | 3 | ||||
-rw-r--r-- | arch/arm/mach-mx2/generic.c | 74 | ||||
-rw-r--r-- | arch/arm/mach-mx2/system.c | 63 |
5 files changed, 152 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig new file mode 100644 index 000000000000..23def05fea0e --- /dev/null +++ b/arch/arm/mach-mx2/Kconfig | |||
@@ -0,0 +1,5 @@ | |||
1 | comment "MX2 family CPU support" | ||
2 | depends on ARCH_MX2 | ||
3 | |||
4 | comment "MX2 Platforms" | ||
5 | depends on ARCH_MX2 | ||
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile new file mode 100644 index 000000000000..937192dc57a7 --- /dev/null +++ b/arch/arm/mach-mx2/Makefile | |||
@@ -0,0 +1,7 @@ | |||
1 | # | ||
2 | # Makefile for the linux kernel. | ||
3 | # | ||
4 | |||
5 | # Object file lists. | ||
6 | |||
7 | obj-y := system.o generic.o | ||
diff --git a/arch/arm/mach-mx2/Makefile.boot b/arch/arm/mach-mx2/Makefile.boot new file mode 100644 index 000000000000..696831dcd485 --- /dev/null +++ b/arch/arm/mach-mx2/Makefile.boot | |||
@@ -0,0 +1,3 @@ | |||
1 | zreladdr-y := 0xA0008000 | ||
2 | params_phys-y := 0xA0000100 | ||
3 | initrd_phys-y := 0xA0800000 | ||
diff --git a/arch/arm/mach-mx2/generic.c b/arch/arm/mach-mx2/generic.c new file mode 100644 index 000000000000..07875cf00de9 --- /dev/null +++ b/arch/arm/mach-mx2/generic.c | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * generic.c | ||
3 | * | ||
4 | * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version 2 | ||
9 | * of the License, or (at your option) any later version. | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
18 | * MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/mm.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <asm/hardware.h> | ||
24 | #include <asm/pgtable.h> | ||
25 | #include <asm/mach/map.h> | ||
26 | |||
27 | /* MX27 memory map definition */ | ||
28 | static struct map_desc mxc_io_desc[] __initdata = { | ||
29 | /* | ||
30 | * this fixed mapping covers: | ||
31 | * - AIPI1 | ||
32 | * - AIPI2 | ||
33 | * - AITC | ||
34 | * - ROM Patch | ||
35 | * - and some reserved space | ||
36 | */ | ||
37 | { | ||
38 | .virtual = AIPI_BASE_ADDR_VIRT, | ||
39 | .pfn = __phys_to_pfn(AIPI_BASE_ADDR), | ||
40 | .length = AIPI_SIZE, | ||
41 | .type = MT_DEVICE | ||
42 | }, | ||
43 | /* | ||
44 | * this fixed mapping covers: | ||
45 | * - CSI | ||
46 | * - ATA | ||
47 | */ | ||
48 | { | ||
49 | .virtual = SAHB1_BASE_ADDR_VIRT, | ||
50 | .pfn = __phys_to_pfn(SAHB1_BASE_ADDR), | ||
51 | .length = SAHB1_SIZE, | ||
52 | .type = MT_DEVICE | ||
53 | }, | ||
54 | /* | ||
55 | * this fixed mapping covers: | ||
56 | * - EMI | ||
57 | */ | ||
58 | { | ||
59 | .virtual = X_MEMC_BASE_ADDR_VIRT, | ||
60 | .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), | ||
61 | .length = X_MEMC_SIZE, | ||
62 | .type = MT_DEVICE | ||
63 | } | ||
64 | }; | ||
65 | |||
66 | /* | ||
67 | * Initialize the memory map. It is called during the | ||
68 | * system startup to create static physical to virtual | ||
69 | * memory map for the IO modules. | ||
70 | */ | ||
71 | void __init mxc_map_io(void) | ||
72 | { | ||
73 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | ||
74 | } | ||
diff --git a/arch/arm/mach-mx2/system.c b/arch/arm/mach-mx2/system.c new file mode 100644 index 000000000000..99304645299d --- /dev/null +++ b/arch/arm/mach-mx2/system.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
4 | * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/io.h> | ||
25 | |||
26 | #include <asm/arch/hardware.h> | ||
27 | #include <asm/proc-fns.h> | ||
28 | #include <asm/system.h> | ||
29 | |||
30 | /* | ||
31 | * Put the CPU into idle mode. It is called by default_idle() | ||
32 | * in process.c file. | ||
33 | */ | ||
34 | void arch_idle(void) | ||
35 | { | ||
36 | /* | ||
37 | * This should do all the clock switching | ||
38 | * and wait for interrupt tricks. | ||
39 | */ | ||
40 | cpu_do_idle(); | ||
41 | } | ||
42 | |||
43 | #define WDOG_WCR_REG IO_ADDRESS(WDOG_BASE_ADDR) | ||
44 | #define WDOG_WCR_SRS (1 << 4) | ||
45 | |||
46 | /* | ||
47 | * Reset the system. It is called by machine_restart(). | ||
48 | */ | ||
49 | void arch_reset(char mode) | ||
50 | { | ||
51 | struct clk *clk; | ||
52 | |||
53 | clk = clk_get(NULL, "wdog_clk"); | ||
54 | if (!clk) { | ||
55 | printk(KERN_ERR"Cannot activate the watchdog. Giving up\n"); | ||
56 | return; | ||
57 | } | ||
58 | |||
59 | clk_enable(clk); | ||
60 | |||
61 | /* Assert SRS signal */ | ||
62 | __raw_writew(__raw_readw(WDOG_WCR_REG) & ~WDOG_WCR_SRS, WDOG_WCR_REG); | ||
63 | } | ||