xref: /openbmc/u-boot/arch/x86/cpu/intel_common/pch.c (revision 1a68faac)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2016 Google, Inc
4  */
5 
6 #include <common.h>
7 #include <dm.h>
8 #include <asm/pch_common.h>
9 
10 u32 pch_common_sir_read(struct udevice *dev, int idx)
11 {
12 	u32 data;
13 
14 	dm_pci_write_config32(dev, SATA_SIRI, idx);
15 	dm_pci_read_config32(dev, SATA_SIRD, &data);
16 
17 	return data;
18 }
19 
20 void pch_common_sir_write(struct udevice *dev, int idx, u32 value)
21 {
22 	dm_pci_write_config32(dev, SATA_SIRI, idx);
23 	dm_pci_write_config32(dev, SATA_SIRD, value);
24 }
25