diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | common/build.mk | 3 | ||||
-rw-r--r-- | driver/accelgyro_bmi260.c | 2 | ||||
-rw-r--r-- | include/common.h | 4 | ||||
-rw-r--r-- | include/init_rom.h | 16 |
5 files changed, 24 insertions, 3 deletions
@@ -128,7 +128,7 @@ UC_PROJECT:=$(call uppercase,$(PROJECT)) # Transform the configuration into make variables. This must be done after # the board/baseboard/project/chip/core variables are defined, since some of # the configs are dependent on particular configurations. -includes=include core/$(CORE)/include include/driver $(dirs) $(out) fuzz test +includes=include core/$(CORE)/include include/driver $(dirs) $(out) fuzz test third_party ifdef CTS_MODULE includes+=cts/$(CTS_MODULE) cts endif diff --git a/common/build.mk b/common/build.mk index c4ee00836c..2cab0bbf5e 100644 --- a/common/build.mk +++ b/common/build.mk @@ -53,6 +53,7 @@ common-$(CONFIG_CHARGE_MANAGER)+=charge_manager.o endif common-$(CONFIG_CHARGE_RAMP_HW)+=charge_ramp.o common-$(CONFIG_CHARGE_RAMP_SW)+=charge_ramp.o charge_ramp_sw.o +common-$(CONFIG_CHIP_INIT_ROM_REGION)+=init_rom.o common-$(CONFIG_CMD_CHARGEN) += chargen.o common-$(CONFIG_CHARGER)+=charger.o charge_state_v2.o common-$(CONFIG_CHARGER_PROFILE_OVERRIDE_COMMON)+=charger_profile_override.o @@ -60,7 +61,7 @@ common-$(CONFIG_CMD_I2CWEDGE)+=i2c_wedge.o common-$(CONFIG_COMMON_GPIO)+=gpio.o gpio_commands.o common-$(CONFIG_IO_EXPANDER)+=ioexpander.o common-$(CONFIG_COMMON_PANIC_OUTPUT)+=panic_output.o -common-$(CONFIG_COMMON_RUNTIME)+=hooks.o main.o system.o peripheral.o init_rom.o +common-$(CONFIG_COMMON_RUNTIME)+=hooks.o main.o system.o peripheral.o common-$(CONFIG_COMMON_TIMER)+=timer.o common-$(CONFIG_CRC8)+= crc8.o common-$(CONFIG_CURVE25519)+=curve25519.o diff --git a/driver/accelgyro_bmi260.c b/driver/accelgyro_bmi260.c index faac2f75a5..573f8ce288 100644 --- a/driver/accelgyro_bmi260.c +++ b/driver/accelgyro_bmi260.c @@ -12,6 +12,7 @@ #include "console.h" #include "accelgyro_bmi_common.h" #include "accelgyro_bmi260.h" +#include "bmi260/accelgyro_bmi260_config_tbin.h" #include "hwtimer.h" #include "i2c.h" #include "init_rom.h" @@ -19,7 +20,6 @@ #include "motion_sense_fifo.h" #include "spi.h" #include "task.h" -#include "third_party/bmi260/accelgyro_bmi260_config_tbin.h" #include "timer.h" #include "util.h" #include "watchdog.h" diff --git a/include/common.h b/include/common.h index d08fa911a4..86c006d9e9 100644 --- a/include/common.h +++ b/include/common.h @@ -132,7 +132,11 @@ * linked into the .rodata section. */ #ifndef __init_rom +#ifndef CONFIG_ZEPHYR #define __init_rom __attribute__((section(".init.rom"))) +#else +#define __init_rom +#endif #endif /* gcc does not support __has_feature */ diff --git a/include/init_rom.h b/include/init_rom.h index 6d54e6aec4..2c1ab33cd5 100644 --- a/include/init_rom.h +++ b/include/init_rom.h @@ -14,6 +14,7 @@ #include "stdbool.h" +#ifdef CONFIG_CHIP_INIT_ROM_REGION /** * Get the memory mapped address of an .init_rom data object. * @@ -49,5 +50,20 @@ void init_rom_unmap(const void *addr, int size); * @return 0 on success. */ int init_rom_copy(int offset, int size, char *data); +#else +static inline const void *init_rom_map(const void *addr, int size) +{ + return addr; +} + +static inline void init_rom_unmap(const void *addr, int size) +{ +} + +static inline int init_rom_copy(int offset, int size, char *data) +{ + return 0; +} +#endif #endif /* __CROS_EC_INIT_ROM_H */ |