<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/firmware/ti_sci.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>firmware: ti_sci: Fix memory leaks in devm_ti_sci_get_of_resource</title>
<updated>2025-12-05T22:23:49+00:00</updated>
<author>
<name>Francois Berder</name>
<email>fberder@outlook.fr</email>
</author>
<published>2025-11-11T10:30:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=00e1fed93c8c3e4c9037741ea1b70a9e693a6e65'/>
<id>00e1fed93c8c3e4c9037741ea1b70a9e693a6e65</id>
<content type='text'>
- Fix temp memory leak
- Free memory during error handling

Signed-off-by: Francois Berder &lt;fberder@outlook.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Fix temp memory leak
- Free memory during error handling

Signed-off-by: Francois Berder &lt;fberder@outlook.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ti_sci: Pointer is never assigned to valid value</title>
<updated>2025-10-16T21:02:14+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-10-08T09:23:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5b9125746dfde0a29911ccd542801da6b8f94239'/>
<id>5b9125746dfde0a29911ccd542801da6b8f94239</id>
<content type='text'>
The pointer resp is declared but never assigned a value but is then
dereferenced. Fix this by assigning the pointer to the message buffer.

This issue was found by Smatch.

Reviewed-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The pointer resp is declared but never assigned a value but is then
dereferenced. Fix this by assigning the pointer to the message buffer.

This issue was found by Smatch.

Reviewed-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ti_sci: Provide error code on error exit</title>
<updated>2025-10-16T21:02:14+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-10-08T09:23:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4602fa92202388665ddfbb622f001d62b1473a08'/>
<id>4602fa92202388665ddfbb622f001d62b1473a08</id>
<content type='text'>
In ti_sci_get_response the check for message sequence will return ret
on a fail but ret will be 0 at that point. Instead return -EINVAL.
Also change dev_dbg call to dev_err to be consistent with other error
detection code in the same function.

This issue was found by Smatch.

Reviewed-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In ti_sci_get_response the check for message sequence will return ret
on a fail but ret will be 0 at that point. Instead return -EINVAL.
Also change dev_dbg call to dev_err to be consistent with other error
detection code in the same function.

This issue was found by Smatch.

Reviewed-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ti_sci: Prevent memory leak</title>
<updated>2025-10-16T21:02:14+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-10-08T09:23:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4b8bc5af80f1637cd71a1b6a0dffa7588a03f27c'/>
<id>4b8bc5af80f1637cd71a1b6a0dffa7588a03f27c</id>
<content type='text'>
temp is assigned the pointer returned by malloc which is used without a
NULL check and then never freed. Add a NULL check and ensure temp is
freed on all return paths.

This issue was found by Smatch.

Reviewed-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
temp is assigned the pointer returned by malloc which is used without a
NULL check and then never freed. Add a NULL check and ensure temp is
freed on all return paths.

This issue was found by Smatch.

Reviewed-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: ti_sci.c: Add a function to request DM metadata using ti_sci* calls</title>
<updated>2025-06-18T18:20:25+00:00</updated>
<author>
<name>Moteen Shah</name>
<email>m-shah@ti.com</email>
</author>
<published>2025-06-09T08:14:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=60ee94585565bbfde4c828a9f464d9c4be5f041f'/>
<id>60ee94585565bbfde4c828a9f464d9c4be5f041f</id>
<content type='text'>
Add a function to retrieve information of the DM firmware's ABI versions,
RM/PM HAL, firmware version, etc using TI_SCI protocol.

Signed-off-by: Moteen Shah &lt;m-shah@ti.com&gt;
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a function to retrieve information of the DM firmware's ABI versions,
RM/PM HAL, firmware version, etc using TI_SCI protocol.

Signed-off-by: Moteen Shah &lt;m-shah@ti.com&gt;
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: ti_sci.c: Add a function to query DM firmware's capability</title>
<updated>2025-06-18T18:20:25+00:00</updated>
<author>
<name>Moteen Shah</name>
<email>m-shah@ti.com</email>
</author>
<published>2025-06-09T08:14:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e1252194b622284ed941c83e55a2277c061e5a95'/>
<id>e1252194b622284ed941c83e55a2277c061e5a95</id>
<content type='text'>
Add a new function to query the capabilities of the DM firmware, using
TI SCI protocol to retrieve a 64-bit firmware capability, where each bit
represents a specific capability supported by the firmware.

Signed-off-by: Moteen Shah &lt;m-shah@ti.com&gt;
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new function to query the capabilities of the DM firmware, using
TI SCI protocol to retrieve a 64-bit firmware capability, where each bit
represents a specific capability supported by the firmware.

Signed-off-by: Moteen Shah &lt;m-shah@ti.com&gt;
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: ti_sci: Add Initialization of dev_info head node</title>
<updated>2025-05-05T20:18:59+00:00</updated>
<author>
<name>Udit Kumar</name>
<email>u-kumar1@ti.com</email>
</author>
<published>2025-04-29T17:14:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1c26f91a224b7ce222314b38c068acd1833599f4'/>
<id>1c26f91a224b7ce222314b38c068acd1833599f4</id>
<content type='text'>
On K3 devices two drivers ti_sci and ti_sci_dm are supporting firmware
functions. At run time one of driver is used.

Driver ti_sci already initializing head for dev_list in its probe
function, but it was missed in ti_sci_dm driver.

So add head list init support for ti_sci_dm driver.
While at this, move init of list before usages in both functions.

Fixes: 5d5a699855a7("firmware: ti_sci: Add support for Resoure Management at R5 SPL stage")
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
Signed-off-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On K3 devices two drivers ti_sci and ti_sci_dm are supporting firmware
functions. At run time one of driver is used.

Driver ti_sci already initializing head for dev_list in its probe
function, but it was missed in ti_sci_dm driver.

So add head list init support for ti_sci_dm driver.
While at this, move init of list before usages in both functions.

Fixes: 5d5a699855a7("firmware: ti_sci: Add support for Resoure Management at R5 SPL stage")
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
Signed-off-by: Udit Kumar &lt;u-kumar1@ti.com&gt;
Reviewed-by: Nishanth Menon &lt;nm@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: ti_sci: Scan all device instances when releasing exclusive devices</title>
<updated>2025-04-14T22:59:52+00:00</updated>
<author>
<name>Nishanth Menon</name>
<email>nm@ti.com</email>
</author>
<published>2025-04-07T12:15:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cce329426f61ad9c42775128d2c995ccd2ebdcfc'/>
<id>cce329426f61ad9c42775128d2c995ccd2ebdcfc</id>
<content type='text'>
When FIT image with multiple dtbs are involved for R5 boot process,
R5 SPL starts off with the first instance of dtb to probe the
eeprom, then once we have identified the type of board, invocation
of setup_multi_dtb_fit will replace the gd-&gt;fdt_blob with the proper
board dtb match. However, when we do this, two things happen:

a) Prior to the invocation of setup_multi_dtb_fit, as part of the eeprom
   discovery process, i2c controller device is already probed and marked
   as exclusive with the match of the very first tisci match (from the
   original boot dtb). This list is stored in the info-&gt;dev_list of the
   first probe.
b) When the second dtb is loaded, tisci is probed again (since this is a
   new node) and the new info-&gt;dev_list is empty.

At this stage, the exclusive devices such as i2c instances used to
probe the board information is left in the old info-&gt;dev_list that is
no longer used actively by the system using the replaced dtb.

As a result of this, the cleanup we intend to do with
ti_sci_cmd_release_exclusive_devices is no longer complete and
leaves the instances such as i2c for eeprom marked used as we scan just
the new info-&gt;dev_list.

This creates a problem when Device Manager(DM) firmware starts up later
on in the boot process and identifies that this instance of i2c is
already marked active, so it assumes this can no longer be controlled
by software and is marked internally as reserved and HLOS can no
longer control these instances. This defeated the purpose of
ti_sci_cmd_release_exclusive_devices.

NOTE: This scheme works just fine if the FIT has just a single dtb as
the info-&gt;dev_list is upto date.

To fix this, let us make ti_sci_cmd_release_exclusive_devices scan the
all registrations of tisci instances and cleanup all exclusive devices
that have ever been registered.

As part of this, change the prototype of release_exclusive_devices to
drop the handle since that has no further meaning now.

Though this issue was identified on AM64-sk, this can be present in
other builds which use multi-fit-dtb for R5 SPL startup.

Fixes: 9566b777ae0a ("firmware: ti_sci: Add a command for releasing all exclusive devices")
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When FIT image with multiple dtbs are involved for R5 boot process,
R5 SPL starts off with the first instance of dtb to probe the
eeprom, then once we have identified the type of board, invocation
of setup_multi_dtb_fit will replace the gd-&gt;fdt_blob with the proper
board dtb match. However, when we do this, two things happen:

a) Prior to the invocation of setup_multi_dtb_fit, as part of the eeprom
   discovery process, i2c controller device is already probed and marked
   as exclusive with the match of the very first tisci match (from the
   original boot dtb). This list is stored in the info-&gt;dev_list of the
   first probe.
b) When the second dtb is loaded, tisci is probed again (since this is a
   new node) and the new info-&gt;dev_list is empty.

At this stage, the exclusive devices such as i2c instances used to
probe the board information is left in the old info-&gt;dev_list that is
no longer used actively by the system using the replaced dtb.

As a result of this, the cleanup we intend to do with
ti_sci_cmd_release_exclusive_devices is no longer complete and
leaves the instances such as i2c for eeprom marked used as we scan just
the new info-&gt;dev_list.

This creates a problem when Device Manager(DM) firmware starts up later
on in the boot process and identifies that this instance of i2c is
already marked active, so it assumes this can no longer be controlled
by software and is marked internally as reserved and HLOS can no
longer control these instances. This defeated the purpose of
ti_sci_cmd_release_exclusive_devices.

NOTE: This scheme works just fine if the FIT has just a single dtb as
the info-&gt;dev_list is upto date.

To fix this, let us make ti_sci_cmd_release_exclusive_devices scan the
all registrations of tisci instances and cleanup all exclusive devices
that have ever been registered.

As part of this, change the prototype of release_exclusive_devices to
drop the handle since that has no further meaning now.

Though this issue was identified on AM64-sk, this can be present in
other builds which use multi-fit-dtb for R5 SPL startup.

Fixes: 9566b777ae0a ("firmware: ti_sci: Add a command for releasing all exclusive devices")
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Reviewed-by: Neha Malcom Francis &lt;n-francis@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers: firmware: ti_sci: Add DM_FLAG_PRE_RELOC to driver</title>
<updated>2024-12-31T23:55:02+00:00</updated>
<author>
<name>Manorit Chawdhry</name>
<email>m-chawdhry@ti.com</email>
</author>
<published>2024-12-17T08:54:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=998e00cfcedf22a19efbde116f4a9bb1bdd775f7'/>
<id>998e00cfcedf22a19efbde116f4a9bb1bdd775f7</id>
<content type='text'>
Currently the driver relies on bootph flag to probe it during PRE_RELOC
stage but with the upcoming cleanup of v6.13, we don't have the bootph
property in the parent nodes anymore and ti_sci driver being one of the
parent nodes required during SPL stage would end up hampering the probe
model [0].

Add DM_FLAG_PRE_RELOC to ti_sci driver for mitigating this issue.

[0]: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/21

Suggested-by: Vignesh Raghavendra &lt;vigneshr@ti.com&gt;
Signed-off-by: Manorit Chawdhry &lt;m-chawdhry@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the driver relies on bootph flag to probe it during PRE_RELOC
stage but with the upcoming cleanup of v6.13, we don't have the bootph
property in the parent nodes anymore and ti_sci driver being one of the
parent nodes required during SPL stage would end up hampering the probe
model [0].

Add DM_FLAG_PRE_RELOC to ti_sci driver for mitigating this issue.

[0]: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/21

Suggested-by: Vignesh Raghavendra &lt;vigneshr@ti.com&gt;
Signed-off-by: Manorit Chawdhry &lt;m-chawdhry@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: ti_sci: Add No-OP for "RX_FL_CFG"</title>
<updated>2024-08-30T19:57:39+00:00</updated>
<author>
<name>Kishon Vijay Abraham I</name>
<email>kishon@ti.com</email>
</author>
<published>2024-08-26T10:25:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=48ea3107715a91bb9b90bfbb17343346ec9fd86a'/>
<id>48ea3107715a91bb9b90bfbb17343346ec9fd86a</id>
<content type='text'>
RX_FL_CFG message should not be forwarded to TIFS and should be
handled within R5 SPL (when DM services are not available). Add
a no-op function to not handle RX_FL_CFG messages.

Reviewed-by: Alexander Sverdlin &lt;alexander.sverdlin@siemens.com&gt;
Signed-off-by: Kishon Vijay Abraham I &lt;kishon@ti.com&gt;
Signed-off-by: Siddharth Vadapalli &lt;s-vadapalli@ti.com&gt;
Signed-off-by: Chintan Vankar &lt;c-vankar@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RX_FL_CFG message should not be forwarded to TIFS and should be
handled within R5 SPL (when DM services are not available). Add
a no-op function to not handle RX_FL_CFG messages.

Reviewed-by: Alexander Sverdlin &lt;alexander.sverdlin@siemens.com&gt;
Signed-off-by: Kishon Vijay Abraham I &lt;kishon@ti.com&gt;
Signed-off-by: Siddharth Vadapalli &lt;s-vadapalli@ti.com&gt;
Signed-off-by: Chintan Vankar &lt;c-vankar@ti.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
