Davinci DM6446 Linux 内核分析——board-evm.c(4)
- UID
- 1029342
- 性别
- 男
|
Davinci DM6446 Linux 内核分析——board-evm.c(4)
static void dm644x_setup_pinmux(unsigned int id)
{
switch (id) {
case DAVINCI_LPSC_ATA:
davinci_cfg_reg(DM644X_HDIREN);
davinci_cfg_reg(DM644X_ATAEN);
break;
case DAVINCI_LPSC_MMC_SD0:
DAVINCI_VDD3P3V_PWDN = 0x0;
davinci_cfg_reg(DM644X_MSTK);
break;
case DAVINCI_LPSC_I2C:
davinci_cfg_reg(DM644X_I2C);
break;
case DAVINCI_LPSC_McBSP0:
davinci_cfg_reg(DM644X_MCBSP0);
break;
case DAVINCI_LPSC_PWM0:
davinci_cfg_reg(DM644X_PWM0);
break;
case DAVINCI_LPSC_PWM1:
davinci_cfg_reg(DM644X_PWM1);
break;
case DAVINCI_LPSC_PWM2:
davinci_cfg_reg(DM644X_PWM2);
break;
case DAVINCI_LPSC_VLYNQ:
davinci_cfg_reg(DM644X_VLINQEN);
davinci_cfg_reg(DM644X_VLINQWD);
break;
default:
break;
}
}
extern const u8 *davinci_def_priorities;
static void __init davinci_map_io(void)
{
davinci_pinmux_setup = dm644x_setup_pinmux;
davinci_def_priorities = dm644x_default_priorities;
davinci_map_common_io();
#ifdef CONFIG_KGDB_8250
early_serial_setup((struct uart_port *)
&serial_platform_data[kgdb8250_ttyS]);
kgdb8250_add_platform_port(kgdb8250_ttyS,
&serial_platform_data[kgdb8250_ttyS]);
#endif
board_init ();
}
int __init davinci_gpio_irq_setup(void);
void davinci_msp430_deep_sleep(void)
{
unsigned int icstr = DAVINCI_I2C_BASE + 0x08;
unsigned int icsar = DAVINCI_I2C_BASE + 0x1C;
unsigned int iccnt = DAVINCI_I2C_BASE + 0x14;
unsigned int icdxr = DAVINCI_I2C_BASE + 0x20;
unsigned int icmdr = DAVINCI_I2C_BASE + 0x24;
u32 cnt = 0, buflen = 2;
char rtcdata[2] = { 2, 8 };
char *buffer = rtcdata;
while (readl(icstr) & 0x1000) ;
writel(2, iccnt);
writel(0x23, icsar);
writel(0x2e20, icmdr);
while (cnt < buflen) {
if ((readl(icstr) & 0x0010) != 0) {
writel(*buffer, icdxr);
++buffer;
++cnt;
}
}
} |
|
|
|
|
|