-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
110 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-FileCopyrightText: © 2024 Tenstorrent Inc. | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
#include <linux/types.h> | ||
|
||
#include "blackhole.h" | ||
#include "pcie.h" | ||
#include "module.h" | ||
|
||
#define MAX_MRRS 4096 | ||
|
||
static bool blackhole_init(struct tenstorrent_device *tt_dev) { | ||
return true; | ||
} | ||
|
||
static bool blackhole_init_hardware(struct tenstorrent_device *tt_dev) { | ||
struct pci_dev *pdev = tt_dev->pdev; | ||
pcie_set_readrq(pdev, MAX_MRRS); | ||
return true; | ||
} | ||
|
||
static bool blackhole_post_hardware_init(struct tenstorrent_device *tt_dev) { | ||
return true; | ||
} | ||
|
||
static void blackhole_cleanup_hardware(struct tenstorrent_device *tt_dev) { | ||
} | ||
|
||
static void blackhole_cleanup(struct tenstorrent_device *tt_dev) { | ||
} | ||
|
||
struct tenstorrent_device_class blackhole_class = { | ||
.name = "Blackhole", | ||
.instance_size = sizeof(struct blackhole_device), | ||
.dma_address_bits = 58, | ||
.init_device = blackhole_init, | ||
.init_hardware = blackhole_init_hardware, | ||
.post_hardware_init = blackhole_post_hardware_init, | ||
.cleanup_hardware = blackhole_cleanup_hardware, | ||
.cleanup_device = blackhole_cleanup, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-FileCopyrightText: © 2023 Tenstorrent Inc. | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
#ifndef TTDRIVER_BLACKHOLE_H_INCLUDED | ||
#define TTDRIVER_BLACKHOLE_H_INCLUDED | ||
|
||
#include <linux/types.h> | ||
#include "device.h" | ||
|
||
struct blackhole_device { | ||
struct tenstorrent_device tt; | ||
}; | ||
|
||
#define tt_dev_to_wh_dev(ttdev) \ | ||
container_of((tt_dev), struct blackhole_device, tt) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters