Skip to content

Commit 9e7313d

Browse files
petejohanson-adikartben
authored andcommitted
drivers: memc: MAX32 memc linker support improvements
In order to allow the linker to place certain objects into external RAM, e.g. heaps, adjust the memc initialization level to PRE_KERNEL_1, allowing clock control and memc to come up before priority objects like heaps are initialized. Signed-off-by: Pete Johanson <[email protected]>
1 parent 6ae130b commit 9e7313d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

drivers/memc/Kconfig.max32_hpb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ config MEMC_MAX32_HPB
88
select PINCTRL
99
help
1010
Enable ADI MAX32 HyperBus controller.
11+
12+
If you want to rely on the linker to place symbols in this memory
13+
(using`zephyr_code_relocate() or Z_GENERIC_SECTION()), you have to
14+
ensure this driver in initialized before KERNEL_INIT_PRIORITY_OBJECTS
15+
(=30). In addition, this driver depends on a clock, so you have to
16+
ensure the clock will be started before this driver as well (see
17+
CLOCK_CONTROL_INIT_PRIORITY)

drivers/memc/memc_max32_hpb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ static const struct memc_max32_hpb_config config = {
136136
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0),
137137
};
138138

139-
DEVICE_DT_INST_DEFINE(0, memc_max32_hpb_init, NULL, NULL, &config, POST_KERNEL,
139+
DEVICE_DT_INST_DEFINE(0, memc_max32_hpb_init, NULL, NULL, &config, PRE_KERNEL_1,
140140
CONFIG_MEMC_INIT_PRIORITY, NULL);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_ZTEST=y
2+
CONFIG_MEMC=y
3+
CONFIG_CLOCK_CONTROL_INIT_PRIORITY=15
4+
CONFIG_MEMC_INIT_PRIORITY=20

0 commit comments

Comments
 (0)