.globl _start .equ _start,0x0 .macro phys_setup mov r0, #0 mcr p15, 0, r0, c7, c10, 5 mrc p15, 0, r1, c15, c2, 0 @ get old remap registers mov r0, #0x6d0 add r0, #0xb mcr p15, 0, r0, 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 r0,cpsr bic r0,r0,#0x1f orr r0,r0,#0xd3 msr cpsr,r0 @ 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 @ offset from mdp phys, use {read,write}_d_mdp #define BYPASS33 0x184 #define BYPASS34 0x188 #define BYPASS35 0x18c #define BYPASS37 0x194 #define BYPASS40 0x1a0 #define BYPASS41 0x1a4 @ offset from mdp control regs phys, use {read_write}_d_mdp_control #define DMACONFIG 0x44 #define INTSTATUS 0x24 #define INTCLEAR 0x28 #define DMASTART 0x80 #define VSYNC 0x8c .text .align 2 @ two bits must be zero, therefore align on word boundaries _start: @ clear the screen ldr r5,=HTC_FB_PHYS ldr r6,=HTC_FB_PHYS_END ldr r4,=DOUBLERGB_GREEN @ green clearscreenloop: str r4,[r5] add r5, r5, #4 cmp r5,r6 ble clearscreenloop mov r6, #HTC_FB_PHYS @ clear one pixel str r4,[r6] @ mdp control registers ldr r6, =0xaa200000 @ clear interrupt waitforint: ldr r4, [r6, #INTSTATUS] cmp r4, r5 beq waitforint str r4, [r6, #INTCLEAR] @ the mdp phys address, not control registers ldr r6, =0xaa210000 ldr r4, =0x14000f0 phys_setup str r4, [r6, #0x184] phys_restore mov r4, #HTC_FB_PHYS phys_setup str r4, [r6, #BYPASS34] phys_restore ldr r4, =0x000001e0 phys_setup str r4, [r6, #BYPASS35] phys_restore add r4, r4, #0 phys_setup str r4, [r6, #BYPASS37] phys_restore phys_setup str r4, [r6, #BYPASS40] phys_restore ldr r4, =0x566600c3 phys_setup str r4, [r6, #BYPASS41] phys_restore @ keep updating the screen dmaloop: @ mdp control registers ldr r6, =0xaa200000 ldr r4, =0x0032616a phys_setup str r4, [r6, #DMACONFIG] phys_restore add r4, r4, #0 phys_setup str r4, [r6, #VSYNC] phys_restore phys_setup str r4, [r6, #DMASTART] phys_restore add r5, r5, #0 waitforint2: phys_setup ldr r4, [r6, #INTSTATUS] phys_restore cmp r4, r5 ble waitforint2 @ clear interrupt waitforint3: phys_setup ldr r4, [r6, #INTSTATUS] phys_restore cmp r4, r5 beq waitforint3 str r4, [r6, #INTCLEAR] @ now clear a line @ draw a line (480 pixels) mov r6, #HTC_FB_PHYS mov r5, #480 @ one line ldr r4, =DOUBLERGB_GREEN lineloop: str r4,[r6,r5] subs r5,r5,#4 bne lineloop @ and update the screen b dmaloop .data