Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 25 | #include <linux/io.h> |
Alexander Shiyan | ce55754 | 2012-08-15 20:28:06 +0400 | [diff] [blame] | 26 | #include <linux/ioport.h> |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 27 | #include <linux/interrupt.h> |
Alexander Shiyan | ce55754 | 2012-08-15 20:28:06 +0400 | [diff] [blame] | 28 | #include <linux/platform_device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 30 | #include <mach/hardware.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #include <asm/sizes.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #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 King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 39 | #include <mach/autcpu12.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
| 41 | #include "common.h" |
| 42 | |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 43 | #define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300) |
| 44 | #define AUTCPU12_CS8900_IRQ (IRQ_EINT3) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 46 | static struct resource autcpu12_cs8900_resource[] __initdata = { |
| 47 | DEFINE_RES_MEM(AUTCPU12_CS8900_BASE, SZ_1K), |
| 48 | DEFINE_RES_IRQ(AUTCPU12_CS8900_IRQ), |
| 49 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Alexander Shiyan | ce55754 | 2012-08-15 20:28:06 +0400 | [diff] [blame] | 51 | static struct resource autcpu12_nvram_resource[] __initdata = { |
| 52 | DEFINE_RES_MEM_NAMED(AUTCPU12_PHYS_NVRAM, SZ_128K, "SRAM"), |
| 53 | }; |
| 54 | |
| 55 | static 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 | |
| 62 | static void __init autcpu12_init(void) |
| 63 | { |
Alexander Shiyan | dd850f1 | 2012-11-17 17:57:09 +0400 | [diff] [blame] | 64 | platform_device_register_simple("video-clps711x", 0, NULL, 0); |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 65 | platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, |
| 66 | ARRAY_SIZE(autcpu12_cs8900_resource)); |
Alexander Shiyan | ce55754 | 2012-08-15 20:28:06 +0400 | [diff] [blame] | 67 | platform_device_register(&autcpu12_nvram_pdev); |
| 68 | } |
| 69 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | MACHINE_START(AUTCPU12, "autronix autcpu12") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 71 | /* Maintainer: Thomas Gleixner */ |
Nicolas Pitre | 6244fa9 | 2011-07-05 22:38:11 -0400 | [diff] [blame] | 72 | .atag_offset = 0x20000, |
Alexander Shiyan | 0d8be81 | 2012-11-17 17:57:13 +0400 | [diff] [blame] | 73 | .nr_irqs = CLPS711X_NR_IRQS, |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 74 | .map_io = clps711x_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 75 | .init_irq = clps711x_init_irq, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | .timer = &clps711x_timer, |
Alexander Shiyan | 200daa3 | 2012-11-17 17:57:07 +0400 | [diff] [blame] | 77 | .init_machine = autcpu12_init, |
Alexander Shiyan | 99f04c8 | 2012-11-17 17:57:14 +0400 | [diff] [blame^] | 78 | .handle_irq = clps711x_handle_irq, |
Russell King | 6c00071 | 2011-11-05 17:41:52 +0000 | [diff] [blame] | 79 | .restart = clps711x_restart, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | MACHINE_END |
| 81 | |