Greg Ungerer | b5aaf3f | 2005-09-02 10:42:52 +1000 | [diff] [blame] | 1 | /***************************************************************************/ |
| 2 | |
| 3 | /* |
| 4 | * linux/arch/m68knommu/platform/523x/config.c |
| 5 | * |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 6 | * Sub-architcture dependent initialization code for the Freescale |
Greg Ungerer | b5aaf3f | 2005-09-02 10:42:52 +1000 | [diff] [blame] | 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 | |
Greg Ungerer | b5aaf3f | 2005-09-02 10:42:52 +1000 | [diff] [blame] | 15 | #include <linux/kernel.h> |
Greg Ungerer | b5aaf3f | 2005-09-02 10:42:52 +1000 | [diff] [blame] | 16 | #include <linux/param.h> |
| 17 | #include <linux/init.h> |
Greg Ungerer | 4b61a35 | 2008-02-01 17:34:15 +1000 | [diff] [blame] | 18 | #include <linux/io.h> |
Greg Ungerer | b5aaf3f | 2005-09-02 10:42:52 +1000 | [diff] [blame] | 19 | #include <asm/machdep.h> |
| 20 | #include <asm/coldfire.h> |
| 21 | #include <asm/mcfsim.h> |
Greg Ungerer | b5aaf3f | 2005-09-02 10:42:52 +1000 | [diff] [blame] | 22 | |
| 23 | /***************************************************************************/ |
| 24 | |
Greg Ungerer | fa1fc24 | 2011-12-24 12:56:10 +1000 | [diff] [blame] | 25 | #ifdef CONFIG_SPI_COLDFIRE_QSPI |
Steven King | 91d6041 | 2010-01-22 12:43:03 -0800 | [diff] [blame] | 26 | |
| 27 | static void __init m523x_qspi_init(void) |
| 28 | { |
| 29 | u16 par; |
| 30 | |
| 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); |
| 37 | } |
Steven King | 91d6041 | 2010-01-22 12:43:03 -0800 | [diff] [blame] | 38 | |
Greg Ungerer | fa1fc24 | 2011-12-24 12:56:10 +1000 | [diff] [blame] | 39 | #endif /* CONFIG_SPI_COLDFIRE_QSPI */ |
Greg Ungerer | 4b61a35 | 2008-02-01 17:34:15 +1000 | [diff] [blame] | 40 | |
| 41 | /***************************************************************************/ |
| 42 | |
Greg Ungerer | 14c16db | 2009-08-12 16:14:43 +1000 | [diff] [blame] | 43 | static void __init m523x_fec_init(void) |
| 44 | { |
| 45 | u16 par; |
| 46 | u8 v; |
| 47 | |
| 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); |
| 53 | } |
| 54 | |
| 55 | /***************************************************************************/ |
| 56 | |
Greg Ungerer | 4b61a35 | 2008-02-01 17:34:15 +1000 | [diff] [blame] | 57 | void __init config_BSP(char *commandp, int size) |
Greg Ungerer | b5aaf3f | 2005-09-02 10:42:52 +1000 | [diff] [blame] | 58 | { |
Greg Ungerer | 35aefb2 | 2012-01-23 15:34:58 +1000 | [diff] [blame] | 59 | mach_sched_init = hw_timer_init; |
Greg Ungerer | 2ba168a | 2011-12-24 13:00:02 +1000 | [diff] [blame] | 60 | m523x_fec_init(); |
Greg Ungerer | fa1fc24 | 2011-12-24 12:56:10 +1000 | [diff] [blame] | 61 | #ifdef CONFIG_SPI_COLDFIRE_QSPI |
Steven King | 91d6041 | 2010-01-22 12:43:03 -0800 | [diff] [blame] | 62 | m523x_qspi_init(); |
| 63 | #endif |
Greg Ungerer | 4b61a35 | 2008-02-01 17:34:15 +1000 | [diff] [blame] | 64 | } |
| 65 | |
Greg Ungerer | 4b61a35 | 2008-02-01 17:34:15 +1000 | [diff] [blame] | 66 | /***************************************************************************/ |