Exemple #1
0
void __init imx1_init_early(void)
{
	mxc_set_cpu_type(MXC_CPU_MX1);
	mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));
	imx_iomuxv1_init(MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR),
			MX1_NUM_GPIO_PORT);
}
int __init mx1_clocks_init(unsigned long fref)
{
	ccm = MX1_IO_ADDRESS(MX1_CCM_BASE_ADDR);

	_mx1_clocks_init(fref);

	clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx-gpt.0");
	clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx-gpt.0");
	clk_register_clkdev(clk[IMX1_CLK_DMA_GATE], "ahb", "imx1-dma");
	clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-dma");
	clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.0");
	clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-uart.0");
	clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.1");
	clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-uart.1");
	clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.2");
	clk_register_clkdev(clk[IMX1_CLK_UART3_GATE], "ipg", "imx1-uart.2");
	clk_register_clkdev(clk[IMX1_CLK_HCLK], NULL, "imx1-i2c.0");
	clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-cspi.0");
	clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-cspi.0");
	clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-cspi.1");
	clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-cspi.1");
	clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-fb.0");
	clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-fb.0");
	clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ahb", "imx1-fb.0");

	mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT);

	return 0;
}
Exemple #3
0
void __init mx1_map_io(void)
{
	mxc_set_cpu_type(MXC_CPU_MX1);
	mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));

	iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
}
Exemple #4
0
int __init mx1_clocks_init(unsigned long fref)
{
	int i;

	clk[dummy] = imx_clk_fixed("dummy", 0);
	clk[clk32] = imx_clk_fixed("clk32", fref);
	clk[clk16m_ext] = imx_clk_fixed("clk16m_ext", 16000000);
	clk[clk16m] = imx_clk_gate("clk16m", "clk16m_ext", CCM_CSCR, 17);
	clk[clk32_premult] = imx_clk_fixed_factor("clk32_premult", "clk32", 512, 1);
	clk[prem] = imx_clk_mux("prem", CCM_CSCR, 16, 1, prem_sel_clks,
			ARRAY_SIZE(prem_sel_clks));
	clk[mpll] = imx_clk_pllv1("mpll", "clk32_premult", CCM_MPCTL0);
	clk[mpll_gate] = imx_clk_gate("mpll_gate", "mpll", CCM_CSCR, 0);
	clk[spll] = imx_clk_pllv1("spll", "prem", CCM_SPCTL0);
	clk[spll_gate] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
	clk[mcu] = imx_clk_divider("mcu", "clk32_premult", CCM_CSCR, 15, 1);
	clk[fclk] = imx_clk_divider("fclk", "mpll_gate", CCM_CSCR, 15, 1);
	clk[hclk] = imx_clk_divider("hclk", "spll_gate", CCM_CSCR, 10, 4);
	clk[clk48m] = imx_clk_divider("clk48m", "spll_gate", CCM_CSCR, 26, 3);
	clk[per1] = imx_clk_divider("per1", "spll_gate", CCM_PCDR, 0, 4);
	clk[per2] = imx_clk_divider("per2", "spll_gate", CCM_PCDR, 4, 4);
	clk[per3] = imx_clk_divider("per3", "spll_gate", CCM_PCDR, 16, 7);
	clk[clko] = imx_clk_mux("clko", CCM_CSCR, 29, 3, clko_sel_clks,
			ARRAY_SIZE(clko_sel_clks));
	clk[uart3_gate] = imx_clk_gate("uart3_gate", "hclk", SCM_GCCR, 6);
	clk[ssi2_gate] = imx_clk_gate("ssi2_gate", "hclk", SCM_GCCR, 5);
	clk[brom_gate] = imx_clk_gate("brom_gate", "hclk", SCM_GCCR, 4);
	clk[dma_gate] = imx_clk_gate("dma_gate", "hclk", SCM_GCCR, 3);
	clk[csi_gate] = imx_clk_gate("csi_gate", "hclk", SCM_GCCR, 2);
	clk[mma_gate] = imx_clk_gate("mma_gate", "hclk", SCM_GCCR, 1);
	clk[usbd_gate] = imx_clk_gate("usbd_gate", "clk48m", SCM_GCCR, 0);

	for (i = 0; i < ARRAY_SIZE(clk); i++)
		if (IS_ERR(clk[i]))
			pr_err("imx1 clk %d: register failed with %ld\n",
				i, PTR_ERR(clk[i]));

	clk_register_clkdev(clk[dma_gate], "ahb", "imx1-dma");
	clk_register_clkdev(clk[hclk], "ipg", "imx1-dma");
	clk_register_clkdev(clk[per1], "per", "imx-gpt.0");
	clk_register_clkdev(clk[hclk], "ipg", "imx-gpt.0");
	clk_register_clkdev(clk[per1], "per", "imx1-uart.0");
	clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.0");
	clk_register_clkdev(clk[per1], "per", "imx1-uart.1");
	clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.1");
	clk_register_clkdev(clk[per1], "per", "imx1-uart.2");
	clk_register_clkdev(clk[uart3_gate], "ipg", "imx1-uart.2");
	clk_register_clkdev(clk[hclk], NULL, "imx1-i2c.0");
	clk_register_clkdev(clk[per2], "per", "imx1-cspi.0");
	clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.0");
	clk_register_clkdev(clk[per2], "per", "imx1-cspi.1");
	clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.1");
	clk_register_clkdev(clk[per2], "per", "imx1-fb.0");
	clk_register_clkdev(clk[dummy], "ipg", "imx1-fb.0");
	clk_register_clkdev(clk[dummy], "ahb", "imx1-fb.0");

	mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT);

	return 0;
}
Exemple #5
0
void __init imx1_soc_init(void)
{
	imx1_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));
	mxc_device_init();

	mxc_register_gpio("imx1-gpio", 0, MX1_GPIO1_BASE_ADDR, SZ_256,
						MX1_GPIO_INT_PORTA, 0);
	mxc_register_gpio("imx1-gpio", 1, MX1_GPIO2_BASE_ADDR, SZ_256,
						MX1_GPIO_INT_PORTB, 0);
	mxc_register_gpio("imx1-gpio", 2, MX1_GPIO3_BASE_ADDR, SZ_256,
						MX1_GPIO_INT_PORTC, 0);
	mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256,
						MX1_GPIO_INT_PORTD, 0);
	imx_add_imx_dma("imx1-dma", MX1_DMA_BASE_ADDR,
			MX1_DMA_INT, MX1_DMA_ERR);
	pinctrl_provide_dummies();
}
static int imx_iomuxv1_init(void)
{
#ifdef CONFIG_ARCH_MX1
	if (cpu_is_mx1()) {
		imx_iomuxv1_baseaddr = MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR);
		imx_iomuxv1_numports = MX1_NUM_GPIO_PORT;
	} else
#endif
#ifdef CONFIG_MACH_MX21
	if (cpu_is_mx21()) {
		imx_iomuxv1_baseaddr = MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR);
		imx_iomuxv1_numports = MX21_NUM_GPIO_PORT;
	} else
#endif
#ifdef CONFIG_MACH_MX27
	if (cpu_is_mx27()) {
		imx_iomuxv1_baseaddr = MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR);
		imx_iomuxv1_numports = MX27_NUM_GPIO_PORT;
	} else
#endif
		return -ENODEV;

	return 0;
}
Exemple #7
0
void __init mx1_init_irq(void)
{
	mxc_init_irq(MX1_IO_ADDRESS(MX1_AVIC_BASE_ADDR));
}
Exemple #8
0
        .flags	= IORESOURCE_IRQ,
    },
};

struct platform_device imx_usb_device = {
    .name		= "imx_udc",
    .id		= 0,
    .num_resources	= ARRAY_SIZE(imx_usb_resources),
    .resource	= imx_usb_resources,
};

/* GPIO port description */
static struct mxc_gpio_port imx_gpio_ports[] = {
    {
        .chip.label = "gpio-0",
        .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR),
        .irq = MX1_GPIO_INT_PORTA,
        .virtual_irq_start = MXC_GPIO_IRQ_START,
    }, {
        .chip.label = "gpio-1",
        .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x100),
        .irq = MX1_GPIO_INT_PORTB,
        .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
    }, {
        .chip.label = "gpio-2",
        .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x200),
        .irq = MX1_GPIO_INT_PORTC,
        .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
    }, {
        .chip.label = "gpio-3",
        .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x300),
Exemple #9
0
void __init mx1_init_irq(void)
{
	mxc_init_irq(MX1_IO_ADDRESS(MX1_AVIC_BASE_ADDR));
	imx1_register_gpios();
}