Skip to content

Commit 739e25f

Browse files
damien-lemoalbjorn-helgaas
authored andcommitted
PCI: rockchip-ep: Use a macro to define EP controller .align feature
Introduce the macro ROCKCHIP_PCIE_AT_SIZE_ALIGN to initialize the .align field of the controller epc_features structure to 256. This is defined as a shift using the macro ROCKCHIP_PCIE_AT_MIN_NUM_BITS (to avoid using the "magic" value 8 directly). Link: https://lore.kernel.org/r/20241017015849.190271-3-dlemoal@kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1 parent 64f093c commit 739e25f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/pci/controller/pcie-rockchip-ep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static const struct pci_epc_features rockchip_pcie_epc_features = {
449449
.linkup_notifier = false,
450450
.msi_capable = true,
451451
.msix_capable = false,
452-
.align = 256,
452+
.align = ROCKCHIP_PCIE_AT_SIZE_ALIGN,
453453
};
454454

455455
static const struct pci_epc_features*

drivers/pci/controller/pcie-rockchip.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248

249249
#define ROCKCHIP_PCIE_AT_MIN_NUM_BITS 8
250250
#define ROCKCHIP_PCIE_AT_MAX_NUM_BITS 20
251+
#define ROCKCHIP_PCIE_AT_SIZE_ALIGN (1UL << ROCKCHIP_PCIE_AT_MIN_NUM_BITS)
251252

252253
#define ROCKCHIP_PCIE_AT_IB_EP_FUNC_BAR_ADDR0(fn, bar) \
253254
(PCIE_CORE_AXI_CONF_BASE + 0x0828 + (fn) * 0x0040 + (bar) * 0x0008)

0 commit comments

Comments
 (0)