summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2019-11-06 21:44:24 +0100
committerCommit Bot <commit-bot@chromium.org>2019-11-07 17:07:11 +0000
commit1bd0562b78ca98740ae987ddf8cc96fdcddf0f37 (patch)
tree7383b04f15ec95216994efd246cae2bcefe11aa7 /chip
parentb76871fce86d8d89e7d1d8e951bae4e9b392d150 (diff)
downloadchrome-ec-1bd0562b78ca98740ae987ddf8cc96fdcddf0f37.tar.gz
chip/stm32: Fix compile with gcc8
gcc8 packs uint8 arrays more tightly sometimes, which is bad if a device expects a certain alignment, so make the 4byte alignment of gcc 4.9 explicit for the buffers. BUG=b:132204142 TEST=sweetberry firmware built with coreboot-sdk reaches the console Change-Id: I24cf151d2df21e106fbb7e8f5b16a3bab81b09ab Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1899437 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/stm32/usb_dwc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/stm32/usb_dwc.c b/chip/stm32/usb_dwc.c
index eef2424842..25c6f091a2 100644
--- a/chip/stm32/usb_dwc.c
+++ b/chip/stm32/usb_dwc.c
@@ -146,14 +146,14 @@ static enum table_case decode_table_10_7(uint32_t doepint)
/* For STATUS/OUT: Use two DMA descriptors, each with one-packet buffers */
#define NUM_OUT_BUFFERS 2
-static uint8_t ep0_setup_buf[USB_MAX_PACKET_SIZE];
+static uint8_t __attribute__((aligned(4))) ep0_setup_buf[USB_MAX_PACKET_SIZE];
/* For IN: Several DMA descriptors, all pointing into one large buffer, so that
* we can return the configuration descriptor as one big blob.
*/
#define NUM_IN_PACKETS_AT_ONCE 4
#define IN_BUF_SIZE (NUM_IN_PACKETS_AT_ONCE * USB_MAX_PACKET_SIZE)
-static uint8_t ep0_in_buf[IN_BUF_SIZE];
+uint8_t __attribute__((aligned(4))) ep0_in_buf[IN_BUF_SIZE];
struct dwc_usb_ep ep0_ctl = {
.max_packet = USB_MAX_PACKET_SIZE,