Alessandro Rubini | 28ad94e | 2009-07-02 19:06:47 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * linux/arch/arm/mach-nomadik/board-8815nhk.c |
| 3 | * |
| 4 | * Copyright (C) STMicroelectronics |
| 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 | * NHK15 board specifc driver definition |
| 11 | */ |
| 12 | #include <linux/types.h> |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/amba/bus.h> |
| 17 | #include <asm/mach-types.h> |
| 18 | #include <asm/mach/arch.h> |
| 19 | #include <asm/mach/irq.h> |
| 20 | #include <mach/setup.h> |
| 21 | #include "clock.h" |
| 22 | |
| 23 | #define __MEM_4K_RESOURCE(x) \ |
| 24 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} |
| 25 | |
| 26 | static struct amba_device uart0_device = { |
| 27 | .dev = { .init_name = "uart0" }, |
| 28 | __MEM_4K_RESOURCE(NOMADIK_UART0_BASE), |
| 29 | .irq = {IRQ_UART0, NO_IRQ}, |
| 30 | }; |
| 31 | |
| 32 | static struct amba_device uart1_device = { |
| 33 | .dev = { .init_name = "uart1" }, |
| 34 | __MEM_4K_RESOURCE(NOMADIK_UART1_BASE), |
| 35 | .irq = {IRQ_UART1, NO_IRQ}, |
| 36 | }; |
| 37 | |
| 38 | static struct amba_device *amba_devs[] __initdata = { |
| 39 | &uart0_device, |
| 40 | &uart1_device, |
| 41 | }; |
| 42 | |
| 43 | /* We have a fixed clock alone, by now */ |
| 44 | static struct clk nhk8815_clk_48 = { |
| 45 | .rate = 48*1000*1000, |
| 46 | }; |
| 47 | |
| 48 | static struct platform_device *nhk8815_platform_devices[] __initdata = { |
| 49 | /* currently empty, will add keypad, touchscreen etc */ |
| 50 | }; |
| 51 | |
| 52 | static void __init nhk8815_platform_init(void) |
| 53 | { |
| 54 | int i; |
| 55 | |
| 56 | cpu8815_platform_init(); |
| 57 | platform_add_devices(nhk8815_platform_devices, |
| 58 | ARRAY_SIZE(nhk8815_platform_devices)); |
| 59 | |
| 60 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| 61 | nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name); |
| 62 | amba_device_register(amba_devs[i], &iomem_resource); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | MACHINE_START(NOMADIK, "NHK8815") |
| 67 | /* Maintainer: ST MicroElectronics */ |
| 68 | .phys_io = NOMADIK_UART0_BASE, |
| 69 | .io_pg_offst = (IO_ADDRESS(NOMADIK_UART0_BASE) >> 18) & 0xfffc, |
| 70 | .boot_params = 0x100, |
| 71 | .map_io = cpu8815_map_io, |
| 72 | .init_irq = cpu8815_init_irq, |
| 73 | .timer = &nomadik_timer, |
| 74 | .init_machine = nhk8815_platform_init, |
| 75 | MACHINE_END |