Skip to content

Commit 6735d0d

Browse files
committed
ondisk: Fix up Genoa MaxDimmsPerChannel6 and some other cleanup.
1 parent 53df093 commit 6735d0d

File tree

1 file changed

+41
-23
lines changed

1 file changed

+41
-23
lines changed

src/ondisk.rs

+41-23
Original file line numberDiff line numberDiff line change
@@ -3613,7 +3613,7 @@ pub mod memory {
36133613
fn default() -> Self {
36143614
Self {
36153615
total_size: (size_of::<Self>() as u32).into(),
3616-
target_memclk: 2000.into(), // FIXME
3616+
target_memclk: 2000.into(),
36173617
dimm_slots_per_channel: 2,
36183618
dimm0_rank_bitmap: 4,
36193619
dimm1_rank_bitmap: 4,
@@ -3778,13 +3778,21 @@ pub mod memory {
37783778
#[repr(C, packed)]
37793779
pub struct MemDfeSearchElementPayload {
37803780
total_size || u32 : LU32,
3781+
/// -40..=40
37813782
tx_dfe_tap_1_start || u8 : u8,
3783+
/// -40..=40
37823784
tx_dfe_tap_1_end || u8 : u8,
3785+
/// -15..=15
37833786
tx_dfe_tap_2_start || u8 : u8,
3787+
/// -15..=15
37843788
tx_dfe_tap_2_end || u8 : u8,
3789+
/// -12..=12
37853790
tx_dfe_tap_3_start || u8 : u8,
3791+
/// -12..=12
37863792
tx_dfe_tap_3_end || u8 : u8,
3793+
/// -8..=8
37873794
tx_dfe_tap_4_start || u8 : u8,
3795+
/// -8..=8
37883796
tx_dfe_tap_4_end || u8 : u8,
37893797
}
37903798
}
@@ -3833,12 +3841,12 @@ pub mod memory {
38333841
fn default() -> Self {
38343842
Self {
38353843
total_size: (size_of::<Self>() as u32).into(),
3836-
rx_dfe_tap_2_min_mv: 0, // FIXME
3837-
rx_dfe_tap_2_max_mv: 0, // FIXME
3838-
rx_dfe_tap_3_min_mv: 0, // FIXME
3839-
rx_dfe_tap_3_max_mv: 0, // FIXME
3840-
rx_dfe_tap_4_min_mv: 0, // FIXME
3841-
rx_dfe_tap_4_max_mv: 0, // FIXME
3844+
rx_dfe_tap_2_min_mv: 0,
3845+
rx_dfe_tap_2_max_mv: 0,
3846+
rx_dfe_tap_3_min_mv: 0,
3847+
rx_dfe_tap_3_max_mv: 0,
3848+
rx_dfe_tap_4_min_mv: 0,
3849+
rx_dfe_tap_4_max_mv: 0,
38423850
}
38433851
}
38443852
}
@@ -3858,6 +3866,9 @@ pub mod memory {
38583866
}
38593867

38603868
make_accessors! {
3869+
/// Decision Feedback Equalization.
3870+
/// See also UMC::Phy::RxDFETapCtrl in the memory controller.
3871+
/// See <https://ieeexplore.ieee.org/document/1455678>.
38613872
#[derive(FromBytes, AsBytes, Unaligned, PartialEq, Debug, Default, Copy, Clone)]
38623873
#[repr(C, packed)]
38633874
pub struct MemDfeSearchElement32 {
@@ -3876,6 +3887,9 @@ pub mod memory {
38763887
}
38773888

38783889
make_accessors! {
3890+
/// Decision Feedback Equalization.
3891+
/// See also UMC::Phy::RxDFETapCtrl in the memory controller.
3892+
/// See <https://ieeexplore.ieee.org/document/1455678>.
38793893
#[derive(FromBytes, AsBytes, Unaligned, PartialEq, Debug, Default, Copy, Clone)]
38803894
#[repr(C, packed)]
38813895
pub struct MemDfeSearchElement20 {
@@ -4747,7 +4761,6 @@ Clone)]
47474761
}
47484762
}
47494763

4750-
// XXX: Not that useful.
47514764
impl Default for DdrDqPinMapElementLane {
47524765
fn default() -> Self {
47534766
Self { pins: [0, 1, 2, 3, 4, 5, 6, 7] }
@@ -4772,7 +4785,7 @@ Clone)]
47724785
#[derive(FromBytes, AsBytes, Unaligned, PartialEq, Debug, Copy, Clone)]
47734786
#[repr(C, packed)]
47744787
pub struct DdrDqPinMapElement {
4775-
lanes: [DdrDqPinMapElementLane; 8], // lanes[lane][bit] == pin
4788+
pub lanes: [DdrDqPinMapElementLane; 8], // lanes[lane][bit] == pin
47764789
}
47774790
}
47784791

@@ -4811,7 +4824,7 @@ Clone)]
48114824
#[derive(FromBytes, AsBytes, Unaligned, PartialEq, Debug, Copy, Clone)]
48124825
#[repr(C, packed)]
48134826
pub struct Ddr5CaPinMapElementLane {
4814-
pins: [u8; 14], // TODO: nicer pin type instead of u8; especially for 0xff "un"
4827+
pub pins: [u8; 14], // TODO: nicer pin type instead of u8; especially for 0xff "un"
48154828
}
48164829
}
48174830

@@ -4839,7 +4852,7 @@ Clone)]
48394852
#[derive(FromBytes, AsBytes, Unaligned, PartialEq, Debug, Default, Copy, Clone)]
48404853
#[repr(C, packed)]
48414854
pub struct Ddr5CaPinMapElement {
4842-
lanes: [Ddr5CaPinMapElementLane; 2], // pins[lane][bit] == pin; pin == 0xff means un?
4855+
pub lanes: [Ddr5CaPinMapElementLane; 2], // pins[lane][bit] == pin; pin == 0xff means un?
48434856
}
48444857
}
48454858

@@ -5259,13 +5272,13 @@ Clone)]
52595272
#[derive(FromBytes, AsBytes, Unaligned, PartialEq, Debug, Copy, Clone)]
52605273
#[repr(C, packed)]
52615274
pub struct MaxDimmsPerChannel6 {
5262-
type_ || #[serde(default = "MaxDimmsPerChannel::serde_default_tag")] SerdeHex8 : u8 | pub get u8 : pub set u8,
5263-
payload_size || #[serde(default = "MaxDimmsPerChannel::serde_default_payload_size")] SerdeHex8 : u8,
5275+
type_ || #[serde(default = "MaxDimmsPerChannel6::serde_default_tag")] SerdeHex8 : u8 | pub get u8 : pub set u8,
5276+
payload_size || #[serde(default = "MaxDimmsPerChannel6::serde_default_payload_size")] SerdeHex8 : u8,
52645277
sockets || SocketIds : u8 | pub get SocketIds : pub set SocketIds,
52655278
channels || ChannelIdsSelection12 : LU16 | pub get ChannelIdsSelection12 : pub set ChannelIdsSelection12,
52665279
dimms || DimmSlots : u8 | pub get DimmSlots : pub set DimmSlots, // Note: must always be "any"
52675280
value || SerdeHex8 : u8 | pub get u8 : pub set u8,
5268-
_padding_0: u8,
5281+
_padding_0 || #[serde(default)] SerdeHex8 : u8 | pub get u8 : pub set u8,
52695282
}
52705283
}
52715284
impl_EntryCompatible!(MaxDimmsPerChannel6, 4, 6);
@@ -6405,17 +6418,22 @@ pub mod fch {
64056418
io80_decoding_enabled || bool : BU8 | pub get bool : pub set bool,
64066419
io6064_decoding_enabled || bool : BU8 | pub get bool : pub set bool,
64076420

6408-
io_range_size || [SerdeHex8; 16] : [u8; 16], // | pub get [u8; 16] : pub set [u8; 16], // FIXME
6409-
io_range_base || [SerdeHex16; 16] : [LU16; 16], // | pub get [u16; 16] : pub set [u16; 16], // FIXME
6421+
/// The first entry is usually for IPMI.
6422+
/// The last two entries != 0 are the serial ports.
6423+
/// Use values 3 (32 bit) or 7 (64 bit).
6424+
io_range_size || [SerdeHex8; 16] : [u8; 16] | pub get [u8; 16] : pub set [u8; 16],
6425+
/// The first entry is usually for IPMI.
6426+
/// The last two entries != 0 are the serial ports.
6427+
io_range_base || [SerdeHex16; 16] : [LU16; 16] | pub get [u16; 16] : pub set [u16; 16],
64106428

6411-
mmio_range_size || [SerdeHex16; 5] : [LU16; 5], // | pub get [u16; 5] : pub set [u16; 5], // FIXME
6412-
mmio_range_base || [SerdeHex32; 5] : [LU32; 5], // | pub get [u32; 5] : pub set [u32; 5], // FIXME
6429+
mmio_range_size || [SerdeHex16; 5] : [LU16; 5] | pub get [u16; 5] : pub set [u16; 5],
6430+
mmio_range_base || [SerdeHex32; 5] : [LU32; 5] | pub get [u32; 5] : pub set [u32; 5],
64136431

64146432
irq_mask || SerdeHex32 : LU32, // | pub get LU32 : pub set u32, // FIXME bitmap
64156433
irq_polarity || SerdeHex32 : LU32, // | pub get LU32 : pub set u32, // FIXME bitmap
64166434

6417-
cputemp_rtctime_vw_enabled || bool : BU8, // | pub get bool : pub set bool,
6418-
cputemp_rtctime_vw_index_select || SerdeHex8 : u8, // | pub get u8 : pub set u8,
6435+
cputemp_rtctime_vw_enabled || bool : BU8 | pub get bool : pub set bool,
6436+
cputemp_rtctime_vw_index_select || SerdeHex8 : u8 | pub get u8 : pub set u8,
64196437

64206438
_dummy_1 : u8,
64216439
_dummy_2 : u8,
@@ -8506,10 +8524,10 @@ make_bitfield_serde! {
85068524
#[derive(Debug, Copy, Clone, PartialEq)]
85078525
pub struct FchConsoleOutSerialPortEspiControllerSelect {
85088526
pub espi_controller || EspiController : B1 | pub get EspiController : pub set EspiController,
8509-
pub _reserved_0 || SerdeHex8 : B2,
8527+
pub _reserved_0 || #[serde(default)] SerdeHex8 : B2,
85108528
pub io_2e_2f_disabled: bool | pub get bool : pub set bool,
85118529
pub io_4e_4f_disabled: bool | pub get bool : pub set bool,
8512-
pub _reserved_1 || SerdeHex8 : B3,
8530+
pub _reserved_1 || #[serde(default)] SerdeHex8 : B3,
85138531
}
85148532
}
85158533
impl_bitfield_primitive_conversion!(
@@ -8532,7 +8550,7 @@ make_bitfield_serde! {
85328550
pub algorithm_7: bool | pub get bool : pub set bool,
85338551
pub algorithm_8: bool | pub get bool : pub set bool,
85348552
pub algorithm_9: bool | pub get bool : pub set bool,
8535-
pub _reserved_0 || SerdeHex8 : B7,
8553+
pub _reserved_0 || #[serde(default)] SerdeHex8 : B7,
85368554
}
85378555
}
85388556
impl_bitfield_primitive_conversion!(

0 commit comments

Comments
 (0)