2005-04-17 06:20:36 +08:00
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* linux/arch/m68knommu/platform/527x/config.c
|
|
|
|
*
|
2011-03-31 09:57:33 +08:00
|
|
|
* Sub-architcture dependent initialization code for the Freescale
|
2005-04-17 06:20:36 +08:00
|
|
|
* 5270/5271 CPUs.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999-2004, Greg Ungerer (gerg@snapgear.com)
|
|
|
|
* Copyright (C) 2001-2004, SnapGear Inc. (www.snapgear.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/param.h>
|
|
|
|
#include <linux/init.h>
|
2008-02-01 15:34:40 +08:00
|
|
|
#include <linux/io.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm/machdep.h>
|
|
|
|
#include <asm/coldfire.h>
|
|
|
|
#include <asm/mcfsim.h>
|
2008-02-01 15:34:40 +08:00
|
|
|
#include <asm/mcfuart.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2012-05-07 03:22:53 +08:00
|
|
|
#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
|
2010-01-23 04:43:03 +08:00
|
|
|
|
|
|
|
static void __init m527x_qspi_init(void)
|
|
|
|
{
|
|
|
|
#if defined(CONFIG_M5271)
|
|
|
|
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);
|
|
|
|
#elif defined(CONFIG_M5275)
|
|
|
|
/* setup QSPS pins for QSPI with gpio CS control */
|
|
|
|
writew(0x003e, MCFGPIO_PAR_QSPI);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-05-07 03:22:53 +08:00
|
|
|
#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
|
2008-02-01 15:34:40 +08:00
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2011-12-23 22:59:03 +08:00
|
|
|
static void __init m527x_uarts_init(void)
|
2008-02-01 15:34:40 +08:00
|
|
|
{
|
|
|
|
u16 sepmask;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* External Pin Mask Setting & Enable External Pin for Interface
|
|
|
|
*/
|
2012-09-17 10:07:21 +08:00
|
|
|
sepmask = readw(MCFGPIO_PAR_UART);
|
2011-12-23 22:59:03 +08:00
|
|
|
sepmask |= UART0_ENABLE_MASK | UART1_ENABLE_MASK | UART2_ENABLE_MASK;
|
2012-09-17 10:07:21 +08:00
|
|
|
writew(sepmask, MCFGPIO_PAR_UART);
|
2008-02-01 15:34:40 +08:00
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/***************************************************************************/
|
|
|
|
|
2009-02-27 14:40:38 +08:00
|
|
|
static void __init m527x_fec_init(void)
|
|
|
|
{
|
|
|
|
u16 par;
|
|
|
|
u8 v;
|
|
|
|
|
|
|
|
/* Set multi-function pins to ethernet mode for fec0 */
|
2009-04-08 09:51:27 +08:00
|
|
|
#if defined(CONFIG_M5271)
|
2012-09-17 10:07:21 +08:00
|
|
|
v = readb(MCFGPIO_PAR_FECI2C);
|
|
|
|
writeb(v | 0xf0, MCFGPIO_PAR_FECI2C);
|
2009-04-08 09:51:27 +08:00
|
|
|
#else
|
2012-09-17 10:07:21 +08:00
|
|
|
par = readw(MCFGPIO_PAR_FECI2C);
|
|
|
|
writew(par | 0xf00, MCFGPIO_PAR_FECI2C);
|
|
|
|
v = readb(MCFGPIO_PAR_FEC0HL);
|
|
|
|
writeb(v | 0xc0, MCFGPIO_PAR_FEC0HL);
|
2009-02-27 14:40:38 +08:00
|
|
|
|
|
|
|
/* Set multi-function pins to ethernet mode for fec1 */
|
2012-09-17 10:07:21 +08:00
|
|
|
par = readw(MCFGPIO_PAR_FECI2C);
|
|
|
|
writew(par | 0xa0, MCFGPIO_PAR_FECI2C);
|
|
|
|
v = readb(MCFGPIO_PAR_FEC1HL);
|
|
|
|
writeb(v | 0xc0, MCFGPIO_PAR_FEC1HL);
|
2009-02-27 14:40:38 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2008-02-01 15:34:40 +08:00
|
|
|
void __init config_BSP(char *commandp, int size)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2012-01-23 13:34:58 +08:00
|
|
|
mach_sched_init = hw_timer_init;
|
2009-02-27 14:40:38 +08:00
|
|
|
m527x_uarts_init();
|
|
|
|
m527x_fec_init();
|
2012-05-07 03:22:53 +08:00
|
|
|
#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
|
2010-01-23 04:43:03 +08:00
|
|
|
m527x_qspi_init();
|
|
|
|
#endif
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|