Skip to content

Supporting local memory trap_info - #88

Open
zbelinsk wants to merge 3 commits into
masterfrom
info_trap_local_mem
Open

Supporting local memory trap_info#88
zbelinsk wants to merge 3 commits into
masterfrom
info_trap_local_mem

Conversation

@zbelinsk

Copy link
Copy Markdown
Contributor

Adding support for info_trap, to retrieve local memory size and address.

@github-actions github-actions Bot added the untested Mark untested PRs label Jul 28, 2026
@zbelinsk
zbelinsk force-pushed the info_trap_local_mem branch from 596efb4 to ee21d06 Compare July 28, 2026 12:21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually wait. We need to make some changes here.

Comment thread kernel/data/globals/globals.h Outdated
Comment on lines +171 to +172
u32_t local_mem_base;
u32_t local_mem_size;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should try to be consistent and keep everything in 4K pages. Even though these are currently uninterpreted values that we just give back to the user, eventually we will take these from devtree and there we will want to store them >>12 so that we can fit larger addresses.

Comment thread booter/booter.c
Comment on lines 329 to +332
BOOTER_PRINTF(" --noc <master int> <slave int>\n\tSet NOC master and slave widget offsets from TCM base.\n");

BOOTER_PRINTF(" --local_mem <base address> <size>\n\tSet local memory base address and size.\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add "(4K pages)"

Comment thread booter/booter.c Outdated
Comment on lines +1425 to +1428
BOOTER_PRINTF("\t\tNOC master LUT base: 0x%08x\n", tcm_base + h2_info(INFO_NOC_MBASE));
BOOTER_PRINTF("\t\tNOC slave LUT base: 0x%08x\n", tcm_base + h2_info(INFO_NOC_SBASE));
BOOTER_PRINTF("\tCore local memory base address: 0x%08x\n", h2_info(INFO_LOCAL_MEM_BASE));
BOOTER_PRINTF("\tCore local memory size: 0x%08x\n", h2_info(INFO_LOCAL_MEM_SIZE));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add "(4K pages)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need fixes.

Comment thread booter/booter.c
}
argc -= 3; argv += 3;
continue;
} else if (0 == strcmp(argv[0], "--local_mem")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to add a 3rd param for the stride (distance between base addresses for each core). ldram regions are not guaranteed to be contiguous.

Comment thread kernel/traps/config/config.ref.c Outdated
}

u32_t H2K_trap_config_local_mem(u32_t unused, u32_t base, u32_t size, u32_t unused3, u32_t unused4, H2K_thread_context *me) {
H2K_gp->local_mem_base = base;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be
base + (stride * core_id)
So that each core gets the address of its own ldram.

@zbelinsk

Copy link
Copy Markdown
Contributor Author

Actually wait. We need to make some changes here.

Done.

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
…t calculation.

Updates booter, config trap, and globals to support configurable memory stride across cores.

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
…r-core memory offset calculation.

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
@zbelinsk
zbelinsk force-pushed the info_trap_local_mem branch from 06ff68b to 102d0ab Compare August 5, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

untested Mark untested PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants