~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: ea58bd43b176333a9531b1ad289583d1b386b84c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (c) 2016-2020 Toradex
 */

#ifndef _TDX_CFG_BLOCK_H
#define _TDX_CFG_BLOCK_H

#include "tdx-common.h"

struct toradex_hw {
	u16 ver_major;
	u16 ver_minor;
	u16 ver_assembly;
	u16 prodid;
};

struct toradex_eth_addr {
	u32 oui:24;
	u32 nic:24;
} __attribute__((__packed__));

struct toradex_som {
	const char *name;
	int is_enabled;
};

enum {
	COLIBRI_PXA270_V1_312MHZ = 1,
	COLIBRI_PXA270_V1_520MHZ,
	COLIBRI_PXA320,
	COLIBRI_PXA300,
	COLIBRI_PXA310, /* 5 */
	COLIBRI_PXA320_IT,
	COLIBRI_PXA300_XT,
	COLIBRI_PXA270_312MHZ,
	COLIBRI_PXA270_520MHZ,
	COLIBRI_VF50, /* 10 */
	COLIBRI_VF61,
	COLIBRI_VF61_IT,
	COLIBRI_VF50_IT,
	COLIBRI_IMX6S,
	COLIBRI_IMX6DL, /* 15 */
	COLIBRI_IMX6S_IT,
	COLIBRI_IMX6DL_IT,
	/* 18 */
	/* 19 */
	COLIBRI_T20_256MB = 20,
	COLIBRI_T20_512MB,
	COLIBRI_T20_512MB_IT,
	COLIBRI_T30,
	COLIBRI_T20_256MB_IT,
	APALIS_T30_2GB, /* 25 */
	APALIS_T30_1GB,
	APALIS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IT,
	VERDIN_AM62D_1G_ET,
	VERDIN_AM62D_1G_IT,
	VERDIN_AM62D_1G_WIFI_BT_IT, /* 75 */
	VERDIN_AM62Q_2G_WIFI_BT_IT,
};

enum {
	DAHLIA = 155,
	VERDIN_DEVELOPMENT_BOARD = 156,
	YAVIA = 173,
};

enum {
	VERDIN_DSI_TO_HDMI_ADAPTER = 157,
	VERDIN_DSI_TO_LVDS_ADAPTER = 159,
};

extern const struct toradex_som toradex_modules[];
extern bool valid_cfgblock;
extern struct toradex_hw tdx_hw_tag;
extern struct toradex_hw tdx_car_hw_tag;
extern struct toradex_eth_addr tdx_eth_addr;
extern u32 tdx_serial;
extern u32 tdx_car_serial;

int read_tdx_cfg_block(void);
int read_tdx_cfg_block_carrier(void);
const char * const get_toradex_carrier_boards(int pid4);
const char * const get_toradex_display_adapters(int pid4);
int try_migrate_tdx_cfg_block_carrier(void);

void get_mac_from_serial(u32 tdx_serial, struct toradex_eth_addr *eth_addr);

#endif /* _TDX_CFG_BLOCK_H */