examples: libmetal: amd_rpu: Fix dynamic config setup#102
examples: libmetal: amd_rpu: Fix dynamic config setup#102bentheredonethat wants to merge 6 commits into
Conversation
| metal_irq_disable(ch->irq_vector_id); | ||
| metal_irq_unregister(ch->irq_vector_id); | ||
| memset(&ch, 0, sizeof(ch)); | ||
| memset(ch, 0, sizeof(*ch)); |
There was a problem hiding this comment.
here is a fix of existing code. could you create a specific commit for this, please?
There was a problem hiding this comment.
@bentheredonethat: Does my comment make sense? Does it fix a bug in the existing code, or should we consider that the code does not work without the entire PR?
There was a problem hiding this comment.
Hi @arnopo your comment makes sense. As this is in cleanup, not init it does not 'break' the demo :) but still valid yes?
7d6939c to
50b0d63
Compare
Use members of channel struct when able as opposed to locals Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Cosmetic change for remote side - have libraries ordered alphabetically Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
As the host application now uses 3 shared mem areas that can be non-contiguous ensure that remote side accounts for this too. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Set first 2G MPU Region as same flags as libmetal demo to ensure MPU regions dont get incorrectly created by BSP This will go away once overlapping region adjustment is fixed in BSP Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Fix bug in call to memset(), pass struct channel_s *, not struct channel_s ** Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Move the shared irq_shmem_demo channel definition into a demo-level header and keep platform-specific state behind a machine_ctx pointer. This removes the duplicated channel_s definitions from the host and remote OS headers and makes the separation between common transport state and platform-private state clearer. Also export the demo common include directory through CMake so the shared header can be included directly as irq_shmem_demo.h instead of using deep relative include paths. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
50b0d63 to
b735d10
Compare
|
Hi @arnopo i have incorporated the machine context changes - thanks |
| int ret; | ||
|
|
||
| metal_assert(ch); | ||
| metal_assert(ch->machine_ctx); |
There was a problem hiding this comment.
you could use local variable here:
struct channel_machine_ctx_s *machine = channel_machine_ctx(ch);
| metal_assert(task); | ||
|
|
||
| ch->task = task; | ||
| channel_machine_ctx(ch)->task = task; |
There was a problem hiding this comment.
metal _assert(ch) already executed in channel_machine_ctx(ch)
| metal_assert(ch); | ||
|
|
||
| ch->irq_pending = (atomic_flag)ATOMIC_FLAG_INIT; | ||
| channel_machine_ctx(ch)->irq_pending = (atomic_flag)ATOMIC_FLAG_INIT; |
There was a problem hiding this comment.
same here use a local variable and remove assert
| @@ -73,7 +77,7 @@ static inline void system_suspend(struct channel_s *ch) | |||
| static inline void system_resume(struct channel_s *ch) | |||
| { | |||
| metal_assert(ch); | |||
There was a problem hiding this comment.
useless as done in channel_machine_ctx
| metal_irq_disable(ch->irq_vector_id); | ||
| metal_irq_unregister(ch->irq_vector_id); | ||
| memset(&ch, 0, sizeof(ch)); | ||
| memset(ch, 0, sizeof(*ch)); |
There was a problem hiding this comment.
@bentheredonethat: Does my comment make sense? Does it fix a bug in the existing code, or should we consider that the code does not work without the entire PR?
bentheredonethat
left a comment
There was a problem hiding this comment.
see review comment -- i can fix cleanup
| metal_irq_disable(ch->irq_vector_id); | ||
| metal_irq_unregister(ch->irq_vector_id); | ||
| memset(&ch, 0, sizeof(ch)); | ||
| memset(ch, 0, sizeof(*ch)); |
There was a problem hiding this comment.
Hi @arnopo your comment makes sense. As this is in cleanup, not init it does not 'break' the demo :) but still valid yes?
|
Hi @arnopo thanks for this cycle of review -- will fix each comment |
|
Hi @arnopo can i also send in a patch for linux side we have for internally working case where linux does not do lopper / SDT stuff? just have a script to setup linux side via a Device tree crawl + discovery script |
|
Ben will submit PR to libmetal library to avoid need for script |
|
related libmetal PR OpenAMP/libmetal#365 -- let us please review and agree on this then i can come back to pick this up |
Linux side allows user to specify non-cotniguous descriptor and data regions
ensure RPU side does the same
also include some stylistic fixes and 1 MPU fix