Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp908902ybj; Tue, 5 May 2020 09:28:29 -0700 (PDT) X-Google-Smtp-Source: APiQypIzEdPIZqgF+IE/9BYx3mmB6sxBNRdslEICCrqfTFjJXu8mv2e1o8NuK9yBtVnyW7qtnl8J X-Received: by 2002:a50:eb8e:: with SMTP id y14mr3389186edr.270.1588696109771; Tue, 05 May 2020 09:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588696109; cv=none; d=google.com; s=arc-20160816; b=ttVAXJ0AcR1qIYZSNqYwnoJ9FyA7PwzJ+V1M+9pvTBC0Oc8dENVbhDwvwhqyjkzpFj TDn/CBhwi4lGhbmUDJjT8KRN4UrY+oXM9PrHrB8EUtR7vB1YfWyJlSHE2PLmJo/zMTRc b3bm848/Ekau9M+zjEV/XYxwDYHZOt7BxpAKF2h1fDI5e0V+05a8n/Z6Bd+VSV1UtIaI GRX7y1xqlW2EQvKI1HBjH7aZMqw0Pegtrnaj6jfGYmGz8sR7gypdtWcIbILUXwoGRWsx g1TxUzTkbHz5IWRqUHBvgt5Az6G6aQzEl+KGZ+5stzvp0YYEnF2hjQkDAZcUlYpIiKx0 648A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ce9wf2Lq1Mi1CxToLb2hAfsKuhTwib8nVUtW1S4F9ms=; b=NfUZ05QWbRhaFSSAlGROoCwI9o1gYHA012oE7iPur6zTYONcYCiMjm3+l1XNsM5oh8 Afk/kkSdpRCVHsIynj1AMe6IEZG+jnQdr6JR5HS90S9KUaE7/IiPOSOGVjKwih9yMAwA PdoHPapQ/Eys45MsJiHhdZXyY2uZFALzvWv06NYku+2NqvhjyKHoNghnnb5KghlbmqC4 P8Iz5DGCQRcleTwYh/qtUo5bRGpFc0Rl/Binjojdw303kDIh5Gt234DZPlIePx3HBiVC aXNxitFZHwa8wlfidNV6/3x3oaXd1cxOHG3VRCjSxucvVy+leMm6+e1O9PvU8kce9QVl WcHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn15si1480944edb.555.2020.05.05.09.28.06; Tue, 05 May 2020 09:28:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730727AbgEEQ0Y (ORCPT + 99 others); Tue, 5 May 2020 12:26:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:57832 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730701AbgEEQ0V (ORCPT ); Tue, 5 May 2020 12:26:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EB82AAF5D; Tue, 5 May 2020 16:26:21 +0000 (UTC) From: Nicolas Saenz Julienne To: mbrugger@suse.com, u-boot@lists.denx.de, bmeng.cn@gmail.com, marex@denx.de, linux-kernel@vger.kernel.org Cc: sjg@chromium.org, m.szyprowski@samsung.com, s.nawrocki@samsung.com, mark.kettenis@xs4all.nl, Nicolas Saenz Julienne Subject: [PATCH v3 2/2] usb: xhci: Load Raspberry Pi 4 VL805's firmware Date: Tue, 5 May 2020 18:26:07 +0200 Message-Id: <20200505162607.334-3-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200505162607.334-1-nsaenzjulienne@suse.de> References: <20200505162607.334-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When needed, RPi4's co-processor (called VideoCore) has to be instructed to load VL805's firmware (the chip providing xHCI support). VideCore's firmware expects the board's PCIe bus to be already configured in order for it to load the xHCI chip firmware. So we have to make sure this happens in between the PCIe configuration and xHCI startup. Introduce a callback in xhci_pci_probe() to run this platform specific routine. Signed-off-by: Nicolas Saenz Julienne --- Changes since v2: - Get rid of #ifdef CONFIG_BCM2711 - Get rid of redundant error message Changes since v1: - Create callback board/raspberrypi/rpi/rpi.c | 6 ++++++ drivers/usb/host/xhci-pci.c | 6 ++++++ include/usb/xhci.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index e367ba3092..dcaf45fbf2 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -494,3 +495,8 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } + +void xhci_pci_fixup(struct udevice *dev) +{ + bcm2711_notify_vl805_reset(); +} diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index c1f60da541..1285dde1ef 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -11,6 +11,10 @@ #include #include +__weak void xhci_pci_fixup(struct udevice *dev) +{ +} + static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr, struct xhci_hcor **ret_hcor) { @@ -40,6 +44,8 @@ static int xhci_pci_probe(struct udevice *dev) struct xhci_hccr *hccr; struct xhci_hcor *hcor; + xhci_pci_fixup(dev); + xhci_pci_init(dev, &hccr, &hcor); return xhci_register(dev, hccr, hcor); diff --git a/include/usb/xhci.h b/include/usb/xhci.h index c16106a2fc..57feed7603 100644 --- a/include/usb/xhci.h +++ b/include/usb/xhci.h @@ -16,6 +16,7 @@ #ifndef HOST_XHCI_H_ #define HOST_XHCI_H_ +#include #include #include #include @@ -1281,4 +1282,6 @@ extern struct dm_usb_ops xhci_usb_ops; struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev); +extern void xhci_pci_fixup(struct udevice *dev); + #endif /* HOST_XHCI_H_ */ -- 2.26.2