Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 //
0003 // Copyright (C) 2008-2009 Samsung Electronics
0004 
0005 #include <linux/kernel.h>
0006 #include <linux/types.h>
0007 #include <linux/interrupt.h>
0008 #include <linux/list.h>
0009 #include <linux/timer.h>
0010 #include <linux/init.h>
0011 #include <linux/serial_core.h>
0012 #include <linux/serial_s3c.h>
0013 #include <linux/platform_device.h>
0014 #include <linux/io.h>
0015 #include <linux/i2c.h>
0016 #include <linux/fb.h>
0017 #include <linux/gpio.h>
0018 #include <linux/delay.h>
0019 
0020 #include <video/platform_lcd.h>
0021 #include <video/samsung_fimd.h>
0022 
0023 #include <asm/mach/arch.h>
0024 #include <asm/mach/map.h>
0025 #include <asm/mach/irq.h>
0026 
0027 #include "irqs.h"
0028 #include "map.h"
0029 
0030 #include <asm/irq.h>
0031 #include <asm/mach-types.h>
0032 
0033 #include <linux/platform_data/i2c-s3c2410.h>
0034 #include "fb.h"
0035 
0036 #include "devs.h"
0037 #include "cpu.h"
0038 
0039 #include "s3c64xx.h"
0040 
0041 #define UCON S3C2410_UCON_DEFAULT
0042 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
0043 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
0044 
0045 static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = {
0046     /* REVISIT: NCP uses only serial 1, 2 */
0047     [0] = {
0048         .hwport      = 0,
0049         .flags       = 0,
0050         .ucon        = UCON,
0051         .ulcon       = ULCON,
0052         .ufcon       = UFCON,
0053     },
0054     [1] = {
0055         .hwport      = 1,
0056         .flags       = 0,
0057         .ucon        = UCON,
0058         .ulcon       = ULCON,
0059         .ufcon       = UFCON,
0060     },
0061     [2] = {
0062         .hwport      = 2,
0063         .flags       = 0,
0064         .ucon        = UCON,
0065         .ulcon       = ULCON,
0066         .ufcon       = UFCON,
0067     },
0068 };
0069 
0070 static struct platform_device *ncp_devices[] __initdata = {
0071     &s3c_device_hsmmc1,
0072     &s3c_device_i2c0,
0073 };
0074 
0075 static struct map_desc ncp_iodesc[] __initdata = {};
0076 
0077 static void __init ncp_map_io(void)
0078 {
0079     s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
0080     s3c64xx_set_xtal_freq(12000000);
0081     s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
0082     s3c64xx_set_timer_source(S3C64XX_PWM3, S3C64XX_PWM4);
0083 }
0084 
0085 static void __init ncp_machine_init(void)
0086 {
0087     s3c_i2c0_set_platdata(NULL);
0088 
0089     platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices));
0090 }
0091 
0092 MACHINE_START(NCP, "NCP")
0093     /* Maintainer: Samsung Electronics */
0094     .atag_offset    = 0x100,
0095     .nr_irqs    = S3C64XX_NR_IRQS,
0096     .init_irq   = s3c6410_init_irq,
0097     .map_io     = ncp_map_io,
0098     .init_machine   = ncp_machine_init,
0099     .init_time  = s3c64xx_timer_init,
0100 MACHINE_END