-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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 realtek rts5912 soc #75267
base: main
Are you sure you want to change the base?
Add realtek rts5912 soc #75267
Conversation
Hello @JasonLin-RealTek, and thank you very much for your first pull request to the Zephyr project! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, organize commit content properly, it seems that first commit contains e.g. pinctrl stuff which should not be there.
config BOARD | ||
default "rts5912_evb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config BOARD | |
default "rts5912_evb" |
this is hwmv1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
# | ||
|
||
config BOARD_RTS5912_EVB | ||
bool "Realtek RTS5912 Evaluation Board" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool "Realtek RTS5912 Evaluation Board" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert to webp, then put it through https://tinypng.com/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
&cpu0 { | ||
cpu-power-states = <&idle &suspend_to_ram>; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking comment: should there be flash partitions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unaddressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
power states must not be at board level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have put those power state to rts5912.dtsi.
# Serial Driver | ||
CONFIG_SERIAL=y | ||
|
||
# CONSOLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# CONSOLE | |
# Console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
soc/realtek/ec/Kconfig.defconfig
Outdated
if SOC_FAMILY_REALTEK_EC | ||
rsource "*/Kconfig.defconfig.series" | ||
endif # SOC_FAMILY_REALTEK_EC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if SOC_FAMILY_REALTEK_EC | |
rsource "*/Kconfig.defconfig.series" | |
endif # SOC_FAMILY_REALTEK_EC | |
if SOC_FAMILY_REALTEK_EC | |
rsource "*/Kconfig.defconfig.series" | |
endif # SOC_FAMILY_REALTEK_EC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
soc/realtek/ec/Kconfig.soc
Outdated
config SOC_FAMILY_REALTEK_EC | ||
bool | ||
config SOC_FAMILY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
soc/realtek/ec/rts5912/Kconfig
Outdated
bool "Realtek RTS5912 Series EC" | ||
select ARM | ||
select CPU_CORTEX_M33 | ||
select SOC_FAMILY_REALTEK_EC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
select SOC_FAMILY_REALTEK_EC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
soc/realtek/ec/rts5912/Kconfig.soc
Outdated
config SOC_SERIES | ||
default "rts5912" if SOC_SERIES_RTS5912 | ||
|
||
config SOC_RTS5912 | ||
bool | ||
select SOC_SERIES_RTS5912 | ||
|
||
config SOC | ||
default "rts5912" if SOC_RTS5912 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking comment: do you really need a soc series when the soc and soc series name as the same? Is this really a series?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There may be series and plenty of SoCs with different names in the future.
In order to maintain the consistency of the folder structure, we will use the same name for the series and SoCs for now.
e16ff4a
to
7a10790
Compare
We followed the suggestions to fix the code and passed the twister testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see any changes regarding my previous request
7a10790
to
7b8a3da
Compare
We misunderstood the request and moved the [pinctrl+register] files to their own commit. |
soc/realtek/ec/Kconfig
Outdated
if SOC_FAMILY_REALTEK_EC | ||
|
||
menuconfig REALTEK_RTS5912_IMG_HEADER | ||
bool "The output binary with RTS5912 image header" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool "The output binary with RTS5912 image header" | |
bool "Add RTS5912 image header to output binary" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
soc/realtek/ec/Kconfig
Outdated
menuconfig REALTEK_RTS5912_IMG_HEADER | ||
bool "The output binary with RTS5912 image header" | ||
help | ||
the RTS5912 ROM code loads firmware image from flash to RAM by the image header setting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*The
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
soc/realtek/ec/Kconfig
Outdated
choice REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_CHOICE | ||
prompt "Clock frequency to use for SPI flash" | ||
default REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV1 | ||
help | ||
This selects the SPI clock frequency that will be used for loading | ||
firmware binary from flash to RAM. | ||
|
||
config REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV1 | ||
bool "SPI flash clock frequency is SPIC engine clock divide 1" | ||
|
||
config REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV2 | ||
bool "SPI flash clock frequency is SPIC engine clock divide 2" | ||
|
||
config REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV4 | ||
bool "SPI flash clock frequency is SPIC engine clock divide 4" | ||
|
||
config REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV8 | ||
bool "SPI flash clock frequency is SPIC engine clock divide 8" | ||
|
||
endchoice # REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_CHOICE | ||
|
||
config REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ | ||
int | ||
default 0 if REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV1 | ||
default 1 if REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV2 | ||
default 2 if REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV4 | ||
default 3 if REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV8 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But they should come from dts, not Kconfig
soc/realtek/ec/Kconfig
Outdated
|
||
endif # REALTEK_RTS5912_IMG_HEADER | ||
|
||
#source "soc/realtek/*/Kconfig.soc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#source "soc/realtek/*/Kconfig.soc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
7b8a3da
to
2a3274a
Compare
9201411
to
38a84ee
Compare
38a84ee
to
c7b4bc6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple more nitpicks from me, thanks
dts/arm/realtek/ec/rts5912.dtsi
Outdated
pinctrl-0 = < &jtag_tdi_gpio87 &jtag_tdo_gpio88 &jtag_rst_gpio89 | ||
&jtag_clk_gpio90 &jtag_tms_gpio91>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, the indentation got a bit funny here, drop the leading spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We remove the leading spaces in next version of PR and align jtag_clk_gpio90
to the jtag_tdi_gpio87.
dts/arm/realtek/ec/rts5912.dtsi
Outdated
interrupts = < 0 0 1 0 2 0 3 0 | ||
4 0 5 0 6 0 7 0 | ||
8 0 9 0 10 0 11 0 | ||
12 0 13 0 14 0 15 0>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for all of these
interrupts = <0 0 1 0 2 0 3 0
4 0 5 0 6 0 7 0
etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the sample, we modified the interrupt numbers format.
5538070
to
af9133b
Compare
We have run ruff to format the |
af9133b
to
905c9f5
Compare
Fix merging conflicts. |
905c9f5
to
1c008f0
Compare
Add support for Realtek RTS5912 embedded controller (EC). Signed-off-by: Lin Yu-Cheng <[email protected]>
Add Realtek RTS5912 chip and driver device tree files. Signed-off-by: Lin Yu-Cheng <[email protected]>
737ac11
to
aaa6d25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, cool to see an soc can be added without deleting a single line of code :)
Add clock controller driver for Realtek RTS5912. Signed-off-by: Lin Yu-Cheng <[email protected]>
Add pinctrl driver for Realtek RTS5912. Signed-off-by: Lin Yu-Cheng <[email protected]>
Add swj driver for Realtek RTS5912. Signed-off-by: Lin Yu-Cheng <[email protected]>
Add timer driver for Realtek RTS5912. Signed-off-by: Lin Yu-Cheng <[email protected]>
Add gpio driver for Realtek RTS5912. Signed-off-by: Lin Yu-Cheng <[email protected]>
Add UART driver for Realtek RTS5912. Signed-off-by: Lin Yu-Cheng <[email protected]>
Add support for Realtek rts5912_evb board Signed-off-by: Lin Yu-Cheng <[email protected]>
This commit adds api and driver of Realtek EC to maintainers.yml Signed-off-by: Lin Yu-Cheng <[email protected]>
cf5701d
aaa6d25
to
cf5701d
Compare
|
||
#include <zephyr/logging/log.h> | ||
#include <zephyr/kernel.h> | ||
#include <zephyr/pm/pm.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is PM involved at all here?
description: | | ||
This binding gives a base representation of the pins configuration | ||
|
||
compatible: "realtek,rts5912-pinctrl" | ||
|
||
include: [base.yaml, pinctrl-device.yaml, pincfg-node.yaml] | ||
|
||
properties: | ||
reg: | ||
required: true | ||
|
||
child-binding: | ||
description: | | ||
This binding gives a base representation of the pins configuration | ||
|
||
include: | ||
- name: pincfg-node.yaml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing docs, list of allowed properties?
#define STD_GPIO_FUNC1 \ | ||
((REALTEK_RTS5912_FUNC1) | (REALTEK_RTS5912_GPIO_PINON) | (REALTEK_RTS5912_GPIO_SCHMITTER)) | ||
#define STD_GPIO_FUNC2 \ | ||
((REALTEK_RTS5912_FUNC2) | (REALTEK_RTS5912_GPIO_PINON) | (REALTEK_RTS5912_GPIO_SCHMITTER)) | ||
#define STD_GPIO_FUNC3 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is schmitt trigger configured here? there are standard properties for that
#define REALTEK_RTS5912_GPIO_DRIVING BIT(11) /* DRIVING : 0 low 1 high */ | ||
#define REALTEK_RTS5912_GPIO_SLEW BIT(12) /* SLEW : 0 fast 1 slow */ | ||
#define REALTEK_RTS5912_GPIO_PULLDN BIT(13) /* PULL DOWN : 0 disable 1 ebable */ | ||
#define REALTEK_RTS5912_GPIO_PULLUP BIT(14) /* PULL UP : 0 disable 1 ebable */ | ||
#define REALTEK_RTS5912_GPIO_SCHMITTER BIT(15) /* Schmitter : 1 ebable 0 disable */ | ||
#define REALTEK_RTS5912_GPIO_TYPE BIT(16) /* TYPE : 0 PP 1 OD */ | ||
#define REALTEK_RTS5912_GPIO_HILOW BIT(17) /* OUTPUT : 0 low 1 high */ | ||
|
||
#define REALTEK_RTS5912_INPUT_OUTPUT_POS 0 | ||
#define REALTEK_RTS5912_INPUT_DETECTION_POS 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here: these are props that need to be managed using standard props.
This PR adds support for the RTS5912 EC Chip from Realtek.
The initial support for the board includes TIMER, GPIO, CLOCK_CONTROL, PINCTRL.
please help us review the pull request.
Thanks!