aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-clps711x
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm/mach-clps711x
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/arm/mach-clps711x')
-rw-r--r--arch/arm/mach-clps711x/Kconfig71
-rw-r--r--arch/arm/mach-clps711x/Makefile20
-rw-r--r--arch/arm/mach-clps711x/Makefile.boot7
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c69
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c58
-rw-r--r--arch/arm/mach-clps711x/ceiva.c62
-rw-r--r--arch/arm/mach-clps711x/clep7312.c48
-rw-r--r--arch/arm/mach-clps711x/common.h11
-rw-r--r--arch/arm/mach-clps711x/dma.c27
-rw-r--r--arch/arm/mach-clps711x/edb7211-arch.c61
-rw-r--r--arch/arm/mach-clps711x/edb7211-mm.c70
-rw-r--r--arch/arm/mach-clps711x/fortunet.c85
-rw-r--r--arch/arm/mach-clps711x/irq.c143
-rw-r--r--arch/arm/mach-clps711x/mm.c43
-rw-r--r--arch/arm/mach-clps711x/p720t-leds.c67
-rw-r--r--arch/arm/mach-clps711x/p720t.c115
-rw-r--r--arch/arm/mach-clps711x/time.c85
17 files changed, 1042 insertions, 0 deletions
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
new file mode 100644
index 000000000000..f6e676322ca9
--- /dev/null
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -0,0 +1,71 @@
1if ARCH_CLPS711X
2
3menu "CLPS711X/EP721X Implementations"
4
5config ARCH_AUTCPU12
6 bool "AUTCPU12"
7 help
8 Say Y if you intend to run the kernel on the autronix autcpu12
9 board. This board is based on a Cirrus Logic CS89712.
10
11config ARCH_CDB89712
12 bool "CDB89712"
13 help
14 This is an evaluation board from Cirrus for the CS89712 processor.
15 The board includes 2 serial ports, Ethernet, IRDA, and expansion
16 headers. It comes with 16 MB SDRAM and 8 MB flash ROM.
17
18config ARCH_CEIVA
19 bool "CEIVA"
20 help
21 Say Y here if you intend to run this kernel on the Ceiva/Polaroid
22 PhotoMax Digital Picture Frame.
23
24config ARCH_CLEP7312
25 bool "CLEP7312"
26
27config ARCH_EDB7211
28 bool "EDB7211"
29 help
30 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
31 evaluation board.
32
33config ARCH_P720T
34 bool "P720T"
35 help
36 Say Y here if you intend to run this kernel on the ARM Prospector
37 720T.
38
39config ARCH_FORTUNET
40 bool "FORTUNET"
41
42# XXX Maybe these should indicate register compatibility
43# instead of being mutually exclusive.
44config ARCH_EP7211
45 bool
46 depends on ARCH_EDB7211
47 default y
48
49config ARCH_EP7212
50 bool
51 depends on ARCH_P720T || ARCH_CEIVA
52 default y
53
54config EP72XX_ROM_BOOT
55 bool "EP72xx ROM boot"
56 depends on ARCH_EP7211 || ARCH_EP7212
57 ---help---
58 If you say Y here, your CLPS711x-based kernel will use the bootstrap
59 mode memory map instead of the normal memory map.
60
61 Processors derived from the Cirrus CLPS-711X core support two boot
62 modes. Normal mode boots from the external memory device at CS0.
63 Bootstrap mode rearranges parts of the memory map, placing an
64 internal 128 byte bootstrap ROM at CS0. This option performs the
65 address map changes required to support booting in this mode.
66
67 You almost surely want to say N here.
68
69endmenu
70
71endif
diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile
new file mode 100644
index 000000000000..4a197315f0cf
--- /dev/null
+++ b/arch/arm/mach-clps711x/Makefile
@@ -0,0 +1,20 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := irq.o mm.o time.o
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_ARCH_CEIVA) += ceiva.o
13obj-$(CONFIG_ARCH_AUTCPU12) += autcpu12.o
14obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o
15obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o
16obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o
17obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o
18obj-$(CONFIG_ARCH_P720T) += p720t.o
19leds-$(CONFIG_ARCH_P720T) += p720t-leds.o
20obj-$(CONFIG_LEDS) += $(leds-y)
diff --git a/arch/arm/mach-clps711x/Makefile.boot b/arch/arm/mach-clps711x/Makefile.boot
new file mode 100644
index 000000000000..d3d29339e149
--- /dev/null
+++ b/arch/arm/mach-clps711x/Makefile.boot
@@ -0,0 +1,7 @@
1# The standard locations for stuff on CLPS711x type processors
2 zreladdr-y := 0xc0028000
3params_phys-y := 0xc0000100
4# Should probably have some agreement on these...
5initrd_phys-$(CONFIG_ARCH_P720T) := 0xc0400000
6initrd_phys-$(CONFIG_ARCH_CDB89712) := 0x00700000
7
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
new file mode 100644
index 000000000000..c106704a2c34
--- /dev/null
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -0,0 +1,69 @@
1/*
2 * linux/arch/arm/mach-clps711x/autcpu12.c
3 *
4 * (c) 2001 Thomas Gleixner, autronix automation <gleixner@autronix.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/types.h>
23#include <linux/string.h>
24#include <linux/mm.h>
25
26#include <asm/hardware.h>
27#include <asm/sizes.h>
28#include <asm/io.h>
29#include <asm/setup.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/pgtable.h>
33#include <asm/page.h>
34
35#include <asm/mach/map.h>
36#include <asm/arch/autcpu12.h>
37
38#include "common.h"
39
40/*
41 * The on-chip registers are given a size of 1MB so that a section can
42 * be used to map them; this saves a page table. This is the place to
43 * add mappings for ROM, expansion memory, PCMCIA, etc. (if static
44 * mappings are chosen for those areas).
45 *
46*/
47
48static struct map_desc autcpu12_io_desc[] __initdata = {
49 /* virtual, physical, length, type */
50 /* memory-mapped extra io and CS8900A Ethernet chip */
51 /* ethernet chip */
52 { AUTCPU12_VIRT_CS8900A, AUTCPU12_PHYS_CS8900A, SZ_1M, MT_DEVICE }
53};
54
55void __init autcpu12_map_io(void)
56{
57 clps711x_map_io();
58 iotable_init(autcpu12_io_desc, ARRAY_SIZE(autcpu12_io_desc));
59}
60
61MACHINE_START(AUTCPU12, "autronix autcpu12")
62 MAINTAINER("Thomas Gleixner")
63 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
64 BOOT_PARAMS(0xc0020000)
65 MAPIO(autcpu12_map_io)
66 INITIRQ(clps711x_init_irq)
67 .timer = &clps711x_timer,
68MACHINE_END
69
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
new file mode 100644
index 000000000000..7664f9cf83b8
--- /dev/null
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -0,0 +1,58 @@
1/*
2 * linux/arch/arm/mach-clps711x/cdb89712.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/types.h>
23#include <linux/string.h>
24#include <linux/mm.h>
25
26#include <asm/hardware.h>
27#include <asm/io.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/setup.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34
35#include "common.h"
36
37/*
38 * Map the CS89712 Ethernet port. That should be moved to the
39 * ethernet driver, perhaps.
40 */
41static struct map_desc cdb89712_io_desc[] __initdata = {
42 { ETHER_BASE, ETHER_START, ETHER_SIZE, MT_DEVICE }
43};
44
45static void __init cdb89712_map_io(void)
46{
47 clps711x_map_io();
48 iotable_init(cdb89712_io_desc, ARRAY_SIZE(cdb89712_io_desc));
49}
50
51MACHINE_START(CDB89712, "Cirrus-CDB89712")
52 MAINTAINER("Ray Lehtiniemi")
53 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
54 BOOT_PARAMS(0xc0000100)
55 MAPIO(cdb89712_map_io)
56 INITIRQ(clps711x_init_irq)
57 .timer = &clps711x_timer,
58MACHINE_END
diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
new file mode 100644
index 000000000000..e4093be3c4cb
--- /dev/null
+++ b/arch/arm/mach-clps711x/ceiva.c
@@ -0,0 +1,62 @@
1/*
2 * linux/arch/arm/mach-clps711x/arch-ceiva.c
3 *
4 * Copyright (C) 2002, Rob Scott <rscott@mtrob.fdns.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/types.h>
22#include <linux/string.h>
23
24#include <asm/setup.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28#include <linux/kernel.h>
29
30#include <asm/hardware.h>
31#include <asm/page.h>
32#include <asm/pgtable.h>
33#include <asm/sizes.h>
34
35#include <asm/mach/map.h>
36
37#include "common.h"
38
39static struct map_desc ceiva_io_desc[] __initdata = {
40 /* virtual, physical, length, type */
41
42 /* SED1355 controlled video RAM & registers */
43 { CEIVA_VIRT_SED1355, CEIVA_PHYS_SED1355, SZ_2M, MT_DEVICE }
44
45};
46
47
48static void __init ceiva_map_io(void)
49{
50 clps711x_map_io();
51 iotable_init(ceiva_io_desc, ARRAY_SIZE(ceiva_io_desc));
52}
53
54
55MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
56 MAINTAINER("Rob Scott")
57 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
58 BOOT_PARAMS(0xc0000100)
59 MAPIO(ceiva_map_io)
60 INITIRQ(clps711x_init_irq)
61 .timer = &clps711x_timer,
62MACHINE_END
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
new file mode 100644
index 000000000000..9ca21cb481ba
--- /dev/null
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -0,0 +1,48 @@
1/*
2 * linux/arch/arm/mach-clps711x/clep7312.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#include <linux/init.h>
19#include <linux/types.h>
20#include <linux/string.h>
21
22#include <asm/setup.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25
26#include "common.h"
27
28static void __init
29fixup_clep7312(struct machine_desc *desc, struct tag *tags,
30 char **cmdline, struct meminfo *mi)
31{
32 mi->nr_banks=1;
33 mi->bank[0].start = 0xc0000000;
34 mi->bank[0].size = 0x01000000;
35 mi->bank[0].node = 0;
36}
37
38
39MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
40 MAINTAINER("Nobody")
41 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
42 BOOT_PARAMS(0xc0000100)
43 FIXUP(fixup_clep7312)
44 MAPIO(clps711x_map_io)
45 INITIRQ(clps711x_init_irq)
46 .timer = &clps711x_timer,
47MACHINE_END
48
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h
new file mode 100644
index 000000000000..2b8b801f1dc3
--- /dev/null
+++ b/arch/arm/mach-clps711x/common.h
@@ -0,0 +1,11 @@
1/*
2 * linux/arch/arm/mach-clps711x/common.h
3 *
4 * Common bits.
5 */
6
7struct sys_timer;
8
9extern void clps711x_map_io(void);
10extern void clps711x_init_irq(void);
11extern struct sys_timer clps711x_timer;
diff --git a/arch/arm/mach-clps711x/dma.c b/arch/arm/mach-clps711x/dma.c
new file mode 100644
index 000000000000..af5a4de38eac
--- /dev/null
+++ b/arch/arm/mach-clps711x/dma.c
@@ -0,0 +1,27 @@
1/*
2 * linux/arch/arm/mach-clps711x/dma.c
3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21
22#include <asm/dma.h>
23#include <asm/mach/dma.h>
24
25void __init arch_dma_init(dma_t *dma)
26{
27}
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
new file mode 100644
index 000000000000..c6c46324a2e3
--- /dev/null
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -0,0 +1,61 @@
1/*
2 * linux/arch/arm/mach-clps711x/arch-edb7211.c
3 *
4 * Copyright (C) 2000, 2001 Blue Mug, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/types.h>
22#include <linux/string.h>
23
24#include <asm/setup.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28#include "common.h"
29
30extern void edb7211_map_io(void);
31
32static void __init
33fixup_edb7211(struct machine_desc *desc, struct tag *tags,
34 char **cmdline, struct meminfo *mi)
35{
36 /*
37 * Bank start addresses are not present in the information
38 * passed in from the boot loader. We could potentially
39 * detect them, but instead we hard-code them.
40 *
41 * Banks sizes _are_ present in the param block, but we're
42 * not using that information yet.
43 */
44 mi->bank[0].start = 0xc0000000;
45 mi->bank[0].size = 8*1024*1024;
46 mi->bank[0].node = 0;
47 mi->bank[1].start = 0xc1000000;
48 mi->bank[1].size = 8*1024*1024;
49 mi->bank[1].node = 1;
50 mi->nr_banks = 2;
51}
52
53MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
54 MAINTAINER("Jon McClintock")
55 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
56 BOOT_PARAMS(0xc0020100) /* 0xc0000000 - 0xc001ffff can be video RAM */
57 FIXUP(fixup_edb7211)
58 MAPIO(edb7211_map_io)
59 INITIRQ(clps711x_init_irq)
60 .timer = &clps711x_timer,
61MACHINE_END
diff --git a/arch/arm/mach-clps711x/edb7211-mm.c b/arch/arm/mach-clps711x/edb7211-mm.c
new file mode 100644
index 000000000000..7fd7b01822d0
--- /dev/null
+++ b/arch/arm/mach-clps711x/edb7211-mm.c
@@ -0,0 +1,70 @@
1/*
2 * linux/arch/arm/mach-clps711x/mm.c
3 *
4 * Extra MM routines for the EDB7211 board
5 *
6 * Copyright (C) 2000, 2001 Blue Mug, Inc. All Rights Reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <asm/hardware.h>
26#include <asm/page.h>
27#include <asm/pgtable.h>
28#include <asm/sizes.h>
29
30#include <asm/mach/map.h>
31
32extern void clps711x_map_io(void);
33
34/*
35 * The on-chip registers are given a size of 1MB so that a section can
36 * be used to map them; this saves a page table. This is the place to
37 * add mappings for ROM, expansion memory, PCMCIA, etc. (if static
38 * mappings are chosen for those areas).
39 *
40 * Here is a physical memory map (to be fleshed out later):
41 *
42 * Physical Address Size Description
43 * ----------------- ----- ---------------------------------
44 * c0000000-c001ffff 128KB reserved for video RAM [1]
45 * c0020000-c0023fff 16KB parameters (see Documentation/arm/Setup)
46 * c0024000-c0027fff 16KB swapper_pg_dir (task 0 page directory)
47 * c0028000-... kernel image (TEXTADDR)
48 *
49 * [1] Unused pages should be given back to the VM; they are not yet.
50 * The parameter block should also be released (not sure if this
51 * happens).
52 */
53static struct map_desc edb7211_io_desc[] __initdata = {
54 /* virtual, physical, length, type */
55
56 /* memory-mapped extra keyboard row and CS8900A Ethernet chip */
57 { EP7211_VIRT_EXTKBD, EP7211_PHYS_EXTKBD, SZ_1M, MT_DEVICE },
58 { EP7211_VIRT_CS8900A, EP7211_PHYS_CS8900A, SZ_1M, MT_DEVICE },
59
60 /* flash banks */
61 { EP7211_VIRT_FLASH1, EP7211_PHYS_FLASH1, SZ_8M, MT_DEVICE },
62 { EP7211_VIRT_FLASH2, EP7211_PHYS_FLASH2, SZ_8M, MT_DEVICE }
63};
64
65void __init edb7211_map_io(void)
66{
67 clps711x_map_io();
68 iotable_init(edb7211_io_desc, ARRAY_SIZE(edb7211_io_desc));
69}
70
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
new file mode 100644
index 000000000000..c1c5b8e01549
--- /dev/null
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -0,0 +1,85 @@
1/*
2 * linux/arch/arm/mach-clps711x/fortunet.c
3 *
4 * Derived from linux/arch/arm/mach-integrator/arch.c
5 *
6 * Copyright (C) 2000 Deep Blue Solutions Ltd
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/config.h>
23#include <linux/types.h>
24#include <linux/init.h>
25#include <linux/initrd.h>
26
27#include <asm/hardware.h>
28#include <asm/irq.h>
29#include <asm/setup.h>
30#include <asm/mach-types.h>
31
32#include <asm/mach/arch.h>
33
34#include "common.h"
35
36struct meminfo memmap = {
37 .nr_banks = 1,
38 .bank = {
39 {
40 .start = 0xC0000000,
41 .size = 0x01000000,
42 .node = 0
43 },
44 },
45};
46
47typedef struct tag_IMAGE_PARAMS
48{
49 int ramdisk_ok;
50 int ramdisk_address;
51 int ramdisk_size;
52 int ram_size;
53 int extra_param_type;
54 int extra_param_ptr;
55 int command_line;
56} IMAGE_PARAMS;
57
58#define IMAGE_PARAMS_PHYS 0xC01F0000
59
60static void __init
61fortunet_fixup(struct machine_desc *desc, struct tag *tags,
62 char **cmdline, struct meminfo *mi)
63{
64 IMAGE_PARAMS *ip = phys_to_virt(IMAGE_PARAMS_PHYS);
65 *cmdline = phys_to_virt(ip->command_line);
66#ifdef CONFIG_BLK_DEV_INITRD
67 if(ip->ramdisk_ok)
68 {
69 initrd_start = __phys_to_virt(ip->ramdisk_address);
70 initrd_end = initrd_start + ip->ramdisk_size;
71 }
72#endif
73 memmap.bank[0].size = ip->ram_size;
74 *mi = memmap;
75}
76
77MACHINE_START(FORTUNET, "ARM-FortuNet")
78 MAINTAINER("FortuNet Inc.")
79 BOOT_MEM(0xc0000000, 0x80000000, 0xf0000000)
80 BOOT_PARAMS(0x00000000)
81 FIXUP(fortunet_fixup)
82 MAPIO(clps711x_map_io)
83 INITIRQ(clps711x_init_irq)
84 .timer = &clps711x_timer,
85MACHINE_END
diff --git a/arch/arm/mach-clps711x/irq.c b/arch/arm/mach-clps711x/irq.c
new file mode 100644
index 000000000000..7ee926e5bad2
--- /dev/null
+++ b/arch/arm/mach-clps711x/irq.c
@@ -0,0 +1,143 @@
1/*
2 * linux/arch/arm/mach-clps711x/irq.c
3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/list.h>
22
23#include <asm/mach/irq.h>
24#include <asm/hardware.h>
25#include <asm/io.h>
26#include <asm/irq.h>
27
28#include <asm/hardware/clps7111.h>
29
30static void int1_mask(unsigned int irq)
31{
32 u32 intmr1;
33
34 intmr1 = clps_readl(INTMR1);
35 intmr1 &= ~(1 << irq);
36 clps_writel(intmr1, INTMR1);
37}
38
39static void int1_ack(unsigned int irq)
40{
41 u32 intmr1;
42
43 intmr1 = clps_readl(INTMR1);
44 intmr1 &= ~(1 << irq);
45 clps_writel(intmr1, INTMR1);
46
47 switch (irq) {
48 case IRQ_CSINT: clps_writel(0, COEOI); break;
49 case IRQ_TC1OI: clps_writel(0, TC1EOI); break;
50 case IRQ_TC2OI: clps_writel(0, TC2EOI); break;
51 case IRQ_RTCMI: clps_writel(0, RTCEOI); break;
52 case IRQ_TINT: clps_writel(0, TEOI); break;
53 case IRQ_UMSINT: clps_writel(0, UMSEOI); break;
54 }
55}
56
57static void int1_unmask(unsigned int irq)
58{
59 u32 intmr1;
60
61 intmr1 = clps_readl(INTMR1);
62 intmr1 |= 1 << irq;
63 clps_writel(intmr1, INTMR1);
64}
65
66static struct irqchip int1_chip = {
67 .ack = int1_ack,
68 .mask = int1_mask,
69 .unmask = int1_unmask,
70};
71
72static void int2_mask(unsigned int irq)
73{
74 u32 intmr2;
75
76 intmr2 = clps_readl(INTMR2);
77 intmr2 &= ~(1 << (irq - 16));
78 clps_writel(intmr2, INTMR2);
79}
80
81static void int2_ack(unsigned int irq)
82{
83 u32 intmr2;
84
85 intmr2 = clps_readl(INTMR2);
86 intmr2 &= ~(1 << (irq - 16));
87 clps_writel(intmr2, INTMR2);
88
89 switch (irq) {
90 case IRQ_KBDINT: clps_writel(0, KBDEOI); break;
91 }
92}
93
94static void int2_unmask(unsigned int irq)
95{
96 u32 intmr2;
97
98 intmr2 = clps_readl(INTMR2);
99 intmr2 |= 1 << (irq - 16);
100 clps_writel(intmr2, INTMR2);
101}
102
103static struct irqchip int2_chip = {
104 .ack = int2_ack,
105 .mask = int2_mask,
106 .unmask = int2_unmask,
107};
108
109void __init clps711x_init_irq(void)
110{
111 unsigned int i;
112
113 for (i = 0; i < NR_IRQS; i++) {
114 if (INT1_IRQS & (1 << i)) {
115 set_irq_handler(i, do_level_IRQ);
116 set_irq_chip(i, &int1_chip);
117 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
118 }
119 if (INT2_IRQS & (1 << i)) {
120 set_irq_handler(i, do_level_IRQ);
121 set_irq_chip(i, &int2_chip);
122 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
123 }
124 }
125
126 /*
127 * Disable interrupts
128 */
129 clps_writel(0, INTMR1);
130 clps_writel(0, INTMR2);
131
132 /*
133 * Clear down any pending interrupts
134 */
135 clps_writel(0, COEOI);
136 clps_writel(0, TC1EOI);
137 clps_writel(0, TC2EOI);
138 clps_writel(0, RTCEOI);
139 clps_writel(0, TEOI);
140 clps_writel(0, UMSEOI);
141 clps_writel(0, SYNCIO);
142 clps_writel(0, KBDEOI);
143}
diff --git a/arch/arm/mach-clps711x/mm.c b/arch/arm/mach-clps711x/mm.c
new file mode 100644
index 000000000000..120b7cac84b5
--- /dev/null
+++ b/arch/arm/mach-clps711x/mm.c
@@ -0,0 +1,43 @@
1/*
2 * linux/arch/arm/mach-clps711x/mm.c
3 *
4 * Generic MM setup for the CLPS711x-based machines.
5 *
6 * Copyright (C) 2001 Deep Blue Solutions Ltd
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/mm.h>
24#include <linux/init.h>
25#include <linux/bootmem.h>
26
27#include <asm/hardware.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/mach/map.h>
31#include <asm/hardware/clps7111.h>
32
33/*
34 * This maps the generic CLPS711x registers
35 */
36static struct map_desc clps711x_io_desc[] __initdata = {
37 { CLPS7111_VIRT_BASE, CLPS7111_PHYS_BASE, 1048576, MT_DEVICE }
38};
39
40void __init clps711x_map_io(void)
41{
42 iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
43}
diff --git a/arch/arm/mach-clps711x/p720t-leds.c b/arch/arm/mach-clps711x/p720t-leds.c
new file mode 100644
index 000000000000..4915b3524963
--- /dev/null
+++ b/arch/arm/mach-clps711x/p720t-leds.c
@@ -0,0 +1,67 @@
1/*
2 * linux/arch/arm/mach-clps711x/leds.c
3 *
4 * Integrator LED control routines
5 *
6 * Copyright (C) 2000 Deep Blue Solutions Ltd
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <asm/hardware.h>
26#include <asm/io.h>
27#include <asm/leds.h>
28#include <asm/system.h>
29#include <asm/mach-types.h>
30
31#include <asm/hardware/clps7111.h>
32#include <asm/hardware/ep7212.h>
33
34static void p720t_leds_event(led_event_t ledevt)
35{
36 unsigned long flags;
37 u32 pddr;
38
39 local_irq_save(flags);
40 switch(ledevt) {
41 case led_idle_start:
42 break;
43
44 case led_idle_end:
45 break;
46
47 case led_timer:
48 pddr = clps_readb(PDDR);
49 clps_writeb(pddr ^ 1, PDDR);
50 break;
51
52 default:
53 break;
54 }
55
56 local_irq_restore(flags);
57}
58
59static int __init leds_init(void)
60{
61 if (machine_is_p720t())
62 leds_event = p720t_leds_event;
63
64 return 0;
65}
66
67arch_initcall(leds_init);
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
new file mode 100644
index 000000000000..29269df054f5
--- /dev/null
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -0,0 +1,115 @@
1/*
2 * linux/arch/arm/mach-clps711x/p720t.c
3 *
4 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/config.h>
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/types.h>
24#include <linux/string.h>
25#include <linux/mm.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/pgtable.h>
30#include <asm/page.h>
31#include <asm/setup.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
35#include <asm/arch/syspld.h>
36
37#include "common.h"
38
39/*
40 * Map the P720T system PLD. It occupies two address spaces:
41 * SYSPLD_PHYS_BASE and SYSPLD_PHYS_BASE + 0x00400000
42 * We map both here.
43 */
44static struct map_desc p720t_io_desc[] __initdata = {
45 { SYSPLD_VIRT_BASE, SYSPLD_PHYS_BASE, 1048576, MT_DEVICE },
46 { 0xfe400000, 0x10400000, 1048576, MT_DEVICE }
47};
48
49static void __init
50fixup_p720t(struct machine_desc *desc, struct tag *tag,
51 char **cmdline, struct meminfo *mi)
52{
53 /*
54 * Our bootloader doesn't setup any tags (yet).
55 */
56 if (tag->hdr.tag != ATAG_CORE) {
57 tag->hdr.tag = ATAG_CORE;
58 tag->hdr.size = tag_size(tag_core);
59 tag->u.core.flags = 0;
60 tag->u.core.pagesize = PAGE_SIZE;
61 tag->u.core.rootdev = 0x0100;
62
63 tag = tag_next(tag);
64 tag->hdr.tag = ATAG_MEM;
65 tag->hdr.size = tag_size(tag_mem32);
66 tag->u.mem.size = 4096;
67 tag->u.mem.start = PHYS_OFFSET;
68
69 tag = tag_next(tag);
70 tag->hdr.tag = ATAG_NONE;
71 tag->hdr.size = 0;
72 }
73}
74
75static void __init p720t_map_io(void)
76{
77 clps711x_map_io();
78 iotable_init(p720t_io_desc, ARRAY_SIZE(p720t_io_desc));
79}
80
81MACHINE_START(P720T, "ARM-Prospector720T")
82 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
83 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
84 BOOT_PARAMS(0xc0000100)
85 FIXUP(fixup_p720t)
86 MAPIO(p720t_map_io)
87 INITIRQ(clps711x_init_irq)
88 .timer = &clps711x_timer,
89MACHINE_END
90
91static int p720t_hw_init(void)
92{
93 /*
94 * Power down as much as possible in case we don't
95 * have the drivers loaded.
96 */
97 PLD_LCDEN = 0;
98 PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
99
100 PLD_KBD = 0;
101 PLD_IO = 0;
102 PLD_IRDA = 0;
103 PLD_CODEC = 0;
104 PLD_TCH = 0;
105 PLD_SPI = 0;
106#ifndef CONFIG_DEBUG_LL
107 PLD_COM2 = 0;
108 PLD_COM1 = 0;
109#endif
110
111 return 0;
112}
113
114__initcall(p720t_hw_init);
115
diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c
new file mode 100644
index 000000000000..383d4e0c6e35
--- /dev/null
+++ b/arch/arm/mach-clps711x/time.c
@@ -0,0 +1,85 @@
1/*
2 * linux/arch/arm/mach-clps711x/time.c
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/timex.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/sched.h>
23
24#include <asm/hardware.h>
25#include <asm/irq.h>
26#include <asm/leds.h>
27#include <asm/io.h>
28#include <asm/hardware/clps7111.h>
29
30#include <asm/mach/time.h>
31
32
33/*
34 * gettimeoffset() returns time since last timer tick, in usecs.
35 *
36 * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
37 * 'tick' is usecs per jiffy.
38 */
39static unsigned long clps711x_gettimeoffset(void)
40{
41 unsigned long hwticks;
42 hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */
43 return (hwticks * (tick_nsec / 1000)) / LATCH;
44}
45
46/*
47 * IRQ handler for the timer
48 */
49static irqreturn_t
50p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
51{
52 write_seqlock(&xtime_lock);
53 timer_tick(regs);
54 write_sequnlock(&xtime_lock);
55 return IRQ_HANDLED;
56}
57
58static struct irqaction clps711x_timer_irq = {
59 .name = "CLPS711x Timer Tick",
60 .flags = SA_INTERRUPT,
61 .handler = p720t_timer_interrupt
62};
63
64static void __init clps711x_timer_init(void)
65{
66 struct timespec tv;
67 unsigned int syscon;
68
69 syscon = clps_readl(SYSCON1);
70 syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
71 clps_writel(syscon, SYSCON1);
72
73 clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
74
75 setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
76
77 tv.tv_nsec = 0;
78 tv.tv_sec = clps_readl(RTCDR);
79 do_settimeofday(&tv);
80}
81
82struct sys_timer clps711x_timer = {
83 .init = clps711x_timer_init,
84 .offset = clps711x_gettimeoffset,
85};