Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Documentation/ABI/testing/sys-platform-tegra-bpmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
What: /sys/bus/platform/devices/<bpmp-device>/mbwt_control/pcie_instance_id
What: /sys/bus/platform/devices/<bpmp-device>/mbwt_control/vc_type
What: /sys/bus/platform/devices/<bpmp-device>/mbwt_control/bandwidth
Date: March 2026
KernelVersion: 6.18
Contact: Aniruddha TVS Rao <anrao@nvidia.com>
Description:
On ACPI-based Tegra systems the BPMP driver does not use the
device-tree mailbox path; firmware interaction is via AML. This sysfs
interface is a userspace tuning knob for memory bandwidth throttler
(MBWT) settings.

On Tegra410, the PCIe bandwidth control path exposes QoS that caps
aggregate bandwidth for PCIe and for GPU traffic over UPHY. Each PCIe
bandwidth group has a single shared cap for all traffic in that group.
A group may contain only PCIe devices, only a GPU on UPHY, or PCIe and
GPU together in a bifurcated topology.

Following attributes appear under a kobject named mbwt_control on the
tegra-bpmp platform device (the same struct device as the driver
binds to), only when that device has an ACPI companion and BPMP
firmware reports support for both MBWT_GET and MBWT_SET via the MBWT
QUERY probe.

pcie_instance_id (RW):
PCIe bandwidth group index: 0 = pcie0, 1 = pcie1, ..., 5 = pcie5.

vc_type (RW):
Traffic type to cap for that group:
0 = PCIe read
1 = PCIe write
2 = GPU UPHY read plus write (combined)

bandwidth (RW):
Target bandwidth cap in GB/s for the pcie_instance_id and vc_type
currently stored in the other two attributes. Intended range is
1-110 GB/s; firmware validates the request (via MRQ MBWT_SET).

When read, issues a MBWT_GET for that same pcie_instance_id and vc_type
and returns one line of three decimal fields separated by ASCII
space: PCIe instance ID, vc_type, and the bandwidth value in GB/s
returned by firmware.

Example:
echo 0 > .../mbwt_control/pcie_instance_id
echo 1 > .../mbwt_control/vc_type
echo 100 > .../mbwt_control/bandwidth
cat .../mbwt_control/bandwidth

Users: Customer tuning of PCIe and GPU UPHY bandwidth caps on
ACPI-based Tegra410 systems.
1 change: 1 addition & 0 deletions drivers/firmware/tegra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ tegra-bpmp-$(CONFIG_ARCH_TEGRA_234_SOC) += bpmp-tegra186.o
tegra-bpmp-$(CONFIG_ARCH_TEGRA_264_SOC) += bpmp-tegra186.o
tegra-bpmp-$(CONFIG_DEBUG_FS) += bpmp-debugfs.o
obj-$(CONFIG_TEGRA_BPMP) += tegra-bpmp.o
obj-$(CONFIG_TEGRA_BPMP) += bpmp-tegra-sysfs.o
obj-$(CONFIG_TEGRA_IVC) += ivc.o
19 changes: 16 additions & 3 deletions drivers/firmware/tegra/bpmp-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
*/
#include <linux/acpi.h>
#include <linux/debugfs.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -771,6 +772,8 @@ static int bpmp_populate_debugfs_shmem(struct tegra_bpmp *bpmp)

int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
{
const char *root_name = "bpmp";
char *acpi_root_name = NULL;
struct dentry *root;
bool inband;
int err;
Expand All @@ -780,13 +783,23 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
if (!inband && !tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUGFS))
return 0;

root = debugfs_create_dir("bpmp", NULL);
if (ACPI_HANDLE(bpmp->dev)) {
acpi_root_name = kasprintf(GFP_KERNEL, "bpmp-%s",
dev_name(bpmp->dev));
if (!acpi_root_name)
return -ENOMEM;

root_name = acpi_root_name;
}

root = debugfs_create_dir(root_name, NULL);
kfree(acpi_root_name);
if (IS_ERR(root))
return -ENOMEM;
return PTR_ERR(root);

bpmp->debugfs_mirror = debugfs_create_dir("debug", root);
if (IS_ERR(bpmp->debugfs_mirror)) {
err = -ENOMEM;
err = PTR_ERR(bpmp->debugfs_mirror);
goto out;
}

Expand Down
8 changes: 8 additions & 0 deletions drivers/firmware/tegra/bpmp-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ struct tegra_bpmp_ops {
extern const struct tegra_bpmp_ops tegra186_bpmp_ops;
extern const struct tegra_bpmp_ops tegra210_bpmp_ops;

#define TEGRA_BPMP_ACPI_BMRQ_DATA_SZ 3960U

struct tegra_bpmp_acpi_message {
u64 status;
u8 *data_ptr;
u8 data[TEGRA_BPMP_ACPI_BMRQ_DATA_SZ];
};

#endif
Loading
Loading