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

Add support for CTI Photon Xavier NX #76

Merged
15 commits merged into from
Jul 9, 2020
Merged

Conversation

pgils
Copy link
Contributor

@pgils pgils commented Jun 5, 2020

Support for Jetson Xavier NX module (P3668-0000) in a CTI Photon carrier board.
Based on #74 with patches from CTI bsp xavier-nx-32.4.2 v001

The machine conf overrides jetson-xavier-nx-devkit-emmc.conf. Is this okay or do we need a standalone config first like with the jetson-nano?

Also I was not sure about the order for these variables. Does that look alright?
This seems to work fine as well:

DTBNAME = "tegra194-p3668-all-p3509-0000"
DTBNAME_photon-xavier-nx = "tegra194-xavier-nx-cti-NGX003"
KERNEL_DEVICETREE = "${DEPLOY_DIR_IMAGE}/${DTBNAME}.dtb"

Would that work as a simpler solution or is there a reason not to set KERNEL_DEVICETREE like this?

This builds and runs fine. We have not been able to test the WWAN interface which should now be enabled as we do not have a module for it yet, but we will soon. I expect these driver changes to be released for photon-nano as well, we will update it when the 32.4.2 BSP it released by CTI.

@resin-jenkins
Copy link

Can one of the admins verify this patch?

@acostach
Copy link
Contributor

acostach commented Jun 5, 2020

thanks for the PR @pgils! yes, overriding the generic nx should be fine and dropping _xavier-nx from KERNEL_DEVICETREE to only override the dtb makes the recipe cleaner

@pgils
Copy link
Contributor Author

pgils commented Jun 5, 2020

great! can i add the KERNEL_DEVICETREE change here or would you prefer a separate PR @acostach ?

@acostach
Copy link
Contributor

acostach commented Jun 5, 2020

@pgils let's wait for my PR to be merged first as we are currently running tests on the new meta-balena before updating it in the PR. afterwards rebasing this PR on top of master and adding the change should be perfect

@pgils pgils force-pushed the photon-xavier-nx branch 2 times, most recently from 9fa0b3c to c21eec8 Compare June 15, 2020 11:32
@pgils pgils marked this pull request as ready for review June 15, 2020 11:40
@pgils pgils marked this pull request as draft June 15, 2020 12:25
@pgils pgils marked this pull request as ready for review June 15, 2020 13:23
@pgils
Copy link
Contributor Author

pgils commented Jun 17, 2020

@acostach I rebased this onto master and had to make one small edit in the boot blob generation in the last commit. Is this good to go?

@pgils pgils force-pushed the photon-xavier-nx branch from 31150a0 to 7abfe7c Compare June 17, 2020 09:29
@acostach
Copy link
Contributor

acostach commented Jun 18, 2020

@acostach I rebased this onto master and had to make one small edit in the boot blob generation in the last commit. Is this good to go?

@pgils I'm afraid it's probably not going to work, it didn't work for me but you can give it a test if you wish.

Reason is the boot blob is very tricky with regards to signatures, that's why we need to use some patching to have it resemble the one created during flashing by tegra host tools, which bundles the dtb for cboot to use. See:

# For this release, /opt/tegra-binaries/boot0.img MD5 should be 7cc64922796a9afc325a5cdf64413d10
If one signature didn't match, mb2 did not want to validate the cboot dtb contents and boot failed.

It's good if you can confirm on your side, you can try to write the bundle you get generated in your custom build like here:

and also try with the one that's generated without the last commit. Would be great to know how it works on your side.

Regarding the configs enabled, some are already enabled by meta-balena: https://github.com/balena-os/meta-balena/blob/master/meta-balena-common/classes/kernel-resin.bbclass#L377

@acostach
Copy link
Contributor

@resin-jenkins test this please

@pgils pgils force-pushed the photon-xavier-nx branch from 7abfe7c to a6aaac8 Compare June 26, 2020 08:20
@pgils
Copy link
Contributor Author

pgils commented Jun 26, 2020

@pgils I'm afraid it's probably not going to work, it didn't work for me but you can give it a test if you wish.

@acostach OK i can confirm it does not work.
A boot blob generated with CTI dtb (tegra194-xavier-nx-cti-NGX003_sigheader.dtb.encrypt):

# md5sum /opt/tegra-binaries/boot0.img
7cb78c91fe6ca78f704612df9bb36170  /opt/tegra-binaries/boot0.img

Writing this to /dev/mtdblock0 results in verification failure and failure to boot like you said.

Writing one generated with tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt:

# md5sum /opt/tegra-binaries/boot0.img
7cc64922796a9afc325a5cdf64413d10  /opt/tegra-binaries/boot0.img

Works fine.

What still confuses me is that the checksum for the partition seems random after each initial flashing (of the full balena image):

# dd if=/dev/mtdblock0 bs=1M status=none|md5sum
ac4c4225819a635bc68895e9d57bf7d4  -
# dd if=/dev/mtdblock0 bs=1M status=none|md5sum
323ec1fbe62c3de76e0df7e992c8f408  -
# dd if=/dev/mtdblock0 bs=1M status=none|md5sum
3fd72a451c127082a6d6d6ec25eb084f  -

Yet this boots and reboots fine.

tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt is not present in ${DEPLOY_DIR_IMAGE}/bootfiles when DTBNAME is anything other than tegra194-p3668-all-p3509-0000, breaking the build. I added a line in the last commit to explicitly copy the signed dtb to bootfiles. This now builds fine.

Regarding the configs enabled, some are already enabled by meta-balena: https://github.com/balena-os/meta-balena/blob/master/meta-balena-common/classes/kernel-resin.bbclass#L377

I removed the duplicates and separated them as well!

pgils and others added 13 commits June 26, 2020 15:59
Add machine file for CTI Photon NX
carrier board for Jetson Xavier NX

Changelog-entry: Add support for CTI photon NX
Signed-off-by: Pelle van Gils <[email protected]>
Add a patch for the changes made to the cdc_mbim driver in
CTI bsp Xavier-NX-32.4.2 V001

Signed-off-by: Pelle van Gils <[email protected]>
pgils added 2 commits June 26, 2020 15:59
enable cdc-wdm, sierra-net, cdc-ncm, and mii.

Signed-off-by: Pelle van Gils <[email protected]>
@acostach
Copy link
Contributor

acostach commented Jul 8, 2020

@resin-jenkins test this please
@balena-ci retest this please

@ghost ghost merged commit 71e9554 into balena-os:master Jul 9, 2020
@pgils pgils deleted the photon-xavier-nx branch July 10, 2020 14:33
This pull request was closed.
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.

3 participants