mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-20 17:08:52 +09:00
![Simon Glass](/assets/img/avatar_default.png)
The SATA indexed register write functions are common to several Intel PCHs. Move this into a common location. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
26 lines
486 B
C
26 lines
486 B
C
/*
|
|
* Copyright (c) 2016 Google, Inc
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <asm/pch_common.h>
|
|
|
|
u32 pch_common_sir_read(struct udevice *dev, int idx)
|
|
{
|
|
u32 data;
|
|
|
|
dm_pci_write_config32(dev, SATA_SIRI, idx);
|
|
dm_pci_read_config32(dev, SATA_SIRD, &data);
|
|
|
|
return data;
|
|
}
|
|
|
|
void pch_common_sir_write(struct udevice *dev, int idx, u32 value)
|
|
{
|
|
dm_pci_write_config32(dev, SATA_SIRI, idx);
|
|
dm_pci_write_config32(dev, SATA_SIRD, value);
|
|
}
|