Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp370508ybt; Fri, 10 Jul 2020 01:53:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3h/bbh34BRdPsLtEtbAHfcbAvGYjwItuC0qATUD74gDzmC/3mdnqqc2uQMLxxRElI2J8S X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr60854409ejb.8.1594371218785; Fri, 10 Jul 2020 01:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594371218; cv=none; d=google.com; s=arc-20160816; b=MSkct6smtt0vxUqulejfMrdnxPBZ/tdiljGp1Ea0ixvIaWDtVVu1/kDRFOv1IxZObb jPrR4iMPycMPIXhklMuATuYX0f1mOY+fWSZPjN5FpgVIH0AMTDlarUNa3mUPRtMUoG+X cj1QcQ53z80isi/ePFxnqMVYjAMbGKVpGyzEFcR/ocBo5zb2ckQ6j4kB6zTDzH2Ch7gW ikHMWojidftTFP6emvH/0oDcdnW2QoG7iUhDiG5ElcE55rgrMvJNGkie1dPu5q0BbOMJ UfWIz55B4G61scozbbwVvofHtGtk/pUGW+8sysAa46Xekt9FGCmqywlMZy4vbtmlyrKW SRGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=DuCUdjY+QuxCi00BCi4yAmfUvWcxHWI4oE/j+WkRSLE=; b=XElOf7kVwctI5nCfFaRrxN2FOo1kvQ6iASuLBftquJaHK+xteJxABhr8HC9yh3VGwo lcB//LqVkM8IEaA9OkfKbdUhX2uG/gmGIxrVNYqkM0xbm9ve5yn+hbl4VidZef2gqVR8 RpF3NTCl90IQss0T2Fc2Ahu2WOIhjzD2xbDqWHcv+BRxg4hlfTeznZUhyQ5JyNYgbDAi 4KjcE7cXdsj7U3+kiEqScOh1uSOSe8MkR4QQ7IS5UOM5MKafYj2+m8KabxNKlqVd0b0o q3xUQa0dSDW0myna4+Y/+MwuztEgMO6H9z/2bRk8+pRlx2vZugFGAfmdGp7WvxnbEoUC aJUg== 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 g10si3807978edu.361.2020.07.10.01.53.16; Fri, 10 Jul 2020 01:53:38 -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 S1728033AbgGJIwO (ORCPT + 99 others); Fri, 10 Jul 2020 04:52:14 -0400 Received: from mail.loongson.cn ([114.242.206.163]:34540 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726832AbgGJIwN (ORCPT ); Fri, 10 Jul 2020 04:52:13 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9CxGdQpLAhfS0kBAA--.1768S2; Fri, 10 Jul 2020 16:51:54 +0800 (CST) From: Zhi Li To: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net, kuba@kernel.org, mcoquelin.stm32@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lixuefeng@loongson.cn, chenhc@lemote.com, jiaxun.yang@flygoat.com, yangtiezhu@loongson.cn, Hongbin Li Subject: [PATCH] stmmac: pci: Add support for LS7A bridge chip Date: Fri, 10 Jul 2020 16:51:50 +0800 Message-Id: <1594371110-7580-1-git-send-email-lizhi01@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9CxGdQ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JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VU18wI3UUUUU== X-CM-SenderInfo: xol2xxqqr6z05rqj20fqof0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add gmac platform data to support LS7A bridge chip. Co-developed-by: Hongbin Li Signed-off-by: Hongbin Li Signed-off-by: Zhi Li --- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 272cb47..dab2a40 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -138,6 +138,24 @@ static const struct stmmac_pci_info snps_gmac5_pci_info = { .setup = snps_gmac5_default_data, }; +static int loongson_default_data(struct pci_dev *pdev, struct plat_stmmacenent_data *plat) +{ + common_default_data(plat); + + plat->bus_id = pci_dev_id(pdev); + plat->phy_addr = 0; + plat->interface = PHY_INTERFACE_MODE_GMII; + + plat->dma_cfg->pbl = 32; + plat->dma_cfg->pblx8 = true; + + return 0; +} + +static struct stmmac_pci_info loongson_pci_info = { + .setup = loongson_default_data; +}; + /** * stmmac_pci_probe * @@ -204,6 +222,8 @@ static int stmmac_pci_probe(struct pci_dev *pdev, res.addr = pcim_iomap_table(pdev)[i]; res.wol_irq = pdev->irq; res.irq = pdev->irq; + if (pdev->vendor == PCI_VENDOR_ID_LOONGSON) + res.lpi_irq = pdev->irq + 1; return stmmac_dvr_probe(&pdev->dev, plat, &res); } @@ -273,11 +293,13 @@ static SIMPLE_DEV_PM_OPS(stmmac_pm_ops, stmmac_pci_suspend, stmmac_pci_resume); #define PCI_DEVICE_ID_STMMAC_STMMAC 0x1108 #define PCI_DEVICE_ID_SYNOPSYS_GMAC5_ID 0x7102 +#define PCI_DEVICE_ID_LOONGSON_GMAC 0x7a03 static const struct pci_device_id stmmac_id_table[] = { { PCI_DEVICE_DATA(STMMAC, STMMAC, &stmmac_pci_info) }, { PCI_DEVICE_DATA(STMICRO, MAC, &stmmac_pci_info) }, { PCI_DEVICE_DATA(SYNOPSYS, GMAC5_ID, &snps_gmac5_pci_info) }, + { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_pci_info) }, {} }; -- 2.1.0