Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2224404ybh; Mon, 9 Mar 2020 01:24:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuiVwraZ/gTy3n5flR179xeSvV/sXJgR/EnVlcw3hsAC8CXy7fiAxKSUUXLfJN83aa9SHX9 X-Received: by 2002:a05:6830:1345:: with SMTP id r5mr12099366otq.342.1583742279852; Mon, 09 Mar 2020 01:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583742279; cv=none; d=google.com; s=arc-20160816; b=UfaMKgL8ldH5QBx/ETnu11dTFHiMPAh/It6CXNAOunFnjDXVri5qHkVS1trziVf+Gx G69XzI3RM8aWROrlINhsuIRpdtuI0zS/DuuRQWomISJKf/FjHDnhc9GiZ9Qw3TsUtB55 YWaUfY8P8ATiNL8pyhM8NS14hxmkaitiV0btZmpqaslkar33pwec7uzJ+7Y8hLaxT6QA XciTXLVzxE1z/W+CqCFUmuDk/4KxU/Di2NiLI2+0sjleW+UtKebhqGAdhNBXuw09R/83 AHXoHBSwARfb8makpVrAb0OHmbGAJW3VN++Z67aUgxHJNASZ2Goys1q8isneX6Vjuqsy bmpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=3HJ1rqEgqEqJBbU0kccmL1LkxTRwyUicP44YYuA0hA4=; b=t/ofE41vZAunWDT7LLcI3KxbKklLgbVmSwLc0xQDbq9fon57D4nD1R80TUJyyMC7Jo 6lP+V7if6AG4F10/La6ROTtTiQvUhCQWaFiB15zR4cb4N072Zz1Qj6vViiNpCO8wgP7t gU+zAlTaNALzcvGUgxQq5VDisMDaNbqCNxvA6JWwlzoZPvwMZcUuJUq0nMVsV++JWqTA ius6aYU6JkCITzCm24P+e6Yc2LEUwGyW+DONtr1+YnV/taFyY9S/EMiy2cTromQV4leo MP1T1QGIWnB5svQsKXf+Mykd6+8mY/IQaOguJzmHpAgeHLUaJQ7Ku0RkD0neNg31GJy2 jQNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si3849474oie.187.2020.03.09.01.24.28; Mon, 09 Mar 2020 01:24:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgCIIYJ (ORCPT + 99 others); Mon, 9 Mar 2020 04:24:09 -0400 Received: from mail.loongson.cn ([114.242.206.163]:55944 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726446AbgCIIXs (ORCPT ); Mon, 9 Mar 2020 04:23:48 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxb9_+_GVesb4YAA--.12S4; Mon, 09 Mar 2020 16:23:30 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Huacai Chen , Jiaxun Yang , Bjorn Helgaas , Jens Axboe Cc: linux-mips@vger.kernel.org, linux-pci@vger.kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [PATCH 2/6] AHCI: Add support for Loongson 7A1000 SATA controller Date: Mon, 9 Mar 2020 16:23:22 +0800 Message-Id: <1583742206-29163-3-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1583742206-29163-1-git-send-email-yangtiezhu@loongson.cn> References: <1583742206-29163-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9Dxb9_+_GVesb4YAA--.12S4 X-Coremail-Antispam: 1UD129KBjvJXoW7AFW8XryrZr4UXrWDCw4fGrg_yoW8Gry7pF 43XFWDKr40grWrK3WDJw4DGry3JF4DGa4Ikayak392qr4qyry5Wr97Aa47JrW7K34kXF17 X34qkr47Wr4DZw7anT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPK14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2 x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UM2 8EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxd M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx v20xvE14v26r1j6r18McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1l F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2 IY04v7MxkIecxEwVAFwVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8 JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1V AFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4 A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU 0xZFpf9x0pRXTmfUUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Loongson 7A1000 SATA controller uses BAR0 as the base address register. Signed-off-by: Tiezhu Yang --- drivers/ata/ahci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 11ea1af..28a336e 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -40,6 +40,7 @@ enum { AHCI_PCI_BAR_STA2X11 = 0, AHCI_PCI_BAR_CAVIUM = 0, + AHCI_PCI_BAR_LOONGSON = 0, AHCI_PCI_BAR_ENMOTUS = 2, AHCI_PCI_BAR_CAVIUM_GEN5 = 4, AHCI_PCI_BAR_STANDARD = 5, @@ -589,6 +590,10 @@ static const struct pci_device_id ahci_pci_tbl[] = { /* Enmotus */ { PCI_DEVICE(0x1c44, 0x8000), board_ahci }, + /* Loongson */ + { PCI_VDEVICE(LOONGSON, PCI_DEVICE_ID_LOONGSON_7A1000_SATA), + board_ahci }, + /* Generic, PCI class code for AHCI */ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci }, @@ -1680,6 +1685,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ahci_pci_bar = AHCI_PCI_BAR_CAVIUM; if (pdev->device == 0xa084) ahci_pci_bar = AHCI_PCI_BAR_CAVIUM_GEN5; + } else if (pdev->vendor == PCI_VENDOR_ID_LOONGSON) { + if (pdev->device == PCI_DEVICE_ID_LOONGSON_7A1000_SATA) + ahci_pci_bar = AHCI_PCI_BAR_LOONGSON; } /* acquire resources */ -- 2.1.0