[UK OFFICIAL] RCC Platform specific changes to the OpenCPI Driver

WD
Walters Dominic A
Thu, Feb 27, 2020 4:25 PM

Classification: UK OFFICIAL

Hi,

I am attempting to pull a BSP and its RCC platform out of an OpenCPI installation that it was implemented in.
As part of work done to get the RCC platform to function correctly, changes had to be made to the OpenCPI linux driver as well as two files in the runtime/hdl directory.
I think these changes, as they currently stand, prevent the OpenCPI driver from being used with any other BSP as they make memory and axi changes that are specific to the configuration of the platform.

Is there a currently accepted/preferred/possible way to make platform specific (not ARCH specific) changes to opencpi.c (specifically the _init and get_dma_memory functions) and other core driver files, such that it won't affect other platforms?
Ideally, this would not involve adding a "CONFIG
" define in the KConfig for the Kernel, although I'm not opposed to doing that as these changes were essentially made necessary by a Kernel incompatibility.
For example, is there a way for me to add a "#define" for the platform, perhaps in my rcc/platforms/<plat-name>/<plat-name>.mk file that can then be referenced in the driver source code?
Other places where I need to add changes are throughout "runtime/hdl/include/HdlZynq.h" and in the init function within "runtime/hdl/src/HdlBusDriver.cxx".

Thanks for any advice you can give,
Dominic Walters

"This e-mail and any attachment(s) is intended for the recipient only.  Its unauthorised use,
disclosure, storage or copying is not permitted.  Communications with Dstl are monitored and/or
recorded for system efficiency and other lawful purposes, including business intelligence, business
metrics and training.  Any views or opinions expressed in this e-mail do not necessarily reflect Dstl policy."

"If you are not the intended recipient, please remove it from your system and notify the author of
the email and centralenq@dstl.gov.uk"

Classification: UK OFFICIAL Hi, I am attempting to pull a BSP and its RCC platform out of an OpenCPI installation that it was implemented in. As part of work done to get the RCC platform to function correctly, changes had to be made to the OpenCPI linux driver as well as two files in the runtime/hdl directory. I think these changes, as they currently stand, prevent the OpenCPI driver from being used with any other BSP as they make memory and axi changes that are specific to the configuration of the platform. Is there a currently accepted/preferred/possible way to make platform specific (not ARCH specific) changes to opencpi.c (specifically the __init and get_dma_memory functions) and other core driver files, such that it won't affect other platforms? Ideally, this would not involve adding a "CONFIG_" define in the KConfig for the Kernel, although I'm not opposed to doing that as these changes were essentially made necessary by a Kernel incompatibility. For example, is there a way for me to add a "#define" for the platform, perhaps in my rcc/platforms/<plat-name>/<plat-name>.mk file that can then be referenced in the driver source code? Other places where I need to add changes are throughout "runtime/hdl/include/HdlZynq.h" and in the init function within "runtime/hdl/src/HdlBusDriver.cxx". Thanks for any advice you can give, Dominic Walters "This e-mail and any attachment(s) is intended for the recipient only. Its unauthorised use, disclosure, storage or copying is not permitted. Communications with Dstl are monitored and/or recorded for system efficiency and other lawful purposes, including business intelligence, business metrics and training. Any views or opinions expressed in this e-mail do not necessarily reflect Dstl policy." "If you are not the intended recipient, please remove it from your system and notify the author of the email and centralenq@dstl.gov.uk"
JK
James Kulp
Thu, Feb 27, 2020 5:34 PM

Hi Dominic,

The quick answer is that the framework code in the areas you are
touching are not yet amenable to the customizations you have done if
they cannot be made in a way that is conditionalized.

For the kernel driver, if there are not any preprocessor symbols in
the non-standard kernel you are using, you need your own fork.

It would definitely be relatively easy to make available some of our
preprocessor symbols found in the ocpi-config.h file (a user mode file),
such as OCPI_PLATFORM, when building the kernel.
I presume you are using a custom RCC platform?   That is what the kernel
compilation is associated with.

As far as the runtime/hdl files, we are definitely aware of a need for
plugins there, but at present there are none.
Again if you have a custom RCC platform, you could conditionalize your
code based on that, until the plugins are ready.

Jim

On 2/27/20 11:25 AM, Walters Dominic A via discuss wrote:

Classification: UK OFFICIAL

Hi,

I am attempting to pull a BSP and its RCC platform out of an OpenCPI installation that it was implemented in.
As part of work done to get the RCC platform to function correctly, changes had to be made to the OpenCPI linux driver as well as two files in the runtime/hdl directory.
I think these changes, as they currently stand, prevent the OpenCPI driver from being used with any other BSP as they make memory and axi changes that are specific to the configuration of the platform.

Is there a currently accepted/preferred/possible way to make platform specific (not ARCH specific) changes to opencpi.c (specifically the _init and get_dma_memory functions) and other core driver files, such that it won't affect other platforms?
Ideally, this would not involve adding a "CONFIG
" define in the KConfig for the Kernel, although I'm not opposed to doing that as these changes were essentially made necessary by a Kernel incompatibility.
For example, is there a way for me to add a "#define" for the platform, perhaps in my rcc/platforms/<plat-name>/<plat-name>.mk file that can then be referenced in the driver source code?
Other places where I need to add changes are throughout "runtime/hdl/include/HdlZynq.h" and in the init function within "runtime/hdl/src/HdlBusDriver.cxx".

Thanks for any advice you can give,
Dominic Walters

"This e-mail and any attachment(s) is intended for the recipient only.  Its unauthorised use,
disclosure, storage or copying is not permitted.  Communications with Dstl are monitored and/or
recorded for system efficiency and other lawful purposes, including business intelligence, business
metrics and training.  Any views or opinions expressed in this e-mail do not necessarily reflect Dstl policy."

"If you are not the intended recipient, please remove it from your system and notify the author of
the email and centralenq@dstl.gov.uk"

Hi Dominic, The quick answer is that the framework code in the areas you are touching are not yet amenable to the customizations you have done if they cannot be made in a way that is conditionalized. For the kernel driver, if there are not *any* preprocessor symbols in the non-standard kernel you are using, you need your own fork. It would definitely be relatively easy to make available some of our preprocessor symbols found in the ocpi-config.h file (a user mode file), such as OCPI_PLATFORM, when building the kernel. I presume you are using a custom RCC platform?   That is what the kernel compilation is associated with. As far as the runtime/hdl files, we are definitely aware of a need for plugins there, but at present there are none. Again if you have a custom RCC platform, you could conditionalize your code based on that, until the plugins are ready. Jim On 2/27/20 11:25 AM, Walters Dominic A via discuss wrote: > Classification: UK OFFICIAL > > > Hi, > > I am attempting to pull a BSP and its RCC platform out of an OpenCPI installation that it was implemented in. > As part of work done to get the RCC platform to function correctly, changes had to be made to the OpenCPI linux driver as well as two files in the runtime/hdl directory. > I think these changes, as they currently stand, prevent the OpenCPI driver from being used with any other BSP as they make memory and axi changes that are specific to the configuration of the platform. > > Is there a currently accepted/preferred/possible way to make platform specific (not ARCH specific) changes to opencpi.c (specifically the __init and get_dma_memory functions) and other core driver files, such that it won't affect other platforms? > Ideally, this would not involve adding a "CONFIG_" define in the KConfig for the Kernel, although I'm not opposed to doing that as these changes were essentially made necessary by a Kernel incompatibility. > For example, is there a way for me to add a "#define" for the platform, perhaps in my rcc/platforms/<plat-name>/<plat-name>.mk file that can then be referenced in the driver source code? > Other places where I need to add changes are throughout "runtime/hdl/include/HdlZynq.h" and in the init function within "runtime/hdl/src/HdlBusDriver.cxx". > > Thanks for any advice you can give, > Dominic Walters > > "This e-mail and any attachment(s) is intended for the recipient only. Its unauthorised use, > disclosure, storage or copying is not permitted. Communications with Dstl are monitored and/or > recorded for system efficiency and other lawful purposes, including business intelligence, business > metrics and training. Any views or opinions expressed in this e-mail do not necessarily reflect Dstl policy." > > "If you are not the intended recipient, please remove it from your system and notify the author of > the email and centralenq@dstl.gov.uk" >