Merge branch 'ipa-fw-names'
Alex Elder says: ==================== net: ipa: allow different firmware names Add the ability to define a "firmware-name" property in the IPA DT node, specifying an alternate name to use for the firmware file. Used only if the AP (Trust Zone) does early IPA initialization. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
d8214c7aae
|
@ -125,6 +125,14 @@ properties:
|
||||||
the firmware passed to Trust Zone for authentication. Required
|
the firmware passed to Trust Zone for authentication. Required
|
||||||
when Trust Zone (not the modem) performs early initialization.
|
when Trust Zone (not the modem) performs early initialization.
|
||||||
|
|
||||||
|
firmware-name:
|
||||||
|
$ref: /schemas/types.yaml#/definitions/string
|
||||||
|
description:
|
||||||
|
If present, name (or relative path) of the file within the
|
||||||
|
firmware search path containing the firmware image used when
|
||||||
|
initializing IPA hardware. Optional, and only used when
|
||||||
|
Trust Zone performs early initialization.
|
||||||
|
|
||||||
required:
|
required:
|
||||||
- compatible
|
- compatible
|
||||||
- iommus
|
- iommus
|
||||||
|
@ -134,12 +142,23 @@ required:
|
||||||
- interconnects
|
- interconnects
|
||||||
- qcom,smem-states
|
- qcom,smem-states
|
||||||
|
|
||||||
|
# Either modem-init is present, or memory-region must be present.
|
||||||
oneOf:
|
oneOf:
|
||||||
- required:
|
- required:
|
||||||
- modem-init
|
- modem-init
|
||||||
- required:
|
- required:
|
||||||
- memory-region
|
- memory-region
|
||||||
|
|
||||||
|
# If memory-region is present, firmware-name may optionally be present.
|
||||||
|
# But if modem-init is present, firmware-name must not be present.
|
||||||
|
if:
|
||||||
|
required:
|
||||||
|
- modem-init
|
||||||
|
then:
|
||||||
|
not:
|
||||||
|
required:
|
||||||
|
- firmware-name
|
||||||
|
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The name of the GSI firmware file relative to /lib/firmware */
|
/* The name of the GSI firmware file relative to /lib/firmware */
|
||||||
#define IPA_FWS_PATH "ipa_fws.mdt"
|
#define IPA_FW_PATH_DEFAULT "ipa_fws.mdt"
|
||||||
#define IPA_PAS_ID 15
|
#define IPA_PAS_ID 15
|
||||||
|
|
||||||
/* Shift of 19.2 MHz timestamp to achieve lower resolution timestamps */
|
/* Shift of 19.2 MHz timestamp to achieve lower resolution timestamps */
|
||||||
|
@ -517,6 +517,7 @@ static int ipa_firmware_load(struct device *dev)
|
||||||
struct device_node *node;
|
struct device_node *node;
|
||||||
struct resource res;
|
struct resource res;
|
||||||
phys_addr_t phys;
|
phys_addr_t phys;
|
||||||
|
const char *path;
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
void *virt;
|
void *virt;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -534,9 +535,17 @@ static int ipa_firmware_load(struct device *dev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = request_firmware(&fw, IPA_FWS_PATH, dev);
|
/* Use name from DTB if specified; use default for *any* error */
|
||||||
|
ret = of_property_read_string(dev->of_node, "firmware-name", &path);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "error %d requesting \"%s\"\n", ret, IPA_FWS_PATH);
|
dev_dbg(dev, "error %d getting \"firmware-name\" resource\n",
|
||||||
|
ret);
|
||||||
|
path = IPA_FW_PATH_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = request_firmware(&fw, path, dev);
|
||||||
|
if (ret) {
|
||||||
|
dev_err(dev, "error %d requesting \"%s\"\n", ret, path);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,13 +558,11 @@ static int ipa_firmware_load(struct device *dev)
|
||||||
goto out_release_firmware;
|
goto out_release_firmware;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = qcom_mdt_load(dev, fw, IPA_FWS_PATH, IPA_PAS_ID,
|
ret = qcom_mdt_load(dev, fw, path, IPA_PAS_ID, virt, phys, size, NULL);
|
||||||
virt, phys, size, NULL);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err(dev, "error %d loading \"%s\"\n", ret, IPA_FWS_PATH);
|
dev_err(dev, "error %d loading \"%s\"\n", ret, path);
|
||||||
else if ((ret = qcom_scm_pas_auth_and_reset(IPA_PAS_ID)))
|
else if ((ret = qcom_scm_pas_auth_and_reset(IPA_PAS_ID)))
|
||||||
dev_err(dev, "error %d authenticating \"%s\"\n", ret,
|
dev_err(dev, "error %d authenticating \"%s\"\n", ret, path);
|
||||||
IPA_FWS_PATH);
|
|
||||||
|
|
||||||
memunmap(virt);
|
memunmap(virt);
|
||||||
out_release_firmware:
|
out_release_firmware:
|
||||||
|
|
Loading…
Reference in New Issue