📄 pd6710.txt
字号:
;;;342 //Card detect changed?
;;;343 if(cardStat&0x8)
000560 e3140008 TST r4,#8
000564 0a00000c BEQ |L1.1436|
;;;344 {
;;;345 //check if CD1,2 is L.
;;;346 if((PD6710_Rd(INTERFACE_STATUS)&0xc)==0xc)
000568 e3a00001 MOV r0,#1
00056c ebfffffe BL PD6710_Rd
000570 e3a0100c MOV r1,#0xc
000574 e1d10000 BICS r0,r1,r0
000578 1a000004 BNE |L1.1424|
;;;347 {
;;;348 Uart_Printf("Card is inserted.\n");
00057c e28f0064 ADR r0,|L1.1512|
000580 ebfffffe BL Uart_Printf
;;;349 PD6710_CardEnable();
000584 ebfffffe BL PD6710_CardEnable
;;;350 PrintCIS();
000588 ebfffffe BL PrintCIS
00058c ea000002 B |L1.1436|
;;;351 }
;;;352 else
;;;353 {
;;;354 Uart_Printf("Card is ejected.\n");
|L1.1424|
000590 e28f0064 ADR r0,|L1.1532|
000594 ebfffffe BL Uart_Printf
;;;355 PD6710_Init(); //can be removed.
000598 ebfffffe BL PD6710_Init
;;;356 }
;;;357 }
;;;358 ClearPending(BIT_EINT3);
|L1.1436|
00059c e3a00008 MOV r0,#8
0005a0 e3a0144a MOV r1,#0x4a000000
0005a4 e5810000 STR r0,[r1,#0]
0005a8 e3a00008 MOV r0,#8
0005ac e3a0144a MOV r1,#0x4a000000
0005b0 e5810010 STR r0,[r1,#0x10]
0005b4 e3a0044a MOV r0,#0x4a000000
0005b8 e5900010 LDR r0,[r0,#0x10]
;;;359 //For level interrupt, the int pending should be cleared at the end of ISR.
;;;360 }
0005bc e28dd004 ADD sp,sp,#4
0005c0 e8bd501f LDMFD sp!,{r0-r4,r12,lr}
0005c4 e25ef004 SUBS pc,lr,#4
|L1.1480|
0005c8 3644500a DCB "\nPD6"
0005cc 20303137 DCB "710 "
0005d0 65746e69 DCB "inte"
0005d4 70757272 DCB "rrup"
0005d8 73692074 DCB "t is"
0005dc 63636f20 DCB " occ"
0005e0 65727275 DCB "urre"
0005e4 000a2e64 DCB "d.\n\0"
|L1.1512|
0005e8 64726143 DCB "Card"
0005ec 20736920 DCB " is "
0005f0 65736e69 DCB "inse"
0005f4 64657472 DCB "rted"
0005f8 00000a2e DCB ".\n\0\0"
|L1.1532|
0005fc 64726143 DCB "Card"
000600 20736920 DCB " is "
000604 63656a65 DCB "ejec"
000608 2e646574 DCB "ted."
00060c 0000000a DCB "\n\0\0\0"
ENDP
PD6710_InitInterrupt PROC
;;;146 void PD6710_InitInterrupt(void)
;;;147 {
000610 e3a00456 MOV r0,#0x56000000
;;;148 //EINT7(GPE7)=nINT_P_CON=nINTR
;;;149 //EINT6(GPE6)=nINT_P_DEV=IRQ3
;;;150
;;;151 rEXTINT0=rEXTINT0&~(7<<12)|(2<<12);
000614 e5900088 LDR r0,[r0,#0x88]
000618 e3c00c70 BIC r0,r0,#0x7000
00061c e3800d80 ORR r0,r0,#0x2000
000620 e3a01456 MOV r1,#0x56000000
000624 e5810088 STR r0,[r1,#0x88]
;;;152 //EINT3(GPF3)=nIRQ_PCMCIA(nINT_P_CON)=nINTR =falling edge
;;;153 rEXTINT1=rEXTINT1&~(7<<0)|(4<<0);
000628 e3a00456 MOV r0,#0x56000000
00062c e590008c LDR r0,[r0,#0x8c]
000630 e3c00007 BIC r0,r0,#7
000634 e3800004 ORR r0,r0,#4
000638 e3a01456 MOV r1,#0x56000000
00063c e581008c STR r0,[r1,#0x8c]
;;;154 //EINT8(GPG0)=IRQ_PCMCIA(INT_P_DEV)=IRQ3 =rising edge
;;;155
;;;156 pISR_EINT3=(U32)IsrPD6710Management; //nINT_P_CON
000640 e59f011c LDR r0,|L1.1892|
000644 e59f111c LDR r1,|L1.1896|
000648 e5810f2c STR r0,[r1,#0xf2c]
;;;157 pISR_EINT8_23=(U32)IsrPD6710Card; //nINT_P_DEV
00064c e59f0118 LDR r0,|L1.1900|
000650 e5810f34 STR r0,[r1,#0xf34]
;;;158 rSRCPND = BIT_EINT3|BIT_EINT8_23; //to clear the previous pending states
000654 e3a00028 MOV r0,#0x28
000658 e3a0144a MOV r1,#0x4a000000
00065c e5810000 STR r0,[r1,#0]
;;;159 rINTPND = BIT_EINT3|BIT_EINT8_23;
000660 e3a00028 MOV r0,#0x28
000664 e3a0144a MOV r1,#0x4a000000
000668 e5810010 STR r0,[r1,#0x10]
;;;160
;;;161 rINTMSK=~(BIT_EINT3|BIT_EINT8_23);
00066c e3e00028 MVN r0,#0x28
000670 e3a0144a MOV r1,#0x4a000000
000674 e5810008 STR r0,[r1,#8]
;;;162 rEINTMASK=rEINTMASK&~(1<<8)|(0<<8); //EINTMASK[8]=enable interrupt.
000678 e3a00456 MOV r0,#0x56000000
00067c e59000a4 LDR r0,[r0,#0xa4]
000680 e3c00f40 BIC r0,r0,#0x100
000684 e3a01456 MOV r1,#0x56000000
000688 e58100a4 STR r0,[r1,#0xa4]
;;;163 }
00068c e1a0f00e MOV pc,lr
ENDP
PD6710_InitBoard PROC
;;;133 void PD6710_InitBoard(void)
;;;134 {
000690 e3a00456 MOV r0,#0x56000000
;;;135 //Initialize S3C2442 for PD6710
;;;136 rGPFCON=rGPFCON&~(3<<6)|(2<<6); //EINT3(GPF3)=nIRQ_PCMCIA(nINT_P_CON)=nINTR
000694 e5900050 LDR r0,[r0,#0x50]
000698 e3c000c0 BIC r0,r0,#0xc0
00069c e3800080 ORR r0,r0,#0x80
0006a0 e3a01456 MOV r1,#0x56000000
0006a4 e5810050 STR r0,[r1,#0x50]
;;;137 rGPGCON=rGPGCON&~(3<<0)|(2<<0); //EINT8(GPG0)=IRQ_PCMCIA(INT_P_DEV)=IRQ3
0006a8 e3a00456 MOV r0,#0x56000000
0006ac e5900060 LDR r0,[r0,#0x60]
0006b0 e3c00003 BIC r0,r0,#3
0006b4 e3800002 ORR r0,r0,#2
0006b8 e3a01456 MOV r1,#0x56000000
0006bc e5810060 STR r0,[r1,#0x60]
;;;138
;;;139 rBWSCON=rBWSCON&~(0xf<<8)|(0xd<<8); //nGCS2=nUB/nLB(nSBHE),nWAIT,16-bit
0006c0 e3a00448 MOV r0,#0x48000000
0006c4 e5900000 LDR r0,[r0,#0]
0006c8 e3c00ef0 BIC r0,r0,#0xf00
0006cc e3800ed0 ORR r0,r0,#0xd00
0006d0 e3a01448 MOV r1,#0x48000000
0006d4 e5810000 STR r0,[r1,#0]
;;;140
;;;141 rBANKCON2=((B6710_Tacs<<13)+(B6710_Tcos<<11)+(B6710_Tacc<<8)+(B6710_Tcoh<<6)\
0006d8 e59f0090 LDR r0,|L1.1904|
0006dc e3a01448 MOV r1,#0x48000000
0006e0 e581000c STR r0,[r1,#0xc]
;;;142 +(B6710_Tah<<4)+(B6710_Tacp<<2)+(B6710_PMC));
;;;143 }
0006e4 e1a0f00e MOV pc,lr
ENDP
Test_PD6710 PROC
;;;52 void Test_PD6710(void)
;;;53 {
0006e8 e92d4008 STMFD sp!,{r3,lr}
;;;54 Uart_Printf("[PD6710 test for reading pc_card CIS]\n");
0006ec e28f0080 ADR r0,|L1.1908|
0006f0 ebfffffe BL Uart_Printf
;;;55 Uart_Printf("Insert PC card!!!\n");
0006f4 e28f00a0 ADR r0,|L1.1948|
0006f8 ebfffffe BL Uart_Printf
;;;56 PD6710_InitBoard();
0006fc ebfffffe BL PD6710_InitBoard
;;;57 PD6710_Init();
000700 ebfffffe BL PD6710_Init
;;;58 PD6710_InitInterrupt();
000704 ebfffffe BL PD6710_InitInterrupt
;;;59
;;;60 //Check if CD1,2 is L. If nCD1,2 is L, the card has been inserted.
;;;61 //In this case, the card management interrupt isn't occurred.
;;;62 if((PD6710_Rd(INTERFACE_STATUS)&0xc)==0xc)
000708 e3a00001 MOV r0,#1
00070c ebfffffe BL PD6710_Rd
000710 e3a0100c MOV r1,#0xc
000714 e1d10000 BICS r0,r1,r0
000718 1a000005 BNE |L1.1844|
;;;63 {
;;;64 Uart_Printf("Card is inserted.\n");
00071c e24f0f4f ADR r0,|L1.1512|
000720 ebfffffe BL Uart_Printf
;;;65 Delay(2000);
000724 e3a00e7d MOV r0,#0x7d0
000728 ebfffffe BL Delay
;;;66 //For card contact stablization. This delay is needed for stable operation.
;;;67 //If this delay isn't here, CF card will not be identified.
;;;68 PD6710_CardEnable();
00072c ebfffffe BL PD6710_CardEnable
;;;69 PrintCIS();
000730 ebfffffe BL PrintCIS
;;;70 }
;;;71
;;;72 while(1)
|L1.1844|
000734 e1a00000 NOP
|L1.1848|
000738 e1a00000 NOP
;;;73 {
;;;74 if(Uart_GetKey()==0x1b) break;
00073c ebfffffe BL Uart_GetKey
000740 e350001b CMP r0,#0x1b
000744 1a000000 BNE |L1.1868|
000748 ea000004 B |L1.1888|
;;;75 Uart_Printf(".");
|L1.1868|
00074c e28f005c ADR r0,|L1.1968|
000750 ebfffffe BL Uart_Printf
;;;76 Delay(10000);
000754 e59f0058 LDR r0,|L1.1972|
000758 ebfffffe BL Delay
;;;77 }
00075c eafffff5 B |L1.1848|
;;;78 }
|L1.1888|
000760 e8bd8008 LDMFD sp!,{r3,pc}
|L1.1892|
000764 00000000 DCD IsrPD6710Management
|L1.1896|
000768 31fff000 DCD 0x31fff000
|L1.1900|
00076c 00000000 DCD IsrPD6710Card
|L1.1904|
000770 00001f4c DCD 0x00001f4c
|L1.1908|
000774 3644505b DCB "[PD6"
000778 20303137 DCB "710 "
00077c 74736574 DCB "test"
000780 726f6620 DCB " for"
000784 61657220 DCB " rea"
000788 676e6964 DCB "ding"
00078c 5f637020 DCB " pc_"
000790 64726163 DCB "card"
000794 53494320 DCB " CIS"
000798 00000a5d DCB "]\n\0\0"
|L1.1948|
00079c 65736e49 DCB "Inse"
0007a0 50207472 DCB "rt P"
0007a4 61632043 DCB "C ca"
0007a8 21216472 DCB "rd!!"
0007ac 00000a21 DCB "!\n\0\0"
|L1.1968|
0007b0 0000002e DCB ".\0\0\0"
|L1.1972|
0007b4 00002710 DCD 0x00002710
ENDP
Card_RdIO PROC
;;;300 U8 Card_RdIO(U32 ioaddr)
;;;301 {
0007b8 e1a01000 MOV r1,r0
;;;302 return *((volatile U8 *)(PD6710_IO_BASE_ADDRESS+ioaddr));
0007bc e2810544 ADD r0,r1,#0x11000000
0007c0 e5d00000 LDRB r0,[r0,#0]
;;;303 }
0007c4 e1a0f00e MOV pc,lr
ENDP
Card_WrIO PROC
;;;306 void Card_WrIO(U32 ioaddr,U8 data)
;;;307 {
0007c8 e2802544 ADD r2,r0,#0x11000000
;;;308 *((volatile U8 *)(PD6710_IO_BASE_ADDRESS+ioaddr))=data;
0007cc e5c21000 STRB r1,[r2,#0]
;;;309 }
0007d0 e1a0f00e MOV pc,lr
ENDP
PD6710_CommonMemAccess PROC
;;;319 void PD6710_CommonMemAccess(void)
;;;320 {
0007d4 e52de004 STR lr,[sp,#-4]!
;;;321 PD6710_Modify(CARD_MEM_MAP0_OFFSET_H,(1<<6),(0<<6)); //nREG=inactive, H
0007d8 e3a02000 MOV r2,#0
0007dc e3a01040 MOV r1,#0x40
0007e0 e3a00015 MOV r0,#0x15
0007e4 ebfffffe BL PD6710_Modify
;;;322 }
0007e8 e49df004 LDR pc,[sp],#4
ENDP
AREA ||.bss||, NOINIT, ALIGN=2
isCardInsert
||.bss$2||
% 4
||str@PrintCIS_0||
% 16
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -