From patchwork Wed Jun 19 08:26:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1118535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="lSdPqF1Z"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="BiyLw40F"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45TJ2K06Zcz9s5c for ; Wed, 19 Jun 2019 18:26:32 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 611A0C21DEC; Wed, 19 Jun 2019 08:26:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9F3D2C21C50; Wed, 19 Jun 2019 08:26:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7BF18C21C50; Wed, 19 Jun 2019 08:26:26 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lists.denx.de (Postfix) with ESMTPS id B1043C21BE5 for ; Wed, 19 Jun 2019 08:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560932786; x=1592468786; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=BnK68wmtVIPVXZsXk1JVL8jPc9CT9lfVWWbcyO5SU7w=; b=lSdPqF1Zx8DiG7hTXq3WMJSsKosbCvSiY0lWRxvVnBP7zPnG2AhltaNL zn7UonHCvTE0gRXJVJc4OZOIvmD0pzOpeqgepjweQkz5L1t3ifwkG7SGQ 1nqP3Mtso2fOwwNHvQ2wvrUIwLGtwgm8nSVwqlPIBsDG62BU/anV/nI4J tER+kpVYo0b/Wkw9hFLvrEmrvcGytAvbjJdFhHoUtiP8DE3fOYJop2REW TEJDyayg0z3zt5W0ChIKwNZbQGxuz7Az+0umSBOHMf8dvGjwC28URZiFC m/dhR40yAVvFHp1ez9sLk1qfcUg4bMryFs74ZrmKfMdV5K9NgjXwudXa1 g==; X-IronPort-AV: E=Sophos;i="5.63,392,1557158400"; d="scan'208";a="110929498" Received: from mail-sn1nam01lp2054.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([104.47.32.54]) by ob1.hgst.iphmx.com with ESMTP; 19 Jun 2019 16:26:24 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BnK68wmtVIPVXZsXk1JVL8jPc9CT9lfVWWbcyO5SU7w=; b=BiyLw40FfJ5gmFpMWxWCoWZuYmT99CoUGo03rxe64hatuLOvwO4tdDZCZ5XjZUOWA1bmnkq/GCgSt6HUhyyNvV8EHJF0dLjVPjQzLoIzBFvQTlWLBIutpjpNNxxzvx8TdRrr+HhCHk3UQ2f6rW7ls3KonWWddC39+CQ9vds6/kQ= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB5950.namprd04.prod.outlook.com (20.179.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.15; Wed, 19 Jun 2019 08:26:21 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::84da:b4e7:4612:48b]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::84da:b4e7:4612:48b%7]) with mapi id 15.20.1987.014; Wed, 19 Jun 2019 08:26:21 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Lukas Auer , Simon Glass Thread-Topic: [PATCH v4 0/6] Update SiFive Unleashed Drivers Thread-Index: AQHVJnistcRat6WTOUCq69OAi/ifdQ== Date: Wed, 19 Jun 2019 08:26:20 +0000 Message-ID: <20190619082555.27607-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR01CA0090.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::32) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [129.253.179.161] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 59da9c98-3c71-48d9-460b-08d6f48fcec7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:MN2PR04MB5950; x-ms-traffictypediagnostic: MN2PR04MB5950: x-ms-exchange-purlcount: 2 wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 0073BFEF03 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(376002)(346002)(366004)(136003)(396003)(39860400002)(189003)(199004)(256004)(5660300002)(8676002)(14444005)(1076003)(2616005)(476003)(50226002)(8936002)(81156014)(81166006)(486006)(53936002)(6512007)(15650500001)(6306002)(2906002)(44832011)(68736007)(6436002)(316002)(6486002)(110136005)(54906003)(36756003)(966005)(72206003)(186003)(99286004)(6116002)(102836004)(52116002)(6506007)(26005)(3846002)(386003)(7736002)(305945005)(66946007)(73956011)(71200400001)(71190400001)(64756008)(25786009)(4326008)(66066001)(66446008)(66476007)(66556008)(86362001)(14454004)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB5950; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Laz4zBn/AN8IXLK/pM48dzchtKPZ1KmPYl4iHsHALuJ7uo+CWMouTd3lr5sc7LEol6uhyjdSHCVu+plEg4xZDPwzeyc+ueBsNzFNriCoTdTHa1UOAJmUWiHKCYxwOHyjbS7bENIKCfv1ticceEemMDkbKvXlW4tWRDxhT3rbEgxX8TF83lo16BDEneWtFG0lnctS+vHD2ij+utlT2xtsefIdwz9JY+1VhSRcz4xk91M7tQMY+3Fxze17KWIyoJIsGQ2UUsAiWakChim/LK9myKK4RqhzLe9YstEGZ+A523RwgsREdjpXL2lMD8shdBSxdOW6hDJgbtKCdOcx3dJlsLU17hCzgl9wb1JiG2Myu+7pbW2kLae5LzjPRPWUAhZjcvIrJ7evkGXIIgC69HIjVc06w8PFg3eN9Kw3uXovRFM= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59da9c98-3c71-48d9-460b-08d6f48fcec7 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jun 2019 08:26:20.9448 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Anup.Patel@wdc.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5950 Cc: Palmer Dabbelt , U-Boot Mailing List Subject: [U-Boot] [PATCH v4 0/6] Update SiFive Unleashed Drivers X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" This series update SiFive Unleashed clock driver so that: 1. It is in sync with upstream Linux driver 2. It uses latest DT bindings as-per upstream Linux driver With this series, we can now use latest DT bindings with U-Boot. I have tested SiFive Serial driver and Cadence MACB ethernet driver with this changes and both work fine. The legacy FSBL will still pass DTB to U-Boot with older DT bindings which will break the updated SiFive Unleashed clock driver. To tackle this, we have embedded DTB in OpenSBI FW_PAYLOAD firmware for SiFive Unleashed so that OpenSBI will override and pass updated DTB to U-Boot. In fact, the updated DTB passed by OpenSBI can be used by latest Linux (i.e. V5.2-rc1 or higher) as well. The OpenSBI changes to embed SiFive Unleashed DTB can be found in sifive_unleashed_dtb_fix_v4 branch of: https://github.com/avpatel/opensbi.git This series can be found in riscv_unleashed_clk_sync_v3 branch of: https://github.com/avpatel/u-boot.git Changes since v3: - Extend MACB ethernet driver for SiFive Unleashed board (just like Linux) Changes since v2: - Dropped PATCH6 which adds new compatible string to MACB driver because more changes are required in MACB driver for different ethernet speeds Changes since v1: - Dropped GEMGXL clock driver - Added new compatible string for SiFive MACB ethernet Anup Patel (6): clk: sifive: Factor-out PLL library as separate module clk: sifive: Sync-up WRPLL library with upstream Linux clk: sifive: Sync-up DT bindings header with upstream Linux clk: sifive: Sync-up main driver with upstream Linux clk: sifive: Drop GEMGXL clock driver net: macb: Extend MACB driver for SiFive Unleashed board board/sifive/fu540/Kconfig | 1 - drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/analogbits/Kconfig | 4 + drivers/clk/analogbits/Makefile | 3 + .../{sifive => analogbits}/wrpll-cln28hpc.c | 168 ++++++++---------- drivers/clk/sifive/Kconfig | 10 -- drivers/clk/sifive/Makefile | 4 - drivers/clk/sifive/fu540-prci.c | 123 +++++++------ drivers/clk/sifive/gemgxl-mgmt.c | 60 ------- drivers/net/macb.c | 38 ++-- drivers/net/macb.h | 1 + include/dt-bindings/clk/sifive-fu540-prci.h | 29 --- include/dt-bindings/clock/sifive-fu540-prci.h | 18 ++ .../linux/clk}/analogbits-wrpll-cln28hpc.h | 70 +++----- 15 files changed, 223 insertions(+), 308 deletions(-) create mode 100644 drivers/clk/analogbits/Kconfig create mode 100644 drivers/clk/analogbits/Makefile rename drivers/clk/{sifive => analogbits}/wrpll-cln28hpc.c (69%) delete mode 100644 drivers/clk/sifive/gemgxl-mgmt.c delete mode 100644 include/dt-bindings/clk/sifive-fu540-prci.h create mode 100644 include/dt-bindings/clock/sifive-fu540-prci.h rename {drivers/clk/sifive => include/linux/clk}/analogbits-wrpll-cln28hpc.h (52%) --- 2.17.1