Re: Reg: Enable arc to access the spi controller on I/O fabric on C1000

Michael Rosen

1. I have declared CONFIG_SPI in the prj.conf for the ARC project and SPI access is working.
Can I declare the CONFIG_ SPI on the prj.conf on the X86 also ?
My query is simultaneous SPI access is possible via ARC and X86 ? or should we declare CONFIG_SPI in any one of the cores only.
You can, just be aware that there isn't any builtin mutual exclusion between the x86 and ARC cores in the OS, so if both cores are trying to access the same SPI controller, there will likely be concurrency issues. But it should be perfectly fine to use SPI0 from x86 and SPI1 from ARC (just be aware there still might be issues if you attempt to clock gate the controllers from both cores). Just be sure to disable the SPI controller you aren't using on the core that isn't using it or the interrupt routing will break things (wrong core responding to the interrupt).





2. After reset of C1000, the code in the ARC is getting executed first, Followed by x86 .
By default can I make some settings to delay the execution of ARC code  other than task_sleep ?
You can make sure ARC starts later if you modify the following file (unfortunately, the option isn't Kconfig'able):

And modify the priority under SYS_INIT to be later. However, if you want it to happen AFTER the x86 application starts, youll need to still modify that file to remove the SYS_INIT and add this to your application:

extern int _arc_init(struct dev* arg);

// use in app like so
// if (_arc_init(NULL)) {
// printk("ARC initialization failed!\n");
// }

Its pretty ugly, but functional. You will still need CONFIG_ARC_INIT=y to build the _arc_init function.


Join to automatically receive all group messages.