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

boards: amd: Add support for AMD Versal NET RPU #86276

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

Conversation

kedareswararao
Copy link

@kedareswararao kedareswararao commented Feb 25, 2025

Add support for the RPU, real-time processing unit on Versal NET SoC. It is based on Cortext-R52 processor.

The patch contains initial wiring and configuration for generic board with OCM(1MB) and DDR(2G) memories, cpu, interrupt controller, global timer and UART.

versalnet.dtsi contains common peripherals integrated into Versal NET SoC, and versalnet_r52.dtsi has peripherals which are private to Cortex-R52 processor.

CC: @mubinsyed

Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

PR needs splitting up into soc and board commits too

Comment on lines 7 to 10
CONFIG_ARM_MPU=y
CONFIG_CACHE_MANAGEMENT=y
CONFIG_DCACHE=y
CONFIG_ICACHE=y
Copy link
Collaborator

Choose a reason for hiding this comment

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

why can't these be set by soc?

Copy link
Author

Choose a reason for hiding this comment

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

okay will move

Comment on lines 1 to 3
CONFIG_ISR_STACK_SIZE=1024
CONFIG_THREAD_STACK_INFO=y

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

Copy link
Author

Choose a reason for hiding this comment

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

sure


CONFIG_ARM_MPU=y
CONFIG_CACHE_MANAGEMENT=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000
Copy link
Collaborator

Choose a reason for hiding this comment

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

why can't this be set at soc level?

Copy link
Collaborator

Choose a reason for hiding this comment

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

CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000 - this is configurable based on HW design and not really hardcoded in SOC.

Copy link
Author

Choose a reason for hiding this comment

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

will read it from dt parameter

interrupt-parent = <&gic>;
status = "okay";
};

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

Copy link
Author

Choose a reason for hiding this comment

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

will remove

#interrupt-cells = <4>;
status = "okay";
};

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

Copy link
Author

Choose a reason for hiding this comment

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

sure will fix

default "amd_versalnet" if SOC_AMD_VERSALNET

config SOC
default "versalnet_rpu" if SOC_AMD_VERSALNET_RPU
Copy link
Collaborator

Choose a reason for hiding this comment

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

name mismatch either needs to be default "amd_versalnet_rpu" if SOC_AMD_VERSALNET_RPU or default "versalnet_rpu" if SOC_VERSALNET_RPU, and soc.yml needs to be the same

Copy link
Author

Choose a reason for hiding this comment

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

sure will fix

Comment on lines 9 to 10
CONFIG_DCACHE=y
CONFIG_ICACHE=y
Copy link
Member

Choose a reason for hiding this comment

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

These items are already provided for any Cortex-R52 CPU in arch/arm/core/cortex_a_r/Kconfig.

Copy link
Author

Choose a reason for hiding this comment

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

okay will remove

# SPDX-License-Identifier: Apache-2.0
#

config SOC_AMD_VERSALNET_RPU
Copy link
Member

Choose a reason for hiding this comment

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

add 'select ARM_MPU' here , then you can remove the other instances of 'CONFIG_ARM_MPU=y'.

Copy link
Author

Choose a reason for hiding this comment

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

okay will fix

#include <zephyr/device.h>
#include <zephyr/kernel.h>

void z_arm_platform_init(void)
Copy link
Member

Choose a reason for hiding this comment

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

In order for z_arm_platform_init() to be executed, you'll have to select PLATFORM_SPECIFIC_INIT. However, this is deprecated and therefore shouldn't be used. You can do things like disabling the caches, adjusting VBAR if available, or making sure that HIVECS is cleared at the earliest stages of booting in soc_reset_hook() which goes into soc.c. With this current implementation of z_arm_platform_init(), the caches are enabled before the MPU is set up.
Have a look at #85537 as reference, this PR is currently in progress, adding cache support for the Cortex-R5.

Copy link
Author

Choose a reason for hiding this comment

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

sure fill fix

@kedareswararao
Copy link
Author

PR needs splitting up into soc and board commits too

Thanks for the review, will fix

Add support for the RPU, real-time processing unit on Versal NET SoC.
It is based on Cortext-R52 processor.

The patch contains initial wiring and configuration for generic board
with OCM(1MB) and DDR(2G) memories, cpu, interrupt controller, global
timer and UART.

versalnet.dtsi contains common peripherals integrated into Versal NET
SoC, and versalnet_r52.dtsi has peripherals which are private to
Cortex-R52 processor.

Signed-off-by: Mubin Sayyed <[email protected]>
Signed-off-by: Appana Durga Kedareswara rao <[email protected]>
Add generic board support for the RPU, real-time processing
unit on Versal NET SoC. It is based on Cortext-R52 processor.

Signed-off-by: Mubin Sayyed <[email protected]>
Signed-off-by: Appana Durga Kedareswara rao <[email protected]>
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.

6 participants