2018-11-19 03:46:21 +00:00
|
|
|
#
|
|
|
|
# eFuse Manager ganeretes header file.
|
|
|
|
#
|
2018-11-21 08:09:36 +00:00
|
|
|
# .PHONY: efuse_table efuse_test_table show_efuse_table
|
2018-11-19 03:46:21 +00:00
|
|
|
|
2018-11-21 08:09:36 +00:00
|
|
|
GEN_TOOL := $(COMPONENT_PATH)/efuse_table_gen.py
|
|
|
|
GEN_EFUSE_TABLE := $(PYTHON) $(GEN_TOOL)
|
2018-11-19 03:46:21 +00:00
|
|
|
|
2018-11-21 08:09:36 +00:00
|
|
|
GEN_EFUSE_TABLE_ARG := --coding_scheme $(CONFIG_EFUSE_CODE_SCHEME)
|
|
|
|
|
|
|
|
ifdef CONFIG_EFUSE_CUSTOM_TABLE_USE_BLK1
|
|
|
|
GEN_EFUSE_TABLE_ARG += --custom_table_use_BLK1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EFUSE_CUSTOM_TABLE_USE_BLK2
|
|
|
|
GEN_EFUSE_TABLE_ARG += --custom_table_use_BLK2
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CONFIG_EFUSE_COMMON_TABLE_FIX_SIZE_BLK1_BLK2_DEP_ON_CODE_SCHEME
|
|
|
|
GEN_EFUSE_TABLE_ARG += --common_table_fix_size_secure_key_and_encrypt_key
|
|
|
|
endif
|
2018-11-19 03:46:21 +00:00
|
|
|
|
|
|
|
###################
|
|
|
|
# Make common files esp_efuse_table.c and include/esp_efuse_table.h files.
|
|
|
|
SOC_NAME := $(IDF_TARGET)
|
|
|
|
EFUSE_COMMON_TABLE_CSV_PATH := $(COMPONENT_PATH)/$(SOC_NAME)/esp_efuse_table.csv
|
2018-11-21 08:09:36 +00:00
|
|
|
EFUSE_COMMON_TABLE_OUT_PATH := $(COMPONENT_PATH)/$(SOC_NAME)/esp_efuse_table.c
|
2018-11-19 03:46:21 +00:00
|
|
|
|
|
|
|
###################
|
2018-11-21 08:09:36 +00:00
|
|
|
# Make custom files project/main/esp_efuse_custom_table.c and project/main/include/esp_efuse_custom_table.h files.
|
2018-11-19 03:46:21 +00:00
|
|
|
ifdef CONFIG_EFUSE_CUSTOM_TABLE
|
|
|
|
# Path to CSV file is relative to project path for custom CSV files.
|
|
|
|
EFUSE_CUSTOM_TABLE_CSV_PATH := $(call dequote,$(abspath $(call dequote, $(PROJECT_PATH))/$(call dequote,$(CONFIG_EFUSE_CUSTOM_TABLE_FILENAME))))
|
2018-11-21 08:09:36 +00:00
|
|
|
EFUSE_CUSTOM_TABLE_OUT_PATH_CSV := $(call dequote,$(abspath $(call dequote, $(PROJECT_PATH))/$(call dequote,$(CONFIG_EFUSE_CUSTOM_TABLE_FILENAME))))
|
|
|
|
EFUSE_CUSTOM_TABLE_OUT_PATH := $(EFUSE_CUSTOM_TABLE_OUT_PATH_CSV:.csv=.c)
|
|
|
|
else
|
|
|
|
EFUSE_CUSTOM_TABLE_CSV_PATH :=
|
|
|
|
EFUSE_CUSTOM_TABLE_OUT_PATH :=
|
|
|
|
endif # ifdef CONFIG_EFUSE_CUSTOM_TABLE
|
2018-11-19 03:46:21 +00:00
|
|
|
|
2018-11-21 08:09:36 +00:00
|
|
|
efuse_table: $(EFUSE_COMMON_TABLE_OUT_PATH) $(EFUSE_CUSTOM_TABLE_OUT_PATH)
|
2018-11-19 03:46:21 +00:00
|
|
|
|
2018-11-21 08:09:36 +00:00
|
|
|
$(EFUSE_COMMON_TABLE_OUT_PATH): $(EFUSE_COMMON_TABLE_CSV_PATH) $(SDKCONFIG_MAKEFILE)
|
|
|
|
@echo "COMMON_TABLE_CSV: $(EFUSE_COMMON_TABLE_CSV_PATH)"
|
|
|
|
$(GEN_EFUSE_TABLE) $(EFUSE_COMMON_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG)
|
2018-11-19 03:46:21 +00:00
|
|
|
|
2018-11-21 08:09:36 +00:00
|
|
|
$(EFUSE_CUSTOM_TABLE_OUT_PATH): $(EFUSE_CUSTOM_TABLE_CSV_PATH) $(SDKCONFIG_MAKEFILE)
|
|
|
|
@echo "CUSTOM_TABLE_CSV: $(EFUSE_CUSTOM_TABLE_CSV_PATH)"
|
|
|
|
$(GEN_EFUSE_TABLE) $(EFUSE_COMMON_TABLE_CSV_PATH) $(EFUSE_CUSTOM_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG)
|
|
|
|
|
|
|
|
# print to console efuse table
|
|
|
|
show_efuse_table:
|
|
|
|
$(GEN_EFUSE_TABLE) $(EFUSE_COMMON_TABLE_CSV_PATH) $(EFUSE_CUSTOM_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG) --info
|
2018-11-19 03:46:21 +00:00
|
|
|
|
|
|
|
###################
|
|
|
|
# Generates files for unit test. This command is run manually.
|
|
|
|
EFUSE_TEST_TABLE_CSV_PATH := $(COMPONENT_PATH)/test/esp_efuse_test_table.csv
|
|
|
|
efuse_test_table:
|
2018-11-21 08:09:36 +00:00
|
|
|
$(GEN_EFUSE_TABLE) $(EFUSE_TEST_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG)
|