cpu.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2011 The Chromium OS Authors.
  3. * SPDX-License-Identifier: GPL-2.0+
  4. */
  5. #include <common.h>
  6. #include <os.h>
  7. DECLARE_GLOBAL_DATA_PTR;
  8. void reset_cpu(ulong ignored)
  9. {
  10. /* This is considered normal termination for now */
  11. os_exit(0);
  12. }
  13. int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  14. {
  15. reset_cpu(0);
  16. return 0;
  17. }
  18. /* delay x useconds */
  19. void __udelay(unsigned long usec)
  20. {
  21. os_usleep(usec);
  22. }
  23. unsigned long __attribute__((no_instrument_function)) timer_get_us(void)
  24. {
  25. return os_get_nsec() / 1000;
  26. }
  27. int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
  28. {
  29. if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
  30. bootstage_mark(BOOTSTAGE_ID_RUN_OS);
  31. printf("## Transferring control to Linux (at address %08lx)...\n",
  32. images->ep);
  33. reset_cpu(0);
  34. }
  35. return 0;
  36. }
  37. int cleanup_before_linux(void)
  38. {
  39. return 0;
  40. }
  41. void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
  42. {
  43. return (void *)(gd->arch.ram_buf + paddr);
  44. }
  45. phys_addr_t map_to_sysmem(void *ptr)
  46. {
  47. return (u8 *)ptr - gd->arch.ram_buf;
  48. }
  49. void flush_dcache_range(unsigned long start, unsigned long stop)
  50. {
  51. }