From patchwork Wed Jul 29 09:56:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1338233 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OgavdDOZ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BGpqb0mD2z9sSy for ; Wed, 29 Jul 2020 19:57:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9BB658257B; Wed, 29 Jul 2020 11:57:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OgavdDOZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3488582579; Wed, 29 Jul 2020 11:56:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0AC4F82561 for ; Wed, 29 Jul 2020 11:56:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf44.google.com with SMTP id dm12so10537512qvb.9 for ; Wed, 29 Jul 2020 02:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jq+kJnlO+D1QcFght90Y55nDV4jzDCF51co/EcsBYhs=; b=OgavdDOZANQQQ5GkrAiyTOSTT5pH0sHu2rHetBUpsaLx/IDBOpkTUvDKvMW7DRjsxT priqelYFhJSgvVIo144g0s/FtPdbkdNNrMrnqRXyf5Vv3/4hElFrihrM+0Xmkjf6oa0z 1tLlDwaMer4RARXPh2DxVs/chVnoudZXpXukUgU3rrwQY5o7f2Q6gylmSq688vouOpLG mA64YToReTBW74B67ErRzotywPLM8TnQFQ3xrzTeuZGRCdegoFG0EMNrbR9PD1iv+h+j B3LVwgI2+7xDz25gj5YSkn6MGOoB1a/7z6AlQ36oLV5PaY3LxMs8BYF2XubZlhFyYpe1 Fc8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jq+kJnlO+D1QcFght90Y55nDV4jzDCF51co/EcsBYhs=; b=lhcWClfg55Fm2gdyenT0i/Yk1XuNjXfJfCjLEPYMdt/1kN5KPdCHVy76+WHcAc0LbK 4xx+PUOZcRIC6mA5QMe0YJSbyNJKHd7YHoSZ35rTEhXPZGi+I0b4QbmIuFUsnxgorYmM O/fF58M1SUW+CETLCSVrnBQsGy8tqpqoBtHXAOL4vivle/GNq9S3964+FrWWePOzC/BC FD7y8+1W/uPKVWKrP5crtzdaGmahDfRJ38rBtTMZDiHnQFbtBBkK7ZivsdikQg6RY/R8 kVoMTIbhF2YWB3JYaiYvF55+JfMfnRv83w0WaWcvP/ZSONb+9EjTDsNB8tG1FjrM3k1J ZndA== X-Gm-Message-State: AOAM5300JGjmItOH4cn3A9/EB2z7xrOjJkIUqoJED4efj6ScCBPChInN yBihjXmobYRL+hl4GSZE+wHHKCRSG0o= X-Google-Smtp-Source: ABdhPJxPHpU8aUAXzGPjbgWoKUmX7/eFlLkChT1O/Tp9gpJx2X6new8i77DDXNSUCYQr5fm5T60Suw== X-Received: by 2002:a0c:ab16:: with SMTP id h22mr11888780qvb.72.1596016614607; Wed, 29 Jul 2020 02:56:54 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id s33sm1421171qtk.11.2020.07.29.02.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2020 02:56:53 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Rick Chen , Bin Meng , Sean Anderson , Anup Patel , Jagan Teki , Sagar Kadam Subject: [PATCH v2 0/7] riscv: Clean up timer drivers Date: Wed, 29 Jul 2020 05:56:29 -0400 Message-Id: <20200729095636.1077054-1-seanga2@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This series cleans up the timer drivers in RISC-V and converts them to DM. This series depends on [1]. This series needs to be tested! I have only tested it on QEMU and the K210. Notably, this means that the HiFive and anything Andes is completely untested. CI for this series is located at [2]. [1] https://patchwork.ozlabs.org/project/uboot/list/?series=190862 [2] https://dev.azure.com/seanga2/u-boot/_build/results?buildId=4 Changes in v2: - Remove RISCV_RDTIME KConfig option - Split Kendryte binding changes into their own commit - Fix SiFive CLINT not getting tick-rate from rtcclk Sean Anderson (7): riscv: Rework riscv timer driver to only support S-mode riscv: Rework Andes PLMT as a UCLASS_TIMER driver riscv: Clean up initialization in Andes PLIC riscv: Rework Sifive CLINT as UCLASS_TIMER driver riscv: clk: Add CLINT clock to kendryte clock driver riscv: Update Kendryte device tree for new CLINT driver riscv: Update SiFive device tree for new CLINT driver arch/riscv/Kconfig | 16 ---- arch/riscv/dts/ae350_32.dts | 1 + arch/riscv/dts/ae350_64.dts | 1 + arch/riscv/dts/fu540-c000-u-boot.dtsi | 8 +- .../dts/hifive-unleashed-a00-u-boot.dtsi | 4 + arch/riscv/dts/k210.dtsi | 9 +- arch/riscv/include/asm/global_data.h | 3 - arch/riscv/lib/Makefile | 1 - arch/riscv/lib/andes_plic.c | 58 ++++++------- arch/riscv/lib/andes_plmt.c | 42 +++++---- arch/riscv/lib/rdtime.c | 38 -------- arch/riscv/lib/sifive_clint.c | 87 ++++++++++++------- common/spl/spl_opensbi.c | 5 ++ drivers/clk/kendryte/clk.c | 4 + drivers/ram/sifive/Kconfig | 2 + drivers/timer/Kconfig | 6 +- drivers/timer/riscv_timer.c | 39 +++++---- include/dt-bindings/clock/k210-sysctl.h | 1 + 18 files changed, 155 insertions(+), 170 deletions(-) delete mode 100644 arch/riscv/lib/rdtime.c