blob: 3de19554d8003e25760187fbb9c250597697f6c6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
Russell Kingfced80c2008-09-06 12:10:45 +010025#include <linux/io.h>
Alexander Shiyance557542012-08-15 20:28:06 +040026#include <linux/ioport.h>
Alexander Shiyan200daa32012-11-17 17:57:07 +040027#include <linux/interrupt.h>
Alexander Shiyance557542012-08-15 20:28:06 +040028#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Russell Kinga09e64f2008-08-05 16:14:15 +010030#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include <asm/sizes.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#include <asm/setup.h>
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35#include <asm/pgtable.h>
36#include <asm/page.h>
37
38#include <asm/mach/map.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010039#include <mach/autcpu12.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41#include "common.h"
42
Alexander Shiyan200daa32012-11-17 17:57:07 +040043#define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300)
44#define AUTCPU12_CS8900_IRQ (IRQ_EINT3)
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Alexander Shiyan200daa32012-11-17 17:57:07 +040046static struct resource autcpu12_cs8900_resource[] __initdata = {
47 DEFINE_RES_MEM(AUTCPU12_CS8900_BASE, SZ_1K),
48 DEFINE_RES_IRQ(AUTCPU12_CS8900_IRQ),
49};
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Alexander Shiyance557542012-08-15 20:28:06 +040051static struct resource autcpu12_nvram_resource[] __initdata = {
52 DEFINE_RES_MEM_NAMED(AUTCPU12_PHYS_NVRAM, SZ_128K, "SRAM"),
53};
54
55static struct platform_device autcpu12_nvram_pdev __initdata = {
56 .name = "autcpu12_nvram",
57 .id = -1,
58 .resource = autcpu12_nvram_resource,
59 .num_resources = ARRAY_SIZE(autcpu12_nvram_resource),
60};
61
62static void __init autcpu12_init(void)
63{
Alexander Shiyandd850f12012-11-17 17:57:09 +040064 platform_device_register_simple("video-clps711x", 0, NULL, 0);
Alexander Shiyan200daa32012-11-17 17:57:07 +040065 platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource,
66 ARRAY_SIZE(autcpu12_cs8900_resource));
Alexander Shiyance557542012-08-15 20:28:06 +040067 platform_device_register(&autcpu12_nvram_pdev);
68}
69
Linus Torvalds1da177e2005-04-16 15:20:36 -070070MACHINE_START(AUTCPU12, "autronix autcpu12")
Russell Kinge9dea0c2005-07-03 17:38:58 +010071 /* Maintainer: Thomas Gleixner */
Nicolas Pitre6244fa92011-07-05 22:38:11 -040072 .atag_offset = 0x20000,
Alexander Shiyan0d8be812012-11-17 17:57:13 +040073 .nr_irqs = CLPS711X_NR_IRQS,
Alexander Shiyan200daa32012-11-17 17:57:07 +040074 .map_io = clps711x_map_io,
Russell Kinge9dea0c2005-07-03 17:38:58 +010075 .init_irq = clps711x_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 .timer = &clps711x_timer,
Alexander Shiyan200daa32012-11-17 17:57:07 +040077 .init_machine = autcpu12_init,
Alexander Shiyan99f04c82012-11-17 17:57:14 +040078 .handle_irq = clps711x_handle_irq,
Russell King6c000712011-11-05 17:41:52 +000079 .restart = clps711x_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -070080MACHINE_END
81