📄 main.c
字号:
/***************************************** Copyright (c) 2001-2002 Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************//* This is file is part of the Jasper PVP boot loader */#include "config.h"#include "uart.h"#include "util.h"#include "jasper.h"#include "bootflash.h"#include "em85xx_pbi.h"int boot_status;#include "jasper.h"void EM85xx_WritePIO (int PIONumber, int Data){ // don't assume that PIO is output if (PIONumber < 16) { *PIO_0_DATA_REG = ((Data? 0x00010001:0x00010000) << PIONumber); *PIO_0_DIR_REG = (0x00010001 << PIONumber); } else { *PIO_1_DATA_REG = ((Data? 0x00010001:0x00010000) << (PIONumber-16)); *PIO_1_DIR_REG = (0x00010001 << (PIONumber-16)); }}// ************************// This is the normal entry// ************************int entry (void){ unsigned long kload = KERNEL_LOAD_ADDRESS;#ifdef ENABLE_UART InitUart (); PrintUart ("\r\nEM85xx Bootloader v" BOOTLOADER_VERSIONSTR " (" __DATE__ " " __TIME__ ")\r\n", -1); PrintUart ("\r\n", -1);#endif // For old envision board - enables network // PIO1_3, PIO1_4 to low// EM85xx_WritePIO (3 + 16, 0);// EM85xx_WritePIO (4 + 16, 0);#if 1 // Setup PBI bus *PB_SL_CTRL = PBI_IN_IDE_PADS; *PB_CS_CONFIG &= ~(0x1111 << 0); // 0x3000 *PB_CS_CONFIG |= PBI_IDE << 0; // 0x3000 // Enable bus output *(unsigned long *)0x00500B40 = 0x10000; // enable IDE output#endif if (!try_boot_flash (kload, ROMFS_START_ADDRESS)) { PrintUart ("boot_flash failed\r\n", 64); goto boot_failed; } // return the adress to jump to PrintUart ("jumping to ", 64); PrintLong ((unsigned long)kload); PrintUart ("\r\n", 64); return (int)kload;boot_failed: // What to do when everything fails while (1); return -1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -