## SPDX-License-Identifier: GPL-2.0-only

if VENDOR_LENOVO

choice
	prompt "Mainboard model"

source "src/mainboard/lenovo/*/Kconfig.name"

endchoice

source "src/mainboard/lenovo/*/Kconfig"

config MAINBOARD_VENDOR
	default "LENOVO"

config MAINBOARD_FAMILY
	string
	default MAINBOARD_PART_NUMBER

if BOARD_LENOVO_T480 || BOARD_LENOVO_T480S || BOARD_LENOVO_X280 || BOARD_LENOVO_T470S || BOARD_LENOVO_T580

config LENOVO_TBFW_BIN
	string "Lenovo ThunderBolt firmware bin file"
	default ""
	help
	  ThunderBolt firmware for certain ThinkPad models e.g. T480.
	  Not used in the actual build. Libreboot's build system uses this
	  along with config/vendor/*/pkg.cfg entries defining a URL to the
	  Lenovo download link and hash. The resulting file when processed by
	  lbmk can be flashed to the ThunderBolt firmware's 25XX NOR device.
	  Earlier versions of this firmware had debug commands enabled that
	  sent logs to said flash IC, and it would quickly fill up, bricking
	  the ThunderBolt controller. With these updates, flashed externally,
	  you can fix the issue if present or otherwise prevent it. The benefit
	  here is that you then don't need to use Windows or a boot disk. You
	  can flash the TB firmware while flashing Libreboot firmware. Easy!
	  Look for these variables in lbmk:
	  TBFW_url TBFW_url_bkup TBFW_hash and look at how it handles that and
	  CONFIG_LENOVO_TBFW_BIN, in lbmk's include/vendor.sh file.
	  The path set by CONFIG_LENOVO_TBFW_BIN is used by lbmk when extracting
	  the firmware, putting it at that desired location. In this way, lbmk
	  can auto-download such firmware. E.g. ./mk -d coreboot t480_fsp_16mb
	  and it appears at vendorfiles/t480/tb.bin fully padded and everything!

	  Just leave this blank if you don't care about this option. It's not
	  useful for every ThinkPad, only certain models.

endif # BOARD_LENOVO_T480 || BOARD_LENOVO_T480S || BOARD_LENOVO_X280 || BOARD_LENOVO_T470S || BOARD_LENOVO_T580

endif # VENDOR_LENOVO
