From patchwork Mon Aug 17 07:07:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1345693 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=M6Tm3z3d; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BVQFh12R9z9sPC for ; Mon, 17 Aug 2020 17:11:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58BB7822AA; Mon, 17 Aug 2020 09:08:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1597648126; bh=aartUAzJmJvJm5BQhs41Lyxg2bHNHZ0HxJfrVC7j02Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=M6Tm3z3dU3LQ7BQOExunhLT+WDYAFpPX6g4a7Q4ZSuyrFUOOSbf3xa+68Turv429s kvXbWlL90Ej7E4C1vzaEHVb5KBRK/Cy/PqzyAttddZiL/+QmG7M0PWZ+0BBLegDUL5 pPp5yE36lhOJW0MS51HSe5Rgu0GDjtjgSp5sPOyKVLEN2amgoBIPtFrlPGINlAN9Aj FK5iPdgod88LiRyG8rYhRTJYWVFjUTzVB2iHuYozsaznHibnnpX3duYXMe+9fyr9st KVSeuAzJ+/aRAU4p8/SDzXEpRieL2dmyDr6/vzFIYZt3mWBHOcvBx4MJ0SflHf26rE drZPuZQpA0CWw== Received: by phobos.denx.de (Postfix, from userid 109) id 0BCC482222; Mon, 17 Aug 2020 09:08:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from mx2.mailbox.org (mx2a.mailbox.org [IPv6:2001:67c:2050:104:0:2:25:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 61B2682236 for ; Mon, 17 Aug 2020 09:08:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 20C87A1613; Mon, 17 Aug 2020 09:08:12 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id 1QSI20ptyami; Mon, 17 Aug 2020 09:08:09 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: sjg@chromium.org, awilliams@marvell.com, trini@konsulko.com, sgarapati@marvell.com, cchavva@marvell.com Subject: [PATCH v2 17/25] ata: ahci: Add BAR index quirk for Cavium PCI SATA device Date: Mon, 17 Aug 2020 09:07:54 +0200 Message-Id: <20200817070802.1517632-18-sr@denx.de> In-Reply-To: <20200817070802.1517632-1-sr@denx.de> References: <20200817070802.1517632-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -1.31 / 15.00 / 15.00 X-Rspamd-Queue-Id: 23F1017F1 X-Rspamd-UID: ca8f62 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Suneel Garapati For SATA controller found on OcteonTX SoC's, use non-standard PCI BAR0 instead of BAR5. Signed-off-by: Suneel Garapati Reviewed-by: Simon Glass Signed-off-by: Stefan Roese --- Changes in v2: - Add Reviewed-by tag from Simon - Add note about adding a Kconfig option for AHCI quirks, once there are multiple quirks Changes in v1: - Change patch subject - Use constants from pci_ids.h instead of hardcoded values drivers/ata/ahci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 47cdea1f58..22bc0d3b10 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1198,10 +1198,25 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base) int ahci_probe_scsi_pci(struct udevice *ahci_dev) { ulong base; + u16 vendor, device; base = (ulong)dm_pci_map_bar(ahci_dev, PCI_BASE_ADDRESS_5, PCI_REGION_MEM); + /* + * Note: + * Right now, we have only one quirk here, which is not enough to + * introduce a new Kconfig option to select this. Once we have more + * quirks in this AHCI code, we should add a Kconfig option for + * this though. + */ + dm_pci_read_config16(ahci_dev, PCI_VENDOR_ID, &vendor); + dm_pci_read_config16(ahci_dev, PCI_DEVICE_ID, &device); + + if (vendor == PCI_VENDOR_ID_CAVIUM && + device == PCI_DEVICE_ID_CAVIUM_SATA) + base = (uintptr_t)dm_pci_map_bar(ahci_dev, PCI_BASE_ADDRESS_0, + PCI_REGION_MEM); return ahci_probe_scsi(ahci_dev, base); } #endif