Commit 8594ca60 authored by Mark A. Greer's avatar Mark A. Greer Committed by Linus Torvalds

[PATCH] ppc32: Marvell host bridge support (mv64x60)

This patch adds core support for a line of host bridges from Marvell
(formerly Galileo).  This code has been tested with a GT64260a, GT64260b,
MV64360, and MV64460.  Patches for platforms that use these bridges will be
sent separately.

The patch is rather large so a link is provided.
Signed-off-by: default avatarMark A. Greer <mgreer@mvista.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b595953f
......@@ -509,12 +509,15 @@ config PCORE
config POWERPMC250
bool "Force-PowerPMC250"
config EV64260
bool "Galileo-EV-64260-BP"
config SPRUCE
bool "IBM-Spruce"
config EV64260
bool "Marvell-EV64260BP"
help
Select EV64260 if configuring a Marvell (formerly Galileo)
EV64260BP Evaluation platform.
config LOPEC
bool "Motorola-LoPEC"
......@@ -679,7 +682,8 @@ config PPC_OF
config PPC_GEN550
bool
depends on SANDPOINT || MCPN765 || SPRUCE || PPLUS || PCORE || \
PRPMC750 || K2 || PRPMC800 || LOPEC
PRPMC750 || K2 || PRPMC800 || LOPEC || \
(EV64260 && !SERIAL_MPSC)
default y
config FORCE
......@@ -692,6 +696,40 @@ config GT64260
depends on EV64260
default y
config MV64X60
bool
depends on (GT64260 || MV64360)
default y
menu "Set bridge options"
depends on MV64X60
config NOT_COHERENT_CACHE
bool "Turn off Cache Coherency"
default n
help
Some 64x60 bridges lock up when trying to enforce cache coherency.
When this option is selected, cache coherency will be turned off.
Note that this can cause other problems (e.g., stale data being
speculatively loaded via a cached mapping). Use at your own risk.
config MV64X60_BASE
hex "Set bridge base used by firmware"
default "0xf1000000"
help
A firmware can leave the base address of the bridge's registers at
a non-standard location. If so, set this value to reflect the
address of that non-standard location.
config MV64X60_NEW_BASE
hex "Set bridge base used by kernel"
default "0xf1000000"
help
If the current base address of the bridge's registers is not where
you want it, set this value to the address that you want it moved to.
endmenu
config NONMONARCH_SUPPORT
bool "Enable Non-Monarch Support"
depends on PRPMC800
......
......@@ -143,6 +143,7 @@ boot-$(CONFIG_8xx) += embed_config.o
boot-$(CONFIG_8260) += embed_config.o
boot-$(CONFIG_BSEIP) += iic.o
boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o
boot-$(CONFIG_MV64X60) += misc-mv64x60.o
boot-$(CONFIG_RPXCLASSIC) += iic.o pci.o qspan_pci.o
boot-$(CONFIG_RPXLITE) += iic.o
# Different boards need different serial implementations.
......@@ -150,8 +151,8 @@ ifeq ($(CONFIG_SERIAL_CPM_CONSOLE),y)
boot-$(CONFIG_8xx) += m8xx_tty.o
boot-$(CONFIG_8260) += m8260_tty.o
endif
boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o
boot-$(CONFIG_GT64260_CONSOLE) += gt64260_tty.o
boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o
boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o
LIBS := $(common)/lib.a $(bootlib)/lib.a
ifeq ($(CONFIG_PPC_PREP),y)
......
/*
* arch/ppc/boot/simple/misc-mv64x60.S
*
* Code to change the base address of the host bridges and call board specific
* init routine.
*
* Author: Mark Greer <mgreer@mvista.com>
*
* 2002 (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.
*/
#include <linux/config.h>
#include <asm/ppc_asm.h>
#include <asm/processor.h>
#include <asm/cache.h>
#include <asm/mv64x60_defs.h>
.globl mv64x60_init
mv64x60_init:
mflr r27
#if (CONFIG_MV64X60_NEW_BASE != CONFIG_MV64X60_BASE)
bl move_base
#endif
bl mv64x60_board_init
mtlr r27
blr
#if (CONFIG_MV64X60_NEW_BASE != CONFIG_MV64X60_BASE)
move_base:
li r20,0
li r23,20
/* Relocate bridge's regs */
addis r25,0,CONFIG_MV64X60_BASE@h
ori r25,r25,MV64x60_INTERNAL_SPACE_DECODE
lwbrx r26,0,(r25)
lis r24,0xffff
and r26,r26,r24
addis r24,0,CONFIG_MV64X60_NEW_BASE@h
srw r24,r24,r23
or r26,r26,r24
stwbrx r26,0,(r25)
sync
/* Wait for write to take effect */
addis r25,0,CONFIG_MV64X60_NEW_BASE@h
ori r25,r25,MV64x60_INTERNAL_SPACE_DECODE
1: lwbrx r24,0,(r25)
cmpw r24,r26
bne 1b
blr
#endif
/*
* arch/ppc/boot/simple/mv64x60_stub.c
*
* Stub for board_init() routine called from mv64x60_init().
*
* Author: Mark A. Greer <mgreer@mvista.com>
*
* 2002 (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.
*/
#include <linux/config.h>
#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
long __attribute__ ((weak)) mv64x60_console_baud = 9600;
long __attribute__ ((weak)) mv64x60_mpsc_clk_src = 8; /* TCLK */
long __attribute__ ((weak)) mv64x60_mpsc_clk_freq = 100000000;
#endif
void __attribute__ ((weak))
mv64x60_board_init(void)
{
}
This diff is collapsed.
......@@ -43,6 +43,7 @@ obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o
obj-$(CONFIG_EV64260) += gt64260_common.o gt64260_pic.o \
indirect_pci.o todc_time.o pci_auto.o
obj-$(CONFIG_GEMINI) += open_pic.o indirect_pci.o
obj-$(CONFIG_GT64260) += gt64260_pic.o
obj-$(CONFIG_K2) += i8259.o indirect_pci.o todc_time.o \
pci_auto.o
obj-$(CONFIG_LOPEC) += i8259.o pci_auto.o todc_time.o
......@@ -50,6 +51,8 @@ obj-$(CONFIG_MCPN765) += todc_time.o indirect_pci.o pci_auto.o \
open_pic.o i8259.o hawk_common.o
obj-$(CONFIG_MENF1) += todc_time.o i8259.o mpc10x_common.o \
pci_auto.o indirect_pci.o
obj-$(CONFIG_MV64360) += mv64360_pic.o
obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o indirect_pci.o
obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \
pci_auto.o hawk_common.o
obj-$(CONFIG_MVME5100_IPMC761_PRESENT) += i8259.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* arch/ppc/syslib/mv64x60_dbg.c
*
* KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery).
*
* Author: Mark A. Greer <mgreer@mvista.com>
*
* 2003 (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.
*/
/*
*****************************************************************************
*
* Low-level MPSC/UART I/O routines
*
*****************************************************************************
*/
#include <linux/config.h>
#include <linux/irq.h>
#include <asm/delay.h>
#include <asm/mv64x60.h>
#if defined(CONFIG_SERIAL_TEXT_DEBUG)
#define MPSC_CHR_1 0x000c
#define MPSC_CHR_2 0x0010
static struct mv64x60_handle mv64x60_dbg_bh;
void
mv64x60_progress_init(u32 base)
{
mv64x60_dbg_bh.v_base = base;
return;
}
static void
mv64x60_polled_putc(int chan, char c)
{
u32 offset;
if (chan == 0)
offset = 0x8000;
else
offset = 0x9000;
mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_1, (u32)c);
mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_2, 0x200);
udelay(2000);
}
void
mv64x60_mpsc_progress(char *s, unsigned short hex)
{
volatile char c;
mv64x60_polled_putc(0, '\r');
while ((c = *s++) != 0)
mv64x60_polled_putc(0, c);
mv64x60_polled_putc(0, '\n');
mv64x60_polled_putc(0, '\r');
return;
}
#endif /* CONFIG_SERIAL_TEXT_DEBUG */
#if defined(CONFIG_KGDB)
#if defined(CONFIG_KGDB_TTYS0)
#define KGDB_PORT 0
#elif defined(CONFIG_KGDB_TTYS1)
#define KGDB_PORT 1
#else
#error "Invalid kgdb_tty port"
#endif
void
putDebugChar(unsigned char c)
{
mv64x60_polled_putc(KGDB_PORT, (char)c);
}
int
getDebugChar(void)
{
unsigned char c;
while (!mv64x60_polled_getc(KGDB_PORT, &c));
return (int)c;
}
void
putDebugString(char* str)
{
while (*str != '\0') {
putDebugChar(*str);
str++;
}
putDebugChar('\r');
return;
}
void
kgdb_interruptible(int enable)
{
}
void
kgdb_map_scc(void)
{
if (ppc_md.early_serial_map)
ppc_md.early_serial_map();
}
#endif /* CONFIG_KGDB */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -13,8 +13,11 @@
#ifndef __ASM_MV64340_H
#define __ASM_MV64340_H
#ifdef __MIPS__
#include <asm/addrspace.h>
#include <asm/marvell.h>
#endif
#include <asm/types.h>
/****************************************/
/* Processor Address Space */
......@@ -1036,4 +1039,50 @@
extern void mv64340_irq_init(unsigned int base);
/* MPSC Platform Device, Driver Data (Shared register regions) */
#define MPSC_SHARED_NAME "mpsc_shared"
#define MPSC_ROUTING_BASE_ORDER 0
#define MPSC_SDMA_INTR_BASE_ORDER 1
#define MPSC_ROUTING_REG_BLOCK_SIZE 0x000c
#define MPSC_SDMA_INTR_REG_BLOCK_SIZE 0x0084
struct mpsc_shared_pd_dd {
u32 mrr_val;
u32 rcrr_val;
u32 tcrr_val;
u32 intr_cause_val;
u32 intr_mask_val;
};
/* MPSC Platform Device, Driver Data */
#define MPSC_CTLR_NAME "mpsc"
#define MPSC_BASE_ORDER 0
#define MPSC_SDMA_BASE_ORDER 1
#define MPSC_BRG_BASE_ORDER 2
#define MPSC_REG_BLOCK_SIZE 0x0038
#define MPSC_SDMA_REG_BLOCK_SIZE 0x0c18
#define MPSC_BRG_REG_BLOCK_SIZE 0x0008
struct mpsc_pd_dd {
u8 mirror_regs;
u8 cache_mgmt;
u8 max_idle;
int default_baud;
int default_bits;
int default_parity;
int default_flow;
u32 chr_1_val;
u32 chr_2_val;
u32 chr_10_val;
u32 mpcr_val;
u32 bcr_val;
u8 brg_can_tune;
u8 brg_clk_src;
u32 brg_clk_freq;
};
#endif /* __ASM_MV64340_H */
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