From patchwork Tue Feb 5 13:04:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1036725 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="Z5o+ntDC"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="Hr+YLIr8"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43v4Xx3r2Sz9sMl for ; Wed, 6 Feb 2019 00:04:33 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2A091C21F62; Tue, 5 Feb 2019 13:04:27 +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.6 required=5.0 tests=KHOP_BIG_TO_CC, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E1909C21E13; Tue, 5 Feb 2019 13:04:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F0F08C21E13; Tue, 5 Feb 2019 13:04:24 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lists.denx.de (Postfix) with ESMTPS id 34D73C21DD9 for ; Tue, 5 Feb 2019 13:04:24 +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=1549371865; x=1580907865; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=5PMRwuFXfxDnqWu5tyqOurNs613Z/aCgxX0oW8J0F2w=; b=Z5o+ntDCsBZ4kCP2w27lHV7Qb6etow7J1UErQRUxBgEOFMjJ9UL5Jr2P Mi/aZFNc62etQTkDitZXovYS7jK+hcpOtVAcQ/0voGODPYD/YnyS3OLvP yASuwt9dlJAOi3+0pDovCI/16oabyDsqFt7I5rKSAZaxk/EHDj6mHIlZ4 5ejl5Ejqi8JMhZg3FWxzJn/raaIiwhRt0TXo0r6hlc/O/aZ2m/R+g1M69 0fJgZz477nRAaG7RWcz8kcEAzQ/wowChbXgiXejeBzijAK15bfsBNQc0t 1Sn3iqQZD6Gt6t3u33ANU67hshaWwOgOOoTf34erEauDdlFsIBijYLxqz w==; X-IronPort-AV: E=Sophos;i="5.56,564,1539619200"; d="scan'208";a="100543282" Received: from mail-co1nam03lp2051.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([104.47.40.51]) by ob1.hgst.iphmx.com with ESMTP; 05 Feb 2019 21:04:20 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Uyk301VOJKPOXL4qzloqZ/TKk9sCLvkz8akYb80y1WE=; b=Hr+YLIr8n9T1ee8R9VLUd24KoS2hDRglndeDO5WPyF066EG/H2hBRe1hI6Hv4dxFTa/tC6cDYCL1exfnQZk9y7miVgsLuEM/YB5GhGd9DrbL0kShW3Mhqkraam/5x11pgL5k5FqwZwgtRySPThQndObdMX7yVc0NT0P2MCKZsYo= Received: from BYAPR04MB5303.namprd04.prod.outlook.com (20.178.49.148) by BYAPR04MB6231.namprd04.prod.outlook.com (20.178.235.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Tue, 5 Feb 2019 13:04:17 +0000 Received: from BYAPR04MB5303.namprd04.prod.outlook.com ([fe80::add1:92cc:65d7:5d94]) by BYAPR04MB5303.namprd04.prod.outlook.com ([fe80::add1:92cc:65d7:5d94%2]) with mapi id 15.20.1580.019; Tue, 5 Feb 2019 13:04:17 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Joe Hershberger , Michal Simek , Michal Simek , Lukas Auer , Masahiro Yamada , Simon Glass Thread-Topic: [PATCH v5 00/15] SiFive FU540 Support Thread-Index: AQHUvVNM7ccZxxPu3kWKOdHbl5WwTg== Date: Tue, 5 Feb 2019 13:04:17 +0000 Message-ID: <20190205130346.77175-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::33) To BYAPR04MB5303.namprd04.prod.outlook.com (2603:10b6:a03:c8::20) 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: [49.207.55.104] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR04MB6231; 6:Gyf/0vn7w6+Ku0lHuSqQRox+vauwg/tkYKSmXpIfEcYPgvZlxzJsIUw/MRZbdoHWM11cocp0GR+aSW8OiLGU/d8l9Hir8iWeVjpPZGxIcPX7+tCT6B51HmT1Qa5D8x6oidy2k1mqRD05HriSZyfVsU9ajKzNIHrR617PEnMboshD4XSBwznmr8wOcmS7AeRO10dNaJNs+QgF+sS9jQDLx3peEGx66yv4hdaadqf1UZ1hXuCDv8gWn3KM4jfLOc5ZQppfF7l0bufNht6+lzaFcnydvz3k9UJuhen0joo9GkXIucwVsmBOl8uUgcBf7Ab/JSantJwUe4zCqC5INoZ7t0kPF4C4vyPX2STYOWHiaMAh+A5MhSnt8sqHJYkYXir/+B8gtAnfYPPTbYV20rymFfQpxZETjH4n/Gm1LI3Dn/eLIKQGo8TMmal0J1GbF0OyV4Sids6xnI1cFEdLDfHnwA==; 5:sTDeB0iT7lgkP499wQujk86rzC2IeOM+G/ByVog8Gxw4kIeg91DswSgLJVt4MlmOudgK7Ld5OlNqWY13F64vOSfUfjXpjEkvcc78RKMpA5kzTOhf3ioaKuMd/L4Sq+0CiuRZo+qHH4BVpKZIXi1b22TFj9YGUWhT6fcjp9Fmc/x3sEw6krJX1r9VzkDvFYFC2Ep14MbGIhkwYeRy6pGfbw==; 7:TZHnXh1cB9bKvha4E3pCNd/Omwxq7NC2O/lx6jBB/wJV2UTN5Yad+2DhZHx+BuSyte89DizzZ2gPwFjtcV8Dgffq6MmYWnGR8a/NM4P03TClyqwwmlxi/6tgIFv67RcYSAXwBVpeoW7bEq42rwQEBQ== x-ms-office365-filtering-correlation-id: 74523d10-e139-427f-b6d1-08d68b6a6f22 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:BYAPR04MB6231; x-ms-traffictypediagnostic: BYAPR04MB6231: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 0939529DE2 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(346002)(366004)(396003)(136003)(376002)(39860400002)(199004)(189003)(72206003)(6512007)(6486002)(478600001)(71190400001)(71200400001)(8936002)(4326008)(44832011)(3846002)(6116002)(8676002)(106356001)(81156014)(105586002)(81166006)(486006)(36756003)(7416002)(66066001)(53936002)(6436002)(110136005)(54906003)(14454004)(14444005)(50226002)(25786009)(86362001)(476003)(2616005)(68736007)(99286004)(97736004)(2906002)(316002)(52116002)(26005)(55236004)(6506007)(102836004)(386003)(186003)(305945005)(7736002)(1076003)(256004); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB6231; H:BYAPR04MB5303.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: QOm6Cir0WUV2+lGOS6m+vLan73ctgONHSgzCUHMsYBSnfzWvnGm/87yj7XIIa3226Am/gUxJ+oOGKlzG63FezoBaJEGVsoMBMZMuokyE5MmUfthGm6tCYEaJ6DMGtW6rwRVLOEvJqAzxS5rocORfphomzSnZdiNBY5FkeuaptfjHQI4SEkl0/EmgHqBMQdgm7ayLW7VLJvQpw3DDl2ApWWaIautY1KT4ti1SDAEOngvgrr7H+GYEhRX9eouTqOmY2pQyylMTscsmm5sNDrL8ohaty3dB+19itXqnHfjYw7QSq+aFGAf1OYv+e8ekGlxTJXCGr7OjirTwfk6EO1VfS+vkC3wx+dJ5TwCvFWoFtm8zxrB7XoTUFnnBoKUXt0YERq6YQizIyOQrQu5ouUAR4hhZXB8fZsP3RqMBhIoBvog= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74523d10-e139-427f-b6d1-08d68b6a6f22 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2019 13:04:12.9587 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB6231 Cc: Palmer Dabbelt , U-Boot Mailing List , Alexander Graf , Christoph Hellwig Subject: [U-Boot] [PATCH v5 00/15] SiFive FU540 Support 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 patchset adds SiFive Freedom Unleashed (FU540) support to RISC-V U-Boot. The patches are based upon latest RISC-V U-Boot tree (git://git.denx.de/u-boot-riscv.git) at commit id 91882c472d8c0aef4db699d3f2de55bf43d4ae4b All drivers namely: SiFive PRCI, SiFive Serial, and Cadance MACB Ethernet work fine on actual SiFive Unleashed board and QEMU sifive_u machine. Changes since v4: - Removed #ifndef from macb_enable_clk() in PATCH7 - Updated test/dm/clk.c in PATCH10 to test fixed factor clock using sandbox Changes since v3: - Added patch to un-ignore arch/riscv/include/asm/arch - Added patch to fix mrproper make target to only remove arch/*/include/asm/arch paths which are symlinks - Added patch to have place-holder asm/arch/clk.h for RISC-V - Removed "#ifndef CONFIG_RISCV" from macb clk API patch Changes since v2: - Fixed typo in PATCH3 comments - Removed "#if" from clk_fixed_factor_ofdata_to_platdata() in PATCH7 - Added PATCH12 for SiFive FU540 README guide Changes since v1: - Re-ordered SoB in patches with multiple SoB - Simplified board_get_usable_ram_top() added by PATCH3 Anup Patel (10): .gitignore: Don't ignore arch/riscv/include/asm/arch Makefile: Fix mrproper make target riscv: Rename cpu/qemu to cpu/generic riscv: Add asm/dma-mapping.h for DMA mappings riscv: Add place-holder asm/arch/clk.h for driver compilation riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems net: macb: Fix clk API usage for RISC-V systems clk: Add SiFive FU540 PRCI clock driver clk: Add fixed-factor clock driver riscv: Add SiFive FU540 board support Atish Patra (5): net: macb: Fix GEM hardware detection drivers: serial_sifive: Fix baud rate calculation drivers: serial_sifive: Skip baudrate config if no input clock cpu: Bind timer driver for boot hart doc: Add a readme guide for SiFive FU540 Makefile | 2 +- arch/.gitignore | 1 + arch/riscv/Kconfig | 6 +- arch/riscv/cpu/{qemu => generic}/Kconfig | 2 +- arch/riscv/cpu/{qemu => generic}/Makefile | 0 arch/riscv/cpu/{qemu => generic}/cpu.c | 0 arch/riscv/cpu/generic/dram.c | 37 ++ arch/riscv/cpu/qemu/dram.c | 17 - arch/riscv/include/asm/arch/clk.h | 14 + arch/riscv/include/asm/dma-mapping.h | 38 ++ arch/sandbox/dts/test.dts | 8 + board/emulation/qemu-riscv/Kconfig | 4 +- .../qemu-riscv => sifive/fu540}/Kconfig | 36 +- board/sifive/fu540/MAINTAINERS | 9 + board/sifive/fu540/Makefile | 5 + board/sifive/fu540/fu540.c | 17 + configs/sifive_fu540_defconfig | 11 + doc/README.sifive-fu540 | 302 +++++++++ drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 5 +- drivers/clk/clk_fixed_factor.c | 72 +++ drivers/clk/sifive/Kconfig | 19 + drivers/clk/sifive/Makefile | 5 + .../clk/sifive/analogbits-wrpll-cln28hpc.h | 101 +++ drivers/clk/sifive/fu540-prci.c | 604 ++++++++++++++++++ drivers/clk/sifive/wrpll-cln28hpc.c | 390 +++++++++++ drivers/cpu/riscv_cpu.c | 7 +- drivers/net/macb.c | 11 +- drivers/serial/serial_sifive.c | 60 +- include/configs/sifive-fu540.h | 43 ++ include/dt-bindings/clk/sifive-fu540-prci.h | 29 + test/dm/clk.c | 5 +- 32 files changed, 1794 insertions(+), 67 deletions(-) rename arch/riscv/cpu/{qemu => generic}/Kconfig (91%) rename arch/riscv/cpu/{qemu => generic}/Makefile (100%) rename arch/riscv/cpu/{qemu => generic}/cpu.c (100%) create mode 100644 arch/riscv/cpu/generic/dram.c delete mode 100644 arch/riscv/cpu/qemu/dram.c create mode 100644 arch/riscv/include/asm/arch/clk.h create mode 100644 arch/riscv/include/asm/dma-mapping.h copy board/{emulation/qemu-riscv => sifive/fu540}/Kconfig (57%) create mode 100644 board/sifive/fu540/MAINTAINERS create mode 100644 board/sifive/fu540/Makefile create mode 100644 board/sifive/fu540/fu540.c create mode 100644 configs/sifive_fu540_defconfig create mode 100644 doc/README.sifive-fu540 create mode 100644 drivers/clk/clk_fixed_factor.c create mode 100644 drivers/clk/sifive/Kconfig create mode 100644 drivers/clk/sifive/Makefile create mode 100644 drivers/clk/sifive/analogbits-wrpll-cln28hpc.h create mode 100644 drivers/clk/sifive/fu540-prci.c create mode 100644 drivers/clk/sifive/wrpll-cln28hpc.c create mode 100644 include/configs/sifive-fu540.h create mode 100644 include/dt-bindings/clk/sifive-fu540-prci.h