-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdumpotp.S
More file actions
54 lines (40 loc) · 718 Bytes
/
dumpotp.S
File metadata and controls
54 lines (40 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
;;;
;;; Dump the contents of OTP memory (hex)
;;;
.include "mmio.inc"
.text
.org 0x200
.global _start
_start:
mov r0, CM_VPUCTL
bl clk_get_freq
bl uart_init
mov r6, OTP_BASE
lea r0, txt_bootmode
bl uart_puts
ld r0, (r6) ; OTP_BOOTMODE_REG
bl uart_puthexword
bl uart_putcrlf
mov r6, 0 ; OTP register address
loop_reg:
mov r0, 'R' <<0 | 'E' <<8 | 'G' <<16 | ' ' <<24
bl uart_putchars
mov r0, r6
bl uart_puthexword
bl otp_open
mov r0, r6
bl otp_read_reg
mov r7, r0
bl otp_close
mov r0, ':' <<0 | ' ' <<8
bl uart_putchars
mov r0, r7
bl uart_puthexword
bl uart_putcrlf
add r6, 1
cmp r6, 127
bls loop_reg
b led_flash
txt_bootmode:
.asciz "BOOTMODE: "
.align 2