2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #include <console/console.h>
16 #include <device/device.h>
17 #include <device/pci.h>
18 #include <device/pci_ids.h>
19 #include <device/pci_ops.h>
22 #include <soc/pci_devs.h>
23 #include <soc/northbridge.h>
24 #include <soc/southbridge.h>
25 #include <amdblocks/acpimmio.h>
26 #include <commonlib/helpers.h>
28 static void enable(struct device
*dev
)
30 const struct soc_amd_picasso_config
*cfg
;
31 const struct device
*nb_dev
= pcidev_path_on_root(GNB_DEVFN
);
35 pci_dev_enable_resources(dev
);
37 /* Set the proper I2S_PIN_CONFIG state */
38 if (!nb_dev
|| !nb_dev
->chip_info
)
41 cfg
= nb_dev
->chip_info
;
43 res
= dev
->resource_list
;
44 if (!res
|| !res
->base
) {
45 printk(BIOS_ERR
, "Error, unable to configure pin in %s\n", __func__
);
49 bar
= (uintptr_t)res
->base
;
50 write32((void *)(bar
+ ACP_I2S_PIN_CONFIG
), cfg
->acp_pin_cfg
);
52 if (cfg
->acp_pin_cfg
== I2S_PINS_I2S_TDM
)
53 sb_clk_output_48Mhz(); /* Internal connection to I2S */
56 static struct pci_operations lops_pci
= {
57 .set_subsystem
= pci_dev_set_subsystem
,
60 static struct device_operations acp_ops
= {
61 .read_resources
= pci_dev_read_resources
,
62 .set_resources
= pci_dev_set_resources
,
63 .enable_resources
= enable
,
67 static const struct pci_driver acp_driver __pci_driver
= {
69 .vendor
= PCI_VENDOR_ID_AMD
,
70 .device
= PCI_DEVICD_ID_AMD_PCO_ACP
,