Adding support for MOXA ART SoC. Testing port of linux-2.6.32.60-moxart.
[linux-3.6.7-moxart.git] / arch / m68k / platform / coldfire / m523x.c
blobd47dfd8f50a2dbfb292933de84f6b764931153c9
1 /***************************************************************************/
3 /*
4 * linux/arch/m68knommu/platform/523x/config.c
6 * Sub-architcture dependent initialization code for the Freescale
7 * 523x CPUs.
9 * Copyright (C) 1999-2005, Greg Ungerer (gerg@snapgear.com)
10 * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
13 /***************************************************************************/
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>
23 /***************************************************************************/
25 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
27 static void __init m523x_qspi_init(void)
29 u16 par;
31 /* setup QSPS pins for QSPI with gpio CS control */
32 writeb(0x1f, MCFGPIO_PAR_QSPI);
33 /* and CS2 & CS3 as gpio */
34 par = readw(MCFGPIO_PAR_TIMER);
35 par &= 0x3f3f;
36 writew(par, MCFGPIO_PAR_TIMER);
39 #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
41 /***************************************************************************/
43 static void __init m523x_fec_init(void)
45 u16 par;
46 u8 v;
48 /* Set multi-function pins to ethernet use */
49 par = readw(MCF_IPSBAR + 0x100082);
50 writew(par | 0xf00, MCF_IPSBAR + 0x100082);
51 v = readb(MCF_IPSBAR + 0x100078);
52 writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
55 /***************************************************************************/
57 void __init config_BSP(char *commandp, int size)
59 mach_sched_init = hw_timer_init;
60 m523x_fec_init();
61 #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
62 m523x_qspi_init();
63 #endif
66 /***************************************************************************/