Lines Matching refs:bs

156 bool bootloader_utility_load_partition_table(bootloader_state_t *bs)  in bootloader_utility_load_partition_table()  argument
190 bs->factory = partition->pos; in bootloader_utility_load_partition_table()
194 bs->test = partition->pos; in bootloader_utility_load_partition_table()
200 bs->ota[partition->subtype & PART_SUBTYPE_OTA_MASK] = partition->pos; in bootloader_utility_load_partition_table()
201 ++bs->app_count; in bootloader_utility_load_partition_table()
212 bs->ota_info = partition->pos; in bootloader_utility_load_partition_table()
252 static esp_partition_pos_t index_to_partition(const bootloader_state_t *bs, int index) in index_to_partition() argument
255 return bs->factory; in index_to_partition()
259 return bs->test; in index_to_partition()
262 if (index >= 0 && index < MAX_OTA_SLOTS && index < (int)bs->app_count) { in index_to_partition()
263 return bs->ota[index]; in index_to_partition()
328 static int get_active_otadata_with_check_anti_rollback(const bootloader_state_t *bs, esp_ota_select… in get_active_otadata_with_check_anti_rollback() argument
341 ota_slot = ota_seq % bs->app_count; // Actual OTA partition selection in get_active_otadata_with_check_anti_rollback()
342 if (check_anti_rollback(&bs->ota[ota_slot]) == false) { in get_active_otadata_with_check_anti_rollback()
355 int bootloader_utility_get_selected_boot_partition(const bootloader_state_t *bs) argument
360 if (bs->ota_info.offset == 0) {
364 if (read_otadata(&bs->ota_info, otadata) != ESP_OK) {
378 … write_otadata(&otadata[i], bs->ota_info.offset + FLASH_SECTOR_SIZE * i, write_encrypted);
386 bs->app_count == 0) {
387 …ll-0xFF) or partition table does not have bootable ota_apps (app_count=%"PRIu32")", bs->app_count);
388 if (bs->factory.offset != 0) {
415 int active_otadata = get_active_otadata_with_check_anti_rollback(bs, otadata);
420 boot_index = ota_seq % bs->app_count; // Actual OTA partition selection
426 …write_otadata(&otadata[active_otadata], bs->ota_info.offset + FLASH_SECTOR_SIZE * active_otadata, …
432 update_anti_rollback(&bs->ota[boot_index]);
436 } else if (bs->factory.offset != 0) {
468 static void set_actual_ota_seq(const bootloader_state_t *bs, int index) argument
478 write_otadata(&otadata, bs->ota_info.offset + FLASH_SECTOR_SIZE * 0, write_encrypted);
481 update_anti_rollback(&bs->ota[index]);
486 esp_partition_pos_t partition = index_to_partition(bs, index);
515 void bootloader_utility_load_boot_image(const bootloader_state_t *bs, int start_index) argument
522 if (check_anti_rollback(&bs->test) && try_load_partition(&bs->test, &image_data)) {
532 part = index_to_partition(bs, index);
538 set_actual_ota_seq(bs, index);
545 for (index = start_index + 1; index < (int)bs->app_count; index++) {
546 part = index_to_partition(bs, index);
552 set_actual_ota_seq(bs, index);
558 if (check_anti_rollback(&bs->test) && try_load_partition(&bs->test, &image_data)) {