diff options
author | Tom Rini <trini@konsulko.com> | 2018-11-20 12:36:47 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-11-20 12:39:16 -0500 |
commit | a3e1653ddeb02f39481eba572275016171e9670c (patch) | |
tree | ab620de093377355ef863ecfe4e1bfda9a9129c8 /include | |
parent | e070dc422d98cd232a928ceba87ac448854b8f25 (diff) | |
parent | 5bbf36af7ff6f4ff77d903320e95e5628c68884d (diff) |
Merge git://git.denx.de/u-boot-marvell
- Clearfog GT-8K support added by Baruch / Raheeb
- const and sizes cleanup (also in MIPS) from Baruch
- Minor cleanup to db-88f6820 from Chris
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 9 | ||||
-rw-r--r-- | include/configs/db-88f6820-amc.h | 5 | ||||
-rw-r--r-- | include/configs/db-88f6820-gp.h | 5 | ||||
-rw-r--r-- | include/linux/const.h | 34 | ||||
-rw-r--r-- | include/linux/sizes.h | 4 |
5 files changed, 38 insertions, 19 deletions
diff --git a/include/common.h b/include/common.h index 8b9f859c07..3f69943887 100644 --- a/include/common.h +++ b/include/common.h @@ -14,9 +14,6 @@ typedef volatile unsigned long vu_long; typedef volatile unsigned short vu_short; typedef volatile unsigned char vu_char; -/* Allow sharing constants with type modifiers between C and assembly. */ -#define _AC(X, Y) (X##Y) - #include <config.h> #include <errno.h> #include <time.h> @@ -541,16 +538,10 @@ int cpu_release(u32 nr, int argc, char * const argv[]); #else /* __ASSEMBLY__ */ -/* Drop a C type modifier (like in 3UL) for constants used in assembly. */ -#define _AC(X, Y) X - #endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */ -/* Declare an unsigned long constant digestable both by C and an assembler. */ -#define UL(x) _AC(x, UL) - #ifdef CONFIG_POST #define CONFIG_HAS_POST #ifndef CONFIG_POST_ALT_LIST diff --git a/include/configs/db-88f6820-amc.h b/include/configs/db-88f6820-amc.h index 2f1ffa2754..e68246cc0f 100644 --- a/include/configs/db-88f6820-amc.h +++ b/include/configs/db-88f6820-amc.h @@ -10,11 +10,6 @@ * High Level Configuration Options (easy to change) */ -/* - * TEXT_BASE needs to be below 16MiB, since this area is scrubbed - * for DDR ECC byte filling in the SPL before loading the main - * U-Boot into it. - */ #define CONFIG_SYS_TCLK 200000000 /* 200MHz */ /* diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h index f2aa21a43e..3900cbed2d 100644 --- a/include/configs/db-88f6820-gp.h +++ b/include/configs/db-88f6820-gp.h @@ -10,11 +10,6 @@ * High Level Configuration Options (easy to change) */ -/* - * TEXT_BASE needs to be below 16MiB, since this area is scrubbed - * for DDR ECC byte filling in the SPL before loading the main - * U-Boot into it. - */ #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ /* diff --git a/include/linux/const.h b/include/linux/const.h new file mode 100644 index 0000000000..379c889232 --- /dev/null +++ b/include/linux/const.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _LINUX_CONST_H +#define _LINUX_CONST_H + +/* const.h: Macros for dealing with constants. */ + +/* Some constant macros are used in both assembler and + * C code. Therefore we cannot annotate them always with + * 'UL' and other type specifiers unilaterally. We + * use the following macros to deal with this. + * + * Similarly, _AT() will cast an expression with a type in C, but + * leave it unchanged in asm. + */ + +#ifdef __ASSEMBLY__ +#define _AC(X,Y) X +#define _AT(T,X) X +#else +#define __AC(X,Y) (X##Y) +#define _AC(X,Y) __AC(X,Y) +#define _AT(T,X) ((T)(X)) +#endif + +#define _UL(x) (_AC(x, UL)) +#define _ULL(x) (_AC(x, ULL)) + +#define _BITUL(x) (_UL(1) << (x)) +#define _BITULL(x) (_ULL(1) << (x)) + +#define UL(x) (_UL(x)) +#define ULL(x) (_ULL(x)) + +#endif /* _LINUX_CONST_H */ diff --git a/include/linux/sizes.h b/include/linux/sizes.h index ce3e8150c1..fbde0bc7e8 100644 --- a/include/linux/sizes.h +++ b/include/linux/sizes.h @@ -8,6 +8,8 @@ #ifndef __LINUX_SIZES_H__ #define __LINUX_SIZES_H__ +#include <linux/const.h> + #define SZ_1 0x00000001 #define SZ_2 0x00000002 #define SZ_4 0x00000004 @@ -44,4 +46,6 @@ #define SZ_1G 0x40000000 #define SZ_2G 0x80000000 +#define SZ_4G _AC(0x100000000, ULL) + #endif /* __LINUX_SIZES_H__ */ |