Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 1 | /* linux/arch/arm/mach-msm/board-halibut.c |
| 2 | * |
| 3 | * Copyright (C) 2007 Google, Inc. |
| 4 | * Author: Brian Swetland <swetland@google.com> |
| 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 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 | */ |
| 16 | |
| 17 | #include <linux/kernel.h> |
| 18 | #include <linux/init.h> |
| 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/input.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 21 | #include <linux/io.h> |
| 22 | #include <linux/delay.h> |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 23 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 24 | #include <mach/hardware.h> |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 25 | #include <asm/mach-types.h> |
| 26 | #include <asm/mach/arch.h> |
| 27 | #include <asm/mach/map.h> |
| 28 | #include <asm/mach/flash.h> |
Arve Hjønnevåg | 6bd631e | 2008-10-29 21:45:46 -0700 | [diff] [blame] | 29 | #include <asm/setup.h> |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 30 | |
Russell King | 9ce8bb5 | 2009-01-27 22:44:12 +0000 | [diff] [blame] | 31 | #include <mach/irqs.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 32 | #include <mach/msm_iomap.h> |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 33 | |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 34 | #include <linux/mtd/nand.h> |
| 35 | #include <linux/mtd/partitions.h> |
| 36 | |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 37 | #include "devices.h" |
Stephen Boyd | 4312a7e | 2012-09-05 12:28:52 -0700 | [diff] [blame] | 38 | #include "common.h" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 39 | |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 40 | static struct resource smc91x_resources[] = { |
| 41 | [0] = { |
| 42 | .start = 0x9C004300, |
| 43 | .end = 0x9C004400, |
| 44 | .flags = IORESOURCE_MEM, |
| 45 | }, |
| 46 | [1] = { |
| 47 | .start = MSM_GPIO_TO_INT(49), |
| 48 | .end = MSM_GPIO_TO_INT(49), |
| 49 | .flags = IORESOURCE_IRQ, |
| 50 | }, |
| 51 | }; |
| 52 | |
| 53 | static struct platform_device smc91x_device = { |
| 54 | .name = "smc91x", |
| 55 | .id = 0, |
| 56 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 57 | .resource = smc91x_resources, |
| 58 | }; |
| 59 | |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 60 | static struct platform_device *devices[] __initdata = { |
Stephen Boyd | 421faca | 2013-06-17 10:43:18 -0700 | [diff] [blame] | 61 | &msm_clock_7x01a, |
Stephen Boyd | 7bce696 | 2013-03-04 15:08:27 -0800 | [diff] [blame] | 62 | &msm_device_gpio_7201, |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 63 | &msm_device_uart3, |
| 64 | &msm_device_smd, |
| 65 | &msm_device_nand, |
| 66 | &msm_device_hsusb, |
| 67 | &msm_device_i2c, |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 68 | &smc91x_device, |
| 69 | }; |
| 70 | |
Rob Herring | b12e9ba | 2012-02-13 13:27:24 -0600 | [diff] [blame] | 71 | static void __init halibut_init_early(void) |
| 72 | { |
| 73 | arch_ioremap_caller = __msm_ioremap_caller; |
| 74 | } |
| 75 | |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 76 | static void __init halibut_init_irq(void) |
| 77 | { |
| 78 | msm_init_irq(); |
| 79 | } |
| 80 | |
| 81 | static void __init halibut_init(void) |
| 82 | { |
| 83 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | static void __init halibut_map_io(void) |
| 87 | { |
| 88 | msm_map_common_io(); |
| 89 | } |
| 90 | |
Shawn Guo | c633c53 | 2012-05-02 15:53:20 +0800 | [diff] [blame] | 91 | static void __init halibut_init_late(void) |
| 92 | { |
| 93 | smd_debugfs_init(); |
| 94 | } |
| 95 | |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 96 | MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)") |
Nicolas Pitre | f631dd4 | 2011-07-05 22:38:14 -0400 | [diff] [blame] | 97 | .atag_offset = 0x100, |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 98 | .map_io = halibut_map_io, |
Rob Herring | b12e9ba | 2012-02-13 13:27:24 -0600 | [diff] [blame] | 99 | .init_early = halibut_init_early, |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 100 | .init_irq = halibut_init_irq, |
| 101 | .init_machine = halibut_init, |
Shawn Guo | c633c53 | 2012-05-02 15:53:20 +0800 | [diff] [blame] | 102 | .init_late = halibut_init_late, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 103 | .init_time = msm7x01_timer_init, |
Brian Swetland | 9e73c84 | 2007-11-26 04:12:13 -0800 | [diff] [blame] | 104 | MACHINE_END |