Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp622663lqb; Fri, 15 Mar 2024 01:19:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpQH/v9+yCBsPu5lt3vB3OU/0B0dKQmZuMzVt3vNuF72VXQ6Bc8tya/DUvDrbpen78ld2k9jL2tbWrdv+mCbFr6k6G4+obI+JIk1E3Cw== X-Google-Smtp-Source: AGHT+IHBq3uvXM5Haf/zIRozsDyaoqgLxSFBpUoChgy1985ehYOap3yLdCfpnOJIATcqhobQBwsR X-Received: by 2002:a0c:ca83:0:b0:691:5600:8e27 with SMTP id a3-20020a0cca83000000b0069156008e27mr3851787qvk.8.1710490753892; Fri, 15 Mar 2024 01:19:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710490753; cv=pass; d=google.com; s=arc-20160816; b=er39XHZge2IvL5bgmSjfxFu6b/aex98EQSIgaH1oM211ABET+AwL8SpEo2lMt/Blnt zTUqIzhrOcbK2BdR8oSbQxP5/zE4ZACEbWKeHaa5oGd+WbbLfWhHscyqMxO1I/NVlOnV ltoJZrYUGr3CByWLCUOnuCMcAyVnv6C0Kg5qawK0rhgngLpZy688rJoTGcwANbIFt0tG esAmNR5754fED68A6p4MVXxyT7iusIZY7hm/G6bhWiAEZWlRJvabnFHYN7xtKab/L2lb l2bJqv5vAYHKrYIrDpJyZgx2RVP/oNW9pGKWvvxvGCjEgoK6r1u/Z7SH5kaSEzxGTxBx 9QbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=upQSaxD+r4SJNUoUIsxh8FrJK6VCuFCbPT2dWCf6fQg=; fh=ug72DRy4i4AITG9K2seI5XdR6w0xv1i1NkaOJkeXufE=; b=XGTE4dK71fx/CEzLIdmdzPGTjCiaaLMwmSoSfGdo7kSCNi9EDLD/fJR2nO3vB15I3y kA4Nkx0bLnALRr4fAIrzOgdy/v4sOy9UTZyMfn5BZOR+SqjoqO8wTg8I9l3HzAIy1qXy L2NVFfLtG6MEDUfR3+ZSkyy8PlbPi6xE4gGA4ZaGq/bDGeVjoA4wuhDnhIEe2ifElJgG aOlav/tLJuw1PtO7HwV2XfEUA49ypXxP74NDzcJrer7NmM0ct0nKhww1NPLKgz+YlG9L bTqBU/f3OgyomwCQn7ypP53zEWlVMo8EirbVmE8ExqDESiKLo9GTXz0IpoNRAj6WUJtX 5oyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b+tIHes/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-104154-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r22-20020a056214125600b006903c84591asi2291059qvv.491.2024.03.15.01.19.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 01:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104154-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b+tIHes/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-104154-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C2ED1C20E76 for ; Fri, 15 Mar 2024 08:19:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3E04171AB; Fri, 15 Mar 2024 08:19:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b+tIHes/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC6BE15AE0; Fri, 15 Mar 2024 08:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710490747; cv=none; b=vF33pvoKr65fsgrMA36SwrBwyvSyGE/dDnUsmBh4G+vInzTPi6RAZxRhQulFALbECWhD4P0Hqi/Kt17b0LjEfJQ12Fxm43CInHEhHTOyVE63PKfcmx0EYqFZbEGwXoQBRH8HGQ3x8Izz0zXbp92BfoiwyqA8bWzO8O+w9UDidDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710490747; c=relaxed/simple; bh=/eKPOjIMzBEqqdf481aoLuRA42OFb7oCAyDNb31yBt4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=d4/ayBmt3KlUJ27XEgELvwabBjI+27q0aoxoR965RUtFiBV0+LmKt61soEpuSxxb5NgPOM8hlWIfRyUfiBimLxWGXe4BhLKTNMPwKlHflH1yf5sQQl6IIvS8ADLk/C1KNFWwqCWr0zQe7tRsI2ODG9UszZa3IH08hi2FzqlnCsk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b+tIHes/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8475EC433C7; Fri, 15 Mar 2024 08:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710490747; bh=/eKPOjIMzBEqqdf481aoLuRA42OFb7oCAyDNb31yBt4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=b+tIHes/7nOkDS7dxeJm8C6GAQoK+SGnAhxi3W06JsHEEleW8rRtRvjMo6vW/wGil iKFeHErxfzh55jV2f89qVKAVFzdElDPYzLbfcOw3Oo3VW1wa30a3WFdOKCNsCLS2kT WUAwlWYbfMteaBBWzbaC0hSPIAH02HwoPXO6Ms+i8IGwFfyHji29MUS6f1sHWpn67W 8nenEV9NH0t8q4S2FtSCV4FT6WxWBwt0046ySc731HDZefbrB0McXYD6c9GUTi4Bo/ WsdQev6Sb4C6zYaB2s3IxITTzNpa2AJxw5BlGhhZYBgdNriu7H8OCTH+YYcmz2XK1n LYvP02JH1Ltfw== Message-ID: <2b0511af-1b5b-4c90-a673-c9113bb58142@kernel.org> Date: Fri, 15 Mar 2024 17:19:04 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/7] riscv: Kconfig.socs: Allow SOC_CANAAN with MMU for K230 Content-Language: en-US To: Yangyu Chen Cc: Conor Dooley , linux-riscv@lists.infradead.org, Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley References: <20240305-fascism-enrich-06483ddeb149@spud> <311bdf17-c16f-41d8-8366-10f9b00adf27@kernel.org> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/14/24 01:56, Yangyu Chen wrote: >> Hi, >> >> Thanks for the review comments. After thinking about it for a while, >> I think we don't need to change it as we have changed the help >> message which deleted the "K210". And the dts on k210.dtsi shows >> mmu-type is riscv.none, I think if someone noticed this would know >> why it fails to boot on the S-Mode MMU Kernel on K210. The only >> special thing for ARCH_CANAAN is that a loader.bin will be built >> when M-Mode is on arch/riscv/Makefile. However, Canaan has no other >> M-Mode chips except for K210. So I think we don't need to change >> it. You completely lost me here. I do not understand what you are trying to say. >> Another reason is that SOC_CANAAN for K210 is somehow hard to change. >> If we continue using SOC_CANAAN for K210 but not for other Canaan >> SoCs such as K230, it will cause some confusion to users. If we >> rename SOC_CANAAN to SOC_CANAAN_K210, it will change many drivers >> in many subsystems like my patch v5 [1]. So I don't think we need >> to fix it. >> >> >> If we don't change it, A concern for this is that some drivers for >> K210 will be built when SOC_CANAAN=y and if we add this to defconfig, >> all riscv builds will also build some K210 drivers even on MMU. But >> I think this will not be a problem just need some memory/storage >> for a slightly bigger kernel. Also, we will enable some new configs >> in defconfig when a new soc gets supported, it's normal for K210 >> SoC drivers. >> >> Thus, I think we don't need to change it. If you have some other >> opinions, please let me know. 1) Rename SOC_CANAAN to SOC_CANAAN_K210 and use that for any conditional code or driver selection that is specific to the K210, which is what's done now. 2) Create a "new" SOC_CANAAN config and make SOC_CANAAN_K210 depend on it and on !MMU You could also add SOC_CANAAN_K230 if needed and make it depend on SOC_CANAAN && MMU. With that, dirvers common to both the K210 and K230 can easilly be selected and selecting SOC_CANAAN will end up either building for the K230 or the K210, depending on MMU being set or not. That's my 2 cents. Feel free to ignore. I am not involved that much with riscv these days and I am far too busy with other kernel areas to be of any help. But I really think that allowing building the K210 when MMU is enabled and "hoping that the user understand his mistake" is not a great approach. -- Damien Le Moal Western Digital Research