os/, build/configs/: Segregate board specific changes from mkldscript.py#7226
os/, build/configs/: Segregate board specific changes from mkldscript.py#7226namanjain7 wants to merge 1 commit intoSamsung:masterfrom
Conversation
|
Removed support for common_.ld and app1_.ld |
74890f1 to
e5a232b
Compare
|
@ewoodev : please review design so we can make changes accordingly in discussed design.
|
| ifeq ($(CONFIG_XIP_ELF),y) | ||
| MEM_VARS := $(shell python $(TOPDIR)/tools/mkldscript.py $(CONFIG_APP1_BIN_NAME)) | ||
| $(foreach v,$(MEM_VARS),$(eval $(v))) | ||
| APP1_LD_DEFS := \ |
There was a problem hiding this comment.
This file is common including from app1 app2.
please check app2 case
There was a problem hiding this comment.
yes, we are adding both,
- app2 and also
- OTA index (just like before it was for both cases). We will take OTA index as argument and will fix it by defconfig as slot 0.
| get_flash_address(binary_type) # Get flash address and size from board specific code | ||
|
|
||
| offset = offset + part_size | ||
| PART_IDX = PART_IDX + 1 | ||
| if binary_type == "common": | ||
| print("RAM_ADD={}".format(common_ram_start)) | ||
| print("RAM_SIZE={}".format(hex(common_ram_size))) | ||
| elif binary_type == "app1": | ||
| print("RAM_ADD={}".format(app1_ram_start)) | ||
| print("RAM_SIZE={}".format(app1_ram_size)) | ||
| elif binary_type == "app2": | ||
| print("RAM_ADD={}".format(app2_ram_start)) | ||
| print("RAM_SIZE={}".format(app2_ram_size)) |
There was a problem hiding this comment.
why everytime calculate and return only one?
it's better calculating once of argument at that time.
There was a problem hiding this comment.
Code modified.
Now, when script is called for common binary, then addresses for app1, app2 will also be calculated and saved in json file. When call for app1, app2 comes, it will fetch from json cache file and return it directly without calculating.
| def get_flash_address(binary_name): | ||
| global offset | ||
| """ | ||
| Get flash address for specified binary (common/app1/app2) in dual OTA mode. | ||
| For rtl8730e, offset starts from base address and accumulates through partitions. | ||
| Returns FLASH_ADD and FLASH_SIZE for the specified binary. | ||
| """ | ||
| index = 0 | ||
| ota_index = 1 | ||
|
|
||
| current_offset = offset | ||
|
|
||
| for name in NAME_LIST: | ||
| part_size = int(SIZE_LIST[index]) * 1024 | ||
|
|
||
| if name == "kernel": | ||
| ota_index = (ota_index + 1) % 2 | ||
| elif name == binary_name: | ||
| if binary_name == "common": | ||
| binary_start = hex(current_offset + 0x10 + signing_offset) | ||
| binary_size = hex(part_size - 0x10 - signing_offset) | ||
| else: | ||
| binary_start = hex(current_offset + 0x30 + signing_offset) | ||
| binary_size = hex(part_size - 0x30 - signing_offset) | ||
|
|
||
| print("FLASH_ADD={}".format(binary_start)) | ||
| print("FLASH_SIZE={}".format(binary_size)) | ||
| return | ||
|
|
||
| current_offset = current_offset + part_size | ||
| index += 1 |
There was a problem hiding this comment.
This function is board specific?
i think, platform just needs only virture start address of kernel partition
|
@namanjain7 This is pending for long time. Please let me know status. |
Hello Mr. chang, |
|
we have added dynamic ram start calculation for each partition. |
| print(sys.argv[5]) | ||
|
|
||
| if __name__ == "__main__": | ||
| get_mem_config() |
00dffd1 to
cc05d68
Compare
|
we will update flash addressing related changes after more verify |
| COMMON_BINARY_NAME=common | ||
| MEM_VARS := $(shell python $(TOPDIR)/tools/mkldscript.py $(COMMON_BINARY_NAME)) | ||
| $(foreach v,$(MEM_VARS),$(eval $(v))) | ||
| COMMON_LD_DEFS := \ | ||
| --defsym __FLASH_START_ADDRESS__=$(FLASH_ADD) \ | ||
| --defsym __FLASH_SIZE__=$(FLASH_SIZE) \ | ||
| --defsym __RAM_START_ADDRESS__=$(RAM_ADD) \ | ||
| --defsym __RAM_SIZE__=$(RAM_SIZE) |
There was a problem hiding this comment.
this code is added severel code(common app1 app2)
how about make function??
There was a problem hiding this comment.
The common binary is build in Makefile.unix. So, this code will execute once.
For app1, app2, --> The makefile is loadable.mk
Both have different makefiles.
| cfg_file = os.path.join(os_folder, '.config') | ||
| build_folder = os.path.join(os_folder, '..', 'build') | ||
| output_folder = os.path.join(build_folder, 'output', 'bin') | ||
| saved_config_file_path = os.path.join(output_folder, 'mem_layout_cache.json') |
There was a problem hiding this comment.
i'd like to know why this is needed.
which file is using this file?
There was a problem hiding this comment.
cfg_file ->used to get CONFIG_RAM_START, common app1 app2... binary size to get address.
build_folder, output_folder, saved_config_file_path -> For saving json file in output folder. This file will have config values extracted from .config file and memory values.
d22117d to
bb87918
Compare
|
All issues resolved. We have tested in tp1x, tp1x plus, and ailite boards. |
mkldscript.py was used to make .ld script containing flash and ram start address and size. The file contained code changes for both rtl8730e and bk7239n. This commit removes this file and make a common file and board specific file. We added new file bin_mem_layout.py which is used to print the data. In makefile, we are reading the data and passing it as an argument in makefile, instead of directly importing .ld scripts.
bb87918 to
547e5d4
Compare
Refactor mkldscript.py file. Add common code in mkldscript.py and board specific address calculation to build/configs//scripts