/* The VLSI Golden Gate II has only 512K of PCI configuration space, so we limit the bus number to 3 bits  */
int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, int len, u32 *val)
/* The VLSI Golden Gate II has only 512K of PCI configuration space, so we limit the bus number to 3 bits  */
int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, int len, u32 *val)
{
	volatile void __iomem *cfg_data;
	struct pci_controller *hose = pci_bus_to_host(bus);
	if (bus->number > 7)
		return PCIBIOS_DEVICE_NOT_FOUND;
	cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off);
	switch (len) {
	case 1:
		*val =  in_8(cfg_data);
		break;
	case 2:
		*val = in_le16(cfg_data);
		break;
	default:
		*val = in_le32(cfg_data);
		break;
	}
	return PCIBIOS_SUCCESSFUL;
}