bootrom.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * (C) Copyright 2017 Heiko Stuebner <heiko@sntech.de>
  4. * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
  5. */
  6. #ifndef _ASM_ARCH_BOOTROM_H
  7. #define _ASM_ARCH_BOOTROM_H
  8. /*
  9. * Saved Stack pointer address.
  10. * Access might be needed in some special cases.
  11. */
  12. extern u32 SAVE_SP_ADDR;
  13. /**
  14. * back_to_bootrom() - return to bootrom (for TPL/SPL), passing a
  15. * result code
  16. *
  17. * Transfer control back to the Rockchip BROM, restoring necessary
  18. * register context and passing a command/result code to the BROM
  19. * to instruct its next actions (e.g. continue boot sequence, enter
  20. * download mode, ...).
  21. *
  22. * This function does not return.
  23. *
  24. * @brom_cmd: indicates how the bootrom should continue the boot
  25. * sequence (e.g. load the next stage)
  26. */
  27. enum rockchip_bootrom_cmd {
  28. /*
  29. * These can not start at 0, as 0 has a special meaning
  30. * for setjmp().
  31. */
  32. BROM_BOOT_NEXTSTAGE = 1, /* continue boot-sequence */
  33. BROM_BOOT_ENTER_DNL, /* have BROM enter download-mode */
  34. };
  35. void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd);
  36. /**
  37. * Boot-device identifiers as used by the BROM
  38. */
  39. enum {
  40. BROM_BOOTSOURCE_NAND = 1,
  41. BROM_BOOTSOURCE_EMMC = 2,
  42. BROM_BOOTSOURCE_SPINOR = 3,
  43. BROM_BOOTSOURCE_SPINAND = 4,
  44. BROM_BOOTSOURCE_SD = 5,
  45. BROM_BOOTSOURCE_USB = 10,
  46. BROM_LAST_BOOTSOURCE = BROM_BOOTSOURCE_USB
  47. };
  48. /**
  49. * Locations of the boot-device identifier in SRAM
  50. */
  51. #define RK3399_BROM_BOOTSOURCE_ID_ADDR 0xff8c0010
  52. #endif