Skip to content

Commit

Permalink
CR-1052501 & CR-1051301 (Xilinx#2714)
Browse files Browse the repository at this point in the history
* CR-1051301
XRT - Update FIC Subsystem Mgmt/User AXI Firewall Max Wait settings

* CR-1052501
XRT - Health thread clock throttling average calculcation incorrect
  • Loading branch information
xdavidz authored and maxzhen committed Jan 24, 2020
1 parent e89bc37 commit cf3fe09
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime_src/core/pcie/driver/linux/xocl/subdev/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ static int clock_status_check(struct platform_device *pdev, bool *latched)
} else if (ucs_status_ch1->clock_throttling_average) {
CLOCK_ERR(clock, "ULP kernel clocks throttled at %d%%.",
(ucs_status_ch1->clock_throttling_average /
CLK_MAX_VALUE) * 100);
(CLK_MAX_VALUE / 100)));
}
}

Expand Down
32 changes: 32 additions & 0 deletions src/runtime_src/core/pcie/driver/linux/xocl/subdev/firewall.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
#define FAULT_STATUS 0x0
#define SOFT_CTRL 0x4
#define UNBLOCK_CTRL 0x8
#define MAX_CONTINUOUS_RTRANSFERS_WAITS 0x30
#define MAX_WRITE_TO_BVALID_WAITS 0x34
#define MAX_ARREADY_WAITS 0x38
#define MAX_AWREADY_WAITS 0x3C
#define MAX_WREADY_WAITS 0x40
// Firewall error bits
#define READ_RESPONSE_BUSY BIT(0)
#define RECS_ARREADY_MAX_WAIT BIT(1)
Expand Down Expand Up @@ -56,6 +61,9 @@
#define FW_DEFAULT_EXPIRE_SECS 1
#define MAX_LEVEL 16

#define FW_MAX_WAIT_DEFAULT 0xffff
#define FW_MAX_WAIT_FIC 0x2000

struct firewall {
void __iomem *base_addrs[MAX_LEVEL];
u32 max_level;
Expand Down Expand Up @@ -419,6 +427,28 @@ static int firewall_remove(struct platform_device *pdev)
return 0;
}

static void inline update_max_wait(void __iomem *addr)
{
XOCL_WRITE_REG32(FW_MAX_WAIT_FIC, addr + MAX_CONTINUOUS_RTRANSFERS_WAITS);
XOCL_WRITE_REG32(FW_MAX_WAIT_FIC, addr + MAX_WRITE_TO_BVALID_WAITS);
XOCL_WRITE_REG32(FW_MAX_WAIT_FIC, addr + MAX_ARREADY_WAITS);
XOCL_WRITE_REG32(FW_MAX_WAIT_FIC, addr + MAX_AWREADY_WAITS);
XOCL_WRITE_REG32(FW_MAX_WAIT_FIC, addr + MAX_WREADY_WAITS);
}

static void resource_additional_check(struct resource *res, void __iomem *addr)
{
const char *res_name = res->name;

if (!res_name)
return;

if (!strncmp(res_name, NODE_AF_CTRL_MGMT, strlen(NODE_AF_CTRL_MGMT)) ||
!strncmp(res_name, NODE_AF_CTRL_USER, strlen(NODE_AF_CTRL_USER)) ||
!strncmp(res_name, NODE_AF_CTRL_DEBUG, strlen(NODE_AF_CTRL_DEBUG)))
update_max_wait(addr);
}

static int firewall_probe(struct platform_device *pdev)
{
struct firewall *fw;
Expand Down Expand Up @@ -446,6 +476,8 @@ static int firewall_probe(struct platform_device *pdev)
xocl_err(&pdev->dev, "Map iomem failed");
goto failed;
}
/* additional check after res mapped */
resource_additional_check(res, fw->base_addrs[i]);
}


Expand Down

0 comments on commit cf3fe09

Please sign in to comment.