2009-07-16 12:42:18 +02:00
|
|
|
/*
|
|
|
|
* TI DA850/OMAP-L138 EVM board
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
|
|
|
|
*
|
|
|
|
* Derived from: arch/arm/mach-davinci/board-da830-evm.c
|
|
|
|
* Original Copyrights follow:
|
|
|
|
*
|
|
|
|
* 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under
|
|
|
|
* the terms of the GNU General Public License version 2. This program
|
|
|
|
* is licensed "as is" without any warranty of any kind, whether express
|
|
|
|
* or implied.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/console.h>
|
|
|
|
#include <linux/i2c.h>
|
|
|
|
#include <linux/i2c/at24.h>
|
2009-09-30 23:00:28 +02:00
|
|
|
#include <linux/i2c/pca953x.h>
|
2009-08-13 20:33:14 +02:00
|
|
|
#include <linux/gpio.h>
|
2009-08-13 22:21:11 +02:00
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <linux/mtd/mtd.h>
|
|
|
|
#include <linux/mtd/nand.h>
|
|
|
|
#include <linux/mtd/partitions.h>
|
2009-08-13 23:36:25 +02:00
|
|
|
#include <linux/mtd/physmap.h>
|
2009-09-22 17:44:04 +02:00
|
|
|
#include <linux/regulator/machine.h>
|
2009-07-16 12:42:18 +02:00
|
|
|
|
|
|
|
#include <asm/mach-types.h>
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
|
|
|
|
#include <mach/cp_intc.h>
|
|
|
|
#include <mach/da8xx.h>
|
2009-08-13 22:21:11 +02:00
|
|
|
#include <mach/nand.h>
|
2009-09-15 23:46:14 +02:00
|
|
|
#include <mach/mux.h>
|
2009-07-16 12:42:18 +02:00
|
|
|
|
2009-07-17 10:47:10 +02:00
|
|
|
#define DA850_EVM_PHY_MASK 0x1
|
|
|
|
#define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
|
|
|
|
|
2009-09-15 23:46:14 +02:00
|
|
|
#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
|
2009-08-13 20:33:14 +02:00
|
|
|
#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
|
|
|
|
|
2009-08-13 21:16:23 +02:00
|
|
|
#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
|
|
|
|
#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
|
|
|
|
|
2009-09-30 23:00:53 +02:00
|
|
|
#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
|
|
|
|
|
2009-08-13 23:36:25 +02:00
|
|
|
static struct mtd_partition da850_evm_norflash_partition[] = {
|
|
|
|
{
|
|
|
|
.name = "NOR filesystem",
|
|
|
|
.offset = 0,
|
|
|
|
.size = MTDPART_SIZ_FULL,
|
|
|
|
.mask_flags = 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct physmap_flash_data da850_evm_norflash_data = {
|
|
|
|
.width = 2,
|
|
|
|
.parts = da850_evm_norflash_partition,
|
|
|
|
.nr_parts = ARRAY_SIZE(da850_evm_norflash_partition),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource da850_evm_norflash_resource[] = {
|
|
|
|
{
|
|
|
|
.start = DA8XX_AEMIF_CS2_BASE,
|
|
|
|
.end = DA8XX_AEMIF_CS2_BASE + SZ_32M - 1,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device da850_evm_norflash_device = {
|
|
|
|
.name = "physmap-flash",
|
|
|
|
.id = 0,
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &da850_evm_norflash_data,
|
|
|
|
},
|
|
|
|
.num_resources = 1,
|
|
|
|
.resource = da850_evm_norflash_resource,
|
|
|
|
};
|
|
|
|
|
2009-08-13 22:21:11 +02:00
|
|
|
/* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash
|
|
|
|
* (128K blocks). It may be used instead of the (default) SPI flash
|
|
|
|
* to boot, using TI's tools to install the secondary boot loader
|
|
|
|
* (UBL) and U-Boot.
|
|
|
|
*/
|
|
|
|
struct mtd_partition da850_evm_nandflash_partition[] = {
|
|
|
|
{
|
|
|
|
.name = "u-boot env",
|
|
|
|
.offset = 0,
|
|
|
|
.size = SZ_128K,
|
|
|
|
.mask_flags = MTD_WRITEABLE,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "UBL",
|
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
|
.size = SZ_128K,
|
|
|
|
.mask_flags = MTD_WRITEABLE,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "u-boot",
|
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
|
.size = 4 * SZ_128K,
|
|
|
|
.mask_flags = MTD_WRITEABLE,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "kernel",
|
|
|
|
.offset = 0x200000,
|
|
|
|
.size = SZ_2M,
|
|
|
|
.mask_flags = 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "filesystem",
|
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
|
.size = MTDPART_SIZ_FULL,
|
|
|
|
.mask_flags = 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct davinci_nand_pdata da850_evm_nandflash_data = {
|
|
|
|
.parts = da850_evm_nandflash_partition,
|
|
|
|
.nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition),
|
|
|
|
.ecc_mode = NAND_ECC_HW,
|
|
|
|
.options = NAND_USE_FLASH_BBT,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource da850_evm_nandflash_resource[] = {
|
|
|
|
{
|
|
|
|
.start = DA8XX_AEMIF_CS3_BASE,
|
|
|
|
.end = DA8XX_AEMIF_CS3_BASE + SZ_512K + 2 * SZ_1K - 1,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.start = DA8XX_AEMIF_CTL_BASE,
|
|
|
|
.end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device da850_evm_nandflash_device = {
|
|
|
|
.name = "davinci_nand",
|
|
|
|
.id = 1,
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &da850_evm_nandflash_data,
|
|
|
|
},
|
|
|
|
.num_resources = ARRAY_SIZE(da850_evm_nandflash_resource),
|
|
|
|
.resource = da850_evm_nandflash_resource,
|
|
|
|
};
|
|
|
|
|
2009-11-03 07:21:09 +01:00
|
|
|
static struct platform_device *da850_evm_devices[] __initdata = {
|
|
|
|
&da850_evm_nandflash_device,
|
|
|
|
&da850_evm_norflash_device,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DA8XX_AEMIF_CE2CFG_OFFSET 0x10
|
|
|
|
#define DA8XX_AEMIF_ASIZE_16BIT 0x1
|
|
|
|
|
|
|
|
static void __init da850_evm_init_nor(void)
|
|
|
|
{
|
|
|
|
void __iomem *aemif_addr;
|
|
|
|
|
|
|
|
aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);
|
|
|
|
|
|
|
|
/* Configure data bus width of CS2 to 16 bit */
|
|
|
|
writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) |
|
|
|
|
DA8XX_AEMIF_ASIZE_16BIT,
|
|
|
|
aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET);
|
|
|
|
|
|
|
|
iounmap(aemif_addr);
|
|
|
|
}
|
|
|
|
|
2009-09-30 23:00:28 +02:00
|
|
|
static u32 ui_card_detected;
|
2009-11-03 07:21:09 +01:00
|
|
|
|
|
|
|
#if defined(CONFIG_MMC_DAVINCI) || \
|
|
|
|
defined(CONFIG_MMC_DAVINCI_MODULE)
|
|
|
|
#define HAS_MMC 1
|
|
|
|
#else
|
|
|
|
#define HAS_MMC 0
|
|
|
|
#endif
|
|
|
|
|
2009-11-03 07:21:19 +01:00
|
|
|
static __init void da850_evm_setup_nor_nand(void)
|
2009-11-03 07:21:09 +01:00
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
if (ui_card_detected & !HAS_MMC) {
|
|
|
|
ret = da8xx_pinmux_setup(da850_nand_pins);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: nand mux setup failed: "
|
|
|
|
"%d\n", ret);
|
|
|
|
|
|
|
|
ret = da8xx_pinmux_setup(da850_nor_pins);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: nor mux setup failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
|
|
|
da850_evm_init_nor();
|
|
|
|
|
|
|
|
platform_add_devices(da850_evm_devices,
|
|
|
|
ARRAY_SIZE(da850_evm_devices));
|
|
|
|
}
|
|
|
|
}
|
2009-09-30 23:00:28 +02:00
|
|
|
|
2009-10-21 17:48:22 +02:00
|
|
|
#ifdef CONFIG_DA850_UI_RMII
|
|
|
|
static inline void da850_evm_setup_emac_rmii(int rmii_sel)
|
|
|
|
{
|
|
|
|
struct davinci_soc_info *soc_info = &davinci_soc_info;
|
|
|
|
|
|
|
|
soc_info->emac_pdata->rmii_en = 1;
|
|
|
|
gpio_set_value(rmii_sel, 0);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static inline void da850_evm_setup_emac_rmii(int rmii_sel) { }
|
|
|
|
#endif
|
|
|
|
|
2009-09-30 23:00:28 +02:00
|
|
|
static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
|
|
|
|
unsigned ngpio, void *c)
|
|
|
|
{
|
|
|
|
int sel_a, sel_b, sel_c, ret;
|
|
|
|
|
|
|
|
sel_a = gpio + 7;
|
|
|
|
sel_b = gpio + 6;
|
|
|
|
sel_c = gpio + 5;
|
|
|
|
|
|
|
|
ret = gpio_request(sel_a, "sel_a");
|
|
|
|
if (ret) {
|
|
|
|
pr_warning("Cannot open UI expander pin %d\n", sel_a);
|
|
|
|
goto exp_setup_sela_fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = gpio_request(sel_b, "sel_b");
|
|
|
|
if (ret) {
|
|
|
|
pr_warning("Cannot open UI expander pin %d\n", sel_b);
|
|
|
|
goto exp_setup_selb_fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = gpio_request(sel_c, "sel_c");
|
|
|
|
if (ret) {
|
|
|
|
pr_warning("Cannot open UI expander pin %d\n", sel_c);
|
|
|
|
goto exp_setup_selc_fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* deselect all functionalities */
|
|
|
|
gpio_direction_output(sel_a, 1);
|
|
|
|
gpio_direction_output(sel_b, 1);
|
|
|
|
gpio_direction_output(sel_c, 1);
|
|
|
|
|
|
|
|
ui_card_detected = 1;
|
|
|
|
pr_info("DA850/OMAP-L138 EVM UI card detected\n");
|
|
|
|
|
|
|
|
da850_evm_setup_nor_nand();
|
|
|
|
|
2009-10-21 17:48:22 +02:00
|
|
|
da850_evm_setup_emac_rmii(sel_a);
|
2009-09-30 23:00:53 +02:00
|
|
|
|
2009-09-30 23:00:28 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
exp_setup_selc_fail:
|
|
|
|
gpio_free(sel_b);
|
|
|
|
exp_setup_selb_fail:
|
|
|
|
gpio_free(sel_a);
|
|
|
|
exp_setup_sela_fail:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int da850_evm_ui_expander_teardown(struct i2c_client *client,
|
|
|
|
unsigned gpio, unsigned ngpio, void *c)
|
|
|
|
{
|
|
|
|
/* deselect all functionalities */
|
|
|
|
gpio_set_value(gpio + 5, 1);
|
|
|
|
gpio_set_value(gpio + 6, 1);
|
|
|
|
gpio_set_value(gpio + 7, 1);
|
|
|
|
|
|
|
|
gpio_free(gpio + 5);
|
|
|
|
gpio_free(gpio + 6);
|
|
|
|
gpio_free(gpio + 7);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct pca953x_platform_data da850_evm_ui_expander_info = {
|
|
|
|
.gpio_base = DAVINCI_N_GPIO,
|
|
|
|
.setup = da850_evm_ui_expander_setup,
|
|
|
|
.teardown = da850_evm_ui_expander_teardown,
|
|
|
|
};
|
|
|
|
|
2009-08-25 14:20:05 +02:00
|
|
|
static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
|
|
|
|
{
|
|
|
|
I2C_BOARD_INFO("tlv320aic3x", 0x18),
|
2009-09-30 23:00:28 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
I2C_BOARD_INFO("tca6416", 0x20),
|
|
|
|
.platform_data = &da850_evm_ui_expander_info,
|
|
|
|
},
|
2009-08-25 14:20:05 +02:00
|
|
|
};
|
|
|
|
|
2009-07-16 12:42:18 +02:00
|
|
|
static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
|
|
|
|
.bus_freq = 100, /* kHz */
|
|
|
|
.bus_delay = 0, /* usec */
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct davinci_uart_config da850_evm_uart_config __initdata = {
|
|
|
|
.enabled_uarts = 0x7,
|
|
|
|
};
|
|
|
|
|
2009-08-11 23:03:25 +02:00
|
|
|
/* davinci da850 evm audio machine driver */
|
|
|
|
static u8 da850_iis_serializer_direction[] = {
|
|
|
|
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
|
|
|
|
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
|
|
|
|
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, TX_MODE,
|
|
|
|
RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct snd_platform_data da850_evm_snd_data = {
|
|
|
|
.tx_dma_offset = 0x2000,
|
|
|
|
.rx_dma_offset = 0x2000,
|
|
|
|
.op_mode = DAVINCI_MCASP_IIS_MODE,
|
|
|
|
.num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
|
|
|
|
.tdm_slots = 2,
|
|
|
|
.serial_dir = da850_iis_serializer_direction,
|
|
|
|
.eventq_no = EVENTQ_1,
|
|
|
|
.version = MCASP_VERSION_2,
|
|
|
|
.txnumevt = 1,
|
|
|
|
.rxnumevt = 1,
|
|
|
|
};
|
|
|
|
|
2009-08-13 21:16:23 +02:00
|
|
|
static int da850_evm_mmc_get_ro(int index)
|
|
|
|
{
|
|
|
|
return gpio_get_value(DA850_MMCSD_WP_PIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int da850_evm_mmc_get_cd(int index)
|
|
|
|
{
|
|
|
|
return !gpio_get_value(DA850_MMCSD_CD_PIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct davinci_mmc_config da850_mmc_config = {
|
|
|
|
.get_ro = da850_evm_mmc_get_ro,
|
|
|
|
.get_cd = da850_evm_mmc_get_cd,
|
|
|
|
.wires = 4,
|
2009-11-03 11:16:14 +01:00
|
|
|
.max_freq = 50000000,
|
|
|
|
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
|
2009-08-13 21:16:23 +02:00
|
|
|
.version = MMC_CTLR_VERSION_2,
|
|
|
|
};
|
|
|
|
|
2009-08-13 20:33:14 +02:00
|
|
|
static int da850_lcd_hw_init(void)
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
|
|
|
|
status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
|
|
|
|
if (status < 0)
|
|
|
|
return status;
|
|
|
|
|
|
|
|
status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
|
|
|
|
if (status < 0) {
|
|
|
|
gpio_free(DA850_LCD_BL_PIN);
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
gpio_direction_output(DA850_LCD_BL_PIN, 0);
|
|
|
|
gpio_direction_output(DA850_LCD_PWR_PIN, 0);
|
|
|
|
|
|
|
|
/* disable lcd backlight */
|
|
|
|
gpio_set_value(DA850_LCD_BL_PIN, 0);
|
|
|
|
|
|
|
|
/* disable lcd power */
|
|
|
|
gpio_set_value(DA850_LCD_PWR_PIN, 0);
|
|
|
|
|
|
|
|
/* enable lcd power */
|
|
|
|
gpio_set_value(DA850_LCD_PWR_PIN, 1);
|
|
|
|
|
|
|
|
/* enable lcd backlight */
|
|
|
|
gpio_set_value(DA850_LCD_BL_PIN, 1);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2009-08-11 23:03:25 +02:00
|
|
|
|
2009-09-22 17:44:04 +02:00
|
|
|
/* TPS65070 voltage regulator support */
|
|
|
|
|
|
|
|
/* 3.3V */
|
|
|
|
struct regulator_consumer_supply tps65070_dcdc1_consumers[] = {
|
|
|
|
{
|
|
|
|
.supply = "usb0_vdda33",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "usb1_vdda33",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 3.3V or 1.8V */
|
|
|
|
struct regulator_consumer_supply tps65070_dcdc2_consumers[] = {
|
|
|
|
{
|
|
|
|
.supply = "dvdd3318_a",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "dvdd3318_b",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "dvdd3318_c",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 1.2V */
|
|
|
|
struct regulator_consumer_supply tps65070_dcdc3_consumers[] = {
|
|
|
|
{
|
|
|
|
.supply = "cvdd",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 1.8V LDO */
|
|
|
|
struct regulator_consumer_supply tps65070_ldo1_consumers[] = {
|
|
|
|
{
|
|
|
|
.supply = "sata_vddr",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "usb0_vdda18",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "usb1_vdda18",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "ddr_dvdd18",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 1.2V LDO */
|
|
|
|
struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
|
|
|
|
{
|
|
|
|
.supply = "sata_vdd",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "pll0_vdda",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "pll1_vdda",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "usbs_cvdd",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.supply = "vddarnwa1",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
struct regulator_init_data tps65070_regulator_data[] = {
|
|
|
|
/* dcdc1 */
|
|
|
|
{
|
|
|
|
.constraints = {
|
|
|
|
.min_uV = 3150000,
|
|
|
|
.max_uV = 3450000,
|
|
|
|
.valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS),
|
|
|
|
.boot_on = 1,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc1_consumers),
|
|
|
|
.consumer_supplies = tps65070_dcdc1_consumers,
|
|
|
|
},
|
|
|
|
|
|
|
|
/* dcdc2 */
|
|
|
|
{
|
|
|
|
.constraints = {
|
|
|
|
.min_uV = 1710000,
|
|
|
|
.max_uV = 3450000,
|
|
|
|
.valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS),
|
|
|
|
.boot_on = 1,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
|
|
|
|
.consumer_supplies = tps65070_dcdc2_consumers,
|
|
|
|
},
|
|
|
|
|
|
|
|
/* dcdc3 */
|
|
|
|
{
|
|
|
|
.constraints = {
|
|
|
|
.min_uV = 950000,
|
|
|
|
.max_uV = 1320000,
|
|
|
|
.valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS),
|
|
|
|
.boot_on = 1,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
|
|
|
|
.consumer_supplies = tps65070_dcdc3_consumers,
|
|
|
|
},
|
|
|
|
|
|
|
|
/* ldo1 */
|
|
|
|
{
|
|
|
|
.constraints = {
|
|
|
|
.min_uV = 1710000,
|
|
|
|
.max_uV = 1890000,
|
|
|
|
.valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS),
|
|
|
|
.boot_on = 1,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies = ARRAY_SIZE(tps65070_ldo1_consumers),
|
|
|
|
.consumer_supplies = tps65070_ldo1_consumers,
|
|
|
|
},
|
|
|
|
|
|
|
|
/* ldo2 */
|
|
|
|
{
|
|
|
|
.constraints = {
|
|
|
|
.min_uV = 1140000,
|
|
|
|
.max_uV = 1320000,
|
|
|
|
.valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
|
|
|
|
REGULATOR_CHANGE_STATUS),
|
|
|
|
.boot_on = 1,
|
|
|
|
},
|
|
|
|
.num_consumer_supplies = ARRAY_SIZE(tps65070_ldo2_consumers),
|
|
|
|
.consumer_supplies = tps65070_ldo2_consumers,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct i2c_board_info __initdata da850evm_tps65070_info[] = {
|
|
|
|
{
|
|
|
|
I2C_BOARD_INFO("tps6507x", 0x48),
|
|
|
|
.platform_data = &tps65070_regulator_data[0],
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init pmic_tps65070_init(void)
|
|
|
|
{
|
|
|
|
return i2c_register_board_info(1, da850evm_tps65070_info,
|
|
|
|
ARRAY_SIZE(da850evm_tps65070_info));
|
|
|
|
}
|
|
|
|
|
2009-09-15 23:46:14 +02:00
|
|
|
static const short da850_evm_lcdc_pins[] = {
|
|
|
|
DA850_GPIO2_8, DA850_GPIO2_15,
|
|
|
|
-1
|
|
|
|
};
|
|
|
|
|
2009-10-21 17:48:22 +02:00
|
|
|
static int __init da850_evm_config_emac(void)
|
2009-09-30 23:00:53 +02:00
|
|
|
{
|
|
|
|
void __iomem *cfg_chip3_base;
|
|
|
|
int ret;
|
|
|
|
u32 val;
|
2009-10-21 17:48:22 +02:00
|
|
|
struct davinci_soc_info *soc_info = &davinci_soc_info;
|
|
|
|
u8 rmii_en = soc_info->emac_pdata->rmii_en;
|
|
|
|
|
|
|
|
if (!machine_is_davinci_da850_evm())
|
|
|
|
return 0;
|
2009-09-30 23:00:53 +02:00
|
|
|
|
|
|
|
cfg_chip3_base = DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG);
|
|
|
|
|
|
|
|
val = __raw_readl(cfg_chip3_base);
|
2009-10-21 17:48:24 +02:00
|
|
|
|
|
|
|
if (rmii_en) {
|
2009-09-30 23:00:53 +02:00
|
|
|
val |= BIT(8);
|
2009-10-21 17:48:24 +02:00
|
|
|
ret = da8xx_pinmux_setup(da850_rmii_pins);
|
|
|
|
pr_info("EMAC: RMII PHY configured, MII PHY will not be"
|
|
|
|
" functional\n");
|
|
|
|
} else {
|
2009-09-30 23:00:53 +02:00
|
|
|
val &= ~BIT(8);
|
|
|
|
ret = da8xx_pinmux_setup(da850_cpgmac_pins);
|
2009-10-21 17:48:24 +02:00
|
|
|
pr_info("EMAC: MII PHY configured, RMII PHY will not be"
|
|
|
|
" functional\n");
|
|
|
|
}
|
|
|
|
|
2009-09-30 23:00:53 +02:00
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-10-21 17:48:24 +02:00
|
|
|
/* configure the CFGCHIP3 register for RMII or MII */
|
|
|
|
__raw_writel(val, cfg_chip3_base);
|
|
|
|
|
2009-09-30 23:00:53 +02:00
|
|
|
ret = davinci_cfg_reg(DA850_GPIO2_6);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init:GPIO(2,6) mux setup "
|
|
|
|
"failed\n");
|
|
|
|
|
|
|
|
ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
|
|
|
|
if (ret) {
|
|
|
|
pr_warning("Cannot open GPIO %d\n",
|
|
|
|
DA850_MII_MDIO_CLKEN_PIN);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-10-21 17:48:24 +02:00
|
|
|
/* Enable/Disable MII MDIO clock */
|
|
|
|
gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
|
2009-09-30 23:00:53 +02:00
|
|
|
|
2009-10-21 17:48:22 +02:00
|
|
|
soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK;
|
|
|
|
soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY;
|
|
|
|
|
|
|
|
ret = da8xx_register_emac();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: emac registration failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-09-30 23:00:53 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2009-10-21 17:48:22 +02:00
|
|
|
device_initcall(da850_evm_config_emac);
|
2009-09-30 23:00:53 +02:00
|
|
|
|
2009-07-16 12:42:18 +02:00
|
|
|
static __init void da850_evm_init(void)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2009-09-22 17:44:04 +02:00
|
|
|
ret = pmic_tps65070_init();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-07-16 12:42:18 +02:00
|
|
|
ret = da8xx_register_edma();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: edma registration failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
|
|
|
ret = da8xx_pinmux_setup(da850_i2c0_pins);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
|
|
|
ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: i2c0 registration failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-07-17 10:47:10 +02:00
|
|
|
|
2009-07-16 12:42:18 +02:00
|
|
|
ret = da8xx_register_watchdog();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da830_evm_init: watchdog registration failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-08-14 00:16:28 +02:00
|
|
|
if (HAS_MMC) {
|
|
|
|
ret = da8xx_pinmux_setup(da850_mmcsd0_pins);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
|
|
|
|
" %d\n", ret);
|
|
|
|
|
|
|
|
ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: can not open GPIO %d\n",
|
|
|
|
DA850_MMCSD_CD_PIN);
|
|
|
|
gpio_direction_input(DA850_MMCSD_CD_PIN);
|
|
|
|
|
|
|
|
ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: can not open GPIO %d\n",
|
|
|
|
DA850_MMCSD_WP_PIN);
|
|
|
|
gpio_direction_input(DA850_MMCSD_WP_PIN);
|
|
|
|
|
|
|
|
ret = da8xx_register_mmcsd0(&da850_mmc_config);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: mmcsd0 registration failed:"
|
|
|
|
" %d\n", ret);
|
|
|
|
}
|
2009-08-13 21:16:23 +02:00
|
|
|
|
2009-07-16 12:42:18 +02:00
|
|
|
davinci_serial_init(&da850_evm_uart_config);
|
|
|
|
|
2009-08-25 14:20:05 +02:00
|
|
|
i2c_register_board_info(1, da850_evm_i2c_devices,
|
|
|
|
ARRAY_SIZE(da850_evm_i2c_devices));
|
|
|
|
|
2009-07-16 12:42:18 +02:00
|
|
|
/*
|
|
|
|
* shut down uart 0 and 1; they are not used on the board and
|
|
|
|
* accessing them causes endless "too much work in irq53" messages
|
|
|
|
* with arago fs
|
|
|
|
*/
|
|
|
|
__raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
|
|
|
|
__raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
|
2009-08-11 23:03:25 +02:00
|
|
|
|
|
|
|
ret = da8xx_pinmux_setup(da850_mcasp_pins);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-08-29 00:05:02 +02:00
|
|
|
da8xx_register_mcasp(0, &da850_evm_snd_data);
|
2009-08-13 20:33:14 +02:00
|
|
|
|
|
|
|
ret = da8xx_pinmux_setup(da850_lcdcntl_pins);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-09-15 23:46:14 +02:00
|
|
|
/* Handle board specific muxing for LCD here */
|
|
|
|
ret = da8xx_pinmux_setup(da850_evm_lcdc_pins);
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: evm specific lcd mux setup "
|
|
|
|
"failed: %d\n", ret);
|
|
|
|
|
2009-08-13 20:33:14 +02:00
|
|
|
ret = da850_lcd_hw_init();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: lcd initialization failed: %d\n",
|
|
|
|
ret);
|
|
|
|
|
2009-09-16 03:14:19 +02:00
|
|
|
ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
|
2009-08-13 20:33:14 +02:00
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: lcdc registration failed: %d\n",
|
|
|
|
ret);
|
2009-09-16 03:15:54 +02:00
|
|
|
|
|
|
|
ret = da8xx_register_rtc();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: rtc setup failed: %d\n", ret);
|
2009-09-22 17:44:03 +02:00
|
|
|
|
|
|
|
ret = da850_register_cpufreq();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: cpufreq registration failed: %d\n",
|
|
|
|
ret);
|
2009-10-22 11:42:15 +02:00
|
|
|
|
|
|
|
ret = da8xx_register_cpuidle();
|
|
|
|
if (ret)
|
|
|
|
pr_warning("da850_evm_init: cpuidle registration failed: %d\n",
|
|
|
|
ret);
|
2009-07-16 12:42:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_SERIAL_8250_CONSOLE
|
|
|
|
static int __init da850_evm_console_init(void)
|
|
|
|
{
|
|
|
|
return add_preferred_console("ttyS", 2, "115200");
|
|
|
|
}
|
|
|
|
console_initcall(da850_evm_console_init);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static __init void da850_evm_irq_init(void)
|
|
|
|
{
|
|
|
|
struct davinci_soc_info *soc_info = &davinci_soc_info;
|
|
|
|
|
|
|
|
cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA850_N_CP_INTC_IRQ,
|
|
|
|
soc_info->intc_irq_prios);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __init da850_evm_map_io(void)
|
|
|
|
{
|
|
|
|
da850_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM")
|
|
|
|
.phys_io = IO_PHYS,
|
|
|
|
.io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
|
|
|
|
.boot_params = (DA8XX_DDR_BASE + 0x100),
|
|
|
|
.map_io = da850_evm_map_io,
|
|
|
|
.init_irq = da850_evm_irq_init,
|
|
|
|
.timer = &davinci_timer,
|
|
|
|
.init_machine = da850_evm_init,
|
|
|
|
MACHINE_END
|