linux/drivers/pci/controller/pcie-rcar.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * PCIe driver for Renesas R-Car SoCs
 *  Copyright (C) 2014-2020 Renesas Electronics Europe Ltd
 *
 * Author: Phil Edworthy <[email protected]>
 */

#ifndef _PCIE_RCAR_H
#define _PCIE_RCAR_H

#define PCIECAR
#define PCIECCTLR
#define PCIECCTLR_CCIE
#define TYPE0
#define TYPE1
#define PCIECDR
#define PCIEMSR
#define PCIEINTXR
#define ASTINTX
#define PCIEPHYSR
#define PHYRDY
#define PCIEMSITXR

/* Transfer control */
#define PCIETCTLR
#define DL_DOWN
#define CFINIT
#define PCIETSTR
#define DATA_LINK_ACTIVE
#define PCIEERRFR
#define UNSUPPORTED_REQUEST
#define PCIEMSIFR
#define PCIEMSIALR
#define MSIFE
#define PCIEMSIAUR
#define PCIEMSIIER

/* root port address */
#define PCIEPRAR(x)

/* local address reg & mask */
#define PCIELAR(x)
#define PCIELAMR(x)
#define LAM_PREFETCH
#define LAM_64BIT
#define LAR_ENABLE

/* PCIe address reg & mask */
#define PCIEPALR(x)
#define PCIEPAUR(x)
#define PCIEPAMR(x)
#define PCIEPTCTLR(x)
#define PAR_ENABLE
#define IO_SPACE

/* Configuration */
#define PCICONF(x)
#define INTDIS
#define PMCAP(x)
#define MSICAP(x)
#define MSICAP0_MSIE
#define MSICAP0_MMESCAP_OFFSET
#define MSICAP0_MMESE_OFFSET
#define MSICAP0_MMESE_MASK
#define EXPCAP(x)
#define VCCAP(x)

/* link layer */
#define IDSETR0
#define IDSETR1
#define SUBIDSETR
#define TLCTLR
#define MACSR
#define SPCHGFIN
#define SPCHGFAIL
#define SPCHGSUC
#define LINK_SPEED
#define LINK_SPEED_2_5GTS
#define LINK_SPEED_5_0GTS
#define MACCTLR
#define MACCTLR_NFTS_MASK
#define SPEED_CHANGE
#define SCRAMBLE_DISABLE
#define LTSMDIS
#define MACCTLR_INIT_VAL
#define PMSR
#define L1FAEG
#define PMEL1RX
#define PMSTATE
#define PMSTATE_L1
#define PMCTLR
#define L1IATN

#define MACS2R
#define MACCGSPSETR
#define SPCNGRSN

/* R-Car H1 PHY */
#define H1_PCIEPHYADRR
#define WRITE_CMD
#define PHY_ACK
#define RATE_POS
#define LANE_POS
#define ADR_POS
#define H1_PCIEPHYDOUTR

/* R-Car Gen2 PHY */
#define GEN2_PCIEPHYADDR
#define GEN2_PCIEPHYDATA
#define GEN2_PCIEPHYCTRL

#define INT_PCI_MSI_NR

#define RCONF(x)
#define RPMCAP(x)
#define REXPCAP(x)
#define RVCCAP(x)

#define PCIE_CONF_BUS(b)
#define PCIE_CONF_DEV(d)
#define PCIE_CONF_FUNC(f)

#define RCAR_PCI_MAX_RESOURCES
#define MAX_NR_INBOUND_MAPS

struct rcar_pcie {};

enum {};

void rcar_pci_write_reg(struct rcar_pcie *pcie, u32 val, unsigned int reg);
u32 rcar_pci_read_reg(struct rcar_pcie *pcie, unsigned int reg);
void rcar_rmw32(struct rcar_pcie *pcie, int where, u32 mask, u32 data);
int rcar_pcie_wait_for_phyrdy(struct rcar_pcie *pcie);
int rcar_pcie_wait_for_dl(struct rcar_pcie *pcie);
void rcar_pcie_set_outbound(struct rcar_pcie *pcie, int win,
			    struct resource_entry *window);
void rcar_pcie_set_inbound(struct rcar_pcie *pcie, u64 cpu_addr,
			   u64 pci_addr, u64 flags, int idx, bool host);

#endif