📄 rom.s
字号:
@On-chip ROM size if 8KB, On-chip RAM is 16KB.
@internal RAM allocate:
@ bios: 0x40003000~0x40003fff
@ user: 0x40000000~0x40003ffc
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.global _start
_start:
b ResetHandler
password:
.ascii "ANYKA323"
flash_information:
.byte 4 @ page size = 2KB
.byte 6 @ read page number
.byte 2 @ command cycle number
.byte 2 @ cycle number of offset address in page
.byte 3 @ cycle number of page address
.byte 0x00 @ unlock command value for read page
.byte 0x30 @ confirm command value for read page(if need)
.byte 0 @ reversed, only for align
.word 0x000c3671 @ FLASH command timing parameter
.word 0x000d3637 @ FLASH data timing parameter
.hword 0 @ reset wait time 2mSecond. 0: use default value; other: new wait value;
.hword 0 @ read page command wait time 1mSecond. 0: use default value; other: new wait value;
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.align 4 @代码起始地址对齐32bit
.word 0x1580f1ec @chip id
.hword 2048 @page size
.hword 64 @page of one blok
.hword 1024 @total block number
.hword 1024 @if size is 512M, A29 must the same when copy back, we thougt the A29=0 is a group,A29=1 is another group
.hword 1024
.byte 64 @spare size
.byte 2 @column address cycle
.byte 0x0f @last column addrress cycle mask bit
.byte 2 @row address cycle
.byte 0xff @last row address cycle mask bit
.byte 0x0 @if is a custom nandflash(ohter not typicly nandflash),set bit,use this would fast
.align 4 @代码起始地址对齐32bit
ResetHandler:
@enable all clock
ldr r1,=0xffffffff
ldr r0,=0x20000000
str r1,[r0]
@set power off pin high. if the power off pin is low, the machine can not run on.
ldr r0, =0x20090000
ldr r1, =0x0400
str r1, [r0]
ldr r0, =0x20090010
@ldr r1, =0x0400
ldr r1, =0xffffffff
str r1, [r0]
@dislable all interrupt
ldr r0,=0x20000018
ldr r1,=0xffff
str r1, [r0]
ldr r0,=0x2000001c
str r1, [r0]
@set moregpio3(bit27)=0, maddr[24:17] as bus address
ldr r0, =0x20090020
ldr r1, [r0]
bic r1, r1, #0x08000000
str r1,[r0]
@set bit1/pull1_reg[1]=1, close mdata[15:0] pull up
ldr r0, =0x20090060
ldr r1, [r0]
orr r1, r1, #0x00000002
str r1,[r0]
@set up sdram which value is best?????
ldr r0, =0x200b0000
ldr r1, =0x100f400
str r1, [r0]
@set up sram
@ldr r0, =0x200b0000
@ldr r1, =0x000f0000
@str r1, [r0]
@set up ssram
@ldr r0, =0x200b0000
@ldr r1, =0x00020000
@str r1, [r0]
@**************************************
ldr r0,=0x13
msr cpsr, R0
ldr r1,=0x30300000
MOV SP, R1
ldr pc, =boot_main
@**************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -