.global _start .equiv PIO_BASE, 0x01c20800 .equiv PD, (0x24 * 3) .equiv PE, (0x24 * 4) .equiv PIO_CFG0, 0x00 .equiv PIO_CFG1, 0x04 .equiv PIO_CFG2, 0x08 .equiv PIO_DATA, 0x10 .equiv LCD_CS, (1 << 21) .equiv LCD_RD, (1 << 20) .equiv LCD_RS, (1 << 19) .equiv LCD_WR, (1 << 18) .equiv LCD_RST, (1 << 11) .equiv LCD_BL, (1 << 6) .arm .text _start: .long 0xea000016 .byte 'e', 'G', 'O', 'N', '.', 'B', 'T', '0' .long 0, __spl_size .byte 'S', 'P', 'L', 2 .long 0, 0 .long 0, 0, 0, 0, 0, 0, 0, 0 .long 0, 0, 0, 0, 0, 0, 0, 0 _vector: b reset b . b . b . b . b . b . b . reset: ldr r4, =PIO_BASE + PD ldr r1, =0x11111111 str r1, [r4, #PIO_CFG0] str r1, [r4, #PIO_CFG1] ldr r1, =0x00111111 str r1, [r4, #PIO_CFG2] ldr r4, =PIO_BASE + PE ldr r1, [r4, #PIO_CFG0] bic r1, #0xf000000 orr r1, #0x1000000 str r1, [r4, #PIO_CFG0] ldr r1, [r4, #PIO_CFG1] bic r1, #0xf000 orr r1, #0x1000 str r1, [r4, #PIO_CFG1] ldr r4, =PIO_BASE + PD ldr r1, =0xffffffff str r1, [r4, #PIO_DATA] ldr r4, =PIO_BASE + PE ldr r1, =0xffffffff str r1, [r4, #PIO_DATA] bl lcd_rst ldr r0, =0x2e bl lcd_cmd ldr r0, =0x89 bl lcd_dat ldr r0, =0x29 bl lcd_cmd ldr r0, =0x8f bl lcd_dat ldr r0, =0x2b bl lcd_cmd ldr r0, =0x02 bl lcd_dat ldr r0, =0xe2 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0xe4 bl lcd_cmd ldr r0, =0x01 bl lcd_dat ldr r0, =0xe5 bl lcd_cmd ldr r0, =0x10 bl lcd_dat ldr r0, =0xe6 bl lcd_cmd ldr r0, =0x01 bl lcd_dat ldr r0, =0xe7 bl lcd_cmd ldr r0, =0x10 bl lcd_dat ldr r0, =0xe8 bl lcd_cmd ldr r0, =0x70 bl lcd_dat ldr r0, =0xf2 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0xea bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0xeb bl lcd_cmd ldr r0, =0x20 bl lcd_dat ldr r0, =0xec bl lcd_cmd ldr r0, =0x3c bl lcd_dat ldr r0, =0xed bl lcd_cmd ldr r0, =0xc8 bl lcd_dat ldr r0, =0xe9 bl lcd_cmd ldr r0, =0x38 bl lcd_dat ldr r0, =0xf1 bl lcd_cmd ldr r0, =0x01 bl lcd_dat ldr r0, =0x40 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x41 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x42 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x43 bl lcd_cmd ldr r0, =0x15 bl lcd_dat ldr r0, =0x44 bl lcd_cmd ldr r0, =0x13 bl lcd_dat ldr r0, =0x45 bl lcd_cmd ldr r0, =0x3f bl lcd_dat ldr r0, =0x47 bl lcd_cmd ldr r0, =0x55 bl lcd_dat ldr r0, =0x48 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x49 bl lcd_cmd ldr r0, =0x12 bl lcd_dat ldr r0, =0x4a bl lcd_cmd ldr r0, =0x19 bl lcd_dat ldr r0, =0x4b bl lcd_cmd ldr r0, =0x19 bl lcd_dat ldr r0, =0x4c bl lcd_cmd ldr r0, =0x16 bl lcd_dat ldr r0, =0x50 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x51 bl lcd_cmd ldr r0, =0x2c bl lcd_dat ldr r0, =0x52 bl lcd_cmd ldr r0, =0x2a bl lcd_dat ldr r0, =0x53 bl lcd_cmd ldr r0, =0x3f bl lcd_dat ldr r0, =0x54 bl lcd_cmd ldr r0, =0x3f bl lcd_dat ldr r0, =0x55 bl lcd_cmd ldr r0, =0x3f bl lcd_dat ldr r0, =0x56 bl lcd_cmd ldr r0, =0x2a bl lcd_dat ldr r0, =0x57 bl lcd_cmd ldr r0, =0x7e bl lcd_dat ldr r0, =0x58 bl lcd_cmd ldr r0, =0x09 bl lcd_dat ldr r0, =0x59 bl lcd_cmd ldr r0, =0x06 bl lcd_dat ldr r0, =0x5a bl lcd_cmd ldr r0, =0x06 bl lcd_dat ldr r0, =0x5b bl lcd_cmd ldr r0, =0x0d bl lcd_dat ldr r0, =0x5c bl lcd_cmd ldr r0, =0x1f bl lcd_dat ldr r0, =0x5d bl lcd_cmd ldr r0, =0xff bl lcd_dat ldr r0, =0x1b bl lcd_cmd ldr r0, =0x1a bl lcd_dat ldr r0, =0x1a bl lcd_cmd ldr r0, =0x02 bl lcd_dat ldr r0, =0x24 bl lcd_cmd ldr r0, =0x61 bl lcd_dat ldr r0, =0x25 bl lcd_cmd ldr r0, =0x5c bl lcd_dat ldr r0, =0x23 bl lcd_cmd ldr r0, =0x62 bl lcd_dat ldr r0, =0x18 bl lcd_cmd ldr r0, =0x36 bl lcd_dat ldr r0, =0x19 bl lcd_cmd ldr r0, =0x01 bl lcd_dat ldr r0, =0x1f bl lcd_cmd ldr r0, =0x88 bl lcd_dat ldr r0, =0x1f bl lcd_cmd ldr r0, =0x80 bl lcd_dat ldr r0, =0x1f bl lcd_cmd ldr r0, =0x90 bl lcd_dat ldr r0, =0x1f bl lcd_cmd ldr r0, =0xd4 bl lcd_dat ldr r0, =0x17 bl lcd_cmd ldr r0, =0x05 bl lcd_dat ldr r0, =0x36 bl lcd_cmd ldr r0, =0x09 bl lcd_dat ldr r0, =0x28 bl lcd_cmd ldr r0, =0x38 bl lcd_dat ldr r0, =0x28 bl lcd_cmd ldr r0, =0x3c bl lcd_dat ldr r0, =0x02 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x03 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x04 bl lcd_cmd ldr r0, =0x01 bl lcd_dat ldr r0, =0x05 bl lcd_cmd ldr r0, =0x3f bl lcd_dat ldr r0, =0x06 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x07 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x08 bl lcd_cmd ldr r0, =0x00 bl lcd_dat ldr r0, =0x09 bl lcd_cmd ldr r0, =0xef bl lcd_dat ldr r0, =0x16 bl lcd_cmd ldr r0, =0x20 bl lcd_dat ldr r0, =0x22 bl lcd_cmd ldr r4, =320*80 ldr r5, =0x1f 0: mov r0, r5 bl lcd_dat subs r4, #1 bne 0b ldr r4, =320*80 ldr r5, =0x7e0 0: mov r0, r5 bl lcd_dat subs r4, #1 bne 0b ldr r4, =320*80 ldr r5, =0xf800 0: mov r0, r5 bl lcd_dat subs r4, #1 bne 0b b . delay: push {lr} 0: subs r0, #1 bne 0b pop {pc} lcd_rst: push {r4, r5, lr} ldr r4, =PIO_BASE + PE ldr r5, =0xffffffff bic r5, #LCD_RST str r5, [r4, #PIO_DATA] ldr r0, =10000 bl delay orr r5, #LCD_RST str r5, [r4, #PIO_DATA] ldr r0, =10000 bl delay pop {r4, r5, pc} lcd_wr: push {r4, r5, lr} ldr r4, =PIO_BASE + PD and r2, r0, #0x001f and r3, r0, #0xf800 and r5, r0, #0x07e0 lsl r2, #11 lsr r3, #11 eor r0, r0 orr r0, r2 orr r0, r3 orr r0, r5 and r2, r0, #0x00ff and r3, r0, #0xff00 lsl r2, #1 lsl r3, #2 eor r5, r5 orr r5, r1 orr r5, r2 orr r5, r3 orr r5, #LCD_RD str r5, [r4, #PIO_DATA] orr r5, #LCD_WR str r5, [r4, #PIO_DATA] pop {r4, r5, pc} lcd_dat: push {lr} mov r1, #LCD_RS bl lcd_wr pop {pc} lcd_cmd: push {lr} mov r1, #0 bl lcd_wr pop {pc} .end