/**********************add by nick****************************** *******/ static struct s3c2410_hcd_info usb_ljd2410_info = { .port[0] = { .flags = S3C_HCDFLG_USED } }; int usb_ljd2410_init(void) { unsigned long upllvalue = (0x78<<12)|(0x02<<4)|(0x03); printk("USB Control, (c) 2006 sbc2410\n"); s3c_device_usb.dev.platform_data = &usb_ljd2410_info; while(upllvalue!=__raw_readl(S3C2410_UPLLCON)) { __raw_writel(upllvalue,S3C2410_UPLLCON); mdelay(1); } return 0; } /***************************end add**********************/ 同时将usb_ljd2410_init()函数添加到smdk2410_map_io函数里面进行初始化,如下所示: 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)); usb_ljd2410_init(); } //注意,不能忘了添加头文件
#include <asm/arch/regs-clock.h> #include <asm/arch/usb-control.h> #include <linux/device.h> #include <linux/delay.h> 修改后的整个文件如下: #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 <linux/serial_core.h> #include <linux/platform_device.h> #include "asm-arm/arch-s3c2410/regs-cs8900.h" #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.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 <asm/arch/fb.h> #include <asm/plat-s3c24xx/devs.h> #include <asm/plat-s3c24xx/cpu.h> #include <asm/plat-s3c24xx/common-smdk.h> #include <asm/arch/regs-clock.h> #include <asm/arch/usb-control.h> #include <linux/device.h> #include <linux/delay.h> static struct map_desc smdk2410_iodesc[] __initdata = { /* nothing here yet */ {vSMDK2410_ETH_IO,pSMDK2410_ETH_IO,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[] __initdata = { [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, } }; //nick LCD Driver 2009.3.22
/* LCD driver info */ /* Configuration for 800*480 */ static struct s3c2410fb_mach_info ljd2410_tft_cfg __initdata = { .type = S3C2410_LCDCON1_TFT, .regs = { .lcdcon1 = S3C2410_LCDCON1_TFT16BPP | S3C2410_LCDCON1_TFT | S3C2410_LCDCON1_CLKVAL(0x01), .lcdcon2 = S3C2410_LCDCON2_VBPD(39) | S3C2410_LCDCON2_LINEVAL(479) | /*480*/ S3C2410_LCDCON2_VFPD(19) | S3C2410_LCDCON2_VSPW(3), .lcdcon3 = S3C2410_LCDCON3_HBPD(49) | S3C2410_LCDCON3_HOZVAL(799) | /* 800 */ S3C2410_LCDCON3_HFPD(19), .lcdcon4 = S3C2410_LCDCON4_MVAL(13) | S3C2410_LCDCON4_HSPW(99), .lcdcon5 = S3C2410_LCDCON5_FRM565 | S3C2410_LCDCON5_INVVLINE | S3C2410_LCDCON5_INVVFRAME | S3C2410_LCDCON5_PWREN | S3C2410_LCDCON5_HWSWP, }, .lpcsel = 0x00, .gpccon= 0xaaaaaaaa, .gpccon_mask= 0xffffffff, .gpcup= 0xffffffff, .gpcup_mask= 0xffffffff, .gpdcon= 0xaaaaaaaa, .gpdcon_mask= 0xffffffff, .gpdup= 0xffffffff, .gpdup_mask= 0xffffffff,
.width =800, .height = 480, .xres = { .min = 800, .max = 800, .defval = 800, }, .yres = { .min = 480, .max = 480, .defval = 480, }, .bpp = { .min = 16, .max = 16, .defval = 16, }, }; //nick LCD
/**********************add by nick****************************** *******/ static struct s3c2410_hcd_info usb_ljd2410_info = { .port[0] = { .flags = S3C_HCDFLG_USED } }; int usb_ljd2410_init(void) { unsigned long upllvalue = (0x78<<12)|(0x02<<4)|(0x03); printk("USB Control, (c) 2006 sbc2410\n"); s3c_device_usb.dev.platform_data = &usb_ljd2410_info; while(upllvalue!=__raw_readl(S3C2410_UPLLCON)) { __raw_writel(upllvalue,S3C2410_UPLLCON); mdelay(1); } return 0; } /***************************end add**********************/
static struct platform_device *smdk2410_devices[] __initdata = { &s3c_device_usb, &s3c_device_lcd, &s3c_device_wdt, &s3c_device_i2c, &s3c_device_iis, }; 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)); usb_ljd2410_init(); } static void __init smdk2410_init(void) { s3c24xx_fb_set_platdata(&ljd2410_tft_cfg); platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices)); smdk_machine_init(); } MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch * to SMDK2410 */ /* Maintainer: Jonas Dietsche */ .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 = s3c24xx_init_irq, .init_machine = smdk2410_init, .timer = &s3c24xx_timer, MACHINE_END
|