From 3aa43abce638786561e7cdeff57384b7e9cdf04f Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sun, 16 Aug 2020 21:39:59 +0800 Subject: ec: add hp/mec1322 --- src/ec/hp/mec1322/Kconfig | 33 +++++++++++++++++++++++++++++++++ src/ec/hp/mec1322/Makefile.inc | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 src/ec/hp/mec1322/Kconfig create mode 100644 src/ec/hp/mec1322/Makefile.inc diff --git a/src/ec/hp/mec1322/Kconfig b/src/ec/hp/mec1322/Kconfig new file mode 100644 index 0000000000..00cb551f6b --- /dev/null +++ b/src/ec/hp/mec1322/Kconfig @@ -0,0 +1,33 @@ +## SPDX-License-Identifier: GPL-2.0-only + +config EC_HP_MEC1322 + bool + help + Interface to SMSC MEC1322 embedded controller in HP laptops. + +if EC_HP_MEC1322 + +comment "Please select the following otherwise your laptop cannot be powered on." + +config MEC1322_FIRMWARE + bool "Add firmware images for MEC1322 EC" + depends on EC_HP_MEC1322 + default n + help + Select this option to add the two firmware blobs for MEC1322. + You need these two blobs to power on your machine. + +config MEC1322_FW + string "MEC1322 firmware path and filename" + depends on MEC1322_FIRMWARE + default "mec1322-fw.bin" + help + The path and filename of the file to use as MEC1322 firmware #1. + You can use util/mec1322/mec1322 to dump it from the vendor firmware. + +config MEC1322_FW_OFFSET + string "Offset of MEC1322 firmware in the flash" + depends on MEC1322_FIRMWARE + default "0xf1f000" + +endif diff --git a/src/ec/hp/mec1322/Makefile.inc b/src/ec/hp/mec1322/Makefile.inc new file mode 100644 index 0000000000..5aec41882c --- /dev/null +++ b/src/ec/hp/mec1322/Makefile.inc @@ -0,0 +1,35 @@ +## SPDX-License-Identifier: GPL-2.0-only + +ifeq ($(CONFIG_EC_HP_MEC1322),y) +MEC1322:=$(top)/util/mec1322/mec1322 +INTERMEDIATE+=mec1322_ec_insert + +ifeq ($(CONFIG_MEC1322_FIRMWARE),y) +cbfs-files-y += ecfw.bin + +ecfw.bin-file := $(call strip_quotes,$(CONFIG_MEC1322_FW)) +ecfw.bin-position := $(CONFIG_MEC1322_FW_OFFSET) +ecfw.bin-type := raw + +endif + +mec1322_ec_insert: $(obj)/coreboot.pre +ifeq ($(CONFIG_MEC1322_FIRMWARE),y) + $(MAKE) -C util/mec1322 + printf " MEC1322 Inserting MEC1322 firmware blobs.\n" + $(MEC1322) insert $(obj)/coreboot.pre $(CONFIG_MEC1322_FW_OFFSET) +endif + +PHONY+=mec1322_ec_insert + +build_complete:: +ifeq ($(CONFIG_MEC1322_FIRMWARE),) + printf "\n** WARNING **\n" + printf "You haven't added the firmware blobs for MEC1322 EC.\n" + printf "You may be unable to power on your laptop without these blobs.\n" + printf "Please select the following option to add them:\n\n" + printf " Chipset --->\n" + printf " [*] Add firmware images for MEC1322 EC\n\n" +endif + +endif -- cgit v1.2.3