Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 2 | /* |
Marcel Ziswiler | 75b9327 | 2020-01-28 14:42:23 +0100 | [diff] [blame] | 3 | * Copyright (c) 2016-2020 Toradex |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 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 | |
Francesco Dolcini | fed3bc7 | 2022-07-21 15:17:34 +0200 | [diff] [blame] | 23 | struct toradex_som { |
| 24 | const char *name; |
| 25 | int is_enabled; |
| 26 | }; |
| 27 | |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 28 | enum { |
| 29 | COLIBRI_PXA270_V1_312MHZ = 1, |
| 30 | COLIBRI_PXA270_V1_520MHZ, |
| 31 | COLIBRI_PXA320, |
| 32 | COLIBRI_PXA300, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 33 | COLIBRI_PXA310, /* 5 */ |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 34 | COLIBRI_PXA320_IT, |
| 35 | COLIBRI_PXA300_XT, |
| 36 | COLIBRI_PXA270_312MHZ, |
| 37 | COLIBRI_PXA270_520MHZ, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 38 | COLIBRI_VF50, /* 10 */ |
Francesco Dolcini | 7699ee6 | 2022-07-21 15:17:32 +0200 | [diff] [blame] | 39 | COLIBRI_VF61, |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 40 | COLIBRI_VF61_IT, |
| 41 | COLIBRI_VF50_IT, |
| 42 | COLIBRI_IMX6S, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 43 | COLIBRI_IMX6DL, /* 15 */ |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 44 | COLIBRI_IMX6S_IT, |
| 45 | COLIBRI_IMX6DL_IT, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 46 | /* 18 */ |
| 47 | /* 19 */ |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 48 | COLIBRI_T20_256MB = 20, |
| 49 | COLIBRI_T20_512MB, |
| 50 | COLIBRI_T20_512MB_IT, |
| 51 | COLIBRI_T30, |
| 52 | COLIBRI_T20_256MB_IT, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 53 | APALIS_T30_2GB, /* 25 */ |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 54 | APALIS_T30_1GB, |
| 55 | APALIS_IMX6Q, |
| 56 | APALIS_IMX6Q_IT, |
| 57 | APALIS_IMX6D, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 58 | COLIBRI_T30_IT, /* 30 */ |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 59 | APALIS_T30_IT, |
| 60 | COLIBRI_IMX7S, |
| 61 | COLIBRI_IMX7D, |
| 62 | APALIS_TK1_2GB, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 63 | APALIS_IMX6D_IT, /* 35 */ |
Stefan Agner | 01875e9 | 2018-05-30 19:01:47 +0200 | [diff] [blame] | 64 | COLIBRI_IMX6ULL, |
Marcel Ziswiler | 2658c8e | 2019-04-09 17:25:32 +0200 | [diff] [blame] | 65 | APALIS_IMX8QM_WIFI_BT_IT, |
| 66 | COLIBRI_IMX8QXP_WIFI_BT_IT, |
Stefan Agner | 01875e9 | 2018-05-30 19:01:47 +0200 | [diff] [blame] | 67 | COLIBRI_IMX7D_EMMC, |
| 68 | COLIBRI_IMX6ULL_WIFI_BT_IT, /* 40 */ |
| 69 | COLIBRI_IMX7D_EPDC, |
Francesco Dolcini | 7699ee6 | 2022-07-21 15:17:32 +0200 | [diff] [blame] | 70 | APALIS_TK1_4GB, |
Gerard Salvatella | 5ab3b1d | 2019-04-09 17:24:07 +0200 | [diff] [blame] | 71 | COLIBRI_T20_512MB_IT_SETEK, |
| 72 | COLIBRI_IMX6ULL_IT, |
| 73 | COLIBRI_IMX6ULL_WIFI_BT, /* 45 */ |
Marcel Ziswiler | f60ffec | 2019-04-09 17:25:33 +0200 | [diff] [blame] | 74 | 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 Ziswiler | 75b9327 | 2020-01-28 14:42:23 +0100 | [diff] [blame] | 81 | APALIS_IMX8QXP, |
| 82 | APALIS_IMX8DXP, |
Marcel Ziswiler | 4a9c702 | 2020-10-28 11:58:08 +0200 | [diff] [blame] | 83 | VERDIN_IMX8MMQ_WIFI_BT_IT, /* 55 */ |
| 84 | VERDIN_IMX8MNQ_WIFI_BT, |
Marcel Ziswiler | eca26ba | 2020-01-28 14:42:24 +0100 | [diff] [blame] | 85 | VERDIN_IMX8MMDL, |
Marcel Ziswiler | 4a9c702 | 2020-10-28 11:58:08 +0200 | [diff] [blame] | 86 | VERDIN_IMX8MPQ_WIFI_BT_IT, |
| 87 | VERDIN_IMX8MMQ_IT, |
| 88 | VERDIN_IMX8MMDL_WIFI_BT_IT, /* 60 */ |
| 89 | VERDIN_IMX8MPQ, |
Marcel Ziswiler | c066a44 | 2021-10-06 18:55:34 +0200 | [diff] [blame] | 90 | 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 Schenker | 48b3703 | 2022-05-09 18:58:15 +0200 | [diff] [blame] | 95 | APALIS_IMX8QM_8GB_WIFI_BT_IT, |
Philippe Schenker | 75b85e1 | 2022-07-21 15:17:31 +0200 | [diff] [blame] | 96 | VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN, |
Marcel Ziswiler | 2bb00b8 | 2023-08-04 12:08:05 +0200 | [diff] [blame] | 97 | VERDIN_AM62Q_WIFI_BT_IT, |
| 98 | VERDIN_IMX8MPQ_8GB_WIFI_BT_IT, /* 70 */ |
| 99 | VERDIN_AM62S_512MB, |
| 100 | VERDIN_AM62S_512MB_WIFI_BT_IT, |
| 101 | VERDIN_AM62D_1G_ET, |
| 102 | VERDIN_AM62D_1G_IT, |
| 103 | VERDIN_AM62D_1G_WIFI_BT_IT, /* 75 */ |
| 104 | VERDIN_AM62Q_2G_WIFI_BT_IT, |
Joao Paulo Goncalves | bdd3ce4 | 2024-01-22 17:09:30 -0300 | [diff] [blame] | 105 | COLIBRI_IMX6S_NOWINCE, |
| 106 | COLIBRI_IMX6S_IT_NOWINCE, |
| 107 | COLIBRI_IMX6DL_NOWINCE, |
| 108 | COLIBRI_IMX6DL_IT_NOWINCE, /* 80 */ |
| 109 | COLIBRI_IMX7D_NOWINCE, |
| 110 | APALIS_IMX6D_NOWINCE, |
| 111 | APALIS_IMX6Q_NOWINCE, |
| 112 | APALIS_IMX6D_IT_NOWINCE, |
| 113 | APALIS_IMX6Q_IT_NOWINCE, /* 85 */ |
Joao Paulo Goncalves | 9dcd9a9 | 2024-01-31 14:32:04 -0300 | [diff] [blame] | 114 | VERDIN_IMX8MMDL_2G_IT, |
Joao Paulo Goncalves | 92b38e7 | 2024-03-08 11:18:01 -0300 | [diff] [blame^] | 115 | VERDIN_IMX8MMQ_2G_IT_NO_CAN, |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 116 | }; |
| 117 | |
Igor Opaniuk | 414df35 | 2020-07-15 13:30:54 +0300 | [diff] [blame] | 118 | enum { |
| 119 | DAHLIA = 155, |
| 120 | VERDIN_DEVELOPMENT_BOARD = 156, |
Max Krummenacher | 2ded2d6 | 2023-07-18 11:07:33 +0200 | [diff] [blame] | 121 | YAVIA = 173, |
Igor Opaniuk | 414df35 | 2020-07-15 13:30:54 +0300 | [diff] [blame] | 122 | }; |
| 123 | |
| 124 | enum { |
| 125 | VERDIN_DSI_TO_HDMI_ADAPTER = 157, |
| 126 | VERDIN_DSI_TO_LVDS_ADAPTER = 159, |
| 127 | }; |
| 128 | |
Francesco Dolcini | fed3bc7 | 2022-07-21 15:17:34 +0200 | [diff] [blame] | 129 | extern const struct toradex_som toradex_modules[]; |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 130 | extern bool valid_cfgblock; |
| 131 | extern struct toradex_hw tdx_hw_tag; |
Igor Opaniuk | 67c9bfc | 2020-07-15 13:30:55 +0300 | [diff] [blame] | 132 | extern struct toradex_hw tdx_car_hw_tag; |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 133 | extern struct toradex_eth_addr tdx_eth_addr; |
| 134 | extern u32 tdx_serial; |
Igor Opaniuk | 67c9bfc | 2020-07-15 13:30:55 +0300 | [diff] [blame] | 135 | extern u32 tdx_car_serial; |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 136 | |
| 137 | int read_tdx_cfg_block(void); |
Igor Opaniuk | 67c9bfc | 2020-07-15 13:30:55 +0300 | [diff] [blame] | 138 | int read_tdx_cfg_block_carrier(void); |
Max Krummenacher | 2ded2d6 | 2023-07-18 11:07:33 +0200 | [diff] [blame] | 139 | const char * const get_toradex_carrier_boards(int pid4); |
Max Krummenacher | cea0909 | 2023-07-18 11:07:34 +0200 | [diff] [blame] | 140 | const char * const get_toradex_display_adapters(int pid4); |
Igor Opaniuk | e9ad67a | 2020-07-15 13:30:56 +0300 | [diff] [blame] | 141 | int try_migrate_tdx_cfg_block_carrier(void); |
| 142 | |
Philippe Schenker | d52a257 | 2022-06-20 16:57:45 +0200 | [diff] [blame] | 143 | void get_mac_from_serial(u32 tdx_serial, struct toradex_eth_addr *eth_addr); |
| 144 | |
Marcel Ziswiler | 7a28dfc | 2016-11-16 17:49:22 +0100 | [diff] [blame] | 145 | #endif /* _TDX_CFG_BLOCK_H */ |