summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@google.com>2017-07-31 16:22:43 -0700
committerCommit Bot <commit-bot@chromium.org>2021-04-20 14:25:12 +0000
commit131328d5fe1279bcc3de243dfa41648eb36bd3c0 (patch)
treee847af7a0c5c9d0a13aceaa6cbb7bd5ab57564eb
parent07f65f5beb2dda74fb17ab5550cef3c823b188ef (diff)
downloadchrome-ec-131328d5fe1279bcc3de243dfa41648eb36bd3c0.tar.gz
Fix compilation with coreboot-sdk
Signed-off-by: Stefan Reinauer <reinauer@google.com> BRANCH=none BUG=none TEST=The following sequence passes sudo emerge coreboot-sdk export CROSS_COMPILE_arm=/opt/coreboot-sdk/bin/arm-eabi- export CROSS_COMPILE_i386=/opt/coreboot-sdk/bin/i386-elf- export CROSS_COMPILE_nds=/opt/coreboot-sdk/bin/nds32le-elf- make buildall -j Change-Id: I4cafbcd70efd6bdf102f848f1cca4772b4ccd10e Reviewed-on: https://chromium-review.googlesource.com/595207 Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org> (cherry picked from commit 47115a93ef6077e5c4519d8916232fb1b3a8e56d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2723451 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/g/dcrypto/x509.c1
-rw-r--r--chip/stm32/i2c-stm32f4.c3
-rw-r--r--chip/stm32/usb_dwc.c13
-rw-r--r--common/usb_pd_protocol.c2
-rw-r--r--include/common.h7
5 files changed, 9 insertions, 17 deletions
diff --git a/chip/g/dcrypto/x509.c b/chip/g/dcrypto/x509.c
index 6f3caf758a..a774256ded 100644
--- a/chip/g/dcrypto/x509.c
+++ b/chip/g/dcrypto/x509.c
@@ -58,7 +58,6 @@ static const uint8_t OID_SHA256_WITH_RSA_ENCRYPTION[13] = {
0x01, 0x01, 0x0b, 0x05, 0x00
};
static const uint8_t OID_commonName[3] = {0x55, 0x04, 0x03};
-static const uint8_t OID_orgName[3] = {0x55, 0x04, 0x0a};
static const uint8_t OID_ecdsa_with_SHA256[8] = {0x2A, 0x86, 0x48, 0xCE,
0x3D, 0x04, 0x03, 0x02};
static const uint8_t OID_id_ecPublicKey[7] = {0x2A, 0x86, 0x48, 0xCE, 0x3D,
diff --git a/chip/stm32/i2c-stm32f4.c b/chip/stm32/i2c-stm32f4.c
index 7c9414e444..d9c331237c 100644
--- a/chip/stm32/i2c-stm32f4.c
+++ b/chip/stm32/i2c-stm32f4.c
@@ -43,8 +43,7 @@
*/
#define STM32F4_FMPI2C_PORT 3
-
-static const struct dma_option dma_tx_option[I2C_PORT_COUNT] = {
+static const __unused struct dma_option dma_tx_option[I2C_PORT_COUNT] = {
{STM32_DMAC_I2C1_TX, (void *)&STM32_I2C_DR(STM32_I2C1_PORT),
STM32_DMA_CCR_MSIZE_8_BIT | STM32_DMA_CCR_PSIZE_8_BIT |
STM32_DMA_CCR_CHANNEL(STM32_I2C1_TX_REQ_CH)},
diff --git a/chip/stm32/usb_dwc.c b/chip/stm32/usb_dwc.c
index 923b18d5f4..78de99873a 100644
--- a/chip/stm32/usb_dwc.c
+++ b/chip/stm32/usb_dwc.c
@@ -96,19 +96,6 @@ const struct usb_config_descriptor USB_CONF_DESC(conf) = {
.bMaxPower = (CONFIG_USB_MAXPOWER_MA / 2),
};
-/* Qualifier Descriptor */
-static const struct usb_qualifier_descriptor qualifier_desc = {
- .bLength = USB_DT_QUALIFIER_SIZE,
- .bDescriptorType = USB_DT_DEVICE_QUALIFIER,
- .bcdUSB = USB_DEV_BCDUSB,
- .bDeviceClass = USB_DEV_CLASS,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = USB_MAX_PACKET_SIZE,
- .bNumConfigurations = 1,
- .bReserved = 0,
-};
-
const uint8_t usb_string_desc[] = {
4, /* Descriptor size */
USB_DT_STRING,
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 426414deca..aa54457af0 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -3841,7 +3841,7 @@ static int pd_control(struct host_cmd_handler_args *args)
{
static int pd_control_disabled;
const struct ec_params_pd_control *cmd = args->params;
- int enable;
+ int enable = 0;
if (cmd->chip >= CONFIG_USB_PD_PORT_COUNT)
return EC_RES_INVALID_PARAM;
diff --git a/include/common.h b/include/common.h
index a98fce3ca2..6f6b964c5f 100644
--- a/include/common.h
+++ b/include/common.h
@@ -59,6 +59,13 @@
#endif
/*
+ * Define __unused in the same manner.
+ */
+#ifndef __unused
+#define __unused __attribute__((unused))
+#endif
+
+/*
* Force the toolchain to keep a symbol even with Link Time Optimization
* activated.
*