Skip to content

[FEATURE][Zephyr] Clarify expectations of platform.h for Zephyr SOF builds #7248

@kv2019i

Description

@kv2019i

Levelling up from #5602

Is your feature request related to a problem? Please describe.
The platform.h has three interfaces:

int platform_boot_complete(uint32_t boot_message);
int platform_init(struct sof *sof);
int platform_context_save(struct sof *sof);

Plus a set of capability definitions used by application code (like PLATFORM_MAX_CHANNELS). These need to be defined by each platform via platform.h.

Documented here: https://github.com/thesofproject/sof/blob/main/src/include/sof/platform.h

Now we have three types of platforms implemented in SOF main (2023/March situation):

  • native Zephyr, can only be built with Zephyr (e.g. platform/intel/ace)
  • native XTOS, can be only built with XTOS (e.g. platform/mtk8186)
  • hybrid that can be built with either Zephyr or XTOS (e.g. platform/intel/cavs and platform/imx8)

Describe the solution you'd like
Clear definition of semantics of platform.h expected for native Zephyr platforms. Based on experience with intel/ace , there is still need for a thin platform layer.

As XTOS does not have its own platform layer, SOF platform.h will need to continue to serve as the platform layer as long as SOF main supports XTOS builds.

Describe alternatives you've considered

  • removal of platform layer completely and make it XTOS only interface
    - this is still a possibility but hard to do unless all platforms move to native Zephyr
    - a new solution would be needed for e.g. intel/ace/platform.c
  • split out "platfrom-capability.h" that only exports platform.h interfaces needed by src/audio/
    - on Zephyr this can be a thin mapping to DTS information (and possibly shared across platforms)
    - this would allow to clean up code for hybrid platforms that continue to support both Zephyr and XTOS builds (versus the current ifdef ZEPHYR mess we have now in some of the platform files)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions