2005-04-16 22:20:36 +00:00
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* linux/arch/m68knommu/platform/527x/config.c
|
|
|
|
*
|
2011-03-31 01:57:33 +00:00
|
|
|
* Sub-architcture dependent initialization code for the Freescale
|
2005-04-16 22:20:36 +00: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 07:34:40 +00:00
|
|
|
#include <linux/io.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <asm/machdep.h>
|
|
|
|
#include <asm/coldfire.h>
|
|
|
|
#include <asm/mcfsim.h>
|
2008-02-01 07:34:40 +00:00
|
|
|
#include <asm/mcfuart.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2011-12-24 02:56:10 +00:00
|
|
|
#ifdef CONFIG_SPI_COLDFIRE_QSPI
|
2010-01-22 20:43:03 +00: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
|
|
|
|
}
|
|
|
|
|
2011-12-24 02:56:10 +00:00
|
|
|
#endif /* CONFIG_SPI_COLDFIRE_QSPI */
|
2008-02-01 07:34:40 +00:00
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2011-12-23 14:59:03 +00:00
|
|
|
static void __init m527x_uarts_init(void)
|
2008-02-01 07:34:40 +00:00
|
|
|
{
|
|
|
|
u16 sepmask;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* External Pin Mask Setting & Enable External Pin for Interface
|
|
|
|
*/
|
|
|
|
sepmask = readw(MCF_IPSBAR + MCF_GPIO_PAR_UART);
|
2011-12-23 14:59:03 +00:00
|
|
|
sepmask |= UART0_ENABLE_MASK | UART1_ENABLE_MASK | UART2_ENABLE_MASK;
|
2008-02-01 07:34:40 +00:00
|
|
|
writew(sepmask, MCF_IPSBAR + MCF_GPIO_PAR_UART);
|
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/***************************************************************************/
|
|
|
|
|
2009-02-27 06:40:38 +00:00
|
|
|
static void __init m527x_fec_init(void)
|
|
|
|
{
|
|
|
|
u16 par;
|
|
|
|
u8 v;
|
|
|
|
|
|
|
|
/* Set multi-function pins to ethernet mode for fec0 */
|
2009-04-08 01:51:27 +00:00
|
|
|
#if defined(CONFIG_M5271)
|
|
|
|
v = readb(MCF_IPSBAR + 0x100047);
|
|
|
|
writeb(v | 0xf0, MCF_IPSBAR + 0x100047);
|
|
|
|
#else
|
2009-02-27 06:40:38 +00:00
|
|
|
par = readw(MCF_IPSBAR + 0x100082);
|
|
|
|
writew(par | 0xf00, MCF_IPSBAR + 0x100082);
|
|
|
|
v = readb(MCF_IPSBAR + 0x100078);
|
|
|
|
writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
|
|
|
|
|
|
|
|
/* Set multi-function pins to ethernet mode for fec1 */
|
|
|
|
par = readw(MCF_IPSBAR + 0x100082);
|
|
|
|
writew(par | 0xa0, MCF_IPSBAR + 0x100082);
|
|
|
|
v = readb(MCF_IPSBAR + 0x100079);
|
|
|
|
writeb(v | 0xc0, MCF_IPSBAR + 0x100079);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2008-02-01 07:34:40 +00:00
|
|
|
void __init config_BSP(char *commandp, int size)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2012-01-23 05:34:58 +00:00
|
|
|
mach_sched_init = hw_timer_init;
|
2009-02-27 06:40:38 +00:00
|
|
|
m527x_uarts_init();
|
|
|
|
m527x_fec_init();
|
2011-12-24 02:56:10 +00:00
|
|
|
#ifdef CONFIG_SPI_COLDFIRE_QSPI
|
2010-01-22 20:43:03 +00:00
|
|
|
m527x_qspi_init();
|
|
|
|
#endif
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|