Lines Matching +full:max +full:- +full:load +full:- +full:value
5 # SPDX-License-Identifier: Apache-2.0
8 # NPCX EC series how to load the firmware from flash to code ram
10 # -i in_file.bin -o out_file.bin
11 # [-chip <name>] [-v|-vv]
12 # [-nohcrc] [-nofcrc] [-ph <offset>]
13 # [-flashsize <1|2|4|8|16>]
14 # [-spimaxclk <20|25|33|40|50>]
15 # [-spireadmode <normal|fast|dual|quad>]
112 INVALID_INPUT = -1
115 BYTES_TO_PAD = HDR_FW_HEADER_SIG_OFFSET - RESERVED_BYTES_OFFSET
166 :returns: output file path object, or -1 if fails
173 exit_with_failure("Define input file, using -i flag")
221 """writes the anchor value to the output file
231 print(f'- HDR - FW Header ANCHOR - Offset '
232 f'{HDR_ANCHOR_OFFSET} - {_hex_print_format(FW_HDR_ANCHOR)}')
237 """writes the extended anchor value to the output file
254 print(f'- HDR - Header EXTENDED ANCHOR - Offset'
255 f' {HDR_EXTENDED_ANCHOR_OFFSET} - {anchor_to_print}')
263 firmware header offset is a non-negative integer.
293 if input_file_size - HEADER_SIZE < paste_fw_offset:
307 Bits 2-0 - SPI MAX Clock
330 message = f'Invalid SPI Core Clock Ratio (3) - it should be 1 or 2'
357 "Cannot read SPI Flash Max Clock")
359 message = f'Invalid SPI Flash MAX Clock size ({spi_max_clock}) '
360 message += '- it should be 20, 25, 33, 40 or 50 MHz'
365 print(f'- HDR - SPI flash MAX Clock - Offset '
366 f'{HDR_SPI_MAX_CLK_OFFSET} - '
377 Bits 2-0 - SPI Flash Read Mode
412 print(f'- HDR - SPI flash Read Mode - Offset '
413 f'{HDR_SPI_READ_MODE_OFFSET} - '
419 """writes the error detection configuration value (enabled/disabled)
436 print(f'- HDR - FW CRC Enabled - Offset '
437 f'{HDR_ERR_DETECTION_CONF_OFFSET} - '
443 """writes the fw load address to the output file
470 message = f'Cannot read FW Load start address'
474 message = f'Firmware load address ({fw_load_addr_to_print}) ' \
479 message = f'Firmware load address ({fw_load_addr_to_print}) ' \
500 print(f'- HDR - FW load start address - Offset '
501 f'{HDR_FW_LOAD_START_ADDR_OFFSET} - '
520 # check if fwep flag wasn't set and set it to fw load address if needed
526 message = f'-usearmrst not allowed, FW entry point already set using '\
527 f'-fwep !'
543 f'should be between the FW load address ' \
556 print(f'- HDR - FW Entry point - Offset '
557 f'{HDR_FW_ENTRY_POINT_OFFSET} - '
563 --crc start address should be 4 byte aligned, bigger than crc end address
564 --crc size should be 4 byte aligned, and be set to firmware length minus
566 --crc end address is crc start address + crc size bytes
578 fw_crc_end = ecst_args.firmware_length - 1
579 # default value for crc size
580 fw_crc_size = ecst_args.firmware_length - fw_crc_start
583 fw_crc_end = fw_crc_start + fw_crc_size - 1
605 if fw_crc_end > ecst_args.firmware_length - 1:
621 print(f'- HDR - FW CRC Start - Offset '
622 f'{HDR_FW_ERR_DETECT_START_ADDR_OFFSET} - '
625 print(f'- HDR - FW CRC End - Offset '
626 f'{HDR_FW_ERR_DETECT_END_ADDR_OFFSET} - '
630 """writes the flash size value to the output file
631 Note: the firmware length value has already been checked before
646 print(f'- HDR - FW Length - Offset '
647 f'{HDR_FW_LENGTH_OFFSET} - '
652 """writes the flash size value to the output file
688 f' please note - for 0.5 MBytes flash, enter \'1\' '
693 print(f'- HDR - Flash size - Offset '
694 f'{HDR_FLASH_SIZE_OFFSET} - '
744 print(f'- HDR - Header CRC - Offset '
745 f'{HDR_FW_HEADER_SIG_OFFSET} - '
780 print(f'- HDR - Header CRC - Offset '
781 f'{HDR_FW_IMAGE_SIG_OFFSET} - '
805 bytes_to_pad_num = abs((16 - input_file_size) % 16)
812 i -= 1
821 ecst_args.firmware_length = input_file_size - HEADER_SIZE - \
942 final_crc |= current_bit << (NUM_OF_BYTES - 1) - j
945 def _hex_print_format(value): argument
948 :param value: an integer to be represented in hex
950 return "0x{:08x}".format(value)