1# SPDX-License-Identifier: GPL-2.0+
2# Copyright (c) 2016 Toradex, Inc.
3
4menuconfig TDX_CFG_BLOCK
5	bool "Enable Toradex config block support"
6	select OF_BOARD_SETUP
7	help
8	  The Toradex config block stored production data on the on-module
9	  flash device (NAND, NOR or eMMC). The area is normally preserved by
10	  software and contains the serial number (out of which the MAC
11	  address is generated) and the exact module type.
12
13# Helper config to determine the correct default location of the cfg block
14config TDX_HAVE_MMC
15	bool
16
17config TDX_HAVE_NAND
18	bool
19
20config TDX_HAVE_NOR
21	bool
22
23config TDX_HAVE_EEPROM
24	bool
25
26config TDX_HAVE_EEPROM_EXTRA
27	bool
28
29if TDX_CFG_BLOCK
30
31config TDX_CFG_BLOCK_IS_IN_MMC
32	bool
33	depends on TDX_HAVE_MMC
34	default y
35
36config TDX_CFG_BLOCK_IS_IN_NAND
37	bool
38	depends on TDX_HAVE_NAND
39	default y
40
41config TDX_CFG_BLOCK_IS_IN_NOR
42	bool
43	depends on TDX_HAVE_NOR
44	default y
45
46config TDX_CFG_BLOCK_IS_IN_EEPROM
47	bool
48	depends on TDX_HAVE_EEPROM
49	default y
50
51config TDX_CFG_BLOCK_DEV
52	int "Toradex config block eMMC device ID"
53	depends on TDX_CFG_BLOCK_IS_IN_MMC
54
55config TDX_CFG_BLOCK_PART
56	int "Toradex config block eMMC partition ID"
57	depends on TDX_CFG_BLOCK_IS_IN_MMC
58
59config TDX_CFG_BLOCK_OFFSET
60	int "Toradex config block offset"
61	help
62	  Specify the byte offset of the Toradex config block within the flash
63	  device the config block is stored on.
64
65config TDX_CFG_BLOCK_OFFSET2
66	int "Toradex config block offset, second instance"
67	default 0
68	help
69	  Specify the byte offset of the 2nd instance of the Toradex config block
70	  within the flash device the config block is stored on.
71	  Set to 0 on modules which have no 2nd instance.
72
73config TDX_CFG_BLOCK_2ND_ETHADDR
74	bool "Set the second Ethernet address"
75	help
76	  For each serial number two Ethernet addresses are available for dual
77	  Ethernet carrier boards. This options enables the code to set the
78	  second Ethernet address as environment variable (eth1addr).
79
80config TDX_CFG_BLOCK_EXTRA
81	bool "Support for additional EEPROMs (carrier board, display adapter)"
82	depends on TDX_HAVE_EEPROM_EXTRA
83	help
84	  Enables fetching auxilary config blocks from carrier board/display
85	  adapter EEPROMs.
86
87config TDX_CFG_BLOCK_USB_GADGET_PID
88	bool "Use config block product ID as USB product ID"
89	depends on USB_GADGET_DOWNLOAD
90	default y
91	help
92	  Use the Toradex product ID learned from the config block as USB
93	  product ID. An offset of 0x4000 is added to the product ID since
94	  inside the Toradex vendor ID (0x1b67) the range starting from
95	  offset 0x4000 is reserved for Colibri/Apalis modules.
96
97endif
98