blob: 32e4c6f6879f5ed5af299ceedd3c96fbda01cfd7 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +01002/*
Marcel Ziswiler75b93272020-01-28 14:42:23 +01003 * Copyright (c) 2016-2020 Toradex
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +01004 */
5
6#ifndef _TDX_CFG_BLOCK_H
7#define _TDX_CFG_BLOCK_H
8
9#include "tdx-common.h"
10
11struct toradex_hw {
12 u16 ver_major;
13 u16 ver_minor;
14 u16 ver_assembly;
15 u16 prodid;
16};
17
18struct toradex_eth_addr {
19 u32 oui:24;
20 u32 nic:24;
21} __attribute__((__packed__));
22
Francesco Dolcinifed3bc72022-07-21 15:17:34 +020023struct toradex_som {
24 const char *name;
25 int is_enabled;
26};
27
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010028enum {
29 COLIBRI_PXA270_V1_312MHZ = 1,
30 COLIBRI_PXA270_V1_520MHZ,
31 COLIBRI_PXA320,
32 COLIBRI_PXA300,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020033 COLIBRI_PXA310, /* 5 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010034 COLIBRI_PXA320_IT,
35 COLIBRI_PXA300_XT,
36 COLIBRI_PXA270_312MHZ,
37 COLIBRI_PXA270_520MHZ,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020038 COLIBRI_VF50, /* 10 */
Francesco Dolcini7699ee62022-07-21 15:17:32 +020039 COLIBRI_VF61,
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010040 COLIBRI_VF61_IT,
41 COLIBRI_VF50_IT,
42 COLIBRI_IMX6S,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020043 COLIBRI_IMX6DL, /* 15 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010044 COLIBRI_IMX6S_IT,
45 COLIBRI_IMX6DL_IT,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020046 /* 18 */
47 /* 19 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010048 COLIBRI_T20_256MB = 20,
49 COLIBRI_T20_512MB,
50 COLIBRI_T20_512MB_IT,
51 COLIBRI_T30,
52 COLIBRI_T20_256MB_IT,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020053 APALIS_T30_2GB, /* 25 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010054 APALIS_T30_1GB,
55 APALIS_IMX6Q,
56 APALIS_IMX6Q_IT,
57 APALIS_IMX6D,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020058 COLIBRI_T30_IT, /* 30 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010059 APALIS_T30_IT,
60 COLIBRI_IMX7S,
61 COLIBRI_IMX7D,
62 APALIS_TK1_2GB,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020063 APALIS_IMX6D_IT, /* 35 */
Stefan Agner01875e92018-05-30 19:01:47 +020064 COLIBRI_IMX6ULL,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020065 APALIS_IMX8QM_WIFI_BT_IT,
66 COLIBRI_IMX8QXP_WIFI_BT_IT,
Stefan Agner01875e92018-05-30 19:01:47 +020067 COLIBRI_IMX7D_EMMC,
68 COLIBRI_IMX6ULL_WIFI_BT_IT, /* 40 */
69 COLIBRI_IMX7D_EPDC,
Francesco Dolcini7699ee62022-07-21 15:17:32 +020070 APALIS_TK1_4GB,
Gerard Salvatella5ab3b1d2019-04-09 17:24:07 +020071 COLIBRI_T20_512MB_IT_SETEK,
72 COLIBRI_IMX6ULL_IT,
73 COLIBRI_IMX6ULL_WIFI_BT, /* 45 */
Marcel Ziswilerf60ffec2019-04-09 17:25:33 +020074 APALIS_IMX8QXP_WIFI_BT_IT,
75 APALIS_IMX8QM_IT,
76 APALIS_IMX8QP_WIFI_BT,
77 APALIS_IMX8QP,
78 COLIBRI_IMX8QXP_IT, /* 50 */
79 COLIBRI_IMX8DX_WIFI_BT,
80 COLIBRI_IMX8DX,
Marcel Ziswiler75b93272020-01-28 14:42:23 +010081 APALIS_IMX8QXP,
82 APALIS_IMX8DXP,
Marcel Ziswiler4a9c7022020-10-28 11:58:08 +020083 VERDIN_IMX8MMQ_WIFI_BT_IT, /* 55 */
84 VERDIN_IMX8MNQ_WIFI_BT,
Marcel Ziswilereca26ba2020-01-28 14:42:24 +010085 VERDIN_IMX8MMDL,
Marcel Ziswiler4a9c7022020-10-28 11:58:08 +020086 VERDIN_IMX8MPQ_WIFI_BT_IT,
87 VERDIN_IMX8MMQ_IT,
88 VERDIN_IMX8MMDL_WIFI_BT_IT, /* 60 */
89 VERDIN_IMX8MPQ,
Marcel Ziswilerc066a442021-10-06 18:55:34 +020090 COLIBRI_IMX6ULL_IT_EMMC,
91 VERDIN_IMX8MPQ_IT,
92 VERDIN_IMX8MPQ_2GB_WIFI_BT_IT,
93 VERDIN_IMX8MPQL_IT, /* 65 */
94 VERDIN_IMX8MPQ_8GB_WIFI_BT,
Philippe Schenker48b37032022-05-09 18:58:15 +020095 APALIS_IMX8QM_8GB_WIFI_BT_IT,
Philippe Schenker75b85e12022-07-21 15:17:31 +020096 VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN,
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010097};
98
Igor Opaniuk414df352020-07-15 13:30:54 +030099enum {
100 DAHLIA = 155,
101 VERDIN_DEVELOPMENT_BOARD = 156,
102};
103
104enum {
105 VERDIN_DSI_TO_HDMI_ADAPTER = 157,
106 VERDIN_DSI_TO_LVDS_ADAPTER = 159,
107};
108
Francesco Dolcinifed3bc72022-07-21 15:17:34 +0200109extern const struct toradex_som toradex_modules[];
Igor Opaniuk414df352020-07-15 13:30:54 +0300110extern const char * const toradex_carrier_boards[];
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100111extern bool valid_cfgblock;
112extern struct toradex_hw tdx_hw_tag;
Igor Opaniuk67c9bfc2020-07-15 13:30:55 +0300113extern struct toradex_hw tdx_car_hw_tag;
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100114extern struct toradex_eth_addr tdx_eth_addr;
115extern u32 tdx_serial;
Igor Opaniuk67c9bfc2020-07-15 13:30:55 +0300116extern u32 tdx_car_serial;
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100117
118int read_tdx_cfg_block(void);
Igor Opaniuk67c9bfc2020-07-15 13:30:55 +0300119int read_tdx_cfg_block_carrier(void);
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100120
Igor Opaniuke9ad67a2020-07-15 13:30:56 +0300121int try_migrate_tdx_cfg_block_carrier(void);
122
Philippe Schenkerd52a2572022-06-20 16:57:45 +0200123void get_mac_from_serial(u32 tdx_serial, struct toradex_eth_addr *eth_addr);
124
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100125#endif /* _TDX_CFG_BLOCK_H */