blob: 92bb927c4478c3301a358e3da63470881388ec62 [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>
Ben Dooks5cc7fd82008-10-31 16:14:38 +000043#include <plat/sdhci.h>
Naveen Krishna Ch50e97692010-06-09 15:25:19 +053044#include <plat/adc-core.h>
Ben Dooks4f507d12008-10-31 16:15:00 +000045#include <plat/iic-core.h>
Kukjin Kimb024043b2011-12-22 23:27:42 +010046
Kukjin Kime979b1a2015-07-30 02:00:36 +090047#include "ata-core.h"
Kukjin Kimb024043b2011-12-22 23:27:42 +010048#include "common.h"
Kukjin Kimfe31d042015-07-30 02:00:47 +090049#include "onenand-core.h"
Ben Dooksd626aee2008-10-21 14:06:50 +010050
Ben Dooksd626aee2008-10-21 14:06:50 +010051void __init s3c6410_map_io(void)
52{
Ben Dooks5cc7fd82008-10-31 16:14:38 +000053 /* initialise device information early */
54 s3c6410_default_sdhci0();
Ben Dooksa2205cd2008-10-31 16:14:39 +000055 s3c6410_default_sdhci1();
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +010056 s3c6410_default_sdhci2();
Ben Dooks4f507d12008-10-31 16:15:00 +000057
58 /* the i2c devices are directly compatible with s3c2440 */
59 s3c_i2c0_setname("s3c2440-i2c");
60 s3c_i2c1_setname("s3c2440-i2c");
Peter Korsgaard14077ea2009-07-01 17:47:06 +020061
Naveen Krishna Ch50e97692010-06-09 15:25:19 +053062 s3c_adc_setname("s3c64xx-adc");
Peter Korsgaard14077ea2009-07-01 17:47:06 +020063 s3c_device_nand.name = "s3c6400-nand";
Marek Szyprowski999304b2010-05-20 08:59:05 +020064 s3c_onenand_setname("s3c6410-onenand");
65 s3c64xx_onenand1_setname("s3c6410-onenand");
Abhilash Kesavan0ab0b6d2010-06-08 16:55:45 +090066 s3c_cfcon_setname("s3c64xx-pata");
Ben Dooksd626aee2008-10-21 14:06:50 +010067}
68
Ben Dooksd9b79fb2008-10-21 14:06:51 +010069void __init s3c6410_init_irq(void)
70{
71 /* VIC0 is missing IRQ7, VIC1 is fully populated. */
72 s3c64xx_init_irq(~0 & ~(1 << 7), ~0);
73}
74
Kay Sievers4a858cf2011-12-21 16:01:38 -080075struct bus_type s3c6410_subsys = {
76 .name = "s3c6410-core",
77 .dev_name = "s3c6410-core",
Ben Dooksd626aee2008-10-21 14:06:50 +010078};
79
Kay Sievers4a858cf2011-12-21 16:01:38 -080080static struct device s3c6410_dev = {
81 .bus = &s3c6410_subsys,
Ben Dooksd626aee2008-10-21 14:06:50 +010082};
83
84static int __init s3c6410_core_init(void)
85{
Tomasz Figac836c902013-08-26 02:37:34 +090086 /* Not applicable when using DT. */
Arnd Bergmanna0e157a2015-02-27 20:31:51 +010087 if (of_have_populated_dt() || !soc_is_s3c64xx())
Tomasz Figac836c902013-08-26 02:37:34 +090088 return 0;
89
Kay Sievers4a858cf2011-12-21 16:01:38 -080090 return subsys_system_register(&s3c6410_subsys, NULL);
Ben Dooksd626aee2008-10-21 14:06:50 +010091}
92
93core_initcall(s3c6410_core_init);
94
95int __init s3c6410_init(void)
96{
97 printk("S3C6410: Initialising architecture\n");
98
Kay Sievers4a858cf2011-12-21 16:01:38 -080099 return device_register(&s3c6410_dev);
Ben Dooksd626aee2008-10-21 14:06:50 +0100100}