All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: "Pali Rohár" <pali@kernel.org>
Cc: "Marek Behún" <kabel@kernel.org>,
	u-boot@lists.denx.de, "Marek Behún" <marek.behun@nic.cz>
Subject: Re: [PATCH u-boot-marvell 02/10] arm: mvebu: a38x: serdes: Move non-serdes PCIe code to pci_mvebu.c
Date: Mon, 13 Dec 2021 08:36:00 +0100	[thread overview]
Message-ID: <e31c363f-78f8-ac18-492d-82a8f04e44cf@denx.de> (raw)
In-Reply-To: <20211210142345.srrdifa3iejac5ml@pali>

Hi Pali,

On 12/10/21 15:23, Pali Rohár wrote:

<snip>

>>>> So I think the correct behavior should be:
>>>>
>>>> 1. pci-mvebu.c configures all controller registers to correct values
>>>> 2. PCIe port is enabled via SoC-specific register
>>>> 3. pci-mvebu.c waits for link up
>>>>
>>>> I guess that reset-controller does not help, as core release this reset
>>>> prior starting driver initialization.
>>>
>>> Ok, it looks like that reset controller API allows to do this. It would
>>> mean to define that "system-controller@18200" as reset controller,
>>> exports from it for each PCIe port reset functionality and implements
>>> assert and deassert functions which disable and enable port.
>>>
>>> And because DTS for pci-mvebu.c driver is defined as multi-root-port,
>>> "resets" property would need to be defined for each port separately.
>>
>> Okay. Sounds like a plan to me.
> 
> I'm looking at this right now and it is even more complicated. For
> example Armada XP has for some ports dedicated enable bits and for some
> ports has just one shared enable bit.
> 
> And this HW design does not fit into current U-Boot PCI DM model where
> for each PCIe port there is dedicated mvebu_pcie_probe() call which
> should setup PCIe port, enable PCIe port and returns once PCIe port is
> ready. In U-Boot PCI DM model is every PCIe port as separate DM device.
> 
> Any idea how to solve this issue?

Sorry, but I don't have clear "solution" for this in my mind right now.

Thanks,
Stefan

>>> Just I'm not sure if this "enable port functionality" should be
>>> implemented via Reset Controller API...
>>
>> How else should / could this be done then? Do you have alterative ideas?
>>
>> Thanks,
>> Stefan
>>
>>>> Anyway, this A385 SoC Control 1 Register is at address 0x18204 which is
>>>> part of following device defined in kernel DTS file:
>>>>
>>>> 			systemc: system-controller@18200 {
>>>> 				compatible = "marvell,armada-380-system-controller",
>>>> 					     "marvell,armada-370-xp-system-controller";
>>>> 				reg = <0x18200 0x100>;
>>>> 			};
>>>>
>>>> Linux kernel has driver for this DTS device is file:
>>>> arch/arm/mach-mvebu/system-controller.c
>>>>
>>>> U-Boot does not have any driver for this compatible string.
>>>>
>>>> So PCIe port enable/disable should be in this driver. I can write simple
>>>> driver also for U-Boot which can control this register. But I really do
>>>> not know which interface should it use.
>>>>
>>>> Has somebody else any idea?
>>>>
>>>>> I just looked into some Linux PCIe DT bindings and found e.g. this in
>>>>> the mediatek spec:
>>>>>
>>>>> Documentation/devicetree/bindings/pci/mediatek-pcie.txt
>>>>> ...
>>>>> Required properties for MT7623/MT2701:
>>>>> ...
>>>>> - resets: Must contain an entry for each entry in reset-names.
>>>>>     See ../reset/reset.txt for details.
>>>>> - reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the
>>>>>     number of root ports.
>>>>> ...
>>>>> 		resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>,
>>>>> 			 <&hifsys MT2701_HIFSYS_PCIE1_RST>,
>>>>> 			 <&hifsys MT2701_HIFSYS_PCIE2_RST>;
>>>>> 		reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2";
>>>>> 		phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>,
>>>>> 		       <&pcie2_phy PHY_TYPE_PCIE>;
>>>>> 		phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2";
>>>>>
>>>>>
>>>>> And make sure in the serdes code keeps (or actively sets?) these PCIe
>>>>> ports into the reset state. The PCIe driver would then release the ports
>>>>> out of reset after their configuration.
>>>>>
>>>>> Or is some other serdes code missing in between "get PCIe port out of
>>>>> reset" and the MVEBU PCIe driver taking over the control?
>>>>>
>>>>> What do you think? I might be missing something here.
>>>>>
>>>>> Thanks,
>>>>> Stefan

Viele Grüße,
Stefan Roese

-- 
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

  reply	other threads:[~2021-12-13  7:36 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 15:35 [PATCH u-boot-marvell 00/10] PCI mvebu and aardvark changes Marek Behún
2021-11-11 15:35 ` [PATCH u-boot-marvell 01/10] pci: pci_mvebu: Wait 100ms for Link Up in mvebu_pcie_probe() Marek Behún
2021-11-12 13:59   ` Stefan Roese
2021-11-12 15:44     ` Pali Rohár
2021-11-12 16:07       ` Stefan Roese
2021-11-18 18:06     ` Pali Rohár
2021-11-11 15:35 ` [PATCH u-boot-marvell 02/10] arm: mvebu: a38x: serdes: Move non-serdes PCIe code to pci_mvebu.c Marek Behún
2021-11-12 14:01   ` Stefan Roese
2021-11-18 18:01     ` Pali Rohár
2021-11-19  6:55       ` Stefan Roese
2021-11-23 15:59         ` Pali Rohár
2021-11-29  7:46           ` Stefan Roese
2021-11-29  9:06             ` Pali Rohár
2021-11-29  9:22               ` Stefan Roese
2021-11-29 11:47                 ` Pali Rohár
2021-11-29 12:30                   ` Stefan Roese
2021-11-29 13:27                     ` Pali Rohár
2021-11-29 14:28                       ` Pali Rohár
2021-11-29 16:07                         ` Stefan Roese
2021-11-29 17:09                           ` Marek Behún
2021-12-10 11:07                             ` Pali Rohár
2021-12-10 14:23                           ` Pali Rohár
2021-12-13  7:36                             ` Stefan Roese [this message]
2021-12-13 10:28                               ` Pali Rohár
2021-11-11 15:35 ` [PATCH u-boot-marvell 03/10] pci: pci_mvebu: Move setup for BAR[0] where other BARs are setup Marek Behún
2021-11-12 14:02   ` Stefan Roese
2021-12-21  8:22   ` Stefan Roese
2021-11-11 15:35 ` [PATCH u-boot-marvell 04/10] pci: pci_mvebu: Replace MBUS_PCI_*_SIZE by resource_size() Marek Behún
2021-11-12 14:03   ` Stefan Roese
2021-12-21  8:23   ` Stefan Roese
2021-11-11 15:35 ` [PATCH u-boot-marvell 05/10] pci: pci_mvebu, pci_aardvark: Fix size of configuration cache Marek Behún
2021-11-12 14:04   ` Stefan Roese
2021-12-15 10:57   ` Stefan Roese
2021-11-11 15:35 ` [PATCH u-boot-marvell 06/10] pci: pci_mvebu: Do not allow setting ROM BAR on PCI Bridge Marek Behún
2021-11-12 14:05   ` Stefan Roese
2021-12-15 10:57   ` Stefan Roese
2021-11-11 15:35 ` [PATCH u-boot-marvell 07/10] pci: pci_mvebu: Fix PCIe MEM and IO resources assignment and mbus mapping Marek Behún
2021-11-12 14:18   ` Stefan Roese
2021-11-18 17:46     ` Pali Rohár
2021-11-19  6:27       ` Stefan Roese
2021-11-11 15:35 ` [PATCH u-boot-marvell 08/10] pci: pci_mvebu: Remove unused DECLARE_GLOBAL_DATA_PTR Marek Behún
2021-11-12 14:19   ` Stefan Roese
2021-12-21  8:23   ` Stefan Roese
2021-11-11 15:35 ` [PATCH u-boot-marvell 09/10] arm: a37xx: pci: Do not allow setting ROM BAR on PCI Bridge Marek Behún
2021-11-12 14:19   ` Stefan Roese
2021-11-11 15:35 ` [PATCH u-boot-marvell 10/10] arm: mvebu: turris_mox: Remove extra newline after module topology Marek Behún
2021-11-12 14:20   ` Stefan Roese
2021-12-21  8:23   ` Stefan Roese
2021-12-12 11:23 ` [PATCH u-boot-marvell 00/10] PCI mvebu and aardvark changes Pali Rohár
2021-12-13  7:41   ` Stefan Roese
2021-12-13 10:27     ` Pali Rohár
2021-12-15  8:10       ` Stefan Roese
2021-12-16 10:28         ` Pali Rohár
2021-12-18 13:53           ` Stefan Roese
2021-12-20 13:30             ` Pali Rohár
2021-12-21  8:19               ` Stefan Roese
2021-12-21 10:57                 ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e31c363f-78f8-ac18-492d-82a8f04e44cf@denx.de \
    --to=sr@denx.de \
    --cc=kabel@kernel.org \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.