Commit graph

16 commits

Author SHA1 Message Date
Neil Armstrong
fdbd2fa400
soc: qcom: rpmh-rsc: add back __tcs_set_trigger() for SM8550/SM8650
The TCS writes has no effect after the removal of the __tcs_set_trigger()
call, obviously it seems the RSC version 3 requires it to complete the transactions.

Fixes: 80c5be164a ("soc: qcom: rpmh-rsc: drop unused multi-threading and non-active TCS support")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> # sm8250 rb5
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-09-06 10:47:46 +02:00
Caleb Connolly
a9cbf76e4d
soc: qcom: cmd-db: map cmd-db region
On at least SM8650 this region might not be included in the memory map.
Use the new mmu_map_region() helper to map it during bind().

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-09-06 10:47:46 +02:00
Caleb Connolly
75acc51189
soc: qcom: cmd-db: use strncmp() instead of memcmp()
memcmp() can cause aborts on some platforms and generally seems to be
the wrong approach here. Use strncmp() instead which is more correct.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-09-06 10:47:46 +02:00
Caleb Connolly
1384436dd8
soc: qcom: add build infrastructure
Add Kconfig / Makefiles to build rpmh and cmd-db drivers.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:11 +02:00
Caleb Connolly
c6112dd247
soc: qcom: rpmh: U-Boot API changes
Fix build errors, add some debug logging.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:11 +02:00
Caleb Connolly
a726ea1140
soc: qcom: rpmh: drop unused functions
A lot of the features in here are only relevant when running
multi-threaded with interrupts. Drop everything except what we need to
run single-threaded with a single TCS (which is all the rpmh-rsc
framework in U-Boot supports).

Keep rpmh_write_async() for simplicity and make it wrap the regular
rpmh_write().

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:11 +02:00
Caleb Connolly
e5218206ce
soc: qcom: rpmh: adjust headers for U-Boot
Drop unused/unsupported Linux headers and add dm/device.h for U-Boot.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:11 +02:00
Caleb Connolly
f55f7decdf
soc: qcom: rpmh-rsc: remaining U-Boot API changes
Minor adjustments to fix building with U-Boot and work correctly as a
synchronous driver without interrupts. RPMh is fast enough that we can
get away with just firing off requests and assuming they complete.

U-Boot behaviour changes are annotated with a "U-Boot:" comment.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:11 +02:00
Caleb Connolly
3f02b06fbc
soc: qcom: rpmh-rsc: adjust probe for U-Boot
Rework the rpmh-rsc initialization to use U-Boot's driver model and
initialize cmd-db.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:11 +02:00
Caleb Connolly
3b2f15f530
soc: qcom: rpmh-rsc: adjust headers for U-Boot
Remove unsupported / unused Linux headers and add those needed for
U-Boot.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:10 +02:00
Caleb Connolly
80c5be164a
soc: qcom: rpmh-rsc: drop unused multi-threading and non-active TCS support
Since U-Boot is single threaded, we can avoid most of the complexity
that comes with handling more than one in-flight TCS. Drop all the rpmh
code associated with multi-threading as we'll instead wait for a
response on each TCS.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:10 +02:00
Caleb Connolly
fb0fd32a4d
soc: qcom: cmd-db: adjust for U-Boot API
Keep the header pointer in the .data section so we don't initialize it
again after relocation, adjust cmd_db_get_header() to work with the
U-Boot API, and skip validating the header since all cmd-db users are
children of the rpmh-rsc and those children will only probe if cmd-db
initializes successfully.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:10 +02:00
Caleb Connolly
1a2df137aa
soc: qcom: cmd-db: adjust probe for U-Boot
Integrate cmd-db into the U-Boot driver model.

This is just a wrapper around an in-memory database, so we just need to
get the address and validate that cmd-db is there.

Since cmd_db_header will be stored in the .data section we can skip
bind if it's already set.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:10 +02:00
Caleb Connolly
bb991ab7a9
soc: qcom: cmd-db: drop unused functions
Due to our simpler rpmh-rsc driver and lack of debugfs, we don't need
quite a few cmd-db functions, just drop them.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:10 +02:00
Caleb Connolly
5f791b8118
soc: qcom: cmd-db: adjust headers for U-Boot
Replace unused/unsupported Linux headers with appropriate U-Boot
alternatives.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:10 +02:00
Caleb Connolly
6716e2211f
soc: qcom: import rpmh and cmd-db drivers from Linux
Import RPMh and cmd-db framework from Linux 6.10-rc6.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:10 +02:00