linux.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* linux.h - ARM linux specific definitions */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2013 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GRUB_LINUX_CPU_HEADER
  20. #define GRUB_LINUX_CPU_HEADER 1
  21. #define LINUX_ZIMAGE_OFFSET 0x24
  22. #define LINUX_ZIMAGE_MAGIC 0x016f2818
  23. #include "system.h"
  24. #if defined GRUB_MACHINE_UBOOT
  25. # include <grub/uboot/uboot.h>
  26. # define LINUX_ADDRESS (start_of_ram + 0x8000)
  27. # define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000)
  28. # define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000)
  29. # define grub_arm_firmware_get_boot_data grub_uboot_get_boot_data
  30. # define grub_arm_firmware_get_machine_type grub_uboot_get_machine_type
  31. #elif defined GRUB_MACHINE_EFI
  32. # include <grub/efi/efi.h>
  33. # include <grub/machine/loader.h>
  34. /* On UEFI platforms - load the images at the lowest available address not
  35. less than *_PHYS_OFFSET from the first available memory location. */
  36. # define LINUX_PHYS_OFFSET (0x00008000)
  37. # define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000)
  38. # define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000)
  39. # define grub_arm_firmware_get_boot_data (grub_addr_t)grub_efi_get_firmware_fdt
  40. static inline grub_uint32_t
  41. grub_arm_firmware_get_machine_type (void)
  42. {
  43. return GRUB_ARM_MACHINE_TYPE_FDT;
  44. }
  45. #elif defined (GRUB_MACHINE_COREBOOT)
  46. #include <grub/fdtbus.h>
  47. #include <grub/machine/kernel.h>
  48. # define LINUX_ADDRESS (start_of_ram + 0x8000)
  49. # define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000)
  50. # define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000)
  51. static inline const void *
  52. grub_arm_firmware_get_boot_data (void)
  53. {
  54. return grub_fdtbus_get_fdt ();
  55. }
  56. static inline grub_uint32_t
  57. grub_arm_firmware_get_machine_type (void)
  58. {
  59. return GRUB_ARM_MACHINE_TYPE_FDT;
  60. }
  61. #endif
  62. #define FDT_ADDITIONAL_ENTRIES_SIZE 0x300
  63. #endif /* ! GRUB_LINUX_CPU_HEADER */