]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: ipa: permit GSI firmware loading to be skipped
authorAlex Elder <elder@linaro.org>
Wed, 16 Nov 2022 07:32:56 +0000 (01:32 -0600)
committerJakub Kicinski <kuba@kernel.org>
Fri, 18 Nov 2022 05:46:55 +0000 (21:46 -0800)
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 <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_main.c

index 214e524dce7955d6ee6ddbd88671366441753f07..8f20825675a1a001bc4f29a8d33b010d25b598d2 100644 (file)
  * @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);