Skip to content

Commit 8c5d119

Browse files
committed
i3c_controller: Add pid, bcr, dcr, da, registers/parameters
These registers are only used to conform with the specifications and may be read by the controller's driver. Neither have an effect on the operation of the controller. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
1 parent 3ed8fc3 commit 8c5d119

File tree

6 files changed

+169
-5
lines changed

6 files changed

+169
-5
lines changed

docs/regmap/adi_regmap_i3c_controller.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,91 @@ ENDFIELD
7979
############################################################################################
8080
############################################################################################
8181

82+
REG
83+
0x15
84+
PID_L
85+
Least significant part of Provisioned ID. The PID value has no effect and is
86+
present only for conformity with the bus specification.
87+
ENDREG
88+
89+
FIELD
90+
[31:16] PART_ID
91+
PART_ID
92+
RO
93+
Device identifier, use the same for all instances of this controller unless ``TYPE_SELECTOR``
94+
is set to 1'b1.
95+
ENDFIELD
96+
97+
FIELD
98+
[15:12] INSTANCE_ID
99+
INSTANCE_ID
100+
RO
101+
Identify the individual device.
102+
ENDFIELD
103+
104+
FIELD
105+
[11:0] EXTRA_ID
106+
EXTRA_ID
107+
RO
108+
Extra characteristics field.
109+
ENDFIELD
110+
111+
############################################################################################
112+
############################################################################################
113+
114+
REG
115+
0x16
116+
PID_H
117+
Most significant part of Provisioned ID. The PID value has no effect and is
118+
present only for conformity with bus specification.
119+
ENDREG
120+
121+
FIELD
122+
[15:1] MANUF_ID
123+
MANUF_ID
124+
RO
125+
MIPI Manufacturer ID.
126+
ENDFIELD
127+
128+
FIELD
129+
[0] TYPE_SELECTOR
130+
TYPE_SELECTOR
131+
RO
132+
1'b1: Random Value, 1'b0: Vendor Fixed Value.
133+
ENDFIELD
134+
135+
############################################################################################
136+
############################################################################################
137+
138+
REG
139+
0x17
140+
DCR_BCR_DA
141+
ENDREG
142+
143+
FIELD
144+
[22:16] DA
145+
DA
146+
RW
147+
Controller dynamic address, used only for conformity, has no effect.
148+
ENDFIELD
149+
150+
FIELD
151+
[15:8] 0x40
152+
BCR
153+
RO
154+
Bus characteristics register.
155+
ENDFIELD
156+
157+
FIELD
158+
[7:0] 0x00
159+
DCR
160+
RO
161+
Device characteristics register.
162+
ENDFIELD
163+
164+
############################################################################################
165+
############################################################################################
166+
82167
REG
83168
0x20
84169
IRQ_MASK

library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface.v

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ module i3c_controller_host_interface #(
4242
parameter SDI_FIFO_ADDRESS_WIDTH = 5,
4343
parameter IBI_FIFO_ADDRESS_WIDTH = 4,
4444
parameter ID = 0,
45+
parameter DA = 7'h31,
4546
parameter ASYNC_CLK = 0,
46-
parameter OFFLOAD = 1
47+
parameter OFFLOAD = 1,
48+
parameter PID_MANUF_ID = 15'b0,
49+
parameter PID_TYPE_SELECTOR = 1'b1,
50+
parameter PID_PART_ID = 16'b0,
51+
parameter PID_INSTANCE_ID = 4'b0,
52+
parameter PID_EXTRA_ID = 12'b0
4753
) (
4854
input clk,
4955
output reset_n,
@@ -151,8 +157,14 @@ module i3c_controller_host_interface #(
151157
.SDI_FIFO_ADDRESS_WIDTH(SDI_FIFO_ADDRESS_WIDTH),
152158
.IBI_FIFO_ADDRESS_WIDTH(IBI_FIFO_ADDRESS_WIDTH),
153159
.ID(ID),
160+
.DA(DA),
161+
.ASYNC_CLK(ASYNC_CLK),
154162
.OFFLOAD(OFFLOAD),
155-
.ASYNC_CLK(ASYNC_CLK)
163+
.PID_MANUF_ID(PID_MANUF_ID),
164+
.PID_TYPE_SELECTOR(PID_TYPE_SELECTOR),
165+
.PID_PART_ID(PID_PART_ID),
166+
.PID_INSTANCE_ID(PID_INSTANCE_ID),
167+
.PID_EXTRA_ID(PID_EXTRA_ID)
156168
) i_i3c_controller_regmap (
157169
.s_axi_aclk(s_axi_aclk),
158170
.s_axi_aresetn(s_axi_aresetn),

library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface_hw.tcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ ad_ip_parameter SDO_FIFO_ADDRESS_WIDTH INTEGER 5
3636
ad_ip_parameter SDI_FIFO_ADDRESS_WIDTH INTEGER 5
3737
ad_ip_parameter IBI_FIFO_ADDRESS_WIDTH INTEGER 4
3838
ad_ip_parameter ID INTEGER 0
39+
ad_ip_parameter DA INTEGER 49
3940
ad_ip_parameter ASYNC_CLK INTEGER 0
4041
ad_ip_parameter OFFLOAD INTEGER 0
42+
ad_ip_parameter PID_MANUF_ID INTEGER 0
43+
ad_ip_parameter PID_TYPE_SELECTOR INTEGER 0
44+
ad_ip_parameter PID_PART_ID INTEGER 0
45+
ad_ip_parameter PID_INSTANCE_ID INTEGER 0
46+
ad_ip_parameter PID_EXTRA_ID INTEGER 0
4147

4248
proc p_elaboration {} {
4349

library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface_ip.tcl

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,49 @@ set_property -dict [list \
225225
"tooltip" "\[IBI_FIFO_ADDRESS_WIDTH\] Define the depth of the FIFO" \
226226
] [ipgui::get_guiparamspec -name "SDI_FIFO_ADDRESS_WIDTH" -component $cc]
227227

228+
## Provisioned ID and dynamic address configuration
229+
set cmd_stream_fifo_group [ipgui::add_group -name "Provisioned ID and dynamic address configuration" -component $cc \
230+
-parent $page0 -display_name "Provisioned ID and dynamic address configuration" ]
231+
232+
ipgui::add_param -name "DA" -component $cc -parent $cmd_stream_fifo_group
233+
set_property -dict [list \
234+
"display_name" "Dynamic address" \
235+
"tooltip" "\[DA\] Controller dynamic address, used only for conformity, has no effect." \
236+
] [ipgui::get_guiparamspec -name "DA" -component $cc]
237+
238+
ipgui::add_param -name "PID_MANUF_ID" -component $cc -parent $cmd_stream_fifo_group
239+
set_property -dict [list \
240+
"display_name" "PID - Manufacturer ID" \
241+
"tooltip" "\[PID_MANUF_ID\] MIPI Manufacturer ID" \
242+
] [ipgui::get_guiparamspec -name "PID_MANUF_ID" -component $cc]
243+
244+
ipgui::add_param -name "PID_TYPE_SELECTOR" -component $cc -parent $cmd_stream_fifo_group
245+
set_property -dict [list \
246+
"display_name" "PID - Type selector" \
247+
"tooltip" "\[PID_TYPE_SELECTOR\] 1'b1: Random Value, 1'b0: Vendor Fixed Value" \
248+
] [ipgui::get_guiparamspec -name "PID_TYPE_SELECTOR" -component $cc]
249+
250+
251+
ipgui::add_param -name "PID_PART_ID" -component $cc -parent $cmd_stream_fifo_group
252+
set_property -dict [list \
253+
"display_name" "PID - Part ID" \
254+
"tooltip" "\[PID_PART_ID\] Device identifier, use the same for all instances of this controller" \
255+
] [ipgui::get_guiparamspec -name "PID_PART_ID" -component $cc]
256+
257+
258+
ipgui::add_param -name "PID_INSTANCE_ID" -component $cc -parent $cmd_stream_fifo_group
259+
set_property -dict [list \
260+
"display_name" "PID - Instance ID" \
261+
"tooltip" "\[PID_INSTANCE_ID\] Identify the individual device" \
262+
] [ipgui::get_guiparamspec -name "PID_INSTANCE_ID" -component $cc]
263+
264+
265+
ipgui::add_param -name "PID_EXTRA_ID" -component $cc -parent $cmd_stream_fifo_group
266+
set_property -dict [list \
267+
"display_name" "PID - Extra ID" \
268+
"tooltip" "\[PID_EXTRA_ID\] Extra characteristics field" \
269+
] [ipgui::get_guiparamspec -name "PID_EXTRA_ID" -component $cc]
270+
228271
## Create and save the XGUI file
229272
ipx::create_xgui_files $cc
230273
ipx::save_core $cc

library/i3c_controller/i3c_controller_host_interface/i3c_controller_regmap.v

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ module i3c_controller_regmap #(
4444
parameter SDI_FIFO_ADDRESS_WIDTH = 5,
4545
parameter IBI_FIFO_ADDRESS_WIDTH = 4,
4646
parameter ID = 0,
47+
parameter DA = 7'h31,
4748
parameter ASYNC_CLK = 0,
4849
parameter OFFLOAD = 1,
49-
parameter DATA_WIDTH = 32
50+
parameter DATA_WIDTH = 32,
51+
parameter PID_MANUF_ID = 15'b0,
52+
parameter PID_TYPE_SELECTOR = 1'b1,
53+
parameter PID_PART_ID = 16'b0,
54+
parameter PID_INSTANCE_ID = 4'b0,
55+
parameter PID_EXTRA_ID = 12'b0
5056
) (
5157

5258
// Slave AXI interface
@@ -121,6 +127,11 @@ module i3c_controller_regmap #(
121127
localparam PCORE_VERSION = 'h00000100;
122128

123129
reg [31:0] up_scratch = 32'h00; // Scratch register
130+
reg [31:0] up_pid_l = {PID_PART_ID, PID_INSTANCE_ID, PID_EXTRA_ID};
131+
reg [31:0] up_pid_h = {16'd0, PID_MANUF_ID, PID_TYPE_SELECTOR};
132+
reg [6:0] up_da = DA;
133+
reg [7:0] up_bcr = 'h40;
134+
reg [7:0] up_dcr = 'h00;
124135
reg up_sw_reset = 1'b1;
125136
reg [31:0] up_rdata_ff = 32'd0;
126137
reg up_wack_ff = 1'b0;
@@ -307,8 +318,9 @@ module i3c_controller_regmap #(
307318
up_wack_ff <= up_wreq_s;
308319
if (up_wreq_s) begin
309320
case (up_waddr_s[7:0])
310-
`I3C_REGMAP_ENABLE: up_sw_reset <= up_wdata_s[0];
311-
`I3C_REGMAP_SCRATCH: up_scratch <= up_wdata_s;
321+
`I3C_REGMAP_ENABLE: up_sw_reset <= up_wdata_s[0];
322+
`I3C_REGMAP_SCRATCH: up_scratch <= up_wdata_s;
323+
`I3C_REGMAP_DCR_BCR_DA: up_da <= up_wdata_s[22:16];
312324
endcase
313325
end
314326
end
@@ -363,6 +375,9 @@ module i3c_controller_regmap #(
363375
`I3C_REGMAP_DEVICE_ID: up_rdata_ff <= ID;
364376
`I3C_REGMAP_SCRATCH: up_rdata_ff <= up_scratch;
365377
`I3C_REGMAP_ENABLE: up_rdata_ff <= up_sw_reset;
378+
`I3C_REGMAP_PID_L: up_rdata_ff <= up_pid_l;
379+
`I3C_REGMAP_PID_H: up_rdata_ff <= up_pid_h;
380+
`I3C_REGMAP_DCR_BCR_DA: up_rdata_ff <= {up_da, up_bcr, up_dcr};
366381
`I3C_REGMAP_IRQ_MASK: up_rdata_ff <= up_irq_mask;
367382
`I3C_REGMAP_IRQ_PENDING: up_rdata_ff <= up_irq_pending;
368383
`I3C_REGMAP_IRQ_SOURCE: up_rdata_ff <= up_irq_source;

library/i3c_controller/i3c_controller_host_interface/i3c_controller_regmap.vh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
`define I3C_REGMAP_DEVICE_ID 8'h01
4141
`define I3C_REGMAP_SCRATCH 8'h02
4242
`define I3C_REGMAP_ENABLE 8'h10
43+
`define I3C_REGMAP_PID_L 8'h15
44+
`define I3C_REGMAP_PID_H 8'h16
45+
`define I3C_REGMAP_DCR_BCR_DA 8'h17
4346
`define I3C_REGMAP_IRQ_MASK 8'h20
4447
`define I3C_REGMAP_IRQ_PENDING 8'h21
4548
`define I3C_REGMAP_IRQ_SOURCE 8'h22

0 commit comments

Comments
 (0)