From patchwork Tue Jun 25 04:14:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1121777 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="Ex6AClYm"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="Dn0iFVH0"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45Xt9S1R9yz9s3C for ; Tue, 25 Jun 2019 14:15:08 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CAB4DC21DAF; Tue, 25 Jun 2019 04:15:05 +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 F1139C21C3F; Tue, 25 Jun 2019 04:15:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0F675C21C38; Tue, 25 Jun 2019 04:15:02 +0000 (UTC) Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lists.denx.de (Postfix) with ESMTPS id 3014BC21BE5 for ; Tue, 25 Jun 2019 04:15:01 +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=1561436102; x=1592972102; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=Lp76Ze8e1kG9gtyxGGrjx/OYvdYSFDwwJkXf5M9mM0c=; b=Ex6AClYmCE+uNL59swjMOrkMYmBKhZK6l741wGUsebYRmhzXse4ZOPqh EExJ8uBVDRGQrK4snQKb4JJaLNUId+6wHFtH15v90cMc29NtOrkflDw4F MgM8RAVs83hcxjn61ThNlXGG7bG/rydd1wU07cIfS0W8Una6YRvd0mrBU 2yaP2AzRSOj8WBfDhTvQWCaAsqHzspDTeUxID2N6kUYT5ScSprR/Y6b4Q nr/pGoxxnuEAYHYMQJU/qaJKA7WpukAbYeVhTxuSDYYFvq2zHA6HRqR4y nCsaKKSPd1jtUh/LNyCivGy8IT8obm/otz/lRRuKzr2aD7vt5dVIdhjJm g==; X-IronPort-AV: E=Sophos;i="5.63,413,1557158400"; d="scan'208";a="116328864" Received: from mail-sn1nam04lp2054.outbound.protection.outlook.com (HELO NAM04-SN1-obe.outbound.protection.outlook.com) ([104.47.44.54]) by ob1.hgst.iphmx.com with ESMTP; 25 Jun 2019 12:14:58 +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=Lp76Ze8e1kG9gtyxGGrjx/OYvdYSFDwwJkXf5M9mM0c=; b=Dn0iFVH0NnY1JF8s6XuZG7DHQ/A6X07f0lahc2oT+1tEvUeVa3at5Bek9BapAY7EHJXnwy4le7MXDkguJuMl/7yl9uRB1WnE+mT4OII+LgvpHP6eFKUFHYXI714X1nWx0KuOYuvxFvO1mQgLcTFXKP1HdMnQ+MLhOHqC0m6DdT4= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6944.namprd04.prod.outlook.com (10.186.147.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Tue, 25 Jun 2019 04:14:54 +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.2008.014; Tue, 25 Jun 2019 04:14:54 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Lukas Auer , Simon Glass Thread-Topic: [PATCH v8 0/9] Update SiFive Unleashed Drivers Thread-Index: AQHVKwyKRxhhfr7w9kykFgAFUSmuiw== Date: Tue, 25 Jun 2019 04:14:53 +0000 Message-ID: <20190625041429.29929-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::11) 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: 7d390261-ff3f-48e2-d0d8-08d6f923aca6 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:MN2PR04MB6944; x-ms-traffictypediagnostic: MN2PR04MB6944: x-ms-exchange-purlcount: 4 wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0079056367 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(346002)(376002)(136003)(396003)(366004)(39860400002)(199004)(40224003)(189003)(476003)(7416002)(66476007)(71190400001)(66946007)(71200400001)(64756008)(66446008)(5660300002)(73956011)(2906002)(66556008)(1076003)(50226002)(36756003)(52116002)(66066001)(99286004)(305945005)(7736002)(6506007)(386003)(102836004)(68736007)(8676002)(8936002)(81156014)(81166006)(86362001)(6486002)(4326008)(44832011)(6436002)(966005)(14454004)(2616005)(110136005)(26005)(14444005)(256004)(25786009)(15650500001)(6116002)(3846002)(54906003)(53936002)(486006)(478600001)(316002)(72206003)(6306002)(6512007)(186003); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6944; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: KOstvFcjaOXAdp9w2aQ7wW3GvFv71OMW/lEZzsDChnpJ0/T6iHfpmziXCf30oBadiJ82F9GgW5bLvDDgMZ2CUxZivn8Wc92zJ3xe28ngsYth3fxys8EEyH/IuslEBE035j3YO8mE2veaOBvAh1ibUPDVUFqo0sUCcCpZuQSYMnZNVv8HQSmdZNdW+vc4/uJRxf7xrsk4BXKoxwhhg37C6QzheQ1+Z4JnOCC/k7zsjAsr2SvWLAp/9ipSqUBFGdpmKkU03ljmq6uauMpNR/o+GVKm41as6/l5GCRl7ug1SKOMVXqe999TZ+ofoO+D3qYbH3zua0jKizDj2XoZnGq8BPS88uV3ZStqItMAXSrMEKMQn1WKklIo/CdChJxAahBqOa4zwhsZ7Jgyk1leWF8Qf98BDaSqoPJePp/rX53FEoU= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d390261-ff3f-48e2-d0d8-08d6f923aca6 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jun 2019 04:14:53.9196 (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: MN2PR04MB6944 Cc: U-Boot Mailing List , Palmer Dabbelt , Joe Hershberger , Alistair Francis Subject: [U-Boot] [PATCH v8 0/9] 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 and Cadence MACB 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 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. The updated DTB passed by OpenSBI is in fact the DTB build by upstream Linux so we can straight away pass this DTB to Linux as well. This series can be found in riscv_unleashed_clk_sync_v8 branch at: https://github.com/avpatel/u-boot.git To try this series use latest OpenSBI at: https://github.com/riscv/opensbi.git And Linux-5.2-rc1 from v5.2-rc1_unleashed branch at: https://github.com/avpatel/linux.git Changes since v7: - Update PATCH6 to not treat dma_burst_length = 0 as skip gmac_configure_dma() - Update PATCH9 to check endianess at runtime Changes since v6: - Added separate patch to fix endianess check in gmac_configure_dma() Changes since v5: - Addressed Ramon's comments in PATCH6 - Addressed Bin's comments in PATCH7 Changes since v4: - Rebased patches upon Ramon's MACB changes (Refer, https://patchwork.ozlabs.org/patch/1114025/) - Added PATCH7 to setup ethaddr based on board serial number read from OTP - Added PATCH8 to update documentation 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 (9): 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 riscv: sifive: fu540: Setup ethaddr env variable using OTP doc: sifive-fu540: Update README for steps to create FW_PAYLOAD net: macb: Fix check for little-endian system in gmac_configure_dma() board/sifive/fu540/Kconfig | 1 - board/sifive/fu540/fu540.c | 122 ++++++ configs/sifive_fu540_defconfig | 1 + doc/README.sifive-fu540 | 356 ++++++++---------- 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 | 98 +++-- 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 ++-- 17 files changed, 559 insertions(+), 510 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