Skip to content

Add minimal support for Renesas EK-RZ/A3M #91031

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nhutnguyenkc
Copy link
Collaborator

@nhutnguyenkc nhutnguyenkc commented Jun 4, 2025

Add minimal support for EK-RZ/A3M as following:

Interface Controller Driver/Component
GPIO on-chip gpio
Pinctrl on-chip pinctrl
UART on-chip serial

Need: zephyrproject-rtos/hal_renesas#110
Doc: https://builds.zephyrproject.io/zephyr/pr/91031/docs/boards/renesas/rza3m_ek/doc/index.html

Copy link

github-actions bot commented Jun 4, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

* R9A07G066M04GBG MPU
* 1GHz, Arm Cortex®-A55 core w/NEON extension
* Built-in 128MB DDR3L DRAM
* 128KB SRAM w/ECC
Copy link
Contributor

Choose a reason for hiding this comment

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

Since I see that the SRAM defined on the board layer is 72 KB, is this information correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, SRAM is 128KB, but the first 56KB is reserved for bootloader, so only 72KB is available for use.

Comment on lines +33 to +37
sram: memory@1e000 {
compatible ="zephyr,memory-region", "mmio-sram";
reg = <0x1e000 DT_SIZE_K(72)>;
zephyr,memory-region = "SRAM";
};
Copy link
Contributor

Choose a reason for hiding this comment

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

As I see in the HWM, this SRAM is in the SoC layer. Is there a specific reason for this node being placed here, or is my information incorrect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SRAM is 128KB, but the first 56KB is reserved for bootloader, so only 72KB is available for use. The start address depends on the bootloader, so it has been moved to board layer.

default 512

config SYS_CLOCK_HW_CYCLES_PER_SEC
default 24000000
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the CPU frequency you defined is 1 GHz, this number doesn't match. Should we retrieve this value from the device tree instead of using a fixed value?

Copy link
Collaborator

Choose a reason for hiding this comment

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

as above, get this value from dts using dts functions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. The generic timer is supplied by osc (24MHz). I added a node in dts and modify to get it. Please help me check again.

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 SYS_CLOCK_HW_CYCLES_PER_SEC should be assigned the value of the CPU clock, not the osc or any source of the CPU clock. In this case, I believe it would be the (CA55_SCLK) clock.

image
image

Copy link
Collaborator Author

@nhutnguyenkc nhutnguyenkc Jun 13, 2025

Choose a reason for hiding this comment

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

Thanks. But CA55_SCLK clock is totally wrong. Could you please refer to chapter 15 for system counter clock used as os timer?

image

image

Comment on lines 14 to 16
&gpio {
status = "okay";
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the board has this node enabled, there's no need to overlay it in test.

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 removed this node. Thanks

default 512

config SYS_CLOCK_HW_CYCLES_PER_SEC
default 24000000
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above, get this value from dts using dts functions

Comment on lines +48 to +52
header: partition@0 {
label = "header";
reg = <0x00000000 0x200>;
read-only;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this for mcuboot? If so, this is not correct. If it's something else then disregard

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it isn't. An existing bootloader (pre-built binary) requires the header in a specific format to load the Zephyr image.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm is that without blobs? Boards in zephyr must be able to run samples without usage of binary blobs to be accepted - see https://docs.zephyrproject.org/latest/contribute/bin_blobs.html#limited-scope for details

Copy link
Collaborator Author

@nhutnguyenkc nhutnguyenkc Jun 11, 2025

Choose a reason for hiding this comment

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

Could you please help me check the html doc? We document it to guide users how to prepare the board including the bootloader.
https://builds.zephyrproject.io/zephyr/pr/91031/docs/boards/renesas/rza3m_ek/doc/index.html#programming-and-debugging

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's not about preparing, either those 2 samples work as-is without blobs or the board cannot be accepted into zephyr, if you need a binary blob IPL to run any application then the test cannot be passed under the without blobs requirement

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @nordicjm, @nashif, @kartben,
As the document https://docs.zephyrproject.org/latest/contribute/guidelines.html#licensing, the other licenses are also accepted (BSD 3-clause included), not only Apache 2.0
image

Also in the manifest of other vendors, they also use BSD 3-clause.
Example: https://github.com/zephyrproject-rtos/hal_nordic/blob/master/drivers/nrf_802154/driver/src/nrf_802154.c

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just reviewed the Zephyr policy regarding external source code integration:
https://docs.zephyrproject.org/latest/contribute/external.html#submission-and-review-process
As my understanding that https://github.com/renesas/hal_renesas has already been approved by the TSC.
Do I need to request TSC approval again for adding the IPL source code to hal_renesas?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @nordicjm
Apologies if my earlier message came across too direct. I really appreciate the discussion and your support in helping us navigate this properly.

Copy link
Member

@nashif nashif Jun 25, 2025

Choose a reason for hiding this comment

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

@nashif @kartben ping - assume needs discussing at TSC

@nordicjm Apache 2.0 requirement only applies to zephyr mainline, not modules. Modules when approved and created, document used license which needs to be compatible. Any new additions to the module/HAL under this license falls under the same approval. So, just because something else under that same approved license is being added to a module does not require TSC approval.

Copy link
Collaborator

@nordicjm nordicjm Jun 26, 2025

Choose a reason for hiding this comment

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

Are we including what is required to build even e.g. hello_world on board targets with that? The original hal request was for apache 2.0 license #33171 so would not apply since this is for BSD licensed code was a different PR for it which listed it #46721

@fabiobaltieri
Copy link
Member

Hey, this needs a rebase and force push to pick up the CI error workaround.

@nhutnguyenkc nhutnguyenkc force-pushed the rza3m_minimal_support branch from f75181f to 6f7fa44 Compare June 11, 2025 06:35
@nhutnguyenkc nhutnguyenkc force-pushed the rza3m_minimal_support branch 3 times, most recently from 6d8fae3 to fc5f9a0 Compare June 17, 2025 06:23
@nhutnguyenkc nhutnguyenkc force-pushed the rza3m_minimal_support branch from fc5f9a0 to bff6cd0 Compare June 19, 2025 10:34
@github-actions github-actions bot added manifest manifest-hal_renesas DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Jun 19, 2025
@KhiemNguyenT KhiemNguyenT added this to the v4.2.0 milestone Jun 25, 2025
nordicjm
nordicjm previously approved these changes Jun 26, 2025
binhnguyen2434
binhnguyen2434 previously approved these changes Jun 26, 2025
@kartben
Copy link
Collaborator

kartben commented Jun 27, 2025

@nhutnguyenkc CI is failing and this needs a rebase -- just a reminder that feature freeze is today :)

Add support for Renesas RZ/A3M

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Add devicetree to support for Renesas RZ/A3M

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
This adds minimal support for board RZ/A3M-EK

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Add pinctrl support for Renesas RZ/A3M

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Add GPIO driver support for RZ/A3M

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Exclude EK-RZ/A3M board as the redefined CONFIG_SRAM_BASE_ADDRESS
degrades the BUILD_OUTPUT_ADJUST_LMA option that will generate a bin
file >10GB

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
@nhutnguyenkc nhutnguyenkc dismissed stale reviews from binhnguyen2434 and nordicjm via b2cfb69 June 30, 2025 02:30
@nhutnguyenkc nhutnguyenkc force-pushed the rza3m_minimal_support branch from bff6cd0 to b2cfb69 Compare June 30, 2025 02:30
@github-actions github-actions bot removed manifest manifest-hal_renesas DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Jun 30, 2025
@nhutnguyenkc nhutnguyenkc reopened this Jun 30, 2025
@nhutnguyenkc nhutnguyenkc modified the milestones: v4.2.0, v4.3.0 Jun 30, 2025
@nhutnguyenkc
Copy link
Collaborator Author

@kartben due to an issue, it has been moved to v4.3.0. I updated the milestone.

Copy link

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

Successfully merging this pull request may close these issues.

9 participants