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