summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-12-05 14:28:59 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-13 04:34:24 +0900
commit152c8c11b7943c83ae07c9a51dc9433f85d85306 (patch)
tree96852bbcf1b07970bd3aa4f4e3c010094f5dc586
parent9eb4d4dd938a1ad86a5a0311e00beb3b5c1d5840 (diff)
utils: move BIT(n) macro to utils.h
We are duplicating this macro define, and it is useful enough to be placed in the common place. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--drivers/arm/pl061/pl061_gpio.c2
-rw-r--r--include/lib/utils.h2
-rw-r--r--plat/rockchip/common/include/plat_private.h4
-rw-r--r--plat/rockchip/rk3399/drivers/soc/soc.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/drivers/arm/pl061/pl061_gpio.c b/drivers/arm/pl061/pl061_gpio.c
index fca00565..327c68e1 100644
--- a/drivers/arm/pl061/pl061_gpio.c
+++ b/drivers/arm/pl061/pl061_gpio.c
@@ -39,6 +39,7 @@
#include <gpio.h>
#include <mmio.h>
#include <pl061_gpio.h>
+#include <utils.h>
#if !PLAT_PL061_MAX_GPIOS
# define PLAT_PL061_MAX_GPIOS 32
@@ -52,7 +53,6 @@ CASSERT(PLAT_PL061_MAX_GPIOS > 0, assert_plat_pl061_max_gpios);
#define PL061_GPIO_DIR 0x400
#define GPIOS_PER_PL061 8
-#define BIT(nr) (1UL << (nr))
static int pl061_get_direction(int gpio);
static void pl061_set_direction(int gpio, int direction);
diff --git a/include/lib/utils.h b/include/lib/utils.h
index a234e3c9..f7af8f66 100644
--- a/include/lib/utils.h
+++ b/include/lib/utils.h
@@ -40,6 +40,8 @@
#define SIZE_FROM_LOG2_WORDS(n) (4 << (n))
+#define BIT(nr) (1UL << (nr))
+
/*
* The round_up() macro rounds up a value to the given boundary in a
* type-agnostic yet type-safe manner. The boundary must be a power of two.
diff --git a/plat/rockchip/common/include/plat_private.h b/plat/rockchip/common/include/plat_private.h
index a093e792..b2234a65 100644
--- a/plat/rockchip/common/include/plat_private.h
+++ b/plat/rockchip/common/include/plat_private.h
@@ -75,10 +75,6 @@ struct rockchip_pm_ops_cb {
******************************************************************************/
#define REG_MSK_SHIFT 16
-#ifndef BIT
-#define BIT(nr) (1 << (nr))
-#endif
-
#ifndef WMSK_BIT
#define WMSK_BIT(nr) BIT((nr) + REG_MSK_SHIFT)
#endif
diff --git a/plat/rockchip/rk3399/drivers/soc/soc.h b/plat/rockchip/rk3399/drivers/soc/soc.h
index 742bb7b7..28590f2b 100644
--- a/plat/rockchip/rk3399/drivers/soc/soc.h
+++ b/plat/rockchip/rk3399/drivers/soc/soc.h
@@ -31,6 +31,8 @@
#ifndef __SOC_H__
#define __SOC_H__
+#include <utils.h>
+
#define GLB_SRST_FST_CFG_VAL 0xfdb9
#define GLB_SRST_SND_CFG_VAL 0xeca8