cpu.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2012 Michal Simek <monstr@monstr.eu>
  3. * Copyright (C) 2012 Xilinx, Inc. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <asm/io.h>
  9. #include <asm/arch/sys_proto.h>
  10. #include <asm/arch/hardware.h>
  11. void lowlevel_init(void)
  12. {
  13. }
  14. int arch_cpu_init(void)
  15. {
  16. zynq_slcr_unlock();
  17. /* remap DDR to zero, FILTERSTART */
  18. writel(0, &scu_base->filter_start);
  19. /* Device config APB, unlock the PCAP */
  20. writel(0x757BDF0D, &devcfg_base->unlock);
  21. writel(0xFFFFFFFF, &devcfg_base->rom_shadow);
  22. /* OCM_CFG, Mask out the ROM, map ram into upper addresses */
  23. writel(0x1F, &slcr_base->ocm_cfg);
  24. /* FPGA_RST_CTRL, clear resets on AXI fabric ports */
  25. writel(0x0, &slcr_base->fpga_rst_ctrl);
  26. /* TZ_DDR_RAM, Set DDR trust zone non-secure */
  27. writel(0xFFFFFFFF, &slcr_base->trust_zone);
  28. /* Set urgent bits with register */
  29. writel(0x0, &slcr_base->ddr_urgent_sel);
  30. /* Urgent write, ports S2/S3 */
  31. writel(0xC, &slcr_base->ddr_urgent);
  32. zynq_slcr_lock();
  33. return 0;
  34. }
  35. void reset_cpu(ulong addr)
  36. {
  37. zynq_slcr_cpu_reset();
  38. while (1)
  39. ;
  40. }