ô Talk to the combi I/O ô ô by Richard Murray (*ô Updated 2004/02/17 with 32bit stuff. 2ô <:ô Downloaded from: http://www.heyrick.co.uk/assembler/ F P$î … ñ ö$+" at line "+Ã(ž/10) : à Z dÞ code% 128 n xGô For 32bit systems (ARM6 or later), you can alter the following... ‚code_32_bit% = ¹ Œ –ã l% = 0 ¸ 2 ˆ 2   P% = code% ª [ OPT l% ´ ¢ 1 ¾ È STR R14, [R13, #-4]! Ò Ü5 SWI "OS_EnterOS" ; go to SVC mode æ ] ð ú ç (code_32_bit% = £) Œ  [ OPT l% $ ; 26 bit way (ARM2 to SA110) 8 TEQP PC, #&0C000003 ; interrupts disabled " ] , Ì 6 [ OPT l% @ J, ; 32 bit way (ARM6 to 'Present Day') T MRS R0, CPSR_all ^4 BIC R0, R0, #192 ; IRQ and FIQ h ‚ R0, R0, #192 r MSR CPSR_all, R0 | ] † Í  š [ OPT l% ¤ LDR R0, base_address ® MOV R1, #&55 ¸. STRB R1, [R0, #&FC0] ; port &3F0  STRB R1, [R0, #&FC0] Ì3 ; Now in 37C665 software configuration mode Ö à= ADR R2, registers ; Where to store registers ê? MOV R3, #0 ; Register number (& offset) ô þ .read_loop 7 ; Write desired register number to address &3F0  STRB R3, [R0, #&FC0] 6 ; Now read register contents from address &3F1 & LDRB R1, [R0, #&FC4] 0( ; Store it in our register block : STRB R1, [R2, R3] D N ADD R3, R3, #1 X CMP R3, #16 b BLT read_loop l v MOV R1, #&AA € STRB R1, [R0, #&FC0] Š0 ; Now out of software configuration mode ” ] ž ¨ ç (code_32_bit% = £) Œ ² [ ¼ OPT l% Æ$ ; 26 bit way (ARM2 to SA110) Ð? TEQP PC, #&08000000 ; interrupts enabled, º mode Ú MOV R0, R0 ä ] î Ì ø [ OPT l% , ; 32 bit way (ARM6 to 'Present Day')   > ; ****************************************************  9 ; IMPORTANT!!! The '#192' restores º26 mode. For *; ; an Iyonix, you would want º32 mode, 4; ; so you should therefore use #224... >= ; *************************************************** H R> MOV R0, #192 ; IRQ and FIQ, then **º26** \ MSR CPSR_all, R0 f ] p Í z „ [ OPT l% Ž ˜ LDR R14, [R13], #4 ¢ MOV PC, R14 ¬ ¶ À .base_address Ê EQUD &03010000 Ô Þ .registers è EQUD 0 ò EQUD 0 ü EQUD 0  EQUD 0  ] í $ .2ñ "Examining multi-I/O chip configuration..."; 8 Ö code% Bñ "done."'' L Vñ "Device identification "; `ÈŽ registers?13 Ê j É &65 : ñ "FDC37C665GT"; tO É &66 : ñ "FDC37C666GT"; : ô Different magic value, so should not happen! ~D : ñ "Error! Device ID "+Ã~(registers?13)+" unrecognised!" : à ˆË ’#ñ ", revision "+Ã(registers?14) œ ¦à ÿ