Exemple #1
0
/**
 * ipq806x_uart_init - initializes UART
 *
 * Initializes clocks, GPIO and UART controller.
 */
void uart_init(int idx)
{
	/* Note int idx isn't used in this driver. */
	void *dm_base;
	void *gsbi_base;

	dm_base = uart_board_param.uart_dm_base;

	if (read32(MSM_BOOT_UART_DM_CSR(dm_base)) == UART_DM_CLK_RX_TX_BIT_RATE)
		return; /* UART must have been already initialized. */

	gsbi_base = uart_board_param.uart_gsbi_base;
	ipq_configure_gpio(uart_board_param.dbg_uart_gpio,
			   NO_OF_DBG_UART_GPIOS);

	/* Configure the uart clock */
	uart_clock_config(uart_board_param.uart_gsbi,
		uart_board_param.mnd_value.m_value,
		uart_board_param.mnd_value.n_value,
		uart_board_param.mnd_value.d_value,
		0);

	write32(GSBI_CTRL_REG(gsbi_base),
		GSBI_PROTOCOL_CODE_I2C_UART << GSBI_CTRL_REG_PROTOCOL_CODE_S);
	write32(MSM_BOOT_UART_DM_CSR(dm_base), UART_DM_CLK_RX_TX_BIT_RATE);

	/* Intialize UART_DM */
	msm_boot_uart_dm_init(dm_base);
}
int board_mmc_init(bd_t *bis)
{
	gpio_func_data_t *gpio = gboard_param->emmc_gpio;

	if (gpio) {
		mmc_host.base = MSM_SDC1_BASE;
		ipq_configure_gpio(gboard_param->emmc_gpio,
				gboard_param->emmc_gpio_count);
		mmc_host.clk_mode = MMC_IDENTIFY_MODE;
		emmc_clock_config(mmc_host.clk_mode);

		ipq_mmc_init(bis, &mmc_host);
		board_mmc_env_init();
	}
	return 0;
}
static void configure_uart_dm(uart_cfg_t *uart_cfg)
{
	ipq_configure_gpio(uart_cfg->dbg_uart_gpio, NO_OF_DBG_UART_GPIOS);

	uart_clock_config(uart_cfg->base,
			uart_cfg->uart_mnd_value.m_value,
			uart_cfg->uart_mnd_value.n_value,
			uart_cfg->uart_mnd_value.d_value,
			gboard_param->clk_dummy);
	writel(GSBI_PROTOCOL_CODE_I2C_UART <<
			GSBI_CTRL_REG_PROTOCOL_CODE_S,
			GSBI_CTRL_REG(uart_cfg->gsbi_base));
	writel(UART_DM_CLK_RX_TX_BIT_RATE,
			MSM_BOOT_UART_DM_CSR(uart_cfg->uart_dm_base));
	/* Intialize UART_DM */
	msm_boot_uart_dm_init(uart_cfg->uart_dm_base);
}
int board_eth_init(bd_t *bis)
{
	int status;
	gpio_func_data_t *gpio = gboard_param->switch_gpio;
	gpio_func_data_t *ak01_gpio = gboard_param->reset_ak01_gmac_gpio;

	if (gpio) {
		gpio_tlmm_config(gpio->gpio, gpio->func, gpio->out,
				gpio->pull, gpio->drvstr, gpio->oe);
	};

	ipq_gmac_common_init(gboard_param->gmac_cfg);

	ipq_configure_gpio(gboard_param->gmac_gpio,
			gboard_param->gmac_gpio_count);
	/*
	 * Register the swith driver routines before
	 * initing the GMAC
	 */
	switch (gboard_param->machid) {
	case MACH_TYPE_IPQ806X_AP160_2XX:
		ipq_register_switch(ipq_qca8511_init);
		break;
	case MACH_TYPE_IPQ806X_AK01_1XX:
		if (ak01_gpio) {
			gpio_tlmm_config(ak01_gpio->gpio, 0, 0, 0, 0, 0);
			mdelay(100);
			gpio_tlmm_config(ak01_gpio->gpio, ak01_gpio->func, ak01_gpio->out,
				ak01_gpio->pull, ak01_gpio->drvstr, ak01_gpio->oe);
		};
		ipq_register_switch(NULL);
		break;
	default:
		ipq_register_switch(ipq_athrs17_init);
		break;
	}

	status = ipq_gmac_init(gboard_param->gmac_cfg);
	return status;
}
Exemple #5
0
/**
 * @brief ipq40xx_uart_init - initializes UART
 *
 * Initializes clocks, GPIO and UART controller.
 */
void uart_init(int idx)
{
	/* Note int idx isn't used in this driver. */
	void *dm_base;

	dm_base = uart_board_param.uart_dm_base;

	if (read32(MSM_BOOT_UART_DM_CSR(dm_base)) == UART_DM_CLK_RX_TX_BIT_RATE)
		return; /* UART must have been already initialized. */

	ipq_configure_gpio(uart_board_param.dbg_uart_gpio,
			   NO_OF_DBG_UART_GPIOS);

	/* Configure the uart clock */
	uart_clock_config(uart_board_param.blsp_uart,
		uart_board_param.mnd_value.m_value,
		uart_board_param.mnd_value.n_value,
		uart_board_param.mnd_value.d_value);

	write32(MSM_BOOT_UART_DM_CSR(dm_base), UART_DM_CLK_RX_TX_BIT_RATE);

	/* Initialize UART_DM */
	msm_boot_uart_dm_init(dm_base);
}
Exemple #6
0
void board_mmc_gpio_config(void)
{
	ipq_configure_gpio(gale_mmc_gpio_conf, ARRAY_SIZE(gale_mmc_gpio_conf));
}