Ben Dooks | 431107e | 2010-01-26 10:11:04 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/mach-s3c64xx/mach-smdk6400.c |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 2 | * |
| 3 | * Copyright 2008 Simtec Electronics |
| 4 | * Ben Dooks <ben@simtec.co.uk> |
| 5 | * http://armlinux.simtec.co.uk/ |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 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> |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 20 | #include <linux/platform_device.h> |
| 21 | #include <linux/i2c.h> |
| 22 | #include <linux/io.h> |
| 23 | |
| 24 | #include <asm/mach-types.h> |
| 25 | |
| 26 | #include <asm/mach/arch.h> |
| 27 | #include <asm/mach/map.h> |
| 28 | #include <asm/mach/irq.h> |
| 29 | |
| 30 | #include <mach/hardware.h> |
| 31 | #include <mach/map.h> |
| 32 | |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 33 | #include <plat/devs.h> |
| 34 | #include <plat/cpu.h> |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 35 | #include <linux/platform_data/i2c-s3c2410.h> |
Linus Walleij | b0161ca | 2014-01-14 14:24:24 +0100 | [diff] [blame] | 36 | #include <mach/gpio-samsung.h> |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 37 | #include <plat/samsung-time.h> |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 38 | |
Kukjin Kim | b024043b | 2011-12-22 23:27:42 +0100 | [diff] [blame] | 39 | #include "common.h" |
| 40 | |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 41 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK |
| 42 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
| 43 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
| 44 | |
| 45 | static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = { |
| 46 | [0] = { |
| 47 | .hwport = 0, |
| 48 | .flags = 0, |
| 49 | .ucon = 0x3c5, |
| 50 | .ulcon = 0x03, |
| 51 | .ufcon = 0x51, |
| 52 | }, |
| 53 | [1] = { |
| 54 | .hwport = 1, |
| 55 | .flags = 0, |
| 56 | .ucon = 0x3c5, |
| 57 | .ulcon = 0x03, |
| 58 | .ufcon = 0x51, |
| 59 | }, |
| 60 | }; |
| 61 | |
| 62 | static struct map_desc smdk6400_iodesc[] = {}; |
| 63 | |
| 64 | static void __init smdk6400_map_io(void) |
| 65 | { |
| 66 | s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc)); |
Tomasz Figa | b69f460 | 2013-08-26 02:00:38 +0900 | [diff] [blame] | 67 | s3c64xx_set_xtal_freq(12000000); |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 68 | s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs)); |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 69 | samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | static struct platform_device *smdk6400_devices[] __initdata = { |
| 73 | &s3c_device_hsmmc1, |
| 74 | &s3c_device_i2c0, |
| 75 | }; |
| 76 | |
| 77 | static struct i2c_board_info i2c_devs[] __initdata = { |
Ben Dooks | 19e3f48 | 2009-04-23 17:26:15 +0100 | [diff] [blame] | 78 | { I2C_BOARD_INFO("wm8753", 0x1A), }, |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 79 | { I2C_BOARD_INFO("24c08", 0x50), }, |
| 80 | }; |
| 81 | |
| 82 | static void __init smdk6400_machine_init(void) |
| 83 | { |
| 84 | i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs)); |
| 85 | platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices)); |
| 86 | } |
| 87 | |
| 88 | MACHINE_START(SMDK6400, "SMDK6400") |
Ben Dooks | afdd225 | 2010-05-07 09:24:05 +0900 | [diff] [blame] | 89 | /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ |
Nicolas Pitre | 170a590 | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 90 | .atag_offset = 0x100, |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 91 | |
| 92 | .init_irq = s3c6400_init_irq, |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 93 | .map_io = smdk6400_map_io, |
| 94 | .init_machine = smdk6400_machine_init, |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 95 | .init_time = samsung_timer_init, |
Kukjin Kim | ff84ded | 2012-01-03 14:03:30 +0100 | [diff] [blame] | 96 | .restart = s3c64xx_restart, |
Ben Dooks | 2ab408e | 2009-03-24 16:09:06 +0000 | [diff] [blame] | 97 | MACHINE_END |