From patchwork Sat Feb 9 06:31:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1039120 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="Kmb7uUBF"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="WmLgc8ro"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43xMdt6xhsz9sML for ; Sat, 9 Feb 2019 17:31:43 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3D5CFC21EFC; Sat, 9 Feb 2019 06:31:37 +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=KHOP_BIG_TO_CC, 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 28CDBC21EA8; Sat, 9 Feb 2019 06:31:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B65AFC21E4E; Sat, 9 Feb 2019 06:31:33 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lists.denx.de (Postfix) with ESMTPS id F4157C21E4E for ; Sat, 9 Feb 2019 06:31:32 +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=1549693894; x=1581229894; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=kIH0O4f4N0tKataU7CvTqX8zxUfsv0sfGCtsMVG4OZg=; b=Kmb7uUBFVS7b3VongDOKaN/3wKxJX/KnzKIMdJLksXdjZIJot04DzGXz +OlFimLJn/5i2eCLGt+ynL3/m0LsKE16e1ZHK85RZCV5khs8jcCl1axuF OjT43ZRZ2cJyJZ1SJZWY5iv8w612pgc2KChmW07AlKFUq/PrpNdOfsDZT BSDErR4c1SOYWndmv06sGCfIwKPtYDsg8fR6NJC4cc+bYLQIJqofbiS3e lUQV+B1nhycyDjh059oYuKwo2AgCTX8YgN4G1+5vWnjgPuL7yVTH7O8LT PeOe1c5C0NpK+zDkUmfPUCa87cIEMSQV2kxn1fNzWyFmnIjEJg7bgrr0R w==; X-IronPort-AV: E=Sophos;i="5.58,350,1544457600"; d="scan'208";a="102611949" Received: from mail-co1nam05lp2051.outbound.protection.outlook.com (HELO NAM05-CO1-obe.outbound.protection.outlook.com) ([104.47.48.51]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2019 14:31:29 +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=9Hlo+xqi7QRzCkWZdkpZ7cJwdB+kZkcblssGFbuZqwA=; b=WmLgc8rocf94pppMyx/TQ4sZczSA9BqSUUQ7TvMPAI/fFX21/IF42WKu4GWBCo+JslLd9c2qf3drq92Uu6M1kfMoKVqOpLlgAM465p8JW35sAIHtYkq62AwvVHCpbkAVuZX6biYEtXMjvKcQMuf7jED+zA+6gkEarEUD9kcKPfI= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.247.148) by MN2SPR01MB0008.namprd04.prod.outlook.com (20.179.144.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Sat, 9 Feb 2019 06:31:23 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::2cdb:c465:af57:8be1]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::2cdb:c465:af57:8be1%7]) with mapi id 15.20.1601.016; Sat, 9 Feb 2019 06:31:23 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Joe Hershberger , Michal Simek , Michal Simek , Lukas Auer , Masahiro Yamada , Simon Glass Thread-Topic: [PATCH v6 00/16] SiFive FU540 Support Thread-Index: AQHUwEETc574dhZuSk6UyMthjcCB+Q== Date: Sat, 9 Feb 2019 06:31:23 +0000 Message-ID: <20190209063052.29092-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0047.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::33) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:de::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.49.10] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MN2SPR01MB0008; 6:EiUO9zHAntzK5nJKAfYz8VTDntV4WYtF4zjWTrOM5ezQBk79bxpho4a1QMxBIvB0QPAZTXmmKh50xfvMno4DBwL1InlJFOx+AdZ44gjrR8z/DbJa5pCv7VUwJ7tVg6ZuhSdE3+0xi7p7speuJRBZCXSMl9cyOxetksWh1Cf4SOhJj46JZ5kccnU5oM45BvZElxzFdoxhYvKx+WmzPx0QtkO0kcQbesqGLEjxghyxsAhVnA+rUq7UorOzUCtV2ZvdugKrSVtKQ3w+cyfZNgDDGOfBWAkRovsw4q/PYeyvhs2eLTQOOSKQ/tovRJzznpFlDVQBm1OMvIO8Mj1OKx8A0DKT3g8G6b9V/OxGeb1NtLh5oEoxMvTbKZtowm/4le0EhjgUIuWcusIIJWJuPTqY3NmkdFtC+y+/5ySyrs2THw7q8FoBBuR4w5i2IGYpxyLT0D/ZW29JodUIaE6pHu5VJQ==; 5:G6yhBTt8MuOY2xvIG5EN7kHP9SzmQ+d6p9Nhq3DgT4VwCAp4I6vLKem6NTMdA23xaVs1hcF4OyoWneAyhzyO6B52jm2fG3Bmgca8FWpNmJAPtwAnmDRPn6xc8gnwU9VhUffz/pO0AYZLl2GVvFkQrlQi98oExiUOAnRv0nJSG167T63gOxWnCrqZQZsIcZVhB7mvSFJbhcdzodB36W7VAg==; 7:F/DjeHqbh+FqXCPCiEEh4cjz/vvfPcAEP8I2iK25RFipwPZHxo4/7SxuYryuW5QhT2oPXkKAw5bqmRnaA63XXE1q+VrDlmwGhtEn0arsYsQF61s64B4X1pDmMTUyCsWXODny4LB6mOo7Qk7R5+nKdg== x-ms-office365-filtering-correlation-id: 853cb97d-310b-450e-4fa0-08d68e5835f1 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:MN2SPR01MB0008; x-ms-traffictypediagnostic: MN2SPR01MB0008: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 09435FCA72 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(376002)(366004)(396003)(346002)(39860400002)(136003)(189003)(199004)(99286004)(1076003)(55236004)(186003)(102836004)(52116002)(6436002)(72206003)(6506007)(71190400001)(71200400001)(478600001)(26005)(6512007)(68736007)(53936002)(386003)(97736004)(256004)(14444005)(6116002)(3846002)(105586002)(305945005)(86362001)(2616005)(81156014)(8676002)(50226002)(25786009)(7736002)(106356001)(476003)(2906002)(66066001)(14454004)(6486002)(44832011)(486006)(7416002)(36756003)(316002)(54906003)(4326008)(110136005)(8936002)(81166006); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2SPR01MB0008; 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: oBGz39ilLXqpibUcBk8Nw25wmm3BPyMDv27XuD+Lh6s8CtHvBGVhWEZsQ5e6BFF26Mj8yPIfF5pG+VCfq2/FUgf2yFmigi9lOLlhJtDGWeacszYd4l/k9mK/Bui6mlIsZfaH1kd5mhmIc+e9ZR4lPSLST+Xg0+AMVkj3haqlyrN7T5mGpK6egxbJy4eoGb7jWV6U0TLPzX5zU3AvDs/wodPcoqNEL2R3u437teCCztCdZUJYLGPs2AnfK+P6RZOro5iao/bJSwr7S3sLk9gdqmsa6UISOKeU5Rua3GNQhiyACITdCmwpSPImSB2TE90uK9S7NCbahHYk8LEVqoo6+3txBD6fb1RiA7QhDsMXgFJ9rhdwaF64oT4Gy8XF1JM2sWf6PwoECxfvAVQazQ7NKK6l+6clqhYmIkvrufq1pXQ= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 853cb97d-310b-450e-4fa0-08d68e5835f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2019 06:31:19.2768 (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: MN2SPR01MB0008 Cc: Palmer Dabbelt , Alexander Graf , U-Boot Mailing List Subject: [U-Boot] [PATCH v6 00/16] 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 v5: - Added PATCH16 to fix INITRD passing to Linux using bootm for U-Boot RISC-V 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 (11): .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 riscv: Enable CONFIG_SYS_BOOT_RAMDISK_HIGH for using initrd 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/config.h | 1 + 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 +- 33 files changed, 1795 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