Skip to content
10 changes: 10 additions & 0 deletions arch/arm64/boot/dts/aspeed/aspeed-bmc-amd-congo.dts
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,16 @@
i2c-scl-hz = <1000000>;
mctp-controller;

sbtsi_p0_iod0: sbtsi@4c,22400000118 {
reg = <0x4c 0x224 0x00000118>;
assigned-address = <0x4c>;
};

sbrmi_p0_iod0: sbrmi@3c,22400001118 {
reg = <0x3c 0x224 0x00001118>;
assigned-address = <0x3c>;
};

scoob_p0: scoob@0,22400002118 {
reg = <0x0 0x224 0x00002118>;
mrl = <69>;
Expand Down
10 changes: 10 additions & 0 deletions arch/arm64/boot/dts/aspeed/aspeed-bmc-amd-kenya.dts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,16 @@
i2c-scl-hz = <1000000>;
mctp-controller;

sbtsi_p0_iod0: sbtsi@4c,22400000118 {
reg = <0x4c 0x224 0x00000118>;
assigned-address = <0x4c>;
};

sbrmi_p0_iod0: sbrmi@3c,22400001118 {
reg = <0x3c 0x224 0x00001118>;
assigned-address = <0x3c>;
};

scoob_p0: scoob@0,22400002118 {
reg = <0x0 0x224 0x00002118>;
mrl = <69>;
Expand Down
34 changes: 34 additions & 0 deletions arch/arm64/boot/dts/aspeed/aspeed-bmc-amd-morocco.dts
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,16 @@
i2c-scl-hz = <1000000>;
mctp-controller;

sbtsi_p0_iod0: sbtsi@4c,22400000118 {
reg = <0x4c 0x224 0x00000118>;
assigned-address = <0x4c>;
};

sbrmi_p0_iod0: sbrmi@3c,22400001118 {
reg = <0x3c 0x224 0x00001118>;
assigned-address = <0x3c>;
};

scoob_p0: scoob@0,22400002118 {
reg = <0x0 0x224 0x00002118>;
mrl = <69>;
Expand All @@ -964,6 +974,30 @@
i2c-scl-hz = <1000000>;
mctp-controller;

sbtsi_p1_iod0: sbtsi@48,22401000118 {
status = "okay";
reg = <0x48 0x224 0x01000118>;
assigned-address = <0x48>;
};

sbtsi_2x1p_iod0: sbtsi@4c,22400000118 {
status = "disabled";
reg = <0x4c 0x224 0x00000118>;
assigned-address = <0x48>;
};

sbrmi_p1_iod0: sbrmi@38,22401001118 {
status = "okay";
reg = <0x38 0x224 0x01001118>;
assigned-address = <0x38>;
};

sbrmi_2x1p_iod0: sbrmi@3c,22400001118 {
status = "disabled";
reg = <0x3c 0x224 0x00001118>;
assigned-address = <0x38>;
};

scoob_2x1p_p1: scoob@0,22400002118 {
reg = <0x0 0x224 0x00002118>;
mrl = <69>;
Expand Down
34 changes: 34 additions & 0 deletions arch/arm64/boot/dts/aspeed/aspeed-bmc-amd-nigeria.dts
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,16 @@
i2c-scl-hz = <1000000>;
mctp-controller;

sbtsi_p0_iod0: sbtsi@4c,22400000118 {
reg = <0x4c 0x224 0x00000118>;
assigned-address = <0x4c>;
};

sbrmi_p0_iod0: sbrmi@3c,22400001118 {
reg = <0x3c 0x224 0x00001118>;
assigned-address = <0x3c>;
};

scoob_p0: scoob@0,22400002118 {
reg = <0x0 0x224 0x00002118>;
mrl = <69>;
Expand All @@ -735,6 +745,30 @@
i2c-scl-hz = <1000000>;
mctp-controller;

sbtsi_p1_iod0: sbtsi@48,22401000118 {
status = "okay";
reg = <0x48 0x224 0x01000118>;
assigned-address = <0x48>;
};

sbtsi_2x1p_iod0: sbtsi@4c,22400000118 {
status = "disabled";
reg = <0x4c 0x224 0x00000118>;
assigned-address = <0x48>;
};

sbrmi_p1_iod0: sbrmi@38,22401001118 {
status = "okay";
reg = <0x38 0x224 0x01001118>;
assigned-address = <0x38>;
};

sbrmi_2x1p_iod0: sbrmi@3c,22400001118 {
status = "disabled";
reg = <0x3c 0x224 0x00001118>;
assigned-address = <0x38>;
};

scoob_2x1p_p1: scoob@0,22400002118 {
reg = <0x0 0x224 0x00002118>;
mrl = <69>;
Expand Down
34 changes: 34 additions & 0 deletions arch/arm64/boot/dts/aspeed/overlays/2x1p-config-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;

/ {
fragment@0 {
target-path = "/soc@14000000/i3c5@14c25000";
__overlay__ {
sbtsi_p1_iod0: sbtsi@48,22401000118 {
status = "disabled";
reg = <0x48 0x224 0x01000118>;
assigned-address = <0x48>;
};

sbtsi_2x1p_iod0: sbtsi@4c,22400000118 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the changes for AB/B0 based SoC as well.

status = "okay";
reg = <0x4c 0x224 0x00000118>;
assigned-address = <0x48>;
};

sbrmi_p1_iod0: sbrmi@38,22401001118 {
status = "disabled";
reg = <0x38 0x224 0x01001118>;
assigned-address = <0x38>;
};

sbrmi_2x1p_iod0: sbrmi@3c,22400001118 {
status = "okay";
reg = <0x3c 0x224 0x00001118>;
assigned-address = <0x38>;
};
};
};
};
33 changes: 1 addition & 32 deletions drivers/misc/amd-apml/apml_sbtsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,30 +430,6 @@ static const char *sbtsi_addr_to_label(u8 addr)
}
}

static void map_sbtsi_pid_to_static_addr(struct i3c_device *i3cdev,
struct apml_sbtsi_device *tsi_dev)
{
if ((i3cdev->bus->id == 4) &&
((i3cdev->desc->info.pid == 0x118) ||
(i3cdev->desc->info.pid == 0x22400000119)))
{
tsi_dev->dev_static_addr = 0x4C;
}
else if ((i3cdev->bus->id == 5) &&
((i3cdev->desc->info.pid == 0x118) ||
(i3cdev->desc->info.pid == 0x01000118) ||
(i3cdev->desc->info.pid == 0x22400000119) ||
(i3cdev->desc->info.pid == 0x22401000119)))
{
tsi_dev->dev_static_addr = 0x48;
}
else
{
dev_err(&i3cdev->dev, "unknown pid. pid = 0x%llx\n",
i3cdev->desc->info.pid);
}
}

static int create_misc_tsi_device(struct apml_sbtsi_device *tsi_dev,
struct device *dev)
{
Expand Down Expand Up @@ -514,14 +490,7 @@ static int sbtsi_i3c_probe(struct i3c_device *i3cdev)
mutex_init(&tsi_dev->lock);

/* Need to verify for the static address for i3cdev */
tsi_dev->dev_static_addr = i3cdev->desc->info.static_addr;
map_sbtsi_pid_to_static_addr(i3cdev, tsi_dev);
if (tsi_dev->dev_static_addr == 0)
{
dev_err(dev, "SBTSI: PID = 0x%llx, static address zero, skip the device\n",
i3cdev->desc->info.pid);
return -ENXIO;
}
tsi_dev->dev_static_addr = i3cdev->desc->info.dyn_addr;

hwmon_dev_name = devm_kasprintf(dev, GFP_KERNEL, "sbtsi_%s",
sbtsi_addr_to_label(tsi_dev->dev_static_addr));
Expand Down
32 changes: 1 addition & 31 deletions drivers/misc/amd-apml/sbrmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,30 +371,6 @@ static const struct file_operations sbrmi_fops = {
.compat_ioctl = sbrmi_ioctl,
};

static void map_sbrmi_pid_to_static_addr(struct i3c_device *i3cdev,
struct apml_sbrmi_device *rmi_dev)
{
if ((i3cdev->bus->id == 4) &&
((i3cdev->desc->info.pid == 0x1118) ||
(i3cdev->desc->info.pid == 0x22400001119)))
{
rmi_dev->dev_static_addr = 0x3C;
}
else if ((i3cdev->bus->id == 5) &&
((i3cdev->desc->info.pid == 0x1118) ||
(i3cdev->desc->info.pid == 0x01001118) ||
(i3cdev->desc->info.pid == 0x22400001119) ||
(i3cdev->desc->info.pid == 0x22401001119)))
{
rmi_dev->dev_static_addr = 0x38;
}
else
{
dev_err(&i3cdev->dev, "unknown pid. pid = 0x%llx\n",
i3cdev->desc->info.pid);
}
}

static int create_misc_rmi_device(struct apml_sbrmi_device *rmi_dev,
struct device *dev)
{
Expand Down Expand Up @@ -688,13 +664,7 @@ static int sbrmi_i3c_probe(struct i3c_device *i3cdev)
dev_set_drvdata(dev, (void *)rmi_dev);

/* Need to verify for the static address for i3cdev */
rmi_dev->dev_static_addr = i3cdev->desc->info.static_addr;
map_sbrmi_pid_to_static_addr(i3cdev, rmi_dev);
if (rmi_dev->dev_static_addr == 0)
{
dev_err(dev, "SBRMI: PID = 0x%llx, static address zero, skip the device\n",
i3cdev->desc->info.pid);
}
rmi_dev->dev_static_addr = i3cdev->desc->info.dyn_addr;

hwmon_dev_name = devm_kasprintf(dev, GFP_KERNEL, "sbrmi_%s",
sbrmi_addr_to_label(rmi_dev->dev_static_addr));
Expand Down