sipi.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2015 Gooogle, Inc
  4. * Written by Simon Glass <sjg@chromium.org>
  5. */
  6. #ifndef _ASM_SIPI_H
  7. #define _ASM_SIPI_H
  8. #define AP_DEFAULT_BASE 0x30000
  9. #define AP_DEFAULT_SIZE 0x10000
  10. #ifndef __ASSEMBLY__
  11. /**
  12. * struct sipi_params_16bit - 16-bit SIPI entry-point parameters
  13. *
  14. * These are set up in the same space as the SIPI 16-bit code so that each AP
  15. * can access the parameters when it boots.
  16. *
  17. * Each of these must be set up for the AP to boot, except @segment which is
  18. * set in the assembly code.
  19. *
  20. * @ap_start: 32-bit SIPI entry point for U-Boot
  21. * @segment: Code segment for U-Boot
  22. * @pad: Padding (not used)
  23. * @gdt_limit: U-Boot GDT limit (X86_GDT_SIZE - 1)
  24. * @gdt: U-Boot GDT (gd->arch.gdt)
  25. * @unused: Not used
  26. */
  27. struct __packed sipi_params_16bit {
  28. u32 ap_start;
  29. u16 segment;
  30. u16 pad;
  31. u16 gdt_limit;
  32. u32 gdt;
  33. u16 unused;
  34. };
  35. /**
  36. * struct sipi_params - 32-bit SIP entry-point parameters
  37. *
  38. * These are used by the AP init code and must be set up before the APs start.
  39. * The members must match with the sipi_params layout in sipi_vector.S.
  40. *
  41. * The stack area extends down from @stack_top, with @stack_size allocated
  42. * for each AP.
  43. *
  44. * @idt_ptr: Interrupt descriptor table pointer
  45. * @stack_top: Top of the AP stack area
  46. * @stack_size: Size of each AP's stack
  47. * @microcode_lock: Used to ensure only one AP loads microcode at once
  48. * 0xffffffff enables parallel loading.
  49. * @microcode_ptr: Pointer to microcode, or 0 if none
  50. * @msr_table_ptr: Pointer to saved MSRs, a list of struct saved_msr
  51. * @msr_count: Number of saved MSRs
  52. * @c_handler: C function to call once early init is complete
  53. * @ap_count: Shared atomic value to allocate CPU indexes
  54. */
  55. struct sipi_params {
  56. u32 idt_ptr;
  57. u32 stack_top;
  58. u32 stack_size;
  59. u32 microcode_lock;
  60. u32 microcode_ptr;
  61. u32 msr_table_ptr;
  62. u32 msr_count;
  63. u32 c_handler;
  64. atomic_t ap_count;
  65. };
  66. /* 16-bit AP entry point */
  67. void ap_start16(void);
  68. /* end of 16-bit code/data, marks the region to be copied to SIP vector */
  69. void ap_start16_code_end(void);
  70. /* 32-bit AP entry point */
  71. void ap_start(void);
  72. extern char sipi_params_16bit[];
  73. extern char sipi_params[];
  74. #endif /* __ASSEMBLY__ */
  75. #endif