blob: c4cc478b3064e0f8035f8f2792ec070c679a4d2c [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Simon Glass9c852d72016-03-16 07:44:36 -06002/*
3 * Copyright (c) 2016 Google, Inc
Simon Glass9c852d72016-03-16 07:44:36 -06004 */
5
Simon Glass9c852d72016-03-16 07:44:36 -06006#include <dm.h>
7#include <asm/pch_common.h>
8
9u32 pch_common_sir_read(struct udevice *dev, int idx)
10{
11 u32 data;
12
13 dm_pci_write_config32(dev, SATA_SIRI, idx);
14 dm_pci_read_config32(dev, SATA_SIRD, &data);
15
16 return data;
17}
18
19void pch_common_sir_write(struct udevice *dev, int idx, u32 value)
20{
21 dm_pci_write_config32(dev, SATA_SIRI, idx);
22 dm_pci_write_config32(dev, SATA_SIRD, value);
23}