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