blob: 5be3f09bac92e3395738267b0f7574c4f6a02e3e [file] [log] [blame]
Ben Dooks431107e2010-01-26 10:11:04 +09001/* linux/arch/arm/mach-s3c64xx/s3c6410.c
Ben Dooksd626aee2008-10-21 14:06:50 +01002 *
3 * Copyright 2008 Simtec Electronics
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
Tomasz Figac836c902013-08-26 02:37:34 +090013/*
14 * NOTE: Code in this file is not used when booting with Device Tree support.
15 */
16
Ben Dooksd626aee2008-10-21 14:06:50 +010017#include <linux/kernel.h>
18#include <linux/types.h>
19#include <linux/interrupt.h>
20#include <linux/list.h>
21#include <linux/timer.h>
22#include <linux/init.h>
23#include <linux/clk.h>
24#include <linux/io.h>
Kay Sievers4a858cf2011-12-21 16:01:38 -080025#include <linux/device.h>
Ben Dooksd626aee2008-10-21 14:06:50 +010026#include <linux/serial_core.h>
Tushar Behera334a1c72014-02-14 10:32:45 +090027#include <linux/serial_s3c.h>
Ben Dooksd626aee2008-10-21 14:06:50 +010028#include <linux/platform_device.h>
Tomasz Figac836c902013-08-26 02:37:34 +090029#include <linux/of.h>
Ben Dooksd626aee2008-10-21 14:06:50 +010030
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33#include <asm/mach/irq.h>
34
35#include <mach/hardware.h>
36#include <asm/irq.h>
37
38#include <plat/cpu-freq.h>
Ben Dooks3501c9a2010-01-26 10:45:40 +090039#include <mach/regs-clock.h>
Ben Dooksd626aee2008-10-21 14:06:50 +010040
41#include <plat/cpu.h>
42#include <plat/devs.h>
43#include <plat/clock.h>
Ben Dooks5cc7fd82008-10-31 16:14:38 +000044#include <plat/sdhci.h>
Abhilash Kesavan0ab0b6d2010-06-08 16:55:45 +090045#include <plat/ata-core.h>
Naveen Krishna Ch50e97692010-06-09 15:25:19 +053046#include <plat/adc-core.h>
Ben Dooks4f507d12008-10-31 16:15:00 +000047#include <plat/iic-core.h>
Marek Szyprowski999304b2010-05-20 08:59:05 +020048#include <plat/onenand-core.h>
Kukjin Kimb024043b2011-12-22 23:27:42 +010049
50#include "common.h"
Ben Dooksd626aee2008-10-21 14:06:50 +010051
Ben Dooksd626aee2008-10-21 14:06:50 +010052void __init s3c6410_map_io(void)
53{
Ben Dooks5cc7fd82008-10-31 16:14:38 +000054 /* initialise device information early */
55 s3c6410_default_sdhci0();
Ben Dooksa2205cd2008-10-31 16:14:39 +000056 s3c6410_default_sdhci1();
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +010057 s3c6410_default_sdhci2();
Ben Dooks4f507d12008-10-31 16:15:00 +000058
59 /* the i2c devices are directly compatible with s3c2440 */
60 s3c_i2c0_setname("s3c2440-i2c");
61 s3c_i2c1_setname("s3c2440-i2c");
Peter Korsgaard14077ea2009-07-01 17:47:06 +020062
Naveen Krishna Ch50e97692010-06-09 15:25:19 +053063 s3c_adc_setname("s3c64xx-adc");
Peter Korsgaard14077ea2009-07-01 17:47:06 +020064 s3c_device_nand.name = "s3c6400-nand";
Marek Szyprowski999304b2010-05-20 08:59:05 +020065 s3c_onenand_setname("s3c6410-onenand");
66 s3c64xx_onenand1_setname("s3c6410-onenand");
Abhilash Kesavan0ab0b6d2010-06-08 16:55:45 +090067 s3c_cfcon_setname("s3c64xx-pata");
Ben Dooksd626aee2008-10-21 14:06:50 +010068}
69
Ben Dooksd9b79fb2008-10-21 14:06:51 +010070void __init s3c6410_init_irq(void)
71{
72 /* VIC0 is missing IRQ7, VIC1 is fully populated. */
73 s3c64xx_init_irq(~0 & ~(1 << 7), ~0);
74}
75
Kay Sievers4a858cf2011-12-21 16:01:38 -080076struct bus_type s3c6410_subsys = {
77 .name = "s3c6410-core",
78 .dev_name = "s3c6410-core",
Ben Dooksd626aee2008-10-21 14:06:50 +010079};
80
Kay Sievers4a858cf2011-12-21 16:01:38 -080081static struct device s3c6410_dev = {
82 .bus = &s3c6410_subsys,
Ben Dooksd626aee2008-10-21 14:06:50 +010083};
84
85static int __init s3c6410_core_init(void)
86{
Tomasz Figac836c902013-08-26 02:37:34 +090087 /* Not applicable when using DT. */
88 if (of_have_populated_dt())
89 return 0;
90
Kay Sievers4a858cf2011-12-21 16:01:38 -080091 return subsys_system_register(&s3c6410_subsys, NULL);
Ben Dooksd626aee2008-10-21 14:06:50 +010092}
93
94core_initcall(s3c6410_core_init);
95
96int __init s3c6410_init(void)
97{
98 printk("S3C6410: Initialising architecture\n");
99
Kay Sievers4a858cf2011-12-21 16:01:38 -0800100 return device_register(&s3c6410_dev);
Ben Dooksd626aee2008-10-21 14:06:50 +0100101}