Armando Montanez | ec9dd67 | 2020-06-05 12:32:51 -0700 | [diff] [blame] | 1 | // Copyright 2020 The Pigweed Authors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | // use this file except in compliance with the License. You may obtain a copy of |
| 5 | // the License at |
| 6 | // |
| 7 | // https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | // License for the specific language governing permissions and limitations under |
| 13 | // the License. |
| 14 | |
| 15 | #include "pw_boot_armv7m/boot.h" |
Ewout van Bekkum | 712cbfb | 2020-08-24 11:55:57 -0700 | [diff] [blame^] | 16 | #include "pw_sys_io_baremetal_lm3s6965evb/init.h" |
Armando Montanez | ec9dd67 | 2020-06-05 12:32:51 -0700 | [diff] [blame] | 17 | |
Ewout van Bekkum | 712cbfb | 2020-08-24 11:55:57 -0700 | [diff] [blame^] | 18 | void pw_boot_PreStaticMemoryInit() { |
| 19 | // Force RCC to be at default at boot. |
| 20 | const uint32_t kRccDefault = 0x078E3AD1U; |
| 21 | volatile uint32_t* rcc = (volatile uint32_t*)0x400FE070U; |
| 22 | *rcc = kRccDefault; |
| 23 | const uint32_t kRcc2Default = 0x07802810U; |
| 24 | volatile uint32_t* rcc2 = (volatile uint32_t*)0x400FE070U; |
| 25 | *rcc2 = kRcc2Default; |
| 26 | } |
| 27 | |
Ewout van Bekkum | fff82ec | 2020-08-21 15:54:28 -0700 | [diff] [blame] | 28 | void pw_boot_PreStaticConstructorInit() {} |
Ewout van Bekkum | 712cbfb | 2020-08-24 11:55:57 -0700 | [diff] [blame^] | 29 | |
| 30 | void pw_boot_PreMainInit() { pw_sys_io_Init(); } |