第一范文网 - 专业文章范例文档资料分享平台

BOOTLoader

来源:用户分享 时间:2025/10/27 22:14:13 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

;@0x33FF_FF60 HandleLCD HandleDMA0 HandleDMA1 HandleDMA2 HandleDMA3 HandleMMC HandleSPI0 HandleUART1 HandleNFCON HandleUSBD HandleUSBH HandleIIC HandleUART0 HandleSPI1 HandleRTC

# # # #

4 4 4 4

# 4 # 4 # 4 # 4

# 4

; Added for 2440.

# 4 # 4 # 4 # 4 # 4 # 4

HandleADC # 4 ;@0x33FF_FFA0 END

2440addr.inc

GBLL BIG_ENDIAN__

BIG_ENDIAN__ SETL {FALSE}

;================= ; Memory control

;=================

BWSCON EQU 0x48000000 ;Bus width & wait status BANKCON0 EQU 0x48000004 ;Boot ROM control BANKCON1 EQU 0x48000008 ;BANK1 control BANKCON2 EQU 0x4800000c ;BANK2 control BANKCON3 EQU 0x48000010 ;BANK3 control BANKCON4 EQU 0x48000014 ;BANK4 control BANKCON5 EQU 0x48000018 ;BANK5 control BANKCON6 EQU 0x4800001c ;BANK6 control BANKCON7 EQU 0x48000020 ;BANK7 control REFRESH EQU 0x48000024 ;DRAM/SDRAM refresh BANKSIZE EQU 0x48000028 ;Flexible Bank Size

MRSRB6 EQU 0x4800002c ;Mode register set for SDRAM Bank6 MRSRB7 EQU 0x48000030 ;Mode register set for SDRAM Bank7

;==========================

; CLOCK & POWER MANAGEMENT ;==========================

LOCKTIME EQU 0x4c000000 ;PLL lock time counter MPLLCON EQU 0x4c000004 ;MPLL Control UPLLCON EQU 0x4c000008 ;UPLL Control CLKCON EQU 0x4c00000c ;Clock generator control CLKSLOW EQU 0x4c000010 ;Slow clock control CLKDIVN EQU 0x4c000014 ;Clock divider control

;================= ; INTERRUPT

;=================

SRCPND EQU 0x4a000000 INTMOD EQU 0x4a000004 INTMSK EQU 0x4a000008 PRIORITY EQU 0x4a00000c INTPND EQU 0x4a000010 INTOFFSET EQU 0x4a000014 SUSSRCPND EQU 0x4a000018 INTSUBMSK EQU 0x4a00001c

;================= ; I/O PORT for LED ;=================

GPFCON EQU 0x56000050 GPFDAT EQU 0x56000054 GPFUP EQU 0x56000058

;Miscellaneous register

MISCCR EQU 0x56000080 DCKCON EQU 0x56000084 EXTINT0 EQU 0x56000088 EXTINT1 EQU 0x5600008c EXTINT2 EQU 0x56000090 EINTFLT0 EQU 0x56000094 EINTFLT1 EQU 0x56000098 EINTFLT2 EQU 0x5600009c EINTFLT3

EQU 0x560000a0 EINTMASK EQU 0x560000a4 EINTPEND EQU 0x560000a8 GSTATUS0 EQU 0x560000ac GSTATUS1 EQU 0x560000b0 GSTATUS2 EQU 0x560000b4 ;Interrupt request status ;Interrupt mode control ;Interrupt mask control

;IRQ priority control <-- May 06, 2002 SOP ;Interrupt request status

;Interruot request source offset ;Sub source pending ;Interrupt sub mask ;Port F control ;Port F data ;Pull-up control F ;Miscellaneous control ;DCLK0/1 control ;External interrupt control register 0 ;External interrupt control register 1 ;External interrupt control register 2 ;Reserved ;Reserved

;External interrupt filter control register 2 ;External interrupt filter control register 3

;External interrupt mask ;External interrupt pending ;External pin status ;Chip ID(0x32440000) ;Reset type

GSTATUS3 EQU 0x560000b8 ;Saved data0(32-bit) before entering POWER_OFF mode GSTATUS4 EQU 0x560000bc ;Saved data1(32-bit) before entering POWER_OFF mode

;Added for 2440 MSLCON

; DonGo

EQU 0x560000cc ;Memory sleep control register

;================= ; WATCH DOG TIMER

;================= WTCON EQU 0x53000000 ;Watch-dog timer mode WTDAT EQU 0x53000004 ;Watch-dog timer data WTCNT EQU 0x53000008 ;Eatch-dog timer count

END

2440lib.c

#include \#include \#include \#include \#include \

#include #include #include #include #include

//***************************[PORTS]******************************************* void Port_Init(void) {

//CAUTION:Follow the configuration order for setting the ports. // 1) setting value(GPnDAT)

// 2) setting control register (GPnCON) // 3) configure pull-up resistor(GPnUP)

//32bit data bus configuration //*** PORT A GROUP

//Ports : GPA22 GPA21 GPA20 GPA19 GPA18 GPA17 GPA16 GPA15 GPA14 GPA13

GPA12

//Signal : nFCE nRSTOUT nFRE nFWE ALE CLE nGCS5 nGCS4 nGCS3 nGCS2 nGCS1

//Binary : 1 1 1 , 1 1 1 1 , 1 1 1 1

//Ports : GPA11 GPA10 GPA9 GPA8 GPA7 GPA6 GPA5 GPA4 GPA3 GPA2 GPA1 GPA0

//Signal : ADDR26 ADDR25 ADDR24 ADDR23 ADDR22 ADDR21 ADDR20 ADDR19 ADDR18 ADDR17 ADDR16 ADDR0

//Binary : 1 1 1 1 , 1 1 1 1 , 1 1 1 1 rGPACON = 0x7fffff;

//**** PORT B GROUP

//Ports : GPB10 GPB9 GPB8 GPB7 GPB6 GPB5 GPB4 GPB3 GPB2 GPB1 GPB0

//Signal : nXDREQ0 nXDACK0 nXDREQ1 nXDACK1 nSS_KBD nDIS_OFF L3CLOCK L3DATA L3MODE nIrDATXDEN Keyboard

//Setting: OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT

//Binary : 01 , 01 01 , 01 01 , 01 01 , 01 01 , 01 01

rGPBCON = 0x155555;

rGPBUP = 0x7ff; // The pull up function is disabled GPB[10:0]

//*** PORT C GROUP

//Ports : GPC15 GPC14 GPC13 GPC12 GPC11 GPC10 GPC9 GPC8 GPC7 GPC6 GPC5 GPC4 GPC3 GPC2 GPC1 GPC0

//Signal : VD7 VD6 VD5 VD4 VD3 VD2 VD1 VD0 LCDVF2 LCDVF1 LCDVF0 VM VFRAME VLINE VCLK LEND

//Binary : 10 10 , 10 10 , 10 10 , 10 10 , 10 10 , 10 10 , 10 10 , 10 10

rGPCCON = 0xaaaaaaaa;

rGPCUP = 0xffff; // The pull up function is disabled GPC[15:0]

//*** PORT D GROUP

//Ports : GPD15 GPD14 GPD13 GPD12 GPD11 GPD10 GPD9 GPD8 GPD7 GPD6 GPD5 GPD4 GPD3 GPD2 GPD1 GPD0

//Signal : VD23 VD22 VD21 VD20 VD19 VD18 VD17 VD16 VD15 VD14 VD13 VD12 VD11 VD10 VD9 VD8

//Binary : 10 10 , 10 10 , 10 10 , 10 10 , 10 10 , 10 10 , 10 10 ,10 10

rGPDCON = 0xaaaaaaaa;

rGPDUP = 0xffff; // The pull up function is disabled GPD[15:0]

搜索更多关于: BOOTLoader 的文档
BOOTLoader.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c02xw00494w7f1wl0kie7_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top