Martin Roth | 74a4dca | 2022-10-28 22:36:59 -0600 | [diff] [blame^] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Stefan Reinauer | 77c04e9 | 2015-04-27 14:03:47 -0700 | [diff] [blame] | 2 | ifeq ($(CONFIG_EC_GOOGLE_CHROMEEC),y) |
| 3 | |
Furquan Shaikh | 31b816b | 2020-07-02 15:59:08 -0700 | [diff] [blame] | 4 | subdirs-y += audio_codec |
Furquan Shaikh | 38b349c | 2020-04-19 17:40:22 -0700 | [diff] [blame] | 5 | subdirs-y += i2c_tunnel |
Prashant Malani | 688105b | 2022-04-01 20:19:20 +0000 | [diff] [blame] | 6 | subdirs-y += mux |
Furquan Shaikh | 38b349c | 2020-04-19 17:40:22 -0700 | [diff] [blame] | 7 | |
Martin Roth | 7d1593a | 2018-03-06 14:36:08 -0700 | [diff] [blame] | 8 | bootblock-$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDID) += ec_boardid.c |
You-Cheng Syu | 76c7688 | 2019-01-19 17:55:20 +0800 | [diff] [blame] | 9 | verstage-$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDID) += ec_boardid.c |
Furquan Shaikh | a209483 | 2017-09-25 08:04:49 -0700 | [diff] [blame] | 10 | romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDID) += ec_boardid.c |
| 11 | ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDID) += ec_boardid.c |
Furquan Shaikh | 8dcfcb31 | 2018-10-06 12:02:27 -0700 | [diff] [blame] | 12 | smm-$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDID) += ec_boardid.c |
Furquan Shaikh | a209483 | 2017-09-25 08:04:49 -0700 | [diff] [blame] | 13 | |
Edward O'Callaghan | c6ab2ff | 2020-02-21 14:58:43 +1100 | [diff] [blame] | 14 | smm-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_skuid.c |
Edward O'Callaghan | 9ed10bf | 2020-02-20 13:38:49 +1100 | [diff] [blame] | 15 | romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_skuid.c |
| 16 | ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_skuid.c |
| 17 | |
Yu-Ping Wu | 863b753 | 2021-06-03 16:26:13 +0800 | [diff] [blame] | 18 | ifeq ($(CONFIG_GENERATE_SMBIOS_TABLES),y) |
| 19 | romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_smbios.c |
| 20 | ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SKUID) += ec_smbios.c |
| 21 | endif |
| 22 | |
Subrata Banik | 50b9258 | 2016-07-21 23:47:38 +0530 | [diff] [blame] | 23 | bootblock-y += ec.c |
Aaron Durbin | fbb3e6c | 2016-05-10 17:00:06 -0500 | [diff] [blame] | 24 | bootblock-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c |
Derek Huang | 1a36876 | 2021-09-30 21:20:02 +0800 | [diff] [blame] | 25 | ramstage-y += ec.c crosec_proto.c vstore.c usbc_mux.c |
Hung-Te Lin | 6bfbb33 | 2013-04-15 18:27:24 +0800 | [diff] [blame] | 26 | ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_I2C) += ec_i2c.c |
Hung-Te Lin | a904f9e | 2013-04-11 15:58:12 +0800 | [diff] [blame] | 27 | ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c |
Hung-Te Lin | 0ee7062 | 2013-06-26 19:42:12 +0800 | [diff] [blame] | 28 | ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SPI) += ec_spi.c |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 29 | smm-y += ec.c crosec_proto.c smihandler.c vstore.c |
Hung-Te Lin | 6bfbb33 | 2013-04-15 18:27:24 +0800 | [diff] [blame] | 30 | smm-$(CONFIG_EC_GOOGLE_CHROMEEC_I2C) += ec_i2c.c |
Hung-Te Lin | a904f9e | 2013-04-11 15:58:12 +0800 | [diff] [blame] | 31 | smm-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c |
Hung-Te Lin | 0ee7062 | 2013-06-26 19:42:12 +0800 | [diff] [blame] | 32 | smm-$(CONFIG_EC_GOOGLE_CHROMEEC_SPI) += ec_spi.c |
Duncan Laurie | e2cea4f | 2015-12-01 19:14:09 -0800 | [diff] [blame] | 33 | romstage-y += ec.c crosec_proto.c vstore.c |
Hung-Te Lin | 6bfbb33 | 2013-04-15 18:27:24 +0800 | [diff] [blame] | 34 | romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_I2C) += ec_i2c.c |
Hung-Te Lin | a904f9e | 2013-04-11 15:58:12 +0800 | [diff] [blame] | 35 | romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c |
Hung-Te Lin | 0ee7062 | 2013-06-26 19:42:12 +0800 | [diff] [blame] | 36 | romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SPI) += ec_spi.c |
Duncan Laurie | e2cea4f | 2015-12-01 19:14:09 -0800 | [diff] [blame] | 37 | verstage-y += ec.c crosec_proto.c vstore.c |
Daisuke Nojiri | 224f922 | 2014-06-30 09:56:32 -0700 | [diff] [blame] | 38 | verstage-$(CONFIG_EC_GOOGLE_CHROMEEC_I2C) += ec_i2c.c |
| 39 | verstage-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c |
| 40 | verstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SPI) += ec_spi.c |
Furquan Shaikh | e0060a8 | 2020-03-05 08:06:27 -0800 | [diff] [blame] | 41 | ramstage-$(CONFIG_HAVE_ACPI_TABLES) += ec_acpi.c |
Stefan Reinauer | 77c04e9 | 2015-04-27 14:03:47 -0700 | [diff] [blame] | 42 | |
Furquan Shaikh | 2a12e2e | 2016-07-25 11:48:03 -0700 | [diff] [blame] | 43 | ramstage-$(CONFIG_VBOOT) += vboot_storage.c |
| 44 | smm-$(CONFIG_VBOOT) += vboot_storage.c |
| 45 | romstage-$(CONFIG_VBOOT) += vboot_storage.c |
| 46 | verstage-$(CONFIG_VBOOT) += vboot_storage.c |
Aaron Durbin | 49b2383 | 2016-01-22 14:42:54 -0600 | [diff] [blame] | 47 | |
Furquan Shaikh | cd2afc0 | 2016-11-15 20:33:29 -0800 | [diff] [blame] | 48 | verstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SWITCHES) += switches.c |
| 49 | romstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SWITCHES) += switches.c |
| 50 | ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SWITCHES) += switches.c |
| 51 | |
Tim Wawrzynczak | 93d7bcb | 2020-05-29 15:44:25 -0600 | [diff] [blame] | 52 | ramstage-$(CONFIG_DRIVERS_INTEL_DPTF) += ec_dptf_helpers.c |
| 53 | |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 54 | CHROMEEC_SOURCE ?= $(top)/3rdparty/chromeec |
| 55 | |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 56 | # These are Chrome EC firmware images that a payload (such as depthcharge) can |
| 57 | # use to update the EC. ecrw is the main embedded controller's firmware, |
| 58 | # pdrw is for a USB PD controller. |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 59 | |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 60 | ifneq ($(CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_NONE),y) |
| 61 | |
| 62 | cbfs-files-y += ecrw |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 63 | ecrw-file := $(obj)/mainboard/$(MAINBOARDDIR)/ecrw |
| 64 | ecrw-name := ecrw |
| 65 | ecrw-type := raw |
Julius Werner | 8e97d00 | 2016-05-31 18:11:10 -0700 | [diff] [blame] | 66 | ecrw-compression := $(CBFS_COMPRESS_FLAG) |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 67 | cbfs-files-y += ecrw.hash |
Julius Werner | 8e97d00 | 2016-05-31 18:11:10 -0700 | [diff] [blame] | 68 | ecrw.hash-file := $(obj)/mainboard/$(MAINBOARDDIR)/ecrw.hash |
| 69 | ecrw.hash-name := ecrw.hash |
| 70 | ecrw.hash-type := raw |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 71 | |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 72 | ifeq ($(CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_EXTERNAL),y) |
| 73 | CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE := $(call strip_quotes,$(CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE)) |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 74 | |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 75 | $(obj)/mainboard/$(MAINBOARDDIR)/ecrw: $(CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE) |
| 76 | cp $(CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE) $@ |
| 77 | else |
| 78 | CONFIG_EC_GOOGLE_CHROMEEC_BOARDNAME := $(call strip_quotes,$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDNAME)) |
Paul Kocialkowski | 94938fb | 2016-07-20 18:38:54 +0200 | [diff] [blame] | 79 | |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 80 | $(obj)/mainboard/$(MAINBOARDDIR)/ecrw: |
Martin Roth | 09ae1d5 | 2016-08-02 15:32:51 -0600 | [diff] [blame] | 81 | $(MAKE) -C $(CHROMEEC_SOURCE) $(if $(CONFIG_CCACHE),,CCACHE=) \ |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 82 | out=$(abspath $(obj)/external/chromeec/$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDNAME)) \ |
Elyes HAOUAS | dd12d53 | 2019-01-05 14:41:08 +0100 | [diff] [blame] | 83 | REPRODUCIBLE_BUILD=1 \ |
| 84 | CC=$(GCC_CC_arm) \ |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 85 | CROSS_COMPILE=$(subst -cpp,-,$(CPP_arm)) \ |
| 86 | HOST_CROSS_COMPILE= \ |
| 87 | BOARD=$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDNAME) \ |
| 88 | rw |
| 89 | cp $(obj)/external/chromeec/$(CONFIG_EC_GOOGLE_CHROMEEC_BOARDNAME)/RW/ec.RW.flat $@ |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 90 | endif |
| 91 | |
| 92 | $(obj)/mainboard/$(MAINBOARDDIR)/ecrw.hash: $(obj)/mainboard/$(MAINBOARDDIR)/ecrw |
| 93 | openssl dgst -sha256 -binary $< > $@ |
| 94 | |
| 95 | endif |
| 96 | |
Ben Pye | 067a340 | 2018-03-06 22:41:20 +0000 | [diff] [blame] | 97 | ifeq ($(CONFIG_EC_GOOGLE_CHROMEEC_PD),y) |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 98 | |
| 99 | ifneq ($(CONFIG_EC_GOOGLE_CHROMEEC_PD_FIRMWARE_NONE),y) |
| 100 | |
| 101 | cbfs-files-y += pdrw |
| 102 | pdrw-file := $(obj)/mainboard/$(MAINBOARDDIR)/pdrw |
| 103 | pdrw-name := pdrw |
| 104 | pdrw-type := raw |
| 105 | pdrw-compression := $(CBFS_COMPRESS_FLAG) |
| 106 | cbfs-files-y += pdrw.hash |
| 107 | pdrw.hash-file := $(obj)/mainboard/$(MAINBOARDDIR)/pdrw.hash |
| 108 | pdrw.hash-name := pdrw.hash |
| 109 | pdrw.hash-type := raw |
| 110 | |
| 111 | ifeq ($(CONFIG_EC_GOOGLE_CHROMEEC_PD_FIRMWARE_EXTERNAL),y) |
| 112 | CONFIG_EC_GOOGLE_CHROMEEC_PD_FIRMWARE_FILE := $(call strip_quotes,$(CONFIG_EC_GOOGLE_CHROMEEC_PD_FIRMWARE_FILE)) |
| 113 | |
| 114 | $(obj)/mainboard/$(MAINBOARDDIR)/pdrw: $(CONFIG_EC_GOOGLE_CHROMEEC_PD_FIRMWARE_FILE) |
| 115 | cp $(CONFIG_EC_GOOGLE_CHROMEEC_PD_FIRMWARE_FILE) $@ |
| 116 | else |
| 117 | CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME := $(call strip_quotes,$(CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME)) |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 118 | |
| 119 | $(obj)/mainboard/$(MAINBOARDDIR)/pdrw: |
Martin Roth | 09ae1d5 | 2016-08-02 15:32:51 -0600 | [diff] [blame] | 120 | $(MAKE) -C $(CHROMEEC_SOURCE) $(if $(CONFIG_CCACHE),,CCACHE=) \ |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 121 | out=$(abspath $(obj)/external/chromeec/$(CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME)) \ |
Elyes HAOUAS | dd12d53 | 2019-01-05 14:41:08 +0100 | [diff] [blame] | 122 | REPRODUCIBLE_BUILD=1 \ |
| 123 | CC=$(GCC_CC_arm) \ |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 124 | CROSS_COMPILE=$(subst -cpp,-,$(CPP_arm)) \ |
| 125 | HOST_CROSS_COMPILE= \ |
| 126 | BOARD=$(CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME) \ |
| 127 | rw |
| 128 | cp $(obj)/external/chromeec/$(CONFIG_EC_GOOGLE_CHROMEEC_PD_BOARDNAME)/RW/ec.RW.flat $@ |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 129 | endif |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 130 | |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 131 | $(obj)/mainboard/$(MAINBOARDDIR)/pdrw.hash: $(obj)/mainboard/$(MAINBOARDDIR)/pdrw |
Julius Werner | 8e97d00 | 2016-05-31 18:11:10 -0700 | [diff] [blame] | 132 | openssl dgst -sha256 -binary $< > $@ |
| 133 | |
Paul Kocialkowski | 8ff2480 | 2016-08-02 14:28:26 +0200 | [diff] [blame] | 134 | endif |
| 135 | |
Patrick Georgi | 14caed8 | 2016-05-12 15:13:23 +0200 | [diff] [blame] | 136 | endif |
Patrick Georgi | e995dad2 | 2016-02-01 15:26:26 +0100 | [diff] [blame] | 137 | |
Stefan Reinauer | 77c04e9 | 2015-04-27 14:03:47 -0700 | [diff] [blame] | 138 | endif |