packaging: release out (3.8.3)
[profile/ivi/kernel-adaptation-intel-automotive.git] / arch / m68k / platform / coldfire / m523x.c
1 /***************************************************************************/
2
3 /*
4  *      linux/arch/m68knommu/platform/523x/config.c
5  *
6  *      Sub-architcture dependent initialization code for the Freescale
7  *      523x CPUs.
8  *
9  *      Copyright (C) 1999-2005, Greg Ungerer (gerg@snapgear.com)
10  *      Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
11  */
12
13 /***************************************************************************/
14
15 #include <linux/kernel.h>
16 #include <linux/param.h>
17 #include <linux/init.h>
18 #include <linux/io.h>
19 #include <asm/machdep.h>
20 #include <asm/coldfire.h>
21 #include <asm/mcfsim.h>
22 #include <asm/mcfclk.h>
23
24 /***************************************************************************/
25
26 DEFINE_CLK(pll, "pll.0", MCF_CLK);
27 DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
28 DEFINE_CLK(mcfpit0, "mcfpit.0", MCF_CLK);
29 DEFINE_CLK(mcfpit1, "mcfpit.1", MCF_CLK);
30 DEFINE_CLK(mcfpit2, "mcfpit.2", MCF_CLK);
31 DEFINE_CLK(mcfpit3, "mcfpit.3", MCF_CLK);
32 DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
33 DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
34 DEFINE_CLK(mcfuart2, "mcfuart.2", MCF_BUSCLK);
35 DEFINE_CLK(fec0, "fec.0", MCF_BUSCLK);
36
37 struct clk *mcf_clks[] = {
38         &clk_pll,
39         &clk_sys,
40         &clk_mcfpit0,
41         &clk_mcfpit1,
42         &clk_mcfpit2,
43         &clk_mcfpit3,
44         &clk_mcfuart0,
45         &clk_mcfuart1,
46         &clk_mcfuart2,
47         &clk_fec0,
48         NULL
49 };
50
51 /***************************************************************************/
52
53 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
54
55 static void __init m523x_qspi_init(void)
56 {
57         u16 par;
58
59         /* setup QSPS pins for QSPI with gpio CS control */
60         writeb(0x1f, MCFGPIO_PAR_QSPI);
61         /* and CS2 & CS3 as gpio */
62         par = readw(MCFGPIO_PAR_TIMER);
63         par &= 0x3f3f;
64         writew(par, MCFGPIO_PAR_TIMER);
65 }
66
67 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
68
69 /***************************************************************************/
70
71 static void __init m523x_fec_init(void)
72 {
73         /* Set multi-function pins to ethernet use */
74         writeb(readb(MCFGPIO_PAR_FECI2C) | 0xf0, MCFGPIO_PAR_FECI2C);
75 }
76
77 /***************************************************************************/
78
79 void __init config_BSP(char *commandp, int size)
80 {
81         mach_sched_init = hw_timer_init;
82         m523x_fec_init();
83 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
84         m523x_qspi_init();
85 #endif
86 }
87
88 /***************************************************************************/