blob: 6e3ea2c7a393c6e4f5fe5e7fc73b2d7cd4aed94a [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
3#include <stdint.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +02004#include <device/pci_ops.h>
Angel Pons2f30e8c2020-09-16 13:29:21 +02005#include <southbridge/intel/i82801ix/i82801ix.h>
Patrick Georgi2efc8802012-11-06 11:03:53 +01006#include "gm45.h"
7
8void gm45_early_init(void)
9{
Furquan Shaikh25f75b22016-08-29 22:51:41 -070010 const pci_devfn_t d0f0 = PCI_DEV(0, 0, 0);
Patrick Georgi2efc8802012-11-06 11:03:53 +010011
Patrick Georgi2efc8802012-11-06 11:03:53 +010012 /* Setup MCHBAR. */
Angel Ponsf462b3d2021-01-20 00:36:31 +010013 pci_write_config32(d0f0, D0F0_MCHBAR_LO, CONFIG_FIXED_MCHBAR_MMIO_BASE | 1);
Patrick Georgi2efc8802012-11-06 11:03:53 +010014
15 /* Setup DMIBAR. */
Angel Ponsf462b3d2021-01-20 00:36:31 +010016 pci_write_config32(d0f0, D0F0_DMIBAR_LO, CONFIG_FIXED_DMIBAR_MMIO_BASE | 1);
Patrick Georgi2efc8802012-11-06 11:03:53 +010017
18 /* Setup EPBAR. */
Angel Ponsf462b3d2021-01-20 00:36:31 +010019 pci_write_config32(d0f0, D0F0_EPBAR_LO, CONFIG_FIXED_EPBAR_MMIO_BASE | 1);
Patrick Georgi2efc8802012-11-06 11:03:53 +010020
21 pci_write_config32(d0f0, D0F0_PMBASE, DEFAULT_PMBASE | 1);
22
23 /* Set C0000-FFFFF to access RAM on both reads and writes */
24 pci_write_config8(d0f0, D0F0_PAM(0), 0x30);
25 pci_write_config8(d0f0, D0F0_PAM(1), 0x33);
26 pci_write_config8(d0f0, D0F0_PAM(2), 0x33);
27 pci_write_config8(d0f0, D0F0_PAM(3), 0x33);
28 pci_write_config8(d0f0, D0F0_PAM(4), 0x33);
29 pci_write_config8(d0f0, D0F0_PAM(5), 0x33);
30 pci_write_config8(d0f0, D0F0_PAM(6), 0x33);
31}