From nobody Fri Nov 22 03:34:02 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 2D7DA199FC9; Wed, 20 Nov 2024 07:50:30 +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=1732089031; cv=none; b=cFEGxjA5N4mcFeTUf6WQuMp7iNC14C5//bBwLpN0WlfA/0HjlLdMfQ66qk2rNRGYxmY2cAJwY15a1My/55k7hVmFSUbX/gpDZ5Mw2Lq2gNDSBq8Y7CoGZ18899qkB5Z3DYw1adsen1CABUFsqZGU4qSnkUZg0GsyK+8pmVqnUhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732089031; c=relaxed/simple; bh=TWCqBj0Mj8/l2t9c51HtO9Ra4L6D7DI1GK/xJ1J/VRE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NSyP9NGX+eOqCUO2nKyGQU34dQclPfjWwO8u7e6uV3+TFMPMGi/3KllPoOenaoDOD3yh8j2UV27UjHtcWzaxNITMJCn46C092LQ7RcEGIdWkJ4UfTBVQ7yCHXZtwQO0i16NmmsZvYViJ3Aok3HDjAMyTCJY8DZlaLK7J/XvQyI0= 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; Wed, 20 Nov 2024 15:50:17 +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; Wed, 20 Nov 2024 15:50:17 +0800 From: Jacky Chou To: , , , , , , , , , , , , CC: Subject: [PATCH net-next v3 4/7] net: ftgmac100: Add support for AST2700 Date: Wed, 20 Nov 2024 15:50:14 +0800 Message-ID: <20241120075017.2590228-5-jacky_chou@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241120075017.2590228-1-jacky_chou@aspeedtech.com> References: <20241120075017.2590228-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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 1840f7089676..6dfd29505d2c 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; @@ -1976,7 +1977,8 @@ static int ftgmac100_probe(struct platform_device *pd= ev) goto err_phy_connect; =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); } @@ -2023,6 +2025,12 @@ static int ftgmac100_probe(struct platform_device *p= dev) netdev->hw_features &=3D ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM); netdev->features |=3D netdev->hw_features; =20 + 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; + } + /* register network device */ err =3D register_netdev(netdev); if (err) { --=20 2.25.1