Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/mach-s5pv210/mach-smdkc110.c |
| 2 | * |
| 3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com/ |
| 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 | #include <linux/kernel.h> |
| 12 | #include <linux/types.h> |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/serial_core.h> |
Tushar Behera | 334a1c7 | 2014-02-14 10:32:45 +0900 | [diff] [blame] | 15 | #include <linux/serial_s3c.h> |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 16 | #include <linux/i2c.h> |
Kay Sievers | edbaa60 | 2011-12-21 16:26:03 -0800 | [diff] [blame] | 17 | #include <linux/device.h> |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 18 | |
| 19 | #include <asm/mach/arch.h> |
| 20 | #include <asm/mach/map.h> |
| 21 | #include <asm/setup.h> |
| 22 | #include <asm/mach-types.h> |
| 23 | |
| 24 | #include <mach/map.h> |
| 25 | #include <mach/regs-clock.h> |
| 26 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 27 | #include <plat/devs.h> |
| 28 | #include <plat/cpu.h> |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 29 | #include <linux/platform_data/ata-samsung_cf.h> |
| 30 | #include <linux/platform_data/i2c-s3c2410.h> |
Jongpill Lee | ea31fd4 | 2010-10-02 19:13:42 +0900 | [diff] [blame] | 31 | #include <plat/pm.h> |
Romain Naour | c1fcd40 | 2013-01-09 18:47:03 -0800 | [diff] [blame] | 32 | #include <plat/samsung-time.h> |
Sachin Kamat | 6ff5d25 | 2012-03-09 07:00:35 -0800 | [diff] [blame] | 33 | #include <plat/mfc.h> |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 34 | |
Kukjin Kim | 3fa754c | 2011-12-22 23:32:07 +0100 | [diff] [blame] | 35 | #include "common.h" |
| 36 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 37 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 38 | #define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 39 | S3C2410_UCON_RXILEVEL | \ |
| 40 | S3C2410_UCON_TXIRQMODE | \ |
| 41 | S3C2410_UCON_RXIRQMODE | \ |
| 42 | S3C2410_UCON_RXFIFO_TOI | \ |
| 43 | S3C2443_UCON_RXERR_IRQEN) |
| 44 | |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 45 | #define SMDKC110_ULCON_DEFAULT S3C2410_LCON_CS8 |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 46 | |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 47 | #define SMDKC110_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 48 | S5PV210_UFCON_TXTRIG4 | \ |
| 49 | S5PV210_UFCON_RXTRIG4) |
| 50 | |
| 51 | static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = { |
| 52 | [0] = { |
| 53 | .hwport = 0, |
| 54 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 55 | .ucon = SMDKC110_UCON_DEFAULT, |
| 56 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 57 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 58 | }, |
| 59 | [1] = { |
| 60 | .hwport = 1, |
| 61 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 62 | .ucon = SMDKC110_UCON_DEFAULT, |
| 63 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 64 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 65 | }, |
| 66 | [2] = { |
| 67 | .hwport = 2, |
| 68 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 69 | .ucon = SMDKC110_UCON_DEFAULT, |
| 70 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 71 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 72 | }, |
| 73 | [3] = { |
| 74 | .hwport = 3, |
| 75 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 76 | .ucon = SMDKC110_UCON_DEFAULT, |
| 77 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 78 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 79 | }, |
| 80 | }; |
| 81 | |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 82 | static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = { |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 83 | .setup_gpio = s5pv210_ide_setup_gpio, |
| 84 | }; |
| 85 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 86 | static struct platform_device *smdkc110_devices[] __initdata = { |
Jassi Brar | 95fa6e6 | 2010-05-18 16:02:35 +0900 | [diff] [blame] | 87 | &s5pv210_device_iis0, |
| 88 | &s5pv210_device_ac97, |
Seungwhan Youn | 494edad | 2010-10-14 10:35:24 +0900 | [diff] [blame] | 89 | &s5pv210_device_spdif, |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 90 | &s3c_device_cfcon, |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 91 | &s3c_device_i2c0, |
| 92 | &s3c_device_i2c1, |
| 93 | &s3c_device_i2c2, |
Atul Dahiya | f580726 | 2010-07-21 17:36:02 +0900 | [diff] [blame] | 94 | &s3c_device_rtc, |
Banajit Goswami | 5b7d7b2 | 2010-05-20 16:21:32 +0900 | [diff] [blame] | 95 | &s3c_device_wdt, |
Sachin Kamat | 4106589 | 2012-03-09 07:00:44 -0800 | [diff] [blame] | 96 | &s5p_device_fimc0, |
| 97 | &s5p_device_fimc1, |
| 98 | &s5p_device_fimc2, |
| 99 | &s5p_device_fimc_md, |
Sachin Kamat | 6ff5d25 | 2012-03-09 07:00:35 -0800 | [diff] [blame] | 100 | &s5p_device_mfc, |
| 101 | &s5p_device_mfc_l, |
| 102 | &s5p_device_mfc_r, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 103 | }; |
| 104 | |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 105 | static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = { |
| 106 | { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ |
Jassi Brar | 0031e9d | 2010-12-21 09:48:35 +0900 | [diff] [blame] | 107 | { I2C_BOARD_INFO("wm8580", 0x1b), }, |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 108 | }; |
| 109 | |
| 110 | static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = { |
| 111 | /* To Be Updated */ |
| 112 | }; |
| 113 | |
| 114 | static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = { |
| 115 | /* To Be Updated */ |
| 116 | }; |
| 117 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 118 | static void __init smdkc110_map_io(void) |
| 119 | { |
Kukjin Kim | 3fa754c | 2011-12-22 23:32:07 +0100 | [diff] [blame] | 120 | s5pv210_init_io(NULL, 0); |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 121 | s3c24xx_init_clocks(24000000); |
| 122 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); |
Romain Naour | c1fcd40 | 2013-01-09 18:47:03 -0800 | [diff] [blame] | 123 | samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 124 | } |
| 125 | |
Sachin Kamat | 6ff5d25 | 2012-03-09 07:00:35 -0800 | [diff] [blame] | 126 | static void __init smdkc110_reserve(void) |
| 127 | { |
| 128 | s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); |
| 129 | } |
| 130 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 131 | static void __init smdkc110_machine_init(void) |
| 132 | { |
Jongpill Lee | ea31fd4 | 2010-10-02 19:13:42 +0900 | [diff] [blame] | 133 | s3c_pm_init(); |
| 134 | |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 135 | s3c_i2c0_set_platdata(NULL); |
| 136 | s3c_i2c1_set_platdata(NULL); |
| 137 | s3c_i2c2_set_platdata(NULL); |
| 138 | i2c_register_board_info(0, smdkc110_i2c_devs0, |
| 139 | ARRAY_SIZE(smdkc110_i2c_devs0)); |
| 140 | i2c_register_board_info(1, smdkc110_i2c_devs1, |
| 141 | ARRAY_SIZE(smdkc110_i2c_devs1)); |
| 142 | i2c_register_board_info(2, smdkc110_i2c_devs2, |
| 143 | ARRAY_SIZE(smdkc110_i2c_devs2)); |
| 144 | |
| 145 | s3c_ide_set_platdata(&smdkc110_ide_pdata); |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 146 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 147 | platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices)); |
| 148 | } |
| 149 | |
| 150 | MACHINE_START(SMDKC110, "SMDKC110") |
| 151 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
Nicolas Pitre | 02350a1 | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 152 | .atag_offset = 0x100, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 153 | .init_irq = s5pv210_init_irq, |
| 154 | .map_io = smdkc110_map_io, |
| 155 | .init_machine = smdkc110_machine_init, |
Romain Naour | c1fcd40 | 2013-01-09 18:47:03 -0800 | [diff] [blame] | 156 | .init_time = samsung_timer_init, |
Russell King | 1f34f0e | 2011-12-22 23:36:02 +0100 | [diff] [blame] | 157 | .restart = s5pv210_restart, |
Sachin Kamat | 6ff5d25 | 2012-03-09 07:00:35 -0800 | [diff] [blame] | 158 | .reserve = &smdkc110_reserve, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 159 | MACHINE_END |