From patchwork Mon Feb 11 05:41:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1039624 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="arEOr5bD"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="d6nnriCh"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43yZR06CT4z9sMM for ; Mon, 11 Feb 2019 16:41:32 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 78966C21F4E; Mon, 11 Feb 2019 05:41:29 +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 C1CECC21EAE; Mon, 11 Feb 2019 05:41:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 98345C21EAE; Mon, 11 Feb 2019 05:41:25 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lists.denx.de (Postfix) with ESMTPS id D7EE7C21E2B for ; Mon, 11 Feb 2019 05:41: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=1549863685; x=1581399685; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=0z6ssKyEAgWzkEamzD4lRsvIIYdsa7QHDtbRCykG8y4=; b=arEOr5bDCytMNHruHUfTAGOP2FjB2Wi/zR80mFbwEug33GBrn8+AOSE/ zCfYGXQejTpFcjz5r+sVPcseLmzalonP6wUC71T3MtDE117bvTsa52kDk Gr79rXPz9XL6YhojESWID9oQo8xsCzHeuKMBhxbSssmR2B6PGe6gcIlL3 34N8L3HVHLbCRV7fxU/LskSudeRugbMnMGKbyHJxErUfs+tTxnlPKGkr+ JX1QPySEzV7vs+CFBArhlYobPTFPAG7Yo1IuFe1WtR5k5DjoD+pWQPeMR qlK1fLVD5ihJFznWLOkDhSiuoieUnurTfJa2Q6vsFg0ULzAS7mxFbvobx w==; X-IronPort-AV: E=Sophos;i="5.58,358,1544457600"; d="scan'208";a="100895066" Received: from mail-bn3nam01lp2055.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.55]) by ob1.hgst.iphmx.com with ESMTP; 11 Feb 2019 13:41:07 +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=VHmDgVrx1wFUecADBquTSoFhVkWJRGcu/CHg+E3u2HU=; b=d6nnriChVb482cHNFW/UtuNW7QlW4e726g973JMLidrxm5EL8512p7fUROdG7ECT6GgbyDUzktI7vwjNF4IX2qcPHOARYi+HjsOie+21MbdTwcDEi5U3IkkkYx9YWF17zU5/0b1XRhBi9eOEaLHpL20OmR3zO2E9+1zZLx6azzc= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.247.148) by MN2PR04MB5903.namprd04.prod.outlook.com (20.179.23.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Mon, 11 Feb 2019 05:41:02 +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.023; Mon, 11 Feb 2019 05:41:02 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Joe Hershberger , Michal Simek , Michal Simek , Lukas Auer , Masahiro Yamada , Simon Glass Thread-Topic: [PATCH v7 00/15] SiFive FU540 Support Thread-Index: AQHUwcxfmMxhwG/9lECoJGvFIYwp/g== Date: Mon, 11 Feb 2019 05:41:02 +0000 Message-ID: <20190211054030.21393-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR01CA0132.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::26) 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: [129.253.179.161] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MN2PR04MB5903; 6:KatP19u27GMx21e6BXqh97c3XMOuh9ASspHfmJfU5Zh3DBeEjVO3nNsvLzV6YgT9mnDVQPTgWzHV9m7UnVnxNsiTDtIPTSzDBX9/8NEFzChY5G3mTDg0gOMygMbcsLOevkzN2DJrhAdCkaANWNBsH9kFCY3UztJuquZNrweTg/voEQP4ylWnbYGHlRj1SQ5MSqHuzXFOxoX/WffysvbmPXMX8uMhWmYGLK+yPyzuLq5RG6WLNq89RXwL4eIrJ8tflPca5vqXy7IKij82oM5y8+jYaoRILiZkgfAN/g9tqmxRVWlbaVIeIA0eZCTPmm1jqX9WqBYUQD15lmVXJpJu1ea+Z+idQa05Z7MjZtdWaGGceouRJxcDDZXiJW1EGDtj4xsIk5bk06iqhETLKKsilZI43Yf5cNA9l4DW48lUjHMXDvX+MrrT4BESNLQh4VEZtj5R8F2lgD5BC2sMEWn+wA==; 5:mTNKGdRrY5PxxxFdZc7fKOASyGQX5dgh+e+tMhAoxnT0/IPQ0EcSmXWVSPmE3fAM5kLkdJHUn4P5l3sgsuuMii/+ADPwvBGXQpqedQjOwLLv3GbWvN2L5uJXb8fDOCb6vHmZadvXJlLDrgXya2apl3s7YntU/RxWy7KVb11dxwU14PEOk5POw6FmCiXRDPjpdb7fXHoQ/1Y1HuBzfkdkKg==; 7:E6GoYS+VUXfIjdzCAUu+kqKcc/y3cBla6gxw1L8M4xXDZ+tLvQ4iHxp25ibuB+LZzr2Dff7HucSSX2PBIhYneLkE6yL0gOQYixBVy2OTOJmSpcOUFaDspM5d2vgpjaQNkl1RQ0vwVsZ36q0HWtkGaA== x-ms-office365-filtering-correlation-id: 3862e838-dcd9-46a9-ff41-08d68fe38238 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:MN2PR04MB5903; x-ms-traffictypediagnostic: MN2PR04MB5903: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 0945B0CC72 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(39860400002)(376002)(366004)(136003)(396003)(346002)(199004)(189003)(81156014)(54906003)(2616005)(26005)(66066001)(386003)(6506007)(44832011)(102836004)(6486002)(476003)(110136005)(486006)(316002)(50226002)(6436002)(1076003)(4326008)(81166006)(8676002)(53936002)(68736007)(8936002)(6512007)(71190400001)(71200400001)(305945005)(256004)(14444005)(105586002)(106356001)(25786009)(97736004)(7736002)(52116002)(3846002)(6116002)(7416002)(14454004)(478600001)(72206003)(186003)(2906002)(86362001)(99286004)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB5903; 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: baf64x0SZDoWOr4BFkQ1irn+SMEKpRwH8vq201mcnBHoSQ8IpX7vvq4Wz1Y/K8vW7ravLhUGt7cTH+VlB0pQJzhzT2xFyb+OoFBEbrPuQh3/Lye3ugQucmIai7p0EOdfHtd8JOmY9bhTpj1ihhG4/6ZZ9fVQ+7hl5vdP4gduP65PzSPhStru14/p5Ppc0kxmnThJyvWGIXJwsU7JJlY0MPi8h+FOlpiKim8+iKQMbbxy4VdqZ+aqIxhN7mXDHxSG/JJxHnMsivh2niM6Jva8FPPNb0ssFsNZf2QNeGf5WsRGLShbfkdcer7mdi0LqEpiKcZzc4IUZ5BnT1sanlOceLZpbrCSTqAfHggAqhRy1rhIVkrfg1QyQgwySodL2fkcKiHN6dJd3FAzxvtQ3AXQVDeDGovkXcKZyvAv0XzLX/M= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3862e838-dcd9-46a9-ff41-08d68fe38238 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2019 05:40:56.1488 (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: MN2PR04MB5903 Cc: Palmer Dabbelt , Alexander Graf , U-Boot Mailing List Subject: [U-Boot] [PATCH v7 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 U-Boot source tree (git://git.denx.de/u-boot.git) at commit id dbe70c7d4e3d5c705a98d82952e05a591efd0683 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 v6: - Rebased patches to latest U-Boot source tree - Droped PATCH1 and PATCH2. Instead added a PATCH to select CREATE_ARCH_SYMLINK for RISC-V - Few typo fixes in SiFive FU540 readme 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 (10): riscv: Enable create symlink using kconfig 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 arch/Kconfig | 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-generic/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 | 303 +++++++++ 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, 1795 insertions(+), 66 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-generic/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