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 // http://www.fluff.org/ben/smdk2443/
0007 //
0008 // Thanks to Samsung for the loan of an SMDK2443
0009 
0010 #include <linux/kernel.h>
0011 #include <linux/types.h>
0012 #include <linux/interrupt.h>
0013 #include <linux/list.h>
0014 #include <linux/timer.h>
0015 #include <linux/init.h>
0016 #include <linux/serial_core.h>
0017 #include <linux/serial_s3c.h>
0018 #include <linux/platform_device.h>
0019 #include <linux/io.h>
0020 
0021 #include <asm/mach/arch.h>
0022 #include <asm/mach/map.h>
0023 #include <asm/mach/irq.h>
0024 
0025 #include <asm/irq.h>
0026 #include <asm/mach-types.h>
0027 
0028 #include "regs-gpio.h"
0029 
0030 #include <linux/platform_data/fb-s3c2410.h>
0031 #include <linux/platform_data/i2c-s3c2410.h>
0032 
0033 #include "devs.h"
0034 #include "cpu.h"
0035 
0036 #include "s3c24xx.h"
0037 #include "common-smdk-s3c24xx.h"
0038 
0039 static struct map_desc smdk2443_iodesc[] __initdata = {
0040     /* ISA IO Space map (memory space selected by A24) */
0041 
0042     {
0043         .virtual    = (u32)S3C24XX_VA_ISA_BYTE,
0044         .pfn        = __phys_to_pfn(S3C2410_CS2),
0045         .length     = 0x10000,
0046         .type       = MT_DEVICE,
0047     }, {
0048         .virtual    = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
0049         .pfn        = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
0050         .length     = SZ_4M,
0051         .type       = MT_DEVICE,
0052     }
0053 };
0054 
0055 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
0056 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
0057 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
0058 
0059 static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
0060     [0] = {
0061         .hwport      = 0,
0062         .flags       = 0,
0063         .ucon        = 0x3c5,
0064         .ulcon       = 0x03,
0065         .ufcon       = 0x51,
0066     },
0067     [1] = {
0068         .hwport      = 1,
0069         .flags       = 0,
0070         .ucon        = 0x3c5,
0071         .ulcon       = 0x03,
0072         .ufcon       = 0x51,
0073     },
0074     /* IR port */
0075     [2] = {
0076         .hwport      = 2,
0077         .flags       = 0,
0078         .ucon        = 0x3c5,
0079         .ulcon       = 0x43,
0080         .ufcon       = 0x51,
0081     },
0082     [3] = {
0083         .hwport      = 3,
0084         .flags       = 0,
0085         .ucon        = 0x3c5,
0086         .ulcon       = 0x03,
0087         .ufcon       = 0x51,
0088     }
0089 };
0090 
0091 static struct platform_device *smdk2443_devices[] __initdata = {
0092     &s3c_device_wdt,
0093     &s3c_device_i2c0,
0094     &s3c_device_hsmmc1,
0095     &s3c2443_device_dma,
0096 };
0097 
0098 static void __init smdk2443_map_io(void)
0099 {
0100     s3c24xx_init_io(smdk2443_iodesc, ARRAY_SIZE(smdk2443_iodesc));
0101     s3c24xx_init_uarts(smdk2443_uartcfgs, ARRAY_SIZE(smdk2443_uartcfgs));
0102     s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
0103 }
0104 
0105 static void __init smdk2443_init_time(void)
0106 {
0107     s3c2443_init_clocks(12000000);
0108     s3c24xx_timer_init();
0109 }
0110 
0111 static void __init smdk2443_machine_init(void)
0112 {
0113     s3c_i2c0_set_platdata(NULL);
0114     platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
0115     smdk_machine_init();
0116 }
0117 
0118 MACHINE_START(SMDK2443, "SMDK2443")
0119     /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
0120     .atag_offset    = 0x100,
0121     .nr_irqs    = NR_IRQS_S3C2443,
0122     .init_irq   = s3c2443_init_irq,
0123     .map_io     = smdk2443_map_io,
0124     .init_machine   = smdk2443_machine_init,
0125     .init_time  = smdk2443_init_time,
0126 MACHINE_END