blob: 8f91d9aec65f9096ebe8472acb4bf3f2b41bcc1a [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
23enum {
24 COLIBRI_PXA270_V1_312MHZ = 1,
25 COLIBRI_PXA270_V1_520MHZ,
26 COLIBRI_PXA320,
27 COLIBRI_PXA300,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020028 COLIBRI_PXA310, /* 5 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010029 COLIBRI_PXA320_IT,
30 COLIBRI_PXA300_XT,
31 COLIBRI_PXA270_312MHZ,
32 COLIBRI_PXA270_520MHZ,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020033 COLIBRI_VF50, /* 10 */
34 COLIBRI_VF61, /* not currently on sale */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010035 COLIBRI_VF61_IT,
36 COLIBRI_VF50_IT,
37 COLIBRI_IMX6S,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020038 COLIBRI_IMX6DL, /* 15 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010039 COLIBRI_IMX6S_IT,
40 COLIBRI_IMX6DL_IT,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020041 /* 18 */
42 /* 19 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010043 COLIBRI_T20_256MB = 20,
44 COLIBRI_T20_512MB,
45 COLIBRI_T20_512MB_IT,
46 COLIBRI_T30,
47 COLIBRI_T20_256MB_IT,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020048 APALIS_T30_2GB, /* 25 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010049 APALIS_T30_1GB,
50 APALIS_IMX6Q,
51 APALIS_IMX6Q_IT,
52 APALIS_IMX6D,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020053 COLIBRI_T30_IT, /* 30 */
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010054 APALIS_T30_IT,
55 COLIBRI_IMX7S,
56 COLIBRI_IMX7D,
57 APALIS_TK1_2GB,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020058 APALIS_IMX6D_IT, /* 35 */
Stefan Agner01875e92018-05-30 19:01:47 +020059 COLIBRI_IMX6ULL,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020060 APALIS_IMX8QM_WIFI_BT_IT,
61 COLIBRI_IMX8QXP_WIFI_BT_IT,
Stefan Agner01875e92018-05-30 19:01:47 +020062 COLIBRI_IMX7D_EMMC,
63 COLIBRI_IMX6ULL_WIFI_BT_IT, /* 40 */
64 COLIBRI_IMX7D_EPDC,
Marcel Ziswiler2658c8e2019-04-09 17:25:32 +020065 APALIS_TK1_4GB, /* not currently on sale */
Gerard Salvatella5ab3b1d2019-04-09 17:24:07 +020066 COLIBRI_T20_512MB_IT_SETEK,
67 COLIBRI_IMX6ULL_IT,
68 COLIBRI_IMX6ULL_WIFI_BT, /* 45 */
Marcel Ziswilerf60ffec2019-04-09 17:25:33 +020069 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,
Marcel Ziswiler75b93272020-01-28 14:42:23 +010076 APALIS_IMX8QXP,
77 APALIS_IMX8DXP,
Marcel Ziswilereca26ba2020-01-28 14:42:24 +010078 VERDIN_IMX8MMQ_WIFI_BT_IT,
79 VERDIN_IMX8MNSL,
80 VERDIN_IMX8MMDL,
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010081};
82
Igor Opaniuk414df352020-07-15 13:30:54 +030083enum {
84 DAHLIA = 155,
85 VERDIN_DEVELOPMENT_BOARD = 156,
86};
87
88enum {
89 VERDIN_DSI_TO_HDMI_ADAPTER = 157,
90 VERDIN_DSI_TO_LVDS_ADAPTER = 159,
91};
92
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010093extern const char * const toradex_modules[];
Igor Opaniuk414df352020-07-15 13:30:54 +030094extern const char * const toradex_carrier_boards[];
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010095extern bool valid_cfgblock;
96extern struct toradex_hw tdx_hw_tag;
Igor Opaniuk67c9bfc2020-07-15 13:30:55 +030097extern struct toradex_hw tdx_car_hw_tag;
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +010098extern struct toradex_eth_addr tdx_eth_addr;
99extern u32 tdx_serial;
Igor Opaniuk67c9bfc2020-07-15 13:30:55 +0300100extern u32 tdx_car_serial;
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100101
102int read_tdx_cfg_block(void);
Igor Opaniuk67c9bfc2020-07-15 13:30:55 +0300103int read_tdx_cfg_block_carrier(void);
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100104
Igor Opaniuke9ad67a2020-07-15 13:30:56 +0300105int try_migrate_tdx_cfg_block_carrier(void);
106
Marcel Ziswiler7a28dfc2016-11-16 17:49:22 +0100107#endif /* _TDX_CFG_BLOCK_H */