diff options
Diffstat (limited to 'arch/m68k/platform/coldfire/m523x.c')
-rw-r--r-- | arch/m68k/platform/coldfire/m523x.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/arch/m68k/platform/coldfire/m523x.c b/arch/m68k/platform/coldfire/m523x.c new file mode 100644 index 000000000000..5d57a4249412 --- /dev/null +++ b/arch/m68k/platform/coldfire/m523x.c | |||
@@ -0,0 +1,88 @@ | |||
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/mcfgpio.h> | ||
23 | |||
24 | /***************************************************************************/ | ||
25 | |||
26 | struct mcf_gpio_chip mcf_gpio_chips[] = { | ||
27 | MCFGPS(PIRQ, 1, 7, MCFEPORT_EPDDR, MCFEPORT_EPDR, MCFEPORT_EPPDR), | ||
28 | MCFGPF(ADDR, 13, 3), | ||
29 | MCFGPF(DATAH, 16, 8), | ||
30 | MCFGPF(DATAL, 24, 8), | ||
31 | MCFGPF(BUSCTL, 32, 8), | ||
32 | MCFGPF(BS, 40, 4), | ||
33 | MCFGPF(CS, 49, 7), | ||
34 | MCFGPF(SDRAM, 56, 6), | ||
35 | MCFGPF(FECI2C, 64, 4), | ||
36 | MCFGPF(UARTH, 72, 2), | ||
37 | MCFGPF(UARTL, 80, 8), | ||
38 | MCFGPF(QSPI, 88, 5), | ||
39 | MCFGPF(TIMER, 96, 8), | ||
40 | MCFGPF(ETPU, 104, 3), | ||
41 | }; | ||
42 | |||
43 | unsigned int mcf_gpio_chips_size = ARRAY_SIZE(mcf_gpio_chips); | ||
44 | |||
45 | /***************************************************************************/ | ||
46 | |||
47 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) | ||
48 | |||
49 | static void __init m523x_qspi_init(void) | ||
50 | { | ||
51 | u16 par; | ||
52 | |||
53 | /* setup QSPS pins for QSPI with gpio CS control */ | ||
54 | writeb(0x1f, MCFGPIO_PAR_QSPI); | ||
55 | /* and CS2 & CS3 as gpio */ | ||
56 | par = readw(MCFGPIO_PAR_TIMER); | ||
57 | par &= 0x3f3f; | ||
58 | writew(par, MCFGPIO_PAR_TIMER); | ||
59 | } | ||
60 | |||
61 | #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ | ||
62 | |||
63 | /***************************************************************************/ | ||
64 | |||
65 | static void __init m523x_fec_init(void) | ||
66 | { | ||
67 | u16 par; | ||
68 | u8 v; | ||
69 | |||
70 | /* Set multi-function pins to ethernet use */ | ||
71 | par = readw(MCF_IPSBAR + 0x100082); | ||
72 | writew(par | 0xf00, MCF_IPSBAR + 0x100082); | ||
73 | v = readb(MCF_IPSBAR + 0x100078); | ||
74 | writeb(v | 0xc0, MCF_IPSBAR + 0x100078); | ||
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 | /***************************************************************************/ | ||