-
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
same70b: Add support for SMC for SAME70-series #78120
base: main
Are you sure you want to change the base?
Conversation
Hello @AsgeirSH, and thank you very much for your first pull request to the Zephyr project! |
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
ccdd7ab
to
fb00921
Compare
drivers/memc/memc_sam_smc.c
Outdated
#if defined(CONFIG_SOC_SERIES_SAME70) || defined(CONFIG_SOC_SERIES_SAMV71) | ||
#define BUS_WIDTH(node_id) COND_CODE_1(DT_ENUM_IDX(node_id, atmel_smc_bus_width), \ | ||
(SMC_MODE_DBW_16_BIT), (SMC_MODE_DBW_8_BIT)) | ||
#else | ||
#define BUS_WIDTH(node_id) (0) | ||
#endif | ||
|
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 defined(CONFIG_SOC_SERIES_SAME70) || defined(CONFIG_SOC_SERIES_SAMV71)
- #define BUS_WIDTH(node_id) COND_CODE_1(DT_ENUM_IDX(node_id, atmel_smc_bus_width), \
- (SMC_MODE_DBW_16_BIT), (SMC_MODE_DBW_8_BIT))
-#else
- #define BUS_WIDTH(node_id) (0)
-#endif
+#define BUS_WIDTH(node_id) COND_CODE_1(DT_ENUM_IDX(node_id, atmel_smc_bus_width), \
+ (SMC_MODE_DBW_16_BIT), (0))
Bus Width configuration for the External Bus Interface / the | ||
Static Memory Controller that is wired to the external device. | ||
SMC on SAME70 (and S70/V70/V71) supports 8- or 16-bit bus width. | ||
On SAM4S (and 4E) only 8-bit data buses are supported, therefore 8-bit is set as default. |
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.
Bus Width configuration for the External Bus Interface. The
Static Memory Controller that is wired to the external device.
SMC on SAMx7 supports 8/16-bit bus width and on SAM4 only
8-bit data bus is supported.
The default value is 8-bit data buses.
Add smc definition in same70.dtsi Add atmel,smc-bus-width to atmel,sam-smc dts bindings. Update driver to select bus width from DT Signed-off-by: Asgeir Stavik Hustad <[email protected]>
fb00921
to
99848b5
Compare
The Static Memory Controller driver (which is already implemented for SAM4S in the existing memc) is not enabled for SAME70, nor does it support the 16-bit memory width of that SMC. This PR (with the accompanying one in hal_atmel) adds this support.
Tested on a custom board, and tests for SAM4S build locally (tests/drivers/memc/ram).