Skip to content

Commit

Permalink
ttkmd update m3 timeout value to ARC
Browse files Browse the repository at this point in the history
  • Loading branch information
nxuTT committed Nov 2, 2023
1 parent e0e017a commit 0a0c01d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modprobe.d-tenstorrent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@
# Maximum number of times to reset device during boot. (uint)
# options tenstorrent reset_limit=10

# Timeout duration in seconds for M3 auto reset to occur. (byte)
# options tenstorrent auto_reset_timeout=10
4 changes: 4 additions & 0 deletions module.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ uint reset_limit = 10;
module_param(reset_limit, uint, 0444);
MODULE_PARM_DESC(reset_limit, "Maximum number of times to reset device during boot.");

unsigned char auto_reset_timeout = 10;
module_param(auto_reset_timeout, byte, 0444);
MODULE_PARM_DESC(auto_reset_timeout, "Timeout duration in seconds for M3 auto reset to occur.");

struct tenstorrent_device_class;
extern struct tenstorrent_device_class grayskull_class;
extern struct tenstorrent_device_class wormhole_class;
Expand Down
1 change: 1 addition & 0 deletions module.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ extern uint axiclk_override;
extern uint tensix_harvest_override;
extern uint dma_address_bits;
extern uint reset_limit;
extern unsigned char auto_reset_timeout;
#endif
3 changes: 3 additions & 0 deletions wormhole.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#include "wormhole.h"
#include "grayskull.h"
#include "pcie.h"
#include "module.h"

#define WH_FW_MSG_PCIE_INDEX 0x51
#define WH_FW_MSG_ASTATE0 0xA0
#define WH_FW_MSG_UPDATE_M3_AUTO_RESET_TIMEOUT 0xBC

// The iATU can be used to match & remap PCIE transactions.
#define IATU_BASE 0x1200 // Relative to the start of BAR2
Expand Down Expand Up @@ -96,6 +98,7 @@ static bool wormhole_init_hardware(struct tenstorrent_device *tt_dev) {
grayskull_send_arc_fw_message(reset_unit_regs(wh_dev), WH_FW_MSG_ASTATE0, 10000, NULL);
update_device_index(wh_dev);
complete_pcie_init(&wh_dev->tt, reset_unit_regs(wh_dev));
grayskull_send_arc_fw_message_with_args(reset_unit_regs(wh_dev), WH_FW_MSG_UPDATE_M3_AUTO_RESET_TIMEOUT, auto_reset_timeout, 0, 10000, NULL);
}

return true;
Expand Down

0 comments on commit 0a0c01d

Please sign in to comment.