89
lis r12, 65472 !R12 contains $FFC00000
addi r12, r12, 8 !Register12 contains address $FFC00008
!This address is used to request the Autoselect mode data as
!specified by the Flash ROM data sheet + a shift by 3.
xor r14, r14, r14 !Clearing Register 14
lis r14, 65472 !Register 14 contains $FFC00000
addi r14, r14, 10920 !Register 14 contains $FFC02AA8
!This address is used to send the first step into the
!Autoselect sequence as specified by the Flash ROM data
!sheet + a shift by 3.
xor r15, r15, r15 !Clearing Register 15
lis r15, 65472 !Register 15 contains $FFC00000
addi r15, r15, 5456 !Register 15 contains address $FFC01550
!This address is used to send the second step into the
!Autoselect sequence as specified by the Flash ROM data !sheet
+ a shift by 3.
xor r16, r16, r16 !Clearing Register 16
addi r16, r16, 170 !Through this steps, the data $AAAAAAAA which will be
slwi r16, r16, 8 !sent to the Flash on the first step of the Autoselect
addi r16, r16, 170 !sequence, is assembled. Note that bit reversal has been
slwi r16, r16, 8 !accounted for.
addi r16, r16, 170
slwi r16, r16, 8
addi r16, r16, 170 !Register 16 contains data $AAAAAAAA
xor r17, r17, r17 !Clearing Register 17
lis r17, 21845 !Data $55555555 is assembled through this steps. This is
addi r17, r17, 21845 !the data that will be sent on the second step of the
!Autoselect sequence. Bit reversal has been taken care of.
xor r18, r18, r18 !Clearing Register 18
addi r18, r18, 9 !Data $09090909 is assembled through this steps. This
slwi r18, r18, 8 !word is sent to the Flash to differentiate the command
addi r18, r18, 9 !sequence from all others. This data is specific to the
slwi r18, r18, 8 !Autoselect mode.
addi r18, r18, 9
slwi r18, r18, 8
addi r18, r18, 9 !Register 18 contains data $09090909
stwx r17, r14, r13 !Store $55555555 data in $FFC02AA8
addi r14, r14, 4 !First sequence step taken care of.
stwx r17, r14, r13 !It has to be written to both memory banks.
stwx r16, r15, r13 !Store $AAAAAAAA data in $FFC01550
addi r15, r15, 4 !Second sequence step taken care of.
stwx r16, r15, r13 !It has to be written to both memory banks.
subi r14, r14, 4 !Subtract 4 from R14 so that the address FFC02AA8 is
!once again available.
stwx r18, r14, r13 !Store $09090909 data in $FFC02AA8
addi r14, r14, 4 !Third step into the Autoselect sequence taken care of.
stwx r18, r14, r13 !It has to be writen to both memory banks.
! At this moment, the Flash ROM is on the Autoselect Mode. All memory reads will return
!Autoselect Mode Information such as Manufacturer ID, Device ID and Sector Protect
!Verification status. To exit Autoselect Mode, the Autoselect Reset sequence or a Hardware
!reset must be performed.
lwzx r19, r12, r13 !Loading into Register 19 Manufacturer ID for the first
!memory bank.
addi r12, r12, 4