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> 3371b9114dSArnd Bergmann #include <mach/regs-clock.h> 3471b9114dSArnd Bergmann 3571b9114dSArnd Bergmann #include <plat/cpu.h> 3671b9114dSArnd Bergmann #include <plat/devs.h> 3771b9114dSArnd Bergmann #include <plat/sdhci.h> 3871b9114dSArnd Bergmann #include <plat/adc-core.h> 3971b9114dSArnd Bergmann #include <plat/iic-core.h> 4071b9114dSArnd Bergmann 4171b9114dSArnd Bergmann #include "ata-core-s3c64xx.h" 4271b9114dSArnd Bergmann #include "s3c64xx.h" 4371b9114dSArnd Bergmann #include "onenand-core-s3c64xx.h" 4471b9114dSArnd Bergmann 4571b9114dSArnd Bergmann void __init s3c6410_map_io(void) 4671b9114dSArnd Bergmann { 4771b9114dSArnd Bergmann /* initialise device information early */ 4871b9114dSArnd Bergmann s3c6410_default_sdhci0(); 4971b9114dSArnd Bergmann s3c6410_default_sdhci1(); 5071b9114dSArnd Bergmann s3c6410_default_sdhci2(); 5171b9114dSArnd Bergmann 5271b9114dSArnd Bergmann /* the i2c devices are directly compatible with s3c2440 */ 5371b9114dSArnd Bergmann s3c_i2c0_setname("s3c2440-i2c"); 5471b9114dSArnd Bergmann s3c_i2c1_setname("s3c2440-i2c"); 5571b9114dSArnd Bergmann 5671b9114dSArnd Bergmann s3c_adc_setname("s3c64xx-adc"); 5771b9114dSArnd Bergmann s3c_device_nand.name = "s3c6400-nand"; 5871b9114dSArnd Bergmann s3c_onenand_setname("s3c6410-onenand"); 5971b9114dSArnd Bergmann s3c64xx_onenand1_setname("s3c6410-onenand"); 6071b9114dSArnd Bergmann s3c_cfcon_setname("s3c64xx-pata"); 6171b9114dSArnd Bergmann } 6271b9114dSArnd Bergmann 6371b9114dSArnd Bergmann void __init s3c6410_init_irq(void) 6471b9114dSArnd Bergmann { 6571b9114dSArnd Bergmann /* VIC0 is missing IRQ7, VIC1 is fully populated. */ 6671b9114dSArnd Bergmann s3c64xx_init_irq(~0 & ~(1 << 7), ~0); 6771b9114dSArnd Bergmann } 6871b9114dSArnd Bergmann 6971b9114dSArnd Bergmann struct bus_type s3c6410_subsys = { 7071b9114dSArnd Bergmann .name = "s3c6410-core", 7171b9114dSArnd Bergmann .dev_name = "s3c6410-core", 7271b9114dSArnd Bergmann }; 7371b9114dSArnd Bergmann 7471b9114dSArnd Bergmann static struct device s3c6410_dev = { 7571b9114dSArnd Bergmann .bus = &s3c6410_subsys, 7671b9114dSArnd Bergmann }; 7771b9114dSArnd Bergmann 7871b9114dSArnd Bergmann static int __init s3c6410_core_init(void) 7971b9114dSArnd Bergmann { 8071b9114dSArnd Bergmann /* Not applicable when using DT. */ 8171b9114dSArnd Bergmann if (of_have_populated_dt() || !soc_is_s3c64xx()) 8271b9114dSArnd Bergmann return 0; 8371b9114dSArnd Bergmann 8471b9114dSArnd Bergmann return subsys_system_register(&s3c6410_subsys, NULL); 8571b9114dSArnd Bergmann } 8671b9114dSArnd Bergmann 8771b9114dSArnd Bergmann core_initcall(s3c6410_core_init); 8871b9114dSArnd Bergmann 8971b9114dSArnd Bergmann int __init s3c6410_init(void) 9071b9114dSArnd Bergmann { 9171b9114dSArnd Bergmann printk("S3C6410: Initialising architecture\n"); 9271b9114dSArnd Bergmann 9371b9114dSArnd Bergmann return device_register(&s3c6410_dev); 9471b9114dSArnd Bergmann } 95