From mboxrd@z Thu Jan 1 00:00:00 1970 From: Saksham Jain Date: Tue, 9 Feb 2016 10:53:38 +0530 Subject: [U-Boot] [PATCH v4 10/14] crypto/fsl: Correct 64bit Write when MMU disabled In-Reply-To: <1454995422-31731-1-git-send-email-saksham.jain@nxp.com> References: <1454995422-31731-1-git-send-email-saksham.jain@nxp.com> Message-ID: <1454995422-31731-11-git-send-email-saksham.jain@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When MMU is disabled, 64bit Write must be at a memory aligned at 64bit Boundary. So, this commit splits the 64bit write into 2 -32bit writes as the memory location is not guaranteed to be 64bit aligned. The alignment exception only occurs when MMU is disabled. Signed-off-by: Aneesh Bansal Signed-off-by: Saksham Jain --- Changes for v2: - No changes Changes for v3: - No changes Changes for v4: - No changes drivers/crypto/fsl/desc_constr.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/fsl/desc_constr.h b/drivers/crypto/fsl/desc_constr.h index 2559ccd..db6ddee 100644 --- a/drivers/crypto/fsl/desc_constr.h +++ b/drivers/crypto/fsl/desc_constr.h @@ -85,10 +85,9 @@ static inline void append_ptr(u32 *desc, dma_addr_t ptr) #ifdef CONFIG_PHYS_64BIT /* The Position of low and high part of 64 bit address * will depend on the endianness of CAAM Block */ - union ptr_addr_t ptr_addr; - ptr_addr.m_halfs.high = (u32)(ptr >> 32); - ptr_addr.m_halfs.low = (u32)ptr; - *offset = ptr_addr.m_whole; + union ptr_addr_t *ptr_addr = (union ptr_addr_t *)offset; + ptr_addr->m_halfs.high = (u32)(ptr >> 32); + ptr_addr->m_halfs.low = (u32)ptr; #else *offset = ptr; #endif -- 1.8.1.4