Skip to content

Commit 41ceca8

Browse files
mindachen1987bjorn-helgaas
authored andcommitted
PCI: microchip: Move PLDA structures to plda-pcie.h
Move the PLDA generic data structures to a header file so they can be re-used by all PLDA-based drivers. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20240328091835.14797-7-minda.chen@starfivetech.com Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
1 parent e9b7007 commit 41ceca8

2 files changed

Lines changed: 21 additions & 20 deletions

File tree

drivers/pci/controller/plda/pcie-microchip-host.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
#include "../../pci.h"
2222
#include "pcie-plda.h"
2323

24-
/* Number of MSI IRQs */
25-
#define PLDA_MAX_NUM_MSI_IRQS 32
26-
2724
/* PCIe Bridge Phy and Controller Phy offsets */
2825
#define MC_PCIE1_BRIDGE_ADDR 0x00008000u
2926
#define MC_PCIE1_CTRL_ADDR 0x0000a000u
@@ -179,23 +176,6 @@ struct event_map {
179176
u32 event_bit;
180177
};
181178

182-
struct plda_msi {
183-
struct mutex lock; /* Protect used bitmap */
184-
struct irq_domain *msi_domain;
185-
struct irq_domain *dev_domain;
186-
u32 num_vectors;
187-
u64 vector_phy;
188-
DECLARE_BITMAP(used, PLDA_MAX_NUM_MSI_IRQS);
189-
};
190-
191-
struct plda_pcie_rp {
192-
struct device *dev;
193-
struct irq_domain *intx_domain;
194-
struct irq_domain *event_domain;
195-
raw_spinlock_t lock;
196-
struct plda_msi msi;
197-
void __iomem *bridge_addr;
198-
};
199179

200180
struct mc_pcie {
201181
struct plda_pcie_rp plda;

drivers/pci/controller/plda/pcie-plda.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#ifndef _PCIE_PLDA_H
77
#define _PCIE_PLDA_H
88

9+
/* Number of MSI IRQs */
10+
#define PLDA_MAX_NUM_MSI_IRQS 32
11+
912
/* PCIe Bridge Phy Regs */
1013
#define PCIE_PCI_IRQ_DW0 0xa8
1114
#define MSIX_CAP_MASK BIT(31)
@@ -105,4 +108,22 @@ enum plda_int_event {
105108

106109
#define PLDA_MAX_EVENT_NUM (PLDA_NUM_DMA_EVENTS + PLDA_INT_EVENT_NUM)
107110

111+
struct plda_msi {
112+
struct mutex lock; /* Protect used bitmap */
113+
struct irq_domain *msi_domain;
114+
struct irq_domain *dev_domain;
115+
u32 num_vectors;
116+
u64 vector_phy;
117+
DECLARE_BITMAP(used, PLDA_MAX_NUM_MSI_IRQS);
118+
};
119+
120+
struct plda_pcie_rp {
121+
struct device *dev;
122+
struct irq_domain *intx_domain;
123+
struct irq_domain *event_domain;
124+
raw_spinlock_t lock;
125+
struct plda_msi msi;
126+
void __iomem *bridge_addr;
127+
};
128+
108129
#endif

0 commit comments

Comments
 (0)