From patchwork Tue Sep 22 09:23:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 1368875 X-Patchwork-Delegate: priyanka.jain@nxp.com 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=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=aB/w+NTv; 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 4BwbjD3njyz9sR4 for ; Tue, 22 Sep 2020 19:33:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9964825B0; Tue, 22 Sep 2020 11:32:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="aB/w+NTv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63DAE825A8; Tue, 22 Sep 2020 11:32:41 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:7d00::60b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E1649825A2 for ; Tue, 22 Sep 2020 11:32:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zhiqiang.hou@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UH5/gsLx0o2hr3AVgpFVjNKTLsXdO95KHzG+YIu2Hq7M3hhRXoLS08CYns3qWgDFr8Q0hUuiepUTqTAVEYIbUZ2E/x1dZu7Yr836q0vl0+yKozo97mHnA61s0Fg1ttHV0d2xQDwJBUI9TyzggdBm/MOnfQ5G5Zbu+eNRTiBvY9mB0hOLXbPNV/HTM9BWeMdl7086yDz7kuNfe2tjfjTWm8eHr8czYIG1EIIwu7MqpunIEE7mUnnGWYQBrbdRUrhyMCeuBIp8pIf+pmk7tdFjo38bgMIfw3fGc8O0f59EuFa75tcb8XAUtMvN+PG3Az+MuEZKs9wAG1rIB1b1BhXqzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=baBegIAYb6uqRnvgxEMVXKRO998p4o99j217qmOIjkU=; b=WV9oOyC5nmU7FCfxnFDc/+fbNA5Chcsoe0gXXrexCFRAX9S/fxWADamNQ6QEoox6ZQK5HInI/gXyxNZKT2KXqoAQBqvj74jL9cA+AElgXlFTptxFsqfECRPQsqCOkkULDtjoqzF/XNHc/Xo9syYkkvOSiyjcdTH51MfZZrEgH6VgbpnuGGWnprxlIsr1eVg/S8DYWLVlaoeO76hnzzYdc2a4TEO5V/lwBspNYsNv/5yf579+JzPFpWBaydeWgb5MKHi0f3+RRxbgflkFXQd/Q7h2khFwfOpNrnHS2HCLl+bj8I7cXSEtZDvFjKQ5MBWOQAMhknnMkjrCnXEJ2Racvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=baBegIAYb6uqRnvgxEMVXKRO998p4o99j217qmOIjkU=; b=aB/w+NTvtUEq/9tgFjuF8AYKZh58o7BGggNiGkqXp0k5bgOTo7NDxJvxjdyTGfEvdNU65wJepy8Md2AEXRFcMJlheg8jDF4W9pOEbJ2/vw13n/s0ihbR4D6YdYZkx8fjfg7s5QAKP7q8jlwdeoD8joCXDqDFGmIf9aNWkoNZV6U= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=nxp.com; Received: from HE1PR0402MB3371.eurprd04.prod.outlook.com (2603:10a6:7:85::27) by HE1PR0402MB2889.eurprd04.prod.outlook.com (2603:10a6:3:d6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.17; Tue, 22 Sep 2020 09:32:35 +0000 Received: from HE1PR0402MB3371.eurprd04.prod.outlook.com ([fe80::c872:d354:7cf7:deb9]) by HE1PR0402MB3371.eurprd04.prod.outlook.com ([fe80::c872:d354:7cf7:deb9%3]) with mapi id 15.20.3391.026; Tue, 22 Sep 2020 09:32:35 +0000 From: Zhiqiang Hou To: u-boot@lists.denx.de, bmeng.cn@gmail.com, olteanv@gmail.com, priyanka.jain@nxp.com Cc: Hou Zhiqiang Subject: [PATCHv6 06/18] net: tsec: Add the compatible string "gianfar" support Date: Tue, 22 Sep 2020 17:23:35 +0800 Message-Id: <20200922092347.19141-7-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200922092347.19141-1-Zhiqiang.Hou@nxp.com> References: <20200922092347.19141-1-Zhiqiang.Hou@nxp.com> X-ClientProxiedBy: SG2PR06CA0169.apcprd06.prod.outlook.com (2603:1096:1:1e::23) To HE1PR0402MB3371.eurprd04.prod.outlook.com (2603:10a6:7:85::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.73) by SG2PR06CA0169.apcprd06.prod.outlook.com (2603:1096:1:1e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.13 via Frontend Transport; Tue, 22 Sep 2020 09:32:33 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.73] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6d5c013c-7a61-49b4-810c-08d85eda7036 X-MS-TrafficTypeDiagnostic: HE1PR0402MB2889: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xVlaXuby6ytTXV5GBP1zukjkVYF05OMf1li6AlrYmb/wAtlciZZMD92g6/i9Tj8mguEjNyRqlJ0DSXg1lkS01PEHxxws1PhP3gDTANtjnu3EpaflsC2g2yrdjx1PZppT+2q39QI/rJ3VwD4fl76U1pl0aHT/hWda6ZnEBz+4dhMcLyZGNVLIk6pGqE+2ERJCP11SMelr5TVY5Xk1nnx8ckLE03hR8IR2mrzStFxbCrrLoUKRm7MgqQneAg8ggXDO1SCT4w/XK1Mr/bhUVOYMRm0yRnTlN8rbfNGZnA/6LI0imRFRw5DRJEFHwCq4QeHPjBUXUxpeQDyt6fLKOTKjw2SCvFj4e1ZD7dKpsWftsyytURPdBcexKrZbMvlXPxZ2 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HE1PR0402MB3371.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(136003)(396003)(39860400002)(346002)(8676002)(66946007)(6636002)(5660300002)(316002)(8936002)(6512007)(4326008)(66556008)(66476007)(2906002)(83380400001)(186003)(26005)(478600001)(86362001)(69590400008)(6506007)(1076003)(52116002)(16526019)(956004)(6486002)(36756003)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: lR/J/CtsHeLlrhccJR6xOMHO8gMRWyT3XRYulmLptG0SKIwKHjdICbmO2ouLIgSx/bgV4nvr6/kn303wXlJ9+k/+7xmLDjJMRkWTBSKtinOwv0LW0Gw6A7ONUWyGq1xd3dlwe3s/fo7xqU8SB2xbUkVrgjtoiN9FDENYuB5ArbS7deeFEeZhe46fnMwK+m7UrvQtlda8tPwMBlG2BCH6WG/EX2OZLm7dVCjiUYSzQuRqzh3AaB87CNyVesqdHUExKPotIeggbG0JyTaCaaAQ864D0+XG2UzcPlwwEQ4Bl/YeSmAQ0Ttgq2CLRmnEXA/cdid7hn0XNCaRkKB5haz2J87Jj5MfObZ3IkZGWLHzfm2VngK/3SLpM9lWmhfFg/Ucbi2/tJlI99mD9NL5iRREi3RchocdU+V+LbPY4hWGQOfGl9guExGvNdUPEGMvZKwUxNIqvJyY9XJTpNyYnF784YjU70Nfu0SBLnWdvI0mA6bUim/+pus2osm39IvP1+xA3pe1oI8eLhCTDsJcInvARL9n3NZkCvcoFXNCIPEi+mjKcWlTw4qJVwMQMPgv4kzJX8vCjal9TJBNt3dVq3sCqTubOFHLn3gut2lA//LYCnZOdltEB1HeWjHoUf4d3Us3GEegtAfU9QRiokfZed7w5A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d5c013c-7a61-49b4-810c-08d85eda7036 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3371.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2020 09:32:35.6184 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D8/fgVotCqHBPICIda5olRBE4l+k7mFcf3Egi8DiTWWTPb4nzjlQhbKNSrERukooCECPZ+4/QhBM6zae08dk/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB2889 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: Hou Zhiqiang Add compatible string "gianfar" support and update the device-tree-bindings doc. Signed-off-by: Hou Zhiqiang Reviewed-by: Vladimir Oltean --- V6: - No change. doc/device-tree-bindings/net/fsl-tsec-phy.txt | 2 +- drivers/net/tsec.c | 16 ++++++++++++++-- include/tsec.h | 4 ++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/device-tree-bindings/net/fsl-tsec-phy.txt b/doc/device-tree-bindings/net/fsl-tsec-phy.txt index 8e8574bc97..a44c5fd9d9 100644 --- a/doc/device-tree-bindings/net/fsl-tsec-phy.txt +++ b/doc/device-tree-bindings/net/fsl-tsec-phy.txt @@ -2,7 +2,7 @@ Properties: - - compatible : Should be "fsl,etsec2" + - compatible : Should be "fsl,etsec2" or "gianfar" - reg : Offset and length of the register set for the device - phy-handle : See ethernet.txt file in the same directory. - phy-connection-type : See ethernet.txt file in the same directory. This diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 1e04a89102..e59a107ea8 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -808,11 +808,14 @@ int tsec_probe(struct udevice *dev) struct tsec_private *priv = dev_get_priv(dev); struct ofnode_phandle_args phandle_args; u32 tbiaddr = CONFIG_SYS_TBIPA_VALUE; + struct tsec_data *data; const char *phy_mode; fdt_addr_t reg; ofnode parent; int ret; + data = (struct tsec_data *)dev_get_driver_data(dev); + pdata->iobase = (phys_addr_t)dev_read_addr(dev); priv->regs = dev_remap_addr(dev); @@ -833,7 +836,7 @@ int tsec_probe(struct udevice *dev) return -ENOENT; } - priv->phyregs_sgmii = map_physmem(reg + TSEC_MDIO_REGS_OFFSET, + priv->phyregs_sgmii = map_physmem(reg + data->mdio_regs_off, 0, MAP_NOCACHE); } @@ -885,8 +888,17 @@ static const struct eth_ops tsec_ops = { .mcast = tsec_mcast_addr, }; +static struct tsec_data etsec2_data = { + .mdio_regs_off = TSEC_MDIO_REGS_OFFSET, +}; + +static struct tsec_data gianfar_data = { + .mdio_regs_off = 0x0, +}; + static const struct udevice_id tsec_ids[] = { - { .compatible = "fsl,etsec2" }, + { .compatible = "fsl,etsec2", .data = (ulong)&etsec2_data }, + { .compatible = "gianfar", .data = (ulong)&gianfar_data }, { } }; diff --git a/include/tsec.h b/include/tsec.h index 43255e538f..5433cfd966 100644 --- a/include/tsec.h +++ b/include/tsec.h @@ -394,6 +394,10 @@ struct tsec { #define TX_BUF_CNT 2 +struct tsec_data { + u32 mdio_regs_off; +}; + struct tsec_private { struct txbd8 __iomem txbd[TX_BUF_CNT]; struct rxbd8 __iomem rxbd[PKTBUFSRX];