blob: f0bd83bb1f99cb14bdad2865159ae9d33ec14879 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/*
* Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef BCB_H
#define BCB_H
#include <linux/types.h>
#include <linux/stat.h>
/* keep same as bootable/recovery/bootloader.h */
struct bootloader_message {
char command[32];
char status[32];
char recovery[768];
/* The 'recovery' field used to be 1024 bytes. It has only ever
been used to store the recovery command line, so 768 bytes
should be plenty. We carve off the last 256 bytes to store the
stage string (for multistage packages) and possible future
expansion. */
char stage[32];
/* The 'reserved' field used to be 224 bytes when it was initially
carved off from the 1024-byte recovery field. Bump it up to
1184-byte so that the entire bootloader_message struct rounds up
to 2048-byte.
*/
char reserved[1184];
};
struct bootloader_message_ab {
struct bootloader_message message;
char slot_suffix[32];
/* Round up the entire struct to 4096-byte. */
char reserved[2016];
};
/* start from bootloader_message_ab.slot_suffix[BOOTCTRL_IDX] */
#define BOOTCTRL_IDX 0
#define MISC_COMMAND_IDX 0
#define BOOTCTRL_OFFSET \
(u32)(&(((struct bootloader_message_ab *)0)->slot_suffix[BOOTCTRL_IDX]))
#define MISC_COMMAND \
(u32)(&(((struct bootloader_message *)0)->command[MISC_COMMAND_IDX]))
int rw_block(bool bread, char **ppblock,
uint *pblksize, char *pblock_write, uint offset, uint size);
void set_mmc_id(unsigned int id);
#endif
|