cpu.c 682 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <asm/arcregs.h>
  8. #include <asm/cache.h>
  9. DECLARE_GLOBAL_DATA_PTR;
  10. int arch_cpu_init(void)
  11. {
  12. timer_init();
  13. /* In simulation (ISS) "CHIPID" and "ARCNUM" are all "ff" */
  14. if ((read_aux_reg(ARC_AUX_IDENTITY) & 0xffffff00) == 0xffffff00)
  15. gd->arch.running_on_hw = 0;
  16. else
  17. gd->arch.running_on_hw = 1;
  18. gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
  19. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  20. cache_init();
  21. return 0;
  22. }
  23. int arch_early_init_r(void)
  24. {
  25. gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  26. gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
  27. return 0;
  28. }