Source
fprintf(stderr, "input image too big. Maximum is %d bytes, got %ld bytes\n",
static int add_barebox_header;
struct socfpga_header {
uint8_t validation_word[4];
uint8_t version;
uint8_t flags;
uint8_t program_length[2];
uint8_t spare[2];
uint8_t checksum[2];
};
static uint32_t bb_header[] = {
0xea00007e, /* b 0x200 */
0xeafffffe, /* 1: b 1b */
0xeafffffe, /* 1: b 1b */
0xeafffffe, /* 1: b 1b */
0xeafffffe, /* 1: b 1b */
0xeafffffe, /* 1: b 1b */
0xeafffffe, /* 1: b 1b */
0xeafffffe, /* 1: b 1b */
0x65726162, /* 'bare' */
0x00786f62, /* 'box\0' */
0x00000000, /* padding */
0x00000000, /* padding */
0x00000000, /* padding */
0x00000000, /* padding */
0x00000000, /* padding */
0x00000000, /* padding */
0x00000000, /* socfpga header */
0x00000000, /* socfpga header */
0x00000000, /* socfpga header */
0xea00006b, /* entry. b 0x200 */
};
static int read_full(int fd, void *buf, size_t size)
{
size_t insize = size;
int now;
int total = 0;
while (size) {
now = read(fd, buf, size);
if (now == 0)
return total;
if (now < 0)
return now;
total += now;