From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Mon, 03 Feb 2014 11:40:09 -0700 Subject: [U-Boot] [PATCH] pci: mx6: Implement reset callback In-Reply-To: <201402031917.26507.marex@denx.de> References: <1390577140-7402-1-git-send-email-marex@denx.de> <201401282032.17617.marex@denx.de> <52EF83D4.7010708@denx.de> <201402031917.26507.marex@denx.de> Message-ID: <52EFE289.6020902@boundarydevices.com> 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 02/03/2014 11:17 AM, Marek Vasut wrote: > On Monday, February 03, 2014 at 12:56:04 PM, Stefano Babic wrote: >> Hi Marek, >> >> sorry for late answer. >> >> On 28/01/2014 20:32, Marek Vasut wrote: >>> On Tuesday, January 28, 2014 at 04:06:12 PM, Stefano Babic wrote: >>>> 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. >>> >>> Yes, that's how it is on all designs I saw thus far (but see below). >>> >>>> I am >>>> expecting then in the board files a diffusion of imx6_pcie_toggle_reset, >>>> where the oinly difference is the number of GPIO. >>> >>> The problem is, there are boards with no nRESET connected to the slot. >> >> Any reference to the Sabrelite is, of course, purely coincidental. But >> this is a hardware bug on a specific board and we should not adjust all >> boards according to the broken one. > > Well ... SL and N6X both. For all I care, we can have #define > MX6_PCIE_RESET_GPIO and if that's not defined, puke out this warning. And > ultimatelly let this function be overriden anyway in case people used some GPIO > expander or whatnot. So the change to this would be: > > __weak int imx6_pcie_toggle_reset(void) > { > #ifdef CONFIG_MX6_PCIE_RESET_GPIO > gpio_set... > mdelay(); > gpio_set... > mdelay(); > #else > puts("Oh yeah, broken design :-(\n"); That's pretty harsh! We have lots of stuff working without a GPIO...