This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6442: PCI Express Add-in Card

Part Number: AM6442

Hello experts,

I want to develop a PCI Express Add-in Card using AM6442.

 *Enabling PCI Express End Point Mode on AM6442

The AM6442 needs to complete initialization early so it can respond to the BIOS initialization of the attached PC.

 *Typically a second or two after power is stabled.

Please give me advice on how to boot, media to use, core to use, etc.

Best regards

Mitsuhiko

  • Hi Mitsuhiko,

    I have assigned your query to our expert. He is currently out for holidays, so expect a response after Jan 3rd. 

    Best Regards,

    Suren

  • Hi Suren,

    Thank you very much for kind reply.

    I look forward to hearing from your expert.

    Best Regards,

    Mitsuhiko

  • Hi Kurata-san,

    Sorry for my late response.

    Linux supports PCIe EP mode on AM6442. I think Linux can be optimized to boot within a few seconds, but under a second would be a challenge.

    AM6442 supports multiple boot media, detailed in the TRM initialization chapter. eMMC or OSPI is commonly used.

  • Hi Bin,

    Thank you very much for kind reply.

    I would consider booting from eMMC or OSPI.
    Do you have sample source code or an execution example?

    # I want to control RU_ICSSG communication (another core:Linux) from PCIe.

    Best Regards,

    Mitsuhiko

  • Hi Bin,

    Thank you for your prompt reply.

    I'd like to know more details.

    Is the order of operations as follows?

    1. Boot the RTOS from eMMC or OSPI to initialize the PCIe portion(EP mode).
        *Typically a second or two after power is stabled.
    2. Boot Linux on another core and allow RU_ICSSG to be controlled from PCIe.

    Where can I find documentation on how to do this?

    Best Regards,

    Mitsuhiko

  • Hi Krurata-san,

    Not exactly. You don't need to run two OS, all of the PCIe EP and PRU_ICSSG program can run on either Linux on A53 or RTOS on R5, of cause, plus the PRU firmware to run on the PRU_ICSSG cores. You just use a single program to implement the PCIe function which also communicate with the PRU firmware.

    However, currently the PCIe support on RTOS is limited, so Linux is perfered on this use case.

  • Hi Bin,

    Thank you very much for kind reply.

    I found Linux to be a good choice for this use case.

    A points to work on:
     The AM6442 needs to complete initialization early so it can respond to the BIOS initialization of the attached PC.
      *Typically a second or two after power is stabled.

    Initialization of PCIe EP mode must be completed before access from BIOS.
    Can the U-Boot load complete PCIe EP mode initialization?

    Please let me know if you know of any better way/method than the mentioned above.

    Best Regards,

    Mitsuhiko

  • Hi Kurata-san,

    As I mentioned in my first response above, the boot time requirement would be a challenge in this project.

    - You could implement PCIe EP in U-Boot, but would have to add PRU_ICSSG handling in U-Boot as well, which includes loading PRU firmware and communicating with PRU. And I am still not comfortable this will meet the BIOS init timing requirement;

    - Or you could implement PCIe EP + PRU routine in Linux which already has most of the infrastructures, and optimize U-Boot to run quicker. Still, the challenge is boot time.

  • Hi Bin,

    Thank you very much for kind reply.

    The important point.

    The BIOS initialization process is to detect PCI devices,
    receive requests for resources from PCI devices, and configure resources.

    As long as the PCIe EP mode is ready to respond to the BIOS initialization process,
    it doesn't matter if the rest of the initialization hasn't completed yet.

    Please advise if there is a better way.

    Best Regards,

    Mitsuhiko

  • Hi Kurata-san,

    If you want to just add PCIe EP in u-boot for BIOS init but leave PCIe EP and PRU communication in Linux, you have to keep in mind that kernel PCIe driver will re-initialize PCIe module again after kernel is running. I am not sure if this would affect the host OS using PCIe. Not to mention you have to ensure kernel PCIe init will present the same PCIe EP interface to the host as that u-boot does, what about the kernel PCIe re-init timing, what if host OS is already accessing PCIe EP while kernel is still booting then PCIe EP is re-initialized?

  • Hi Bin,

    Thank you very much for kind reply.

    For normal host PC.
    ・PCIe initialization by host PC BIOS
    1-2 seconds after the power supply stabilizes.
    (PCI device search, resource claim, base address setting, command register setting, etc.)
    ・The OS of the host PC boots and accesses the PCIe device
    10 seconds or more after the power has stabilized.
    (Start controlling PCIe device by host PC)

    Initialization of the Linux kernel must be completed before the OS of the host PC boots.

    If the setting value of the PCI configuration register initialized by the BIOS of the host PC can be retained even when PCIeEP is initialized by Linux kernel, the host PC will not be affected, but once it is initialized, it will not work.

    When the Linux kernel PCIe driver reinitializes the PCIeEP module, is there a way to set the PCI configuration register to the values initialized by the host PC?

    Best Regards,

    Mitsuhiko

  • Hi Kurata-san,

    ・The OS of the host PC boots and accesses the PCIe device
    10 seconds or more after the power has stabilized.
    (Start controlling PCIe device by host PC)

    If you have control of the timing of the host PC accessing the PCIe device, I think this solution is feasible.

    When the Linux kernel PCIe driver reinitializes the PCIeEP module, is there a way to set the PCI configuration register to the values initialized by the host PC?

    Though we never tried this, since it is you implementing the PCIe EP code in both u-boot and kernel, I think you can make the BAR info identical.

    However please keep in mind that I am not aware of any implementation of such solution, I am not sure if there is any caveat that we haven't thought about it.

  • Hi Bin,

    Thank you very much for your prompt reply.

    We will check the operation.

    If you have sample code to implement PCIe EP code in U-Boot,
    please let me know.


    Best Regards,

    Mitsuhiko

  • Hi Kurata-san,

    The U-Boot has PCIe and EP implementation, please see the source drivers/PCIe/ and drivers/pci_endpoint/ folders.

    The U-Boot PCIe-EP function is not validated on AM64x though, not sure if there is any details missing.

  • Hi Bin,

    Thank you very much for kind reply.

    I'll give it a try.

    I appreciate your advise.

    Best Regards,

    Mitsuhiko