Skip to content

Enable SOF driver to support built-in mode #139

Closed

Description

@keyonjie

Currently SOF driver only support modular mode, but we have requirement to support built-in mode, the main gap currently is that rootfs may be unavailable yet during SOF driver loading stage.

Activity

  1. wenqingfu commented on Apr 1, 2019

    @wenqingfu

    Is this request still valid? If so, any idea can throw on the table?

  2. plbossart commented on Apr 1, 2019

    @plbossart
    Member

    I think it could be done by baking the firmware and topology files inside of the kernel, otherwise the dependency with the filesystem remains.

  3. keyonjie commented on Apr 2, 2019

    @keyonjie
    Author

    I initiated this with intention to reminding about trying to implement built-in driver support without built-in FW/tplg images using some retry(later) logic once request_firmware fails.

    As we have implemented runtime suspend/resume now, it's possible to do this retry in runtime resume, though it fails at the first boot with built-in driver(need keep pci driver working at this fails), @plbossart what do you think about this?

  4. plbossart commented on Apr 2, 2019

    @plbossart
    Member

    @keyonjie I don't think we should try this. We need to verify all the boot flows immediately, not rely on some sort of retry. In other implementations such as Edison where everything was built-in, the firmware was embedded in the kernel and that's an acceptable restriction to me.

  5. keyonjie commented on Apr 3, 2019

    @keyonjie
    Author

    OK, then let's close this item.

  6. plbossart commented on Apr 3, 2019

    @plbossart
    Member

    no, let's try with the firmware embedded in the kernel and close when it's verified.

  7. xiulipan commented on Apr 4, 2019

    @xiulipan

    @plbossart
    Then it may not be easy to try with the CI. It will need the firmware inside the kernel build folder. And the kernel config set to include the binaries.

    Maybe I can come up with some scripts to test it once a week. I will upload the scripts and the def-config to kconfig repo once I have done the test.

  8. added a commit that references this issue on May 4, 2020
  9. caseorum commented on Sep 19, 2020

    @caseorum

    Anecdotally, I can confirm success with both built-in FW/tplg and in the initramfs on bdw-rt5677 (samus).
    Kernel 5.9.0-rc5+ eb5f95f
    FW/tplg latest release v1.5.1

  10. paulstelian97 commented on Sep 21, 2020

    @paulstelian97

    NXP side (also anecdotal), we had used built in (with in-kernel-image firmware) as well (a while ago actually). A bit hacky but that's how we did it for a while. Had to do that because built-in SOF somehow loaded before the networked rootfs...

  11. keyonjie commented on Sep 21, 2020

    @keyonjie
    Author

    Thanks for trying this out @caseorum and @paulstelian97. @lyakh FYI.

  12. dbaluta commented on Sep 21, 2020

    @dbaluta
    Collaborator

    I wonder if there's a de facto solution for having builtin modules which load the firmware from rootfs (to avoid building the firmware inside the kernel image).
    When we tried this solution loading the firmware always failed because the rootfs wasn't available at that time.

  13. lyakh commented on Sep 21, 2020

    @lyakh
    Collaborator

    I wonder if there's a de facto solution for having builtin modules which load the firmware from rootfs (to avoid building the firmware inside the kernel image).

    @dbaluta As mentioned in https://www.kernel.org/doc/html/latest/driver-api/firmware/direct-fs-lookup.html#firmware-and-initramfs

    using a userspace fallback mechanism is currently the only viable solution as only userspace can know for sure when the real rootfs is ready and mounted.

  14. paulstelian97 commented on Sep 21, 2020

    @paulstelian97

    I wonder if there's a de facto solution for having builtin modules which load the firmware from rootfs (to avoid building the firmware inside the kernel image).

    @dbaluta As mentioned in https://www.kernel.org/doc/html/latest/driver-api/firmware/direct-fs-lookup.html#firmware-and-initramfs

    using a userspace fallback mechanism is currently the only viable solution as only userspace can know for sure when the real rootfs is ready and mounted.

    Problem with that is that a weird cyclic dependency happens that prevents the rootfs from ever mounting (nfsroot comes after sof for some reason?).

    Also AFAICT we at NXP do not use any initramfs at all.

  15. added a commit that references this issue on May 6, 2021
  16. plbossart commented on Jun 10, 2021

    @plbossart
    Member

    let's close this, there are existing solutions and no real new development needed.

  17. marc-hb commented on Jun 22, 2021

    @marc-hb
    Collaborator

    Some references.

    This problem is not specific to audio and there are security aspects:
    http://lkml.iu.edu/hypermail/linux/kernel/1508.1/03428.html

    Note not every device has the simple concept of "one rootfs".

    ChromeOS had a generic workaround for a long time:
    https://chromium-review.googlesource.com/q/system_running
    ... which has been NACKed upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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