xref: /OK3568_Linux_fs/u-boot/arch/x86/cpu/intel_common/pch.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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 
pch_common_sir_read(struct udevice * dev,int idx)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 
pch_common_sir_write(struct udevice * dev,int idx,u32 value)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