blob: 201640611adf373de2ecb6ad24bf560ddf7e226c [file] [log] [blame]
Hadi Asyrafi616da772019-06-27 11:34:03 +08001/*
2 * Copyright (c) 2019, Intel Corporation. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef HANDOFF_H
8#define HANDOFF_H
9
10#define HANDOFF_MAGIC_HEADER 0x424f4f54 /* BOOT */
11#define HANDOFF_MAGIC_PINMUX_SEL 0x504d5558 /* PMUX */
12#define HANDOFF_MAGIC_IOCTLR 0x494f4354 /* IOCT */
13#define HANDOFF_MAGIC_FPGA 0x46504741 /* FPGA */
14#define HANDOFF_MAGIC_IODELAY 0x444c4159 /* DLAY */
15#define HANDOFF_MAGIC_CLOCK 0x434c4b53 /* CLKS */
16#define HANDOFF_MAGIC_MISC 0x4d495343 /* MISC */
17
18typedef struct handoff_t {
19 /* header */
20 uint32_t header_magic;
21 uint32_t header_device;
22 uint32_t _pad_0x08_0x10[2];
23
24 /* pinmux configuration - select */
25 uint32_t pinmux_sel_magic;
26 uint32_t pinmux_sel_length;
27 uint32_t _pad_0x18_0x20[2];
28 uint32_t pinmux_sel_array[96]; /* offset, value */
29
30 /* pinmux configuration - io control */
31 uint32_t pinmux_io_magic;
32 uint32_t pinmux_io_length;
33 uint32_t _pad_0x1a8_0x1b0[2];
34 uint32_t pinmux_io_array[96]; /* offset, value */
35
36 /* pinmux configuration - use fpga switch */
37 uint32_t pinmux_fpga_magic;
38 uint32_t pinmux_fpga_length;
39 uint32_t _pad_0x338_0x340[2];
40 uint32_t pinmux_fpga_array[42]; /* offset, value */
41 uint32_t _pad_0x3e8_0x3f0[2];
42
43 /* pinmux configuration - io delay */
44 uint32_t pinmux_delay_magic;
45 uint32_t pinmux_delay_length;
46 uint32_t _pad_0x3f8_0x400[2];
47 uint32_t pinmux_iodelay_array[96]; /* offset, value */
48
49 /* clock configuration */
50 uint32_t clock_magic;
51 uint32_t clock_length;
52 uint32_t _pad_0x588_0x590[2];
53 uint32_t main_pll_mpuclk;
54 uint32_t main_pll_nocclk;
55 uint32_t main_pll_nocdiv;
56 uint32_t main_pll_pllglob;
57 uint32_t main_pll_fdbck;
58 uint32_t main_pll_pllc0;
59 uint32_t main_pll_pllc1;
60 uint32_t main_pll_pllc2;
61 uint32_t main_pll_pllc3;
62 uint32_t main_pll_pllm;
63 uint32_t per_pll_emacctl;
64 uint32_t per_pll_gpiodiv;
65 uint32_t per_pll_pllglob;
66 uint32_t per_pll_fdbck;
67 uint32_t per_pll_pllc0;
68 uint32_t per_pll_pllc1;
69 uint32_t per_pll_pllc2;
70 uint32_t per_pll_pllc3;
71 uint32_t per_pll_pllm;
72 uint32_t alt_emacactr;
73 uint32_t alt_emacbctr;
74 uint32_t alt_emacptpctr;
75 uint32_t alt_gpiodbctr;
76 uint32_t alt_sdmmcctr;
77 uint32_t alt_s2fuser0ctr;
78 uint32_t alt_s2fuser1ctr;
79 uint32_t alt_psirefctr;
80 uint32_t hps_osc_clk_h;
81 uint32_t fpga_clk_hz;
82 uint32_t _pad_0x604_0x610[3];
83
84 /* misc configuration */
85 uint32_t misc_magic;
86 uint32_t misc_length;
87 uint32_t _pad_0x618_0x620[2];
88 uint32_t boot_source;
89} handoff;
90
91int verify_handoff_image(handoff *hoff_ptr, handoff *reverse_hoff_ptr);
92int agilex_get_handoff(handoff *hoff_ptr);
93
94#endif
95
96