Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 //
0003 // Copyright 2008 Simtec Electronics
0004 //  Ben Dooks <ben@simtec.co.uk>
0005 //  http://armlinux.simtec.co.uk/
0006 
0007 #include <linux/kernel.h>
0008 #include <linux/types.h>
0009 #include <linux/interrupt.h>
0010 #include <linux/list.h>
0011 #include <linux/timer.h>
0012 #include <linux/init.h>
0013 #include <linux/serial_core.h>
0014 #include <linux/serial_s3c.h>
0015 #include <linux/platform_device.h>
0016 #include <linux/i2c.h>
0017 #include <linux/io.h>
0018 
0019 #include <asm/mach-types.h>
0020 
0021 #include <asm/mach/arch.h>
0022 #include <asm/mach/map.h>
0023 #include <asm/mach/irq.h>
0024 
0025 #include "irqs.h"
0026 #include "map.h"
0027 
0028 #include "devs.h"
0029 #include "cpu.h"
0030 #include <linux/platform_data/i2c-s3c2410.h>
0031 #include "gpio-samsung.h"
0032 
0033 #include "s3c64xx.h"
0034 
0035 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
0036 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
0037 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
0038 
0039 static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = {
0040     [0] = {
0041         .hwport      = 0,
0042         .flags       = 0,
0043         .ucon        = 0x3c5,
0044         .ulcon       = 0x03,
0045         .ufcon       = 0x51,
0046     },
0047     [1] = {
0048         .hwport      = 1,
0049         .flags       = 0,
0050         .ucon        = 0x3c5,
0051         .ulcon       = 0x03,
0052         .ufcon       = 0x51,
0053     },
0054 };
0055 
0056 static struct map_desc smdk6400_iodesc[] = {};
0057 
0058 static void __init smdk6400_map_io(void)
0059 {
0060     s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc));
0061     s3c64xx_set_xtal_freq(12000000);
0062     s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs));
0063     s3c64xx_set_timer_source(S3C64XX_PWM3, S3C64XX_PWM4);
0064 }
0065 
0066 static struct platform_device *smdk6400_devices[] __initdata = {
0067     &s3c_device_hsmmc1,
0068     &s3c_device_i2c0,
0069 };
0070 
0071 static struct i2c_board_info i2c_devs[] __initdata = {
0072     { I2C_BOARD_INFO("wm8753", 0x1A), },
0073     { I2C_BOARD_INFO("24c08", 0x50), },
0074 };
0075 
0076 static void __init smdk6400_machine_init(void)
0077 {
0078     i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs));
0079     platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices));
0080 }
0081 
0082 MACHINE_START(SMDK6400, "SMDK6400")
0083     /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
0084     .atag_offset    = 0x100,
0085     .nr_irqs    = S3C64XX_NR_IRQS,
0086     .init_irq   = s3c6400_init_irq,
0087     .map_io     = smdk6400_map_io,
0088     .init_machine   = smdk6400_machine_init,
0089     .init_time  = s3c64xx_timer_init,
0090 MACHINE_END