大连零基础网站建设培训电话,浏览器入口,舞台搭建费用明细,wordpress升级教程1. u-boot修改 board/ti/am335x/board.c void s_init(void)和static int read_eeprom(void)这两个函数要从e2中读取数据#xff0c;只需要把原版的bbb的e2中的数据读出来并添充到相应的数据结构里即可。 最终是要填充这个结构体 struct am335x_baseboard_id { unsigned int m…1. u-boot修改 board/ti/am335x/board.c void s_init(void)和static int read_eeprom(void)这两个函数要从e2中读取数据只需要把原版的bbb的e2中的数据读出来并添充到相应的数据结构里即可。 最终是要填充这个结构体 struct am335x_baseboard_id { unsigned int magic; char name[HDR_NAME_LEN]; char version[4]; char serial[12]; char config[32]; char mac_addr[HDR_NO_OF_MAC_ADDR][HDR_ETH_ALEN]; }; 先在原版的板子上打印这个结构体数据 int i 0; uchar *tmp (uchar *)header; //header即为am335x_baseboard_id的变量 for(i 0; i sizeof(header); i) { if(i%10 0) printf(\n); printf(%x , *tmp); tmp; } 数据如下 unsigned char e2_data[80] {0xaa, 0x55, 0x33, 0xee, 0x41, 0x33, 0x33, 0x35, 0x42, 0x4e, 0x4c, 0x54, 0x30, 0x30, 0x41, 0x35, 0x35, 0x30, 0x30, 0x34, 0x42, 0x42, 0x42, 0x4b, 0x32, 0x37, 0x35, 0x30, 0x58, 0x41, 0x58, 0x58, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 然后在代码里填充这个结构体即可 int i 0; uchar *tmp (uchar *)header; for(i 0; i sizeof(header); i) { tmp[i] e2_data[i]; } 然后修改代码找不到和读不到e2时别让程序return就可以了
2. kernel修改 arch/arm/mach-omap2/board-am335xevm.c static void am335x_evm_setup(struct memory_accessor *mem_acc, void *context) 修改以下两个地方即可 if (ret ! sizeof(am335x_mac_addr)) { pr_warning(AM335X: EVM Config read fail: %d\n, ret); //return; memcpy(am335x_mac_addr, e2_data EEPROM_MAC_ADDRESS_OFFSET, sizeof(am335x_mac_addr)); } if (ret ! sizeof(config)) { pr_err(AM335X EVM config read fail, read %d bytes\n, ret); pr_err(This likely means that there either is no/or a failed EEPROM\n); //goto out; memcpy((char *)config, e2_data, sizeof(config)); }