Skip to content

Commit

Permalink
fpga: Fix travis build issues with sys_proto.h inclusion
Browse files Browse the repository at this point in the history
This patch fixes the travis build issue for platforms which dont
have sys_proto.h.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
Siva Durga Prasad Paladugu authored and Michal Simek committed Apr 23, 2018
1 parent b3f012d commit a79f0e8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 0 additions & 3 deletions arch/arm/include/asm/arch-zynqmp/sys_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#define ZYNQMP_FPGA_BIT_ENC_DEV_KEY 4
#define ZYNQMP_FPGA_BIT_NS 5

#define ZYNQMP_FPGA_ENC_USR_KEY 1
#define ZYNQMP_FPGA_AUTH_DDR 1
#define ZYNQMP_FPGA_NO_ENC 2
#define ZYNQMP_FPGA_NO_AUTH 2

enum {
IDCODE,
Expand Down
11 changes: 5 additions & 6 deletions cmd/fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <fpga.h>
#include <fs.h>
#include <malloc.h>
#include <asm/arch/sys_proto.h>

/* Local functions */
static int fpga_get_op(char *opstr);
Expand Down Expand Up @@ -82,15 +81,15 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
simple_strtoull(argv[7], NULL, 16);
case 7:
fpga_sec_info.encflag = (u8)simple_strtoul(argv[6], NULL, 16);
if (((fpga_sec_info.encflag == ZYNQMP_FPGA_ENC_USR_KEY) &&
if (((fpga_sec_info.encflag == FPGA_ENC_USR_KEY) &&
!fpga_sec_info.userkey_addr) ||
(fpga_sec_info.encflag > ZYNQMP_FPGA_NO_ENC)) {
(fpga_sec_info.encflag > FPGA_NO_ENC)) {
op = FPGA_NONE;
break;
}
case 6:
fpga_sec_info.authflag = (u8)simple_strtoul(argv[5], NULL, 16);
if (fpga_sec_info.authflag > ZYNQMP_FPGA_NO_AUTH) {
if (fpga_sec_info.authflag > FPGA_NO_AUTH) {
op = FPGA_NONE;
break;
}
Expand Down Expand Up @@ -172,8 +171,8 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
#endif
#if defined(CONFIG_CMD_FPGA_LOAD_SECURE)
case FPGA_LOADS:
if (fpga_sec_info.authflag == ZYNQMP_FPGA_NO_AUTH &&
fpga_sec_info.encflag == ZYNQMP_FPGA_NO_ENC) {
if (fpga_sec_info.authflag == FPGA_NO_AUTH &&
fpga_sec_info.encflag == FPGA_NO_ENC) {
wrong_parms = 1;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/fpga/zynqmppl.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static int zynqmp_loads(xilinx_desc *desc, const void *buf, size_t bsize,
flag |= BIT(ZYNQMP_FPGA_BIT_ENC_DEV_KEY);

if (fpga_sec_info->userkey_addr &&
fpga_sec_info->encflag == ZYNQMP_FPGA_ENC_USR_KEY) {
fpga_sec_info->encflag == FPGA_ENC_USR_KEY) {
flush_dcache_range((ulong)fpga_sec_info->userkey_addr,
(ulong)fpga_sec_info->userkey_addr +
KEY_PTR_LEN);
Expand Down
4 changes: 4 additions & 0 deletions include/fpga.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
/* device numbers must be non-negative */
#define FPGA_INVALID_DEVICE -1

#define FPGA_ENC_USR_KEY 1
#define FPGA_NO_ENC 2
#define FPGA_NO_AUTH 2

/* root data type defintions */
typedef enum { /* typedef fpga_type */
fpga_min_type, /* range check value */
Expand Down

0 comments on commit a79f0e8

Please sign in to comment.