@ new version for dzo bootloader inclusion .globl _start .equ _start,0x0 @ r3 is #0 @ r2 is #06d0 (for phys_setup) @ r13 holds temp values for mcr/mrc @ r13 holds temp values for mcr/mrc mov r3, #0 .macro phys_setup @ r3 is 0 mcr p15, 0, r3, c7, c10, 5 mrc p15, 0, r1, c15, c2, 0 @ get old remap registers mov r2, #0x6d0 add r2, #0xb mcr p15, 0, r2, c15, c2, 0 @ set all data access to be device-nonshared .endm .macro phys_restore mcr p15, 0, r1, c15, c2, 0 @ restore .endm @ make sure we are in svc32 mode mrs r13,cpsr bic r13,r13,#0x1f orr r13,r13,#0xd3 msr cpsr,r13 @ clear the screen to green and start dma @ code from dzo htc-vogue early printk #define DOUBLERGB_GREEN 0x7e007e0 @ physical page of fb @ htc values from ce, we can try the dzo values instead @#define HTC_FB_PHYS 0x16800000 @#define HTC_FB_PHYS_END 0x16896000 #define HTC_FB_PHYS 0x00700000 #define HTC_FB_PHYS_END 0x00796000 @ 0xaa200000 r7 + #define INTSTATUS 0x24 #define INTCLEAR 0x28 #define VSYNC 0x8c @ offset from mdp control regs phys, use {read_write}_d_mdp_control @ 0xaa210000 r8 + #define BYPASS33 0x184 #define BYPASS34 0x188 #define BYPASS35 0x18c #define BYPASS37 0x194 #define BYPASS40 0x1a0 #define BYPASS41 0x1a4 #define DMACONFIG 0x180 #define DMASTART 0x44 .text .align 2 @ two bits must be zero, therefore align on word boundaries _start: @ setup registers mov r5,#HTC_FB_PHYS ldr r6,=HTC_FB_PHYS_END ldr r7, = 0xaa200000 @ mdp registers ldr r8, = 0xaa210000 @ mdp control registers ldr r4, =DOUBLERGB_GREEN @ green ldr r9, =0x14000f0 ldr r10, =0x000001e0 ldr r11, =0x566600c3 ldr r12, =0x0032616a @ r13 is scratch @ we can enter phys_setup at this point @ eliminate any memory access after this point before clearing screen again clearscreenloop: str r4,[r5] add r5, r5, #4 cmp r5,r6 ble clearscreenloop @ clear two pixels str r4,[r5] phys_setup @ no memory access after this @ clear interrupt waitforint: ldr r4, [r7, #INTSTATUS] @ 0xaa200000 r7 + cmp r4, #0 bne waitforint str r4, [r7, #INTCLEAR] @ 0xaa200000 r7 + @ldr r9, =0x14000f0 str r9, [r8, #BYPASS33] @ 0xaa210000 r8 + @ r5 is already HTC_FB_PHYS just use it str r5, [r8, #BYPASS34] @ 0xaa200000 r8 + @ldr r10, =0x000001e0 str r10, [r8, #BYPASS35] @ 0xaa210000 r8 + @ r3 is 0 str r3, [r8, #BYPASS37] @ 0xaa210000 r8 + str r3, [r8, #BYPASS40] @ 0xaa210000 r8 + @ldr r11, =0x566600c3 str r11, [r8, #BYPASS41] @ 0xaa21000 r8 + @ keep updating the screen dmaloop: @ldr r12, =0x0032616a str r12, [r6, #DMACONFIG] @ 0xaa21000 r8 + @ r3 is 0 str r3, [r7, #VSYNC] @ 0xaa200000 r7 + str r3, [r8, #DMASTART] @ 0xaa210000 r8 + @ r13 is scratch waitforint2: ldr r13, [r7, #INTSTATUS] @ 0xaa200000 r7 + cmp r13, #0 bne waitforint2 @ clear interrupt waitforint3: phys_setup ldr r13, [r7, #INTSTATUS] @ 0xaa200000 r7 + phys_restore cmp r13, #0 beq waitforint3 str r4, [r7, #INTCLEAR] @ 0xaa20000 r7 + phys_restore @ draw a line (480 pixels) @mov r5, #HTC_FB_PHYS @ replacing HTC_FB_PHYS_END we are only clearing one line mov r6, #240 @ one line, 240 words is 480 pixels ldr r4, =DOUBLERGB_GREEN lineloop: str r4,[r5,r6] @ r6 is HTC_FB_PHYS subs r6,r6,#4 cmp r6,#0 bne lineloop @ and update the screen phys_setup b dmaloop .data