* [PATCH] arm: a37xx: pci: Program the data strobe for config read requests
@ 2021-11-01 9:12 Pali Rohár
2021-11-02 10:43 ` Stefan Roese
2021-11-03 7:46 ` Stefan Roese
0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2021-11-01 9:12 UTC (permalink / raw)
To: Stefan Roese; +Cc: Marek Behún, u-boot
According to the Armada 3720 Functional Specification Data Strobe applies
for both read and write config requests.
Data strobe bits configure which bytes from the start address should be
returned for read request. Set value 0xf (all 4 bits) into Data Strobe
register to read all four bytes from specified 32-bit config space
register. Same value for Data Strobe register is programmed by Linux
pci-aardvark.c driver for config read requests.
Without this patch pci-aardvark driver sets data strobe register only
during config write operations. So any followup config read operations
could result with just partial datai returned (if previous write operation
was not 32-bit wide). This patch fixes it and ensures that config read
operations always read all bytes from requested register.
Signed-off-by: Pali Rohár <pali@kernel.org>
---
drivers/pci/pci-aardvark.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index 9e623b6e617b..4e94b776c5b9 100644
--- a/drivers/pci/pci-aardvark.c
+++ b/drivers/pci/pci-aardvark.c
@@ -472,6 +472,9 @@ static int pcie_advk_read_config(const struct udevice *bus, pci_dev_t bdf,
advk_writel(pcie, reg, PIO_ADDR_LS);
advk_writel(pcie, 0, PIO_ADDR_MS);
+ /* Program the data strobe */
+ advk_writel(pcie, 0xf, PIO_WR_DATA_STRB);
+
retry_count = 0;
retry:
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm: a37xx: pci: Program the data strobe for config read requests
2021-11-01 9:12 [PATCH] arm: a37xx: pci: Program the data strobe for config read requests Pali Rohár
@ 2021-11-02 10:43 ` Stefan Roese
2021-11-03 7:46 ` Stefan Roese
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2021-11-02 10:43 UTC (permalink / raw)
To: Pali Rohár; +Cc: Marek Behún, u-boot
On 01.11.21 10:12, Pali Rohár wrote:
> According to the Armada 3720 Functional Specification Data Strobe applies
> for both read and write config requests.
>
> Data strobe bits configure which bytes from the start address should be
> returned for read request. Set value 0xf (all 4 bits) into Data Strobe
> register to read all four bytes from specified 32-bit config space
> register. Same value for Data Strobe register is programmed by Linux
> pci-aardvark.c driver for config read requests.
>
> Without this patch pci-aardvark driver sets data strobe register only
> during config write operations. So any followup config read operations
> could result with just partial datai returned (if previous write operation
> was not 32-bit wide). This patch fixes it and ensures that config read
> operations always read all bytes from requested register.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
> drivers/pci/pci-aardvark.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
> index 9e623b6e617b..4e94b776c5b9 100644
> --- a/drivers/pci/pci-aardvark.c
> +++ b/drivers/pci/pci-aardvark.c
> @@ -472,6 +472,9 @@ static int pcie_advk_read_config(const struct udevice *bus, pci_dev_t bdf,
> advk_writel(pcie, reg, PIO_ADDR_LS);
> advk_writel(pcie, 0, PIO_ADDR_MS);
>
> + /* Program the data strobe */
> + advk_writel(pcie, 0xf, PIO_WR_DATA_STRB);
> +
> retry_count = 0;
>
> retry:
>
Viele Grüße,
Stefan
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm: a37xx: pci: Program the data strobe for config read requests
2021-11-01 9:12 [PATCH] arm: a37xx: pci: Program the data strobe for config read requests Pali Rohár
2021-11-02 10:43 ` Stefan Roese
@ 2021-11-03 7:46 ` Stefan Roese
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2021-11-03 7:46 UTC (permalink / raw)
To: Pali Rohár; +Cc: Marek Behún, u-boot
On 01.11.21 10:12, Pali Rohár wrote:
> According to the Armada 3720 Functional Specification Data Strobe applies
> for both read and write config requests.
>
> Data strobe bits configure which bytes from the start address should be
> returned for read request. Set value 0xf (all 4 bits) into Data Strobe
> register to read all four bytes from specified 32-bit config space
> register. Same value for Data Strobe register is programmed by Linux
> pci-aardvark.c driver for config read requests.
>
> Without this patch pci-aardvark driver sets data strobe register only
> during config write operations. So any followup config read operations
> could result with just partial datai returned (if previous write operation
> was not 32-bit wide). This patch fixes it and ensures that config read
> operations always read all bytes from requested register.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
Applied to u-boot-marvell/master
Thanks,
Stefan
> ---
> drivers/pci/pci-aardvark.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
> index 9e623b6e617b..4e94b776c5b9 100644
> --- a/drivers/pci/pci-aardvark.c
> +++ b/drivers/pci/pci-aardvark.c
> @@ -472,6 +472,9 @@ static int pcie_advk_read_config(const struct udevice *bus, pci_dev_t bdf,
> advk_writel(pcie, reg, PIO_ADDR_LS);
> advk_writel(pcie, 0, PIO_ADDR_MS);
>
> + /* Program the data strobe */
> + advk_writel(pcie, 0xf, PIO_WR_DATA_STRB);
> +
> retry_count = 0;
>
> retry:
>
Viele Grüße,
Stefan
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-03 7:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-01 9:12 [PATCH] arm: a37xx: pci: Program the data strobe for config read requests Pali Rohár
2021-11-02 10:43 ` Stefan Roese
2021-11-03 7:46 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox