aboutsummaryrefslogtreecommitdiff
path: root/clocks.s
blob: 74bd215bed98b1de018789248634224985671e36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.syntax unified
.cpu cortex-m0plus
.thumb

.equ CLOCKS_BASE, 0x40008000
.equ CLK_REF_CTRL_OFST, 0x30
.equ CLK_SYS_CTRL_OFST, 0x3c

.type setup_clocks, %function
.global setup_clocks

setup_clocks:
  ldr r1, =CLOCKS_BASE
  movs r0, 2 // use xosc (=0x2) as clk_ref source
  str r0, [r1, CLK_REF_CTRL_OFST]
  movs r0, 1 // use auxsrc (default pll_sys, =0x1) as clk_sys source
  str r0, [r1, CLK_SYS_CTRL_OFST]
  bx lr