coresight: type cast 32-bit physical address to phys_addr_t

TMC_ETR_SG_ENT_TO_BLK macro performs bit manipulations on the entry in
scatter gather table for TMC-ETR DDR configuration to convert it to
physical address pointing to 4K blocks of physical memory.

On 64-bit architecture, the top 32-bits are lost if 32-bit address is
passed to this macro and value becomes 64-bit after bit manipulation. Type
cast 32-bit physical address to phys_addr_t when passing to
TMC_ETR_SG_ENT_TO_BLK macro.

Change-Id: I37b1c4aaeed6bcd1a9fbeaea4821881e6e1d9e39
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
This commit is contained in:
Sarangdhar Joshi 2015-03-12 13:53:31 -07:00 committed by Gerrit - the friendly Code Review server
parent 9984598409
commit 42f54e4d7f
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -101,7 +101,8 @@ do { \
#define TMC_REG_DUMP_VER_OFF (4)
#define TMC_REG_DUMP_VER (1)
#define TMC_ETR_SG_ENT_TO_BLK(phys_pte) ((phys_pte >> 4) << PAGE_SHIFT);
#define TMC_ETR_SG_ENT_TO_BLK(phys_pte) (((phys_addr_t)phys_pte >> 4) \
<< PAGE_SHIFT);
#define TMC_ETR_SG_ENT(phys_pte) (((phys_pte >> PAGE_SHIFT) << 4) | 0x2);
#define TMC_ETR_SG_NXT_TBL(phys_pte) (((phys_pte >> PAGE_SHIFT) << 4) | 0x3);
#define TMC_ETR_SG_LST_ENT(phys_pte) (((phys_pte >> PAGE_SHIFT) << 4) | 0x1);