Merge tag 'u-boot-atmel-fixes-2021.01-b' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / board / toradex / common / tdx-cfg-block.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2016-2020 Toradex
4  */
5
6 #ifndef _TDX_CFG_BLOCK_H
7 #define _TDX_CFG_BLOCK_H
8
9 #include "tdx-common.h"
10
11 struct toradex_hw {
12         u16 ver_major;
13         u16 ver_minor;
14         u16 ver_assembly;
15         u16 prodid;
16 };
17
18 struct toradex_eth_addr {
19         u32 oui:24;
20         u32 nic:24;
21 } __attribute__((__packed__));
22
23 enum {
24         COLIBRI_PXA270_V1_312MHZ = 1,
25         COLIBRI_PXA270_V1_520MHZ,
26         COLIBRI_PXA320,
27         COLIBRI_PXA300,
28         COLIBRI_PXA310, /* 5 */
29         COLIBRI_PXA320_IT,
30         COLIBRI_PXA300_XT,
31         COLIBRI_PXA270_312MHZ,
32         COLIBRI_PXA270_520MHZ,
33         COLIBRI_VF50, /* 10 */
34         COLIBRI_VF61, /* not currently on sale */
35         COLIBRI_VF61_IT,
36         COLIBRI_VF50_IT,
37         COLIBRI_IMX6S,
38         COLIBRI_IMX6DL, /* 15 */
39         COLIBRI_IMX6S_IT,
40         COLIBRI_IMX6DL_IT,
41         /* 18 */
42         /* 19 */
43         COLIBRI_T20_256MB = 20,
44         COLIBRI_T20_512MB,
45         COLIBRI_T20_512MB_IT,
46         COLIBRI_T30,
47         COLIBRI_T20_256MB_IT,
48         APALIS_T30_2GB, /* 25 */
49         APALIS_T30_1GB,
50         APALIS_IMX6Q,
51         APALIS_IMX6Q_IT,
52         APALIS_IMX6D,
53         COLIBRI_T30_IT, /* 30 */
54         APALIS_T30_IT,
55         COLIBRI_IMX7S,
56         COLIBRI_IMX7D,
57         APALIS_TK1_2GB,
58         APALIS_IMX6D_IT, /* 35 */
59         COLIBRI_IMX6ULL,
60         APALIS_IMX8QM_WIFI_BT_IT,
61         COLIBRI_IMX8QXP_WIFI_BT_IT,
62         COLIBRI_IMX7D_EMMC,
63         COLIBRI_IMX6ULL_WIFI_BT_IT, /* 40 */
64         COLIBRI_IMX7D_EPDC,
65         APALIS_TK1_4GB, /* not currently on sale */
66         COLIBRI_T20_512MB_IT_SETEK,
67         COLIBRI_IMX6ULL_IT,
68         COLIBRI_IMX6ULL_WIFI_BT, /* 45 */
69         APALIS_IMX8QXP_WIFI_BT_IT,
70         APALIS_IMX8QM_IT,
71         APALIS_IMX8QP_WIFI_BT,
72         APALIS_IMX8QP,
73         COLIBRI_IMX8QXP_IT, /* 50 */
74         COLIBRI_IMX8DX_WIFI_BT,
75         COLIBRI_IMX8DX,
76         APALIS_IMX8QXP,
77         APALIS_IMX8DXP,
78         VERDIN_IMX8MMQ_WIFI_BT_IT, /* 55 */
79         VERDIN_IMX8MNQ_WIFI_BT,
80         VERDIN_IMX8MMDL,
81         VERDIN_IMX8MPQ_WIFI_BT_IT,
82         VERDIN_IMX8MMQ_IT,
83         VERDIN_IMX8MMDL_WIFI_BT_IT, /* 60 */
84         VERDIN_IMX8MPQ,
85 };
86
87 enum {
88         DAHLIA = 155,
89         VERDIN_DEVELOPMENT_BOARD = 156,
90 };
91
92 enum {
93         VERDIN_DSI_TO_HDMI_ADAPTER = 157,
94         VERDIN_DSI_TO_LVDS_ADAPTER = 159,
95 };
96
97 extern const char * const toradex_modules[];
98 extern const char * const toradex_carrier_boards[];
99 extern bool valid_cfgblock;
100 extern struct toradex_hw tdx_hw_tag;
101 extern struct toradex_hw tdx_car_hw_tag;
102 extern struct toradex_eth_addr tdx_eth_addr;
103 extern u32 tdx_serial;
104 extern u32 tdx_car_serial;
105
106 int read_tdx_cfg_block(void);
107 int read_tdx_cfg_block_carrier(void);
108
109 int try_migrate_tdx_cfg_block_carrier(void);
110
111 #endif /* _TDX_CFG_BLOCK_H */