From patchwork Wed Jun 3 07:52:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Nemirovsky X-Patchwork-Id: 1302830 X-Patchwork-Delegate: trini@ti.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=none (p=none dis=none) header.from=cortina-access.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=CortinaAccess.onmicrosoft.com header.i=@CortinaAccess.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-CortinaAccess-onmicrosoft-com header.b=G+rFMwxb; 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 49cLk75Hwwz9sT5 for ; Wed, 3 Jun 2020 17:53:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A3AD81260; Wed, 3 Jun 2020 09:52:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=cortina-access.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=CortinaAccess.onmicrosoft.com header.i=@CortinaAccess.onmicrosoft.com header.b="G+rFMwxb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C3AA810DB; Wed, 3 Jun 2020 09:52:56 +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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-pu1apc01on062f.outbound.protection.outlook.com [IPv6:2a01:111:f400:febe::62f]) (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 2AF9D810DB for ; Wed, 3 Jun 2020 09:52:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=cortina-access.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Alex.Nemirovsky@cortina-access.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oIJ6LCWSF5ZVCNtQHjuM855Usz7GJ1AwsiFasHiJckd9TCZiQm2pptcERdLAb4jPIu58lthWOg6EO0jFxt2s4DeCCHlkVsN98S+M0vA8PMbPLmoQGh5/6jSR7NNjM2ptqhL/q6k//ZitP+cgCKhoV3nfDsnrjAdlVdZZ0NldIqLTbKpePKlofJYui0x2Slb7+CT4yHBNMDYj0K+Z/ZBtuVYXwmPJEhrPgcQgapnpdnK7Bda+bxucc0oXSifGfL33FMVaozqEXWpxDiZ+DyE+3Ez95E85ucB0PQBmGeKgQtE8Abq7/9+VG9Ufxb7aemYERXR0cAvHkk8MLGY06vgi3A== 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=WzX5cK7WSkYNUaxQwJRwJo/pYHqM0Ssd+fWAzvKfDEo=; b=Ak+RGrlUCXWvvhqFqXFvoeg26/9L872C4Aj5A7hTScMv6Nl7OPbhzY26ShPisEZvXI0kRuOJZfL+P/pt1/rEQQ821Tjfv3WX9H973gtNp9Xu9QR3/Gil4Lx1OPZeJnmSshYPS7hnW6VRF106ei9XXlmnIU2/iQDstLxsYgTQJK410DI3e6yNag3cNfWF0/x6BnCZ3OGeoZ4I9+V2894bBZDbbPLjBuZd32BmNRxH7ih+CJqJXsZlhcrARW9XOSYRWnngk5i6KS6bX29nM4bKSJQIqyAgLjMsEKj/0ebWXp14n5MvyGI9QCDed5ZTcWba4FztRgNR9q8db4KuP2pRJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cortina-access.com; dmarc=pass action=none header.from=cortina-access.com; dkim=pass header.d=cortina-access.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CortinaAccess.onmicrosoft.com; s=selector2-CortinaAccess-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WzX5cK7WSkYNUaxQwJRwJo/pYHqM0Ssd+fWAzvKfDEo=; b=G+rFMwxb/8QTTcJ/hs5MY55EJMGBS0jkqSVsAooHiVmchYQGRix9bSObtzFlXpZs/nncjeylno7baZyVg8/968xYnoz5nKaqhxDHQUfAntgKbaMd+8XQngNyDqizuT3LT8acyOXjzMqIATXhXqL3xEXxlcWfs227hb3lOrKctGs= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=cortina-access.com; Received: from PU1PR01MB1964.apcprd01.prod.exchangelabs.com (2603:1096:803:1e::16) by PU1PR01MB1899.apcprd01.prod.exchangelabs.com (2603:1096:803:1c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Wed, 3 Jun 2020 07:52:49 +0000 Received: from PU1PR01MB1964.apcprd01.prod.exchangelabs.com ([fe80::c19b:2121:2956:35a5]) by PU1PR01MB1964.apcprd01.prod.exchangelabs.com ([fe80::c19b:2121:2956:35a5%4]) with mapi id 15.20.3066.018; Wed, 3 Jun 2020 07:52:49 +0000 From: Alex Nemirovsky To: u-boot@lists.denx.de Cc: Alex Nemirovsky Subject: [PATCH v2 2/2] board: presidio-asic: Add CAxxxx Ethernet support Date: Wed, 3 Jun 2020 00:52:33 -0700 Message-Id: <1591170753-2691-2-git-send-email-alex.nemirovsky@cortina-access.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591170753-2691-1-git-send-email-alex.nemirovsky@cortina-access.com> References: <1591170753-2691-1-git-send-email-alex.nemirovsky@cortina-access.com> X-ClientProxiedBy: CO2PR04CA0158.namprd04.prod.outlook.com (2603:10b6:104:4::12) To PU1PR01MB1964.apcprd01.prod.exchangelabs.com (2603:1096:803:1e::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smok.hrh.localdomain (70.58.207.205) by CO2PR04CA0158.namprd04.prod.outlook.com (2603:10b6:104:4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3066.18 via Frontend Transport; Wed, 3 Jun 2020 07:52:48 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [70.58.207.205] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 492daa6c-582e-43d3-f18a-08d807931c68 X-MS-TrafficTypeDiagnostic: PU1PR01MB1899: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-LD-Processed: 0694623c-6669-497c-89c3-3a32a9934313,ExtAddr X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-Forefront-PRVS: 04238CD941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T7HJ0f8aeoPl8jq7il9BMl9/X5HSv1I8dz1/MJZdXx5smUuiaF95CNItBq9Q8VHCttAcPY4a0qsNWmU99whoSZFTE9G4DMBBKXBYJpGVjSC7CzUVxcfDUdGfZXVcstFUB5opH86fypVcbU+kOkuFCR38mxhVFjcildKIc7giLCRQX8Nt8yG20ixOvDH7VaMAjOGLfg6VnGX+Tt8rcxa+E/HwoxwAsGIHFmxxmzdW3gd7tMFmEXYB3K5ihk+rGVil2Twbq4bWdUACuciM8tEJui0FwHkSc17vm46HdYSdqVvT8Ut+uUwUz0yecpI8A8PMujp/TZ5w97dS6DdA1O91tA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PU1PR01MB1964.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(39850400004)(346002)(136003)(366004)(376002)(107886003)(26005)(4326008)(16526019)(316002)(8676002)(44832011)(186003)(6512007)(6506007)(6666004)(956004)(8936002)(83380400001)(2616005)(5660300002)(66556008)(508600001)(2906002)(52116002)(6486002)(36756003)(86362001)(66946007)(66476007)(6916009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 66J2byNiTvwyyFcyu9NWbNvQa0lZ9Va0YY+vOkN1GDiYiTzoTbngiyh/6W7GyNObqOmzs3/uDtB9gws9Qn0BaahFbHRNMqdc/5h7pQO1VUjTa9J+GUsyJOvquwXPEGLYqCaKGXPNh26Qvd9YUHQf26Im0XwKENvp9+P/WmP6vQuUdkzI3sTqAUNgCxD4z7C/i8i+pAb6no//d+yz3SBCe9UUIsMjNvu5ap1QYR11D0CS63x1H60Fu6DpKOJmFEhKkF1LZwNAS+LhJxiR1XJAKZLs9LafY1rxJgngDDGDSdxjxnIukZ0ILpneRHrf/n9EIabWf0kZiZ7ULgd0KbVHlx//UPzXyRZoBrUFcnYbDkgOZWzPgaG3eaYJTv3IGrOl3CIzMKfLGGr4q7e4zKB5SntxqYavjax/AFYTIWA3yXcG7zDHEOTim3oVkVUdcRtHqAhAfxcGr5M5PiPXZCHIuNd2fDJpdPb1ShJqWs03EO4= X-OriginatorOrg: CORTINA-ACCESS.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 492daa6c-582e-43d3-f18a-08d807931c68 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2020 07:52:49.4819 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0694623c-6669-497c-89c3-3a32a9934313 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6RJW0AlUSviDYQ+B0EDKqFfZwulo/0LwK5FT9sI0o+Ep+xiBRi1yjf5MRRbiii4J8EL+ZY/4BdH9FyHSjKvoVoSSgrQ6ANipS9m/BdrOZK+SI2qfTmfGRjtJd43W7OF0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1PR01MB1899 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean Add CAxxxx Ethernet support for the Cortina Access Presidio Engineering Board Signed-off-by: Alex Nemirovsky --- Changes in v2: None arch/arm/dts/ca-presidio-engboard.dts | 7 +++++++ board/cortina/presidio-asic/presidio.c | 21 +++++++++++++++++++++ configs/cortina_presidio-asic-emmc_defconfig | 4 +++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/ca-presidio-engboard.dts b/arch/arm/dts/ca-presidio-engboard.dts index c03dacc..fff879d 100644 --- a/arch/arm/dts/ca-presidio-engboard.dts +++ b/arch/arm/dts/ca-presidio-engboard.dts @@ -66,4 +66,11 @@ spi-max-frequency = <108000000>; }; }; + + eth: ethnet@0xf4300000 { + compatible = "eth_cortina"; + reg = <0x0 0xf4320000 0x34>, + <0x0 0xf43290d8 0x04>, + <0x0 0xf4304000 0x04>; + }; }; diff --git a/board/cortina/presidio-asic/presidio.c b/board/cortina/presidio-asic/presidio.c index 3c132f1..a0dbfd6 100644 --- a/board/cortina/presidio-asic/presidio.c +++ b/board/cortina/presidio-asic/presidio.c @@ -105,6 +105,27 @@ int board_init(void) return 0; } +#ifndef CONFIG_DM_ETH +/* + * Board specific ethernet initialization routine. + */ +int ca77xx_eth_initialize(bd_t *bis); +int board_eth_init(bd_t *bis) +{ + int rc = 0; + unsigned int reg_data; + + ca77xx_eth_initialize(bis); + + // Power down GMAC4 TX/RX clock for EMI issue + reg_data = readl(0xf4304684); + reg_data |= (3 << 11); + writel(reg_data, 0xf4304684); + + return rc; +} +#endif + int dram_init(void) { unsigned int ddr_size; diff --git a/configs/cortina_presidio-asic-emmc_defconfig b/configs/cortina_presidio-asic-emmc_defconfig index e10008a..360ebeb 100644 --- a/configs/cortina_presidio-asic-emmc_defconfig +++ b/configs/cortina_presidio-asic-emmc_defconfig @@ -21,12 +21,14 @@ CONFIG_CMD_EXT4=y CONFIG_OF_CONTROL=y CONFIG_OF_LIVE=y CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard" -# CONFIG_NET is not set CONFIG_DM=y CONFIG_CORTINA_GPIO=y CONFIG_DM_MMC=y CONFIG_MMC_DW=y CONFIG_MMC_DW_CORTINA=y +CONFIG_PHYLIB=y +CONFIG_DM_ETH=y +CONFIG_CORTINA_NI_ENET=y CONFIG_DM_SERIAL=y CONFIG_CORTINA_UART=y CONFIG_WDT=y