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 Renesas H3ULCB board #31307

Merged

Conversation

julien-massot
Copy link
Collaborator

@julien-massot julien-massot commented Jan 14, 2021

This pull request adds a very minimal support in order to run Zephyr on the Cortex-r7
present on Renesas H3ULCB board.

H3ULCB have cortex A5x Cores and a 'Realtime processor' based on Cortex-R7.

With this minimal support it is possible to start the hello world, blinky and button demo.
The output is printed on the ram console.

Drivers such as Pinmux, UART, CAN will come later and are already tested in our feature branches
such as 'renesas' branch of https://github.com/iotbzh/zephyr.

This PR create also a renesas_rcar soc family and a 'gen3' soc_series, the different SoCs of the Gen3 series will be
able to reuse this work with just few dts entries and pinmux configuration.

For user which want to talk about Renesas R-Car support within Zephyr, feel free to join the new shiny 'renesas' channel on
Zephyr slack.

@julien-massot julien-massot changed the title Iotbzh/for upstream/add h3ulcb RFC: Iotbzh/for upstream/add h3ulcb Jan 14, 2021
@julien-massot julien-massot changed the title RFC: Iotbzh/for upstream/add h3ulcb RFC: Add Renesas H3ULCB board Jan 14, 2021
@julien-massot julien-massot force-pushed the iotbzh/for-upstream/add-h3ulcb branch 2 times, most recently from 28269f9 to 81246e0 Compare January 15, 2021 06:38
@github-actions github-actions bot added area: API Changes to public APIs area: Devicetree Binding PR modifies or adds a Device Tree binding area: Timer Timer labels Jan 18, 2021
@julien-massot
Copy link
Collaborator Author

Finally I decide to make this PR bigger than the first proposal,
by adding clock control, timer and gpio driver.

Please let us know what is the preferred strategy.

@julien-massot julien-massot force-pushed the iotbzh/for-upstream/add-h3ulcb branch 2 times, most recently from 29f4d47 to 9a70c75 Compare January 19, 2021 15:24
@carlescufi carlescufi requested review from carlocaione and removed request for andrewboie February 2, 2021 13:37
@ioannisg
Copy link
Member

ioannisg commented Feb 2, 2021

@stephanosio you might want to take a look as well.

@carlocaione
Copy link
Collaborator

carlocaione commented Feb 3, 2021

Hey @julien-massot a general comment: can you fix the define indentation madness in this patchset? ;)

Also a general question (maybe for @ioannisg @nashif and others) should be the device MMIO API enforced for all the new drivers? Or is that only nice-to-have?

@julien-massot
Copy link
Collaborator Author

julien-massot commented Feb 3, 2021

Hey @julien-massot a general comment: can you fix the define indentation madness in this patchset? ;)

Hi @carlocaione Indeed I did read this code so much so that I didn't notice anymore that's indentation is odd,
will look at it again.

Thanks for the review.
I'm also interested at any hint which can make the review easier, one way could be to send each driver: timer, gpio and clock alone, and then the SoC support so that each patchset may be easier to handle.

@carlocaione
Copy link
Collaborator

I'm also interested at any hint which can make the review easier, one way could be to send each driver: timer, gpio and clock alone, and then the SoC support so that each patchset may be easier to handle.

My take on this is (and other devs can have a different opinion on this): the minimum set of things to make the CI happy when testing the pushed code.

So for example I wouldn't push the GPIO driver alone when there is no way for the CI to test the code because there is no soc support for that. So I would push the soc / board enabling code and the minimum set of drivers to make it testable on the CI.

Copy link
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

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

Some more comments

drivers/clock_control/clock_control_rcar_cpg_mssr.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_rcar.c Outdated Show resolved Hide resolved
drivers/timer/rcar_cmt_timer.c Outdated Show resolved Hide resolved
drivers/timer/rcar_cmt_timer.c Outdated Show resolved Hide resolved
drivers/timer/rcar_cmt_timer.c Outdated Show resolved Hide resolved
drivers/timer/rcar_cmt_timer.c Outdated Show resolved Hide resolved
drivers/timer/rcar_cmt_timer.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@bbolen bbolen left a comment

Choose a reason for hiding this comment

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

Aside from stephanosio's Nit comments, looks good to me.

@ioannisg
Copy link
Member

Aside from stephanosio's Nit comments, looks good to me.

@julien-massot pls, address those, so we can close the review :)

Julien Massot and others added 16 commits April 22, 2021 07:40
Most of the Renesas RCar Gen3 based SoC contains a Cortex R7
processor.
This processor has access to the same memory mapped devices than
the Cortex-A5x cores.

- CPU operates upto 800MHz
- Can use ram area from 0x40040000 to 0x42000000
- Has 512 interrupts on GIC-400 compliant with Arm GICv2

Add support for r8a77951 as first SoC of this series which is also
known as H3 ES2.0 and is present present on different boards such as
Salvator and R-Car Starter Kit(H3ulcb).

This first SoC definition is just enough to print Hello World in a
ram console.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Add basic configuration for H3ULCB, just enough to see the
Zephyr boot banner on the ram console.

This configuration make use of the Cortex-R7 present on
r8a977951 SoC.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Adding ulcb boards documentation based on Renesas official documentation
and following zephyr guideline.

The documentation is describing the board and the current
Zephyr support.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
This add bindings for Renesas CPG, MSSR clock control
driver.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
DTS bindings file for Renesas RCar CPG clock control.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Clock Pulse Generator, Module Standby Software Reset, are registers
presents in Renesas Gen3 SoC series.

MSSR is used to supply clock to the different modules, shuch as timer,
or UART, it's also possible to issue a reset the different module.

CPG registers allow to get the rate or to set some divider like for
the CAN clock.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Add device tree binding for Compare Match Timer that can
be found on various Renesas RCar SoC.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Compare Match Timer is a 32 bit compare match timer
that can be found on various Renesas R-Car SoC.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
The Compare match timer can be found on Renesas
RCar Gen3 soc series.

It depends on clock controller to supply clock to the
CMT module.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Enable CMT timer that can be found on H3ULCB board.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Renesas RCar gpio controller can manage up to 32 gpio
per bank.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Add GPIO controller driver that can be found on Renesas
RCar gen3 soc series.

Controller can handle up to 32 GPIOs per banks.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Renesas RCar Gen3 series have up to 8 GPIOs
bank.

Add bank 5 and bank 6, that is used to manage user led and
switches on different demo board.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Enable the user led and user switch that can be found
on h3ulcb, they are both connected to the GPIO 6 bank.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
This test require explicit definition of the timer irq.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Update supported features for Renesas
R-Car H3ULCB board.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
@ioannisg ioannisg merged commit 38126f9 into zephyrproject-rtos:master Apr 22, 2021
@julien-massot
Copy link
Collaborator Author

Thanks to all people who helped me to find some issues and to apply all the Zephyr code guidelines !

@julien-massot julien-massot deleted the iotbzh/for-upstream/add-h3ulcb branch April 22, 2021 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: ARM ARM (32-bit) Architecture area: Boards area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree area: Documentation area: Timer Timer platform: Renesas Renesas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants