-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Atmel SAM: Introduce SMC driver #42739
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
Conversation
|
Hi @pdgendt , Thank you for this contribution. It seems a very clean implementation. I hope can review soon when merge window is open again.
|
Codecov Report
@@ Coverage Diff @@
## main #42739 +/- ##
==========================================
+ Coverage 50.10% 50.41% +0.30%
==========================================
Files 632 632
Lines 77529 77530 +1
Branches 18102 18101 -1
==========================================
+ Hits 38844 39084 +240
+ Misses 32257 31981 -276
- Partials 6428 6465 +37
Continue to review full report at Codecov.
|
|
Hi @nandojve, thank you for the response. I've update the PR, please check my responses below.
I've added the
Is this still required if it is added to an existing board where other tests will probably already cover this?
Added.
Added based on the SAM4E datasheet, unable to test due to lack of HW.
I've updated the |
76e1960 to
d3587e7
Compare
|
Rebased on |
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.
Hi @pdgendt ,
It will be necessary add a test at tests/drivers/memc. My suggestion is do something simple like write a pattern, read back and compare. This could be a generic test that may be used for any future memc_sram driver inclusive.
Hey @nandojve, I was looking into this, and there's a test for Looking at #42008 and #40422 we could rework that existing test once those PRs are merged. |
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 was looking into this, and there's a test for stm32_sdram which could be reused. However this requires some more effort for the linker sections to be more generic.
If it is possible, better! Project prefers reuse instead add new ones.
Looking at #42008 and #40422 we could rework that existing test once those PRs are merged.
Your PR will be conditioned to be merged after those.
I was looking this controller and my initial thought was that SMC should handle SDRAM too. After looking datasheets I noted that SAM uses a dedicated controller for SDRAM. So, in this case, we have two distinct drivers and those are independently.
On that research I noted that SAMS7/E7/V7 uses same SMC ip. It is up to you add that nodes like SAM4E. There is a minimal change in the driver that could be added which will allow SAMS7/E7/V7 have 16 bit access instead only 8. If you don't mind add this, you can upstream the whole feature set. This is a plus not a block from my side.
So we wait a bit, or?
Do you mean on the SMC module as well?
I currently have limited time to add these additional SoCs, and no hardware to test. The SAM4E looked easy, but I also have no way to test this. I guess if someone needs them, it should be easy to test and upstream. |
Yes, to reuse.
As far I understood SMC not support SDRAM. SDRAM is handled by a dedicated controller. At end, EBI is a set of one or two controllers (SMC + SDRAM). |
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.
Still keeping a -1 on for now because it's not clear to me if this is a correct use of 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.
Hi @pdgendt ,
I think it is better but still missing important information. I tried highlight few points to you.
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.
Hi @pdgendt ,
It still not clear. Please, see my suggestions and adapt as you wish.
|
Thanks @nandojve, for all your efforts to help out! I updated the suggestions you made, but adjusted the example timings to the datasheet specifications. |
|
Hi @pdgendt , I BTW, we need fix flash stuff |
Fixed by #48762 |
Add soc support for sam4sa16c variant Signed-off-by: Pieter De Gendt <[email protected]>
Add a driver to support external memory connected to the SMC port for Atmel SAM devices. Signed-off-by: Pieter De Gendt <[email protected]>
Add pinctrl definitions for the SMC peripheral and add the module to the sam4s soc. Signed-off-by: Pieter De Gendt <[email protected]>
Add pinctrl definitions for the SMC peripheral (8) and add the module to the sam4e soc. IDs and addresses are taken from the datasheet. Signed-off-by: Pieter De Gendt <[email protected]>
This commit enables the SRAM controller is66wv51216dbll connected to the SMC/EBI bus. Half of the memory is made available (512KB) on chip select 0, the other part is (512KB) on chip select 1. The SMC timings are taken from the Microchip studio example SMC_SRAM_EXAMPLE for the sam4s_xplained board. Signed-off-by: Pieter De Gendt <[email protected]>
* Reworked the stm32 SDRAM test to be more generic * Added SRAM entries * Moved to new ztest API Signed-off-by: Pieter De Gendt <[email protected]>
|
Hi @mbolivar-nordic , No more CI erros and @pdgendt made few changes. I was wondering if you can revisit this PR. |
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.
|
@pdgendt, @nandojve, I'm working on a similar driver for Infineon XMC4xxx. The driver set up happens with POST_KERNEL priority, but Did you come across something like this? |
Hey @talih0, I did not need relocating to external RAM, so I can't really share my experience there. If this is something you want to be looked at, I would suggest creating a new issue. Comments on merged PRs are easily overlooked :) |
|
thanks @pdgendt for following up, I'll create an issue. |
Add support for the ATSAM4SA16C variant and add a driver for the Atmel SMC/EBI module.
Tested on a custom board