/***********************************************************************
*
* linux/arch/arm/mach-s3c2410/mach-smdk2410.c
*
* Copyright (C) 2004 by FS Forth-Systeme GmbH
* All rights reserved.
*
* $Id: mach-smdk2410.c,v 1.1 2004/05/11 14:15:38 mpietrek Exp $
* @Author: Jonas Dietsche
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* @History:
* derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
* Ben Dooks <ben@simtec.co.uk>
*
* 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
* 20-Sep-2005 BJD Added static to non-exported items
*
***********************************************************************/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <asm/arch/usb-control.h>
#include <asm/arch/regs-clock.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/arch/regs-lcd.h>
#include <asm/arch-s3c2410/fb.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
#include <asm/arch/regs-serial.h>
#include "devs.h"
#include "cpu.h"
static struct s3c2410fb_mach_info s3c2410_lcd_info __initdata={
.fixed_syncs=0,
.regs={.lcdcon1=S3C2410_LCDCON1_TFT16BPP | S3C2410_LCDCON1_TFT | S3C2410_LCDCON1_CLKVAL(1),
.lcdcon2=S3C2410_LCDCON2_VBPD(32) | S3C2410_LCDCON2_VFPD(9) |S3C2410_LCDCON2_VSPW(1),
.lcdcon3=S3C2410_LCDCON3_HBPD(47) | S3C2410_LCDCON3_HFPD(15),
.lcdcon4=S3C2410_LCDCON4_MVAL(13) | S3C2410_LCDCON4_HSPW(95),
.lcdcon5=S3C2410_LCDCON5_FRM565 |S3C2410_LCDCON5_INVVLINE |S3C2410_LCDCON5_HWSWP | S3C2410_LCDCON5_PWREN |S3C2410_LCDCON5_INVVFRAME,},
.lpcsel=0x0,
.gpccon=0xaaaaaaaa,
.gpccon_mask=0xffffffff,
.gpcup=0xffffffff,
.gpcup_mask=0xffffffff,
.gpdcon=0xaaaaaaaa,
.gpdcon_mask=0x0,
.gpdup=0xffffffff,
.gpdup_mask=0xffffffff,
.width=640,
.height=480,
.xres={640,640,640},
.yres={480,480,480},
.bpp={16,16,16},
};
static void __init smdk2410_lcd_init(void)
{
set_s3c2410fb_info(&s3c2410_lcd_info);
}
struct s3c2410_hcd_info usb_s3c2410_info={
.port[0]={.flags=S3C_HCDFLG_USED }
};
int smdk2410_usb_init(void)
{
unsigned long upllvalue=(0x78<<12)|(0x02<<4)|(0x03);
printk("USB Control,(c) 2006 s3c2410\n");
s3c_device_usb.dev.platform_data=&usb_s3c2410_info;
while(upllvalue!=__raw_readl(S3C2410_UPLLCON))
{ __raw_writel(upllvalue,S3C2410_UPLLCON);
mdelay(1);
}
return 0;
}
static struct map_desc smdk2410_iodesc[] __initdata = {
/* nothing here yet */
{vAX88796_BASE, pAX88796_BASE, SZ_1M, MT_DEVICE},
};
#define UCON S3C2410_UCON_DEFAULT
#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
static struct s3c2410_uartcfg smdk2410_uartcfgs[] = {
[0] = {
.hwport = 0,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
},
[1] = {
.hwport = 1,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
},
[2] = {
.hwport = 2,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
}
};
static struct platform_device *smdk2410_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
&s3c_device_nand,
};
static struct s3c24xx_board smdk2410_board __initdata = {
.devices = smdk2410_devices,
.devices_count = ARRAY_SIZE(smdk2410_devices)
};
static void __init smdk2410_map_io(void)
{
s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
s3c24xx_set_board(&smdk2410_board);
smdk2410_usb_init();
}
static void __init smdk2410_init_irq(void)
{
s3c24xx_init_irq();
}
MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
* to SMDK2410 */
/* Maintainer: Jonas Dietsche */
.phys_ram = S3C2410_SDRAM_PA,
.phys_io = S3C2410_PA_UART,
.io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
.boot_params = S3C2410_SDRAM_PA + 0x100,
.map_io = smdk2410_map_io,
.init_irq = smdk2410_init_irq,
.timer = &s3c24xx_timer,
.init_machine =smdk2410_lcd_init,
MACHINE_END