Files
qdl/program.h
Bjorn Andersson 321e776cb7 firehose: Handle multiple primary bootloaders
Builds with multiple copies of the primary bootloader does not make
sense, but after successfully flashing all the partitions of such build
it makes more sense to make one of them bootable, at least more than
skipping the step and saying that none was found.

Pick the first found primary bootloader and warn the user about the
situation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2024-12-20 10:37:08 -06:00

32 lines
790 B
C

#ifndef __PROGRAM_H__
#define __PROGRAM_H__
#include <stdbool.h>
#include "qdl.h"
struct program {
unsigned pages_per_block;
unsigned sector_size;
unsigned file_offset;
const char *filename;
const char *label;
unsigned num_sectors;
unsigned partition;
const char *start_sector;
unsigned last_sector;
bool is_nand;
bool is_erase;
struct program *next;
};
int program_load(const char *program_file, bool is_nand);
int program_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program, int fd),
const char *incdir, bool allow_missing);
int erase_execute(struct qdl_device *qdl, int (*apply)(struct qdl_device *qdl, struct program *program));
int program_find_bootable_partition(bool *multiple_found);
void free_programs(void);
#endif