11 #include <linux/kernel.h>
16 #include <linux/i2c.h>
25 #include <linux/videodev2.h>
27 #include <linux/export.h>
34 #include <mach/common.h>
45 #define DM644X_EVM_PHY_ID "davinci_mdio-0:01"
46 #define LXT971_PHY_ID (0x001378e2)
47 #define LXT971_PHY_MASK (0xfffffff0)
49 static struct mtd_partition davinci_evm_norflash_partitions[] = {
82 .parts = davinci_evm_norflash_partitions,
83 .nr_parts =
ARRAY_SIZE(davinci_evm_norflash_partitions),
88 static struct resource davinci_evm_norflash_resource = {
95 .name =
"physmap-flash",
98 .platform_data = &davinci_evm_norflash_data,
101 .resource = &davinci_evm_norflash_resource,
108 static struct mtd_partition davinci_evm_nandflash_partition[] = {
117 .name =
"bootloader",
131 .name =
"filesystem",
153 .parts = davinci_evm_nandflash_partition,
154 .nr_parts =
ARRAY_SIZE(davinci_evm_nandflash_partition),
157 .timing = &davinci_evm_nandflash_timing,
160 static struct resource davinci_evm_nandflash_resource[] = {
173 .name =
"davinci_nand",
176 .platform_data = &davinci_evm_nandflash_data,
178 .num_resources =
ARRAY_SIZE(davinci_evm_nandflash_resource),
179 .resource = davinci_evm_nandflash_resource,
188 .dma_mask = &davinci_fb_dma_mask,
200 #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
202 static struct v4l2_input dm644xevm_tvp5146_inputs[] = {
222 static struct vpfe_route dm644xevm_tvp5146_routes[] = {
233 static struct vpfe_subdev_info dm644xevm_vpfe_sub_devs[] = {
237 .num_inputs =
ARRAY_SIZE(dm644xevm_tvp5146_inputs),
238 .inputs = dm644xevm_tvp5146_inputs,
239 .routes = dm644xevm_tvp5146_routes,
242 .if_type = VPFE_BT656,
243 .hdpol = VPFE_PINPOL_POSITIVE,
244 .vdpol = VPFE_PINPOL_POSITIVE,
248 .platform_data = &dm644xevm_tvp5146_pdata,
253 static struct vpfe_config dm644xevm_capture_cfg = {
254 .num_subdevs =
ARRAY_SIZE(dm644xevm_vpfe_sub_devs),
256 .sub_devs = dm644xevm_vpfe_sub_devs,
257 .card_name =
"DM6446 EVM",
258 .ccdc =
"DM6446 CCDC",
262 .name =
"rtc_davinci_evm",
274 #define PCF_Uxx_BASE(x) (DAVINCI_N_GPIO + ((x) * 8))
279 static struct gpio_led evm_leds[] = {
280 { .name =
"DS8", .active_low = 1,
281 .default_trigger =
"heartbeat", },
282 { .name =
"DS7", .active_low = 1, },
283 { .name =
"DS6", .active_low = 1, },
284 { .name =
"DS5", .active_low = 1, },
285 { .name =
"DS4", .active_low = 1, },
286 { .name =
"DS3", .active_low = 1, },
287 { .name =
"DS2", .active_low = 1,
288 .default_trigger =
"mmc0", },
289 { .name =
"DS1", .active_low = 1,
290 .default_trigger =
"ide-disk", },
316 &evm_led_data,
sizeof evm_led_data);
318 evm_led_dev->
dev.parent = &client->
dev;
328 evm_led_teardown(
struct i2c_client *client,
int gpio,
unsigned ngpio,
void *c)
339 .setup = evm_led_setup,
340 .teardown = evm_led_teardown,
360 evm_u18_setup(
struct i2c_client *client,
int gpio,
unsigned ngpio,
void *c)
390 evm_u18_teardown(
struct i2c_client *client,
int gpio,
unsigned ngpio,
void *c)
405 .n_latch = (1 << 3) | (1 << 2) | (1 << 1),
406 .
setup = evm_u18_setup,
414 evm_u35_setup(
struct i2c_client *client,
int gpio,
unsigned ngpio,
void *c)
450 evm_u35_teardown(
struct i2c_client *client,
int gpio,
unsigned ngpio,
void *c)
464 .setup = evm_u35_setup,
465 .teardown = evm_u35_teardown,
477 .byte_len = (256*1024) / 8,
491 static int dm6446evm_msp_probe(
struct i2c_client *client,
498 static int dm6446evm_msp_remove(
struct i2c_client *client)
500 dm6446evm_msp =
NULL;
505 {
"dm6446evm_msp", 0, },
509 static struct i2c_driver dm6446evm_msp_driver = {
510 .driver.name =
"dm6446evm_msp",
511 .id_table = dm6446evm_msp_ids,
512 .probe = dm6446evm_msp_probe,
513 .remove = dm6446evm_msp_remove,
516 static int dm6444evm_msp430_get_pins(
void)
518 static const char txbuf[2] = { 2, 4, };
522 .addr = dm6446evm_msp->
addr,
528 .addr = dm6446evm_msp->
addr,
548 "PINS: %02x %02x %02x %02x\n",
549 buf[0], buf[1], buf[2], buf[3]);
551 return (buf[3] << 8) | buf[2];
554 static int dm6444evm_mmc_get_cd(
int module)
556 int status = dm6444evm_msp430_get_pins();
558 return (status < 0) ? status : !(status &
BIT(1));
561 static int dm6444evm_mmc_get_ro(
int module)
563 int status = dm6444evm_msp430_get_pins();
565 return (status < 0) ? status : status &
BIT(6 + 8);
569 .get_cd = dm6444evm_mmc_get_cd,
570 .get_ro = dm6444evm_mmc_get_ro,
581 .platform_data = &pcf_data_u2,
585 .platform_data = &pcf_data_u18,
589 .platform_data = &pcf_data_u35,
593 .platform_data = &eeprom_info,
610 static void __init evm_init_i2c(
void)
613 i2c_add_driver(&dm6446evm_msp_driver);
617 #define VENC_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
629 .fps = {30000, 1001},
631 .upper_margin = 0x10,
643 .upper_margin = 0x16,
659 .upper_margin = 0x20,
671 .upper_margin = 0x30,
683 static struct vpbe_output dm644xevm_vpbe_outputs[] = {
693 .default_mode =
"ntsc",
694 .num_modes =
ARRAY_SIZE(dm644xevm_enc_std_timing),
695 .modes = dm644xevm_enc_std_timing,
705 .default_mode =
"480p59_94",
706 .num_modes =
ARRAY_SIZE(dm644xevm_enc_preset_timing),
707 .modes = dm644xevm_enc_preset_timing,
711 static struct vpbe_config dm644xevm_display_cfg = {
712 .module_name =
"dm644x-vpbe-display",
720 .num_outputs =
ARRAY_SIZE(dm644xevm_vpbe_outputs),
721 .outputs = dm644xevm_vpbe_outputs,
734 davinci_evm_map_io(
void)
739 static int davinci_phy_fixup(
struct phy_device *phydev)
748 phy_write(phydev, 26, (control | 0x800));
752 #if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
753 defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
759 #if defined(CONFIG_MTD_PHYSMAP) || \
760 defined(CONFIG_MTD_PHYSMAP_MODULE)
766 #if defined(CONFIG_MTD_NAND_DAVINCI) || \
767 defined(CONFIG_MTD_NAND_DAVINCI_MODULE)
773 static __init void davinci_evm_init(
void)
775 struct clk *aemif_clk;
784 "enabled, but they share AEMIF pins.\n"
785 "\tDisable IDE for NAND/NOR support.\n");
796 pr_warning(
"WARNING: both NAND and NOR flash "
797 "are enabled; disable one of them.\n");
824 .atag_offset = 0x100,
825 .map_io = davinci_evm_map_io,
828 .init_machine = davinci_evm_init,