二、S3C2440启动代码中与大小管相关的代码
Option.inc中相关代码
- GBLL ENDIAN_CHANGE
- ENDIAN_CHANGE<span style="white-space:pre"> </span>SETL<span style="white-space:pre"> </span>{TRUE}
- GBLA ENTRY_BUS_WIDTH
- ENTRY_BUS_WIDTH SETA 16
- AREA Init,CODE,READONLY
- ENTRY
- EXPORT __ENTRY
- __ENTRY
- ResetEntry
- ;1)The code, which converts to Big-endian, should be in little endian code.
- ;2)The following little endian code will be compiled in Big-Endian mode.
- ; The code byte order should be changed as the memory bus width.
- ;3)The pseudo instruction,DCD can not be used here because the linker generates error.
- ASSERT :DEF:ENDIAN_CHANGE
- [ ENDIAN_CHANGE
- ASSERT :DEF:ENTRY_BUS_WIDTH
- [ ENTRY_BUS_WIDTH=32
- b ChangeBigEndian ;DCD 0xea000007
- ]
- [ ENTRY_BUS_WIDTH=16
- andeq r14,r7,r0,lsl #20 ;DCD 0x0007ea00
- ]
- [ ENTRY_BUS_WIDTH=8
- streq r0,[r0,-r10,ror #1] ;DCD 0x070000ea
- ]
- |
- b ResetHandler
- ]
- b HandlerUndef ;handler for Undefined mode
- b HandlerSWI ;handler for SWI interrupt
- b HandlerPabort ;handler for PAbort
- b HandlerDabort ;handler for DAbort
- b . ;reserved
- b HandlerIRQ ;handler for IRQ interrupt
- b HandlerFIQ ;handler for FIQ interrupt
- ;@0x20
- b EnterPWDN ; Must be @0x20.
- ChangeBigEndian
- ;@0x24
- [ ENTRY_BUS_WIDTH=32
- DCD 0xee110f10 ;0xee110f10 => mrc p15,0,r0,c1,c0,0
- DCD 0xe3800080 ;0xe3800080 => orr r0,r0,#0x80; //Big-endian
- DCD 0xee010f10 ;0xee010f10 => mcr p15,0,r0,c1,c0,0
- ]
- [ ENTRY_BUS_WIDTH=16
- DCD 0x0f10ee11
- DCD 0x0080e380
- DCD 0x0f10ee01
- ]
- [ ENTRY_BUS_WIDTH=8
- DCD 0x100f11ee
- DCD 0x800080e3
- DCD 0x100f01ee
- ]
- DCD 0xffffffff ;swinv 0xffffff is similar with NOP and run well in both endian mode.
- DCD 0xffffffff
- DCD 0xffffffff
- DCD 0xffffffff
- DCD 0xffffffff
- b ResetHandler
