soc.c 658 B

12345678910111213141516171819202122232425262728293031323334353637
  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.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. configure_clocks();
  18. /*
  19. * Configure the memory protection unit (MPU) to allow full access to
  20. * the whole 4GB address space.
  21. */
  22. writel(0, &V7M_MPU->rnr);
  23. writel(0, &V7M_MPU->rbar);
  24. writel((V7M_MPU_RASR_AP_RW_RW | V7M_MPU_RASR_SIZE_4GB
  25. | V7M_MPU_RASR_EN), &V7M_MPU->rasr);
  26. writel(V7M_MPU_CTRL_ENABLE | V7M_MPU_CTRL_HFNMIENA, &V7M_MPU->ctrl);
  27. return 0;
  28. }
  29. void s_init(void)
  30. {
  31. }