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> |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 15 | #include <linux/i2c.h> |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 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> |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 29 | #include <plat/ata.h> |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 30 | #include <plat/iic.h> |
Jongpill Lee | ea31fd4 | 2010-10-02 19:13:42 +0900 | [diff] [blame] | 31 | #include <plat/pm.h> |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 32 | |
| 33 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 34 | #define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 35 | S3C2410_UCON_RXILEVEL | \ |
| 36 | S3C2410_UCON_TXIRQMODE | \ |
| 37 | S3C2410_UCON_RXIRQMODE | \ |
| 38 | S3C2410_UCON_RXFIFO_TOI | \ |
| 39 | S3C2443_UCON_RXERR_IRQEN) |
| 40 | |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 41 | #define SMDKC110_ULCON_DEFAULT S3C2410_LCON_CS8 |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 42 | |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 43 | #define SMDKC110_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 44 | S5PV210_UFCON_TXTRIG4 | \ |
| 45 | S5PV210_UFCON_RXTRIG4) |
| 46 | |
| 47 | static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = { |
| 48 | [0] = { |
| 49 | .hwport = 0, |
| 50 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 51 | .ucon = SMDKC110_UCON_DEFAULT, |
| 52 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 53 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 54 | }, |
| 55 | [1] = { |
| 56 | .hwport = 1, |
| 57 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 58 | .ucon = SMDKC110_UCON_DEFAULT, |
| 59 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 60 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 61 | }, |
| 62 | [2] = { |
| 63 | .hwport = 2, |
| 64 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 65 | .ucon = SMDKC110_UCON_DEFAULT, |
| 66 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 67 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 68 | }, |
| 69 | [3] = { |
| 70 | .hwport = 3, |
| 71 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 72 | .ucon = SMDKC110_UCON_DEFAULT, |
| 73 | .ulcon = SMDKC110_ULCON_DEFAULT, |
| 74 | .ufcon = SMDKC110_UFCON_DEFAULT, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 75 | }, |
| 76 | }; |
| 77 | |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 78 | static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = { |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 79 | .setup_gpio = s5pv210_ide_setup_gpio, |
| 80 | }; |
| 81 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 82 | static struct platform_device *smdkc110_devices[] __initdata = { |
Jassi Brar | 95fa6e6 | 2010-05-18 16:02:35 +0900 | [diff] [blame] | 83 | &s5pv210_device_iis0, |
| 84 | &s5pv210_device_ac97, |
Seungwhan Youn | 494edad | 2010-10-14 10:35:24 +0900 | [diff] [blame] | 85 | &s5pv210_device_spdif, |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 86 | &s3c_device_cfcon, |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 87 | &s3c_device_i2c0, |
| 88 | &s3c_device_i2c1, |
| 89 | &s3c_device_i2c2, |
Atul Dahiya | f580726 | 2010-07-21 17:36:02 +0900 | [diff] [blame] | 90 | &s3c_device_rtc, |
Banajit Goswami | 5b7d7b2 | 2010-05-20 16:21:32 +0900 | [diff] [blame] | 91 | &s3c_device_wdt, |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 92 | }; |
| 93 | |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 94 | static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = { |
| 95 | { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ |
| 96 | }; |
| 97 | |
| 98 | static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = { |
| 99 | /* To Be Updated */ |
| 100 | }; |
| 101 | |
| 102 | static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = { |
| 103 | /* To Be Updated */ |
| 104 | }; |
| 105 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 106 | static void __init smdkc110_map_io(void) |
| 107 | { |
| 108 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); |
| 109 | s3c24xx_init_clocks(24000000); |
| 110 | s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); |
| 111 | } |
| 112 | |
| 113 | static void __init smdkc110_machine_init(void) |
| 114 | { |
Jongpill Lee | ea31fd4 | 2010-10-02 19:13:42 +0900 | [diff] [blame] | 115 | s3c_pm_init(); |
| 116 | |
Naveen Krishna Ch | 170d741 | 2010-07-21 09:21:56 +0530 | [diff] [blame] | 117 | s3c_i2c0_set_platdata(NULL); |
| 118 | s3c_i2c1_set_platdata(NULL); |
| 119 | s3c_i2c2_set_platdata(NULL); |
| 120 | i2c_register_board_info(0, smdkc110_i2c_devs0, |
| 121 | ARRAY_SIZE(smdkc110_i2c_devs0)); |
| 122 | i2c_register_board_info(1, smdkc110_i2c_devs1, |
| 123 | ARRAY_SIZE(smdkc110_i2c_devs1)); |
| 124 | i2c_register_board_info(2, smdkc110_i2c_devs2, |
| 125 | ARRAY_SIZE(smdkc110_i2c_devs2)); |
| 126 | |
| 127 | s3c_ide_set_platdata(&smdkc110_ide_pdata); |
Abhilash Kesavan | 4b9a5ad | 2010-06-08 17:11:43 +0900 | [diff] [blame] | 128 | |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 129 | platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices)); |
| 130 | } |
| 131 | |
| 132 | MACHINE_START(SMDKC110, "SMDKC110") |
| 133 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
Kukjin Kim | d515ec33 | 2010-02-24 16:40:53 +0900 | [diff] [blame] | 134 | .boot_params = S5P_PA_SDRAM + 0x100, |
| 135 | .init_irq = s5pv210_init_irq, |
| 136 | .map_io = smdkc110_map_io, |
| 137 | .init_machine = smdkc110_machine_init, |
| 138 | .timer = &s3c24xx_timer, |
| 139 | MACHINE_END |