summaryrefslogtreecommitdiff
path: root/board/theobroma-systems/puma_rk3399
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2017-07-27 19:59:03 +0800
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-07-27 14:59:04 +0200
commit26722335253a9fa384ceb423419254cb00d0def1 (patch)
treefaa2c0f18f5aabf1ece9ee2342bed3377da8eda1 /board/theobroma-systems/puma_rk3399
parent86b1122a844790bf548ec5245872e8a10a791351 (diff)
rockchip: puma-rk3399: remove duplicate code (merge artifact)
A few lines (defines and declarations) had been duplicated when the puma-rk3399 board was initially merged. This removes the duplicates and changes the style to use local constants instead of pasted literals. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> [fixed up commit-message & converted to use 'const u32':] Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'board/theobroma-systems/puma_rk3399')
-rw-r--r--board/theobroma-systems/puma_rk3399/puma-rk3399.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index 36e9cd7f84..9347329eac 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -9,20 +9,11 @@
#include <ram.h>
#include <dm/pinctrl.h>
#include <dm/uclass-internal.h>
-#include <misc.h>
#include <asm/setup.h>
#include <asm/arch/periph.h>
#include <power/regulator.h>
#include <u-boot/sha256.h>
-#define RK3399_CPUID_OFF 0x7
-#define RK3399_CPUID_LEN 0x10
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define RK3399_CPUID_OFF 0x7
-#define RK3399_CPUID_LEN 0x10
-
DECLARE_GLOBAL_DATA_PTR;
int board_init(void)
@@ -107,11 +98,14 @@ static void setup_macaddr(void)
static void setup_serial(void)
{
#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE)
+ const u32 cpuid_offset = 0x7;
+ const u32 cpuid_length = 0x10;
+
struct udevice *dev;
int ret, i;
- u8 cpuid[RK3399_CPUID_LEN];
- u8 low[RK3399_CPUID_LEN/2], high[RK3399_CPUID_LEN/2];
- char cpuid_str[RK3399_CPUID_LEN * 2 + 1];
+ u8 cpuid[cpuid_length];
+ u8 low[cpuid_length/2], high[cpuid_length/2];
+ char cpuid_str[cpuid_length * 2 + 1];
u64 serialno;
char serialno_str[16];
@@ -124,7 +118,7 @@ static void setup_serial(void)
}
/* read the cpu_id range from the efuses */
- ret = misc_read(dev, RK3399_CPUID_OFF, &cpuid, sizeof(cpuid));
+ ret = misc_read(dev, cpuid_offset, &cpuid, sizeof(cpuid));
if (ret) {
debug("%s: reading cpuid from the efuses failed\n",
__func__);