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

Develop/ram console option known addr buf #68452

Conversation

Zhiqiang-Hou
Copy link
Contributor

This PR added an option for RAM console driver to locate the console buffer to a predefined memory region, so that the RAM console can be used easily, and also added an example on imx8mmevk.

@Zhiqiang-Hou Zhiqiang-Hou force-pushed the develop/ram-console-option-known-addr-buf branch 2 times, most recently from cf3e9e0 to 18d8ba5 Compare February 3, 2024 11:28
@zephyrbot zephyrbot requested a review from andyross February 3, 2024 11:29
@Zhiqiang-Hou
Copy link
Contributor Author

This update fixed some check failures.

drivers/console/ram_console.c Outdated Show resolved Hide resolved
@Zhiqiang-Hou Zhiqiang-Hou force-pushed the develop/ram-console-option-known-addr-buf branch from 18d8ba5 to 8a64dfb Compare February 7, 2024 07:08
carlocaione
carlocaione previously approved these changes Feb 7, 2024
dleach02
dleach02 previously approved these changes Feb 22, 2024
@Zhiqiang-Hou Zhiqiang-Hou dismissed stale reviews from dleach02 and carlocaione via 6c7ea74 February 26, 2024 04:13
@Zhiqiang-Hou Zhiqiang-Hou force-pushed the develop/ram-console-option-known-addr-buf branch 2 times, most recently from 6c7ea74 to 7ae1799 Compare February 26, 2024 06:53
@Zhiqiang-Hou
Copy link
Contributor Author

Updated to fix LONG_LINE check warning.

carlocaione
carlocaione previously approved these changes Feb 26, 2024
@dleach02 dleach02 added the hwmv2-likely-conflict DNM until collab-hwmv2 has been merged label Feb 29, 2024
Copy link
Member

@dleach02 dleach02 left a comment

Choose a reason for hiding this comment

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

This will conflict with the HWMv2 so we will block this till the collab branch merges

@Zhiqiang-Hou
Copy link
Contributor Author

This will conflict with the HWMv2 so we will block this till the collab branch merges

Okay, will rebase then.

kartben
kartben previously requested changes May 6, 2024
drivers/console/Kconfig Outdated Show resolved Hide resolved
drivers/console/ram_console.c Outdated Show resolved Hide resolved
snippets/ram-console/README.rst Outdated Show resolved Hide resolved
snippets/ram-console/README.rst Outdated Show resolved Hide resolved
drivers/console/Kconfig Outdated Show resolved Hide resolved
@Zhiqiang-Hou Zhiqiang-Hou force-pushed the develop/ram-console-option-known-addr-buf branch from 84716af to 8671935 Compare May 7, 2024 14:02
@JiafeiPan JiafeiPan requested review from nordicjm and dleach02 May 16, 2024 01:48
JiafeiPan
JiafeiPan previously approved these changes May 16, 2024
@JiafeiPan JiafeiPan requested review from kartben and andyross May 16, 2024 01:50
nordicjm
nordicjm previously approved these changes May 16, 2024
@dleach02
Copy link
Member

@kartben can you review the changes to your change request
@carlocaione you had a previous approval but that was dropped to address a different request.

@kartben kartben dismissed their stale review May 22, 2024 20:49

Earlier comments regarding documentation have been addressed

snippets/ram-console/README.rst Outdated Show resolved Hide resolved
snippets/ram-console/README.rst Show resolved Hide resolved
@Zhiqiang-Hou Zhiqiang-Hou dismissed stale reviews from nordicjm and JiafeiPan via cbf420b May 23, 2024 03:30
@Zhiqiang-Hou Zhiqiang-Hou force-pushed the develop/ram-console-option-known-addr-buf branch from 8671935 to cbf420b Compare May 23, 2024 03:30
In arm64 linker script, create a memory region and section for each
device tree node with compatible string "zephyr,memory-region".

Signed-off-by: Hou Zhiqiang <[email protected]>
It has been added in the arm64 common linker script, so also update
the one of mimx9 SoCs.

Signed-off-by: Hou Zhiqiang <[email protected]>
Leave one byte from the CONFIG_RAM_CONSOLE_BUFFER_SIZE to ensure
the NULL-termination.

Signed-off-by: Hou Zhiqiang <[email protected]>
Currently, the ram_console buffer is defined as a global var, its
address is determined during the building and may be changed when
code update. This is not a problem if the ram_console is just used
in debug purpose.

While in the heterogeneous SoCs, there can be multiple MPU Cores
and several MCU cores, it can run multiple OS/bare-metal instances
on these cores, but the UART ports may be not enough, so the
ram_console can be leveraged. To make it easy to use, it's better
make the console buffer fixed and predefined.

This patch adds a option to link the console buffer to a given
section, through the "zephyr,memory-region" device tree node, then
the address can be known from the device tree node and easy to
check from other cores running Linux/U-Boot.

To use this option, the chosen property 'zephyr,ram-console' must
be added, the following is a example:

	chosen {
		zephyr,ram-console = &ram_console;
	};

	ram_console: memory@93d00000 {
		compatible = "zephyr,memory-region";
		reg = <0x93d00000 DT_SIZE_K(4)>;
		zephyr,memory-region = "RAM_CONSOLE";
	};

Signed-off-by: Hou Zhiqiang <[email protected]>
The ram-console snippet disabled UART console and enabled the
RAM console with the option link the RAM console buffer to a
dedicate section in a new added memory-region.

Signed-off-by: Hou Zhiqiang <[email protected]>
@Zhiqiang-Hou Zhiqiang-Hou force-pushed the develop/ram-console-option-known-addr-buf branch from cbf420b to 47d631a Compare May 24, 2024 03:26
@JiafeiPan JiafeiPan requested review from kartben and nordicjm June 3, 2024 02:16
@kartben
Copy link
Collaborator

kartben commented Jun 7, 2024

@carlocaione could you please refresh your +1? thanks!

@decsny decsny added this to the v3.7.0 milestone Jun 7, 2024
@dleach02 dleach02 merged commit fd584b4 into zephyrproject-rtos:main Jun 12, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Architectures area: ARM64 ARM (64-bit) Architecture area: Build System area: Console area: Devicetree Binding PR modifies or adds a Device Tree binding area: UART Universal Asynchronous Receiver-Transmitter platform: NXP Drivers NXP Semiconductors, drivers platform: NXP MPU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants