Skip to content

Commit 1e75d2e

Browse files
John MadieuMani-Sadhasivam
authored andcommitted
PCI: rzg3s-host: Explicitly set class code for RZ/G3E compatibility
Program the class code register explicitly during PCIe configuration initialization. RZ/G3E requires this register to be set, while RZ/G3S has these values as hardware defaults. This configuration is harmless for RZ/G3S where these match the hardware defaults, and necessary for RZ/G3E to properly identify the device as a PCI bridge. Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # RZ/V2N EVK Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Link: https://patch.msgid.link/20260306143423.19562-11-john.madieu.xa@bp.renesas.com
1 parent 5f2c4de commit 1e75d2e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/pci/controller/pcie-rzg3s-host.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ static int rzg3s_pcie_set_max_link_speed(struct rzg3s_pcie_host *host)
10811081
static int rzg3s_pcie_config_init(struct rzg3s_pcie_host *host)
10821082
{
10831083
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(host);
1084+
u32 mask = GENMASK(31, 8);
10841085
struct resource_entry *ft;
10851086
struct resource *bus;
10861087
u8 subordinate_bus;
@@ -1104,6 +1105,13 @@ static int rzg3s_pcie_config_init(struct rzg3s_pcie_host *host)
11041105
writel_relaxed(0xffffffff, host->pcie + RZG3S_PCI_CFG_BARMSK00L);
11051106
writel_relaxed(0xffffffff, host->pcie + RZG3S_PCI_CFG_BARMSK00U);
11061107

1108+
/*
1109+
* Explicitly program class code. RZ/G3E requires this configuration.
1110+
* Harmless for RZ/G3S where this matches the hardware default.
1111+
*/
1112+
rzg3s_pcie_update_bits(host->pcie, PCI_CLASS_REVISION, mask,
1113+
field_prep(mask, PCI_CLASS_BRIDGE_PCI_NORMAL));
1114+
11071115
/* Disable access control to the CFGU */
11081116
writel_relaxed(0, host->axi + RZG3S_PCI_PERM);
11091117

0 commit comments

Comments
 (0)