xref: /linux/arch/arm/mach-s3c/s3c6410.c (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
171b9114dSArnd Bergmann // SPDX-License-Identifier: GPL-2.0
271b9114dSArnd Bergmann //
371b9114dSArnd Bergmann // Copyright 2008 Simtec Electronics
471b9114dSArnd Bergmann // Copyright 2008 Simtec Electronics
571b9114dSArnd Bergmann //	Ben Dooks <ben@simtec.co.uk>
671b9114dSArnd Bergmann //	http://armlinux.simtec.co.uk/
771b9114dSArnd Bergmann 
871b9114dSArnd Bergmann /*
971b9114dSArnd Bergmann  * NOTE: Code in this file is not used when booting with Device Tree support.
1071b9114dSArnd Bergmann  */
1171b9114dSArnd Bergmann 
1271b9114dSArnd Bergmann #include <linux/kernel.h>
1371b9114dSArnd Bergmann #include <linux/types.h>
1471b9114dSArnd Bergmann #include <linux/interrupt.h>
1571b9114dSArnd Bergmann #include <linux/list.h>
1671b9114dSArnd Bergmann #include <linux/timer.h>
1771b9114dSArnd Bergmann #include <linux/init.h>
1871b9114dSArnd Bergmann #include <linux/clk.h>
1971b9114dSArnd Bergmann #include <linux/io.h>
2071b9114dSArnd Bergmann #include <linux/device.h>
2171b9114dSArnd Bergmann #include <linux/serial_core.h>
2271b9114dSArnd Bergmann #include <linux/serial_s3c.h>
2371b9114dSArnd Bergmann #include <linux/platform_device.h>
2471b9114dSArnd Bergmann #include <linux/of.h>
2571b9114dSArnd Bergmann 
2671b9114dSArnd Bergmann #include <asm/mach/arch.h>
2771b9114dSArnd Bergmann #include <asm/mach/map.h>
2871b9114dSArnd Bergmann #include <asm/mach/irq.h>
2971b9114dSArnd Bergmann 
3071b9114dSArnd Bergmann #include <asm/irq.h>
3171b9114dSArnd Bergmann 
3271b9114dSArnd Bergmann #include <linux/soc/samsung/s3c-pm.h>
33c6ff132dSArnd Bergmann #include "regs-clock.h"
3471b9114dSArnd Bergmann 
35c6ff132dSArnd Bergmann #include "cpu.h"
36c6ff132dSArnd Bergmann #include "devs.h"
37c6ff132dSArnd Bergmann #include "sdhci.h"
38c6ff132dSArnd Bergmann #include "iic-core.h"
3971b9114dSArnd Bergmann 
4071b9114dSArnd Bergmann #include "s3c64xx.h"
4171b9114dSArnd Bergmann 
s3c6410_map_io(void)4271b9114dSArnd Bergmann void __init s3c6410_map_io(void)
4371b9114dSArnd Bergmann {
4471b9114dSArnd Bergmann 	/* initialise device information early */
4571b9114dSArnd Bergmann 	s3c6410_default_sdhci0();
4671b9114dSArnd Bergmann 	s3c6410_default_sdhci1();
4771b9114dSArnd Bergmann 	s3c6410_default_sdhci2();
4871b9114dSArnd Bergmann 
4971b9114dSArnd Bergmann 	/* the i2c devices are directly compatible with s3c2440 */
5071b9114dSArnd Bergmann 	s3c_i2c0_setname("s3c2440-i2c");
5171b9114dSArnd Bergmann 	s3c_i2c1_setname("s3c2440-i2c");
5271b9114dSArnd Bergmann }
5371b9114dSArnd Bergmann 
s3c6410_init_irq(void)5471b9114dSArnd Bergmann void __init s3c6410_init_irq(void)
5571b9114dSArnd Bergmann {
5671b9114dSArnd Bergmann 	/* VIC0 is missing IRQ7, VIC1 is fully populated. */
5771b9114dSArnd Bergmann 	s3c64xx_init_irq(~0 & ~(1 << 7), ~0);
5871b9114dSArnd Bergmann }
5971b9114dSArnd Bergmann 
60*a3891621SRicardo B. Marliere const struct bus_type s3c6410_subsys = {
6171b9114dSArnd Bergmann 	.name		= "s3c6410-core",
6271b9114dSArnd Bergmann 	.dev_name	= "s3c6410-core",
6371b9114dSArnd Bergmann };
6471b9114dSArnd Bergmann 
6571b9114dSArnd Bergmann static struct device s3c6410_dev = {
6671b9114dSArnd Bergmann 	.bus	= &s3c6410_subsys,
6771b9114dSArnd Bergmann };
6871b9114dSArnd Bergmann 
s3c6410_core_init(void)6971b9114dSArnd Bergmann static int __init s3c6410_core_init(void)
7071b9114dSArnd Bergmann {
7171b9114dSArnd Bergmann 	/* Not applicable when using DT. */
7271b9114dSArnd Bergmann 	if (of_have_populated_dt() || !soc_is_s3c64xx())
7371b9114dSArnd Bergmann 		return 0;
7471b9114dSArnd Bergmann 
7571b9114dSArnd Bergmann 	return subsys_system_register(&s3c6410_subsys, NULL);
7671b9114dSArnd Bergmann }
7771b9114dSArnd Bergmann 
7871b9114dSArnd Bergmann core_initcall(s3c6410_core_init);
7971b9114dSArnd Bergmann 
s3c6410_init(void)8071b9114dSArnd Bergmann int __init s3c6410_init(void)
8171b9114dSArnd Bergmann {
8271b9114dSArnd Bergmann 	printk("S3C6410: Initialising architecture\n");
8371b9114dSArnd Bergmann 
8471b9114dSArnd Bergmann 	return device_register(&s3c6410_dev);
8571b9114dSArnd Bergmann }
86