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

📄 loader.c

📁 Hermit-at-1.1.3,一款bootloader
💻 C
字号:
/* * Copyright (c) 2004-2006 Atmark Techno, Inc.  All Rights Reserved. */#include <target/buffer.h>#include <target/crc.h>#include <target/io.h>#include <target/flash.h>#include <target/frob.h>#include <target/mem.h>#include <target/str.h>#include <target/medium.h>#include <target/memzero.h>#include <target/setenv.h>#include <target/gunzip.h>#include <ep93xx/ioregs.h>#include "linux.h"#include "memmap.h"#include "board.h"#ifdef ENABLE_ETH#include <target/net/mac.h>#include "tftpdl.h"#endifchar target_name[256];char *target_profile = target_name;static const command_t *commands[] = {	&help_command,	&boot_command,	&clearenv_command,	&download_command,	&flash_erase_command,	&frob_command,	&jump_command,	&linux_command,	&medium_command,	&memmap_command,	&flash_program_command,	&setenv_command,	&unzip_command,	&upload_command,	&version_command,	&info_command,#ifdef ENABLE_ETH        &mac_command,        &tftpdl_command,#endif	0};ABBR(boot_command, 'b')ABBR(help_command, '?')ABBR(frob_command, 'f')ABBR(version_command, 'V')static const abbrev_t *abbrevs[] = {	&boot_command_abbrev,	&help_command_abbrev,	&frob_command_abbrev,	&version_command_abbrev,	0};int hmain(void){	command_list_t command_list = { commands, abbrevs, "hermit", 0 };	int len;	flash_initialize(FLASH_TYPE_AMD, FLASH_START);       	board_init();	check_mode_jumper();	switch (board_info.id) {      	case BOARD_ID_A210:	  *(unsigned long *)GPIO_PEDDR = 0x03;	  *(unsigned long *)GPIO_PEDR = 0x02;	  break;	case BOARD_ID_A230:	  *(unsigned long *)SMCBCR7 = 0x100085cb; //ICY:15,WST1:14,WST2:32	case BOARD_ID_A220:	case BOARD_ID_A240:	  *(unsigned long *)SMCBCR3 = 0x00000460;	case BOARD_ID_A210C:	  *(unsigned long *)GPIO_PCDDR = 0x80;	  *(unsigned long *)GPIO_PCDR = 0x80;	  break;	default:	  hprintf("warning: Not matched board type!(%x)\n", board_info.id);	  break;	}#if 0	update_board_name(get_board_name(id));#endif	memzero(target_name, 256);	len = strlen(get_board_name(board_info.id));	strcpy(&target_name[0], get_board_name(board_info.id));	if(strlen(PROFILE_STRING)){	  target_name[len] = '/';	  strcpy(&target_name[len + 1], PROFILE_STRING);	  target_name[len + 1 + strlen(PROFILE_STRING)] = 0; //NULL	}	init_crc32();	/* startup stuff: activate LED and print version string */	(*version_command.func)(0, 0);#if defined RELOCATE	if(jumper_mode == 0){	  //Linux-Boot	  (*boot_command.func)(0, 0);	}#endif	switch (board_info.id) {	case BOARD_ID_A210:	case BOARD_ID_A210C:	  LED_RED_OFF();	  break;	default:	  break;	}	do_command_loop(&command_list);	for (;;);}

⌨️ 快捷键说明

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