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
28 changes: 19 additions & 9 deletions Documentation/devicetree/bindings/i3c/i3c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ properties:
description: |
Each I2C device connected to the bus should be described in a subnode.

All I3C devices are supposed to support DAA (Dynamic Address Assignment),
and are thus discoverable. So, by default, I3C devices do not have to be
described in the device tree. This being said, one might want to attach
extra resources to these devices, and those resources may have to be
described in the device tree, which in turn means we have to describe
I3C devices.

Another use case for describing an I3C device in the device tree is when
this I3C device has a static I2C address and we want to assign it a
By default, I3C devices do not have to be described in the device tree.
This being said, one might want to attach extra resources to these
devices, and those resources may have to be described in the device tree,
which in turn means we have to describe I3C devices.

I3C child would have to be described in the device tree if the I3C device
uses SETAASA for its discovery and needs to be assigned a static
address, or if it uses a static I2C address and we want to assign a
specific I3C dynamic address before the DAA takes place (so that other
devices on the bus can't take this dynamic address).

Expand Down Expand Up @@ -147,6 +146,17 @@ patternProperties:
through SETDASA. If static address is not present, this address is assigned
through SETNEWDA after assigning a temporary address via ENTDAA.

mipi-i3c-static-method:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [ 1, 2 ]
description: |
Bitmap (Bit(0) = ENTDAA, Bit(1) = SETAASA) that indicates the static
address method used for the device discovery. This property is mandatory
for I3C devices that require to use SETAASA instead of ENTDAA to assign
a static address. The static address will be the one encoded in reg[0]
if SETAASA is used. ENTDAA will remain as the default method even if
this property is not present.

required:
- reg

Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ CONFIG_I2C_TEGRA=y
CONFIG_I2C_UNIPHIER_F=y
CONFIG_I2C_RCAR=y
CONFIG_I2C_CROS_EC_TUNNEL=y
CONFIG_I3C=m
CONFIG_DW_I3C_MASTER=m
CONFIG_SPI=y
CONFIG_SPI_ARMADA_3700=y
CONFIG_SPI_BCM2835=m
Expand Down Expand Up @@ -713,6 +715,7 @@ CONFIG_SENSORS_RASPBERRYPI_HWMON=m
CONFIG_SENSORS_SL28CPLD=m
CONFIG_SENSORS_INA2XX=m
CONFIG_SENSORS_INA3221=m
CONFIG_SENSORS_SPD5118=m
CONFIG_SENSORS_TMP102=m
CONFIG_MISC_RP1=m
CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
Expand Down
9 changes: 9 additions & 0 deletions debian.nvidia-6.17/config/annotations
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ CONFIG_DRM_NOUVEAU_GSP_DEFAULT note<'Disable nouveau for NVIDIA
CONFIG_DRM_NOUVEAU_SVM policy<{'amd64': '-', 'arm64': '-'}>
CONFIG_DRM_NOUVEAU_SVM note<'Disable nouveau for NVIDIA kernels'>

CONFIG_DW_I3C_MASTER policy<{'amd64': 'n', 'arm64': 'm'}>
CONFIG_DW_I3C_MASTER note<'Enable DesignWare I3C master controller for Tegra410'>

CONFIG_EFI_CAPSULE_LOADER policy<{'amd64': 'm', 'arm64': 'y'}>
CONFIG_EFI_CAPSULE_LOADER note<'LP: #2067111'>

Expand All @@ -120,6 +123,9 @@ CONFIG_ETM4X_IMPDEF_FEATURE note<'Required for Grace enablem
CONFIG_GPIO_AAEON policy<{'amd64': '-'}>
CONFIG_GPIO_AAEON note<'Disable all Ubuntu ODM drivers'>

CONFIG_I3C policy<{'amd64': 'n', 'arm64': 'm'}>
CONFIG_I3C note<'Enable I3C bus support for Tegra410 and SPD5118 temperature sensors'>

CONFIG_IOMMU_DEFAULT_DMA_LAZY policy<{'amd64': 'y', 'arm64': 'n'}>
CONFIG_IOMMU_DEFAULT_DMA_LAZY note<'On Nvidia CPU passthrough mode is recommend so set passthrough mode as default for better performance'>

Expand Down Expand Up @@ -183,6 +189,9 @@ CONFIG_SAMPLE_CORESIGHT_SYSCFG note<'Required for Grace enablem
CONFIG_SENSORS_AAEON policy<{'amd64': '-'}>
CONFIG_SENSORS_AAEON note<'Disable all Ubuntu ODM drivers'>

CONFIG_SENSORS_SPD5118 policy<{'amd64': 'n', 'arm64': 'm'}>
CONFIG_SENSORS_SPD5118 note<'Enable SPD5118 temperature sensor support for DDR5 memory modules'>

CONFIG_SND_HDA_ACPI policy<{'amd64': 'n', 'arm64': 'm'}>
CONFIG_SND_HDA_ACPI note<'Add support for ACPI-enumerated HDA'>

Expand Down
6 changes: 5 additions & 1 deletion drivers/acpi/acpica/rsserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ struct acpi_rsconvert_info acpi_rs_convert_csi2_serial_bus[14] = {
*
******************************************************************************/

struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[17] = {
struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[18] = {
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus),
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_i2c_serial_bus)},
Expand Down Expand Up @@ -391,6 +391,10 @@ struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[17] = {
AML_OFFSET(i2c_serial_bus.type_specific_flags),
0},

{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.i2c_serial_bus.lvr),
AML_OFFSET(i2c_serial_bus.type_specific_flags) + 1,
0},

{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.i2c_serial_bus.connection_speed),
AML_OFFSET(i2c_serial_bus.connection_speed),
1},
Expand Down
12 changes: 8 additions & 4 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2288,12 +2288,16 @@ config SENSORS_INA3221

config SENSORS_SPD5118
tristate "SPD5118 Compliant Temperature Sensors"
depends on I2C
select REGMAP_I2C
depends on I2C || I3C
select REGMAP_I2C if I2C
select REGMAP_I3C if I3C
help
If you say yes here you get support for SPD5118 (JEDEC JESD300)
compliant temperature sensors. Such sensors are found on DDR5 memory
modules.
compliant temperature sensors using I2C or I3C bus interface.
Such sensors are found on DDR5 memory modules.

This driver supports both I2C and I3C interfaces. I3C devices
use 16-bit register addressing mode as specified in JESD300-5B.

This driver can also be built as a module. If so, the module
will be called spd5118.
Expand Down
63 changes: 62 additions & 1 deletion drivers/hwmon/spd5118.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/bits.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/i3c/device.h>
#include <linux/hwmon.h>
#include <linux/module.h>
#include <linux/mutex.h>
Expand Down Expand Up @@ -770,7 +771,67 @@ static struct i2c_driver spd5118_i2c_driver = {
.address_list = IS_ENABLED(CONFIG_SENSORS_SPD5118_DETECT) ? normal_i2c : NULL,
};

module_i2c_driver(spd5118_i2c_driver);
/* I3C */

static int spd5118_i3c_probe(struct i3c_device *i3cdev)
{
struct device *dev = i3cdev_to_dev(i3cdev);
struct regmap *regmap;
unsigned int regval;
int err;

/*
* I3C devices use 16-bit register addressing.
* Per SPD5118 specification section 7.2, I3C interface uses
* 16-bit register address mode.
*/
regmap = devm_regmap_init_i3c(i3cdev, &spd5118_regmap8_config);
if (IS_ERR(regmap))
return dev_err_probe(dev, PTR_ERR(regmap), "regmap init failed\n");

/* Verify this is a SPD5118 device */
err = regmap_read(regmap, SPD5118_REG_TYPE, &regval);
if (err)
return err;

/* Check device type - should be 0x51 in first register */
if (regval != 0x51)
return -ENODEV;

err = regmap_read(regmap, SPD5118_REG_TYPE + 1, &regval);
if (err)
return err;

/* Second register should be 0x18 (combined: 0x5118) */
if (regval != 0x18)
return -ENODEV;

/* I3C devices always use 16-bit addressing */
return spd5118_common_probe(dev, regmap, true);
}

/*
* SPD5118 does not have a manufacturer/part ID defined in the
* JESD specification for I3C. We use a generic match for now.
* Devices should be instantiated via device tree or ACPI.
*/
static const struct i3c_device_id spd5118_i3c_ids[] = {
I3C_CLASS(I3C_DCR_GENERIC_DEVICE, NULL),
{ }
};
MODULE_DEVICE_TABLE(i3c, spd5118_i3c_ids);

static struct i3c_driver spd5118_i3c_driver = {
.driver = {
.name = "spd5118_i3c",
.of_match_table = spd5118_of_ids,
.pm = pm_sleep_ptr(&spd5118_pm_ops),
},
.probe = spd5118_i3c_probe,
.id_table = spd5118_i3c_ids,
};

module_i3c_i2c_driver(spd5118_i3c_driver, &spd5118_i2c_driver)

MODULE_AUTHOR("René Rebe <rene@exactcode.de>");
MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
Expand Down
Loading