Skip to content

Conversation

@bentheredonethat
Copy link
Contributor

This is based off PR #87

The third and second commits for Linux build.

The top commit has the aim of having the Libmetal Demo converge with the OpenAMP Legacy demo in terms of:

  • allow data-driven app configuration of the demos using .cmake files.
  • re-use the OpenAMP carveouts so that a single device tree can re-use the same carveouts for either Libmetal or OpenAMP Demo showcase.

@arnopo arnopo requested review from arnopo, edmooring and tnmysh January 7, 2026 18:17
@bentheredonethat bentheredonethat force-pushed the align-libmetal-demo-with-openamp-vendor-support branch from 099f49f to 35dad11 Compare January 7, 2026 18:18
@bentheredonethat
Copy link
Contributor Author

Hello - ping for review @arnopo @edmooring

@bentheredonethat bentheredonethat force-pushed the align-libmetal-demo-with-openamp-vendor-support branch from 35dad11 to 4702659 Compare January 13, 2026 23:42
@bentheredonethat bentheredonethat force-pushed the align-libmetal-demo-with-openamp-vendor-support branch from 4702659 to f29e681 Compare January 16, 2026 21:37
@bentheredonethat
Copy link
Contributor Author

bentheredonethat commented Jan 16, 2026

Hi @arnopo ok this branch is now:

  • re-tested off the machineless libmetal
  • i worked to make the configure-time data passed in more complete. here that is the linker script, interrupt, timer-counter, and carveouts
  • style / code-hygiene cleanups

@bentheredonethat bentheredonethat force-pushed the align-libmetal-demo-with-openamp-vendor-support branch from f29e681 to ceedb12 Compare January 19, 2026 22:56
Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few typos to fix, else LGTM

#define DEFAULT_PAGE_SHIFT (-1UL)
#define DEFAULT_PAGE_MASK (-1UL)

#define SHM_TOTAL_SIZE SHM0_DESC_SIZE + SHM1_DESC_SIZE +SHM_PAYLOAD_SIZE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define SHM_TOTAL_SIZE SHM0_DESC_SIZE + SHM1_DESC_SIZE +SHM_PAYLOAD_SIZE
#define SHM_TOTAL_SIZE (SHM0_DESC_SIZE + SHM1_DESC_SIZE + SHM_PAYLOAD_SIZE)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix

metal_io_block_write(shm_io, tx_data_offset, msg_hdr,
sizeof(struct msg_hdr_s) + msg_hdr->len);
ret = metal_io_block_write(payload_io, tx_data_offset, msg_hdr,
sizeof(struct msg_hdr_s) + msg_hdr->len);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment should match open parenthesis

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix

/* copy message to shared buffer */
metal_io_block_write(shm_io, tx_data_offset, msg_hdr,
ret = metal_io_block_write(payload_io, tx_data_offset, msg_hdr,
sizeof(struct msg_hdr_s) + msg_hdr->len);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment should match open parenthesis

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix

As the resume condition clears the flag, this should check if clear.

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
…PIPSU driver

AMD BSP recommended usage recommends using IPI driver to hook in IPIPSU driver.

Reference example here: https://github.com/xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/ipipsu/examples/xipipsu_self_test_example.c

As part of this remove unneeded lines.

Also use config.h provided IPI value to get the IPIPSU instance.

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Move the libmetal host/remote demo off the legacy single 3ed80000.shm window
to the OpenAMP-style carveouts at 0x09860000 with separate descriptor UIOs
(9860000.shm_desc, 9864000.shm_desc) and payload (9868000.shm), update the
platform init code to open/map the new descriptor regions, add
optional config-driven IPI overrides, and match the RPU defaults to the same
layout.

As part of this, mimic OpenAMP vendor-specific demos in that they will also
support support use of unified CMake-driven symbols. This enables external
tooling to generate a .cmake file from the system device tree that configures
the demo for the target platform without manual edits to source files.

Key changes:

- Add config.h.in templates for both Linux host and RPU remote that use
  #cmakedefine to optionally override defaults from common.h

- Separate monolithic SHM_BASE_ADDR/SHM_SIZE into distinct carveouts:
  * SHM0_DESC_BASE/SIZE - descriptor ring 0
  * SHM1_DESC_BASE/SIZE - descriptor ring 1
  * SHM_PAYLOAD_BASE/SIZE - data payload area

- Wrap all platform-specific IPI symbols in #ifndef guards:
  * IPI_DEV_NAME, IPI_BASE_ADDR, IPI_MASK

- Wrap all platform-specific TTC symbols in #ifndef guards:
  * TTC_DEV_NAME, TTC0_BASE_ADDR, TTC_NODEID

- Include demo-specific specific symbols for IPI, Shared memory and TTC
  as provided by configure-time generated config.h file.

- Configure linker script via .cmake metadata too.

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
UIO C file is dead code. remove it.

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Simplify build as it was previously based off legacy Libmetal
Linux AMP Demo.

Streamline it to just pick up and deliver a statically linked
executable.

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
@bentheredonethat bentheredonethat force-pushed the align-libmetal-demo-with-openamp-vendor-support branch from 96f1a93 to 08d5351 Compare January 20, 2026 14:05
@bentheredonethat
Copy link
Contributor Author

bentheredonethat commented Jan 20, 2026

Hi @arnopo thanks for your quick review. apologies on those few nits left. I have cleaned them AFAICT

one thing to note - the github render seems to differ from my editor. I have tab indented aligned for the changes but in git it shows differently.

@arnopo
Copy link
Collaborator

arnopo commented Jan 20, 2026

Hi @arnopo thanks for your quick review. apologies on those few nits left. I have cleaned them AFAICT

No worries that part of my job ;-)

one thing to note - the github render seems to differ from my editor. I have tab indented aligned for the changes but in git it shows differently.

You can run check patch on your pull request or generating local patch
For instance for your PR

https://github.com/OpenAMP/openamp-system-reference/pull/93.patch
./libmetal/scripts/checkpatch.pl --strict 93.patch

In term should be nice that we add the checkpatch in system-reference repository

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants