2005-09-02 10:42:52 +10:00
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* linux/arch/m68knommu/platform/523x/config.c
|
|
|
|
*
|
2011-03-30 22:57:33 -03:00
|
|
|
* Sub-architcture dependent initialization code for the Freescale
|
2005-09-02 10:42:52 +10:00
|
|
|
* 523x CPUs.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999-2005, Greg Ungerer (gerg@snapgear.com)
|
|
|
|
* Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/param.h>
|
|
|
|
#include <linux/init.h>
|
2008-02-01 17:34:15 +10:00
|
|
|
#include <linux/io.h>
|
2005-09-02 10:42:52 +10:00
|
|
|
#include <asm/machdep.h>
|
|
|
|
#include <asm/coldfire.h>
|
|
|
|
#include <asm/mcfsim.h>
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2012-05-06 12:22:53 -07:00
|
|
|
#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
|
2010-01-22 12:43:03 -08:00
|
|
|
|
|
|
|
static void __init m523x_qspi_init(void)
|
|
|
|
{
|
|
|
|
u16 par;
|
|
|
|
|
|
|
|
/* setup QSPS pins for QSPI with gpio CS control */
|
|
|
|
writeb(0x1f, MCFGPIO_PAR_QSPI);
|
|
|
|
/* and CS2 & CS3 as gpio */
|
|
|
|
par = readw(MCFGPIO_PAR_TIMER);
|
|
|
|
par &= 0x3f3f;
|
|
|
|
writew(par, MCFGPIO_PAR_TIMER);
|
|
|
|
}
|
|
|
|
|
2012-05-06 12:22:53 -07:00
|
|
|
#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
|
2005-09-02 10:42:52 +10:00
|
|
|
|
2008-02-01 17:34:15 +10:00
|
|
|
/***************************************************************************/
|
|
|
|
|
2009-08-12 16:14:43 +10:00
|
|
|
static void __init m523x_fec_init(void)
|
|
|
|
{
|
|
|
|
/* Set multi-function pins to ethernet use */
|
2012-09-18 12:14:18 +10:00
|
|
|
writeb(readb(MCFGPIO_PAR_FECI2C) | 0xf0, MCFGPIO_PAR_FECI2C);
|
2009-08-12 16:14:43 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2008-02-01 17:34:15 +10:00
|
|
|
void __init config_BSP(char *commandp, int size)
|
2005-09-02 10:42:52 +10:00
|
|
|
{
|
2012-01-23 15:34:58 +10:00
|
|
|
mach_sched_init = hw_timer_init;
|
2011-12-24 13:00:02 +10:00
|
|
|
m523x_fec_init();
|
2012-05-06 12:22:53 -07:00
|
|
|
#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
|
2010-01-22 12:43:03 -08:00
|
|
|
m523x_qspi_init();
|
|
|
|
#endif
|
2008-02-01 17:34:15 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|