linux/drivers/pci/controller/pcie-xilinx-dma-pl.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * PCIe host controller driver for Xilinx XDMA PCIe Bridge
 *
 * Copyright (C) 2023 Xilinx, Inc. All rights reserved.
 */
#include <linux/bitfield.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/msi.h>
#include <linux/of_address.h>
#include <linux/of_pci.h>

#include "../pci.h"
#include "pcie-xilinx-common.h"

/* Register definitions */
#define XILINX_PCIE_DMA_REG_IDR
#define XILINX_PCIE_DMA_REG_IMR
#define XILINX_PCIE_DMA_REG_PSCR
#define XILINX_PCIE_DMA_REG_RPSC
#define XILINX_PCIE_DMA_REG_MSIBASE1
#define XILINX_PCIE_DMA_REG_MSIBASE2
#define XILINX_PCIE_DMA_REG_RPEFR
#define XILINX_PCIE_DMA_REG_IDRN
#define XILINX_PCIE_DMA_REG_IDRN_MASK
#define XILINX_PCIE_DMA_REG_MSI_LOW
#define XILINX_PCIE_DMA_REG_MSI_HI
#define XILINX_PCIE_DMA_REG_MSI_LOW_MASK
#define XILINX_PCIE_DMA_REG_MSI_HI_MASK

#define IMR(x)

#define XILINX_PCIE_INTR_IMR_ALL_MASK

#define XILINX_PCIE_DMA_IMR_ALL_MASK
#define XILINX_PCIE_DMA_IDR_ALL_MASK
#define XILINX_PCIE_DMA_IDRN_MASK

/* Root Port Error Register definitions */
#define XILINX_PCIE_DMA_RPEFR_ERR_VALID
#define XILINX_PCIE_DMA_RPEFR_REQ_ID
#define XILINX_PCIE_DMA_RPEFR_ALL_MASK

/* Root Port Interrupt Register definitions */
#define XILINX_PCIE_DMA_IDRN_SHIFT

/* Root Port Status/control Register definitions */
#define XILINX_PCIE_DMA_REG_RPSC_BEN

/* Phy Status/Control Register definitions */
#define XILINX_PCIE_DMA_REG_PSCR_LNKUP

/* Number of MSI IRQs */
#define XILINX_NUM_MSI_IRQS

struct xilinx_msi {};

/**
 * struct pl_dma_pcie - PCIe port information
 * @dev: Device pointer
 * @reg_base: IO Mapped Register Base
 * @irq: Interrupt number
 * @cfg: Holds mappings of config space window
 * @phys_reg_base: Physical address of reg base
 * @intx_domain: Legacy IRQ domain pointer
 * @pldma_domain: PL DMA IRQ domain pointer
 * @resources: Bus Resources
 * @msi: MSI information
 * @intx_irq: INTx error interrupt number
 * @lock: Lock protecting shared register access
 */
struct pl_dma_pcie {};

static inline u32 pcie_read(struct pl_dma_pcie *port, u32 reg)
{}

static inline void pcie_write(struct pl_dma_pcie *port, u32 val, u32 reg)
{}

static inline bool xilinx_pl_dma_pcie_link_up(struct pl_dma_pcie *port)
{}

static void xilinx_pl_dma_pcie_clear_err_interrupts(struct pl_dma_pcie *port)
{}

static bool xilinx_pl_dma_pcie_valid_device(struct pci_bus *bus,
					    unsigned int devfn)
{}

static void __iomem *xilinx_pl_dma_pcie_map_bus(struct pci_bus *bus,
						unsigned int devfn, int where)
{}

/* PCIe operations */
static struct pci_ecam_ops xilinx_pl_dma_pcie_ops =;

static void xilinx_pl_dma_pcie_enable_msi(struct pl_dma_pcie *port)
{}

static void xilinx_mask_intx_irq(struct irq_data *data)
{}

static void xilinx_unmask_intx_irq(struct irq_data *data)
{}

static struct irq_chip xilinx_leg_irq_chip =;

static int xilinx_pl_dma_pcie_intx_map(struct irq_domain *domain,
				       unsigned int irq, irq_hw_number_t hwirq)
{}

/* INTx IRQ Domain operations */
static const struct irq_domain_ops intx_domain_ops =;

static irqreturn_t xilinx_pl_dma_pcie_msi_handler_high(int irq, void *args)
{}

static irqreturn_t xilinx_pl_dma_pcie_msi_handler_low(int irq, void *args)
{}

static irqreturn_t xilinx_pl_dma_pcie_event_flow(int irq, void *args)
{}

#define _IC(x, s)

static const struct {} intr_cause[32] =;

static irqreturn_t xilinx_pl_dma_pcie_intr_handler(int irq, void *dev_id)
{}

static struct irq_chip xilinx_msi_irq_chip =;

static struct msi_domain_info xilinx_msi_domain_info =;

static void xilinx_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
{}

static int xilinx_msi_set_affinity(struct irq_data *irq_data,
				   const struct cpumask *mask, bool force)
{}

static struct irq_chip xilinx_irq_chip =;

static int xilinx_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
				   unsigned int nr_irqs, void *args)
{}

static void xilinx_irq_domain_free(struct irq_domain *domain, unsigned int virq,
				   unsigned int nr_irqs)
{}

static const struct irq_domain_ops dev_msi_domain_ops =;

static void xilinx_pl_dma_pcie_free_irq_domains(struct pl_dma_pcie *port)
{}

static int xilinx_pl_dma_pcie_init_msi_irq_domain(struct pl_dma_pcie *port)
{}

/*
 * INTx error interrupts are Xilinx controller specific interrupt, used to
 * notify user about errors such as cfg timeout, slave unsupported requests,
 * fatal and non fatal error etc.
 */

static irqreturn_t xilinx_pl_dma_pcie_intx_flow(int irq, void *args)
{}

static void xilinx_pl_dma_pcie_mask_event_irq(struct irq_data *d)
{}

static void xilinx_pl_dma_pcie_unmask_event_irq(struct irq_data *d)
{}

static struct irq_chip xilinx_pl_dma_pcie_event_irq_chip =;

static int xilinx_pl_dma_pcie_event_map(struct irq_domain *domain,
					unsigned int irq, irq_hw_number_t hwirq)
{}

static const struct irq_domain_ops event_domain_ops =;

/**
 * xilinx_pl_dma_pcie_init_irq_domain - Initialize IRQ domain
 * @port: PCIe port information
 *
 * Return: '0' on success and error value on failure.
 */
static int xilinx_pl_dma_pcie_init_irq_domain(struct pl_dma_pcie *port)
{}

static int xilinx_pl_dma_pcie_setup_irq(struct pl_dma_pcie *port)
{}

static void xilinx_pl_dma_pcie_init_port(struct pl_dma_pcie *port)
{}

static int xilinx_request_msi_irq(struct pl_dma_pcie *port)
{}

static int xilinx_pl_dma_pcie_parse_dt(struct pl_dma_pcie *port,
				       struct resource *bus_range)
{}

static int xilinx_pl_dma_pcie_probe(struct platform_device *pdev)
{}

static const struct of_device_id xilinx_pl_dma_pcie_of_match[] =;

static struct platform_driver xilinx_pl_dma_pcie_driver =;

builtin_platform_driver();