Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1821086ybz; Thu, 30 Apr 2020 06:10:17 -0700 (PDT) X-Google-Smtp-Source: APiQypJRgppoSP0bAMEYIbkWZocVB3qTPw2XFw81nBFVD/y8shYKJZxs0xQUnh0wCEKFkuDwlXDB X-Received: by 2002:a05:6402:686:: with SMTP id f6mr2710733edy.136.1588252216947; Thu, 30 Apr 2020 06:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588252216; cv=none; d=google.com; s=arc-20160816; b=eakiO0AYA/0GGOVUu+wk5cyWCWUgbBZFDu+ufbSEl9mL0nYFe6uV/Co3ai+Q+hDlhP eXEadhPcNFaKyJcvvbLbzFq4QDynV9zfWPihkx/0Fz3eb4Vm7MJ6+VMosbAPceCWI3bO 2YHS2L4z+hMT1/+2icdBFCKJcKzcIIGxqUF/WdfCvMh8Clp0Beu2IphaiO02HIPddSeQ RVHRpNcNqhxw3XRTsCREYuRQzNe9XCh1HgkxDqM9zV54rlhjYCmPqyuJG9lT078nISOS YSLs9Kfil6BFxiFi3FRGknkCkxib24oGd/e4cXh4KaGq/waIUpMioc2ioyuccZe3kJXr IssA== 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=c+9nS30DBScKdswain6sxuEMB/sGSIEBym5hdGxIuUY=; b=GgPRBwVvxjivE5OZkB3MGFpt7cKhGQnNgp9hvbIvWihLeZFoGq/kPSfTr1NAIqAcBu znIZvk3hoQbFO9nTjjFNTf1G07YAIRNtQHc5fM3HJxE1Up65779pzzK61r0BaUrybWE5 dotLe8v7AS39KkzcChfKjSuuihKLG9RDCam2yMSjqjjM+e505bsa9nyGyZgsf6JpyWKd Gb+udINLYhincgqleiHCJa/OWS4O6M60aq1ZbCRMSqu3bagNTCvvbPFYkHCOp/oHCMWK NaaWgIm0z/eU1MPPdUFghinpyvqSOyC6lSJbojG3HxacaXGfY+OV25Gouq3JvfMlbSQ3 udIA== 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 ba9si5267842edb.114.2020.04.30.06.09.53; Thu, 30 Apr 2020 06:10:16 -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 S1727110AbgD3NEp (ORCPT + 99 others); Thu, 30 Apr 2020 09:04:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:50884 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbgD3NEn (ORCPT ); Thu, 30 Apr 2020 09:04:43 -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 36D7EACCE; Thu, 30 Apr 2020 13:04:41 +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, Nicolas Saenz Julienne Subject: [PATCH v2 2/2] usb: xhci: Load Raspberry Pi 4 VL805's firmware Date: Thu, 30 Apr 2020 15:04:33 +0200 Message-Id: <20200430130433.11248-3-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200430130433.11248-1-nsaenzjulienne@suse.de> References: <20200430130433.11248-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). VideoCore'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 v1: - Create callback board/raspberrypi/rpi/rpi.c | 12 ++++++++++++ drivers/usb/host/xhci-pci.c | 6 ++++++ include/usb/xhci.h | 3 +++ 3 files changed, 21 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index e367ba3092..8aa78d1f48 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,14 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } + +#ifdef CONFIG_BCM2711 +void xhci_pci_fixup(struct udevice *dev) +{ + int ret; + + ret = bcm2711_notify_vl805_reset(); + if (ret) + printf("RPI: Failed to notify VideoCore about vl805's firmware\n"); +} +#endif 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