Files
lk/platform/stm32f1xx/init.c

35 lines
824 B
C
Raw Normal View History

2012-03-17 17:33:26 -07:00
/*
* Copyright (c) 2012-2014 Travis Geiselbrecht
2012-03-17 17:33:26 -07:00
*
* 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-03-17 17:33:26 -07:00
*/
#include <lk/err.h>
#include <lk/debug.h>
#include <dev/uart.h>
2012-03-17 17:33:26 -07:00
#include <platform.h>
#include <platform/stm32.h>
#include <arch/arm/cm.h>
#include <stm32f10x_rcc.h>
#include "system_stm32f10x.h"
2012-03-17 17:33:26 -07:00
void platform_early_init(void) {
// Crank up the clock before initing timers.
SystemInit();
// 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();
stm32_flash_nor_early_init();
2012-03-17 17:33:26 -07:00
}
void platform_init(void) {
stm32_timer_init();
stm32_flash_nor_init();
2012-03-17 17:33:26 -07:00
}