Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E0F4C4320E for ; Thu, 12 Aug 2021 20:22:52 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57BA06104F for ; Thu, 12 Aug 2021 20:22:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 57BA06104F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5FEE882DB3; Thu, 12 Aug 2021 22:22:49 +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="VHjU+bvG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E2AE282DC8; Thu, 12 Aug 2021 22:22:46 +0200 (CEST) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (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 8E3EF82DAA for ; Thu, 12 Aug 2021 22:22:42 +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-qk1-x732.google.com with SMTP id az7so8199702qkb.5 for ; Thu, 12 Aug 2021 13:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=n93yI9BO2Ez2+MTHDb/OCoEcN0Re1MFFYEQn5WiKpbs=; b=VHjU+bvGwNK/eCTv+a16nXFly+JxGrPRVPhVdnZqe6n4bzHblgBpQkHVjeKSqxYdDo iJqDpp6k5dHWWTYOHMZkYiECSu9CsWfN5d2M/xgwOSBZkjpAGLw7F4Znb4qeQWWV3SNr ChaWbImB/cjK8mFvBh3YkLLQ5m0J6xbYhERpfoHB5E1Qd56F5aL/HSpfYqBtKGMIp6Yw BCZb8Lk43GJ8yE6dsv90De8DyfOccEqEO1/QVDS51PXjUPaydxtuvJm7sRHBjqyulZAU OBAq3JOfYKm7HscadcLLstJeg/bES4Y7cNHagHnPoBd13gnvoPXdbWiVBzGhnYUpHvet ZoNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=n93yI9BO2Ez2+MTHDb/OCoEcN0Re1MFFYEQn5WiKpbs=; b=BzycTepC96BYYS8aG9axt2+1jbGeaNV+dhoitzKMDWRgR4dSv9Vudn/VcW8geVKQSR ZcobSZjg0CXJIjTMumiJ2Ru3rA0zyeDUxKfIzLVsPkr9g1EirI2UUz71c9kC6ONVGjX7 XTRy+P1mwY9QjK7BHr97MVfaA8qTkDLMrUq3OCeN4IrvYrkvIFBQ9v8bt0YD/WxqLEVN qpNkV1+PGh/rvL91XYI96qzkAra0edJNnJ8tmZvGCqpbrB32huG7m2vynq1xAIZKSHHH NaawCOdYN3kPEd9fCsLFCas/9mkC98w1krtqOm3v2ONvkbQC+cxNsD8/hQw6/aT7JSyz CGmw== X-Gm-Message-State: AOAM531O1aWz2vsRuzKKEHDuzo6I/JunxYM9iSX8VisXxhYp6UcsNemD qMe8+s5Nu2bsGqXAGUL3rIDeOGmCh8M= X-Google-Smtp-Source: ABdhPJw5gnRKw2ZQkaylA5MxHO3HAt1RZN1CkcxTG+J18TNAaJnAO4/TlDt3z1zBjXjchyO6ABsOFw== X-Received: by 2002:a37:65c3:: with SMTP id z186mr1700392qkb.313.1628799760939; Thu, 12 Aug 2021 13:22:40 -0700 (PDT) Received: from [192.168.1.201] (pool-108-45-127-224.washdc.fios.verizon.net. [108.45.127.224]) by smtp.googlemail.com with ESMTPSA id p187sm2010508qkd.101.2021.08.12.13.22.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 13:22:40 -0700 (PDT) From: Sean Anderson Subject: Re: [PATCH v2 5/6] riscv: lib: move platform-related libraries to sperate folder To: Zong Li Cc: rick@andestech.com, Leo Liang , Bin Meng , Green Wan , Paul Walmsley , sjg@chromium.org, u-boot@lists.denx.de References: <20210803044444.14032-1-zong.li@sifive.com> <20210803044444.14032-6-zong.li@sifive.com> <82452149-5b53-4eac-c35c-be8673564c7f@gmail.com> Message-ID: <2aa7b40d-7ad0-a2b3-c9c9-bc164412ca51@gmail.com> Date: Thu, 12 Aug 2021 16:22:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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.103.2 at phobos.denx.de X-Virus-Status: Clean On 8/10/21 3:04 AM, Zong Li wrote: > On Tue, Aug 10, 2021 at 12:55 PM Sean Anderson wrote: >> >>> Re: [PATCH v2 5/6] riscv: lib: move platform-related libraries to sperate folder >> >> nit: separate >> > > Thanks for catching it. Fix it in the next version. > >> On 8/3/21 12:44 AM, Zong Li wrote: >>> Put the platform-related implementation into their own folder >>> respectively. Just leave the common library in the top of lib >>> folder. >>> >>> Signed-off-by: Zong Li >>> --- >>> arch/riscv/Kconfig | 7 +++++++ >>> arch/riscv/lib/Makefile | 9 ++++----- >>> arch/riscv/lib/andestech/Kconfig | 8 ++++++++ >>> arch/riscv/lib/andestech/Makefile | 7 +++++++ >>> arch/riscv/lib/{ => andestech}/andes_plic.c | 0 >>> arch/riscv/lib/sifive/Kconfig | 8 ++++++++ >>> arch/riscv/lib/sifive/Makefile | 9 +++++++++ >>> arch/riscv/lib/{ => sifive}/sifive_cache.c | 0 >>> arch/riscv/lib/{ => sifive}/sifive_clint.c | 0 >>> 9 files changed, 43 insertions(+), 5 deletions(-) >>> create mode 100644 arch/riscv/lib/andestech/Kconfig >>> create mode 100644 arch/riscv/lib/andestech/Makefile >>> rename arch/riscv/lib/{ => andestech}/andes_plic.c (100%) >>> create mode 100644 arch/riscv/lib/sifive/Kconfig >>> create mode 100644 arch/riscv/lib/sifive/Makefile >>> rename arch/riscv/lib/{ => sifive}/sifive_cache.c (100%) >>> rename arch/riscv/lib/{ => sifive}/sifive_clint.c (100%) >> >> NAK from me. I'd much rather see organization by function (e.g. >> clint/sbi/plic together) than by vendor. Plus, the clint/plic are not >> really specific to one vendor like ccache. >> > > Yes, it makes more sense to me. In this case, there are three > functionalities, so I'd like to separate clint, plic and cache at this > time, does it make sense to you? No, it does not. clint and plic should be grouped with SBI because in U-Boot they are all used for IPIs. But frankly, I don't really see the need to place them in subdirectories yet... --Sean > >> --Sean >> >>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >>> index ec651fe0a4..ed1bf2f6c8 100644 >>> --- a/arch/riscv/Kconfig >>> +++ b/arch/riscv/Kconfig >>> @@ -72,6 +72,10 @@ source "arch/riscv/cpu/fu540/Kconfig" >>> source "arch/riscv/cpu/fu740/Kconfig" >>> source "arch/riscv/cpu/generic/Kconfig" >>> >>> +# library-specific options below >>> +source "arch/riscv/lib/sifive/Kconfig" >>> +source "arch/riscv/lib/andestech/Kconfig" >>> + >>> # architecture-specific options below >>> >>> choice >>> @@ -175,18 +179,21 @@ config SIFIVE_CLINT >>> config SPL_SIFIVE_CLINT >>> bool >>> depends on SPL_RISCV_MMODE >>> + select SIFIVE_LIB >>> help >>> The SiFive CLINT block holds memory-mapped control and status registers >>> associated with software and timer interrupts. >>> >>> config SIFIVE_CACHE >>> bool >>> + select SIFIVE_LIB >>> help >>> This enables the operations to configure SiFive cache >>> >>> config ANDES_PLIC >>> bool >>> depends on RISCV_MMODE || SPL_RISCV_MMODE >>> + select ANDESTECH_LIB >>> select REGMAP >>> select SYSCON >>> select SPL_REGMAP if SPL >>> diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile >>> index 06020fcc2a..f58d1f9819 100644 >>> --- a/arch/riscv/lib/Makefile >>> +++ b/arch/riscv/lib/Makefile >>> @@ -10,11 +10,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o >>> obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o >>> obj-$(CONFIG_CMD_GO) += boot.o >>> obj-y += cache.o >>> -obj-$(CONFIG_SIFIVE_CACHE) += sifive_cache.o >>> -ifeq ($(CONFIG_$(SPL_)RISCV_MMODE),y) >>> -obj-$(CONFIG_$(SPL_)SIFIVE_CLINT) += sifive_clint.o >>> -obj-$(CONFIG_ANDES_PLIC) += andes_plic.o >>> -else >>> +ifeq ($(CONFIG_$(SPL_)RISCV_MMODE),) >>> obj-$(CONFIG_SBI) += sbi.o >>> obj-$(CONFIG_SBI_IPI) += sbi_ipi.o >>> endif >>> @@ -42,3 +38,6 @@ extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC) >>> obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o >>> obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMMOVE) += memmove.o >>> obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o >>> + >>> +obj-$(CONFIG_SIFIVE_LIB) += sifive/ >>> +obj-$(CONFIG_ANDESTECH_LIB) += andestech/ >>> diff --git a/arch/riscv/lib/andestech/Kconfig b/arch/riscv/lib/andestech/Kconfig >>> new file mode 100644 >>> index 0000000000..75f83a8123 >>> --- /dev/null >>> +++ b/arch/riscv/lib/andestech/Kconfig >>> @@ -0,0 +1,8 @@ >>> +# SPDX-License-Identifier: GPL-2.0+ >>> +# >>> +# Copyright (C) 2021 SiFive, Inc >>> + >>> +config ANDESTECH_LIB >>> + bool >>> + help >>> + This supports the specific libraries for AndesTech platforms >>> diff --git a/arch/riscv/lib/andestech/Makefile b/arch/riscv/lib/andestech/Makefile >>> new file mode 100644 >>> index 0000000000..49f45d0a29 >>> --- /dev/null >>> +++ b/arch/riscv/lib/andestech/Makefile >>> @@ -0,0 +1,7 @@ >>> +# SPDX-License-Identifier: GPL-2.0+ >>> +# >>> +# Copyright (C) 2021 SiFive, Inc >>> + >>> +ifeq ($(CONFIG_$(SPL_)RISCV_MMODE),y) >>> +obj-$(CONFIG_ANDES_PLIC) += andes_plic.o >>> +endif >>> diff --git a/arch/riscv/lib/andes_plic.c b/arch/riscv/lib/andestech/andes_plic.c >>> similarity index 100% >>> rename from arch/riscv/lib/andes_plic.c >>> rename to arch/riscv/lib/andestech/andes_plic.c >>> diff --git a/arch/riscv/lib/sifive/Kconfig b/arch/riscv/lib/sifive/Kconfig >>> new file mode 100644 >>> index 0000000000..20574079e9 >>> --- /dev/null >>> +++ b/arch/riscv/lib/sifive/Kconfig >>> @@ -0,0 +1,8 @@ >>> +# SPDX-License-Identifier: GPL-2.0+ >>> +# >>> +# Copyright (C) 2021 SiFive, Inc >>> + >>> +config SIFIVE_LIB >>> + bool >>> + help >>> + This supports the specific libraries for SiFive platforms >>> diff --git a/arch/riscv/lib/sifive/Makefile b/arch/riscv/lib/sifive/Makefile >>> new file mode 100644 >>> index 0000000000..ba120db26a >>> --- /dev/null >>> +++ b/arch/riscv/lib/sifive/Makefile >>> @@ -0,0 +1,9 @@ >>> +# SPDX-License-Identifier: GPL-2.0+ >>> +# >>> +# Copyright (C) 2021 SiFive, Inc >>> + >>> +obj-$(CONFIG_SIFIVE_CACHE) += sifive_cache.o >>> + >>> +ifeq ($(CONFIG_$(SPL_)RISCV_MMODE),y) >>> +obj-$(CONFIG_$(SPL_)SIFIVE_CLINT) += sifive_clint.o >>> +endif >>> diff --git a/arch/riscv/lib/sifive_cache.c b/arch/riscv/lib/sifive/sifive_cache.c >>> similarity index 100% >>> rename from arch/riscv/lib/sifive_cache.c >>> rename to arch/riscv/lib/sifive/sifive_cache.c >>> diff --git a/arch/riscv/lib/sifive_clint.c b/arch/riscv/lib/sifive/sifive_clint.c >>> similarity index 100% >>> rename from arch/riscv/lib/sifive_clint.c >>> rename to arch/riscv/lib/sifive/sifive_clint.c >>> >>