Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/mach-s5pv210/mach-smdkv210.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> |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 13 | #include <linux/i2c.h> |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 14 | #include <linux/init.h> |
| 15 | #include <linux/serial_core.h> |
| 16 | |
| 17 | #include <asm/mach/arch.h> |
| 18 | #include <asm/mach/map.h> |
| 19 | #include <asm/setup.h> |
| 20 | #include <asm/mach-types.h> |
| 21 | |
| 22 | #include <mach/map.h> |
| 23 | #include <mach/regs-clock.h> |
| 24 | |
| 25 | #include <plat/regs-serial.h> |
| 26 | #include <plat/s5pv210.h> |
| 27 | #include <plat/devs.h> |
| 28 | #include <plat/cpu.h> |
Naveen Krishna Ch | 41d8289 | 2010-05-20 11:39:54 +0900 | [diff] [blame] | 29 | #include <plat/adc.h> |
| 30 | #include <plat/ts.h> |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 31 | #include <plat/ata.h> |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 32 | #include <plat/iic.h> |
Naveen Krishna Ch | 88a1cc4 | 2010-06-21 16:47:16 +0900 | [diff] [blame] | 33 | #include <plat/keypad.h> |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 34 | |
| 35 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 36 | #define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 37 | S3C2410_UCON_RXILEVEL | \ |
| 38 | S3C2410_UCON_TXIRQMODE | \ |
| 39 | S3C2410_UCON_RXIRQMODE | \ |
| 40 | S3C2410_UCON_RXFIFO_TOI | \ |
| 41 | S3C2443_UCON_RXERR_IRQEN) |
| 42 | |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 43 | #define SMDKV210_ULCON_DEFAULT S3C2410_LCON_CS8 |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 44 | |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 45 | #define SMDKV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 46 | S5PV210_UFCON_TXTRIG4 | \ |
| 47 | S5PV210_UFCON_RXTRIG4) |
| 48 | |
| 49 | static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = { |
| 50 | [0] = { |
| 51 | .hwport = 0, |
| 52 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 53 | .ucon = SMDKV210_UCON_DEFAULT, |
| 54 | .ulcon = SMDKV210_ULCON_DEFAULT, |
| 55 | .ufcon = SMDKV210_UFCON_DEFAULT, |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 56 | }, |
| 57 | [1] = { |
| 58 | .hwport = 1, |
| 59 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 60 | .ucon = SMDKV210_UCON_DEFAULT, |
| 61 | .ulcon = SMDKV210_ULCON_DEFAULT, |
| 62 | .ufcon = SMDKV210_UFCON_DEFAULT, |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 63 | }, |
| 64 | [2] = { |
| 65 | .hwport = 2, |
| 66 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 67 | .ucon = SMDKV210_UCON_DEFAULT, |
| 68 | .ulcon = SMDKV210_ULCON_DEFAULT, |
| 69 | .ufcon = SMDKV210_UFCON_DEFAULT, |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 70 | }, |
| 71 | [3] = { |
| 72 | .hwport = 3, |
| 73 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 74 | .ucon = SMDKV210_UCON_DEFAULT, |
| 75 | .ulcon = SMDKV210_ULCON_DEFAULT, |
| 76 | .ufcon = SMDKV210_UFCON_DEFAULT, |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 77 | }, |
| 78 | }; |
| 79 | |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 80 | static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = { |
| 81 | .setup_gpio = s5pv210_ide_setup_gpio, |
| 82 | }; |
| 83 | |
Naveen Krishna Ch | 88a1cc4 | 2010-06-21 16:47:16 +0900 | [diff] [blame] | 84 | static uint32_t smdkv210_keymap[] __initdata = { |
| 85 | /* KEY(row, col, keycode) */ |
| 86 | KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3), |
| 87 | KEY(0, 6, KEY_4), KEY(0, 7, KEY_5), |
| 88 | KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C), |
| 89 | KEY(1, 6, KEY_D), KEY(1, 7, KEY_E) |
| 90 | }; |
| 91 | |
| 92 | static struct matrix_keymap_data smdkv210_keymap_data __initdata = { |
| 93 | .keymap = smdkv210_keymap, |
| 94 | .keymap_size = ARRAY_SIZE(smdkv210_keymap), |
| 95 | }; |
| 96 | |
| 97 | static struct samsung_keypad_platdata smdkv210_keypad_data __initdata = { |
| 98 | .keymap_data = &smdkv210_keymap_data, |
| 99 | .rows = 8, |
| 100 | .cols = 8, |
| 101 | }; |
| 102 | |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 103 | static struct platform_device *smdkv210_devices[] __initdata = { |
Jassi Brar | 9b5f1e0 | 2010-05-18 16:02:30 +0900 | [diff] [blame] | 104 | &s5pv210_device_iis0, |
| 105 | &s5pv210_device_ac97, |
Naveen Krishna Ch | 41d8289 | 2010-05-20 11:39:54 +0900 | [diff] [blame] | 106 | &s3c_device_adc, |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 107 | &s3c_device_cfcon, |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 108 | &s3c_device_hsmmc0, |
| 109 | &s3c_device_hsmmc1, |
| 110 | &s3c_device_hsmmc2, |
| 111 | &s3c_device_hsmmc3, |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 112 | &s3c_device_i2c0, |
| 113 | &s3c_device_i2c1, |
| 114 | &s3c_device_i2c2, |
Naveen Krishna Ch | 88a1cc4 | 2010-06-21 16:47:16 +0900 | [diff] [blame] | 115 | &samsung_device_keypad, |
Atul Dahiya | f580726 | 2010-07-21 17:36:02 +0900 | [diff] [blame] | 116 | &s3c_device_rtc, |
Naveen Krishna Ch | 41d8289 | 2010-05-20 11:39:54 +0900 | [diff] [blame] | 117 | &s3c_device_ts, |
Banajit Goswami | 5b7d7b2 | 2010-05-20 16:21:32 +0900 | [diff] [blame] | 118 | &s3c_device_wdt, |
Naveen Krishna Ch | 41d8289 | 2010-05-20 11:39:54 +0900 | [diff] [blame] | 119 | }; |
| 120 | |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 121 | static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = { |
| 122 | { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ |
| 123 | }; |
| 124 | |
| 125 | static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = { |
| 126 | /* To Be Updated */ |
| 127 | }; |
| 128 | |
| 129 | static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = { |
| 130 | /* To Be Updated */ |
| 131 | }; |
| 132 | |
Naveen Krishna Ch | 41d8289 | 2010-05-20 11:39:54 +0900 | [diff] [blame] | 133 | static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { |
| 134 | .delay = 10000, |
| 135 | .presc = 49, |
| 136 | .oversampling_shift = 2, |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 137 | }; |
| 138 | |
| 139 | static void __init smdkv210_map_io(void) |
| 140 | { |
| 141 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); |
| 142 | s3c24xx_init_clocks(24000000); |
| 143 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); |
| 144 | } |
| 145 | |
| 146 | static void __init smdkv210_machine_init(void) |
| 147 | { |
Naveen Krishna Ch | 88a1cc4 | 2010-06-21 16:47:16 +0900 | [diff] [blame] | 148 | samsung_keypad_set_platdata(&smdkv210_keypad_data); |
Naveen Krishna Ch | 41d8289 | 2010-05-20 11:39:54 +0900 | [diff] [blame] | 149 | s3c24xx_ts_set_platdata(&s3c_ts_platform); |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 150 | |
| 151 | s3c_i2c0_set_platdata(NULL); |
| 152 | s3c_i2c1_set_platdata(NULL); |
| 153 | s3c_i2c2_set_platdata(NULL); |
| 154 | i2c_register_board_info(0, smdkv210_i2c_devs0, |
| 155 | ARRAY_SIZE(smdkv210_i2c_devs0)); |
| 156 | i2c_register_board_info(1, smdkv210_i2c_devs1, |
| 157 | ARRAY_SIZE(smdkv210_i2c_devs1)); |
| 158 | i2c_register_board_info(2, smdkv210_i2c_devs2, |
| 159 | ARRAY_SIZE(smdkv210_i2c_devs2)); |
| 160 | |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 161 | s3c_ide_set_platdata(&smdkv210_ide_pdata); |
| 162 | |
Kukjin Kim | 9817441 | 2010-02-24 16:40:49 +0900 | [diff] [blame] | 163 | platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); |
| 164 | } |
| 165 | |
| 166 | MACHINE_START(SMDKV210, "SMDKV210") |
| 167 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
| 168 | .phys_io = S3C_PA_UART & 0xfff00000, |
| 169 | .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, |
| 170 | .boot_params = S5P_PA_SDRAM + 0x100, |
| 171 | .init_irq = s5pv210_init_irq, |
| 172 | .map_io = smdkv210_map_io, |
| 173 | .init_machine = smdkv210_machine_init, |
| 174 | .timer = &s3c24xx_timer, |
| 175 | MACHINE_END |