summaryrefslogtreecommitdiff
path: root/include/galileo/core.h
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-27 21:31:46 +0000
committerwdenk <wdenk>2003-06-27 21:31:46 +0000
commit8bde7f776c77b343aca29b8c7b58464d915ac245 (patch)
tree20f1fd99975215e7c658454a15cdb4ed4694e2d4 /include/galileo/core.h
parent993cad9364c6b87ae429d1ed1130d8153f6f027e (diff)
downloadu-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.zip
u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.gz
u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.bz2
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'include/galileo/core.h')
-rw-r--r--include/galileo/core.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/include/galileo/core.h b/include/galileo/core.h
index 56db097..0735d07 100644
--- a/include/galileo/core.h
+++ b/include/galileo/core.h
@@ -123,18 +123,18 @@ typedef enum _bool{false,true} bool;
#define SHORT_SWAP(X) ((X <<8 ) | (X >> 8))
#define WORD_SWAP(X) (((X)&0xff)<<24)+ \
- (((X)&0xff00)<<8)+ \
- (((X)&0xff0000)>>8)+ \
- (((X)&0xff000000)>>24)
+ (((X)&0xff00)<<8)+ \
+ (((X)&0xff0000)>>8)+ \
+ (((X)&0xff000000)>>24)
#define LONG_SWAP(X) ( (l64) (((X)&0xffULL)<<56)+ \
- (((X)&0xff00ULL)<<40)+ \
- (((X)&0xff0000ULL)<<24)+ \
- (((X)&0xff000000ULL)<<8)+ \
- (((X)&0xff00000000ULL)>>8)+ \
- (((X)&0xff0000000000ULL)>>24)+ \
- (((X)&0xff000000000000ULL)>>40)+ \
- (((X)&0xff00000000000000ULL)>>56))
+ (((X)&0xff00ULL)<<40)+ \
+ (((X)&0xff0000ULL)<<24)+ \
+ (((X)&0xff000000ULL)<<8)+ \
+ (((X)&0xff00000000ULL)>>8)+ \
+ (((X)&0xff0000000000ULL)>>24)+ \
+ (((X)&0xff000000000000ULL)>>40)+ \
+ (((X)&0xff00000000000000ULL)>>56))
#endif
@@ -154,44 +154,44 @@ typedef enum _bool{false,true} bool;
/* Read/Write to/from GT`s internal registers */
#define GT_REG_READ(offset, pData) \
*pData = ( *((volatile unsigned int *)(NONE_CACHEABLE | \
- INTERNAL_REG_BASE_ADDR | (offset))) ) ; \
+ INTERNAL_REG_BASE_ADDR | (offset))) ) ; \
*pData = WORD_SWAP(*pData)
#define GTREGREAD(offset) \
- (WORD_SWAP( *((volatile unsigned int *)(NONE_CACHEABLE | \
- INTERNAL_REG_BASE_ADDR | (offset))) ))
+ (WORD_SWAP( *((volatile unsigned int *)(NONE_CACHEABLE | \
+ INTERNAL_REG_BASE_ADDR | (offset))) ))
#define GT_REG_WRITE(offset, data) \
*((unsigned int *)( INTERNAL_REG_BASE_ADDR | (offset))) = \
- WORD_SWAP(data)
+ WORD_SWAP(data)
/* Write 32/16/8 bit */
#define WRITE_CHAR(address, data) \
- *((unsigned char *)(address)) = data
+ *((unsigned char *)(address)) = data
#define WRITE_SHORT(address, data) \
- *((unsigned short *)(address)) = data
+ *((unsigned short *)(address)) = data
#define WRITE_WORD(address, data) \
- *((unsigned int *)(address)) = data
+ *((unsigned int *)(address)) = data
/* Read 32/16/8 bits - returns data in variable. */
#define READ_CHAR(address, pData) \
- *pData = *((volatile unsigned char *)(address))
+ *pData = *((volatile unsigned char *)(address))
#define READ_SHORT(address, pData) \
- *pData = *((volatile unsigned short *)(address))
+ *pData = *((volatile unsigned short *)(address))
#define READ_WORD(address, pData) \
- *pData = *((volatile unsigned int *)(address))
+ *pData = *((volatile unsigned int *)(address))
/* Read 32/16/8 bit - returns data direct. */
#define READCHAR(address) \
- *((volatile unsigned char *)((address) | NONE_CACHEABLE))
+ *((volatile unsigned char *)((address) | NONE_CACHEABLE))
#define READSHORT(address) \
- *((volatile unsigned short *)((address) | NONE_CACHEABLE))
+ *((volatile unsigned short *)((address) | NONE_CACHEABLE))
#define READWORD(address) \
- *((volatile unsigned int *)((address) | NONE_CACHEABLE))
+ *((volatile unsigned int *)((address) | NONE_CACHEABLE))
/* Those two Macros were defined to be compatible with MIPS */
#define VIRTUAL_TO_PHY(x) (((unsigned int)x) & 0xffffffff)
@@ -203,8 +203,8 @@ typedef enum _bool{false,true} bool;
SET_REG_BITS(0x840,BIT3 | BIT24 | BIT30) - set bits: 3,24 and 30 to logic
'1' in register 0x840 while the other bits stays as is. */
#define SET_REG_BITS(regOffset,bits) \
- *(unsigned int*)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR | \
- regOffset) |= (unsigned int)WORD_SWAP(bits)
+ *(unsigned int*)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR | \
+ regOffset) |= (unsigned int)WORD_SWAP(bits)
/* RESET_REG_BITS(regOffset,bits) -
gets register offset and bits: a 32bit value. It set to logic '0' in the
@@ -212,7 +212,7 @@ typedef enum _bool{false,true} bool;
RESET_REG_BITS(0x840,BIT3 | BIT24 | BIT30) - set bits: 3,24 and 30 to logic
'0' in register 0x840 while the other bits stays as is. */
#define RESET_REG_BITS(regOffset,bits) \
- *(unsigned int*)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR \
- | regOffset) &= ~( (unsigned int)WORD_SWAP(bits) )
+ *(unsigned int*)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR \
+ | regOffset) &= ~( (unsigned int)WORD_SWAP(bits) )
#endif /* __INCcoreh */