From patchwork Mon Apr 17 07:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 674814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35DA5C77B76 for ; Mon, 17 Apr 2023 07:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjDQHgv (ORCPT ); Mon, 17 Apr 2023 03:36:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbjDQHgQ (ORCPT ); Mon, 17 Apr 2023 03:36:16 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9134F40F7 for ; Mon, 17 Apr 2023 00:35:01 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4ec8399e963so1180488e87.1 for ; Mon, 17 Apr 2023 00:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681716898; x=1684308898; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wdge6a4JDiruNd3imU9/L1NhlUICcC+6sBqY7kaO9So=; b=HX0MRrzXW5+rVaVp5wEvJKoBYQvR68Nxdvm6JOa1KPUy/RokGXGhIue8OrU4WeOEu2 B2Zj57kf1qlkAkw2nvrZmIwICnRsl8wOnsD2K6qLkrIOLdRzfNtSLcClPS+hfTqP3UvK yccxgVGnFJEEk1lK+GNACHlGt+CidiHgTkuRPP1T/+BZ4Y6cyWNarWkHYqLRwgNYr1gI iKtMqIHQh483gwrmROQZn4whIXWvG0fJsRTi+zCE5NWAcwkbZbYuvJkhPZFZGDox/rYP nsYN/XXFFwXHZjt7NzcSTovNe+0FDmclYhZL3fxo0YSZjAsqu8aqXM6lip42HyJGd1F6 aM4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681716898; x=1684308898; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wdge6a4JDiruNd3imU9/L1NhlUICcC+6sBqY7kaO9So=; b=TKn9TKhm0EHQ2UH9A8wYcePgGTrkxDADFp5RaAAl41fxmobeINbN2aMu7ZlI2rlZS2 pu4HkfjDCP9QEnicTK5FxirawZm4bDNisHmF3T9X7o/iU5GTc3EfV5HDzHmIuvki0yEf ZUUEAh/gjSMTOTSfw4MJxiZUVloIqsS3srFJunjTdg2hfofkJy1RDdGiKCN9M/XeGEJz 71Rk1TpycgEi2R+tGsnVx4wdNrhVs+1WLsic61n6g0Bp1NzaUOjJsaL+6tiLSeQDdh6o ZyAOe3hu6yeY7zx5IAG/LBP2Zt7J4Qhge8txJLKotpjS8+F7kUj48or858051ShFQucQ 020w== X-Gm-Message-State: AAQBX9fkWjgon0Aodod7hRCyaQaxzjFL/PvZPvYstYJesgld1wIB2DAx L1zptG+gMx4OGjGl0MvzVo/LJg== X-Google-Smtp-Source: AKy350Yv+d6lc4zRU2N5tGPWChtws4rli7B1vq16ITPhIt/caTCHY74r6hD5WZBFYQCnLv18PzBKwg== X-Received: by 2002:ac2:4a89:0:b0:4dd:9a38:fcc with SMTP id l9-20020ac24a89000000b004dd9a380fccmr2015468lfp.63.1681716898793; Mon, 17 Apr 2023 00:34:58 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id w15-20020a056512098f00b004eb2f35045bsm1956275lft.269.2023.04.17.00.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 00:34:58 -0700 (PDT) From: Linus Walleij Date: Mon, 17 Apr 2023 09:34:56 +0200 Subject: [PATCH 1/2] dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM MIME-Version: 1.0 Message-Id: <20230417-ux500-sram-v1-1-5924988bb835@linaro.org> References: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> In-Reply-To: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds an SoC-specific binding for the banks of eSRAM available in the ST-Ericsson U8500. Signed-off-by: Linus Walleij Acked-by: Rob Herring --- Documentation/devicetree/bindings/sram/sram.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml index 993430be355b..0922d1f71ba8 100644 --- a/Documentation/devicetree/bindings/sram/sram.yaml +++ b/Documentation/devicetree/bindings/sram/sram.yaml @@ -94,6 +94,7 @@ patternProperties: - samsung,exynos4210-sysram - samsung,exynos4210-sysram-ns - socionext,milbeaut-smp-sram + - stericsson,u8500-esram reg: description: From patchwork Mon Apr 17 07:34:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 674015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 012D5C77B70 for ; Mon, 17 Apr 2023 07:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbjDQHgw (ORCPT ); Mon, 17 Apr 2023 03:36:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230449AbjDQHgR (ORCPT ); Mon, 17 Apr 2023 03:36:17 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9CB84214 for ; Mon, 17 Apr 2023 00:35:03 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2a8aea0c7dcso10305391fa.2 for ; Mon, 17 Apr 2023 00:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681716899; x=1684308899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=n47v9+PzhQgXr23TTNhsK7isjIIKM72ZIjxtKH7ks7Q=; b=q5yMGpOVyeyFCk+S0Ffj+uDLwQX1UOOr4uKsV6Wz3P69P9eIzxL57eahmDFLtoDCr1 9spzByynB6vOIJTvgD7o6auKxzc2fYDstW89N7lKOyWaiY0NSOUN07Ex2YGqUndJFVZH CtdBourk1Fb4eUKGsqmtvcb+tEvXtOgqVeWpYpBuOye580U/kPK7DAwVs/vfgpGNEhRa KkmmtCCvYs7xHeMWe/2gEvzOSfMU/4aHSDTXUYdVCBuzie7kNpu2y3DPT8x4GkMP3Kd8 dJRSXuYdOkz7x7DCcOyg6oMFtGMldgtB900Fv1ysiJkIYjsrJxiZA4FO1hfhotwxS93A o1Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681716899; x=1684308899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n47v9+PzhQgXr23TTNhsK7isjIIKM72ZIjxtKH7ks7Q=; b=d6k1Nqf4ww4X23FDyxH3caZk9GgGMDpPoHhi6JdDNUq7SPa7+NeNUHT8/zQZnmWOT5 Foyt7U7XVCuSf0MEbx0akJYC8Hod7AXRQMoq61EBcd1UDh2sdPTt3VpJI+fJgoBVJMON vq2Vsa3QVIBO5PoW28DnyZYesSQufkvVtrB2v2ysdYVBjMyKk0eY0bduX5V7HXfdnPT0 mJA2wT5H5JowyxvPRa0XtMJTBu88wTiZ7cGM8/z6vjo4TfZQBMpuySsh3QEtEe6F3P0U iOwjl+0xCTqhV4CuDTGhhiW2VmwIFzNl6Gz7FbV+Ocj5m/pqglHK6oE1FvZOef66k4Xq dVPA== X-Gm-Message-State: AAQBX9foxxphpoBihz3TF1vkE18JLCP3Tx3Vn4whU5en/EXlmW8Zf9iy EOS4br9LjcHrglldXXzufme4Cw== X-Google-Smtp-Source: AKy350Y3aoSR3pxVPSyf35wftXXudu2hZ2TSxbE4T9ejSSxyln411KwE9XoAOTwQq4x5ybYzVjEN8A== X-Received: by 2002:ac2:4848:0:b0:4db:28ce:e5ef with SMTP id 8-20020ac24848000000b004db28cee5efmr1635960lfy.0.1681716899646; Mon, 17 Apr 2023 00:34:59 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id w15-20020a056512098f00b004eb2f35045bsm1956275lft.269.2023.04.17.00.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 00:34:59 -0700 (PDT) From: Linus Walleij Date: Mon, 17 Apr 2023 09:34:57 +0200 Subject: [PATCH 2/2] misc: sram: Generate unique names for subpools MIME-Version: 1.0 Message-Id: <20230417-ux500-sram-v1-2-5924988bb835@linaro.org> References: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> In-Reply-To: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The current code will, if we do not specify unique labels for the SRAM subnodes, fail to register several nodes named the same. Example: sram@40020000 { (...) sram@0 { (...) }; sram@1000 { (...) }; }; Since the child->name in both cases will be "sram" the gen_pool_create() will fail because the name is not unique. So let's use of_full_node_name() instead of child->name so the name is "sram@0" and "sram@1000" respectively. However if there are two or more SRAMs on the system with subnodes named the same (that exists on the U8500) then this again will not work. So catenate the top node name and the subnode full name to form a string that will always be unique. Signed-off-by: Linus Walleij --- drivers/misc/sram.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index f0e7f02605eb..84d4e090678b 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -240,10 +240,12 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) goto err_chunks; } if (!label) - label = child->name; - - block->label = devm_kstrdup(sram->dev, - label, GFP_KERNEL); + block->label = devm_kasprintf(sram->dev, GFP_KERNEL, + "%s-%s", dev_name(sram->dev), + of_node_full_name(child)); + else + block->label = devm_kstrdup(sram->dev, + label, GFP_KERNEL); if (!block->label) { ret = -ENOMEM; goto err_chunks;