blob: af82b64a13c75032076efe3ea385da3e9350f12b [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Simon Glass7e4a6ae2016-03-16 07:44:36 -06002/*
3 * Copyright (c) 2016 Google, Inc
Simon Glass7e4a6ae2016-03-16 07:44:36 -06004 */
5
6#include <common.h>
7#include <dm.h>
8#include <asm/pch_common.h>
9
10u32 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
20void 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}