Skip to content

Conversation

@mahkurap
Copy link
Collaborator

@mahkurap mahkurap commented Aug 7, 2025

Add support to configure the Max Read Length and Max Write Length for each i3c device using device tree tags.


if (!of_property_read_u32(node, "mrl", &mrl))
boardinfo->mrl = (u16)mrl;

Copy link
Collaborator

Choose a reason for hiding this comment

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

should we have a default value for mrl? and set it in else statement

Copy link
Collaborator

Choose a reason for hiding this comment

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

i3c.yaml also can updated with default info?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Targets return their buffer sizes for GETMRL/GETMWL CCC. Controller uses them as default values.

$ref: /schemas/types.yaml#/definitions/uint16
minimum: 0x10
maximum: 0xffff
Maximum Write Length(MWL) that the device supports.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ensure mrl and mwl are optional properties (not in required: list).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need help. I thought they are not mentioned as part of required:

return ret;
}

static void i3c_master_attach_boardinfo(struct i3c_dev_desc *i3cdev)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How this changes connected connceted to mrl and mwl chnages , is this to fix some thing similar [PATCH] i3c: transfer pid from boardinfo to device info ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are not related to this change. They appeared because of the rebase. May be I need create a fresh branch?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Tracking point it will be good to mrl change independently. like rebase commit fisrt and then add this .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ojayanth I was wrong when I said this is not related to the MRL/MWL change. Infact this is related to MRL/MWL change. If this is not done, the boardinfo details are not getting attached to the device structure.


if (!of_property_read_u32(node, "mrl", &mrl))
boardinfo->mrl = (u16)mrl;

Copy link
Collaborator

Choose a reason for hiding this comment

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

i3c.yaml also can updated with default info?

}

if (dev->boardinfo && dev->boardinfo->mrl)
if (dev->boardinfo && dev->boardinfo->mrl) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this AMD specific chnages?

Copy link
Collaborator Author

@mahkurap mahkurap Oct 22, 2025

Choose a reason for hiding this comment

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

Yes

Add support for two optional Device Tree properties, mrl (Maximum Read
Length) and mwl (Maximum Write Length), for I3C target devices. These
properties allow firmware to specify the maximum read and write transfer
lengths supported by a target, as defined in the MIPI I3C specification.

Example usage in Device Tree:

    scoob_p0: scoob@5c,22400002118 {
            reg = <0x5c 0x224 0x00002118>;
            assigned-address = <0x5c>;
            mrl = <69>;
            mwl = <69>;
    };

tested: verified on Congo and Morocco

Signed-off-by: Mahesh Kurapati <[email protected]>
Add support for two new Device Tree properties, `mrl` (Maximum Read
Length) and `mwl` (Maximum Write Length), for I3C target devices.

These properties allow firmware to specify the maximum read and write
transfer lengths supported by a target, as defined in the I3C
specification. The values are used by the BMC/I3C master to send SETMRL
and SETMWL CCC commands the target initialization/probe. BMC retrieves
the effective values using GETMRL and GETMWL CCC commands. These values
are then used to during the private transfers.

Example usage in Device Tree:

    scoob_p0: scoob@5c,22400002118 {
        reg = <0x5c 0x224 0x00002118>;
        assigned-address = <0x5c>;
        mrl = <69>;
        mwl = <69>;
    };

tested: verified on Morocco

Signed-off-by: Mahesh Kurapati <[email protected]>
Add `mrl` (Maximum Read Length) and `mwl` (Maximum Write Length)
properties to the Congo I3C device node in the Aspeed device tree.

These properties are defined by the I3C specification and indicate
the maximum read and write transfer lengths supported by the target
device. Setting both values to 69 bytes allows the I3C master to
optimize private data transfers accordingly.

tested: verified on Congo

Signed-off-by: Mahesh Kurapati <[email protected]>
Add `mrl` (Maximum Read Length) and `mwl` (Maximum Write Length)
properties to the Ghana I3C device node in the Aspeed device tree.

These properties are defined by the I3C specification and indicate
the maximum read and write transfer lengths supported by the target
device.

tested: build verified for Ghana

Signed-off-by: Mahesh Kurapati <[email protected]>
Add `mrl` (Maximum Read Length) and `mwl` (Maximum Write Length)
properties to the Kenya I3C device node in the Aspeed device tree.

These properties are defined by the I3C specification and indicate
the maximum read and write transfer lengths supported by the target
device.

tested: verified on Kenya

Signed-off-by: Mahesh Kurapati <[email protected]>
Add `mrl` (Maximum Read Length) and `mwl` (Maximum Write Length)
properties to the Morocco I3C device node in the Aspeed device tree.

These properties are defined by the I3C specification and indicate
the maximum read and write transfer lengths supported by the target
device.

tested: verified on Morocco

Signed-off-by: Mahesh Kurapati <[email protected]>
Add `mrl` (Maximum Read Length) and `mwl` (Maximum Write Length)
properties to the Nigeria I3C device node in the Aspeed device tree.

These properties are defined by the I3C specification and indicate
the maximum read and write transfer lengths supported by the target
device.

tested: verified on Nigeria

Signed-off-by: Mahesh Kurapati <[email protected]>
Issue DISEC CCC before issueing the SETMRL CCC to enable the MPIO
FW to send the discovery notify only when the MCTP over I3C binding
driver.

tested: verified on Congo and Morocco.

Signed-off-by: Mahesh Kurapati <[email protected]>
Copy link
Collaborator

@ojayanth ojayanth left a comment

Choose a reason for hiding this comment

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

Looking good .

return ret;
}

static void i3c_master_attach_boardinfo(struct i3c_dev_desc *i3cdev)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tracking point it will be good to mrl change independently. like rebase commit fisrt and then add this .

@mahkurap mahkurap merged commit 39ae533 into dev-a1 Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants