Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 //
0003 // Copyright (c) 2004 Nex Vision
0004 //   Guillaume GOURAT <guillaume.gourat@nexvision.fr>
0005 
0006 #include <linux/kernel.h>
0007 #include <linux/types.h>
0008 #include <linux/interrupt.h>
0009 #include <linux/list.h>
0010 #include <linux/timer.h>
0011 #include <linux/init.h>
0012 #include <linux/serial_core.h>
0013 #include <linux/serial_s3c.h>
0014 #include <linux/platform_device.h>
0015 #include <linux/io.h>
0016 
0017 #include <linux/platform_data/i2c-s3c2410.h>
0018 
0019 #include <asm/irq.h>
0020 #include <asm/mach-types.h>
0021 #include <asm/mach/arch.h>
0022 #include <asm/mach/map.h>
0023 #include <asm/mach/irq.h>
0024 
0025 #include "gpio-samsung.h"
0026 #include "gpio-cfg.h"
0027 
0028 #include "cpu.h"
0029 #include "devs.h"
0030 
0031 #include "s3c24xx.h"
0032 #include "otom.h"
0033 
0034 static struct map_desc otom11_iodesc[] __initdata = {
0035   /* Device area */
0036     { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
0037 };
0038 
0039 #define UCON S3C2410_UCON_DEFAULT
0040 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
0041 #define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
0042 
0043 static struct s3c2410_uartcfg otom11_uartcfgs[] __initdata = {
0044     [0] = {
0045         .hwport      = 0,
0046         .flags       = 0,
0047         .ucon        = UCON,
0048         .ulcon       = ULCON,
0049         .ufcon       = UFCON,
0050     },
0051     [1] = {
0052         .hwport      = 1,
0053         .flags       = 0,
0054         .ucon        = UCON,
0055         .ulcon       = ULCON,
0056         .ufcon       = UFCON,
0057     },
0058     /* port 2 is not actually used */
0059     [2] = {
0060         .hwport      = 2,
0061         .flags       = 0,
0062         .ucon        = UCON,
0063         .ulcon       = ULCON,
0064         .ufcon       = UFCON,
0065     }
0066 };
0067 
0068 /* NOR Flash on NexVision OTOM board */
0069 
0070 static struct resource otom_nor_resource[] = {
0071     [0] = DEFINE_RES_MEM(S3C2410_CS0, SZ_4M),
0072 };
0073 
0074 static struct platform_device otom_device_nor = {
0075     .name       = "mtd-flash",
0076     .id     = -1,
0077     .num_resources  = ARRAY_SIZE(otom_nor_resource),
0078     .resource   = otom_nor_resource,
0079 };
0080 
0081 /* Standard OTOM devices */
0082 
0083 static struct platform_device *otom11_devices[] __initdata = {
0084     &s3c_device_ohci,
0085     &s3c_device_lcd,
0086     &s3c_device_wdt,
0087     &s3c_device_i2c0,
0088     &s3c_device_iis,
0089     &s3c_device_rtc,
0090     &otom_device_nor,
0091 };
0092 
0093 static void __init otom11_map_io(void)
0094 {
0095     s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
0096     s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
0097     s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
0098 }
0099 
0100 static void __init otom11_init_time(void)
0101 {
0102     s3c2410_init_clocks(12000000);
0103     s3c24xx_timer_init();
0104 }
0105 
0106 static void __init otom11_init(void)
0107 {
0108     s3c_i2c0_set_platdata(NULL);
0109 
0110     /* Configure the I2S pins (GPE0...GPE4) in correct mode */
0111     s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
0112                   S3C_GPIO_PULL_NONE);
0113     platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
0114 }
0115 
0116 MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
0117     /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
0118     .atag_offset    = 0x100,
0119     .nr_irqs    = NR_IRQS_S3C2410,
0120     .map_io     = otom11_map_io,
0121     .init_machine   = otom11_init,
0122     .init_irq   = s3c2410_init_irq,
0123     .init_time  = otom11_init_time,
0124 MACHINE_END