Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openamp v2018.10 #11355

Merged
merged 3 commits into from
Jan 30, 2019
Merged

Openamp v2018.10 #11355

merged 3 commits into from
Jan 30, 2019

Conversation

galak
Copy link
Collaborator

@galak galak commented Nov 14, 2018

Update Zephyr to utilize OpenAMP (and libmetal) v2018.10 release. The v2018.10 release reduces code footprint and reworks the API set to decouple rpmsg and remoteproc. We update the sample app to take advantage of rpmsg and see around a 4k reduction in footprint.

@galak galak added the area: IPC Inter-Process Communication label Nov 14, 2018
@galak
Copy link
Collaborator Author

galak commented Nov 14, 2018

Fixes #9921

@codecov-io
Copy link

codecov-io commented Nov 14, 2018

Codecov Report

Merging #11355 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11355   +/-   ##
=======================================
  Coverage   53.51%   53.51%           
=======================================
  Files         239      239           
  Lines       26983    26983           
  Branches     6518     6518           
=======================================
  Hits        14440    14440           
  Misses       9879     9879           
  Partials     2664     2664

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 109f80f...6fb4b57. Read the comment docs.

${PLATFORM_DIR}/platform.c
${PLATFORM_DIR}/platform_ops.c
${PLATFORM_DIR}/resource_table.c)
target_sources(app PRIVATE src/main_master.c)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should have a "master" folder since we have one for "remote". And a proper README.rst per sample app.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have any particular issue with this, so master/main.c? instead of src/main_master.c? How much do you expect to exist in the master dir beyond the source and a README.rst in both master and remote?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes more clear to have a master/src/main.c and remote/src/main.c, especially for beginners. For master and remote folders we should have a README.rst giving more details what the sample app does alongside with the CMakeLists.txt and prj.conf.

As soon as this and #8527 get merged I will work to get this working on the i.MX7.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you expect in the remote/README.rst?

Copy link
Contributor

Choose a reason for hiding this comment

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

Introducing to it, how it works. Explaining it is not using remoteproc, etc.

@SebastianBoe SebastianBoe removed their request for review November 14, 2018 09:37
@galak
Copy link
Collaborator Author

galak commented Nov 14, 2018

@arnop2 & @wjliang Would appreciate you guys taking a look at this.

#define VRING_ALIGNMENT 4
#define VRING_SIZE 16

#define RSC_TABLE_ADDRESS 0x04000000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the resource table address covered by the shm? as this is beyond the SHM_START_ADDR, just wonder where is this memory mapped?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean by mapped?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

static K_SEM_DEFINE(data_sem, 0, 1);
static K_SEM_DEFINE(data_rx_sem, 0, 1);

static void platform_ipm_callback(void *context, u32_t id, volatile void *data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Platforms need a mailbox to be able to run this example. Suggest to add the limitation in README.rst file.

struct virtio_dispatch dispatch = {
.get_status = virtio_get_status,
.get_features = virtio_get_features,
.set_features = virtio_set_features,
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that the .set_features callback is not needed for the remote:
https://github.com/OpenAMP/open-amp/blob/master/lib/remoteproc/remoteproc_virtio.c#L167

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe there is an inconsistency in the OpenAMP implementation:
OpenAMP/open-amp#139

Copy link
Collaborator

Choose a reason for hiding this comment

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

For now, as RPMsg is the only virtio user, and the demo doesn't make use of .set_features on the remote side. Implementation is not required. But prefer to have comments to the virtio dispatch ops structure to explain why there is no implementation for those functions.

@@ -135,7 +135,7 @@ int metal_sys_init(const struct metal_init_params *params)
strerror(errno));
return -errno;
}
if (sizeof(int) != fread(&seed, sizeof(int), 1, urandom)) {
if (fread(&seed, 1, sizeof(seed), urandom) <= 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not know if that was intention of the author, however we assume success if at least one byte of seed has been taken from urandom.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Dec 12, 2018

Found the following issues, please fix and resubmit:

License/Copyright issues

In most cases you do not need to do anything here, especially if the files reported below are going into ext/ and if license was approved for inclusion into ext/ already. Fix any missing license/copyright issues. The license exception if a JFYI for the maintainers and can be overriden when merging the pull request.

  • ext/lib/ipc/open-amp/open-amp/docs/img-src/gen-graph.py missing license.
  • ext/lib/ipc/open-amp/open-amp/docs/img-src/gen-graph.py missing copyright.
  • ext/lib/ipc/open-amp/open-amp/lib/include/openamp/remoteproc_virtio.h is not apache-2.0 licensed: bsd-new
  • ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h is not apache-2.0 licensed: bsd-new
  • ext/lib/ipc/open-amp/open-amp/lib/remoteproc/remoteproc_virtio.c is not apache-2.0 licensed: bsd-new
  • ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg_internal.h is not apache-2.0 licensed: bsd-new
  • ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg_internal.h missing copyright.
  • ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg_virtio.c is not apache-2.0 licensed: bsd-new

@galak galak force-pushed the openamp-v2018.10 branch 3 times, most recently from 7f7e6be to 2a43738 Compare December 12, 2018 19:28
@galak galak requested a review from MaureenHelm as a code owner December 12, 2018 19:28
static void virtio_set_features(struct virtio_device *vdev,
u32_t features)
{
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

better to comments on why it is empty?

return 0;
}

SYS_INIT(init_status_flag, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only see init_status_flag() called from master, it suggests master needs to load first, better to have some comments on the init_status_flags.

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.

Ok for me, just few improvement proposals.

#define VRING_ALIGNMENT 4
#define VRING_SIZE 16

#define OPENAMP_STATUS_ADDR 0x04000000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be nice to have CONFIG or dtsmemory region to declare the address and size, as platform dependent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will re-work that as a follow on PR that looks to support more platforms with this sample.


/* Since we are using name service, we need to wait for a response
* from NS setup and than we need to process it
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

just for you information, NS announcement is optional, you can also define a fixed source and destination address on end point creation.

@galak
Copy link
Collaborator Author

galak commented Jan 9, 2019

@MaureenHelm did you or anyone from NXP want to review this?

galak added 2 commits January 30, 2019 10:56
Since there's an official release lets update to it.

Signed-off-by: Kumar Gala <[email protected]>
Update to new OpenAMP v2018.10 release.  This release allows us to
utilize just rpmsg without remoteproc.  The API set has changed and
requires updates to the openamp sample.  Additionally, the changes
in this release reduce the code size footprint, and support a static
allocation memory model.

Signed-off-by: Kumar Gala <[email protected]>
The v2018.10 release of OpenAMP reworks the API set and splits the
remoteproc vs rpmsg interfaces so one can use rpmsg without remoteproc.

This helps drastically reduce the code footprint utilized by OpenAMP.
The remote see around 4k reduction in code size.

Signed-off-by: Kumar Gala <[email protected]>
@galak galak merged commit e2b62b4 into zephyrproject-rtos:master Jan 30, 2019
@galak galak deleted the openamp-v2018.10 branch January 30, 2019 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: IPC Inter-Process Communication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants