Exemple #1
0
static void __init tegra_curacao_init(void)
{
	tegra_clk_init_from_table(curacao_clk_init_table);
	tegra_enable_pinmux();
	curacao_pinmux_init();
	tegra_soc_device_init("curacao");

	if (tegra_revision == TEGRA_REVISION_QT)
		debug_uart_platform_data[0].uartclk = tegra_clk_measure_input_freq();

	platform_add_devices(curacao_devices, ARRAY_SIZE(curacao_devices));

	curacao_power_off_init();
	tegra_io_dpd_init();
	curacao_sdhci_init();
	curacao_i2c_init();
	curacao_regulator_init();
	curacao_emc_init();
	curacao_suspend_init();
	curacao_touch_init();
	curacao_usb_init();
	curacao_panel_init();
	curacao_hs_uart_init();
	curacao_bt_rfkill();
	curacao_sensors_init();
}
void __init tegra3_init_timer(u32 *offset, int *irq)
{
	unsigned long rate = tegra_clk_measure_input_freq();

	switch (rate) {
	case 12000000:
		timer_writel(0x000b, TIMERUS_USEC_CFG);
		break;
	case 13000000:
		timer_writel(0x000c, TIMERUS_USEC_CFG);
		break;
	case 19200000:
		timer_writel(0x045f, TIMERUS_USEC_CFG);
		break;
	case 26000000:
		timer_writel(0x0019, TIMERUS_USEC_CFG);
		break;
	case 16800000:
		timer_writel(0x0453, TIMERUS_USEC_CFG);
		break;
	case 38400000:
		timer_writel(0x04BF, TIMERUS_USEC_CFG);
		break;
	case 48000000:
		timer_writel(0x002F, TIMERUS_USEC_CFG);
		break;
	default:
		WARN(1, "Unknown clock rate");
	}

#ifdef CONFIG_PM_SLEEP
#ifdef CONFIG_SMP
	/* For T30.A01 use INT_TMR_SHARED instead of INT_TMR6 for CPU3. */
	if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA3) &&
		(tegra_get_revision() == TEGRA_REVISION_A01))
			tegra_lp2wake_irq[3].irq = INT_TMR_SHARED;
#endif

	tegra3_register_wake_timer(0);
#endif

	*offset = TIMER1_OFFSET;
	*irq = INT_TMR1;
}