xref: /openbmc/u-boot/drivers/pch/pch9.c (revision 3e389d8b)
1 /*
2  * Copyright (C) 2014 Google, Inc
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include <dm.h>
9 #include <pch.h>
10 
11 #define SBASE_ADDR	0x54
12 
13 static int pch9_get_spi_base(struct udevice *dev, ulong *sbasep)
14 {
15 	uint32_t sbase_addr;
16 
17 	dm_pci_read_config32(dev, SBASE_ADDR, &sbase_addr);
18 	*sbasep = sbase_addr & 0xfffffe00;
19 
20 	return 0;
21 }
22 
23 static const struct pch_ops pch9_ops = {
24 	.get_spi_base	= pch9_get_spi_base,
25 };
26 
27 static const struct udevice_id pch9_ids[] = {
28 	{ .compatible = "intel,pch9" },
29 	{ }
30 };
31 
32 U_BOOT_DRIVER(pch9_drv) = {
33 	.name		= "intel-pch9",
34 	.id		= UCLASS_PCH,
35 	.of_match	= pch9_ids,
36 	.ops		= &pch9_ops,
37 };
38