Requested by Marek during upstream review.
Signed-off-by: Ian Campbell <[email protected]>
---
tools/mksunxiboot.c | 41 +++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/tools/mksunxiboot.c b/tools/mksunxiboot.c
index 50fcda5..0de591b 100644
--- a/tools/mksunxiboot.c
+++ b/tools/mksunxiboot.c
@@ -16,28 +16,25 @@
#include <sys/types.h>
#include <sys/stat.h>
-typedef unsigned char u8;
-typedef unsigned int u32;
-
/* boot head definition from sun4i boot code */
struct boot_file_head {
- u32 jump_instruction; /* one intruction jumping to real code */
- u8 magic[8]; /* ="eGON.BT0" or "eGON.BT1", not C-style str */
- u32 check_sum; /* generated by PC */
- u32 length; /* generated by PC */
+ uint32_t b_instruction; /* one intruction jumping to real code */
+ uint8_t magic[8]; /* ="eGON.BT0" or "eGON.BT1", not C-style str */
+ uint32_t check_sum; /* generated by PC */
+ uint32_t length; /* generated by PC */
#if 1
/* We use a simplified header, only filling in what is needed by the
* boot ROM. To be compatible with Allwinner tools the larger header
* below should be used, followed by a custom header if desired. */
- u8 pad[12]; /* align to 32 bytes */
+ uint8_t pad[12]; /* align to 32 bytes */
#else
- u32 pub_head_size; /* the size of boot_file_head */
- u8 pub_head_vsn[4]; /* the version of boot_file_head */
- u8 file_head_vsn[4]; /* the version of boot0_file_head or
- boot1_file_head */
- u8 Boot_vsn[4]; /* Boot version */
- u8 eGON_vsn[4]; /* eGON version */
- u8 platform[8]; /* platform information */
+ uint32_t pub_head_size; /* the size of boot_file_head */
+ uint8_t pub_head_vsn[4]; /* the version of boot_file_head */
+ uint8_t file_head_vsn[4]; /* the version of boot0_file_head or
+ boot1_file_head */
+ uint8_t Boot_vsn[4]; /* Boot version */
+ uint8_t eGON_vsn[4]; /* eGON version */
+ uint8_t platform[8]; /* platform information */
#endif
};
@@ -48,17 +45,17 @@ struct boot_file_head {
int gen_check_sum(void *boot_buf)
{
struct boot_file_head *head_p;
- u32 length;
- u32 *buf;
- u32 loop;
- u32 i;
- u32 sum;
+ uint32_t length;
+ uint32_t *buf;
+ uint32_t loop;
+ uint32_t i;
+ uint32_t sum;
head_p = (struct boot_file_head *)boot_buf;
length = head_p->length;
if ((length & 0x3) != 0) /* must 4-byte-aligned */
return -1;
- buf = (u32 *)boot_buf;
+ buf = (uint32_t *)boot_buf;
head_p->check_sum = STAMP_VALUE; /* fill stamp */
loop = length >> 2;
@@ -132,7 +129,7 @@ int main(int argc, char *argv[])
}
/* fill the header */
- img.header.jump_instruction = /* b instruction */
+ img.header.b_instruction = /* b instruction */
0xEA000000 | /* jump to the first instr after the header */
((sizeof(struct boot_file_head) / sizeof(int) - 2)
& 0x00FFFFFF);
--
1.9.0
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.