Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 1 | /* |
Ben Dooks | 431107e | 2010-01-26 10:11:04 +0900 | [diff] [blame] | 2 | * linux/arch/arm/mach-s3c64xx/mach-ncp.c |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2008-2009 Samsung Electronics |
| 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 | */ |
| 11 | |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/types.h> |
| 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/list.h> |
| 16 | #include <linux/timer.h> |
| 17 | #include <linux/init.h> |
| 18 | #include <linux/serial_core.h> |
Tushar Behera | 334a1c7 | 2014-02-14 10:32:45 +0900 | [diff] [blame] | 19 | #include <linux/serial_s3c.h> |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 20 | #include <linux/platform_device.h> |
| 21 | #include <linux/io.h> |
| 22 | #include <linux/i2c.h> |
| 23 | #include <linux/fb.h> |
| 24 | #include <linux/gpio.h> |
| 25 | #include <linux/delay.h> |
| 26 | |
| 27 | #include <video/platform_lcd.h> |
Leela Krishna Amudala | 5a213a5 | 2012-08-08 09:44:49 +0900 | [diff] [blame] | 28 | #include <video/samsung_fimd.h> |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 29 | |
| 30 | #include <asm/mach/arch.h> |
| 31 | #include <asm/mach/map.h> |
| 32 | #include <asm/mach/irq.h> |
| 33 | |
| 34 | #include <mach/hardware.h> |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 35 | #include <mach/map.h> |
| 36 | |
| 37 | #include <asm/irq.h> |
| 38 | #include <asm/mach-types.h> |
| 39 | |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 40 | #include <linux/platform_data/i2c-s3c2410.h> |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 41 | #include <plat/fb.h> |
| 42 | |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 43 | #include <plat/devs.h> |
| 44 | #include <plat/cpu.h> |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 45 | #include <plat/samsung-time.h> |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 46 | |
Kukjin Kim | b024043b | 2011-12-22 23:27:42 +0100 | [diff] [blame] | 47 | #include "common.h" |
| 48 | |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 49 | #define UCON S3C2410_UCON_DEFAULT |
| 50 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE |
| 51 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
| 52 | |
| 53 | static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = { |
| 54 | /* REVISIT: NCP uses only serial 1, 2 */ |
| 55 | [0] = { |
| 56 | .hwport = 0, |
| 57 | .flags = 0, |
| 58 | .ucon = UCON, |
| 59 | .ulcon = ULCON, |
| 60 | .ufcon = UFCON, |
| 61 | }, |
| 62 | [1] = { |
| 63 | .hwport = 1, |
| 64 | .flags = 0, |
| 65 | .ucon = UCON, |
| 66 | .ulcon = ULCON, |
| 67 | .ufcon = UFCON, |
| 68 | }, |
| 69 | [2] = { |
| 70 | .hwport = 2, |
| 71 | .flags = 0, |
| 72 | .ucon = UCON, |
| 73 | .ulcon = ULCON, |
| 74 | .ufcon = UFCON, |
| 75 | }, |
| 76 | }; |
| 77 | |
| 78 | static struct platform_device *ncp_devices[] __initdata = { |
| 79 | &s3c_device_hsmmc1, |
| 80 | &s3c_device_i2c0, |
| 81 | }; |
| 82 | |
Marek Szyprowski | 4d4e2bc | 2009-06-24 08:05:43 +0200 | [diff] [blame] | 83 | static struct map_desc ncp_iodesc[] __initdata = {}; |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 84 | |
| 85 | static void __init ncp_map_io(void) |
| 86 | { |
| 87 | s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc)); |
Tomasz Figa | b69f460 | 2013-08-26 02:00:38 +0900 | [diff] [blame] | 88 | s3c64xx_set_xtal_freq(12000000); |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 89 | s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs)); |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 90 | samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | static void __init ncp_machine_init(void) |
| 94 | { |
| 95 | s3c_i2c0_set_platdata(NULL); |
| 96 | |
| 97 | platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices)); |
| 98 | } |
| 99 | |
| 100 | MACHINE_START(NCP, "NCP") |
| 101 | /* Maintainer: Samsung Electronics */ |
Nicolas Pitre | 170a590 | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 102 | .atag_offset = 0x100, |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 103 | .init_irq = s3c6410_init_irq, |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 104 | .map_io = ncp_map_io, |
| 105 | .init_machine = ncp_machine_init, |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 106 | .init_time = samsung_timer_init, |
Kukjin Kim | ff84ded | 2012-01-03 14:03:30 +0100 | [diff] [blame] | 107 | .restart = s3c64xx_restart, |
Kyungmin Park | 87c4122f | 2009-03-11 11:05:55 +0900 | [diff] [blame] | 108 | MACHINE_END |