Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e8fe00a

Browse files
committedSep 23, 2024·
[top_earlgrey,pinmux] Enable pull-down for TAP strap 0 at reset
TAP strap 0 is sampled after reset (and only once for life cycle states that are not TEST_UNLOCKED* or RMA). To ensure it gets sampled as 0 unless driven to 1 from an external source (and specifically that it gets sampled as 0 when left floating / not connected), this enables the pull-down of the pad at reset. Signed-off-by: Andreas Kurth <adk@lowrisc.org>
1 parent feab036 commit e8fe00a

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed
 

‎hw/ip/pinmux/data/pinmux.hjson

+3-1
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@
439439
Muxed pad attributes.
440440
This register has WARL behavior since not each pad type may support
441441
all attributes.
442+
The muxed pad that is used for TAP strap 0 has a different reset value, with `pull_en` set to 1.
442443
''',
443444
count: "NMioPads",
444445
compact: "false",
@@ -509,7 +510,8 @@
509510
// read back the same value that was written to them.
510511
// further, they have hardware side effects since they drive the
511512
// pad attributes, and hence no random data should be written to them.
512-
tags: ["excl:CsrAllTests:CsrExclWrite"]
513+
// Additionally, their reset value is defined by the RTL implementation and may not equal `resval` for all instances (#24621).
514+
tags: ["excl:CsrAllTests:CsrExclAll"]
513515
}
514516
},
515517

‎hw/ip/pinmux/data/pinmux.hjson.tpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@
556556
Muxed pad attributes.
557557
This register has WARL behavior since not each pad type may support
558558
all attributes.
559+
The muxed pad that is used for TAP strap 0 has a different reset value, with `pull_en` set to 1.
559560
''',
560561
count: "NMioPads",
561562
compact: "false",
@@ -626,7 +627,8 @@
626627
// read back the same value that was written to them.
627628
// further, they have hardware side effects since they drive the
628629
// pad attributes, and hence no random data should be written to them.
629-
tags: ["excl:CsrAllTests:CsrExclWrite"]
630+
// Additionally, their reset value is defined by the RTL implementation and may not equal `resval` for all instances (#24621).
631+
tags: ["excl:CsrAllTests:CsrExclAll"]
630632
}
631633
},
632634

‎hw/ip/pinmux/lint/pinmux.waiver

+3
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ waive -rules CLOCK_USE -location {pinmux.sv} -regexp {'(dio_wkup_mux\[12\]|dio_w
3737

3838
waive -rules CLOCK_MUX -location {pinmux.sv} -regexp {Clock 'dio_in_i\[12\]' reaches a multiplexer here, used as a clock 'clk_i'} \
3939
-comment "This mux is required to filter designated scan clock inputs (e.g. 'DioSpiDeviceSck' at index 12) from wakeup detector inputs"
40+
41+
waive -rules RESET_ONLY -location {pinmux.sv} -regexp {'mio_pad_attr_q\[0\]' is asynchronously reset but has no other assignments in this block} \
42+
-comment "This error can safely be ignored: The signal is obviously driven further down in the very same block, changing the TargetCfg.tap_strap0_idx value to a non-zero value (which it actually is in the Earlgrey top level) makes the error go away."

‎hw/ip/pinmux/rtl/pinmux.sv

+11-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,17 @@ module pinmux
161161
always_ff @(posedge clk_i or negedge rst_ni) begin : p_regs
162162
if (!rst_ni) begin
163163
dio_pad_attr_q <= '0;
164-
mio_pad_attr_q <= '0;
164+
for (int kk = 0; kk < NMioPads; kk++) begin
165+
if (kk == TargetCfg.tap_strap0_idx) begin
166+
// TAP strap 0 is sampled after reset (and only once for life cycle states that are not
167+
// TEST_UNLOCKED* or RMA). To ensure it gets sampled as 0 unless driven to 1 from an
168+
// external source (and specifically that it gets sampled as 0 when left floating / not
169+
// connected), this enables the pull-down of the pad at reset.
170+
mio_pad_attr_q[kk] <= '{pull_en: 1'b1, default: '0};
171+
end else begin
172+
mio_pad_attr_q[kk] <= '0;
173+
end
174+
end
165175
end else begin
166176
// dedicated pads
167177
for (int kk = 0; kk < NDioPads; kk++) begin

‎hw/top_earlgrey/ip/pinmux/data/autogen/pinmux.hjson

+3-1
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@
552552
Muxed pad attributes.
553553
This register has WARL behavior since not each pad type may support
554554
all attributes.
555+
The muxed pad that is used for TAP strap 0 has a different reset value, with `pull_en` set to 1.
555556
''',
556557
count: "NMioPads",
557558
compact: "false",
@@ -622,7 +623,8 @@
622623
// read back the same value that was written to them.
623624
// further, they have hardware side effects since they drive the
624625
// pad attributes, and hence no random data should be written to them.
625-
tags: ["excl:CsrAllTests:CsrExclWrite"]
626+
// Additionally, their reset value is defined by the RTL implementation and may not equal `resval` for all instances (#24621).
627+
tags: ["excl:CsrAllTests:CsrExclAll"]
626628
}
627629
},
628630

0 commit comments

Comments
 (0)
Please sign in to comment.