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

Renesas: Smartbond: Add MEMC Driver Support #68023

Merged
merged 6 commits into from
May 23, 2024

Conversation

ioannis-karachalios
Copy link
Contributor

No description provided.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 23, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_renesas DNM This PR should not be merged (Do Not Merge) labels Jan 23, 2024
@ioannis-karachalios ioannis-karachalios force-pushed the da1469x-memc branch 6 times, most recently from c6c1abb to ed5de93 Compare January 24, 2024 12:56
@kartben kartben assigned andrzej-kaczmarek and unassigned kartben Jan 24, 2024
@ioannis-karachalios ioannis-karachalios force-pushed the da1469x-memc branch 7 times, most recently from 5af4220 to 0557c82 Compare January 30, 2024 10:29
Comment on lines 373 to 365
qspi_set_read_pipe_delay(7);
qspi_set_cs_delay(SystemCoreClock,
da1469x_qspi_set_read_pipe_delay(QSPIC_ID, 7);
da1469x_qspi_set_cs_delay(QSPIC_ID, SystemCoreClock,
DT_PROP(DT_NODELABEL(flash_controller),
read_cs_idle_delay),
DT_PROP(DT_NODELABEL(flash_controller),
erase_cs_idle_delay));
#if DT_NODE_HAS_STATUS(DT_NODELABEL(memc), okay)
da1469x_qspi_set_read_pipe_delay(QSPIC2_ID, 7);
da1469x_qspi_set_cs_delay(QSPIC2_ID, SystemCoreClock,
DT_PROP(DT_NODELABEL(memc), read_cs_idle_min_ns),
DT_PROP_OR(DT_NODELABEL(memc), erase_cs_idle_min_ns, 0));
#if DT_PROP(DT_NODELABEL(memc), is_ram)
da1469x_qspi_set_tcem(SystemCoreClock, DT_PROP(DT_NODELABEL(memc), tcem_max_us));
#endif
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move it to a separate function? Code looks the same like in lines 381-395.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. Applying memory settings has been moved to a subroutine.

blauret
blauret previously approved these changes May 16, 2024
@blauret
Copy link
Contributor

blauret commented May 16, 2024

@kartben, Could you kindly review again!!! I think we are there with this one.

@blauret
Copy link
Contributor

blauret commented May 17, 2024

@andrzej-kaczmarek ping

@ioannis-karachalios ioannis-karachalios force-pushed the da1469x-memc branch 2 times, most recently from 2d69d9d to 1bb753e Compare May 21, 2024 22:08
type: int
required: true
description: |
Time in microsends (us) the memory device can accept the next command following a SW reset.
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
Time in microsends (us) the memory device can accept the next command following a SW reset.
Time in microseconds (us) the memory device can accept the next command following a SW reset.

access in case the total time exceeds the defined value
(at the cost of extra cycles required for re-sending the instruction,
address and dummy bytes, if any). This setting is meaningful only if
is-ram is present. This value reflects the max. time in microsends the
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
is-ram is present. This value reflects the max. time in microsends the
is-ram is present. This value reflects the max. time in microseconds the

type: int
required: true
description: |
Manafacturer ID, part of device ID, used to verify the memory device used.
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
Manafacturer ID, part of device ID, used to verify the memory device used.
Manufacturer ID, part of device ID, used to verify the memory device used.

type: boolean
description: |
If present, the memory device will enter the QPI mode which typically reflects that
all bytes be sent in qaud bus mode. It's a pre-requisite that read and write
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
all bytes be sent in qaud bus mode. It's a pre-requisite that read and write
all bytes be sent in quad bus mode. It's a pre-requisite that read and write

default: "addr-range-24bit"
description: |
Address size to use in auto mode. In 24-bit mode up to 16MB can be
accessed whilst in 32-bit mode up to 32MB can be accssed which is
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
accessed whilst in 32-bit mode up to 32MB can be accssed which is
accessed whilst in 32-bit mode up to 32MB can be accessed which is

Comment on lines +211 to +213
Describes the mode of SPI bus during the dummy bytes phase for single/burst
read accesses in auto mode. The single mode should be supported by all
memory devices.
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
Describes the mode of SPI bus during the dummy bytes phase for single/burst
read accesses in auto mode. The single mode should be supported by all
memory devices.
Describes the mode of SPI bus during the dummy bytes phase for single/burst
read accesses in auto mode. Default value is single mode which should be supported by all
memory devices.

Comment on lines 222 to 224
Describes the mode of SPI bus during the extra byte phase for single/burst
read accesses in auto mode. The single mode should be supported by all
memory devices.
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
Describes the mode of SPI bus during the extra byte phase for single/burst
read accesses in auto mode. The single mode should be supported by all
memory devices.
Describes the mode of SPI bus during the extra byte phase for single/burst
read accesses in auto mode. Default value is single mode which should be supported by all
memory devices.

Comment on lines 234 to 236
Describes the mode of SPI bus during the address phase for single/burst
write accesses in auto mode. The single mode should be supported by all
memory devices.
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
Describes the mode of SPI bus during the address phase for single/burst
write accesses in auto mode. The single mode should be supported by all
memory devices.
Describes the mode of SPI bus during the address phase for single/burst
write accesses in auto mode. Default value is single mode which should be supported by all
memory devices.

Comment on lines +247 to +248
write accesses in auto mode. The single mode should be supported by all
memory devices.
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
write accesses in auto mode. The single mode should be supported by all
memory devices.
write accesses in auto mode. Default value is single mode which should be supported by all
memory devices.

Comment on lines 258 to 260
Describes the mode of SPI bus during the data phase for single/burst
write accesses in auto mode. The single mode should be supported by all
memory devices.
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
Describes the mode of SPI bus during the data phase for single/burst
write accesses in auto mode. The single mode should be supported by all
memory devices.
Describes the mode of SPI bus during the data phase for single/burst
write accesses in auto mode. Default value is single mode which should be supported by all
memory devices.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed all typos

Add support for the memory controller by utilizing QSPIC2. The latter is
capable to drive both NOR and PSRAM memory devices. For this to work,
the RAM driving mode is enabled.

Signed-off-by: Ioannis Karachalios <[email protected]>
1. Update the clock control driver so it can update timing settings for
   QSPIC2 following system clock transitions (translated based on
   AHB AMBA bus clock).
2. Remove the QSPIC related subroutines and use the respective HAL API
   which is now available.
3. Add support for PM (CONFIG_PM_DEVICE). This is required as QSPIC2
   register file is powered by PD_SYS which is turned off during device
   sleep and so registers contents are lost (in contrast to QSPIC which
   is used to drive the flash memory).

Signed-off-by: Ioannis Karachalios <[email protected]>
Update DTS and board configurations to support memory controller (QSPIC2).

Signed-off-by: Ioannis Karachalios <[email protected]>
In order to avoid defining almost the same overlays in the available
sample codes, tests and user applications, a common overlay file
per memory type is demonstrated under the boards dts folder.
Currently only the PSRAM interface is supported and the APS6404L
PSRAM QSPI memory device is demonstrated. In doing so, an
application code will only have to define another overlay file explicitly,
under application's board folder, to overwrite the default QSPI
controller's settings. In either case, users should explicitly
invoke the requested overlay files  at 'west build' invokation
via the DTC_OVERLAY_FILE system variable.

Signed-off-by: Ioannis Karachalios <[email protected]>
Add configuration and overlay files to support the DA1469x development kit.

Signed-off-by: Ioannis Karachalios <[email protected]>
Add configuration and overlay files to support the DA1469x development kit.

Signed-off-by: Ioannis Karachalios <[email protected]>
@nashif nashif merged commit 5c1e7d9 into zephyrproject-rtos:main May 23, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Clock Control area: Devicetree Binding PR modifies or adds a Device Tree binding area: MEMC area: Samples Samples platform: Renesas SmartBond Renesas Electronics Corporation, SmartBond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants