Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-ep93xx/micro9.c |
| 3 | * |
| 4 | * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH |
| 5 | * Manfred Gruber <manfred.gruber@contec.at> |
| 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 version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/ioport.h> |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/mm.h> |
| 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/sched.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 19 | #include <linux/io.h> |
Hartley Sweeten | 3e7a728 | 2008-12-10 23:39:54 +0100 | [diff] [blame] | 20 | #include <linux/i2c.h> |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 21 | #include <linux/mtd/physmap.h> |
| 22 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 23 | #include <mach/hardware.h> |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 24 | |
| 25 | #include <asm/mach/arch.h> |
| 26 | #include <asm/mach-types.h> |
| 27 | |
| 28 | static struct ep93xx_eth_data micro9_eth_data = { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 29 | .phy_id = 0x1f, |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 30 | }; |
| 31 | |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 32 | static void __init micro9_init(void) |
| 33 | { |
Hartley Sweeten | a0a08fd | 2008-10-04 20:01:49 +0100 | [diff] [blame] | 34 | ep93xx_register_eth(µ9_eth_data, 1); |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | /* |
| 38 | * Micro9-H |
| 39 | */ |
| 40 | #ifdef CONFIG_MACH_MICRO9H |
| 41 | static struct physmap_flash_data micro9h_flash_data = { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 42 | .width = 4, |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | static struct resource micro9h_flash_resource = { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 46 | .start = EP93XX_CS1_PHYS_BASE, |
| 47 | .end = EP93XX_CS1_PHYS_BASE + SZ_64M - 1, |
| 48 | .flags = IORESOURCE_MEM, |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | static struct platform_device micro9h_flash = { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 52 | .name = "physmap-flash", |
| 53 | .id = 0, |
| 54 | .dev = { |
| 55 | .platform_data = µ9h_flash_data, |
| 56 | }, |
| 57 | .num_resources = 1, |
| 58 | .resource = µ9h_flash_resource, |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | static void __init micro9h_init(void) |
| 62 | { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 63 | platform_device_register(µ9h_flash); |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | static void __init micro9h_init_machine(void) |
| 67 | { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 68 | ep93xx_init_devices(); |
| 69 | micro9_init(); |
| 70 | micro9h_init(); |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H") |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 74 | /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */ |
| 75 | .phys_io = EP93XX_APB_PHYS_BASE, |
| 76 | .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, |
| 77 | .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100, |
| 78 | .map_io = ep93xx_map_io, |
| 79 | .init_irq = ep93xx_init_irq, |
| 80 | .timer = &ep93xx_timer, |
| 81 | .init_machine = micro9h_init_machine, |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 82 | MACHINE_END |
| 83 | #endif |
| 84 | |
| 85 | /* |
| 86 | * Micro9-M |
| 87 | */ |
| 88 | #ifdef CONFIG_MACH_MICRO9M |
| 89 | static void __init micro9m_init_machine(void) |
| 90 | { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 91 | ep93xx_init_devices(); |
| 92 | micro9_init(); |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | MACHINE_START(MICRO9M, "Contec Hypercontrol Micro9-M") |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 96 | /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */ |
| 97 | .phys_io = EP93XX_APB_PHYS_BASE, |
| 98 | .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, |
| 99 | .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100, |
| 100 | .map_io = ep93xx_map_io, |
| 101 | .init_irq = ep93xx_init_irq, |
| 102 | .timer = &ep93xx_timer, |
| 103 | .init_machine = micro9m_init_machine, |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 104 | MACHINE_END |
| 105 | #endif |
| 106 | |
| 107 | /* |
| 108 | * Micro9-L |
| 109 | */ |
| 110 | #ifdef CONFIG_MACH_MICRO9L |
| 111 | static void __init micro9l_init_machine(void) |
| 112 | { |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 113 | ep93xx_init_devices(); |
| 114 | micro9_init(); |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | MACHINE_START(MICRO9L, "Contec Hypercontrol Micro9-L") |
Hartley Sweeten | e48f3fa | 2008-12-08 17:57:22 +0100 | [diff] [blame] | 118 | /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */ |
| 119 | .phys_io = EP93XX_APB_PHYS_BASE, |
| 120 | .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, |
| 121 | .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100, |
| 122 | .map_io = ep93xx_map_io, |
| 123 | .init_irq = ep93xx_init_irq, |
| 124 | .timer = &ep93xx_timer, |
| 125 | .init_machine = micro9l_init_machine, |
Manfred Gruber | d941caa | 2006-12-17 22:10:48 +0100 | [diff] [blame] | 126 | MACHINE_END |
| 127 | #endif |
| 128 | |