[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SEYPR06MB5134378DDE51A94D9F83E7439D78A@SEYPR06MB5134.apcprd06.prod.outlook.com>
Date: Tue, 24 Jun 2025 11:11:22 +0000
From: Jacky Chou <jacky_chou@...eedtech.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
CC: "bhelgaas@...gle.com" <bhelgaas@...gle.com>, "lpieralisi@...nel.org"
<lpieralisi@...nel.org>, "kwilczynski@...nel.org" <kwilczynski@...nel.org>,
"mani@...nel.org" <mani@...nel.org>, "robh@...nel.org" <robh@...nel.org>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>, "conor+dt@...nel.org"
<conor+dt@...nel.org>, "joel@....id.au" <joel@....id.au>,
"andrew@...econstruct.com.au" <andrew@...econstruct.com.au>,
"vkoul@...nel.org" <vkoul@...nel.org>, "kishon@...nel.org"
<kishon@...nel.org>, "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
"linux-aspeed@...ts.ozlabs.org" <linux-aspeed@...ts.ozlabs.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, LKML <linux-kernel@...r.kernel.org>,
"linux-phy@...ts.infradead.org" <linux-phy@...ts.infradead.org>,
"openbmc@...ts.ozlabs.org" <openbmc@...ts.ozlabs.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"elbadrym@...gle.com" <elbadrym@...gle.com>, "romlem@...gle.com"
<romlem@...gle.com>, "anhphan@...gle.com" <anhphan@...gle.com>,
"wak@...gle.com" <wak@...gle.com>, "yuxiaozhang@...gle.com"
<yuxiaozhang@...gle.com>, BMC-SW <BMC-SW@...eedtech.com>
Subject:
回覆: [PATCH 7/7] pci: aspeed: Add ASPEED PCIe host controller driver
> > > > + u32 reg;
> > > > + bool link;
> > > > +
> > > > + regmap_read(pcie->pciephy, PEHR_MISC_300, ®);
> > > > + if (reg & CAPABILITY_GEN2) {
> > > > + regmap_read(pcie->pciephy, PEHR_MISC_344, ®);
> > > > + link = !!(reg & LINK_STATUS_GEN2);
> > > > + } else {
> > > > + regmap_read(pcie->pciephy, PEHR_MISC_358, ®);
> > > > + link = !!(reg & LINK_STATUS_GEN4);
> > >
> > > While I don't entirely know the meaning of these bits, what if the
> > > link is not using maximum speed it is capable of, does this check
> misbehave?
> > >
> >
> > In our AST2700, there are gen4 RC and gen2 RC.
> > Therefore, here will get capability to confirm it is gen2 or gen4.
> > And the link status is in different register.
>
> Okay, but then I'm a bit worried the naming of the defines as "Link Status" has
> a well-known meaning in PCIe Spec so it is confusing to call something else
> LINK_STATUS_*. Does that name come from some AST spec? In not, change the
> define naming. If yes, you should prefix it with so it is clear this is not referring
> to a generic PCIe thing and I suggest also adding a comment above those
> defines too so anyone looking them later won't wonder if you're just
> duplicating something from the PCIe spec.
Thanks for your reminder.
This code is used to get information whether PCIe have completed physical training.
I should change them to call LINK_UP_GEN2 and LINK_UP_GEN4.
I will modify this part to avoid confusion and add more comment, as you said.
Thanks,
Jacky
Powered by blists - more mailing lists