⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bootpara.h

📁 s3c2440 bootloader适用于S3C2440开发板
💻 H
字号:
#ifndef BOOTPARAMS_H
#define	BOOTPARAMS_H

typedef struct {
	char flags[12];
	unsigned int val;
} ParamItem;

typedef struct {
	ParamItem start;        // 启动代码标志
	ParamItem cpu_clk;      // CPU 时钟
	ParamItem boot_delay;   // boot自动启动的时间
	ParamItem serial_sel;   // 串口号
	ParamItem serial_baud;  // 波特率
	ParamItem machine;      //
	ParamItem run_addr;     // 应用程序启动地址
	ParamItem root_sel;
	ParamItem tty_sel;
	ParamItem initrd_addr;
	ParamItem initrd_len;
	ParamItem mem_cfg;
	ParamItem devfs_sel;
	ParamItem osstor;
	ParamItem user_params;
	char string[512];
} 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	"root=/dev/mtdblock1 rw rootfstype=jffs2 noinitrd init=/linuxrc console=ttySAC1,115200 mem=64M ip=192.168.1.7:192.168.1.1:192.168.1.1:255.255.255.0:avantech:eth0:off\0"
	//"display=shp240"

#ifdef GLOBAL_PARAMS

//小于等于512个字节,最多保存24个ITEM和128字节用户定义的字符串
BootParams boot_params = {
	{"bootpara", 3},	//0=boot without parameters,1=boot with parameters
	{"cpuclk",   0},	//0=296M, 1=399M, 2=400M, 3=440M
	{"rundelay", 5},	//0 seconds
	{"serial",   1},	//0=serial port 0, 1=serial port 1
	{"baudrate", 115200},
	{"machine",  362},
	{"runAddr",  0x30400000}, 
	{"rootfs",   2},
	{"tty",      1},
	{"initrdA",  0},
	{"initrdL",  0},
	{"memsize",  0x04000000},
	{"devfs",    1},
	{"ostore",   0},	//0=nand, 1=nor
	{"userpara", sizeof(DEFAULT_USER_PARAMS)},
//	{"userpara", 256},
	DEFAULT_USER_PARAMS
};

//小于等于256字节
VenderParams vend_params = {
	{"VendID",   0x76543210},
	{"ProdID",   0xfedcba98},
	{"Serial_L", 0x01234567},
	{"Serial_H", 0x89abcdef},
	{"userpara", 1},	//0=data, 1=string
	
};

#else

extern BootParams boot_params;
extern VenderParams vend_params;

#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -