16 #include <linux/kernel.h>
17 #include <linux/types.h>
19 #include <linux/list.h>
23 #include <linux/input.h>
25 #include <linux/serial_core.h>
30 #include <linux/i2c.h>
36 #include <mach/hardware.h>
41 #include <mach/regs-gpio.h>
43 #include <mach/regs-mem.h>
44 #include <mach/regs-lcd.h>
45 #include <mach/irqs.h>
57 #include <plat/clock.h>
65 #define MACH_MINI2440_DM9K_BASE (S3C2410_CS4 + 0x300)
71 #define UCON S3C2410_UCON_DEFAULT
72 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
73 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
112 #define _LCD_DECLARE(_clock,_xres,margin_left,margin_right,hsync, \
113 _yres,margin_top,margin_bottom,vsync, refresh) \
118 .left_margin = margin_left, \
119 .right_margin = margin_right, \
120 .upper_margin = margin_top, \
121 .lower_margin = margin_bottom, \
122 .hsync_len = hsync, \
123 .vsync_len = vsync, \
124 .pixclock = ((_clock*100000000000LL) / \
126 (hsync + margin_left + _xres + margin_right) * \
127 (vsync + margin_top + _yres + margin_bottom))), \
129 .type = (S3C2410_LCDCON1_TFT16BPP |\
194 #define S3C2410_GPCCON_MASK(x) (3 << ((x) * 2))
195 #define S3C2410_GPDCON_MASK(x) (3 << ((x) * 2))
198 .displays = &mini2440_lcd_cfg[0],
200 .default_display = 0,
206 .gpcup = (0xf << 1) | (0x3f << 10),
220 .
gpdup = (0x3f << 2) | (0x3f << 10),
248 static struct mtd_partition mini2440_default_nand_part[] __initdata = {
255 .name =
"u-boot-env",
277 .nr_partitions =
ARRAY_SIZE(mini2440_default_nand_part),
278 .partitions = mini2440_default_nand_part,
288 .sets = mini2440_nand_sets,
289 .ignore_unset_ecc = 1,
294 static struct resource mini2440_dm9k_resource[] = {
312 .num_resources =
ARRAY_SIZE(mini2440_dm9k_resource),
313 .resource = mini2440_dm9k_resource,
315 .platform_data = &mini2440_dm9k_pdata,
388 .platform_data = &mini2440_button_data,
398 .def_trigger =
"heartbeat",
405 .def_trigger =
"nand-disk",
412 .def_trigger =
"mmc0",
425 .def_trigger =
"backlight",
429 .
name =
"s3c24xx_led",
432 .platform_data = &mini2440_led1_pdata,
437 .
name =
"s3c24xx_led",
440 .platform_data = &mini2440_led2_pdata,
445 .
name =
"s3c24xx_led",
448 .platform_data = &mini2440_led3_pdata,
453 .
name =
"s3c24xx_led",
456 .platform_data = &mini2440_led4_pdata,
461 .
name =
"s3c24xx_led",
464 .platform_data = &mini2440_led_backlight_pdata,
478 .
name =
"s3c24xx_uda134x",
481 .platform_data = &mini2440_audio_pins,
496 .platform_data = &at24c08,
501 .
name =
"uda134x-codec",
511 &mini2440_device_eth,
516 &mini2440_button_device,
525 static void __init mini2440_map_io(
void)
541 static char mini2440_features_str[12] __initdata =
"0tb";
543 static int __init mini2440_features_setup(
char *
str)
546 strlcpy(mini2440_features_str, str,
sizeof(mini2440_features_str));
550 __setup(
"mini2440=", mini2440_features_setup);
552 #define FEATURE_SCREEN (1 << 0)
553 #define FEATURE_BACKLIGHT (1 << 1)
554 #define FEATURE_TOUCH (1 << 2)
555 #define FEATURE_CAMERA (1 << 3)
564 static void __init mini2440_parse_features(
566 const char * features_str )
568 const char *
fp = features_str;
581 "screen type already set\n", f);
586 "'%c' out of range LCD mode\n", f);
598 "backlight already set\n", f);
601 &mini2440_led_backlight;
607 "touchscreen not compiled in\n", f);
612 "camera already registered\n", f);
622 static void __init mini2440_init(
void)
628 mini2440_features_str);
631 mini2440_parse_features(&features, mini2440_features_str);
646 for (i = 0; i <
ARRAY_SIZE(mini2440_buttons); i++) {
653 mini2440_fb_info.displays =
657 for (li = 0; li <
ARRAY_SIZE(mini2440_lcd_cfg); li++)
660 mini2440_lcd_cfg[li].
width,
661 mini2440_lcd_cfg[li].
height);
664 mini2440_lcd_cfg[li].
width,
665 mini2440_lcd_cfg[li].
height);
688 .atag_offset = 0x100,
689 .map_io = mini2440_map_io,
690 .init_machine = mini2440_init,