Commit e6b6239f authored by Andrei Konovalov's avatar Andrei Konovalov Committed by Linus Torvalds

[PATCH] ppc32: add Freescale MPC885ADS board support

This patch adds the Freescale MPC86xADS board support.  The supported
devices are SMC UART and 10Mbit ethernet on SCC1.

The manual for the board says that it "is compatible with the MPC8xxFADS
for software point of view".  That's why this patch extends FADS instead of
introducing a new platform.

FEC is not supported as the "combined FCC/FEC ethernet driver" driver by
Pantelis Antoniou should replace the current FEC driver.
Signed-off-by: default avatarGennadiy Kurtsman <gkurtsman@ru.mvista.com>
Signed-off-by: default avatarAndrei Konovalov <akonovalov@ru.mvista.com>
Acked-by: default avatarTom Rini <trini@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5432ebb5
...@@ -714,16 +714,24 @@ static int __init scc_enet_init(void) ...@@ -714,16 +714,24 @@ static int __init scc_enet_init(void)
immap->im_ioport.iop_pcdat &= ~PC_ENET_LBK; /* Disable Loopback */ immap->im_ioport.iop_pcdat &= ~PC_ENET_LBK; /* Disable Loopback */
#endif /* PC_ENET_LBK */ #endif /* PC_ENET_LBK */
/* Configure port C pins to enable CLSN and RENA. #ifdef PE_ENET_TCLK
/* Configure port E for TCLK and RCLK.
*/ */
immap->im_ioport.iop_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA); cp->cp_pepar |= (PE_ENET_TCLK | PE_ENET_RCLK);
immap->im_ioport.iop_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA); cp->cp_pedir &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
immap->im_ioport.iop_pcso |= (PC_ENET_CLSN | PC_ENET_RENA); cp->cp_peso &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
#else
/* Configure port A for TCLK and RCLK. /* Configure port A for TCLK and RCLK.
*/ */
immap->im_ioport.iop_papar |= (PA_ENET_TCLK | PA_ENET_RCLK); immap->im_ioport.iop_papar |= (PA_ENET_TCLK | PA_ENET_RCLK);
immap->im_ioport.iop_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK); immap->im_ioport.iop_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK);
#endif
/* Configure port C pins to enable CLSN and RENA.
*/
immap->im_ioport.iop_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA);
immap->im_ioport.iop_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA);
immap->im_ioport.iop_pcso |= (PC_ENET_CLSN | PC_ENET_RENA);
/* Configure Serial Interface clock routing. /* Configure Serial Interface clock routing.
* First, clear all SCC bits to zero, then set the ones we want. * First, clear all SCC bits to zero, then set the ones we want.
...@@ -896,14 +904,18 @@ static int __init scc_enet_init(void) ...@@ -896,14 +904,18 @@ static int __init scc_enet_init(void)
/* It is now OK to enable the Ethernet transmitter. /* It is now OK to enable the Ethernet transmitter.
* Unfortunately, there are board implementation differences here. * Unfortunately, there are board implementation differences here.
*/ */
#if (!defined (PB_ENET_TENA) && defined (PC_ENET_TENA)) #if (!defined (PB_ENET_TENA) && defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
immap->im_ioport.iop_pcpar |= PC_ENET_TENA; immap->im_ioport.iop_pcpar |= PC_ENET_TENA;
immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA; immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA;
#elif ( defined (PB_ENET_TENA) && !defined (PC_ENET_TENA)) #elif ( defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
cp->cp_pbpar |= PB_ENET_TENA; cp->cp_pbpar |= PB_ENET_TENA;
cp->cp_pbdir |= PB_ENET_TENA; cp->cp_pbdir |= PB_ENET_TENA;
#elif ( !defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && defined (PE_ENET_TENA))
cp->cp_pepar |= PE_ENET_TENA;
cp->cp_pedir &= ~PE_ENET_TENA;
cp->cp_peso |= PE_ENET_TENA;
#else #else
#error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA #error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA, PE_ENET_TENA
#endif #endif
#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) #if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
...@@ -936,6 +948,29 @@ static int __init scc_enet_init(void) ...@@ -936,6 +948,29 @@ static int __init scc_enet_init(void)
*((volatile uint *)BCSR1) &= ~BCSR1_ETHEN; *((volatile uint *)BCSR1) &= ~BCSR1_ETHEN;
#endif #endif
#ifdef CONFIG_MPC885ADS
/* Deassert PHY reset and enable the PHY.
*/
{
volatile uint __iomem *bcsr = ioremap(BCSR_ADDR, BCSR_SIZE);
uint tmp;
tmp = in_be32(bcsr + 1 /* BCSR1 */);
tmp |= BCSR1_ETHEN;
out_be32(bcsr + 1, tmp);
tmp = in_be32(bcsr + 4 /* BCSR4 */);
tmp |= BCSR4_ETH10_RST;
out_be32(bcsr + 4, tmp);
iounmap(bcsr);
}
/* On MPC885ADS SCC ethernet PHY defaults to the full duplex mode
* upon reset. SCC is set to half duplex by default. So this
* inconsistency should be better fixed by the software.
*/
#endif
dev->base_addr = (unsigned long)ep; dev->base_addr = (unsigned long)ep;
#if 0 #if 0
dev->name = "CPM_ENET"; dev->name = "CPM_ENET";
...@@ -969,3 +1004,4 @@ static int __init scc_enet_init(void) ...@@ -969,3 +1004,4 @@ static int __init scc_enet_init(void)
} }
module_init(scc_enet_init); module_init(scc_enet_init);
...@@ -284,6 +284,9 @@ endmenu ...@@ -284,6 +284,9 @@ endmenu
menu "Platform options" menu "Platform options"
config FADS
bool
choice choice
prompt "8xx Machine Type" prompt "8xx Machine Type"
depends on 8xx depends on 8xx
...@@ -399,8 +402,25 @@ config BSEIP ...@@ -399,8 +402,25 @@ config BSEIP
26MB DRAM, 4MB flash, Ethernet, a 16K-gate FPGA, USB, an LCD/video 26MB DRAM, 4MB flash, Ethernet, a 16K-gate FPGA, USB, an LCD/video
controller, and two RS232 ports. controller, and two RS232 ports.
config FADS config MPC8XXFADS
bool "FADS" bool "FADS"
select FADS
config MPC86XADS
bool "MPC86XADS"
help
MPC86x Application Development System by Freescale Semiconductor.
The MPC86xADS is meant to serve as a platform for s/w and h/w
development around the MPC86X processor families.
select FADS
config MPC885ADS
bool "MPC885ADS"
help
Freescale Semiconductor MPC885 Application Development System (ADS).
Also known as DUET.
The MPC885ADS is meant to serve as a platform for s/w and h/w
development around the MPC885 processor family.
config TQM823L config TQM823L
bool "TQM823L" bool "TQM823L"
......
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,18 @@ ...@@ -3,7 +3,18 @@
* the Motorola 860T FADS board. Copied from the MBX stuff. * the Motorola 860T FADS board. Copied from the MBX stuff.
* *
* Copyright (c) 1998 Dan Malek (dmalek@jlc.net) * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
*
* Added MPC86XADS support.
* The MPC86xADS manual says the board "is compatible with the MPC8xxFADS
* for SW point of view". This is 99% correct.
*
* Author: MontaVista Software, Inc.
* source@mvista.com
* 2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is licensed
* "as is" without any warranty of any kind, whether express or implied.
*/ */
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef __ASM_FADS_H__ #ifndef __ASM_FADS_H__
#define __ASM_FADS_H__ #define __ASM_FADS_H__
...@@ -12,18 +23,45 @@ ...@@ -12,18 +23,45 @@
#include <asm/ppcboot.h> #include <asm/ppcboot.h>
#if defined(CONFIG_MPC86XADS)
/* U-Boot maps BCSR to 0xff080000 */
#define BCSR_ADDR ((uint)0xff080000)
/* MPC86XADS has one more CPLD and an additional BCSR.
*/
#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
#define BCSR5_T1_RST 0x10
#define BCSR5_ATM155_RST 0x08
#define BCSR5_ATM25_RST 0x04
#define BCSR5_MII1_EN 0x02
#define BCSR5_MII1_RST 0x01
/* There is no PHY link change interrupt */
#define PHY_INTERRUPT (-1)
#else /* FADS */
/* Memory map is configured by the PROM startup. /* Memory map is configured by the PROM startup.
* I tried to follow the FADS manual, although the startup PROM * I tried to follow the FADS manual, although the startup PROM
* dictates this and we simply have to move some of the physical * dictates this and we simply have to move some of the physical
* addresses for Linux. * addresses for Linux.
*/ */
#define BCSR_ADDR ((uint)0xff010000) #define BCSR_ADDR ((uint)0xff010000)
/* PHY link change interrupt */
#define PHY_INTERRUPT SIU_IRQ2
#endif /* CONFIG_MPC86XADS */
#define BCSR_SIZE ((uint)(64 * 1024)) #define BCSR_SIZE ((uint)(64 * 1024))
#define BCSR0 ((uint)0xff010000) #define BCSR0 ((uint)(BCSR_ADDR + 0x00))
#define BCSR1 ((uint)0xff010004) #define BCSR1 ((uint)(BCSR_ADDR + 0x04))
#define BCSR2 ((uint)0xff010008) #define BCSR2 ((uint)(BCSR_ADDR + 0x08))
#define BCSR3 ((uint)0xff01000c) #define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
#define BCSR4 ((uint)0xff010010) #define BCSR4 ((uint)(BCSR_ADDR + 0x10))
#define IMAP_ADDR ((uint)0xff000000) #define IMAP_ADDR ((uint)0xff000000)
#define IMAP_SIZE ((uint)(64 * 1024)) #define IMAP_SIZE ((uint)(64 * 1024))
...@@ -34,8 +72,17 @@ ...@@ -34,8 +72,17 @@
/* Bits of interest in the BCSRs. /* Bits of interest in the BCSRs.
*/ */
#define BCSR1_ETHEN ((uint)0x20000000) #define BCSR1_ETHEN ((uint)0x20000000)
#define BCSR1_IRDAEN ((uint)0x10000000)
#define BCSR1_RS232EN_1 ((uint)0x01000000) #define BCSR1_RS232EN_1 ((uint)0x01000000)
#define BCSR1_PCCEN ((uint)0x00800000)
#define BCSR1_PCCVCC0 ((uint)0x00400000)
#define BCSR1_PCCVPP0 ((uint)0x00200000)
#define BCSR1_PCCVPP1 ((uint)0x00100000)
#define BCSR1_PCCVPP_MASK (BCSR1_PCCVPP0 | BCSR1_PCCVPP1)
#define BCSR1_RS232EN_2 ((uint)0x00040000) #define BCSR1_RS232EN_2 ((uint)0x00040000)
#define BCSR1_PCCVCC1 ((uint)0x00010000)
#define BCSR1_PCCVCC_MASK (BCSR1_PCCVCC0 | BCSR1_PCCVCC1)
#define BCSR4_ETHLOOP ((uint)0x80000000) /* EEST Loopback */ #define BCSR4_ETHLOOP ((uint)0x80000000) /* EEST Loopback */
#define BCSR4_EEFDX ((uint)0x40000000) /* EEST FDX enable */ #define BCSR4_EEFDX ((uint)0x40000000) /* EEST FDX enable */
#define BCSR4_FETH_EN ((uint)0x08000000) /* PHY enable */ #define BCSR4_FETH_EN ((uint)0x08000000) /* PHY enable */
...@@ -44,14 +91,64 @@ ...@@ -44,14 +91,64 @@
#define BCSR4_FETHFDE ((uint)0x02000000) /* PHY FDX advertise */ #define BCSR4_FETHFDE ((uint)0x02000000) /* PHY FDX advertise */
#define BCSR4_FETHRST ((uint)0x00200000) /* PHY Reset */ #define BCSR4_FETHRST ((uint)0x00200000) /* PHY Reset */
/* IO_BASE definition for pcmcia.
*/
#define _IO_BASE 0x80000000
#define _IO_BASE_SIZE 0x1000
#ifdef CONFIG_IDE
#define MAX_HWIFS 1
#endif
/* Interrupt level assignments. /* Interrupt level assignments.
*/ */
#define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */ #define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
#define PHY_INTERRUPT SIU_IRQ2 /* PHY link change interrupt */
/* We don't use the 8259. /* We don't use the 8259.
*/ */
#define NR_8259_INTS 0 #define NR_8259_INTS 0
/* CPM Ethernet through SCC1 or SCC2 */
#ifdef CONFIG_SCC1_ENET /* Probably 860 variant */
/* Bits in parallel I/O port registers that have to be set/cleared
* to configure the pins for SCC1 use.
* TCLK - CLK1, RCLK - CLK2.
*/
#define PA_ENET_RXD ((ushort)0x0001)
#define PA_ENET_TXD ((ushort)0x0002)
#define PA_ENET_TCLK ((ushort)0x0100)
#define PA_ENET_RCLK ((ushort)0x0200)
#define PB_ENET_TENA ((uint)0x00001000)
#define PC_ENET_CLSN ((ushort)0x0010)
#define PC_ENET_RENA ((ushort)0x0020)
/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
* SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
*/
#define SICR_ENET_MASK ((uint)0x000000ff)
#define SICR_ENET_CLKRT ((uint)0x0000002c)
#endif /* CONFIG_SCC1_ENET */
#ifdef CONFIG_SCC2_ENET /* Probably 823/850 variant */
/* Bits in parallel I/O port registers that have to be set/cleared
* to configure the pins for SCC1 use.
* TCLK - CLK1, RCLK - CLK2.
*/
#define PA_ENET_RXD ((ushort)0x0004)
#define PA_ENET_TXD ((ushort)0x0008)
#define PA_ENET_TCLK ((ushort)0x0400)
#define PA_ENET_RCLK ((ushort)0x0200)
#define PB_ENET_TENA ((uint)0x00002000)
#define PC_ENET_CLSN ((ushort)0x0040)
#define PC_ENET_RENA ((ushort)0x0080)
/* Control bits in the SICR to route TCLK and RCLK to
* SCC2. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
*/
#define SICR_ENET_MASK ((uint)0x0000ff00)
#define SICR_ENET_CLKRT ((uint)0x00002e00)
#endif /* CONFIG_SCC2_ENET */
#endif /* __ASM_FADS_H__ */ #endif /* __ASM_FADS_H__ */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
/*
* A collection of structures, addresses, and values associated with
* the Freescale MPC885ADS board.
* Copied from the FADS stuff.
*
* Author: MontaVista Software, Inc.
* source@mvista.com
*
* 2005 (c) MontaVista Software, Inc. This file is licensed under the
* terms of the GNU General Public License version 2. This program is licensed
* "as is" without any warranty of any kind, whether express or implied.
*/
#ifdef __KERNEL__
#ifndef __ASM_MPC885ADS_H__
#define __ASM_MPC885ADS_H__
#include <linux/config.h>
#include <asm/ppcboot.h>
/* U-Boot maps BCSR to 0xff080000 */
#define BCSR_ADDR ((uint)0xff080000)
#define BCSR_SIZE ((uint)32)
#define BCSR0 ((uint)(BCSR_ADDR + 0x00))
#define BCSR1 ((uint)(BCSR_ADDR + 0x04))
#define BCSR2 ((uint)(BCSR_ADDR + 0x08))
#define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
#define BCSR4 ((uint)(BCSR_ADDR + 0x10))
#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
#define IMAP_ADDR ((uint)0xff000000)
#define IMAP_SIZE ((uint)(64 * 1024))
#define PCMCIA_MEM_ADDR ((uint)0xff020000)
#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
/* Bits of interest in the BCSRs.
*/
#define BCSR1_ETHEN ((uint)0x20000000)
#define BCSR1_IRDAEN ((uint)0x10000000)
#define BCSR1_RS232EN_1 ((uint)0x01000000)
#define BCSR1_PCCEN ((uint)0x00800000)
#define BCSR1_PCCVCC0 ((uint)0x00400000)
#define BCSR1_PCCVPP0 ((uint)0x00200000)
#define BCSR1_PCCVPP1 ((uint)0x00100000)
#define BCSR1_PCCVPP_MASK (BCSR1_PCCVPP0 | BCSR1_PCCVPP1)
#define BCSR1_RS232EN_2 ((uint)0x00040000)
#define BCSR1_PCCVCC1 ((uint)0x00010000)
#define BCSR1_PCCVCC_MASK (BCSR1_PCCVCC0 | BCSR1_PCCVCC1)
#define BCSR4_ETH10_RST ((uint)0x80000000) /* 10Base-T PHY reset*/
#define BCSR4_USB_LO_SPD ((uint)0x04000000)
#define BCSR4_USB_VCC ((uint)0x02000000)
#define BCSR4_USB_FULL_SPD ((uint)0x00040000)
#define BCSR4_USB_EN ((uint)0x00020000)
#define BCSR5_MII2_EN 0x40
#define BCSR5_MII2_RST 0x20
#define BCSR5_T1_RST 0x10
#define BCSR5_ATM155_RST 0x08
#define BCSR5_ATM25_RST 0x04
#define BCSR5_MII1_EN 0x02
#define BCSR5_MII1_RST 0x01
/* Interrupt level assignments */
#define PHY_INTERRUPT SIU_IRQ7 /* PHY link change interrupt */
#define SIU_INT_FEC1 SIU_LEVEL1 /* FEC1 interrupt */
#define SIU_INT_FEC2 SIU_LEVEL3 /* FEC2 interrupt */
#define FEC_INTERRUPT SIU_INT_FEC1 /* FEC interrupt */
/* We don't use the 8259 */
#define NR_8259_INTS 0
/* CPM Ethernet through SCC3 */
#define PA_ENET_RXD ((ushort)0x0040)
#define PA_ENET_TXD ((ushort)0x0080)
#define PE_ENET_TCLK ((uint)0x00004000)
#define PE_ENET_RCLK ((uint)0x00008000)
#define PE_ENET_TENA ((uint)0x00000010)
#define PC_ENET_CLSN ((ushort)0x0400)
#define PC_ENET_RENA ((ushort)0x0800)
/* Control bits in the SICR to route TCLK (CLK5) and RCLK (CLK6) to
* SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero */
#define SICR_ENET_MASK ((uint)0x00ff0000)
#define SICR_ENET_CLKRT ((uint)0x002c0000)
#endif /* __ASM_MPC885ADS_H__ */
#endif /* __KERNEL__ */
...@@ -94,12 +94,42 @@ void smc1_lineif(struct uart_cpm_port *pinfo) ...@@ -94,12 +94,42 @@ void smc1_lineif(struct uart_cpm_port *pinfo)
((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
} }
#ifdef CONFIG_MPC885ADS
/* Enable SMC1 transceivers */
{
volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4);
uint tmp;
tmp = in_be32(bcsr1);
tmp &= ~BCSR1_RS232EN_1;
out_be32(bcsr1, tmp);
iounmap(bcsr1);
}
#endif
pinfo->brg = 1; pinfo->brg = 1;
} }
void smc2_lineif(struct uart_cpm_port *pinfo) void smc2_lineif(struct uart_cpm_port *pinfo)
{ {
/* XXX SMC2: insert port configuration here */ #ifdef CONFIG_MPC885ADS
volatile cpm8xx_t *cp = cpmp;
volatile uint __iomem *bcsr1;
uint tmp;
cp->cp_pepar |= 0x00000c00;
cp->cp_pedir &= ~0x00000c00;
cp->cp_peso &= ~0x00000400;
cp->cp_peso |= 0x00000800;
/* Enable SMC2 transceivers */
bcsr1 = ioremap(BCSR1, 4);
tmp = in_be32(bcsr1);
tmp &= ~BCSR1_RS232EN_2;
out_be32(bcsr1, tmp);
iounmap(bcsr1);
#endif
pinfo->brg = 2; pinfo->brg = 2;
} }
......
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
#include <platforms/lantec.h> #include <platforms/lantec.h>
#endif #endif
#if defined(CONFIG_MPC885ADS)
#include <platforms/mpc885ads.h>
#endif
/* Currently, all 8xx boards that support a processor to PCI/ISA bridge /* Currently, all 8xx boards that support a processor to PCI/ISA bridge
* use the same memory map. * use the same memory map.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment