From patchwork Wed Nov 16 07:32:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 20748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp254737dyb; Tue, 15 Nov 2022 23:33:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6z/3eFl7OKtjIjFZEObXtl8nYrTX6iM6JSfly89/qRYgjyge3mG7/GWm+OOpr4L8JWLAku X-Received: by 2002:a62:16d0:0:b0:56b:ced4:d3ed with SMTP id 199-20020a6216d0000000b0056bced4d3edmr21992566pfw.34.1668584038710; Tue, 15 Nov 2022 23:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668584038; cv=none; d=google.com; s=arc-20160816; b=cSZD9mr/U3xQdraA9cKzq5CFrp9wnr1cCdzRzQDpw7z3ZwNwTg1S5KhcQZY5RPDe+c 6YJixqdSl1sCe/1phRbrZqFiUH34u7WGszgdwPfYvCPuxbsaakWIzRG3aa1e01x9Frlf sGZu12/F9VXuzn5PXFONWlLJEYLd7omDXWpEVAWOO3KzHFQhgx2eLl3w3+AkFocNDS3H geexrA1QhZuARtHL/6ExHsjdVIRdfltU/+ulHaTX93SRjV7pKSPFpWHpJ6/+XjaV4tJ4 aFtijgasC7jMLVdUW5MdH2JbxacgZmXXp3Hdz0Dtug8Zr1PAOjS7vWjXDVsahJjQqtzw 9Ydw== 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=iPPeUQlF89WuMuKsE4L6h0ih48TI+X2n9tqxiV2tD4Q=; b=TJI3rD6Uu0Zys2OcMes9ZyB6U6cRmAAy7Kbgo11zV89THDlZ94l+gijs4AFj9tNO6F iSHdCfTMsLUp3+eBjFllRenizzkM62z9X0CNHyq6fqwqx9EOvn2lbfwV+v9N2Dbbi9Cl ODS0xzeYpF7qLj/KO+WdsBE9HdfqR/Zbn+dV+5Nu767aL1JzdjBPmQ14H17FTJwrufsO hmx1wqRNzshBwJMu6RIXLu4TfeGEpoPAqkLCF2iV0gon2ViOaVtFs1gWgYDiCfTp1cGi G1ZeiI8ERyHvLdxwPik2q2WGY2vrMRvTt0w3qq+9EzOaBQYw8jKTCqwPxo7K9DagtYOK 7aBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ImY4GLY1; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a170902ea0900b001867d1a71a6si16403544plg.473.2022.11.15.23.33.32; Tue, 15 Nov 2022 23:33:58 -0800 (PST) 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=@linaro.org header.s=google header.b=ImY4GLY1; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232810AbiKPHdI (ORCPT + 99 others); Wed, 16 Nov 2022 02:33:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232587AbiKPHdF (ORCPT ); Wed, 16 Nov 2022 02:33:05 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5035BF7 for ; Tue, 15 Nov 2022 23:33:04 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id o30so11280219wms.2 for ; Tue, 15 Nov 2022 23:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iPPeUQlF89WuMuKsE4L6h0ih48TI+X2n9tqxiV2tD4Q=; b=ImY4GLY1t/Rm4yER2CBeMhVxYLKVOewt7gDiUzCuRDac1mKXRnEUWXCfS1gwlytz7I VDfuGN4n7HXiRl/9Zbc6+zM84UufF2LthkeMQHDmuG+tSfpe1WJFzuzAizwDjnTxUCNf Ymfx4+iAlaYQu36is8mVx7V2LtE2lYkJotNVGb6+bR75g9/YFyXxD4AeoJfa2RK0j2a/ HbgSrIi1RSTXYlD1h7hl32fv4HPw1h/notcrUL1W0yXX9c0Dol0K3kURGIjr9mKZLLxO CS+CtPWcItnQ+nBh0pRZ9Ok7Mwvz165GboELNavCxm/no/pptFlJBCdJNawb4mN5Z8MF 47BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iPPeUQlF89WuMuKsE4L6h0ih48TI+X2n9tqxiV2tD4Q=; b=3KOLj74qN2x0piwzplmt25/iXHjQE+macGQVO4hfuXC9pDKusrgDKN0dS0KatEByz8 rv9OSG4ZqGNWFQhoix+QKzCOnFP4+7FwOBkV4BBB5J6tiDtHSosjGbvrbaf3p0sEnh75 FZlAK6PXXyqfaB5l3y6Za1FxpdPleNigg7eXXG829ftA8wFcR02nSE4bR6XI+miTSlcB F6ie6T41z9McqcH+FSYAUp9Vs+8UIpF8KuPKLoiUY2CGguywr5uZcuurKExFRBPjHxuc Murfm8GE772MriYNRNEjupeVGVUe2zzXoSthsxvazjkxwIJwLstnJTS9np/x+kQ9DBab vb2w== X-Gm-Message-State: ANoB5pnUl4wpxfgU96KlwwayRf0ZR9OsXeP/GfYmM82oD/ILiKRxuc7U xnmw19Y1jZ6jGdxL5whF5H7YsMaortosWG5prqg= X-Received: by 2002:a05:600c:3046:b0:3cf:cb16:f242 with SMTP id n6-20020a05600c304600b003cfcb16f242mr1205354wmh.82.1668583982753; Tue, 15 Nov 2022 23:33:02 -0800 (PST) Received: from zoltan.localdomain ([167.98.215.174]) by smtp.gmail.com with ESMTPSA id g34-20020a05600c4ca200b003cfd4e6400csm1058823wmp.19.2022.11.15.23.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 23:33:01 -0800 (PST) From: Alex Elder To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: andersson@kernel.org, konrad.dybcio@linaro.org, agross@kernel.org, elder@kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH net-next v3 1/5] dt-bindings: net: qcom,ipa: deprecate modem-init Date: Wed, 16 Nov 2022 01:32:52 -0600 Message-Id: <20221116073257.34010-2-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116073257.34010-1-elder@linaro.org> References: <20221116073257.34010-1-elder@linaro.org> MIME-Version: 1.0 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 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?1749637176956429879?= X-GMAIL-MSGID: =?utf-8?q?1749637176956429879?= GSI firmware for IPA must be loaded during initialization, either by the AP or by the modem. The loader is currently specified based on whether the Boolean modem-init property is present. Instead, use a new property with an enumerated value to indicate explicitly how GSI firmware gets loaded. With this in place, a third approach can be added in an upcoming patch. The new qcom,gsi-loader property has two defined values: - self: The AP loads GSI firmware - modem: The modem loads GSI firmware The modem-init property must still be supported, but is now marked deprecated. Update the example so it represents the SC7180 SoC, and provide examples for the qcom,gsi-loader, memory-region, and firmware-name properties. Signed-off-by: Alex Elder Reviewed-by: Krzysztof Kozlowski --- v3: Added Krzysztof's reviewed-by tag. v2: Updated description, switched example completely to SC7180. .../devicetree/bindings/net/qcom,ipa.yaml | 76 ++++++++++++++----- 1 file changed, 55 insertions(+), 21 deletions(-) diff --git a/Documentation/devicetree/bindings/net/qcom,ipa.yaml b/Documentation/devicetree/bindings/net/qcom,ipa.yaml index e752b76192df0..d0f34763b9383 100644 --- a/Documentation/devicetree/bindings/net/qcom,ipa.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ipa.yaml @@ -124,19 +124,29 @@ properties: - const: ipa-clock-enabled-valid - const: ipa-clock-enabled + qcom,gsi-loader: + enum: + - self + - modem + description: + Indicates how GSI firmware should be loaded. If the AP loads + and validates GSI firmware, this property has value "self". + If the modem does this, this property has value "modem". + modem-init: + deprecated: true type: boolean description: - If present, it indicates that the modem is responsible for - performing early IPA initialization, including loading and - validating firwmare used by the GSI. + This is the older (deprecated) way of indicating how GSI firmware + should be loaded. If present, the modem loads GSI firmware; if + absent, the AP loads GSI firmware. memory-region: maxItems: 1 description: If present, a phandle for a reserved memory area that holds the firmware passed to Trust Zone for authentication. Required - when Trust Zone (not the modem) performs early initialization. + when the AP (not the modem) performs early initialization. firmware-name: $ref: /schemas/types.yaml#/definitions/string @@ -155,15 +165,36 @@ required: - interconnects - qcom,smem-states -# If modem-init is not present, the AP loads GSI firmware, and -# memory-region must be specified -if: - not: - required: - - modem-init -then: - required: - - memory-region +allOf: + # If qcom,gsi-loader is present, modem-init must not be present + - if: + required: + - qcom,gsi-loader + then: + properties: + modem-init: false + + # If qcom,gsi-loader is "self", the AP loads GSI firmware, and + # memory-region must be specified + if: + properties: + qcom,gsi-loader: + contains: + const: self + then: + required: + - memory-region + else: + # If qcom,gsi-loader is not present, we use deprecated behavior. + # If modem-init is not present, the AP loads GSI firmware, and + # memory-region must be specified. + if: + not: + required: + - modem-init + then: + required: + - memory-region additionalProperties: false @@ -194,14 +225,17 @@ examples: }; ipa@1e40000 { - compatible = "qcom,sdm845-ipa"; + compatible = "qcom,sc7180-ipa"; - modem-init; + qcom,gsi-loader = "self"; + memory-region = <&ipa_fw_mem>; + firmware-name = "qcom/sc7180-trogdor/modem/modem.mdt"; - iommus = <&apps_smmu 0x720 0x3>; + iommus = <&apps_smmu 0x440 0x0>, + <&apps_smmu 0x442 0x0>; reg = <0x1e40000 0x7000>, - <0x1e47000 0x2000>, - <0x1e04000 0x2c000>; + <0x1e47000 0x2000>, + <0x1e04000 0x2c000>; reg-names = "ipa-reg", "ipa-shared", "gsi"; @@ -219,9 +253,9 @@ examples: clock-names = "core"; interconnects = - <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_EBI1>, - <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_IMEM>, - <&rsc_hlos MASTER_APPSS_PROC &rsc_hlos SLAVE_IPA_CFG>; + <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI1 0>, + <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_IMEM 0>, + <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_IPA_CFG 0>; interconnect-names = "memory", "imem", "config"; From patchwork Wed Nov 16 07:32:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 20749 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp254771dyb; Tue, 15 Nov 2022 23:34:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ovV3NDX/JhDnsM2IioU1ih0khxq2TX1g/treVNFKpZ1M0HN/+/T0SR8BmF+KuE99eYRag X-Received: by 2002:a17:902:c211:b0:188:a6ea:27a1 with SMTP id 17-20020a170902c21100b00188a6ea27a1mr7713425pll.164.1668584044151; Tue, 15 Nov 2022 23:34:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668584044; cv=none; d=google.com; s=arc-20160816; b=lUS2wEJIUnrggm30Ph3VefiX7+05dGLQ3RmU3up+m2ZDhsvgfNtzyboaXRXy7XfCml FDhOz/5I54qqo5udiqcBy50ff+RvTMpSunKzHSWKcGXXO+7VdkIHzSx6JhH97wlYU2CE Y3s73Ejo/lYwhhdwEIYwYWJ5/qKNOHTbrAb1kbOUbjI63vdxTJzIxwm6HgZHZxMzeKf/ dtszfuzESGwD0x9jO0UVxwoUKjVPwfLKBFxGcQ1aR45MXAQgKO+BRv+hme0Te28oo36x wztXedQN3/950g0KXTqgytQTRhl+nI6w8nQzk2ya/8BR0TxB1PUAS4Lz5HWzsLv7hjtw YxIg== 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=IbFCvRl1cs7XC6NWdvqbuTmw/rqE6VsOAXoQYLExO5Q=; b=POxUZYiqcJ6e9oE/o8sUwS2AMDE+eTCJGieQgkhD2A/32fCPyVaOaWXTOHrNaOavMl QJUR1B88+aXHY1R9l8hqAXOeo85t8NrycMFZWK+Oehdxpis1jJ0h33W5wStCBWOg3lSy pGpMirnwUPXiSEDkIFA06V6/R3+EcQByJH89L+OSBd1DNhVyYpawIm6ji9Xq56Wtu6IR au7Uyb+9VgBFpKt2oxPibaIEvGHT8jKuYROX08Q0IEQQYZh5KfBmBqGWqHeTq0rlUQWb i3HOFHUmRkkupGI9yuJznxakAq4c0AFohMmzx2Gt6g8Nkd2xc0VW7cCjh0dgeTAl8Ubk 1OLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DU7zoibq; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a17090a68c600b002133104a17csi1035349pjj.79.2022.11.15.23.33.50; Tue, 15 Nov 2022 23:34:04 -0800 (PST) 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=@linaro.org header.s=google header.b=DU7zoibq; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232847AbiKPHdN (ORCPT + 99 others); Wed, 16 Nov 2022 02:33:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232734AbiKPHdG (ORCPT ); Wed, 16 Nov 2022 02:33:06 -0500 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 B6DE6C2E for ; Tue, 15 Nov 2022 23:33:05 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id w14so28434183wru.8 for ; Tue, 15 Nov 2022 23:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IbFCvRl1cs7XC6NWdvqbuTmw/rqE6VsOAXoQYLExO5Q=; b=DU7zoibqF3VBeTWDB1vEVwMsv4KlatyI3tqd0l3rYwWf91OWuP87YxY4SgVZW5bSja P/AuW06El34WSS9tvrxvmpqlp+Iu7W/jCxl/UUk9jczg1+LrryegvgjlQ92BF7QN8m7E yymio/ffeYE8OJuEs9x2SWrTUyDYP6TgfYL3LtfA6PmSmnPVgvgCNmvrfIRbAbC1+d3D mb2qWhHHyUgmEBaBBEO6OsdRKR4iPwe9qZN3jHsmKu9t4x4HHiICUE/l5ZoMmwnD+q0s caM5y++t4iivpSWgOlOnjFS1OXBeQy67ZtcG9aK4ni7NUIqc6kzCLWRwqYI7cfW+w4RL 3DeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IbFCvRl1cs7XC6NWdvqbuTmw/rqE6VsOAXoQYLExO5Q=; b=osfywiyJcuYkILcMr6zP/7c79csAEKq79wY09jTbLsB615uHddwtgM4YXLV6URAZyA 1YZXxx3LbvHReFzkVuLzPouc5VgiRpCCG6Z84fuPU5qry/To+fPsPfH9x6nWHAK9h8rG q7znXIU6BBJAmvetDpwVJvHdJRqkPy9KmJJnsJwdZbGZJAXHNhSJk/CSYc2KohL5w+Nz eNUjm+17BVdXvPGDXVhO/oY0fkkUqdTddr77FQFxzlmGyb+cJUsEpGPTdvMN0DssGreo 74dvAwtdqnXs0gbUABUtAibLeqeS754Ydyjf/xsWZXqMD5riPWss8hg8s/kEgl6/rWRb 9YNw== X-Gm-Message-State: ANoB5pl8yAiOGIzzFzZkOwKNSFznGqP2P6k5gyffKf/qePjFUGNh93Vc rfxlzO04tLYOi369/6i+BZhUxQ== X-Received: by 2002:a5d:5446:0:b0:236:6442:3a65 with SMTP id w6-20020a5d5446000000b0023664423a65mr13222982wrv.84.1668583984173; Tue, 15 Nov 2022 23:33:04 -0800 (PST) Received: from zoltan.localdomain ([167.98.215.174]) by smtp.gmail.com with ESMTPSA id g34-20020a05600c4ca200b003cfd4e6400csm1058823wmp.19.2022.11.15.23.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 23:33:03 -0800 (PST) From: Alex Elder To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: andersson@kernel.org, konrad.dybcio@linaro.org, agross@kernel.org, elder@kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 2/5] net: ipa: encapsulate decision about firmware load Date: Wed, 16 Nov 2022 01:32:53 -0600 Message-Id: <20221116073257.34010-3-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116073257.34010-1-elder@linaro.org> References: <20221116073257.34010-1-elder@linaro.org> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749637182849995942?= X-GMAIL-MSGID: =?utf-8?q?1749637182849995942?= The GSI layer used for IPA requires firmware to be loaded. Currently either the AP or the modem loads the firmware, distinguished by whether the "modem-init" Device Tree property is defined. Some newer systems implement a third option. In preparation for that, encapsulate the code that determines how the GSI firmware gets loaded in a new function, ipa_firmware_loader(). Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 39 ++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index ebb6c9b311eb9..9e43b79d233e9 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -81,6 +81,19 @@ /* Divider for 19.2 MHz crystal oscillator clock to get common timer clock */ #define IPA_XO_CLOCK_DIVIDER 192 /* 1 is subtracted where used */ +/** + * enum ipa_firmware_loader: How GSI firmware gets loaded + * + * @IPA_LOADER_DEFER: System not ready; try again later + * @IPA_LOADER_SELF: AP loads GSI firmware + * @IPA_LOADER_MODEM: Modem loads GSI firmware, signals when done + */ +enum ipa_firmware_loader { + IPA_LOADER_DEFER, + IPA_LOADER_SELF, + IPA_LOADER_MODEM, +}; + /** * ipa_setup() - Set up IPA hardware * @ipa: IPA pointer @@ -696,6 +709,18 @@ static void ipa_validate_build(void) BUILD_BUG_ON(!ipa_aggr_granularity_val(IPA_AGGR_GRANULARITY)); } +static enum ipa_firmware_loader ipa_firmware_loader(struct device *dev) +{ + if (of_property_read_bool(dev->of_node, "modem-init")) + return IPA_LOADER_MODEM; + + /* We need Trust Zone to load firmware; make sure it's available */ + if (qcom_scm_is_available()) + return IPA_LOADER_SELF; + + return IPA_LOADER_DEFER; +} + /** * ipa_probe() - IPA platform driver probe function * @pdev: Platform device pointer @@ -722,9 +747,9 @@ static void ipa_validate_build(void) static int ipa_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + enum ipa_firmware_loader loader; const struct ipa_data *data; struct ipa_power *power; - bool modem_init; struct ipa *ipa; int ret; @@ -747,11 +772,9 @@ static int ipa_probe(struct platform_device *pdev) return -EINVAL; } - /* If we need Trust Zone, make sure it's available */ - modem_init = of_property_read_bool(dev->of_node, "modem-init"); - if (!modem_init) - if (!qcom_scm_is_available()) - return -EPROBE_DEFER; + loader = ipa_firmware_loader(dev); + if (loader == IPA_LOADER_DEFER) + return -EPROBE_DEFER; /* The clock and interconnects might not be ready when we're * probed, so might return -EPROBE_DEFER. @@ -796,7 +819,7 @@ static int ipa_probe(struct platform_device *pdev) if (ret) goto err_endpoint_exit; - ret = ipa_smp2p_init(ipa, modem_init); + ret = ipa_smp2p_init(ipa, loader == IPA_LOADER_MODEM); if (ret) goto err_table_exit; @@ -815,7 +838,7 @@ static int ipa_probe(struct platform_device *pdev) * call to ipa_setup() when it has finished. In that case we're * done here. */ - if (modem_init) + if (loader == IPA_LOADER_MODEM) goto done; /* Otherwise we need to load the firmware and have Trust Zone validate From patchwork Wed Nov 16 07:32:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 20750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp254803dyb; Tue, 15 Nov 2022 23:34:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Z7mib6OodJ6+/uhu1Gz2LQwBT8AqmUTcyYQenAKLc9ZHqLU1pf2ArquD+nn3Q0Y6KxTij X-Received: by 2002:a17:902:9f8f:b0:179:f94a:6fda with SMTP id g15-20020a1709029f8f00b00179f94a6fdamr7850224plq.118.1668584049069; Tue, 15 Nov 2022 23:34:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668584049; cv=none; d=google.com; s=arc-20160816; b=X0bU2lB3x5Russp5h59CVsf8nu1ryxKtOFCUF4YTob+yVuZP++JtX6RXDsINuZ52n2 fKUrWvmXysDPrgGOsYLIKNcuKgumyS4SP7rbnzckdphSh96O+zf2ihD7aT5qIaG4DXN7 ANHxrIw25vC7tXg8hY+NSMAmdRJbnVqDESO1i6ykczIjJHaf4pvKby2YFCzHpUWKSSJV RDggF1o6WNoH1l0l1dzcPAmK7YGQ1VXanHvEVD91fk8iBsCoFcz7wW/+o5vZq4EnZnoD B+QoyoKs0B6ld6Swxxsw5rGu3hPgY+hYEZwWM4R2kvo3HpWosGYp6HUln4JPiuIH270d Miyw== 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=QmJK2z6YewxghveqGIb9UQBF6OMvTjY+OevUyUnH0xk=; b=zC7fv+uWyQg6M4Lpi+dRBFUUfJn/U7wSkO8Dg53MoKv/uM+SObOOHVhjf+cH0zuzDO erMirdU4fAYzGgvXHmr7y7wOJVSdcS1GSqGDIHMRJ78X0t6jSOfQvsPc0gOQraVuo4C/ +q+to3eVHbknTP0EeNtPFZTXUdoJh1ufS/YJ2Sp4ZyfIFbSIRrygGOt7AQYpnP1xj5lq jLXT/teHbX6ziKjVtVAUekmGBGiTBXPaXnBnohLhm7pvFASdwuJOoTLyiR8vKndCVVbD OlOf+eAYHd8jwgO7NkAzka0hsjdtcnoBDopMj7gTatMCjCUP72Spsn+4X4Z3xWd2GS4w S9IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AlwDnToV; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i186-20020a6387c3000000b004769f0faab8si5601574pge.740.2022.11.15.23.33.55; Tue, 15 Nov 2022 23:34:09 -0800 (PST) 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=@linaro.org header.s=google header.b=AlwDnToV; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232906AbiKPHdb (ORCPT + 99 others); Wed, 16 Nov 2022 02:33:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232501AbiKPHdI (ORCPT ); Wed, 16 Nov 2022 02:33:08 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FA2EF7 for ; Tue, 15 Nov 2022 23:33:07 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id v7so11285866wmn.0 for ; Tue, 15 Nov 2022 23:33:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QmJK2z6YewxghveqGIb9UQBF6OMvTjY+OevUyUnH0xk=; b=AlwDnToVO2of7fWwUMmka1YavMRruNRrWzdBbvlUDfspCxIL90nNvyGeVYFxHCrwSa qiaS3T7X63l9vutvktkMzPsvV8+N7I0qVjejVbxzFPUn4sPaJ9OvXFZQf/3f/5Ln5k/J 27Ef6HD165TVua+NrERnzzR9+lFEZMrxkT+ZvGI5Ar3alJ/9KDz7dwt28z68oxuq6yex NjSkHgdlAHsHw0IWX+vT0UusfXj/zSydp4igAc+jsX7kHqFJvcBcfuPkR1jKh8G9IMZL uyl10CjRKz1Pwp714ZcObGaRQTsbaKt022qSs/ZqnPdqurS8vCUHEnKTzKUM61/2OolN 3GGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QmJK2z6YewxghveqGIb9UQBF6OMvTjY+OevUyUnH0xk=; b=gJFKPZd2/ngSnq346SqU7Z9D7yjTYDLfGfb+BKnHqE0ILxyzuJ1txDg1MdlAT3sHXl oDwVZ7P61evzq63MIM600KiEJqOy/wjqkXbSvljzfpY0auAaNqgpe4LvUufn7QzhxUeL PWM32Lse3szgKTRnd5VTzN+uEDmrPbmWuL50h1mbS2Bn+nPpSsqn5FcCGUIjvLRGQrgT QUaI5HkPXBcfwAZvDmsy8EQdD2q7t9B7SL6jXCa5swYLQ0Zrk2Eq04LYFyBhGU4rwq1Y jxQ0PbXmJKtq7VsaUOiylKH9lL+OURq7kP5cLVkxMSp+OyUVpzyeAYEvhEB/amLMZOa1 xD5g== X-Gm-Message-State: ANoB5pnN6YfP6cb5RkvIHRQ8/XUr3mJ5qxSs4tSPFMWzCbY1syakr0ro 94ANVJ2yy9wqiFgo0pM8BSSOyg== X-Received: by 2002:a1c:e914:0:b0:3cf:d055:9138 with SMTP id q20-20020a1ce914000000b003cfd0559138mr1126362wmc.140.1668583985420; Tue, 15 Nov 2022 23:33:05 -0800 (PST) Received: from zoltan.localdomain ([167.98.215.174]) by smtp.gmail.com with ESMTPSA id g34-20020a05600c4ca200b003cfd4e6400csm1058823wmp.19.2022.11.15.23.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 23:33:04 -0800 (PST) From: Alex Elder To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: andersson@kernel.org, konrad.dybcio@linaro.org, agross@kernel.org, elder@kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 3/5] net: ipa: introduce "qcom,gsi-loader" property Date: Wed, 16 Nov 2022 01:32:54 -0600 Message-Id: <20221116073257.34010-4-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116073257.34010-1-elder@linaro.org> References: <20221116073257.34010-1-elder@linaro.org> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749637187795517187?= X-GMAIL-MSGID: =?utf-8?q?1749637187795517187?= Introduce a new way of specifying how the GSI firmware gets loaded for IPA. Currently, this is indicated by the presence or absence of the Boolean "modem-init" Device Tree property. The new property must have a value--either "self" or "modem"--which indicates whether the AP or modem is the GSI firmware loader, respectively. For legacy systems, the new property will not exist, and the "modem-init" property will be used. For newer systems, the "qcom,gsi-loader" property *must* exist, and must have one of the two prescribed values. It is an error to have both properties defined, and it is an error for the new property to have an unrecognized value. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 44 ++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 9e43b79d233e9..214e524dce795 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -87,11 +87,13 @@ * @IPA_LOADER_DEFER: System not ready; try again later * @IPA_LOADER_SELF: AP loads GSI firmware * @IPA_LOADER_MODEM: Modem loads GSI firmware, signals when done + * @IPA_LOADER_INVALID: GSI firmware loader specification is invalid */ enum ipa_firmware_loader { IPA_LOADER_DEFER, IPA_LOADER_SELF, IPA_LOADER_MODEM, + IPA_LOADER_INVALID, }; /** @@ -711,9 +713,37 @@ static void ipa_validate_build(void) static enum ipa_firmware_loader ipa_firmware_loader(struct device *dev) { - if (of_property_read_bool(dev->of_node, "modem-init")) + bool modem_init; + const char *str; + int ret; + + /* Look up the old and new properties by name */ + modem_init = of_property_read_bool(dev->of_node, "modem-init"); + ret = of_property_read_string(dev->of_node, "qcom,gsi-loader", &str); + + /* If the new property doesn't exist, it's legacy behavior */ + if (ret == -EINVAL) { + if (modem_init) + return IPA_LOADER_MODEM; + goto out_self; + } + + /* Any other error on the new property means it's poorly defined */ + if (ret) + return IPA_LOADER_INVALID; + + /* New property value exists; if old one does too, that's invalid */ + if (modem_init) + return IPA_LOADER_INVALID; + + /* Modem loads GSI firmware for "modem" */ + if (!strcmp(str, "modem")) return IPA_LOADER_MODEM; + /* Any value other than "self" is an error */ + if (strcmp(str, "self")) + return IPA_LOADER_INVALID; +out_self: /* We need Trust Zone to load firmware; make sure it's available */ if (qcom_scm_is_available()) return IPA_LOADER_SELF; @@ -773,6 +803,8 @@ static int ipa_probe(struct platform_device *pdev) } loader = ipa_firmware_loader(dev); + if (loader == IPA_LOADER_INVALID) + return -EINVAL; if (loader == IPA_LOADER_DEFER) return -EPROBE_DEFER; @@ -834,20 +866,18 @@ static int ipa_probe(struct platform_device *pdev) dev_info(dev, "IPA driver initialized"); - /* If the modem is doing early initialization, it will trigger a - * call to ipa_setup() when it has finished. In that case we're - * done here. + /* If the modem is loading GSI firmware, it will trigger a call to + * ipa_setup() when it has finished. In that case we're done here. */ if (loader == IPA_LOADER_MODEM) goto done; - /* Otherwise we need to load the firmware and have Trust Zone validate - * and install it. If that succeeds we can proceed with setup. - */ + /* The AP is loading GSI firmware; do so now */ ret = ipa_firmware_load(dev); if (ret) goto err_deconfig; + /* GSI firmware is loaded; proceed to setup */ ret = ipa_setup(ipa); if (ret) goto err_deconfig; From patchwork Wed Nov 16 07:32:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 20751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp256791dyb; Tue, 15 Nov 2022 23:39:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5aqtP01NZULZZsVdei5jxAqXUlVMOPrhjPIg6hlO8CG0zDnD0naU0RolKkJ4sgvsJIIN+T X-Received: by 2002:a17:906:9f04:b0:7ae:ed2:5367 with SMTP id fy4-20020a1709069f0400b007ae0ed25367mr16801265ejc.521.1668584380914; Tue, 15 Nov 2022 23:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668584380; cv=none; d=google.com; s=arc-20160816; b=blH8urePw57TV6CDIOFhJY5KiYLPTHWM+rIfjH9EskD1lETXyjSPJsdR+0HacLtGXd aIClnmRx7cUdoXhVoMsn5fK1swqEOfGKMKLqh5XcSM5tiS+w7/10YB0iEW7YPnDHMAkZ Eg07XBQc2T4c2AYliqdFj0+Ec/MG+/hVqXiTBpE2kuyj/y2XFWmW8k9eXTWR6Y9Z8MZO JhsC6eu3lJ054AEi116qLRDlq9wYS6Dns35BmY9KqwPmkVKLO+eb08I6l5c8qIhX3Mz3 NhARRPdRMTpxZXudG7ylMaZAeMU0iDY/VsEUZzUOiz0XygoIIKe9MbF4bHxulxe4OCjY SKUw== 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=nYNlJyihLZjd+VQJNRFqHneq/kxBQWta00+5mLZPhSc=; b=RFX+IwOkN1bNSWWpgqTpWrHMcoazN2/LAASEdD2wtfFXEQkbvwaZfVfERsPsBfDhMR lGFBFKAjXPuOX/PLjEJj+pFz85zrH01SfSh4swjH4dRJYeAVegIzhItkqGOADbQpMWRb n8SzOwn40zf5DbqxtQ89V77JxlAAlXk2ljKc+meYjzAWk6fpEcJxMx5mr+0zITqN/6Fy TnIju29h3mb2BnFnsz1IJ89Dfo+4s5Rn188MP8gc8fs4+OGK5Ofga0ZfDEL+8oZkYKrQ px6GDWfCZRXkQHYRrVfh680AGbtSnk/L5DaaDrTzV3M/5S1lqFU1Xeq9vDNpZ+iDSulv Sj1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q6xyqG3n; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu10-20020a170906eeca00b0078dcdbb3e87si12363156ejb.530.2022.11.15.23.39.15; Tue, 15 Nov 2022 23:39:40 -0800 (PST) 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=@linaro.org header.s=google header.b=Q6xyqG3n; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232915AbiKPHdz (ORCPT + 99 others); Wed, 16 Nov 2022 02:33:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232758AbiKPHd2 (ORCPT ); Wed, 16 Nov 2022 02:33:28 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FE23BF41 for ; Tue, 15 Nov 2022 23:33:08 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id j15so28477583wrq.3 for ; Tue, 15 Nov 2022 23:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nYNlJyihLZjd+VQJNRFqHneq/kxBQWta00+5mLZPhSc=; b=Q6xyqG3ndI5aq/sWqfLQTKiGdcWJAmI3Oa/Et2oMDiAaVp8SKXeCBAYm+UeIJyuqW4 rDGbE0knBMpgYLDgeWCXrntJFy4NVI6BbWbC1awE+okko2B4nyhRfhMmbZBXMyTabEW1 4YVP9uL+hRsrUaaTdPmJUf/ZqRv3UltsxGW0yUmvgDh4fCvv7sy3Hf86RRMGV7OtkqZz x53UtEdMgH3KTjl5gooZHSkHhCTd8Ui9E3DTk/RcF4hZkYOSFn/tun29/7DXGdtPCdYQ uR2TgQIkxDBWOltdF0oInQteekJuOYDRz+Omh6osaYgq6mEqDSGbl+qXs+5hc4Hc34Pc wD8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nYNlJyihLZjd+VQJNRFqHneq/kxBQWta00+5mLZPhSc=; b=2aODL6u6+6ir5ICc8rwgRvY18+BT+ZNqRUYTBak9LA50x27boHcvnogL5/Z3UeOJ/8 h77sBFAp6FKJlNmZxGgkybrnp8OvPwz66RaYD/fsIRu4vPIJlf8fgmMWtcdjfym+QlKc csV/DF5e1MwZjgA6952yySyokVHNo1lINTymmN8K5j4xPg/1cQNu+R8+9FD+E1NUrNoT cbcpVEZ/Om566SK2A4OWF/mGPNEF9b9RE7b9rJNVuVCtiM+WkMpEcyEtWvZDUdWR4hf0 hSMbJ18owC+ayDYkA52KRoHB7kL3/LfqeK0z6LN4E6ae8x8z7KyzBjODEos03uNjCXja ZtXw== X-Gm-Message-State: ANoB5pkjTLhSt1n4GpWf2RMDlvW18i21c2sagSLFWBuF1g/tIxW2PF4k pkF09L5oKO8P1bJzmEv5/O/nUw== X-Received: by 2002:a5d:518d:0:b0:236:4ec6:af52 with SMTP id k13-20020a5d518d000000b002364ec6af52mr12606634wrv.524.1668583986957; Tue, 15 Nov 2022 23:33:06 -0800 (PST) Received: from zoltan.localdomain ([167.98.215.174]) by smtp.gmail.com with ESMTPSA id g34-20020a05600c4ca200b003cfd4e6400csm1058823wmp.19.2022.11.15.23.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 23:33:06 -0800 (PST) From: Alex Elder To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: andersson@kernel.org, konrad.dybcio@linaro.org, agross@kernel.org, elder@kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH net-next v3 4/5] dt-bindings: net: qcom,ipa: support skipping GSI firmware load Date: Wed, 16 Nov 2022 01:32:55 -0600 Message-Id: <20221116073257.34010-5-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116073257.34010-1-elder@linaro.org> References: <20221116073257.34010-1-elder@linaro.org> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749637535746997354?= X-GMAIL-MSGID: =?utf-8?q?1749637535746997354?= Add a new enumerated value to those defined for the qcom,gsi-loader property. If the qcom,gsi-loader is "skip", the GSI firmware will already be loaded, so neither the AP nor modem is required to load GSI firmware. Signed-off-by: Alex Elder Reviewed-by: Krzysztof Kozlowski --- v3: Added Krzysztof's reviewed-by tag. Documentation/devicetree/bindings/net/qcom,ipa.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/net/qcom,ipa.yaml b/Documentation/devicetree/bindings/net/qcom,ipa.yaml index d0f34763b9383..9e81b9ec7cfdd 100644 --- a/Documentation/devicetree/bindings/net/qcom,ipa.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ipa.yaml @@ -128,10 +128,12 @@ properties: enum: - self - modem + - skip description: Indicates how GSI firmware should be loaded. If the AP loads and validates GSI firmware, this property has value "self". If the modem does this, this property has value "modem". + Otherwise, "skip" means GSI firmware loading is not required. modem-init: deprecated: true From patchwork Wed Nov 16 07:32:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 20752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp259732dyb; Tue, 15 Nov 2022 23:47:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ug8PLu85ZpVks/djAUWbxW2phiXE9bezJlWeuQRuXGNg61JXCM2fqnsZDw7/2DAC9D9aS X-Received: by 2002:a17:906:ecfb:b0:7a6:cf13:ccba with SMTP id qt27-20020a170906ecfb00b007a6cf13ccbamr16583485ejb.432.1668584859413; Tue, 15 Nov 2022 23:47:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668584859; cv=none; d=google.com; s=arc-20160816; b=vE0LoSsZG0dAgVC7EndpfLzJh/qtlfxL563dSnQKI/YjmN7zLhWWFODFQ5mhrrYLI3 rcnCgsD0B7bLWyTCQmP4aXyyY08UcB/nAzCnNSwGowROcJsXlts+/Eim4AcahrSFUCb6 QQJ4fyzSm5FTFjI5XDrrwgy7b7Um5rj+dbx5+HBuWutt7ifT5UQMPxAZWwdli646YMUS exDeSuTPXznxDmfFHrcxaePopP3/MUqYV2LSDWbyLY3KB8iv9TeplD59kDFC0oA99FoI Mo+xAr4LZsMAjxfe8ifdqZrFzo6EGl533X0Ixk5ciHeJEpFXMXwDQpQHtHLELl+dmgsz d+Mw== 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=umpLk1dbP5jy5ZPV4Q21UM7cr1nZKFjsXDStFsdzpxA=; b=Sw2bnSaWdkcWdFwSeZrd2v+DaP1RpF4g83ONsB+5/sRr+/4tvyT5to4+xfIKPftlxF jB7l+6cuKw8OzX05WHrwdg4mSd3EJNkOzgdzNl4io+6hVjKm9ZhvBxJ5AZzvyPg1EzuE G48NcHmRerSEDNxUZmMvlqfXYeDxAyngxOX4xvQSpDI6cHFy0AgFxqJXudw3Y2FyiGqf 1bXEHwy5IM16z6rV9d3InhSBxE7Btftdcu3YTIdiVgHwK0Afo3mHqEpOLNERDJXcdwBR B2t7Bqzcozwzq2cofA05Z1fDCPjDH87uL1RGpQMtlMZ1dnmVtXLUFYUE2BcBbUizg5II 1ghw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bUEFiyV6; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020a05640227ca00b004587e99bcc2si14463965ede.383.2022.11.15.23.47.12; Tue, 15 Nov 2022 23:47:39 -0800 (PST) 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=@linaro.org header.s=google header.b=bUEFiyV6; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232981AbiKPHdv (ORCPT + 99 others); Wed, 16 Nov 2022 02:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232762AbiKPHd3 (ORCPT ); Wed, 16 Nov 2022 02:33:29 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D01BF7A for ; Tue, 15 Nov 2022 23:33:09 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id o30so11280346wms.2 for ; Tue, 15 Nov 2022 23:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=umpLk1dbP5jy5ZPV4Q21UM7cr1nZKFjsXDStFsdzpxA=; b=bUEFiyV6kZIbszj2+ZIoMR3VTFJn6PlTsF7tRLl0wEQxGtgtif3Y2dDkmsoG1FumFw JMIFFU92pNjKKcVCF2rJaWSO54zy4tt6BjgnERylWwYu0aBDo1wwX4NKhablIM1r0WRD QneZc8D4GylnFjzHyC0m9IC/xwKZ8K1zBTIyqJdVRzxFP5/X9mHOutth5ynK/jY88dvD 4U+KCK/qE5wFDEEn4FAz7jESpw707XHSacO0QWhyCFHVeWGuVky0qV14WG1NWghbIBi5 0B33Z2c1FpTHhd1h8qTaAQ4aLw1raMYtHH0+VuF4l8x0SCi09v8Yi/rnW07WBAs7Kg8o 4eaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=umpLk1dbP5jy5ZPV4Q21UM7cr1nZKFjsXDStFsdzpxA=; b=5lJxovVgYU7qlTYV4iow+ZaOglFJeaVomnTr6ammV6SLMYJU9ZOLGQJGptbK8eJV31 zYoC3rz+9ohE0hT67YLpbeAqEYQj9rix1V4/dxcHB8V/ox0z12/pKqQORNu4cuG4LH5c hLIy2OmQZg88tt9BOmbLk+vf+73SxRZgKQ+Lch2D7rozyMKjavUmKGOuLFjeuYYqg/kz 98Mbu7rqsJlZiV22vS7l7FadYKI5vP7gv2x3LzVzPMe/nRnCCyc2rjUyli/64L9yrMTo e998W+s4wyaa8CJFpbOnvp6uZ1J7JKQDmNtwaot2KK3FCYlSqEupmucBR31AgZQa7Gi1 fnPQ== X-Gm-Message-State: ANoB5pmi9K03ITp117TLzWNpXS2H+RtlXL4a42cs6lJ+uOr1bewLIPF+ hZ2vbFdCiAdLXQN5HbroWkRgoA== X-Received: by 2002:a7b:c00a:0:b0:3cf:e8f0:ad11 with SMTP id c10-20020a7bc00a000000b003cfe8f0ad11mr1215370wmb.65.1668583988521; Tue, 15 Nov 2022 23:33:08 -0800 (PST) Received: from zoltan.localdomain ([167.98.215.174]) by smtp.gmail.com with ESMTPSA id g34-20020a05600c4ca200b003cfd4e6400csm1058823wmp.19.2022.11.15.23.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 23:33:07 -0800 (PST) From: Alex Elder To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: andersson@kernel.org, konrad.dybcio@linaro.org, agross@kernel.org, elder@kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 5/5] net: ipa: permit GSI firmware loading to be skipped Date: Wed, 16 Nov 2022 01:32:56 -0600 Message-Id: <20221116073257.34010-6-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116073257.34010-1-elder@linaro.org> References: <20221116073257.34010-1-elder@linaro.org> MIME-Version: 1.0 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 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?1749638037403454788?= X-GMAIL-MSGID: =?utf-8?q?1749638037403454788?= Define a new value "skip" for the "qcom,gsi-loader" Device Tree property. If used, it indicates that neither the AP nor the modem need to load GSI firmware (because it has already been loaded--for example by the boot loader). Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 214e524dce795..8f20825675a1a 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -87,12 +87,14 @@ * @IPA_LOADER_DEFER: System not ready; try again later * @IPA_LOADER_SELF: AP loads GSI firmware * @IPA_LOADER_MODEM: Modem loads GSI firmware, signals when done + * @IPA_LOADER_SKIP: Neither AP nor modem need to load GSI firmware * @IPA_LOADER_INVALID: GSI firmware loader specification is invalid */ enum ipa_firmware_loader { IPA_LOADER_DEFER, IPA_LOADER_SELF, IPA_LOADER_MODEM, + IPA_LOADER_SKIP, IPA_LOADER_INVALID, }; @@ -740,6 +742,10 @@ static enum ipa_firmware_loader ipa_firmware_loader(struct device *dev) if (!strcmp(str, "modem")) return IPA_LOADER_MODEM; + /* No GSI firmware load is needed for "skip" */ + if (!strcmp(str, "skip")) + return IPA_LOADER_SKIP; + /* Any value other than "self" is an error */ if (strcmp(str, "self")) return IPA_LOADER_INVALID; @@ -872,10 +878,12 @@ static int ipa_probe(struct platform_device *pdev) if (loader == IPA_LOADER_MODEM) goto done; - /* The AP is loading GSI firmware; do so now */ - ret = ipa_firmware_load(dev); - if (ret) - goto err_deconfig; + if (loader == IPA_LOADER_SELF) { + /* The AP is loading GSI firmware; do so now */ + ret = ipa_firmware_load(dev); + if (ret) + goto err_deconfig; + } /* Otherwise loader == IPA_LOADER_SKIP */ /* GSI firmware is loaded; proceed to setup */ ret = ipa_setup(ipa);