global_data.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * (C) Copyright 2002-2010
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef __ASM_GBL_DATA_H
  8. #define __ASM_GBL_DATA_H
  9. #ifndef __ASSEMBLY__
  10. enum pei_boot_mode_t {
  11. PEI_BOOT_NONE = 0,
  12. PEI_BOOT_SOFT_RESET,
  13. PEI_BOOT_RESUME,
  14. };
  15. /* Architecture-specific global data */
  16. struct arch_global_data {
  17. struct global_data *gd_addr; /* Location of Global Data */
  18. uint8_t x86; /* CPU family */
  19. uint8_t x86_vendor; /* CPU vendor */
  20. uint8_t x86_model;
  21. uint8_t x86_mask;
  22. uint32_t x86_device;
  23. uint64_t tsc_base; /* Initial value returned by rdtsc() */
  24. uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */
  25. uint32_t tsc_prev; /* For show_boot_progress() */
  26. uint32_t tsc_mhz; /* TSC frequency in MHz */
  27. void *new_fdt; /* Relocated FDT */
  28. uint32_t bist; /* Built-in self test value */
  29. struct pci_controller *hose; /* PCI hose for early use */
  30. enum pei_boot_mode_t pei_boot_mode;
  31. const struct pch_gpio_map *gpio_map; /* board GPIO map */
  32. };
  33. #endif
  34. #include <asm-generic/global_data.h>
  35. #ifndef __ASSEMBLY__
  36. static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
  37. {
  38. gd_t *gd_ptr;
  39. asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
  40. return gd_ptr;
  41. }
  42. #define gd get_fs_gd_ptr()
  43. #endif
  44. /*
  45. * Our private Global Data Flags
  46. */
  47. #define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */
  48. #define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */
  49. #define DECLARE_GLOBAL_DATA_PTR
  50. #endif /* __ASM_GBL_DATA_H */