boot.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * 1. load vmlinuz
  3. *
  4. * CONFIG_MEMORY_START +-----------------------+
  5. * | vmlinuz |
  6. * +-----------------------+
  7. * 2. decompressed
  8. *
  9. * CONFIG_MEMORY_START +-----------------------+
  10. * | vmlinuz |
  11. * +-----------------------+
  12. * | |
  13. * BOOT_RELOC_ADDR +-----------------------+
  14. * | |
  15. * KERNEL_DECOMPRESS_ADDR +-----------------------+
  16. * | vmlinux |
  17. * +-----------------------+
  18. *
  19. * 3. relocate copy & jump code
  20. *
  21. * CONFIG_MEMORY_START +-----------------------+
  22. * | vmlinuz |
  23. * +-----------------------+
  24. * | |
  25. * BOOT_RELOC_ADDR +-----------------------+
  26. * | boot(copy&jump) |
  27. * KERNEL_DECOMPRESS_ADDR +-----------------------+
  28. * | vmlinux |
  29. * +-----------------------+
  30. *
  31. * 4. relocate decompressed kernel
  32. *
  33. * CONFIG_MEMORY_START +-----------------------+
  34. * | vmlinux |
  35. * +-----------------------+
  36. * | |
  37. * BOOT_RELOC_ADDR +-----------------------+
  38. * | boot(copy&jump) |
  39. * KERNEL_DECOMPRESS_ADDR +-----------------------+
  40. * | |
  41. * +-----------------------+
  42. *
  43. */
  44. #ifdef __ASSEMBLY__
  45. #define __val(x) x
  46. #else
  47. #define __val(x) (x)
  48. #endif
  49. #define DECOMPRESS_OFFSET_BASE __val(0x00900000)
  50. #define BOOT_RELOC_SIZE __val(0x00001000)
  51. #define KERNEL_EXEC_ADDR __val(CONFIG_MEMORY_START)
  52. #define KERNEL_DECOMPRESS_ADDR __val(CONFIG_MEMORY_START + \
  53. DECOMPRESS_OFFSET_BASE + BOOT_RELOC_SIZE)
  54. #define KERNEL_ENTRY __val(CONFIG_MEMORY_START + 0x1000)
  55. #define BOOT_EXEC_ADDR __val(CONFIG_MEMORY_START)
  56. #define BOOT_RELOC_ADDR __val(CONFIG_MEMORY_START + DECOMPRESS_OFFSET_BASE)