From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 28 Jan 2014 16:06:12 +0100 Subject: [U-Boot] [PATCH] pci: mx6: Implement reset callback In-Reply-To: <1390577140-7402-1-git-send-email-marex@denx.de> References: <1390577140-7402-1-git-send-email-marex@denx.de> Message-ID: <52E7C764.50208@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On 24/01/2014 16:25, Marek Vasut wrote: > Add a callback so that a board can implement it's own specific routine to > toggle the port's nRESET line. > > Signed-off-by: Marek Vasut > Cc: Stefano Babic > --- > drivers/pci/pcie_imx.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c > index 0a74867..b554075 100644 > --- a/drivers/pci/pcie_imx.c > +++ b/drivers/pci/pcie_imx.c > @@ -450,6 +450,13 @@ static int imx6_pcie_init_phy(void) > return 0; > } > > +__weak int imx6_pcie_toggle_reset(void) > +{ > + /* This function ought to be overridden ! */ > + puts("WARNING: Make sure the PCIe nRESET line is connected!\n"); > + return 0; > +} > + Just to know: I assume that the nRESET is implemented with a GPIO. I am expecting then in the board files a diffusion of imx6_pcie_toggle_reset, where the oinly difference is the number of GPIO. What about to define the GPIO in the board configuration file instead of defininig the function as __weak ? Something like imx6_pcie_toggle_reset(int nReset) { .. } static int imx6_pcie_deassert_core_reset(void) { ... imx6_pcie_toggle_reset(CONFIG_IMX6_PCIE_RESET); } Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================