From patchwork Mon Oct 26 01:46:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1387423 X-Patchwork-Delegate: uboot@andestech.com 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=QYZFwGlD; 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 4CKHlC6lSFz9sSs for ; Mon, 26 Oct 2020 12:47:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4AFC882483; Mon, 26 Oct 2020 02:47:10 +0100 (CET) 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="QYZFwGlD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8A7CC8248D; Mon, 26 Oct 2020 02:47:06 +0100 (CET) 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-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (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 81F848246A for ; Mon, 26 Oct 2020 02:47:03 +0100 (CET) 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-qk1-x742.google.com with SMTP id t128so2047714qke.0 for ; Sun, 25 Oct 2020 18:47:03 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wbv7+HPaWjq7MCU7v2r0g3cvw3Mzt55YiLPADaEhEKQ=; b=QYZFwGlDeFs+GqZxS/YDp+8WzQ2bXSeuYXJhjp/xEnytsoo0dgqN+ou+HenGHQ1Ql2 5fC8RryWoEREp+lsKz+/bfYYStmoX/MCd9odI/DjbuFdi12yjalWiCzNMYG0zBTSXj4L LBD2L5tuRAO3I9/j/VMhVZTSpz2+YuOvJA6FRS7JALXSdmP8ZDf2zoyJyp4as3zsvwFV 9a/5vCp7qnfT96ciQfqg0jKL1rK1Fo0OnmfVkmIy31BMqrczyF0EZVaqlK/ZkNh79IkQ JoCKWZweGZ4AxlzVUAkzh8HExvOiV4WSGho3AWWxjtx1BLsco3cKECO+fF9VU7I7ZS1N EE2w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wbv7+HPaWjq7MCU7v2r0g3cvw3Mzt55YiLPADaEhEKQ=; b=Ux3agkeP/3psl+Eg00YTJe0f8v7SbNorKDIVz51ZiuOE1cFZ6JB+mw4Gxcg+PFTjeg Jy64zqtdTS0EK88MozASMW11dBeqSCrCr3CtEzsWPJMMDx3U0QBMfsM7pJGJwlVRLZTM eYbbRRHdhBPkE/9ZM8ywnEA0foMr5buV8E+8OQBQQ1e5/yJdMNMes3lflDT0LbKbBp0f rSjAzQQI1r1ho6xlX6rO8n5mrhLaFhr/4ilqw6f3nt/kEA4fohJ4yqbYE7IlrT1zzhMI do51bgT2z+jy+3lLKJ9+j7qvaX8UVjgQP/vE1JXYIFe/ZfeAtcL7Zx3EwBQXD2REU4ts 9M9g== X-Gm-Message-State: AOAM531IDpFQnDzRJKJM2bGFp9hgOaLAjEZjpWICqzpvqFHC5n1nxTdu SGq9kFpXju+pvrnmIK/40KH7oeervDf8LyCb X-Google-Smtp-Source: ABdhPJw9xnlsmRa0crM3KebLe46GQWgXo+FcykElEyuA7MYy5DRX+uEAIq0vwe1ZhbLm+2ashQM6QA== X-Received: by 2002:a05:620a:2018:: with SMTP id c24mr13525299qka.154.1603676822237; Sun, 25 Oct 2020 18:47:02 -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 k15sm5840964qtq.11.2020.10.25.18.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 18:47:01 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Simon Glass , Rick Chen , Bin Meng , Pragnesh Patel , Sean Anderson , Rick Chen Subject: [PATCH v2 1/3] riscv: Move Andes PLMT driver to drivers/timer Date: Sun, 25 Oct 2020 21:46:56 -0400 Message-Id: <20201026014658.609304-2-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201026014658.609304-1-seanga2@gmail.com> References: <20201026014658.609304-1-seanga2@gmail.com> 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 is a regular timer driver, and should live with the other timer drivers. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass Reviewed-by: Rick Chen --- (no changes since v1) MAINTAINERS | 1 + arch/riscv/Kconfig | 7 ------- arch/riscv/lib/Makefile | 1 - drivers/timer/Kconfig | 7 +++++++ drivers/timer/Makefile | 1 + .../lib/andes_plmt.c => drivers/timer/andes_plmt_timer.c | 0 6 files changed, 9 insertions(+), 8 deletions(-) rename arch/riscv/lib/andes_plmt.c => drivers/timer/andes_plmt_timer.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index fc4fad46ee..5d022352c4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -938,6 +938,7 @@ S: Maintained T: git https://gitlab.denx.de/u-boot/custodians/u-boot-riscv.git F: arch/riscv/ F: cmd/riscv/ +F: drivers/timer/andes_plmt_timer.c F: tools/prelink-riscv.c RISC-V KENDRYTE diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index aaa3b833a5..30934d9cc6 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -170,13 +170,6 @@ config ANDES_PLIC The Andes PLIC block holds memory-mapped claim and pending registers associated with software interrupt. -config ANDES_PLMT - bool - depends on RISCV_MMODE || SPL_RISCV_MMODE - help - The Andes PLMT block holds memory-mapped mtime register - associated with timer tick. - config SYS_MALLOC_F_LEN default 0x1000 diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile index 10ac5b06d3..12c14f2019 100644 --- a/arch/riscv/lib/Makefile +++ b/arch/riscv/lib/Makefile @@ -13,7 +13,6 @@ obj-y += cache.o ifeq ($(CONFIG_$(SPL_)RISCV_MMODE),y) obj-$(CONFIG_SIFIVE_CLINT) += sifive_clint.o obj-$(CONFIG_ANDES_PLIC) += andes_plic.o -obj-$(CONFIG_ANDES_PLMT) += andes_plmt.o else obj-$(CONFIG_SBI) += sbi.o obj-$(CONFIG_SBI_IPI) += sbi_ipi.o diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index f8fa4aa71f..6b8e4c9dc0 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -53,6 +53,13 @@ config ALTERA_TIMER Select this to enable a timer for Altera devices. Please find details on the "Embedded Peripherals IP User Guide" of Altera. +config ANDES_PLMT + bool + depends on RISCV_MMODE || SPL_RISCV_MMODE + help + The Andes PLMT block holds memory-mapped mtime register + associated with timer tick. + config ARC_TIMER bool "ARC timer support" depends on TIMER && ARC && CLK diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile index 3a4d74b996..dd4f9cc1d4 100644 --- a/drivers/timer/Makefile +++ b/drivers/timer/Makefile @@ -5,6 +5,7 @@ obj-y += timer-uclass.o obj-$(CONFIG_AG101P_TIMER) += ag101p_timer.o obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o +obj-$(CONFIG_ANDES_PLMT) += andes_plmt_timer.o obj-$(CONFIG_ARC_TIMER) += arc_timer.o obj-$(CONFIG_AST_TIMER) += ast_timer.o obj-$(CONFIG_ATCPIT100_TIMER) += atcpit100_timer.o diff --git a/arch/riscv/lib/andes_plmt.c b/drivers/timer/andes_plmt_timer.c similarity index 100% rename from arch/riscv/lib/andes_plmt.c rename to drivers/timer/andes_plmt_timer.c