Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0+
0002 //
0003 // Copyright (C) 2004 by FS Forth-Systeme GmbH
0004 // All rights reserved.
0005 //
0006 // @Author: Jonas Dietsche
0007 //
0008 // @History:
0009 // derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
0010 // Ben Dooks <ben@simtec.co.uk>
0011 
0012 #include <linux/kernel.h>
0013 #include <linux/types.h>
0014 #include <linux/interrupt.h>
0015 #include <linux/list.h>
0016 #include <linux/timer.h>
0017 #include <linux/init.h>
0018 #include <linux/serial_core.h>
0019 #include <linux/serial_s3c.h>
0020 #include <linux/platform_device.h>
0021 #include <linux/io.h>
0022 #include "gpio-samsung.h"
0023 #include "gpio-cfg.h"
0024 
0025 #include <asm/mach/arch.h>
0026 #include <asm/mach/map.h>
0027 #include <asm/mach/irq.h>
0028 
0029 #include <asm/irq.h>
0030 #include <asm/mach-types.h>
0031 
0032 #include <linux/platform_data/i2c-s3c2410.h>
0033 
0034 #include "devs.h"
0035 #include "cpu.h"
0036 
0037 #include "s3c24xx.h"
0038 #include "common-smdk-s3c24xx.h"
0039 
0040 static struct map_desc smdk2410_iodesc[] __initdata = {
0041   /* nothing here yet */
0042 };
0043 
0044 #define UCON S3C2410_UCON_DEFAULT
0045 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
0046 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
0047 
0048 static struct s3c2410_uartcfg smdk2410_uartcfgs[] __initdata = {
0049     [0] = {
0050         .hwport      = 0,
0051         .flags       = 0,
0052         .ucon        = UCON,
0053         .ulcon       = ULCON,
0054         .ufcon       = UFCON,
0055     },
0056     [1] = {
0057         .hwport      = 1,
0058         .flags       = 0,
0059         .ucon        = UCON,
0060         .ulcon       = ULCON,
0061         .ufcon       = UFCON,
0062     },
0063     [2] = {
0064         .hwport      = 2,
0065         .flags       = 0,
0066         .ucon        = UCON,
0067         .ulcon       = ULCON,
0068         .ufcon       = UFCON,
0069     }
0070 };
0071 
0072 static struct platform_device *smdk2410_devices[] __initdata = {
0073     &s3c_device_ohci,
0074     &s3c_device_lcd,
0075     &s3c_device_wdt,
0076     &s3c_device_i2c0,
0077     &s3c_device_iis,
0078 };
0079 
0080 static void __init smdk2410_map_io(void)
0081 {
0082     s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
0083     s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
0084     s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
0085 }
0086 
0087 static void __init smdk2410_init_time(void)
0088 {
0089     s3c2410_init_clocks(12000000);
0090     s3c24xx_timer_init();
0091 }
0092 
0093 static void __init smdk2410_init(void)
0094 {
0095     s3c_i2c0_set_platdata(NULL);
0096     platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
0097     /* Configure the I2S pins (GPE0...GPE4) in correct mode */
0098     s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
0099                   S3C_GPIO_PULL_NONE);
0100     smdk_machine_init();
0101 }
0102 
0103 MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
0104                     * to SMDK2410 */
0105     /* Maintainer: Jonas Dietsche */
0106     .atag_offset    = 0x100,
0107     .nr_irqs    = NR_IRQS_S3C2410,
0108     .map_io     = smdk2410_map_io,
0109     .init_irq   = s3c2410_init_irq,
0110     .init_machine   = smdk2410_init,
0111     .init_time  = smdk2410_init_time,
0112 MACHINE_END