Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
fc17f612
Commit
fc17f612
authored
Jan 18, 2017
by
danh-arm
Committed by
GitHub
Jan 18, 2017
Browse files
Merge pull request #790 from masahir0y/utils
add utility macros to utils.h
parents
44f1c0bd
152c8c11
Changes
4
Hide whitespace changes
Inline
Side-by-side
drivers/arm/pl061/pl061_gpio.c
View file @
fc17f612
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#include <gpio.h>
#include <gpio.h>
#include <mmio.h>
#include <mmio.h>
#include <pl061_gpio.h>
#include <pl061_gpio.h>
#include <utils.h>
#if !PLAT_PL061_MAX_GPIOS
#if !PLAT_PL061_MAX_GPIOS
# define PLAT_PL061_MAX_GPIOS 32
# define PLAT_PL061_MAX_GPIOS 32
...
@@ -52,7 +53,6 @@ CASSERT(PLAT_PL061_MAX_GPIOS > 0, assert_plat_pl061_max_gpios);
...
@@ -52,7 +53,6 @@ CASSERT(PLAT_PL061_MAX_GPIOS > 0, assert_plat_pl061_max_gpios);
#define PL061_GPIO_DIR 0x400
#define PL061_GPIO_DIR 0x400
#define GPIOS_PER_PL061 8
#define GPIOS_PER_PL061 8
#define BIT(nr) (1UL << (nr))
static
int
pl061_get_direction
(
int
gpio
);
static
int
pl061_get_direction
(
int
gpio
);
static
void
pl061_set_direction
(
int
gpio
,
int
direction
);
static
void
pl061_set_direction
(
int
gpio
,
int
direction
);
...
...
include/lib/utils.h
View file @
fc17f612
...
@@ -40,6 +40,8 @@
...
@@ -40,6 +40,8 @@
#define SIZE_FROM_LOG2_WORDS(n) (4 << (n))
#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
* 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.
* type-agnostic yet type-safe manner. The boundary must be a power of two.
...
...
plat/rockchip/common/include/plat_private.h
View file @
fc17f612
...
@@ -75,10 +75,6 @@ struct rockchip_pm_ops_cb {
...
@@ -75,10 +75,6 @@ struct rockchip_pm_ops_cb {
******************************************************************************/
******************************************************************************/
#define REG_MSK_SHIFT 16
#define REG_MSK_SHIFT 16
#ifndef BIT
#define BIT(nr) (1 << (nr))
#endif
#ifndef WMSK_BIT
#ifndef WMSK_BIT
#define WMSK_BIT(nr) BIT((nr) + REG_MSK_SHIFT)
#define WMSK_BIT(nr) BIT((nr) + REG_MSK_SHIFT)
#endif
#endif
...
...
plat/rockchip/rk3399/drivers/soc/soc.h
View file @
fc17f612
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
#ifndef __SOC_H__
#ifndef __SOC_H__
#define __SOC_H__
#define __SOC_H__
#include <utils.h>
#define GLB_SRST_FST_CFG_VAL 0xfdb9
#define GLB_SRST_FST_CFG_VAL 0xfdb9
#define GLB_SRST_SND_CFG_VAL 0xeca8
#define GLB_SRST_SND_CFG_VAL 0xeca8
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment