/* $Id: pci.c,v 1.2 2005/06/16 13:46:21 cgoh Exp $
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * MAP implementation of PCI BIOS services for PCI support.
 *
 * Copyright (C) Equator Technologies
 */
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/types.h>
#include <linux/string.h>

#include <libdev/etiRegisters.h>
#include <libdev/etiInterrupts.h>
#include <libdev/etiProcessor.h>
#include <libdev/etiPci.h>
#include <libdev/etiPciDriver.h>

#include <libdev/mapca/pcia_piomap.h>
#define PCI_PIO(x) PIO( PCIAOffset   + PCIA##x##Offset )

#ifdef CONFIG_PCI

#include <asm/processor.h>
#include <asm/system.h>
#include <asm/pci.h>

/*
 * Called before PCI bus scan 
 */
__initfunc(void pcibios_init(void))
{
}

int pcibios_present (void)
{
#ifdef CONFIG_PCI
	return 1;
#else
	return 0;
#endif
}

void pcibios_fixup (void)
{
}

int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn,
                              unsigned char where, unsigned char *val)
{
	return pciReadConfigUInt8(bus, dev_fn, where, (void *)val);
}

int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn,
                              unsigned char where, unsigned short *val)
{
	return pciReadConfigUInt16(bus, dev_fn, where, (void *)val);
}

int pcibios_read_config_dword (unsigned char bus, unsigned char dev_fn,
                               unsigned char where, unsigned int *val)
{
	return pciReadConfigUInt32(bus, dev_fn, where, (void *)val);
}

int pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn,
                               unsigned char where, unsigned char val)
{
	return pciWriteConfigUInt8(bus, dev_fn, where, (int)val);
}

int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn,
                               unsigned char where, unsigned short val)
{
	return pciWriteConfigUInt16(bus, dev_fn, where, (int)val);
}

int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn,
                                unsigned char where, unsigned int val)
{
	return pciWriteConfigUInt32(bus, dev_fn, where, (int)val);
}

__initfunc(char *pcibios_setup(char *str))
{
	return str;
}

__initfunc(void pcibios_fixup_bus(struct pci_bus *bus))
{
}

#endif /* defined(CONFIG_PCI) */


/*
 * Emacs specific local variables
 *
 * Local Variables:
 * mode: C
 * c-tab-always-indent: t
 * c-basic-offset: 8
 * End:
 *
 */


