From patchwork Mon May 15 10:12:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 9344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6808786vqo; Mon, 15 May 2023 03:21:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MS4VCI7x9E11+4DR7T64KlcqkA1DroIJ5f7gtdUjts43tbhgBW/PKxNnKg9wiad5Rsqt/ X-Received: by 2002:a17:903:124f:b0:1aa:d292:3814 with SMTP id u15-20020a170903124f00b001aad2923814mr40292052plh.67.1684146080407; Mon, 15 May 2023 03:21:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684146080; cv=pass; d=google.com; s=arc-20160816; b=cqUxQiGUEU+D4E6Ybdj3cDiDdvzPCMlLKO5fS9Tnl87rU7qdsiSnCn/8RysdRCR7Ot U52bRpjwlrznHsbwhyqFHXufPvNW6kqiis07tNHJ9EhCmxiMti5FwjjNU14wPQakZu1O BWoA87wXLsubsKUG7lhT1xi88QO4VqOy6fc4hFO7k5mdoraUCy6CeMX8nw6AkPAbRGQB jtxhBVS/Lt9Jo0a19h6n4EBSvuPMHsA6CIZx0otcmzjt7ftGkXC6zOicDgUgpYDeNxaM vs8qOyItw1/TtwK6sB2tMv9lygj9RC60yECciNyfaEueubdlIjr7pDXQeehUIzqZhzWk xEKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature:dkim-signature; bh=zv1egBp4VF43Uy3k9TsxyBgv1FbKom8ab/az0E+stOE=; b=Ag/DwhppWX1Wm3RafzgyFML2IdOVjM5lKwdJ5xzouHPynK5EMwTkBIhGw1lmA05dJv nwks/vANCxpelTHnhuzf7W+2F9ezGIhvw5FD8LaFzVexK/ErEMEJrKoI0v+arkxKIL+a cf5wlPNH6yh7rCij6sV9eR1W/0Inctu04SCDo5ku4gj31LF7DSfWhZcTUruMoFbKlmTG IOZWFuNJaS1hMpSoV7zqxhU4FlAx/V2y8XETioAmL177/zntham2suKPMPr5kyjOJ6ls GLDK70Cc5gd+A66a/wcQzUUMpfaKXyWnH1SRe004x5HDROF/1sc6NgosCVisyju/ca2E munA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b="imfAJaU/"; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003 header.b=73WOrUXf; arc=pass (i=1); 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a170903124c00b001a1be5ca65asi16288641plh.528.2023.05.15.03.21.07; Mon, 15 May 2023 03:21:20 -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=@gerhold.net header.s=strato-dkim-0002 header.b="imfAJaU/"; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003 header.b=73WOrUXf; arc=pass (i=1); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239874AbjEOKQc (ORCPT + 99 others); Mon, 15 May 2023 06:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241037AbjEOKQN (ORCPT ); Mon, 15 May 2023 06:16:13 -0400 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5022E19A4; Mon, 15 May 2023 03:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684145543; cv=none; d=strato.com; s=strato-dkim-0002; b=tkq67o77DSOOySalWTFkTuGf6/bIN0Ir8zF6vP9mkPpNAoqFAC0AbUvaN1UiVyeq5X m59+lbX0YZ5Li9Py3kJ5yv3u0P0o2YKIQKW6L7CzSd9iAM3/paDE9ccrT06Z7UbEeyiP LUc41qIXch8Ha9fEYE5k8aVOdjYI+mMdeP6xHsTMYSr0A7XUwO1F0l6D1eLJvaidnkqm HqwN0LmfWr8JVqSRwGVYweVq5vyY72H+jv9b9jkkymT7XJ8rTqGYlLlhMuziSep/JqXO a0+lhq2Xen28B6j2e6KWvLMeL+aCoYHkYxpJ4X0OC8sMpb6mB8PYdrv4wG7CyGYWs353 bYmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1684145543; s=strato-dkim-0002; d=strato.com; h=Cc:To:Message-Id:Date:Subject:From:Cc:Date:From:Subject:Sender; bh=zv1egBp4VF43Uy3k9TsxyBgv1FbKom8ab/az0E+stOE=; b=m5KM5ma7u2oxMFenubqzXEFUOIsly0xnM+EAEzJInltm7jGhdSP/nVhOohPfHANop2 1q2Bvv5ee/7dhM3u65oTLgReJ/8T/tVW6VSiTFIqL6rAb3+Q6xeHICp33TJq+x3kS0Vo 7f83pTQFaSrIAwCZKzYSLPXm+8ntjpYv0M/OsE12xttETNWstg9jwSMHF/kG9CqyitwF Vnh3HpvndrtVAolzcpnWehz+cGSWGl9lW16ETMcbHPbhqbbHn1YDjncUkEa5Uvs3m8dd vgbvu/zH/miiku6yP3z7mjcrY/c0C0CzJOzL9vQHkRU1/0MelGkCMi+AskGR60S6rFQD KzTA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1684145543; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:Message-Id:Date:Subject:From:Cc:Date:From:Subject:Sender; bh=zv1egBp4VF43Uy3k9TsxyBgv1FbKom8ab/az0E+stOE=; b=imfAJaU/zyCIj2aNmPHz+L0wMpozqF4Kf0qRiMUbyl6cxspTG6BvDfetN7+zUAcgar uW3tBTZGlugGeFhFKTVTgLDoWghi+sGxtr8SmiS2lDvyM/jGJloI76G3+8gBCntHn/Lh 4rcSYau61EKSwfLu9NnrNAdb9uD3pHIHx4cbZvywF+tQyyyvGK0BSy+KLelwxxWDTJVY CgznmnZnLpLoaH+Q1uYtdSRn5jlbRyeUWrsvlehe2ttumpSKCMIO+2xyJn9COB0YP2Eb MRIaXIEOk0x5yavD6NNLecKG2Gd3sUFVUT+nlGoG8ptBFKOHk0pReUViYkMr9AX6+mfJ 0raA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1684145543; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:Message-Id:Date:Subject:From:Cc:Date:From:Subject:Sender; bh=zv1egBp4VF43Uy3k9TsxyBgv1FbKom8ab/az0E+stOE=; b=73WOrUXfKDQ/beydx/HNIClkP/a39K12oD4b+YJigg6F4OLW1QjxVN6v7Z2a64biwI 4ukV4J9P0bsa2OXseuAg== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4ly9TY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.4.0 DYNA|AUTH) with ESMTPSA id j6420az4FACN1JF (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 15 May 2023 12:12:23 +0200 (CEST) From: Stephan Gerhold Subject: [PATCH 0/5] of: reserved_mem: Provide more control about allocation behavior Date: Mon, 15 May 2023 12:12:15 +0200 Message-Id: <20230510-dt-resv-bottom-up-v1-0-3bf68873dbed@gerhold.net> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAH8FYmQC/x2NQQrDIBAAvxL23AW11IZ+pfSgcW32EA27NhRC/ l7T4zAMs4OSMCk8hh2ENlaupYO9DDDNobwJOXUGZ9zV3KzB1FBIN4y1tbrgZ0U/prvN2Xs3Zuh dDEoYJZRpPsslaCM5xSqU+fufPV/H8QMeIu6gfAAAAA== To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Rowand Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , devicetree@vger.kernel.org, devicetree-spec@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stephan Gerhold X-Mailer: b4 0.12.2 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_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765955160570380381?= X-GMAIL-MSGID: =?utf-8?q?1765955160570380381?= Provide more control about the allocation behavior for dynamically allocated reserved memory by adding a "alloc-bottom-up" and "alloc-top-down" option and by making the allocation order deterministic. The motivation for this patch series are the many different reserved firmware regions on Qualcomm platforms. Currently it is often necessary to duplicate them into each board DT, because minor differences for some of the firmware regions (e.g. the firmware size) requires shifting the base address of all following firmware regions as well. I propose describing the actual requirements (size, alignment, alloc-ranges) instead and allocating the reserved regions at runtime. This allows defining only the actual device-specific part in the board DT and having everything else shared in the SoC.dtsi. The series starts with two minor additions to the of_reserved_mem code. The last two patches are examples that are meant to show the motivation more clearly for the MSM8916 SoC. PATCH 4/5 shows the current (static) approach, then PATCH 5/5 switches to the dynamic allocation based on the first 3 patches. If the first 3 patches are accepted I would send the full MSM8916 DT changes in a separate series. Signed-off-by: Stephan Gerhold --- Stephan Gerhold (5): dt-bindings: reserved-memory: Add alloc-{bottom-up,top-down} of: reserved_mem: Implement alloc-{bottom-up,top-down} of: reserved_mem: Use stable allocation order [RFC] arm64: dts: qcom: msm8916: Enable modem on two phones [RFC] arm64: dts: qcom: msm8916: Reserve firmware memory dynamically .../bindings/reserved-memory/reserved-memory.yaml | 39 ++++++++++++++++++++ arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 13 +++++++ .../boot/dts/qcom/msm8916-longcheer-l8150.dts | 31 ++++++++++++++-- .../boot/dts/qcom/msm8916-samsung-serranove.dts | 21 +++++++++++ arch/arm64/boot/dts/qcom/msm8916-ufi.dtsi | 29 ++++++++------- arch/arm64/boot/dts/qcom/msm8916.dtsi | 42 ++++++++++++++++------ drivers/of/of_reserved_mem.c | 14 +++++++- 7 files changed, 163 insertions(+), 26 deletions(-) --- base-commit: 715abedee4cd660ad390659aefa7482f05275bbd change-id: 20230510-dt-resv-bottom-up-68d71ff6628f Best regards,