📄 bootpara.h
字号:
#ifndef BOOTPARAMS_H
#define BOOTPARAMS_H
typedef struct {
char flags[12];
unsigned int val;
} ParamItem;
typedef struct {
ParamItem start;
//ParamItem cpu_clk;
ParamItem boot_delay;
ParamItem serial_sel;
ParamItem AppRun_addr;
ParamItem serial_baud;
ParamItem machine;
ParamItem run_addr;
ParamItem root_sel;
ParamItem tty_sel;
ParamItem display_sel;
ParamItem initrd_addr;
ParamItem initrd_len;
ParamItem mem_cfg;
//ParamItem devfs_sel;
//ParamItem osstor;
ParamItem user_params;
char string[128];
unsigned int bpage[50];
} BootParams;
typedef struct {
ParamItem vid;
ParamItem pid;
ParamItem ser_l;
ParamItem ser_h;
ParamItem user_params;
char string[128];
} VenderParams;
int search_params(void);
int save_params(void);
int set_params(void);
#define DEFAULT_USER_PARAMS "display=vga640"
#ifdef GLOBAL_PARAMS
//小于等于512个字节,最多保存24个ITEM和128字节用户定义的字符串
BootParams boot_params = {
{"auto-run", 1}, //0=boot without parameters,1=boot with parameters
//{"cpuclk", 2}, //0=200M, 1=300M, 2=400M, 3=440M
{"rundelay", 0}, //0 seconds
{"serial", 0}, //0=serial port 0, 1=serial port 1
{"AppRunAddr", 0x32000000},
{"baudrate", 115200},
{"machine", 193},
{"runAddr", 0x30201000},
{"rootfs", 3},
{"tty", 0},
{"display", 0}, //0=320*240 1=640*480
{"initrdA", 0x30200000},
{"initrdL", 0},
{"memsize", 0x04000000},
//{"devfs", 1},
//{"ostore", 0}, //0=nand, 1=nor
{"userpara", sizeof(DEFAULT_USER_PARAMS)},
DEFAULT_USER_PARAMS,
{0}
};
//小于等于256字节
VenderParams vend_params = {
{"VendID", 0x76543210},
{"ProdID", 0xfedcba98},
{"Serial_L", 0x01234567},
{"Serial_H", 0x89abcdef},
{"userpara", 1}, //0=data, 1=string
"www.witech.com.cn"
};
#else
extern BootParams boot_params;
extern VenderParams vend_params;
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -