91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 10KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-29
  • 語言: 其他
  • 標簽: orange??uboot??

資源簡介

orangepi one編寫 gboot 點亮LED

資源截圖

代碼片段和文件信息

/*
?*?(C)?Copyright?2007-2011
?*?Allwinner?Technology?Co.?Ltd.?
?*?Tom?Cubie?
?*
?*?a?simple?tool?to?generate?bootable?image?for?sunxi?platform.
?*
?*?This?program?is?free?software;?you?can?redistribute?it?and/or
?*?modify?it?under?the?terms?of?the?GNU?General?Public?License?as
?*?published?by?the?Free?Software?Foundation;?either?version?2?of
?*?the?License?or?(at?your?option)?any?later?version.
?*
?*?This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE. ?See?the
?*?GNU?General?Public?License?for?more?details.
?*
?*?You?should?have?received?a?copy?of?the?GNU?General?Public?License
?*?along?with?this?program;?if?not?write?to?the?Free?Software
?*?Foundation?Inc.?59?Temple?Place?Suite?330?Boston
?*?MA?02111-1307?USA
?*/

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

typedef?unsigned?char?u8;
typedef?unsigned?int?u32;

/*?boot?head?definition?from?sun4i?boot?code?*/
typedef?struct?boot_file_head
{
u32??jump_instruction;???//?one?intruction?jumping?to?real?code
u8???magic[8];???????????//?=“eGON.BT0“?or?“eGON.BT1“??not?C-style?string.
u32??check_sum;??????????//?generated?by?PC
u32??length;?????????????//?generated?by?PC
u32??pub_head_size;??????//?the?size?of?boot_file_head_t
u8???pub_head_vsn[4];????//?the?version?of?boot_file_head_t
u8???file_head_vsn[4];???//?the?version?of?boot0_file_head_t?or?boot1_file_head_t
u8???Boot_vsn[4];????????//?Boot?version
u8???eGON_vsn[4];????????//?eGON?version
u8???platform[8];????????//?platform?information
}boot_file_head_t;

#define?BOOT0_MAGIC?????????????????????“eGON.BT0“
#define?STAMP_VALUE?????????????????????0x5F0A6C39
/*?check?sum?functon?from?sun4i?boot?code?*/
int?gen_check_sum(?void?*boot_buf?)
{
boot_file_head_t??*head_p;
u32?length;
u32?*buf;
u32?loop;
u32?i;
u32?sum;

head_p?=?(boot_file_head_t?*)boot_buf;
length?=?head_p->length;
if(?(?length?&?0x3?)?!=?0?)???????????????????//?must?4-byte-aligned
return?-1;
buf?=?(u32?*)boot_buf;
head_p->check_sum?=?STAMP_VALUE;??????????????//?fill?stamp
loop?=?length?>>?2;
/*?calculate?the?sum?*/
for(?i?=?0?sum?=?0;??i? sum?+=?buf[i];

/*?write?back?check?sum?*/
head_p->check_sum?=?sum;

return?0;
}

#define?ALIGN(xa)??????__ALIGN_MASK((x)(typeof(x))(a)-1)
#define?__ALIGN_MASK(xmask)????(((x)+(mask))&~(mask))

#define?SUN4I_SRAM_SIZE?(24?*?1024)
#define?SRAM_LOAD_MAX_SIZE?(SUN4I_SRAM_SIZE?-?sizeof(boot_file_head_t))
#define?BLOCK_SIZE?512
struct?boot_img?{
boot_file_head_t?header;
char?code[SRAM_LOAD_MAX_SIZE];
char?pad[BLOCK_SIZE];
};

int?main(int?argc?char?*?argv[])
{
int?fd_in?fd_out;
struct?boot_img?img;
unsigned?file_size?load_size;
int?count;

if(argc? printf(“\tThis?program?makes?an?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-03-07?13:27??gboot-master\
?????文件?????????282??2019-03-07?13:27??gboot-master\Makefile
?????文件?????????328??2019-03-07?13:27??gboot-master\README.md
?????文件?????????112??2019-03-07?13:27??gboot-master\gboot.bin
?????文件???????66780??2019-03-07?13:27??gboot-master\gboot.elf
?????文件?????????338??2019-03-07?13:27??gboot-master\gboot.lds
?????文件????????1266??2019-03-07?13:27??gboot-master\start.S
?????文件????????1544??2019-03-07?13:27??gboot-master\start.o
?????目錄???????????0??2019-03-07?13:27??gboot-master\tools\
?????文件??????????58??2019-03-07?13:27??gboot-master\tools\Makefile
?????文件?????????512??2019-03-07?13:27??gboot-master\tools\gboot-sdcard.bin
?????文件????????9064??2019-03-07?13:27??gboot-master\tools\mksunxiboot
?????文件????????4407??2019-03-07?13:27??gboot-master\tools\mksunxiboot.c

評論

共有 條評論