Skip to content

stm32h7rs xspi Node with domain clock for peripheral clock configuration #88051

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

Merged
merged 8 commits into from
May 21, 2025

Conversation

FRASTM
Copy link
Collaborator

@FRASTM FRASTM commented Apr 2, 2025

This PR is adding the xspi nodes to the stm32h7rs serie with domain clock configuration for the peripheral clock and the XSPIMgr clock
The XSPI peripheral is clocked by the STM32_SRC_PLL2_S and the PLL2 is enabled in the board device tree

			clock-names = "xspix", "xspi-ker", "xspi-mgr";
			clocks = <&rcc STM32_CLOCK(AHB5, 5U)>,
				<&rcc STM32_SRC_PLL2_S XSPI2_SEL(1)>,
				<&rcc STM32_CLOCK(AHB5, 14U)>;

@FRASTM
Copy link
Collaborator Author

FRASTM commented Apr 7, 2025

Can also select the HCLK 5 to be the domain clock of the XSPI peripheral:

		xspi2: spi@5200a000 {
			compatible = "st,stm32-xspi";
			reg = <0x5200a000 0x1000>;
			interrupts = <106 0>;
			clock-names = "xspix", "xspi-ker", "xspi-mgr";
			clocks = <&rcc STM32_CLOCK(AHB5, 12U)>,
				<&rcc STM32_SRC_HCLK5 XSPI2_SEL(0)>,
				<&rcc STM32_CLOCK(AHB5, 14U)>;
			#address-cells = <1>;
			#size-cells = <0>;
			status = "disabled";
		};

@FRASTM FRASTM force-pushed the stm32h7rs_xspi branch 2 times, most recently from 5856ea0 to 4081d20 Compare April 14, 2025 07:24
@FRASTM
Copy link
Collaborator Author

FRASTM commented Apr 14, 2025

rebase on d453fb9

@FRASTM
Copy link
Collaborator Author

FRASTM commented May 14, 2025

rebase on 88b108d (fixing typo and conflict)

@FRASTM FRASTM requested review from etienne-lms and erwango May 14, 2025 09:49
tmon-nordic
tmon-nordic previously approved these changes May 16, 2025
@erwango erwango removed Release Notes To be mentioned in the release notes area: USB Universal Serial Bus area: MEMC labels May 16, 2025
erwango
erwango previously approved these changes May 16, 2025
etienne-lms
etienne-lms previously approved these changes May 19, 2025
@@ -455,6 +461,10 @@ static int stm32_clock_control_get_subsys_rate(const struct device *clock,
case STM32_CLOCK_BUS_AHB2:
case STM32_CLOCK_BUS_AHB3:
case STM32_CLOCK_BUS_AHB4:
#if defined(CONFIG_SOC_SERIES_STM32H7RSX)
/* HCLK5 i a possible source clock for some peripherals */
case STM32_SRC_HCLK5:
Copy link
Collaborator

Choose a reason for hiding this comment

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

STM32_SRC_HCLK1/2/3/4 and STM32_CLOCK_BUS_AHB5 cases are still missing in this function.

FRASTM added 4 commits May 21, 2025 10:09
Add the definitions of the PLL2 and PLL3 outputs for the stm32H7RS mcus
and the HCLK 5 which is clock source for the XSPI instance.
and other HCLKn for other peripherals.

Signed-off-by: Francois Ramu <[email protected]>
Defines the corresponding memory area of the MPU for
the external NOR xspi node.

Signed-off-by: Francois Ramu <[email protected]>
Add the XSPI 2 which is an octoSPI connection to a octo NOR flash
MX25UW25645GXDI00 (256 Mbits, 1.8 V, 200 MHz, DTR, rww)
on the nucleo_h7s3l8 board.

Signed-off-by: Francois Ramu <[email protected]>
Add the XSPI 2 which is an octoSPI connection to a octo NOR flash
mx66uw1g45 on the stm32h7s78_dk disco kit

Signed-off-by: Francois Ramu <[email protected]>
@FRASTM FRASTM dismissed stale reviews from etienne-lms, erwango, and tmon-nordic via 20adb4b May 21, 2025 08:11
@FRASTM
Copy link
Collaborator Author

FRASTM commented May 21, 2025

adding the HCLKn clocks

Copy link

@erwango erwango assigned erwango and unassigned nordic-krch May 21, 2025
Copy link
Collaborator

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

LGTM, with these suggestions/comments addressed of not.

@@ -2068,6 +2073,11 @@ static int flash_stm32_xspi_init(const struct device *dev)
LOG_ERR("XSPI mode SPI|DUAL|QUAD/DTR is not valid");
return -ENOTSUP;
}
#if defined(CONFIG_SOC_SERIES_STM32H7RSX)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpicking: may I suggest an empty line above?

.Refresh = 0,
#endif /* OCTOSPI_DCR4_REFRESH */
#endif /* XSPI_DCR4_REFRESH */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Default loading 0 values is not strictly needed. Maybe simpler if removed.

slot0_partition: partition@0 {
label = "image-0";
reg = <0x00000000 DT_SIZE_K(512)>;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Prefer with an empty line before each subnodes.

};
storage_partition: partition@110000 {
label = "storage";
reg = <0x00110000 DT_SIZE_K(64)>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Intentionally waste the remaining of the internal flash? 64kB is not much. Maybe increase to 1 or 2 MByte, or even (DT_SIZE_M(30) - DT_SIZE_K(64)).

slot0_partition: partition@0 {
label = "image-0";
reg = <0x00000000 DT_SIZE_K(512)>;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add an empty line between each subnode.

@kartben kartben merged commit b926ba6 into zephyrproject-rtos:main May 21, 2025
28 checks passed
Copy link
Collaborator

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

Sorry, I'm removing my +1, at leas tthe empty lines should be added in the DTS file (coding style conformance).

@etienne-lms
Copy link
Collaborator

So quick! nevermind, we'll fix the DT later :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants