Files
lk/platform/stm32f2xx/init.c

33 lines
757 B
C
Raw Normal View History

2012-10-03 15:10:53 -07:00
/*
* Copyright (c) 2012 Travis Geiselbrecht
*
* Use of this source code is governed by a MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT
2012-10-03 15:10:53 -07:00
*/
#include <lk/err.h>
#include <lk/debug.h>
2012-10-03 15:10:53 -07:00
#include <dev/uart.h>
#include <platform.h>
#include <platform/stm32.h>
#include <arch/arm/cm.h>
#include <stm32f2xx_rcc.h>
2012-10-03 15:10:53 -07:00
#include "system_stm32f2xx.h"
void platform_early_init(void) {
// Crank up the clock before initing timers.
SystemInit();
2012-10-03 15:10:53 -07:00
// start the systick timer
RCC_ClocksTypeDef clocks;
RCC_GetClocksFreq(&clocks);
arm_cm_systick_init(clocks.SYSCLK_Frequency);
stm32_timer_early_init();
stm32_gpio_early_init();
2012-10-03 15:10:53 -07:00
}
void platform_init(void) {
stm32_timer_init();
2012-10-03 15:10:53 -07:00
}