util/autoport: Assign SPD addresses in devicetree

Commit 45e4ab4a66 (mb/*: Update SPD mapping for sandybridge boards)
changed the way in which SPD addresses are set up for SNB/IVB boards,
but autoport was not updated to reflect these changes. Result is:

    register "spd_addresses" = "{0x50, 0x51, 0x52, 0x53}" # FIXME: Put proper SPD map here"

The stray quote at the end is irritating, but is hard to get rid of
without substantial refactoring of autoport's guts. But, given that
this is a FIXME comment, anyone using autoport should just drop the
comment after verifying the SPD map, so it's not a big deal.

In addition, update the corresponding section of the README, which
was horrendously out-of-date.

Change-Id: I6ad38f53afc4fafb45be7f086723cc0782a965ed
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82405
Reviewed-by: Keith Hui <buurin@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Angel Pons
2024-05-13 19:09:29 +02:00
committed by Felix Held
parent 8da4d8840c
commit 496362d7e1
3 changed files with 46 additions and 60 deletions

View File

@@ -1,10 +1,19 @@
package main
import "fmt"
import "strings"
type sandybridgemc struct {
}
func MakeSPDMap(ctx Context) string {
var values []string
for _, addr := range GuessSPDMap(ctx) {
values = append(values, fmt.Sprintf("0x%02x", addr))
}
return "{"+strings.Join(values, ", ")+"}"
}
func (i sandybridgemc) Scan(ctx Context, addr PCIDevData) {
inteltool := ctx.InfoSource.GetInteltool()
@@ -33,6 +42,7 @@ func (i sandybridgemc) Scan(ctx Context, addr PCIDevData) {
"gpu_cpu_backlight": FormatHex32(inteltool.IGD[0x48254]),
"gpu_pch_backlight": FormatHex32((inteltool.IGD[0xc8254] >> 16) * 0x10001),
"gfx": fmt.Sprintf("GMA_STATIC_DISPLAYS(%d)", (inteltool.IGD[0xc6200] >> 12) & 1),
"spd_addresses": MakeSPDMap(ctx)+"\" # FIXME: Put proper SPD map here",
},
Children: []DevTreeNode{
{