@@ -47,17 +47,17 @@ func init() {
47
47
48
48
func pric_init () {
49
49
// Make sure the HFROSC is on
50
- sifive .PRIC .HFROSCCFG .SetBits (sifive .PRIC_HFROSCCFG_ENABLE )
50
+ sifive .PRCI .HFROSCCFG .SetBits (sifive .PRCI_HFROSCCFG_ENABLE )
51
51
52
52
// Run off 16 MHz Crystal for accuracy.
53
- sifive .PRIC .PLLCFG .SetBits (sifive .PRIC_PLLCFG_REFSEL | sifive .PRIC_PLLCFG_BYPASS )
54
- sifive .PRIC .PLLCFG .SetBits (sifive .PRIC_PLLCFG_SEL )
53
+ sifive .PRCI .PLLCFG .SetBits (sifive .PRCI_PLLCFG_REFSEL | sifive .PRCI_PLLCFG_BYPASS )
54
+ sifive .PRCI .PLLCFG .SetBits (sifive .PRCI_PLLCFG_SEL )
55
55
56
56
// Turn off HFROSC to save power
57
- sifive .PRIC .HFROSCCFG .ClearBits (sifive .PRIC_HFROSCCFG_ENABLE )
57
+ sifive .PRCI .HFROSCCFG .ClearBits (sifive .PRCI_HFROSCCFG_ENABLE )
58
58
59
59
// Enable the RTC.
60
- sifive .RTC .CONFIG .Set (sifive .RTC_CONFIG_ENALWAYS )
60
+ sifive .RTC .RTCCFG .Set (sifive .RTC_RTCCFG_ENALWAYS )
61
61
}
62
62
63
63
func preinit () {
@@ -85,10 +85,10 @@ func putchar(c byte) {
85
85
func ticks () timeUnit {
86
86
// Combining the low bits and the high bits yields a time span of over 270
87
87
// years without counter rollover.
88
- highBits := sifive .RTC .HI .Get ()
88
+ highBits := sifive .RTC .RTCHI .Get ()
89
89
for {
90
- lowBits := sifive .RTC .LO .Get ()
91
- newHighBits := sifive .RTC .HI .Get ()
90
+ lowBits := sifive .RTC .RTCLO .Get ()
91
+ newHighBits := sifive .RTC .RTCHI .Get ()
92
92
if newHighBits == highBits {
93
93
// High bits stayed the same.
94
94
return timeUnit (lowBits ) | (timeUnit (highBits ) << 32 )
0 commit comments