cpu.c 488 B

123456789101112131415161718192021222324252627282930
  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. gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
  14. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  15. cache_init();
  16. return 0;
  17. }
  18. int arch_early_init_r(void)
  19. {
  20. gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  21. gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
  22. return 0;
  23. }