diff options
| author | Nicholas Chin <nic.c3.14@gmail.com> | 2024-03-18 10:45:05 -0600 | 
|---|---|---|
| committer | Nicholas Chin <nic.c3.14@gmail.com> | 2024-03-18 10:45:05 -0600 | 
| commit | 8cba237086dfbb312a5913bb75eef4f6046aeae5 (patch) | |
| tree | a208e8ff3e8b628b1615918cbb55b6ce351cfe54 /util/autoport/rce823.go | |
| parent | c578fe56c36f94af5c51a1be27a1a1c4b57a4289 (diff) | |
util: Import autoport with Haswell patches
This is a copy of coreboot's autoport utility, with a patch applied to
support Haswell/Lynx Point platforms. That patch is currently in review
on coreboot's Gerrit.
https://review.coreboot.org/c/coreboot/+/30890
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Diffstat (limited to 'util/autoport/rce823.go')
| -rw-r--r-- | util/autoport/rce823.go | 39 | 
1 files changed, 39 insertions, 0 deletions
| diff --git a/util/autoport/rce823.go b/util/autoport/rce823.go new file mode 100644 index 00000000..7c921093 --- /dev/null +++ b/util/autoport/rce823.go @@ -0,0 +1,39 @@ +package main + +import "fmt" + +type rce823 struct { +	variant string +} + +func (r rce823) Scan(ctx Context, addr PCIDevData) { +	if addr.Dev == 0 && addr.Func == 0 { +		cur := DevTreeNode{ +			Chip:    "drivers/ricoh/rce822", +			Comment: "Ricoh cardreader", +			Registers: map[string]string{ + +				"sdwppol":      fmt.Sprintf("%d", (addr.ConfigDump[0xfb]&2)>>1), +				"disable_mask": fmt.Sprintf("0x%x", addr.ConfigDump[0xcb]), +			}, +			PCISlots: []PCISlot{ +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 0}, writeEmpty: false}, +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 1}, writeEmpty: false}, +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 2}, writeEmpty: false}, +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 3}, writeEmpty: false}, +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 4}, writeEmpty: false}, +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 5}, writeEmpty: false}, +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 6}, writeEmpty: false}, +				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 7}, writeEmpty: false}, +			}, +		} +		PutPCIChip(addr, cur) +	} +	PutPCIDev(addr, "Ricoh SD card reader") +	KconfigBool["DRIVERS_RICOH_RCE822"] = true +} + +func init() { +	RegisterPCI(0x1180, 0xe822, rce823{}) +	RegisterPCI(0x1180, 0xe823, rce823{}) +} | 
