Skip to content

Commit

Permalink
[top_earlgrey,pinmux] Add input disable attribute for non-manual pads
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Kurth <[email protected]>
  • Loading branch information
andreaskurth committed May 14, 2024
1 parent 66dd1d2 commit f541cd9
Show file tree
Hide file tree
Showing 24 changed files with 3,403 additions and 445 deletions.
14 changes: 14 additions & 0 deletions hw/ip/pinmux/data/pinmux.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,13 @@
name: "od_en",
desc: "Enable open drain."
},
{ bits: "7",
name: "input_disable",
desc: '''
Disable input drivers.
Setting this to 1 for pads that are not used as input can reduce their leakage current.
'''
},
{ bits: "17:16",
name: "slew_rate",
desc: "Slew rate (0x0: slowest, 0x3: fastest)."
Expand Down Expand Up @@ -584,6 +591,13 @@
name: "od_en",
desc: "Enable open drain."
},
{ bits: "7",
name: "input_disable",
desc: '''
Disable input drivers.
Setting this to 1 for pads that are not used as input can reduce their leakage current.
'''
},
{ bits: "17:16",
name: "slew_rate",
desc: "Slew rate (0x0: slowest, 0x3: fastest)."
Expand Down
14 changes: 14 additions & 0 deletions hw/ip/pinmux/data/pinmux.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,13 @@
name: "od_en",
desc: "Enable open drain."
},
{ bits: "7",
name: "input_disable",
desc: '''
Disable input drivers.
Setting this to 1 for pads that are not used as input can reduce their leakage current.
'''
},
{ bits: "17:16",
name: "slew_rate",
desc: "Slew rate (0x0: slowest, 0x3: fastest)."
Expand Down Expand Up @@ -701,6 +708,13 @@
name: "od_en",
desc: "Enable open drain."
},
{ bits: "7",
name: "input_disable",
desc: '''
Disable input drivers.
Setting this to 1 for pads that are not used as input can reduce their leakage current.
'''
},
{ bits: "17:16",
name: "slew_rate",
desc: "Slew rate (0x0: slowest, 0x3: fastest)."
Expand Down
22 changes: 16 additions & 6 deletions hw/ip/pinmux/doc/registers.md
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ Muxed pad attributes.
This register has WARL behavior since not each pad type may support
all attributes.
- Reset default: `0x0`
- Reset mask: `0xf3007f`
- Reset mask: `0xf300ff`

### Instances

Expand Down Expand Up @@ -1024,7 +1024,7 @@ all attributes.
### Fields

```wavejson
{"reg": [{"name": "invert", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "virtual_od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_select", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "keeper_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "schmitt_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"bits": 9}, {"name": "slew_rate", "bits": 2, "attr": ["rw"], "rotate": -90}, {"bits": 2}, {"name": "drive_strength", "bits": 4, "attr": ["rw"], "rotate": -90}, {"bits": 8}], "config": {"lanes": 1, "fontsize": 10, "vspace": 160}}
{"reg": [{"name": "invert", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "virtual_od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_select", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "keeper_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "schmitt_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "input_disable", "bits": 1, "attr": ["rw"], "rotate": -90}, {"bits": 8}, {"name": "slew_rate", "bits": 2, "attr": ["rw"], "rotate": -90}, {"bits": 2}, {"name": "drive_strength", "bits": 4, "attr": ["rw"], "rotate": -90}, {"bits": 8}], "config": {"lanes": 1, "fontsize": 10, "vspace": 160}}
```

| Bits | Type | Reset | Name |
Expand All @@ -1033,7 +1033,8 @@ all attributes.
| 23:20 | rw | 0x0 | [drive_strength](#mio_pad_attr--drive_strength) |
| 19:18 | | | Reserved |
| 17:16 | rw | 0x0 | [slew_rate](#mio_pad_attr--slew_rate) |
| 15:7 | | | Reserved |
| 15:8 | | | Reserved |
| 7 | rw | 0x0 | [input_disable](#mio_pad_attr--input_disable) |
| 6 | rw | 0x0 | [od_en](#mio_pad_attr--od_en) |
| 5 | rw | 0x0 | [schmitt_en](#mio_pad_attr--schmitt_en) |
| 4 | rw | 0x0 | [keeper_en](#mio_pad_attr--keeper_en) |
Expand All @@ -1048,6 +1049,10 @@ Drive strength (0x0: weakest, 0xf: strongest)
### MIO_PAD_ATTR . slew_rate
Slew rate (0x0: slowest, 0x3: fastest).

### MIO_PAD_ATTR . input_disable
Disable input drivers.
Setting this to 1 for pads that are not used as input can reduce their leakage current.

### MIO_PAD_ATTR . od_en
Enable open drain.

Expand Down Expand Up @@ -1118,7 +1123,7 @@ Dedicated pad attributes.
This register has WARL behavior since not each pad type may support
all attributes.
- Reset default: `0x0`
- Reset mask: `0xf3007f`
- Reset mask: `0xf300ff`

### Instances

Expand All @@ -1145,7 +1150,7 @@ all attributes.
### Fields

```wavejson
{"reg": [{"name": "invert", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "virtual_od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_select", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "keeper_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "schmitt_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"bits": 9}, {"name": "slew_rate", "bits": 2, "attr": ["rw"], "rotate": -90}, {"bits": 2}, {"name": "drive_strength", "bits": 4, "attr": ["rw"], "rotate": -90}, {"bits": 8}], "config": {"lanes": 1, "fontsize": 10, "vspace": 160}}
{"reg": [{"name": "invert", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "virtual_od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "pull_select", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "keeper_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "schmitt_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "od_en", "bits": 1, "attr": ["rw"], "rotate": -90}, {"name": "input_disable", "bits": 1, "attr": ["rw"], "rotate": -90}, {"bits": 8}, {"name": "slew_rate", "bits": 2, "attr": ["rw"], "rotate": -90}, {"bits": 2}, {"name": "drive_strength", "bits": 4, "attr": ["rw"], "rotate": -90}, {"bits": 8}], "config": {"lanes": 1, "fontsize": 10, "vspace": 160}}
```

| Bits | Type | Reset | Name |
Expand All @@ -1154,7 +1159,8 @@ all attributes.
| 23:20 | rw | 0x0 | [drive_strength](#dio_pad_attr--drive_strength) |
| 19:18 | | | Reserved |
| 17:16 | rw | 0x0 | [slew_rate](#dio_pad_attr--slew_rate) |
| 15:7 | | | Reserved |
| 15:8 | | | Reserved |
| 7 | rw | 0x0 | [input_disable](#dio_pad_attr--input_disable) |
| 6 | rw | 0x0 | [od_en](#dio_pad_attr--od_en) |
| 5 | rw | 0x0 | [schmitt_en](#dio_pad_attr--schmitt_en) |
| 4 | rw | 0x0 | [keeper_en](#dio_pad_attr--keeper_en) |
Expand All @@ -1169,6 +1175,10 @@ Drive strength (0x0: weakest, 0xf: strongest)
### DIO_PAD_ATTR . slew_rate
Slew rate (0x0: slowest, 0x3: fastest).

### DIO_PAD_ATTR . input_disable
Disable input drivers.
Setting this to 1 for pads that are not used as input can reduce their leakage current.

### DIO_PAD_ATTR . od_en
Enable open drain.

Expand Down
5 changes: 3 additions & 2 deletions hw/ip/pinmux/doc/theory_of_operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ Signal | Direction | Type | Description
`attr_i[4]` | `input` | `logic` | Keeper enable
`attr_i[5]` | `input` | `logic` | Schmitt trigger enable
`attr_i[6]` | `input` | `logic` | Open drain enable
`attr_i[8:7]` | `input` | `logic` | Slew rate (0x0: slowest, 0x3: fastest)
`attr_i[12:9]` | `input` | `logic` | Drive strength (0x0: weakest, 0xf: strongest)
`attr_i[7]` | `input` | `logic` | Input disable (0: input enabled, 1: input disabled)
`attr_i[9:8]` | `input` | `logic` | Slew rate (0x0: slowest, 0x3: fastest)
`attr_i[13:10]` | `input` | `logic` | Drive strength (0x0: weakest, 0xf: strongest)

Note that the corresponding pad attribute registers [`MIO_PAD_ATTR_0`](registers.md#mio_pad_attr) and [`DIO_PAD_ATTR_0`](registers.md#dio_pad_attr) have "writes-any-reads-legal" (WARL) behavior (see also [pad attributes](#pad-attributes)).
2 changes: 2 additions & 0 deletions hw/ip/pinmux/fpv/vip/pinmux_assert_fpv.sv
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ module pinmux_assert_fpv
assign mio_pad_attr_mask.keep_en = 0;
assign mio_pad_attr_mask.schmitt_en = 0;
assign mio_pad_attr_mask.od_en = 0;
assign mio_pad_attr_mask.input_disable = 0;
assign mio_pad_attr_mask.slew_rate = '0;
assign mio_pad_attr_mask.drive_strength[3:1] = '0;

Expand Down Expand Up @@ -323,6 +324,7 @@ module pinmux_assert_fpv
assign dio_pad_attr_mask.keep_en = 0;
assign dio_pad_attr_mask.schmitt_en = 0;
assign dio_pad_attr_mask.od_en = 0;
assign dio_pad_attr_mask.input_disable = 0;
assign dio_pad_attr_mask.slew_rate = '0;
assign dio_pad_attr_mask.drive_strength[3:1] = '0;

Expand Down
8 changes: 8 additions & 0 deletions hw/ip/pinmux/rtl/pinmux.sv
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ module pinmux
if (reg2hw.dio_pad_attr[kk].slew_rate.qe) begin
dio_pad_attr_q[kk].slew_rate <= reg2hw.dio_pad_attr[kk].slew_rate.q;
end
if (reg2hw.dio_pad_attr[kk].input_disable.qe) begin
dio_pad_attr_q[kk].input_disable <= reg2hw.dio_pad_attr[kk].input_disable.q;
end
if (reg2hw.dio_pad_attr[kk].od_en.qe) begin
dio_pad_attr_q[kk].od_en <= reg2hw.dio_pad_attr[kk].od_en.q;
end
Expand Down Expand Up @@ -201,6 +204,9 @@ module pinmux
if (reg2hw.mio_pad_attr[kk].slew_rate.qe) begin
mio_pad_attr_q[kk].slew_rate <= reg2hw.mio_pad_attr[kk].slew_rate.q;
end
if (reg2hw.mio_pad_attr[kk].input_disable.qe) begin
mio_pad_attr_q[kk].input_disable <= reg2hw.mio_pad_attr[kk].input_disable.q;
end
if (reg2hw.mio_pad_attr[kk].od_en.qe) begin
mio_pad_attr_q[kk].od_en <= reg2hw.mio_pad_attr[kk].od_en.q;
end
Expand Down Expand Up @@ -243,6 +249,7 @@ module pinmux
assign dio_attr[k] = dio_pad_attr_q[k] & warl_mask;
assign hw2reg.dio_pad_attr[k].drive_strength.d = dio_attr[k].drive_strength;
assign hw2reg.dio_pad_attr[k].slew_rate.d = dio_attr[k].slew_rate;
assign hw2reg.dio_pad_attr[k].input_disable.d = dio_attr[k].input_disable;
assign hw2reg.dio_pad_attr[k].od_en.d = dio_attr[k].od_en;
assign hw2reg.dio_pad_attr[k].schmitt_en.d = dio_attr[k].schmitt_en;
assign hw2reg.dio_pad_attr[k].keeper_en.d = dio_attr[k].keep_en;
Expand All @@ -265,6 +272,7 @@ module pinmux
assign mio_attr[k] = mio_pad_attr_q[k] & warl_mask;
assign hw2reg.mio_pad_attr[k].drive_strength.d = mio_attr[k].drive_strength;
assign hw2reg.mio_pad_attr[k].slew_rate.d = mio_attr[k].slew_rate;
assign hw2reg.mio_pad_attr[k].input_disable.d = mio_attr[k].input_disable;
assign hw2reg.mio_pad_attr[k].od_en.d = mio_attr[k].od_en;
assign hw2reg.mio_pad_attr[k].schmitt_en.d = mio_attr[k].schmitt_en;
assign hw2reg.mio_pad_attr[k].keeper_en.d = mio_attr[k].keep_en;
Expand Down
Loading

0 comments on commit f541cd9

Please sign in to comment.