Commit 9e7313d9 authored by Pete Johanson's avatar Pete Johanson Committed by Benjamin Cabé
Browse files

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: default avatarPete Johanson <pete.johanson@analog.com>
parent 6ae130b4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -8,3 +8,10 @@ config MEMC_MAX32_HPB
	select PINCTRL
	help
	  Enable ADI MAX32 HyperBus controller.

	  If you want to rely on the linker to place symbols in this memory
	  (using`zephyr_code_relocate() or Z_GENERIC_SECTION()), you have to
	  ensure this driver in initialized before KERNEL_INIT_PRIORITY_OBJECTS
	  (=30). In addition, this driver depends on a clock, so you have to
	  ensure the clock will be started before this driver as well (see
	  CLOCK_CONTROL_INIT_PRIORITY)
+1 −1
Original line number Diff line number Diff line
@@ -136,5 +136,5 @@ static const struct memc_max32_hpb_config config = {
	.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0),
};

DEVICE_DT_INST_DEFINE(0, memc_max32_hpb_init, NULL, NULL, &config, POST_KERNEL,
DEVICE_DT_INST_DEFINE(0, memc_max32_hpb_init, NULL, NULL, &config, PRE_KERNEL_1,
		      CONFIG_MEMC_INIT_PRIORITY, NULL);
+4 −0
Original line number Diff line number Diff line
CONFIG_ZTEST=y
CONFIG_MEMC=y
CONFIG_CLOCK_CONTROL_INIT_PRIORITY=15
CONFIG_MEMC_INIT_PRIORITY=20