blob: 8174623847f8873ad04b67f1c3c56131480b5a63 [file] [log] [blame]
Patrick Georgie72a8a32012-11-06 11:05:09 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Sven Schnelle <svens@stackframe.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Patrick Georgie72a8a32012-11-06 11:05:09 +010014 */
15
16#include <arch/io.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +020017#include <device/pci_ops.h>
Patrick Georgie72a8a32012-11-06 11:05:09 +010018
19static void enable_spi_prefetch(void)
20{
Elyes HAOUASba28e8d2016-08-31 19:22:16 +020021 u8 reg8;
22 pci_devfn_t dev;
Patrick Georgie72a8a32012-11-06 11:05:09 +010023
Elyes HAOUASba28e8d2016-08-31 19:22:16 +020024 dev = PCI_DEV(0, 0x1f, 0);
Patrick Georgie72a8a32012-11-06 11:05:09 +010025
Elyes HAOUASba28e8d2016-08-31 19:22:16 +020026 reg8 = pci_read_config8(dev, 0xdc);
27 reg8 &= ~(3 << 2);
28 reg8 |= (2 << 2); /* Prefetching and Caching Enabled */
29 pci_write_config8(dev, 0xdc, reg8);
Patrick Georgie72a8a32012-11-06 11:05:09 +010030}
31
32static void bootblock_southbridge_init(void)
33{
Elyes HAOUASba28e8d2016-08-31 19:22:16 +020034 enable_spi_prefetch();
Patrick Georgie72a8a32012-11-06 11:05:09 +010035}