summaryrefslogtreecommitdiff
path: root/zephyr/CMakeLists.txt
diff options
context:
space:
mode:
authorWealian Liao <whliao@nuvoton.corp-partner.google.com>2021-05-03 18:34:31 +0800
committerCommit Bot <commit-bot@chromium.org>2021-05-19 19:29:49 +0000
commit31dc11d5778645e974ebd1e75123c465ca411609 (patch)
treeae583d1137e4cbe1d297f5a107d4327b7c1cb87d /zephyr/CMakeLists.txt
parente19a8e92bcf167385f46270b486ff2179ed891f4 (diff)
downloadchrome-ec-31dc11d5778645e974ebd1e75123c465ca411609.tar.gz
zephyr: npcx: Move ecst configuration options to upstream
NPCX series ROM code changes the chip basic setting by firmware binary header for loading the firmware from flash to RAM. All the NPCX series chips could use it, so those configuration options are moved to upstream. The ecst chip version automatic select by CONFIG_SOC_NPCX7MNX. Currently, the project setting doesn't set to the expected chip part number. Change the following project to select the target chip & configure ecst header: - volteer: npcx7m7fc - trogdor: npcx7m6fc - kohaku: npcx7m6fc BUG=b:184448653 BRANCH=none TEST=zmake testall TEST=volteer boot to OS Cq-Depend: chromium:2872415 Signed-off-by: Yuval Peress <peress@chromium.org> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Ieed6c21536401f70950ddd1f18d243b127d896ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2867128 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/CMakeLists.txt')
-rw-r--r--zephyr/CMakeLists.txt76
1 files changed, 0 insertions, 76 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 954a691a0b..4d7a2430eb 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -77,82 +77,6 @@ if(DEFINED CONFIG_PLATFORM_EC)
endif()
endif()
-# If a header is needed (should only be set for npcx) run the ecst.py script to
-# generate it.
-if (DEFINED CONFIG_PLATFORM_EC_RO_HEADER)
- # Translate the CONFIG_FLASH_SIZE to the correct argument value.
- if ("${CONFIG_FLASH_SIZE}" STREQUAL "512" OR "${CONFIG_FLASH_SIZE}" STREQUAL "1024")
- set(flash_size 1)
- elseif ("${CONFIG_FLASH_SIZE}" STREQUAL "2048")
- set(flash_size 2)
- elseif ("${CONFIG_FLASH_SIZE}" STREQUAL "4096")
- set(flash_size 4)
- elseif ("${CONFIG_FLASH_SIZE}" STREQUAL "8192")
- set(flash_size 8)
- elseif ("${CONFIG_FLASH_SIZE}" STREQUAL "16384")
- set(flash_size 16)
- endif()
-
- if (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_CORE_CLOCK_SPI_CLOCK_RATIO_1)
- set(spiclkratio 1)
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_CORE_CLOCK_SPI_CLOCK_RATIO_2)
- set(spiclkratio 2)
- else()
- # Defaults to 1 if none are set.
- set(spiclkratio 1)
- endif()
-
- if (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_MAX_CLOCK_20)
- set(spimaxclk 20)
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_MAX_CLOCK_25)
- set(spimaxclk 25)
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_MAX_CLOCK_33)
- set(spimaxclk 33)
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_MAX_CLOCK_40)
- set(spimaxclk 40)
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_MAX_CLOCK_50)
- set(spimaxclk 50)
- else()
- # Defaults to 20 if none are set.
- set(spimaxclk 20)
- endif()
-
- if (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_READ_MODE_NORMAL)
- set(spireadmode "normal")
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_READ_MODE_FAST)
- set(spireadmode "fast")
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_READ_MODE_DUAL)
- set(spireadmode "dual")
- elseif (DEFINED CONFIG_PLATFORM_EC_RO_HEADER_SPI_READ_MODE_QUAD)
- set(spireadmode "quad")
- else()
- # Defaults to "dual" if none are set.
- set(spireadmode "dual")
- endif()
-
- # Check for disabling header CRC.
- if (NOT DEFINED CONFIG_PLATFORM_EC_RO_HEADER_ENABLE_HEADER_CRC)
- set(hcrc "-nohcrc")
- endif()
-
- # Check for disabling firmware CRC.
- if (NOT DEFINED CONFIG_PLATFORM_EC_RO_HEADER_ENABLE_FIRMWARE_CRC)
- set(fcrc "-nofcrc")
- endif()
-
- # Note, we cannot get the chip from Kconfig because currently Zephyr doesn't
- # support all the variations we need for NPCX. These values should be set
- # in each project's board.cmake.
- set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
- COMMAND ${PYTHON_EXECUTABLE}
- ${ZEPHYR_BASE}/boards/arm/npcx7m6fb_evb/support/ecst.py
- -i ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
- -o ${PROJECT_BINARY_DIR}/zephyr.packed.bin ${hcrc} ${fcrc}
- -chip ${ECST_CHIP_ARG} -flashsize ${flash_size}
- -spiclkratio ${spiclkratio} -spimaxclk ${spimaxclk}
- -spireadmode ${spireadmode})
-endif()
-
# Switch from the "zephyr" library to the "app" library for all Chromium OS
# sources.
set(ZEPHYR_CURRENT_LIBRARY app)