-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers/espi: it8xxx2: Add a config to share h2ram pool space #99139
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
drivers/espi: it8xxx2: Add a config to share h2ram pool space #99139
Conversation
| #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"))); |
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.
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
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.
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>
cf65fad to
903a81c
Compare
|
|
@fabiobaltieri since these changes occur in the SOC file, could you assign this PR to me. |



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.