Skip to content

Conversation

@GTLin08
Copy link
Contributor

@GTLin08 GTLin08 commented Nov 10, 2025

The h2ram is an independent 4KB section. With default settings of CONFIG_ESPI_PERIPHERAL_HOST_CMD_PARAM_PORT_NUM and CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION_PORT_NUM,
There is a 2KB gap that is unused. This change was made to make unused gap can be reused by other modules to reduce overall RAM usage.

Comment on lines 951 to 958
#ifdef CONFIG_ESPI_IT8XXX2_H2RAM_SHARED
uint8_t h2ram_pool[MAX(H2RAM_ACPI_SHM_MAX, H2RAM_EC_HOST_CMD_MAX)]
#else
static uint8_t h2ram_pool[MAX(H2RAM_ACPI_SHM_MAX, H2RAM_EC_HOST_CMD_MAX)]
__attribute__((section(".h2ram_pool")));
#endif
__attribute__((section(".h2ram_pool")));
Copy link
Member

Choose a reason for hiding this comment

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

how about using an intermediary macro for the static? something like

#ifdef CONFIG_ESPI_IT8XXX2_H2RAM_SHARED
#define H2RAM_STORAGE
#else
#define H2RAM_STORAGE static
#endif

H2RAM_STORAGE uint8_t h2ram_pool[MAX(H2RAM_ACPI_SHM_MAX, H2RAM_EC_HOST_CMD_MAX)]
 					__attribute__((section(".h2ram_pool")));

just to avoid repeating the allocation since there's some logic in there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

The h2ram is an independent 4KB section. With default settings of
CONFIG_ESPI_PERIPHERAL_HOST_CMD_PARAM_PORT_NUM and
CONFIG_ESPI_PERIPHERAL_ACPI_SHM_REGION_PORT_NUM,
There is a 2KB gap that is unused. This change was made to make
unused gap can be reused by other modules to reduce overall RAM
usage.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
@GTLin08 GTLin08 force-pushed the it8xxx2_espi_h2ram_shared branch from cf65fad to 903a81c Compare November 10, 2025 07:56
@sonarqubecloud
Copy link

@Dino-Li
Copy link
Contributor

Dino-Li commented Nov 10, 2025

@fabiobaltieri since these changes occur in the SOC file, could you assign this PR to me.

@fabiobaltieri fabiobaltieri assigned Dino-Li and GTLin08 and unassigned albertofloyd Nov 10, 2025
@jhedberg jhedberg added this to the v4.4.0 milestone Nov 12, 2025
@jhedberg jhedberg merged commit 6a340f6 into zephyrproject-rtos:main Nov 13, 2025
26 checks passed
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.

7 participants