diff --git a/chip/lm4/config.h b/chip/lm4/config.h index bb82dd7b31..88354a2ea2 100644 --- a/chip/lm4/config.h +++ b/chip/lm4/config.h @@ -50,6 +50,7 @@ #define CONFIG_ADC #define CONFIG_EEPROM #define CONFIG_FLASH +#define CONFIG_VBOOT #define CONFIG_FPU #define CONFIG_I2C #define CONFIG_LPC diff --git a/common/build.mk b/common/build.mk index 2c32fc292e..8c81d9866b 100644 --- a/common/build.mk +++ b/common/build.mk @@ -5,9 +5,9 @@ # Common files build # -common-y=main.o message.o util.o console.o vboot.o uart_buffering.o +common-y=main.o message.o util.o console.o uart_buffering.o common-y+=memory_commands.o shared_mem.o system_common.o hooks.o -common-y+=gpio_commands.o version.o fmap.o +common-y+=gpio_commands.o version.o common-$(CONFIG_BATTERY_ATL706486)+=battery_atl706486.o common-$(CONFIG_CHARGER_BQ24725)+=charger_bq24725.o common-$(CONFIG_EOPTION)+=eoption.o @@ -27,3 +27,4 @@ common-$(CONFIG_TASK_THERMAL)+=thermal.o thermal_commands.o common-$(CONFIG_TASK_X86POWER)+=x86_power.o common-$(CONFIG_TMP006)+=tmp006.o common-$(CONFIG_USB_CHARGE)+=usb_charge.o usb_charge_commands.o +common-$(CONFIG_VBOOT)+=vboot.o fmap.o diff --git a/common/main.c b/common/main.c index 044ae45027..9a37179cc1 100644 --- a/common/main.c +++ b/common/main.c @@ -43,9 +43,11 @@ int main(void) flash_pre_init(); #endif +#ifdef CONFIG_VBOOT /* Verified boot pre-init. This write-protects flash if necessary. * Flash and GPIOs must be initialized first. */ vboot_pre_init(); +#endif /* Initialize the system module. This enables the hibernate clock * source we need to calibrate the internal oscillator. */ @@ -87,6 +89,7 @@ int main(void) keyboard_scan_init(); #endif +#ifdef CONFIG_VBOOT /* Verified boot initialization. This may jump to another image, which * will need to reconfigure / reinitialize the system, so as little as * possible should be done above this step. @@ -94,6 +97,7 @@ int main(void) * Note that steps above here may be done TWICE per boot, once in the * RO image and once in the RW image. */ vboot_init(); +#endif /* Initialize other driver modules. These can occur in any order. * Non-driver modules with tasks do their inits from their task diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 00e7cf9e68..eb72c4fc19 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -78,13 +78,10 @@ SECTIONS . = ALIGN(4); __data_end = .; } > IRAM -#ifdef SECTION_IS_RO +#if defined(SECTION_IS_RO) && defined(CONFIG_VBOOT) .google CONFIG_FW_RO_GBB_OFF : AT(CONFIG_FW_RO_GBB_OFF) { *(.google) - . += 16; } > FLASH - ASSERT(SIZEOF(.text) + SIZEOF(.rodata) + SIZEOF(.data) + SIZEOF(.google) - <= CONFIG_FW_IMAGE_SIZE, "Too much stuff to fit in the image") #else /DISCARD/ : { *(.google)