Skip to content

Commit

Permalink
ARM: dts: ast2600-evb: use macro to creat I3C SPD child node
Browse files Browse the repository at this point in the history
Add macros to create I3C SPD child nodes.
Example 1: create an I3C SPD child node in I3C mode
// attach this device on I3C bus 0 with index 0x0 and address 0x50
JESD300_SPD_I3C_MODE(0, 0, 50)

Example 2: create an I3C SPD chile node in I2C mode
// attach this device on I3C bus 2 with index 0x1 and address 0x51
JESD300_SPD_I2C_MODE(2, 1, 51)

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Change-Id: I83c8c62b2835982e63b908ae8489112f24cd2378
  • Loading branch information
aspeeddylan committed Oct 5, 2022
1 parent 0e9a421 commit ee4117e
Showing 1 changed file with 22 additions and 60 deletions.
82 changes: 22 additions & 60 deletions arch/arm/boot/dts/aspeed-ast2600-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,20 @@
* | |
* +---------------------+
*/
#define JESD300_SPD_I2C_MODE(bus, index, addr) \
spd_ ## bus ## _ ## index: spd@addr { \
compatible = "idt,spd"; \
reg = <0x ## addr 0x0 0x0>; \
};

#define JESD300_SPD_I3C_MODE(bus, index, addr) \
spd_ ## bus ## _ ## index: spd@addr,4cc5118 ## index ## 000 { \
reg = <0x ## addr 0x4cc 0x5118 ## index ## 000>; \
assigned-address = <0x ## addr>; \
dcr = <0xda>; \
bcr = <0x6>; \
};

&i3c0 {
status = "okay";
jdec-spd;
Expand All @@ -927,21 +941,8 @@
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_0_0: spd@50,4cc51180000 {
reg = <0x50 0x4cc 0x51180000>;
assigned-address = <0x50>;
dcr = <0xda>;
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_0_1: spd@51,4cc51181000 {
reg = <0x51 0x4cc 0x51181000>;
assigned-address = <0x51>;
dcr = <0xda>;
bcr = <0x6>;
};
JESD300_SPD_I3C_MODE(0, 0, 50)
JESD300_SPD_I3C_MODE(0, 1, 51)
};

&i3c1 {
Expand All @@ -955,21 +956,8 @@
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_1_0: spd@50,4cc51180000 {
reg = <0x50 0x4cc 0x51180000>;
assigned-address = <0x50>;
dcr = <0xda>;
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_1_1: spd@51,4cc51181000 {
reg = <0x51 0x4cc 0x51181000>;
assigned-address = <0x51>;
dcr = <0xda>;
bcr = <0x6>;
};
JESD300_SPD_I3C_MODE(1, 0, 50)
JESD300_SPD_I3C_MODE(1, 1, 51)
};

&i3c2 {
Expand All @@ -986,21 +974,8 @@
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_2_0: spd@52,4cc51180000 {
reg = <0x52 0x4cc 0x51180000>;
assigned-address = <0x52>;
dcr = <0xda>;
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_2_1: spd@53,4cc51181000 {
reg = <0x53 0x4cc 0x51181000>;
assigned-address = <0x53>;
dcr = <0xda>;
bcr = <0x6>;
};
JESD300_SPD_I3C_MODE(2, 0, 52)
JESD300_SPD_I3C_MODE(2, 1, 53)
};

&i3c3 {
Expand All @@ -1017,21 +992,8 @@
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_3_0: spd@52,4cc51180000 {
reg = <0x52 0x4cc 0x51180000>;
assigned-address = <0x52>;
dcr = <0xda>;
bcr = <0x6>;
};

/* Renesas SPD5118 */
spd5118_3_1: spd@53,4cc51181000 {
reg = <0x53 0x4cc 0x51181000>;
assigned-address = <0x53>;
dcr = <0xda>;
bcr = <0x6>;
};
JESD300_SPD_I3C_MODE(3, 0, 52)
JESD300_SPD_I3C_MODE(3, 1, 53)
};
#endif

Expand Down

0 comments on commit ee4117e

Please sign in to comment.