1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2f86b9e03SGreg Ungerer /***************************************************************************/
3f86b9e03SGreg Ungerer
4f86b9e03SGreg Ungerer /*
5ece9ae65SGreg Ungerer * m5407.c -- platform support for ColdFire 5407 based boards
6f86b9e03SGreg Ungerer *
7f86b9e03SGreg Ungerer * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
8f86b9e03SGreg Ungerer * Copyright (C) 2000, Lineo (www.lineo.com)
9f86b9e03SGreg Ungerer */
10f86b9e03SGreg Ungerer
11f86b9e03SGreg Ungerer /***************************************************************************/
12f86b9e03SGreg Ungerer
13*63aadb77SArnd Bergmann #include <linux/clkdev.h>
14f86b9e03SGreg Ungerer #include <linux/kernel.h>
15f86b9e03SGreg Ungerer #include <linux/param.h>
16f86b9e03SGreg Ungerer #include <linux/init.h>
17f86b9e03SGreg Ungerer #include <linux/io.h>
18f86b9e03SGreg Ungerer #include <asm/machdep.h>
19f86b9e03SGreg Ungerer #include <asm/coldfire.h>
20f86b9e03SGreg Ungerer #include <asm/mcfsim.h>
21f86b9e03SGreg Ungerer #include <asm/mcfclk.h>
22f86b9e03SGreg Ungerer
23f86b9e03SGreg Ungerer /***************************************************************************/
24f86b9e03SGreg Ungerer
25f86b9e03SGreg Ungerer DEFINE_CLK(pll, "pll.0", MCF_CLK);
26f86b9e03SGreg Ungerer DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
27f86b9e03SGreg Ungerer
28*63aadb77SArnd Bergmann static struct clk_lookup m5407_clk_lookup[] = {
29*63aadb77SArnd Bergmann CLKDEV_INIT(NULL, "pll.0", &clk_pll),
30*63aadb77SArnd Bergmann CLKDEV_INIT(NULL, "sys.0", &clk_sys),
31*63aadb77SArnd Bergmann CLKDEV_INIT("mcftmr.0", NULL, &clk_sys),
32*63aadb77SArnd Bergmann CLKDEV_INIT("mcftmr.1", NULL, &clk_sys),
33*63aadb77SArnd Bergmann CLKDEV_INIT("mcfuart.0", NULL, &clk_sys),
34*63aadb77SArnd Bergmann CLKDEV_INIT("mcfuart.1", NULL, &clk_sys),
35*63aadb77SArnd Bergmann CLKDEV_INIT("imx1-i2c.0", NULL, &clk_sys),
36f86b9e03SGreg Ungerer };
37f86b9e03SGreg Ungerer
38f86b9e03SGreg Ungerer /***************************************************************************/
39f86b9e03SGreg Ungerer
m5407_i2c_init(void)402d24b532SSteven King static void __init m5407_i2c_init(void)
412d24b532SSteven King {
422d24b532SSteven King #if IS_ENABLED(CONFIG_I2C_IMX)
432d24b532SSteven King writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL5 | MCFSIM_ICR_PRI0,
442d24b532SSteven King MCFSIM_I2CICR);
452d24b532SSteven King mcf_mapirq2imr(MCF_IRQ_I2C0, MCFINTC_I2C);
462d24b532SSteven King #endif /* IS_ENABLED(CONFIG_I2C_IMX) */
472d24b532SSteven King }
482d24b532SSteven King
492d24b532SSteven King /***************************************************************************/
502d24b532SSteven King
config_BSP(char * commandp,int size)51f86b9e03SGreg Ungerer void __init config_BSP(char *commandp, int size)
52f86b9e03SGreg Ungerer {
53f86b9e03SGreg Ungerer mach_sched_init = hw_timer_init;
54f86b9e03SGreg Ungerer
55f86b9e03SGreg Ungerer /* Only support the external interrupts on their primary level */
56f86b9e03SGreg Ungerer mcf_mapirq2imr(25, MCFINTC_EINT1);
57f86b9e03SGreg Ungerer mcf_mapirq2imr(27, MCFINTC_EINT3);
58f86b9e03SGreg Ungerer mcf_mapirq2imr(29, MCFINTC_EINT5);
59f86b9e03SGreg Ungerer mcf_mapirq2imr(31, MCFINTC_EINT7);
602d24b532SSteven King m5407_i2c_init();
61*63aadb77SArnd Bergmann
62*63aadb77SArnd Bergmann clkdev_add_table(m5407_clk_lookup, ARRAY_SIZE(m5407_clk_lookup));
63f86b9e03SGreg Ungerer }
64f86b9e03SGreg Ungerer
65f86b9e03SGreg Ungerer /***************************************************************************/
66