linux/include/linux/ssb/ssb_driver_pci.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef LINUX_SSB_PCICORE_H_
#define LINUX_SSB_PCICORE_H_

#include <linux/types.h>

struct pci_dev;


#ifdef CONFIG_SSB_DRIVER_PCICORE

/* PCI core registers. */
#define SSB_PCICORE_CTL
#define SSB_PCICORE_CTL_RST_OE
#define SSB_PCICORE_CTL_RST
#define SSB_PCICORE_CTL_CLK_OE
#define SSB_PCICORE_CTL_CLK
#define SSB_PCICORE_ARBCTL
#define SSB_PCICORE_ARBCTL_INTERN
#define SSB_PCICORE_ARBCTL_EXTERN
#define SSB_PCICORE_ARBCTL_PARKID
#define SSB_PCICORE_ARBCTL_PARKID_LAST
#define SSB_PCICORE_ARBCTL_PARKID_4710
#define SSB_PCICORE_ARBCTL_PARKID_EXT0
#define SSB_PCICORE_ARBCTL_PARKID_EXT1
#define SSB_PCICORE_ISTAT
#define SSB_PCICORE_ISTAT_INTA
#define SSB_PCICORE_ISTAT_INTB
#define SSB_PCICORE_ISTAT_SERR
#define SSB_PCICORE_ISTAT_PERR
#define SSB_PCICORE_ISTAT_PME
#define SSB_PCICORE_IMASK
#define SSB_PCICORE_IMASK_INTA
#define SSB_PCICORE_IMASK_INTB
#define SSB_PCICORE_IMASK_SERR
#define SSB_PCICORE_IMASK_PERR
#define SSB_PCICORE_IMASK_PME
#define SSB_PCICORE_MBOX
#define SSB_PCICORE_MBOX_F0_0
#define SSB_PCICORE_MBOX_F0_1
#define SSB_PCICORE_MBOX_F1_0
#define SSB_PCICORE_MBOX_F1_1
#define SSB_PCICORE_MBOX_F2_0
#define SSB_PCICORE_MBOX_F2_1
#define SSB_PCICORE_MBOX_F3_0
#define SSB_PCICORE_MBOX_F3_1
#define SSB_PCICORE_BCAST_ADDR
#define SSB_PCICORE_BCAST_ADDR_MASK
#define SSB_PCICORE_BCAST_DATA
#define SSB_PCICORE_GPIO_IN
#define SSB_PCICORE_GPIO_OUT
#define SSB_PCICORE_GPIO_ENABLE
#define SSB_PCICORE_GPIO_CTL
#define SSB_PCICORE_SBTOPCI0
#define SSB_PCICORE_SBTOPCI0_MASK
#define SSB_PCICORE_SBTOPCI1
#define SSB_PCICORE_SBTOPCI1_MASK
#define SSB_PCICORE_SBTOPCI2
#define SSB_PCICORE_SBTOPCI2_MASK
#define SSB_PCICORE_PCICFG0
#define SSB_PCICORE_PCICFG1
#define SSB_PCICORE_PCICFG2
#define SSB_PCICORE_PCICFG3
#define SSB_PCICORE_SPROM(wordoffset)

/* SBtoPCIx */
#define SSB_PCICORE_SBTOPCI_MEM
#define SSB_PCICORE_SBTOPCI_IO
#define SSB_PCICORE_SBTOPCI_CFG0
#define SSB_PCICORE_SBTOPCI_CFG1
#define SSB_PCICORE_SBTOPCI_PREF
#define SSB_PCICORE_SBTOPCI_BURST
#define SSB_PCICORE_SBTOPCI_MRM
#define SSB_PCICORE_SBTOPCI_RC
#define SSB_PCICORE_SBTOPCI_RC_READ
#define SSB_PCICORE_SBTOPCI_RC_READL
#define SSB_PCICORE_SBTOPCI_RC_READM


/* PCIcore specific boardflags */
#define SSB_PCICORE_BFL_NOPCI


struct ssb_pcicore {};

extern void ssb_pcicore_init(struct ssb_pcicore *pc);

/* Enable IRQ routing for a specific device */
extern int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
					  struct ssb_device *dev);

int ssb_pcicore_plat_dev_init(struct pci_dev *d);
int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);


#else /* CONFIG_SSB_DRIVER_PCICORE */


struct ssb_pcicore {
};

static inline
void ssb_pcicore_init(struct ssb_pcicore *pc)
{
}

static inline
int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
				   struct ssb_device *dev)
{
	return 0;
}

static inline
int ssb_pcicore_plat_dev_init(struct pci_dev *d)
{
	return -ENODEV;
}
static inline
int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
	return -ENODEV;
}

#endif /* CONFIG_SSB_DRIVER_PCICORE */
#endif /* LINUX_SSB_PCICORE_H_ */