Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 //
0003 // Copyright (c) 2007 Simtec Electronics
0004 //   Ben Dooks <ben@simtec.co.uk>
0005 //
0006 // Samsung S3C2443 Mobile CPU support
0007 
0008 #include <linux/kernel.h>
0009 #include <linux/types.h>
0010 #include <linux/interrupt.h>
0011 #include <linux/list.h>
0012 #include <linux/timer.h>
0013 #include <linux/init.h>
0014 #include <linux/gpio.h>
0015 #include <linux/platform_device.h>
0016 #include <linux/serial_core.h>
0017 #include <linux/device.h>
0018 #include <linux/clk.h>
0019 #include <linux/io.h>
0020 #include <linux/reboot.h>
0021 
0022 #include <asm/mach/arch.h>
0023 #include <asm/mach/map.h>
0024 #include <asm/mach/irq.h>
0025 
0026 #include "map.h"
0027 #include "gpio-samsung.h"
0028 #include "irqs.h"
0029 #include <asm/irq.h>
0030 #include <asm/system_misc.h>
0031 
0032 #include "regs-s3c2443-clock.h"
0033 #include "rtc-core-s3c24xx.h"
0034 
0035 #include "gpio-core.h"
0036 #include "gpio-cfg.h"
0037 #include "gpio-cfg-helpers.h"
0038 #include "devs.h"
0039 #include "cpu.h"
0040 #include "adc-core.h"
0041 
0042 #include "s3c24xx.h"
0043 #include "fb-core-s3c24xx.h"
0044 #include "nand-core-s3c24xx.h"
0045 #include "spi-core-s3c24xx.h"
0046 
0047 static struct map_desc s3c2443_iodesc[] __initdata __maybe_unused = {
0048     IODESC_ENT(WATCHDOG),
0049     IODESC_ENT(CLKPWR),
0050     IODESC_ENT(TIMER),
0051 };
0052 
0053 struct bus_type s3c2443_subsys = {
0054     .name = "s3c2443-core",
0055     .dev_name = "s3c2443-core",
0056 };
0057 
0058 static struct device s3c2443_dev = {
0059     .bus        = &s3c2443_subsys,
0060 };
0061 
0062 int __init s3c2443_init(void)
0063 {
0064     printk("S3C2443: Initialising architecture\n");
0065 
0066     s3c_nand_setname("s3c2412-nand");
0067     s3c_fb_setname("s3c2443-fb");
0068 
0069     s3c_adc_setname("s3c2443-adc");
0070     s3c_rtc_setname("s3c2443-rtc");
0071 
0072     /* change WDT IRQ number */
0073     s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
0074     s3c_device_wdt.resource[1].end   = IRQ_S3C2443_WDT;
0075 
0076     return device_register(&s3c2443_dev);
0077 }
0078 
0079 void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
0080 {
0081     s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
0082 }
0083 
0084 /* s3c2443_map_io
0085  *
0086  * register the standard cpu IO areas, and any passed in from the
0087  * machine specific initialisation.
0088  */
0089 
0090 void __init s3c2443_map_io(void)
0091 {
0092     s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull;
0093     s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
0094 
0095     /* initialize device information early */
0096     s3c24xx_spi_setname("s3c2443-spi");
0097 
0098     iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
0099 }
0100 
0101 /* need to register the subsystem before we actually register the device, and
0102  * we also need to ensure that it has been initialised before any of the
0103  * drivers even try to use it (even if not on an s3c2443 based system)
0104  * as a driver which may support both 2443 and 2440 may try and use it.
0105 */
0106 
0107 static int __init s3c2443_core_init(void)
0108 {
0109     return subsys_system_register(&s3c2443_subsys, NULL);
0110 }
0111 
0112 core_initcall(s3c2443_core_init);