From 37fa38296266e62adfe10226b7b1a22ac9335537 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Wed, 22 Mar 2023 14:58:09 -0500 Subject: cr50: add a factory config space Add a 64 bit write once factory config space to info1. If the factory has something they want to configure, they can use part of the space to store that configration. Right now nothing in cr50 uses the factory config space. If we need to modify cr50 behavior based on the space value, we can add functionality later. The factory just needs to set the bit in the factory config. BUG=b:214065944 TEST=manual Clear the Board ID set the config to 0. Verify it does nothing gsctool -a --factory_config 0 gsctool -a --factory_config 0 Set the flags gsctool -ai 0xffffffff:0x10 Set the config to something gsctool -a --factory_config 0x12345678cafecafe gsctool -a --factory_config 12345678CAFECAFE # Set it to the same thing. Verify cr50 returns EC_SUCCESS. gsctool -a --factory_config 0x12345678cafecafe gsctool -a --factory_config 12345678CAFECAFE [40.114944 write_factory_config: ok.] Try to set it to something else. Verify it's rejected because the space is set. gsctool -a --factory_config 0xcafe [43.331302 write_factory_config: factory cfg already programmed] gsctool -a --factory_config 12345678CAFECAFE Set the Board ID Type gsctool -ai ZZCR:0x10 Try to set the config again. Verify it's rejected because the board id type is set. gsctool -a --factory_config 0x12345678cafecafe Factory config failed. (7) gsctool -a --factory_config 12345678CAFECAFE Change-Id: Ie816ebffcf6c24ad94bbcd2dc2f0c3936caafb11 Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4424873 Reviewed-by: Vadim Bendebury --- chip/g/build.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'chip/g/build.mk') diff --git a/chip/g/build.mk b/chip/g/build.mk index 6f863169fc..358b1e640a 100644 --- a/chip/g/build.mk +++ b/chip/g/build.mk @@ -24,6 +24,7 @@ endif # Required chip modules chip-y = clock.o gpio.o hwtimer.o pre_init.o system.o chip-$(CONFIG_BOARD_ID_SUPPORT) += board_id.o +chip-$(CONFIG_BOARD_ID_SUPPORT) += factory_config.o chip-$(CONFIG_SN_BITS_SUPPORT) += sn_bits.o ifeq ($(CONFIG_POLLING_UART),y) chip-y += polling_uart.o -- cgit v1.2.1