From nobody Wed Dec 4 19:25:10 2024 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA70314EC60; Mon, 18 Nov 2024 06:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731909750; cv=none; b=lGj4wc+Vm3n0N1wFZf3sLQdZEAuks1roAWpvXuG+04VLUucijeZn9zrCvMchMMzwp1Csc2m90WrxQW41+61kEDjPrS/J6M7A21vg7Zx6LDd+H7qVFF2EZJ0W1URkRjDE2X/8hNnA0AGlnMcvSGeHHQ8KfWctWPk+5q/i2POgAgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731909750; c=relaxed/simple; bh=n2XTKaJCsH8XAHaHQX2Xfs1h9fKItgAa3nZrIKn7oOg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qMS9F2VWlo9OHs25qEjUzS+joM2/wdibg8MxT/JA0K4ubAMebfBVoCXJHYMfinvwqlivvzB7BALFpCD4FrUyXpD5EWSUB69zum+26XakCtbxeywhygepu2+atnVyIaMb+VTubfuBmou2D2tdURauZjargTUVZUb15t49AWep458= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Mon, 18 Nov 2024 14:02:07 +0800 Received: from mail.aspeedtech.com (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Mon, 18 Nov 2024 14:02:07 +0800 From: Jacky Chou To: , , , , , , , , , , , CC: Subject: [net-next v2 4/7] net: ftgmac100: Add support for AST2700 Date: Mon, 18 Nov 2024 14:02:04 +0800 Message-ID: <20241118060207.141048-5-jacky_chou@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241118060207.141048-1-jacky_chou@aspeedtech.com> References: <20241118060207.141048-1-jacky_chou@aspeedtech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add comptaible for AST2700 and set dma mask to 64-bit. The ftgmac100 on AST2700 supports 64-bit DMA. Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index cae23b712a6d..5b277285666a 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1884,7 +1884,8 @@ static int ftgmac100_probe(struct platform_device *pd= ev) np =3D pdev->dev.of_node; if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac") || of_device_is_compatible(np, "aspeed,ast2500-mac") || - of_device_is_compatible(np, "aspeed,ast2600-mac"))) { + of_device_is_compatible(np, "aspeed,ast2600-mac") || + of_device_is_compatible(np, "aspeed,ast2700-mac"))) { priv->rxdes0_edorr_mask =3D BIT(30); priv->txdes0_edotr_mask =3D BIT(30); priv->is_aspeed =3D true; @@ -1967,7 +1968,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) dev_err(priv->dev, "MII probe failed!\n"); goto err_ncsi_dev; } - } =20 if (priv->is_aspeed) { @@ -1995,9 +1995,18 @@ static int ftgmac100_probe(struct platform_device *p= dev) } =20 /* Disable ast2600 problematic HW arbitration */ - if (of_device_is_compatible(np, "aspeed,ast2600-mac")) + if (of_device_is_compatible(np, "aspeed,ast2600-mac") || + of_device_is_compatible(np, "aspeed,ast2700-mac")) iowrite32(FTGMAC100_TM_DEFAULT, priv->base + FTGMAC100_OFFSET_TM); + + if (of_device_is_compatible(np, "aspeed,ast2700-mac")) { + err =3D dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); + if (err) { + dev_err(&pdev->dev, "64-bit DMA enable failed\n"); + goto err_register_netdev; + } + } } =20 /* Default ring sizes */ --=20 2.25.1