util/spd_tools/spd_gen/lp5: Encode Optional SDRAM features
ADL and Sabrina provide different advisories to encode Optional SDRAM features (byte indices 7 & 9). Encode those bytes as per the respective advisories. BUG=b:211510456 TEST=Generate the SPD binaries for Sabrina. Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Change-Id: Icac8ae148458162768a919d9690d7bf96734e6c0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61730 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Reka Norman <rekanorman@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
This commit is contained in:
committed by
Felix Held
parent
6c4135e636
commit
3248db0e5a
@ -1,4 +1,4 @@
|
|||||||
23 11 13 0E 15 1A 95 08 00 00 00 00 02 02 00 00
|
23 11 13 0E 15 1A 95 18 00 40 00 00 02 02 00 00
|
||||||
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
|
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
|
||||||
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
23 11 13 0E 15 1A B5 08 00 00 00 00 0A 02 00 00
|
23 11 13 0E 15 1A B5 18 00 40 00 00 0A 02 00 00
|
||||||
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
|
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
|
||||||
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
23 11 13 0E 16 22 95 08 00 00 00 00 02 02 00 00
|
23 11 13 0E 16 22 95 18 00 40 00 00 02 02 00 00
|
||||||
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 C0 08 60
|
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 C0 08 60
|
||||||
04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
@ -57,6 +57,8 @@ type LP5SPDAttribTableEntry struct {
|
|||||||
|
|
||||||
type LP5Set struct {
|
type LP5Set struct {
|
||||||
SPDRevision byte
|
SPDRevision byte
|
||||||
|
optionalFeatures byte
|
||||||
|
otherOptionalFeatures byte
|
||||||
busWidthEncoding byte
|
busWidthEncoding byte
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,6 +76,7 @@ const (
|
|||||||
LP5SPDIndexAddressing = 5
|
LP5SPDIndexAddressing = 5
|
||||||
LP5SPDIndexPackageType = 6
|
LP5SPDIndexPackageType = 6
|
||||||
LP5SPDIndexOptionalFeatures = 7
|
LP5SPDIndexOptionalFeatures = 7
|
||||||
|
LP5SPDIndexOtherOptionalFeatures = 9
|
||||||
LP5SPDIndexModuleOrganization = 12
|
LP5SPDIndexModuleOrganization = 12
|
||||||
LP5SPDIndexBusWidth = 13
|
LP5SPDIndexBusWidth = 13
|
||||||
LP5SPDIndexTimebases = 17
|
LP5SPDIndexTimebases = 17
|
||||||
@ -130,15 +133,6 @@ const (
|
|||||||
*/
|
*/
|
||||||
LP5SPDValueModuleType = 0x0e
|
LP5SPDValueModuleType = 0x0e
|
||||||
|
|
||||||
/*
|
|
||||||
* From JEDEC spec:
|
|
||||||
* 5:4 (Maximum Activate Window) = 00 (8192 * tREFI)
|
|
||||||
* 3:0 (Maximum Activate Count) = 1000 (Unlimited MAC)
|
|
||||||
* Set to 0x08.
|
|
||||||
*/
|
|
||||||
LP5SPDValueOptionalFeatures = 0x08
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From JEDEC spec:
|
* From JEDEC spec:
|
||||||
* 3:2 (MTB) = 00 (0.125ns)
|
* 3:2 (MTB) = 00 (0.125ns)
|
||||||
@ -184,6 +178,13 @@ var LP5PlatformSetMap = map[int][]int{
|
|||||||
var LP5SetInfo = map[int]LP5Set{
|
var LP5SetInfo = map[int]LP5Set{
|
||||||
0: {
|
0: {
|
||||||
SPDRevision: LP5SPDValueRevision1_0,
|
SPDRevision: LP5SPDValueRevision1_0,
|
||||||
|
/*
|
||||||
|
* From JEDEC spec:
|
||||||
|
* 5:4 (Maximum Activate Window) = 00 (8192 * tREFI)
|
||||||
|
* 3:0 (Maximum Activate Count) = 1000 (Unlimited MAC)
|
||||||
|
* Set to 0x08.
|
||||||
|
*/
|
||||||
|
optionalFeatures: 0x08,
|
||||||
/*
|
/*
|
||||||
* For ADL (as per advisory #616599):
|
* For ADL (as per advisory #616599):
|
||||||
* 7:5 (Number of system channels) = 000 (1 channel always)
|
* 7:5 (Number of system channels) = 000 (1 channel always)
|
||||||
@ -195,6 +196,19 @@ var LP5SetInfo = map[int]LP5Set{
|
|||||||
},
|
},
|
||||||
1: {
|
1: {
|
||||||
SPDRevision: LP5SPDValueRevision1_1,
|
SPDRevision: LP5SPDValueRevision1_1,
|
||||||
|
/*
|
||||||
|
* For Sabrina (as per advisory b/211510456):
|
||||||
|
* 5:4 (Maximum Activate Window) = 01 (4096 * tREFI)
|
||||||
|
* 3:0 (Maximum Activate Count) = 1000 (Unlimited MAC)
|
||||||
|
* Set to 0x18.
|
||||||
|
*/
|
||||||
|
optionalFeatures: 0x18,
|
||||||
|
/*
|
||||||
|
* For Sabrina (as per advisory b/211510456):
|
||||||
|
* 7:6 (PPR) = 1 (Post Package Repair is supported)
|
||||||
|
* Set to 0x40.
|
||||||
|
*/
|
||||||
|
otherOptionalFeatures: 0x40,
|
||||||
/*
|
/*
|
||||||
* For Sabrina (as per advisory b/211510456):
|
* For Sabrina (as per advisory b/211510456):
|
||||||
* 7:5 (Number of system channels) = 000 (1 channel always)
|
* 7:5 (Number of system channels) = 000 (1 channel always)
|
||||||
@ -306,31 +320,32 @@ var LP5SpeedMbpsToSPDEncoding = map[int]LP5SpeedParams{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var LP5SPDAttribTable = map[int]LP5SPDAttribTableEntry{
|
var LP5SPDAttribTable = map[int]LP5SPDAttribTableEntry{
|
||||||
LP5SPDIndexSize: {constVal: LP5SPDValueSize},
|
LP5SPDIndexSize: {constVal: LP5SPDValueSize},
|
||||||
LP5SPDIndexRevision: {getVal: LP5EncodeSPDRevision},
|
LP5SPDIndexRevision: {getVal: LP5EncodeSPDRevision},
|
||||||
LP5SPDIndexMemoryType: {constVal: LP5SPDValueMemoryType},
|
LP5SPDIndexMemoryType: {constVal: LP5SPDValueMemoryType},
|
||||||
LP5SPDIndexModuleType: {constVal: LP5SPDValueModuleType},
|
LP5SPDIndexModuleType: {constVal: LP5SPDValueModuleType},
|
||||||
LP5SPDIndexDensityBanks: {getVal: LP5EncodeDensityBanks},
|
LP5SPDIndexDensityBanks: {getVal: LP5EncodeDensityBanks},
|
||||||
LP5SPDIndexAddressing: {getVal: LP5EncodeSdramAddressing},
|
LP5SPDIndexAddressing: {getVal: LP5EncodeSdramAddressing},
|
||||||
LP5SPDIndexPackageType: {getVal: LP5EncodePackageType},
|
LP5SPDIndexPackageType: {getVal: LP5EncodePackageType},
|
||||||
LP5SPDIndexOptionalFeatures: {constVal: LP5SPDValueOptionalFeatures},
|
LP5SPDIndexOptionalFeatures: {getVal: LP5EncodeOptionalFeatures},
|
||||||
LP5SPDIndexModuleOrganization: {getVal: LP5EncodeModuleOrganization},
|
LP5SPDIndexOtherOptionalFeatures: {getVal: LP5EncodeOtherOptionalFeatures},
|
||||||
LP5SPDIndexBusWidth: {getVal: LP5EncodeBusWidth},
|
LP5SPDIndexModuleOrganization: {getVal: LP5EncodeModuleOrganization},
|
||||||
LP5SPDIndexTimebases: {constVal: LP5SPDValueTimebases},
|
LP5SPDIndexBusWidth: {getVal: LP5EncodeBusWidth},
|
||||||
LP5SPDIndexTCKMin: {getVal: LP5EncodeTCKMin},
|
LP5SPDIndexTimebases: {constVal: LP5SPDValueTimebases},
|
||||||
LP5SPDIndexTCKMinFineOffset: {getVal: LP5EncodeTCKMinFineOffset},
|
LP5SPDIndexTCKMin: {getVal: LP5EncodeTCKMin},
|
||||||
LP5SPDIndexTAAMin: {getVal: LP5EncodeTAAMin},
|
LP5SPDIndexTCKMinFineOffset: {getVal: LP5EncodeTCKMinFineOffset},
|
||||||
LP5SPDIndexTAAMinFineOffset: {getVal: LP5EncodeTAAMinFineOffset},
|
LP5SPDIndexTAAMin: {getVal: LP5EncodeTAAMin},
|
||||||
LP5SPDIndexTRCDMin: {getVal: LP5EncodeTRCDMin},
|
LP5SPDIndexTAAMinFineOffset: {getVal: LP5EncodeTAAMinFineOffset},
|
||||||
LP5SPDIndexTRCDMinFineOffset: {getVal: LP5EncodeTRCDMinFineOffset},
|
LP5SPDIndexTRCDMin: {getVal: LP5EncodeTRCDMin},
|
||||||
LP5SPDIndexTRPABMin: {getVal: LP5EncodeTRPABMin},
|
LP5SPDIndexTRCDMinFineOffset: {getVal: LP5EncodeTRCDMinFineOffset},
|
||||||
LP5SPDIndexTRPABMinFineOffset: {getVal: LP5EncodeTRPABMinFineOffset},
|
LP5SPDIndexTRPABMin: {getVal: LP5EncodeTRPABMin},
|
||||||
LP5SPDIndexTRPPBMin: {getVal: LP5EncodeTRPPBMin},
|
LP5SPDIndexTRPABMinFineOffset: {getVal: LP5EncodeTRPABMinFineOffset},
|
||||||
LP5SPDIndexTRPPBMinFineOffset: {getVal: LP5EncodeTRPPBMinFineOffset},
|
LP5SPDIndexTRPPBMin: {getVal: LP5EncodeTRPPBMin},
|
||||||
LP5SPDIndexTRFCABMinLSB: {getVal: LP5EncodeTRFCABMinLsb},
|
LP5SPDIndexTRPPBMinFineOffset: {getVal: LP5EncodeTRPPBMinFineOffset},
|
||||||
LP5SPDIndexTRFCABMinMSB: {getVal: LP5EncodeTRFCABMinMsb},
|
LP5SPDIndexTRFCABMinLSB: {getVal: LP5EncodeTRFCABMinLsb},
|
||||||
LP5SPDIndexTRFCPBMinLSB: {getVal: LP5EncodeTRFCPBMinLsb},
|
LP5SPDIndexTRFCABMinMSB: {getVal: LP5EncodeTRFCABMinMsb},
|
||||||
LP5SPDIndexTRFCPBMinMSB: {getVal: LP5EncodeTRFCPBMinMsb},
|
LP5SPDIndexTRFCPBMinLSB: {getVal: LP5EncodeTRFCPBMinLsb},
|
||||||
|
LP5SPDIndexTRFCPBMinMSB: {getVal: LP5EncodeTRFCPBMinMsb},
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------------------------ */
|
||||||
@ -418,6 +433,26 @@ func LP5EncodeModuleOrganization(memAttribs *LP5MemAttributes) byte {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func LP5EncodeOptionalFeatures(memAttribs *LP5MemAttributes) byte {
|
||||||
|
f, ok := LP5SetInfo[LP5CurrSet]
|
||||||
|
|
||||||
|
if ok == false {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return f.optionalFeatures
|
||||||
|
}
|
||||||
|
|
||||||
|
func LP5EncodeOtherOptionalFeatures(memAttribs *LP5MemAttributes) byte {
|
||||||
|
f, ok := LP5SetInfo[LP5CurrSet]
|
||||||
|
|
||||||
|
if ok == false {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return f.otherOptionalFeatures
|
||||||
|
}
|
||||||
|
|
||||||
func LP5EncodeBusWidth(memAttribs *LP5MemAttributes) byte {
|
func LP5EncodeBusWidth(memAttribs *LP5MemAttributes) byte {
|
||||||
f, ok := LP5SetInfo[LP5CurrSet]
|
f, ok := LP5SetInfo[LP5CurrSet]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user