huangcm
2025-04-07 511b111543524704f6182b374e489f5d0e51db8c
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * (C) Copyright 2018
 * wangwei <wangwei@allwinnertech.com>
 * SPDX-License-Identifier: GPL-2.0+
 */
 
#ifndef  __boot0_v2_h
#define  __boot0_v2_h
 
#include <linux/types.h>
#include <spare_head.h>
 
#define BOOT0_MAGIC                     "eGON.BT0"
#define SYS_PARA_LOG                    0x4d415244
 
/******************************************************************************/
/*                              file head of Boot                             */
/******************************************************************************/
typedef struct _Boot_file_head
{
   __u32  jump_instruction;   /* one intruction jumping to real code */
   __u8   magic[MAGIC_SIZE];  /* ="eGON.BT0" */
   __u32  check_sum;          /* generated by PC */
   __u32  length;             /* generated by PC */
   __u32  pub_head_size;      /* the size of boot_file_head_t */
   __u8   pub_head_vsn[4];    /* the version of boot_file_head_t */
   __u32  ret_addr;           /* the return value */
   __u32  run_addr;           /* run addr */
   __u32  boot_cpu;           /* eGON version */
   __u8   platform[8];        /* platform information */
}boot_file_head_t;
 
 
/******************************************************************************/
/*                              file head of Boot0                            */
/******************************************************************************/
typedef struct _boot0_private_head_t
{
   __u32                       prvt_head_size;
   /*debug_mode = 0 : do not print any message,debug_mode = 1 ,print debug message*/
   __u8                        debug_mode;
   /*0:axp, 1: no axp  */
   __u8                        power_mode;
   __u8                        reserve[2];
   /*DRAM patameters for initialising dram. Original values is arbitrary*/
   unsigned int                dram_para[32];
   /*uart: num & uart pin*/
   __s32                        uart_port;
   normal_gpio_cfg             uart_ctrl[2];
   /* jtag: 1 : enable,  0 : disable */
   __s32                       enable_jtag;
    normal_gpio_cfg                jtag_gpio[5];
   /* nand/mmc pin*/
    normal_gpio_cfg             storage_gpio[32];
   /*reserve data*/
    char                        storage_data[512 - sizeof(normal_gpio_cfg) * 32];
}boot0_private_head_t;
 
typedef struct _boot0_file_head_t
{
   boot_file_head_t      boot_head;
   boot0_private_head_t  prvt_head;
   char hash[64];
}boot0_file_head_t;
 
extern const boot0_file_head_t BT0_head;
#endif