blob: e9110643f40e4ef5fabcea34314ccdf08228e61a [file] [log] [blame]
Angel Pons4b429832020-04-02 23:48:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Patrick Georgi2efc8802012-11-06 11:03:53 +01002
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +02003#include <device/pci_ops.h>
Angel Pons2f30e8c2020-09-16 13:29:21 +02004#include <southbridge/intel/i82801ix/i82801ix.h>
Patrick Georgi2efc8802012-11-06 11:03:53 +01005#include "gm45.h"
6
7void gm45_early_init(void)
8{
Furquan Shaikh25f75b22016-08-29 22:51:41 -07009 const pci_devfn_t d0f0 = PCI_DEV(0, 0, 0);
Patrick Georgi2efc8802012-11-06 11:03:53 +010010
Patrick Georgi2efc8802012-11-06 11:03:53 +010011 /* Setup MCHBAR. */
Angel Ponsf462b3d2021-01-20 00:36:31 +010012 pci_write_config32(d0f0, D0F0_MCHBAR_LO, CONFIG_FIXED_MCHBAR_MMIO_BASE | 1);
Patrick Georgi2efc8802012-11-06 11:03:53 +010013
14 /* Setup DMIBAR. */
Angel Ponsf462b3d2021-01-20 00:36:31 +010015 pci_write_config32(d0f0, D0F0_DMIBAR_LO, CONFIG_FIXED_DMIBAR_MMIO_BASE | 1);
Patrick Georgi2efc8802012-11-06 11:03:53 +010016
17 /* Setup EPBAR. */
Angel Ponsf462b3d2021-01-20 00:36:31 +010018 pci_write_config32(d0f0, D0F0_EPBAR_LO, CONFIG_FIXED_EPBAR_MMIO_BASE | 1);
Patrick Georgi2efc8802012-11-06 11:03:53 +010019
20 pci_write_config32(d0f0, D0F0_PMBASE, DEFAULT_PMBASE | 1);
21
22 /* Set C0000-FFFFF to access RAM on both reads and writes */
23 pci_write_config8(d0f0, D0F0_PAM(0), 0x30);
24 pci_write_config8(d0f0, D0F0_PAM(1), 0x33);
25 pci_write_config8(d0f0, D0F0_PAM(2), 0x33);
26 pci_write_config8(d0f0, D0F0_PAM(3), 0x33);
27 pci_write_config8(d0f0, D0F0_PAM(4), 0x33);
28 pci_write_config8(d0f0, D0F0_PAM(5), 0x33);
29 pci_write_config8(d0f0, D0F0_PAM(6), 0x33);
30}