[PATCH 0/2] Minor misc. cleanups for TI K3 SoCs

Hi Lokesh,
The following are two minor cleanups/fixes that I ran into while doing some development work on a newer SoC due to different Kconfig symbols.
Following is the patch summary: - Patch #1 makes the ti_sci_protocol.h self-contained when CONFIG_TI_SCI_PROTOCOL is not defined. - Patch #2 defines a release_resources_for_core_shutdown() stub. This function is used in the common code, but yet is expected to be implemented in a SoC-specific source file.
regards Suman
Suman Anna (2): firmware: ti_sci: Include linux/err.h in ti_sci_protocol.h arm: mach-k3: common: Add a release_resources_for_core_shutdown() stub
arch/arm/mach-k3/common.c | 5 +++++ include/linux/soc/ti/ti_sci_protocol.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-)

The common TI SCI header file uses some macros from err.h and these get exercised when CONFIG_TI_SCI_PROTOCOL is not defined. Include the linux/err.h header file in this header file directly rather than relying on source files to include it to eliminate any potential build errors.
While at this, reorder the existing header file include to the beginning of the file.
Signed-off-by: Suman Anna s-anna@ti.com --- include/linux/soc/ti/ti_sci_protocol.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h index 794737923cf1..7f9941894cdf 100644 --- a/include/linux/soc/ti/ti_sci_protocol.h +++ b/include/linux/soc/ti/ti_sci_protocol.h @@ -11,6 +11,9 @@ #ifndef __TISCI_PROTOCOL_H #define __TISCI_PROTOCOL_H
+#include <linux/bitops.h> +#include <linux/err.h> + /** * struct ti_sci_version_info - version information structure * @abi_major: Major ABI version. Change here implies risk of backward @@ -20,7 +23,6 @@ * @firmware_revision: Firmware revision (not usually used). * @firmware_description: Firmware description (not usually used). */ -#include <linux/bitops.h> struct ti_sci_version_info { u8 abi_major; u8 abi_minor;

On 18:24-20210727, Suman Anna wrote:
The common TI SCI header file uses some macros from err.h and these get exercised when CONFIG_TI_SCI_PROTOCOL is not defined. Include the linux/err.h header file in this header file directly rather than relying on source files to include it to eliminate any potential build errors.
While at this, reorder the existing header file include to the beginning of the file.
Signed-off-by: Suman Anna s-anna@ti.com
include/linux/soc/ti/ti_sci_protocol.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h index 794737923cf1..7f9941894cdf 100644 --- a/include/linux/soc/ti/ti_sci_protocol.h +++ b/include/linux/soc/ti/ti_sci_protocol.h @@ -11,6 +11,9 @@ #ifndef __TISCI_PROTOCOL_H #define __TISCI_PROTOCOL_H
+#include <linux/bitops.h> +#include <linux/err.h>
/**
- struct ti_sci_version_info - version information structure
- @abi_major: Major ABI version. Change here implies risk of backward
@@ -20,7 +23,6 @@
- @firmware_revision: Firmware revision (not usually used).
- @firmware_description: Firmware description (not usually used).
*/ -#include <linux/bitops.h> struct ti_sci_version_info { u8 abi_major; u8 abi_minor;
Reviewed-by: Nishanth Menon nm@ti.com

On Tue, Jul 27, 2021 at 06:24:39PM -0500, Suman Anna wrote:
The common TI SCI header file uses some macros from err.h and these get exercised when CONFIG_TI_SCI_PROTOCOL is not defined. Include the linux/err.h header file in this header file directly rather than relying on source files to include it to eliminate any potential build errors.
While at this, reorder the existing header file include to the beginning of the file.
Signed-off-by: Suman Anna s-anna@ti.com Reviewed-by: Nishanth Menon nm@ti.com
Applied to u-boot/master, thanks!

Add a weak release_resources_for_core_shutdown() stub implementation that can be overridden by actual implementation if a SoC supports that function.
Signed-off-by: Suman Anna s-anna@ti.com --- arch/arm/mach-k3/common.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index bb0f64194f4e..08b7344df749 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -193,6 +193,11 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr) } #endif
+__weak void release_resources_for_core_shutdown(void) +{ + debug("%s not implemented...\n", __func__); +} + void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) { typedef void __noreturn (*image_entry_noargs_t)(void);

On 18:24-20210727, Suman Anna wrote:
Add a weak release_resources_for_core_shutdown() stub implementation that can be overridden by actual implementation if a SoC supports that function.
Signed-off-by: Suman Anna s-anna@ti.com
arch/arm/mach-k3/common.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index bb0f64194f4e..08b7344df749 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -193,6 +193,11 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr) } #endif
+__weak void release_resources_for_core_shutdown(void) +{
- debug("%s not implemented...\n", __func__);
+}
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) { typedef void __noreturn (*image_entry_noargs_t)(void);
Reviewed-by: Nishanth Menon nm@ti.com

On Tue, Jul 27, 2021 at 06:24:40PM -0500, Suman Anna wrote:
Add a weak release_resources_for_core_shutdown() stub implementation that can be overridden by actual implementation if a SoC supports that function.
Signed-off-by: Suman Anna s-anna@ti.com Reviewed-by: Nishanth Menon nm@ti.com
Applied to u-boot/master, thanks!
participants (3)
-
Nishanth Menon
-
Suman Anna
-
Tom Rini