-
Notifications
You must be signed in to change notification settings - Fork 2
/
vpuinfo.S
68 lines (50 loc) · 891 Bytes
/
vpuinfo.S
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
;;;
;;; Get VPU info
;;;
.include "mmio.inc"
.text
.org 0x200
.global _start
_start:
mov r0, CM_VPUCTL
bl clk_get_freq
mov r6, r0
bl uart_init
;; VPU ID
lea r0, txt_vpuid
bl uart_puts
version r0
bl uart_puthexword
bl uart_putcrlf
;; VPU rate
lea r0, txt_vpufreq
bl uart_puts
mov r0, r6
bl uart_putdecword
lea r0, txt_hz
bl uart_puts
;; Dump OTP memory
lea r0, txt_otpdump
bl uart_puts
bl otp_open
mov r6, 0 ; OTP register address
mov r7, 127
.L_otp_loop:
mov r0, r6
bl uart_putdecword
mov r0, r6
bl otp_read_reg
mov r8, r0
mov r0, ':' <<0 | ' ' <<8
bl uart_putchars
mov r0, r8
bl uart_puthexword
bl uart_putcrlf
addcmpbls r6, 1, r7, .L_otp_loop
bl otp_close
b led_flash
txt_vpufreq: .asciz "VPU runs at "
txt_hz: .asciz " Hz\r\n"
txt_vpuid: .asciz "VPU ID: 0x"
txt_otpdump: .asciz "OTP memory dump: \r\n"
.align 2