/*
* Board and PCI setup routines for MCG PowerPlus
*
* Author: Randy Vinson <rvinson@mvista.com>
*
* Derived from original PowerPlus PReP work by
* Cort Dougan, Johnnie Peters, Matt Porter, and
* Troy Benjegerdes.
*
* 2001-2004 (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/kernel.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/console.h>
#include <linux/pci.h>
#include <linux/ide.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/dma.h>
#include <asm/machdep.h>
#include <asm/prep_nvram.h>
#include <asm/vga.h>
#include <asm/i8259.h>
#include <asm/open_pic.h>
#include <asm/hawk.h>
#include <asm/todc.h>
#include <asm/bootinfo.h>
#include <asm/kgdb.h>
#include <asm/reg.h>
#include "pplus.h"
#undef DUMP_DBATS
TODC_ALLOC();
extern void pplus_setup_hose(void);
extern void pplus_set_VIA_IDE_native(void);
extern unsigned long loops_per_jiffy;
unsigned char *Motherboard_map_name;
/* Tables for known hardware */
/* Motorola Mesquite */
static inline int
mesquite_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
static char pci_irq_table[][4] =
/*
* MPIC interrupts for various IDSEL values (MPIC IRQ0 =
* Linux IRQ16 (to leave room for ISA IRQs at 0-15).
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{18, 0, 0, 0}, /* IDSEL 14 - Enet 0 */
{ 0, 0, 0, 0}, /* IDSEL 15 - unused */
{19, 19, 19, 19}, /* IDSEL 16 - PMC Slot 1 */
{ 0, 0, 0, 0}, /* IDSEL 17 - unused */
{ 0, 0, 0, 0}, /* IDSEL 18 - unused */
{ 0, 0, 0, 0}, /* IDSEL 19 - unused */
{24, 25, 26, 27}, /* IDSEL 20 - P2P bridge (to cPCI 1) */
{ 0, 0, 0, 0}, /* IDSEL 21 - unused */
{28, 29, 30, 31} /* IDSEL 22 - P2P bridge (to cPCI 2) */
};
const long min_idsel = 14, max_idsel = 22, irqs_per_slot = 4;
return PCI_IRQ_TABLE_LOOKUP;
}
/* Motorola Sitka */
static inline int
sitka_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
static char pci_irq_table[][4] =
/*
* MPIC interrupts for various IDSEL values (MPIC IRQ0 =
* Linux IRQ16 (to leave room for ISA IRQs at 0-15).
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{18, 0, 0, 0}, /* IDSEL 14 - Enet 0 */
{ 0, 0, 0, 0}, /* IDSEL 15 - unused */
{25, 26, 27, 28}, /* IDSEL 16 - PMC Slot 1 */
{28, 25, 26, 27}, /* IDSEL 17 - PMC Slot 2 */
{ 0, 0, 0, 0}, /* IDSEL 18 - unused */
{ 0, 0, 0, 0}, /* IDSEL 19 - unused */
{20, 0, 0, 0} /* IDSEL 20 - P2P bridge (to cPCI) */
};
const long min_idsel = 14, max_idsel = 20, irqs_per_slot = 4;
return PCI_IRQ_TABLE_LOOKUP;
}
/* Motorola MTX */
static inline int
MTX_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
static char pci_irq_table[][4] =
/*
* MPIC interrupts for various IDSEL values (MPIC IRQ0 =
* Linux IRQ16 (to leave room for ISA IRQs at 0-15).
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{19, 0, 0, 0}, /* IDSEL 12 - SCSI */
{ 0, 0, 0, 0}, /* IDSEL 13 - unused */
{18, 0, 0, 0}, /* IDSEL 14 - Enet */
{ 0, 0, 0, 0}, /* IDSEL 15 - unused */
{25, 26, 27, 28}, /* IDSEL 16 - PMC Slot 1 */
{26, 27, 28, 25}, /* IDSEL 17 - PMC Slot 2 */
{27, 28, 25, 26} /* IDSEL 18 - PCI Slot 3 */
};
const long min_idsel = 12, max_idsel = 18, irqs_per_slot = 4;
return PCI_IRQ_TABLE_LOOKUP;
}
/* Motorola MTX Plus */
/* Secondary bus interrupt routing is not supported yet */
static inline int
MTXplus_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
static char pci_irq_table[][4] =
/*
* MPIC interrupts for various IDSEL values (MPIC IRQ0 =
* Linux IRQ16 (to leave room for ISA IRQs at 0-15).
* PCI IDSEL/INTPIN->INTLINE
* A B C D
*/
{
{19, 0, 0, 0}, /* IDSEL 12 - SCSI */
{ 0, 0, 0, 0}, /* IDSEL 13 - unused */
{18, 0, 0, 0}, /* IDSEL 14 - Enet 1 */
{ 0, 0, 0, 0}, /* IDSEL 15 - unused */
{25, 26, 27, 28}, /* IDSEL 16 - PCI Slot 1P */
{26, 27, 28, 25}, /* IDSEL 17 - PCI Slot 2P */
{27, 28, 25, 26}, /* IDSEL 18 - PCI Slot 3P */
{26, 0, 0, 0}, /* IDSEL 19 - Enet 2 */
{ 0, 0, 0, 0} /* IDSEL 20 - P2P Bridge */
};
const long min_idsel =