soc.c 712 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * (C) Copyright 2015
  3. * Kamil Lulko, <kamil.lulko@gmail.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <asm/io.h>
  9. #include <asm/armv7m_mpu.h>
  10. #include <asm/arch/stm32.h>
  11. u32 get_cpu_rev(void)
  12. {
  13. return 0;
  14. }
  15. int arch_cpu_init(void)
  16. {
  17. struct mpu_region_config stm32_region_config[] = {
  18. { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
  19. STRONG_ORDER, REGION_4GB },
  20. };
  21. int i;
  22. configure_clocks();
  23. /*
  24. * Configure the memory protection unit (MPU) to allow full access to
  25. * the whole 4GB address space.
  26. */
  27. disable_mpu();
  28. for (i = 0; i < ARRAY_SIZE(stm32_region_config); i++)
  29. mpu_config(&stm32_region_config[i]);
  30. enable_mpu();
  31. return 0;
  32. }
  33. void s_init(void)
  34. {
  35. }