[U-Boot] [PATCH v2 4/6] pci: tegra: introduce weak tegra_pcie_board_port_reset() function

Marcel Ziswiler marcel.ziswiler at toradex.com
Wed Aug 9 08:18:58 UTC 2017


On Tue, 2017-08-08 at 10:09 -0600, Stephen Warren wrote:
> On 08/08/2017 06:42 AM, Marcel Ziswiler wrote:
> > From: Marcel Ziswiler <marcel.ziswiler at toradex.com>
> > 
> > Introduce a weak tegra_pcie_board_port_reset() function by default
> > calling the existing tegra_pcie_port_reset() function. Additionally
> > add
> > a tegra_pcie_port_index_of_port() function to retrieve the specific
> > PCIe
> > port index if required. This allows overriding the PCIe port reset
> > functionality from board specific code as e.g. required for Apalis
> > T30
> > and Apalis TK1.
> > diff --git a/include/pci_tegra.h b/include/pci_tegra.h
> > +int tegra_pcie_port_index_of_port(void *port);
> > +
> > +void tegra_pcie_port_reset(void *port);
> 
> The parameter to these functions should be "struct tegra_pcie_port 
> *port" for type-safety and to avoid all the casts in the
> implementation. 
> Since this is a pointer, it doesn't matter that the board-level
> callers 
> don't have the full type defined since they don't dereference the 
> pointer, just pass it around. All you need to do is add the following
> to 
> the header before the function prototypes:
> 
> struct tegra_pcie_port;

Yes, thanks. Of course that makes more sense. I will do that in a v3.


More information about the U-Boot mailing list