From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 7 Apr 2015 13:10:43 -0600 Subject: [U-Boot] [PATCH v2 57/80] dm: usb: tegra: Remove the port_addr_clear_csc variable In-Reply-To: <5513CAE7.1020103@nvidia.com> References: <1427307788-7496-1-git-send-email-sjg@chromium.org> <1427307788-7496-58-git-send-email-sjg@chromium.org> <17d74078e679442ab7f56f08620b5ac7@HKMAIL103.nvidia.com> <5513CAE7.1020103@nvidia.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 26 March 2015 at 03:01, Jim Lin wrote: > Please ignore my question because it is answered by [PATCH v2 34/80]. > > > On 03/26/2015 11:38 AM, Jim Lin wrote: >>> >>> -----Original Message----- >>> From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Simon >>> Glass >>> Sent: Thursday, March 26, 2015 2:23 AM >>> To: U-Boot Mailing List >>> Cc: Marek Vasut; Stephen Warren; Vivek Gautam; Tom Warren >>> Subject: [U-Boot] [PATCH v2 57/80] dm: usb: tegra: Remove the >>> port_addr_clear_csc variable >>> >>> This variable is a bit of a hack. We can obtain the same information from >>> the normal device config. This will fit better with driver model, where >>> global variables > are best avoided. >>> >>> Signed-off-by: Simon Glass >>> --- >>> >>> Changes in v2: None >>> >>> drivers/usb/host/ehci-tegra.c | 6 +----- >>> 1 file changed, 1 insertion(+), 5 deletions(-) >>> >>> diff --git a/drivers/usb/host/ehci-tegra.c >>> b/drivers/usb/host/ehci-tegra.c index 38333c7..464f55d 100644 >>> --- a/drivers/usb/host/ehci-tegra.c >>> +++ b/drivers/usb/host/ehci-tegra.c >>> @@ -87,8 +87,6 @@ struct fdt_usb { >>> static struct fdt_usb port[USB_PORTS_MAX]; /* List of valid USB >>> ports */ >>> static unsigned port_count; /* Number of available >>> ports */ >>> -/* Port that needs to clear CSC after Port Reset */ -static u32 >>> port_addr_clear_csc; >>> /* >>> * This table has USB timing parameters for each Oscillator frequency >>> we @@ -206,7 +204,7 @@ static void tegra_ehci_powerup_fixup(struct ehci_ctrl >>> *ctrl, >> >> if (controller->has_hostpc) >>> >>> *reg |= EHCI_PS_PE; >>> - if (((u32)status_reg & TEGRA_USB_ADDR_MASK) != >>> port_addr_clear_csc) >>> + if (!config->has_legacy_mode) >>> return; >> >> How do we get config (config->has_legacy_mode) for in this function? >> If you read ehci_set_usbmode, "config" comes from >> "config = &port[index];". >> Or "config" is an input argument like set_up_vbus(struct fdt_usb *config, >> ...) >> But for ehci_powerup_fixup, I don't see a way for us to get "config". >> >>> /* For EHCI_PS_CSC to be cleared in ehci_hcd.c */ >> >> --nvpublic >> _______________________________________________ >> U-Boot mailing list >> U-Boot at lists.denx.de >> http://lists.denx.de/mailman/listinfo/u-boot > > Applied to u-boot-dm/next.