Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3302162iog; Mon, 27 Jun 2022 13:10:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ujs+CoGSAIJav1sNA/yg0WLr/O3wn7wjFbMxKw28Xo1BDoH949cbSJ+V39e5PaN1sNd2au X-Received: by 2002:a17:90b:1d04:b0:1ec:f898:d863 with SMTP id on4-20020a17090b1d0400b001ecf898d863mr23085387pjb.79.1656360640054; Mon, 27 Jun 2022 13:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656360640; cv=none; d=google.com; s=arc-20160816; b=lFZJcwiAPJbEe1aBgVvW1ADRMGE8mVH3ZJH8PUowNtCgucj5ge5TpHKATuP+TQOSEl YWHjTo94wvxI9ms8EODnVR+RB3mQdh9qBinvWwGjnzq9a/UVNmPmnZZsr6v8jogVG8v9 GnCiBVTw2zYKrRRifdowHMtEh/+Xk9FiNSnPnU5N9hMhFuOj9229Y021t+T/UXwCtVy9 x9PDGGRXQWaXCUPin4YQJz3ee/mdm4dE4cEy6T98WgkxTsfTNnpjVrS6zYqE/a7OHRGB 8J+3p0Csz4qidNL5LWzIh0WEzXyh/EkMtRdvfX8Atf6CFCvYsfKBTyHGr5kYd2PXfxcZ k76g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CI3fJo8A+eaieUlzNYpta6LCY7AsQa7tJxY+upYt5DU=; b=XpmbcGMyebSOPKGe93uZQZy7AzVjYv9fLF5OOY0UrgcjyOBGCUFoHGTzpUoxuBcYIs xpQdgv6xBdjY/TlVR62EeSuFyo9SSFPdNq1x52FSscDdCCXTLJEhfBoGp7Q7nKDMcBQl TOtZlJUj3c88tM+cOYkdDW/Isl0HfMaZUeNGVVKJ9n9+ILdC5E0TpGske2tyuG+YPLSU eyE9hrGdh+MEu49lxsYA77MeCgtBmT1aBYG8IMsZqr87ryMSBQqNaNJNb4Q3a6TIQLmH W6k7VwHUyI18ndZRFg1G5yI/g59hhjTUdWZaSEw1hax5PXEyZ6GoI8xeCZLNpUluK0/w YUFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@conchuod.ie header.s=google header.b=NCjs560w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a654187000000b004051d974ce4si2420021pgq.458.2022.06.27.13.10.28; Mon, 27 Jun 2022 13:10:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@conchuod.ie header.s=google header.b=NCjs560w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=conchuod.ie Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240549AbiF0Tl6 (ORCPT + 99 others); Mon, 27 Jun 2022 15:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240505AbiF0Tlb (ORCPT ); Mon, 27 Jun 2022 15:41:31 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 105C517042 for ; Mon, 27 Jun 2022 12:41:29 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id d17so8856151wrc.10 for ; Mon, 27 Jun 2022 12:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CI3fJo8A+eaieUlzNYpta6LCY7AsQa7tJxY+upYt5DU=; b=NCjs560wHII6fVECQB9/GdNlhvJNFE4pkOGLs8jP+UxuRPiuWEHK2RAq+jRyb7l21B lfShg0ET3/X/0mjEMGlwSBSEdfkuN/jOG4+hLlup2Q1NEGgyw8TvLXt6Sh1ng8wnUUF6 ACyhrCvbH8GLUqGorfK03QyZ/EOUgFIIkp9U/rze0vaIL0pGtOjj0l2WGg8p0UVFtKdE 2GtvloqzOeXu8KfiG3wMjVq/vAsjfcHvwx3Fvw+Z7IhEjjmeAf2mLbSlaMXjwCsQ5NF8 F9+tVjwoFB7PMmDlGl56M6lK2Iw5z3M3LCYB6VBFZ/Gv2C7k/N+jEVee+9P4Wub30j/G soHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CI3fJo8A+eaieUlzNYpta6LCY7AsQa7tJxY+upYt5DU=; b=XB97qZF9iWE/CHhKqidAEZDBMZ3Ha5XU3Kgz9uaATF7/sRpci8VpuvCqdFSchQTDd+ KKKSAZ/7WBo+NPHWp4FnSClCxfUyY2lLfBJE7A4gx+rCo4wAq4mETHHstI2bND+WHbQ9 +HjuksRkEGDtG4jQbFP+IH/SqQC4/NGoUpHEBtnTOCMv9dG1kNgmW2yQekOtOULH4mfg R8UaVYRtVS/YPCFroqbcIY2pinXC+We3jX5WXHOZQkqDbt3BEb112twxYIR0G1Yo9OsH pAIkaZaTtw/VVOCIut4rV4VxDxUD0CJEoG+XAZ7MVGlxkyYwp6sDcP6PUGgt6nRknCTE LueA== X-Gm-Message-State: AJIora8wytDaG2kbQMuEHhNPj2RXPOsLu0oOqlCGCpBelkFfG85HV5nz dHrDtiejQQ5cV47b+9a+O53zPw== X-Received: by 2002:a05:6000:18d:b0:21b:901e:9b27 with SMTP id p13-20020a056000018d00b0021b901e9b27mr14202414wrx.389.1656358887406; Mon, 27 Jun 2022 12:41:27 -0700 (PDT) Received: from henark71.. ([51.37.234.167]) by smtp.gmail.com with ESMTPSA id e9-20020a5d4e89000000b0021a3a87fda9sm11428047wru.47.2022.06.27.12.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 12:41:26 -0700 (PDT) From: Conor Dooley To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Sam Ravnborg , Eugeniy Paltsev , Vinod Koul , Liam Girdwood , Mark Brown , Serge Semin , Daniel Lezcano , Palmer Dabbelt , Palmer Dabbelt Cc: Thomas Gleixner , Paul Walmsley , Albert Ou , Conor Dooley , Masahiro Yamada , Damien Le Moal , Geert Uytterhoeven , Niklas Cassel , Dillon Min , Heng Sia , Jose Abreu , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 07/16] dt-bindings: memory-controllers: add canaan k210 sram controller Date: Mon, 27 Jun 2022 20:39:55 +0100 Message-Id: <20220627194003.2395484-8-mail@conchuod.ie> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627194003.2395484-1-mail@conchuod.ie> References: <20220627194003.2395484-1-mail@conchuod.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Conor Dooley The k210 U-Boot port has been using the clocks defined in the devicetree to bring up the board's SRAM, but this violates the dt-schema. As such, move the clocks to a dedicated node with the same compatible string & document it. Signed-off-by: Conor Dooley --- I made myself maintainer since I didn't have anywhere else to point a finger, but I am happy to let someone else take that on! The corresponding U-Boot code seems to be: static int sram_init(void) { int ret, i; const char * const banks[] = { "sram0", "sram1", "aisram" }; ofnode memory; struct clk clk; /* Enable RAM clocks */ memory = ofnode_by_compatible(ofnode_null(), "canaan,k210-sram"); if (ofnode_equal(memory, ofnode_null())) return -ENOENT; for (i = 0; i < ARRAY_SIZE(banks); i++) { ret = clk_get_by_name_nodev(memory, banks[i], &clk); if (ret) continue; ret = clk_enable(&clk); clk_free(&clk); if (ret) return ret; } return 0; } Which, without having the hardware etc, I suspect is likely to keep working after the move. --- .../memory-controllers/canaan,k210-sram.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/memory-controllers/canaan,k210-sram.yaml diff --git a/Documentation/devicetree/bindings/memory-controllers/canaan,k210-sram.yaml b/Documentation/devicetree/bindings/memory-controllers/canaan,k210-sram.yaml new file mode 100644 index 000000000000..837eb65854fc --- /dev/null +++ b/Documentation/devicetree/bindings/memory-controllers/canaan,k210-sram.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memory-controllers/canaan,k210-sram.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Canaan K210 SRAM memory controller + +description: | + The Canaan K210 SRAM memory controller is initialised and programmed by + firmware, but an OS might want to read its registers for error reporting + purposes and to learn about the DRAM topology. + +maintainers: + - Conor Dooley + +properties: + compatible: + enum: + - canaan,k210-sram + + clocks: + minItems: 1 + items: + - description: sram0 clock + - description: sram1 clock + - description: aisram clock + + clock-names: + minItems: 1 + items: + - const: sram0 + - const: sram1 + - const: aisram + +required: + - compatible + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include + memory-controller { + compatible = "canaan,k210-sram"; + clocks = <&sysclk K210_CLK_SRAM0>, + <&sysclk K210_CLK_SRAM1>, + <&sysclk K210_CLK_AI>; + clock-names = "sram0", "sram1", "aisram"; + }; + -- 2.36.1