Commit 3ae4c27e authored by David Woodhouse's avatar David Woodhouse Committed by David Woodhouse

Add support for WindRiver PowerQUICC II.

Code from Guy Streeter <streeter@redhat.com>
parent f8b34d3f
......@@ -158,12 +158,21 @@ static int fcc_enet_set_mac_address(struct net_device *dev, void *addr);
#define PA1_DIRA0 (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
#define PA1_DIRA1 (PA1_TXDAT | PA1_TXEN | PA1_TXER)
#ifdef CONFIG_SBC82xx
/* rx is clk9, tx is clk10
*/
#define PC_F1RXCLK ((uint)0x00000100)
#define PC_F1TXCLK ((uint)0x00000200)
#define CMX1_CLK_ROUTE ((uint)0x25000000)
#define CMX1_CLK_MASK ((uint)0xff000000)
#else
/* CLK12 is receive, CLK11 is transmit. These are board specific.
*/
#define PC_F1RXCLK ((uint)0x00000800)
#define PC_F1TXCLK ((uint)0x00000400)
#define CMX1_CLK_ROUTE ((uint)0x3e000000)
#define CMX1_CLK_MASK ((uint)0xff000000)
#endif /* !CONFIG_SBC82xx */
/* I/O Pin assignment for FCC2. I don't yet know the best way to do this,
* but there is little variation among the choices.
......@@ -1617,6 +1626,9 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
*/
eap = (unsigned char *)&(ep->fen_paddrh);
for (i=5; i>=0; i--) {
#ifdef CONFIG_SBC82xx
*eap++ = dev->dev_addr[i] = bd->bi_enetaddrs[fip->fc_fccnum+1][i];
#else
if (i == 3) {
dev->dev_addr[i] = bd->bi_enetaddr[i];
dev->dev_addr[i] |= (1 << (7 - fip->fc_fccnum));
......@@ -1625,6 +1637,7 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
else {
*eap++ = dev->dev_addr[i] = bd->bi_enetaddr[i];
}
#endif
}
ep->fen_taddrh = 0;
......
......@@ -161,7 +161,7 @@ static struct serial_state rs_table[] = {
#ifndef CONFIG_SCC1_ENET
{ 0, 0, PROFF_SCC1, SIU_INT_SCC1, 0, SCC_NUM_BASE}, /* SCC1 ttyS2 */
#endif
#ifndef CONFIG_SCC2_ENET
#if !defined(CONFIG_SBC82xx) && !defined(CONFIG_SCC2_ENET)
{ 0, 0, PROFF_SCC2, SIU_INT_SCC2, 0, SCC_NUM_BASE + 1}, /* SCC2 ttyS3 */
#endif
};
......@@ -475,7 +475,7 @@ static _INLINE_ void receive_chars(ser_info_t *info, struct pt_regs *regs)
if (break_pressed && info->line == sercons.index) {
if (ch != 0 && time_before(jiffies,
break_pressed + HZ*5)) {
handle_sysrq(ch, regs, NULL, NULL);
handle_sysrq(ch, regs, NULL);
break_pressed = 0;
goto ignore_char;
} else
......
......@@ -542,6 +542,15 @@ config EST8260
<http://www.windriver.com/>, but the EST8260 cannot be found on it
and has probably been discontinued or rebadged.
config SBC82xx
bool "SBC82xx"
---help---
SBC PowerQUICC II, single-board computer with MPC82xx CPU
Manufacturer: Wind River Systems, Inc.
Date of Release: May 2003
End of Life: -
URL: <http://www.windriver.com/>
config SBS8260
bool "SBS8260"
......@@ -575,7 +584,7 @@ config EMBEDDEDBOOT
config 8260
bool "MPC8260 CPM Support" if WILLOW
depends on 6xx
default y if TQM8260 || RPXSUPER || EST8260 || SBS8260
default y if TQM8260 || RPXSUPER || EST8260 || SBS8260 || SBC82xx
help
The MPC8260 CPM (Communications Processor Module) is a typical
embedded CPU made by Motorola. Selecting this option means that
......
......@@ -484,6 +484,51 @@ clk_8280(bd_t *bd)
bd->bi_brgfreq = main_clk / 16;
}
#endif
#ifdef CONFIG_SBC82xx
void
embed_config(bd_t **bdp)
{
u_char *cp;
int i;
bd_t *bd;
unsigned long pvr;
bd = *bdp;
bd = &bdinfo;
*bdp = bd;
bd->bi_baudrate = 9600;
bd->bi_memsize = 256 * 1024 * 1024; /* just a guess */
cp = (void*)SBC82xx_MACADDR_NVRAM_SCC1;
for (i=0; i<6; i++) {
bd->bi_enetaddrs[0][i] = *cp++;
}
cp = (void*)SBC82xx_MACADDR_NVRAM_FCC1;
for (i=0; i<6; i++) {
bd->bi_enetaddrs[1][i] = *cp++;
}
cp = (void*)SBC82xx_MACADDR_NVRAM_FCC2;
for (i=0; i<6; i++) {
bd->bi_enetaddrs[2][i] = *cp++;
}
cp = (void*)SBC82xx_MACADDR_NVRAM_FCC3;
for (i=0; i<6; i++) {
bd->bi_enetaddrs[3][i] = *cp++;
}
/* can busfreq be calculated? */
bd->bi_busfreq = 100000000;
__asm__ __volatile__ ("mfspr %0, 287" : "=r" (pvr));
if ((pvr & 0xffff0000) == 0x80820000)
clk_8280(bd);
else
clk_8260(bd);
}
#endif /* SBC82xx */
#if defined(CONFIG_EST8260) || defined(CONFIG_TQM8260)
void
embed_config(bd_t **bdp)
......
......@@ -45,6 +45,7 @@ obj-$(CONFIG_PPLUS) += pplus.o
obj-$(CONFIG_PRPMC750) += prpmc750.o
obj-$(CONFIG_PRPMC800) += prpmc800.o
obj-$(CONFIG_SANDPOINT) += sandpoint.o
obj-$(CONFIG_SBC82xx) += sbc82xx.o
obj-$(CONFIG_SPRUCE) += spruce.o
ifeq ($(CONFIG_SMP),y)
......
/*
* arch/ppc/platforms/sbc82xx.c
*
* SBC82XX platform support
*
* Author: Guy Streeter <streeter@redhat.com>
*
* Derived from: est8260_setup.c by Allen Curtis, ONZ
*
* Copyright 2004 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#include <linux/config.h>
#include <linux/seq_file.h>
#include <asm/mpc8260.h>
#include <asm/machdep.h>
#include <asm/io.h>
#include <asm/todc.h>
static void (*callback_setup_arch)(void);
extern unsigned char __res[sizeof(bd_t)];
extern void m8260_init(unsigned long r3, unsigned long r4,
unsigned long r5, unsigned long r6, unsigned long r7);
extern void (*late_time_init)(void);
static int
sbc82xx_show_cpuinfo(struct seq_file *m)
{
bd_t *binfo = (bd_t *)__res;
seq_printf(m, "vendor\t\t: Wind River\n"
"machine\t\t: SBC PowerQUICC II\n"
"\n"
"mem size\t\t: 0x%08x\n"
"console baud\t\t: %d\n"
"\n",
binfo->bi_memsize,
binfo->bi_baudrate);
return 0;
}
static void __init
sbc82xx_setup_arch(void)
{
printk("SBC PowerQUICC II Port\n");
callback_setup_arch();
}
TODC_ALLOC();
/*
* Timer init happens before mem_init but after paging init, so we cannot
* directly use ioremap() at that time.
* late_time_init() is call after paging init.
*/
#ifdef CONFIG_GEN_RTC
static void sbc82xx_time_init(void)
{
TODC_INIT(TODC_TYPE_MK48T59, 0, 0, SBC82xx_TODC_NVRAM_ADDR, 0);
todc_info->nvram_data =
(unsigned int)ioremap(todc_info->nvram_data, 0x2000);
BUG_ON(!todc_info->nvram_data);
ppc_md.get_rtc_time = todc_get_rtc_time;
ppc_md.set_rtc_time = todc_set_rtc_time;
ppc_md.nvram_read_val = todc_direct_read_val;
ppc_md.nvram_write_val = todc_direct_write_val;
todc_time_init();
}
#endif /* CONFIG_GEN_RTC */
void __init
platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
{
/* Generic 8260 platform initialization */
m8260_init(r3, r4, r5, r6, r7);
/* Anything special for this platform */
ppc_md.show_cpuinfo = sbc82xx_show_cpuinfo;
callback_setup_arch = ppc_md.setup_arch;
ppc_md.setup_arch = sbc82xx_setup_arch;
#ifdef CONFIG_GEN_RTC
ppc_md.time_init = NULL;
ppc_md.get_rtc_time = NULL;
ppc_md.set_rtc_time = NULL;
ppc_md.nvram_read_val = NULL;
ppc_md.nvram_write_val = NULL;
late_time_init = sbc82xx_time_init;
#endif /* CONFIG_GEN_RTC */
}
/* Board information for the SBCPowerQUICCII, which should be generic for
* all 8260 boards. The IMMR is now given to us so the hard define
* will soon be removed. All of the clock values are computed from
* the configuration SCMR and the Power-On-Reset word.
*/
#define IMAP_ADDR 0xf0000000
#define SBC82xx_TODC_NVRAM_ADDR 0x80000000
#define SBC82xx_MACADDR_NVRAM_FCC1 0x220000c9 /* JP6B */
#define SBC82xx_MACADDR_NVRAM_SCC1 0x220000cf /* JP6A */
#define SBC82xx_MACADDR_NVRAM_FCC2 0x220000d5 /* JP7A */
#define SBC82xx_MACADDR_NVRAM_FCC3 0x220000db /* JP7B */
/* A Board Information structure that is given to a program when
* prom starts it up.
*/
typedef struct bd_info {
unsigned int bi_memstart; /* Memory start address */
unsigned int bi_memsize; /* Memory (end) size in bytes */
unsigned int bi_intfreq; /* Internal Freq, in Hz */
unsigned int bi_busfreq; /* Bus Freq, in MHz */
unsigned int bi_cpmfreq; /* CPM Freq, in MHz */
unsigned int bi_brgfreq; /* BRG Freq, in MHz */
unsigned int bi_vco; /* VCO Out from PLL */
unsigned int bi_baudrate; /* Default console baud rate */
unsigned char bi_enetaddrs[4][6];
#define bi_enetaddr bi_enetaddrs[0]
} bd_t;
extern bd_t m8xx_board_info;
......@@ -63,6 +63,7 @@ obj-$(CONFIG_PRPMC750) += open_pic.o indirect_pci.o pci_auto.o \
obj-$(CONFIG_HARRIER) += harrier.o
obj-$(CONFIG_PRPMC800) += open_pic.o indirect_pci.o pci_auto.o
obj-$(CONFIG_SANDPOINT) += i8259.o open_pic.o pci_auto.o todc_time.o
obj-$(CONFIG_SBC82xx) += todc_time.o
obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \
todc_time.o
obj-$(CONFIG_8260) += m8260_setup.o ppc8260_pic.o
......
......@@ -16,6 +16,10 @@
#include <platforms/est8260.h>
#endif
#ifdef CONFIG_SBC82xx
#include <platforms/sbc82xx.h>
#endif
#ifdef CONFIG_SBS8260
#include <platforms/sbs8260.h>
#endif
......
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