From patchwork Thu Aug 11 21:22:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 109689 X-Patchwork-Delegate: linux@bohmer.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 21ECAB6F77 for ; Fri, 12 Aug 2011 07:23:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8615528244; Thu, 11 Aug 2011 23:23:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vUNBZtu1Oiou; Thu, 11 Aug 2011 23:23:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B29028227; Thu, 11 Aug 2011 23:22:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C5D528227 for ; Thu, 11 Aug 2011 23:22:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MtUplBKfSyix for ; Thu, 11 Aug 2011 23:22:55 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by theia.denx.de (Postfix) with ESMTPS id 8C5CE2821A for ; Thu, 11 Aug 2011 23:22:53 +0200 (CEST) Received: by yxp4 with SMTP id 4so1556028yxp.3 for ; Thu, 11 Aug 2011 14:22:52 -0700 (PDT) Received: by 10.236.184.233 with SMTP id s69mr451095yhm.94.1313097772741; Thu, 11 Aug 2011 14:22:52 -0700 (PDT) Received: from localhost.localdomain (cpe-76-184-244-226.tx.res.rr.com [76.184.244.226]) by mx.google.com with ESMTPS id s62sm2616671yhn.61.2011.08.11.14.22.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Aug 2011 14:22:52 -0700 (PDT) From: Joel A Fernandes To: u-boot@lists.denx.de Date: Thu, 11 Aug 2011 16:22:45 -0500 Message-Id: <1313097765-3206-1-git-send-email-agnel.joel@gmail.com> X-Mailer: git-send-email 1.7.1 Cc: Syed Mohammed Khasim , k-kooi@ti.com, jdk@ti.com Subject: [U-Boot] [PATCH v4] USB: Add align(4) in __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Jason Kridner Switched to align(4) to prevent byte access to soc registers in some gcc versions. Credits have to go to Laine Walker-Avina for finding the problem. Signed-off-by: Jason Kridner Signed-off-by: Joel A Fernandes Cc: Koen Kooi Cc: Alexander Holler Cc: Sandeep Paulraj Cc: Igor Grinberg --- Changes for v2: * Original and v2 were provided by Alexander Holler. * v1 was http://patchwork.ozlabs.org/patch/89358/ * v2 was http://patchwork.ozlabs.org/patch/89362/ Changes for v3: * Switched to align(4), rather than remove the attribute, per suggestion from Alexander. Changes for v4: * Modified commit summary and title to be more accurate drivers/usb/host/ehci.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 945ab64..3d0ad0c 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -55,7 +55,7 @@ struct ehci_hccr { #define HCS_N_PORTS(p) (((p) >> 0) & 0xf) uint32_t cr_hccparams; uint8_t cr_hcsp_portrt[8]; -} __attribute__ ((packed)); +} __attribute__ ((packed, aligned(4))); struct ehci_hcor { uint32_t or_usbcmd; @@ -85,7 +85,7 @@ struct ehci_hcor { #define FLAG_CF (1 << 0) /* true: we'll support "high speed" */ uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS]; uint32_t or_systune; -} __attribute__ ((packed)); +} __attribute__ ((packed, aligned(4))); #define USBMODE 0x68 /* USB Device mode */ #define USBMODE_SDIS (1 << 3) /* Stream disable */