Fork of the vendor (Boundary Devices) u-boot for Reform 2, with minor tweaks. The goal is to migrate to mainstream u-boot or barebox ASAP. The main impediment so far is the 4GB RAM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

53 lines
915 B

  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2002
  4. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  5. * Marius Groeger <mgroeger@sysgo.de>
  6. *
  7. * (C) Copyright 2002
  8. * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
  9. */
  10. /*
  11. * CPU specific code
  12. */
  13. #include <common.h>
  14. #include <command.h>
  15. #include <asm/system.h>
  16. static void cache_flush(void);
  17. int cleanup_before_linux (void)
  18. {
  19. /*
  20. * this function is called just before we call linux
  21. * it prepares the processor for linux
  22. *
  23. * we turn off caches etc ...
  24. */
  25. disable_interrupts ();
  26. /* turn off I/D-cache */
  27. icache_disable();
  28. dcache_disable();
  29. l2_cache_disable();
  30. /* flush I/D-cache */
  31. cache_flush();
  32. return 0;
  33. }
  34. /* flush I/D-cache */
  35. static void cache_flush (void)
  36. {
  37. #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
  38. unsigned long i = 0;
  39. asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));
  40. #endif
  41. }