summaryrefslogtreecommitdiff
path: root/src/southbridge/nvidia
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-02-03 08:05:55 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-02-16 23:14:02 +0100
commit413e3da8c039360079c0c6a93f28456d0d80ff76 (patch)
treea614af76dbe7e4d28a058378a6cff0d47409fe13 /src/southbridge/nvidia
parentfacf0b93615bb0b5680ef80dcf1680bec337d69f (diff)
nvidia/ck804: Fix redundant configuration defines
All code must agree on PCI enumeration for the CK804 device, define these only once. The definition in enable_usbdebug.c was different and was assumed incorrect. Change-Id: I7d25c145afbad41db81a6b9b4f3956ad50fcb9f2 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8339 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'src/southbridge/nvidia')
-rw-r--r--src/southbridge/nvidia/ck804/ac97.c2
-rw-r--r--src/southbridge/nvidia/ck804/bootblock.c7
-rw-r--r--src/southbridge/nvidia/ck804/chip.h2
-rw-r--r--src/southbridge/nvidia/ck804/ck804.c4
-rw-r--r--src/southbridge/nvidia/ck804/ck804.h14
-rw-r--r--src/southbridge/nvidia/ck804/early_setup.c21
-rw-r--r--src/southbridge/nvidia/ck804/early_setup_car.c14
-rw-r--r--src/southbridge/nvidia/ck804/enable_usbdebug.c6
-rw-r--r--src/southbridge/nvidia/ck804/ht.c2
-rw-r--r--src/southbridge/nvidia/ck804/ide.c2
-rw-r--r--src/southbridge/nvidia/ck804/lpc.c2
-rw-r--r--src/southbridge/nvidia/ck804/nic.c2
-rw-r--r--src/southbridge/nvidia/ck804/pci.c2
-rw-r--r--src/southbridge/nvidia/ck804/pcie.c2
-rw-r--r--src/southbridge/nvidia/ck804/sata.c2
-rw-r--r--src/southbridge/nvidia/ck804/smbus.c2
-rw-r--r--src/southbridge/nvidia/ck804/usb.c2
-rw-r--r--src/southbridge/nvidia/ck804/usb2.c2
18 files changed, 30 insertions, 60 deletions
diff --git a/src/southbridge/nvidia/ck804/ac97.c b/src/southbridge/nvidia/ck804/ac97.c
index 8b0e0bb1e2..f7feb4eb1c 100644
--- a/src/southbridge/nvidia/ck804/ac97.c
+++ b/src/southbridge/nvidia/ck804/ac97.c
@@ -23,7 +23,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
static struct device_operations ac97audio_ops = {
.read_resources = pci_dev_read_resources,
diff --git a/src/southbridge/nvidia/ck804/bootblock.c b/src/southbridge/nvidia/ck804/bootblock.c
index 6e68404d64..39584f198a 100644
--- a/src/southbridge/nvidia/ck804/bootblock.c
+++ b/src/southbridge/nvidia/ck804/bootblock.c
@@ -19,12 +19,7 @@
*/
#include <arch/io.h>
-
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
-#else
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
-#endif
+#include "ck804.h"
static void ck804_enable_rom(void)
{
diff --git a/src/southbridge/nvidia/ck804/chip.h b/src/southbridge/nvidia/ck804/chip.h
index 2d839aab5d..3d81a2f06f 100644
--- a/src/southbridge/nvidia/ck804/chip.h
+++ b/src/southbridge/nvidia/ck804/chip.h
@@ -31,4 +31,6 @@ struct southbridge_nvidia_ck804_config {
unsigned int mac_eeprom_addr;
};
+extern struct pci_operations ck804_pci_ops;
+
#endif
diff --git a/src/southbridge/nvidia/ck804/ck804.c b/src/southbridge/nvidia/ck804/ck804.c
index 353a4bda82..2258ddab00 100644
--- a/src/southbridge/nvidia/ck804/ck804.c
+++ b/src/southbridge/nvidia/ck804/ck804.c
@@ -24,7 +24,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
static u32 final_reg;
@@ -57,7 +57,7 @@ static device_t find_lpc_dev(device_t dev, unsigned devfn)
return lpc_dev;
}
-void ck804_enable(device_t dev)
+static void ck804_enable(device_t dev)
{
device_t lpc_dev;
unsigned index = 0, index2 = 0, deviceid, vendorid, devfn;
diff --git a/src/southbridge/nvidia/ck804/ck804.h b/src/southbridge/nvidia/ck804/ck804.h
index 7ec57a4d2f..f26c56309b 100644
--- a/src/southbridge/nvidia/ck804/ck804.h
+++ b/src/southbridge/nvidia/ck804/ck804.h
@@ -21,10 +21,18 @@
#ifndef SOUTHBRIDGE_NVIDIA_CK804_CK804_H
#define SOUTHBRIDGE_NVIDIA_CK804_CK804_H
-#include "chip.h"
+#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
+#define CK804_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
+#else
+#define CK804_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
+#endif
-void ck804_enable(device_t dev);
+#define CK804B_BUSN 0x80
+#define CK804B_DEVN_BASE (!CONFIG_SB_HT_CHAIN_UNITID_OFFSET_ONLY ? CK804_DEVN_BASE : 1)
-extern struct pci_operations ck804_pci_ops;
+#if CONFIG_CK804_NUM > 1
+#define CK804B_ANACTRL_IO_BASE (ANACTRL_IO_BASE + 0x8000)
+#define CK804B_SYSCTRL_IO_BASE (SYSCTRL_IO_BASE + 0x8000)
+#endif
#endif
diff --git a/src/southbridge/nvidia/ck804/early_setup.c b/src/southbridge/nvidia/ck804/early_setup.c
index ecbf219597..b93c07c9fb 100644
--- a/src/southbridge/nvidia/ck804/early_setup.c
+++ b/src/southbridge/nvidia/ck804/early_setup.c
@@ -19,6 +19,7 @@
*/
#include <reset.h>
+#include "ck804.h"
static int set_ht_link_ck804(u8 ht_c_num)
{
@@ -66,28 +67,8 @@ static void setup_ss_table(unsigned index, unsigned where, unsigned control,
* 16 4 :4
*/
-#if CONFIG_CK804_NUM > 1
-#define CK804B_ANACTRL_IO_BASE (ANACTRL_IO_BASE + 0x8000)
-#define CK804B_SYSCTRL_IO_BASE (SYSCTRL_IO_BASE + 0x8000)
-#ifndef CK804B_BUSN
-#define CK804B_BUSN 0x80
-#endif
-#endif
-
#define CK804_CHIP_REV 3
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
-#else
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
-#endif
-
-#if CONFIG_SB_HT_CHAIN_UNITID_OFFSET_ONLY
-#define CK804B_DEVN_BASE 1
-#else
-#define CK804B_DEVN_BASE CK804_DEVN_BASE
-#endif
-
static void ck804_early_set_port(void)
{
static const unsigned int ctrl_devport_conf[] = {
diff --git a/src/southbridge/nvidia/ck804/early_setup_car.c b/src/southbridge/nvidia/ck804/early_setup_car.c
index 6044e3d424..2df3434c7f 100644
--- a/src/southbridge/nvidia/ck804/early_setup_car.c
+++ b/src/southbridge/nvidia/ck804/early_setup_car.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "ck804.h"
+
#if !IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDK8)
/* Someone messed up and snuck in some K8-specific code */
static int set_ht_link_buffer_counts_chain(uint8_t ht_c_num, unsigned vendorid, unsigned val) { return 0; /* stub */};
@@ -73,18 +75,6 @@ static void setup_ss_table(unsigned index, unsigned where, unsigned control,
#define CK804_CHIP_REV 3
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
-#else
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
-#endif
-
-#if CONFIG_SB_HT_CHAIN_UNITID_OFFSET_ONLY
-#define CK804B_DEVN_BASE 1
-#else
-#define CK804B_DEVN_BASE CK804_DEVN_BASE
-#endif
-
static void ck804_early_set_port(unsigned ck804_num, unsigned *busn,
unsigned *io_base)
{
diff --git a/src/southbridge/nvidia/ck804/enable_usbdebug.c b/src/southbridge/nvidia/ck804/enable_usbdebug.c
index 97e8ecbccd..8673001962 100644
--- a/src/southbridge/nvidia/ck804/enable_usbdebug.c
+++ b/src/southbridge/nvidia/ck804/enable_usbdebug.c
@@ -30,12 +30,6 @@
#include <device/pci_def.h>
#include "ck804.h"
-#if CONFIG_HT_CHAIN_END_UNITID_BASE != 0x20
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
-#else
-#define CK804_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
-#endif
-
pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx)
{
return PCI_DEV(0, CK804_DEVN_BASE + 2, 1); /* USB EHCI */
diff --git a/src/southbridge/nvidia/ck804/ht.c b/src/southbridge/nvidia/ck804/ht.c
index f5ea2498c7..83b29b1218 100644
--- a/src/southbridge/nvidia/ck804/ht.c
+++ b/src/southbridge/nvidia/ck804/ht.c
@@ -23,8 +23,8 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
#include <arch/acpi.h>
+#include "chip.h"
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
diff --git a/src/southbridge/nvidia/ck804/ide.c b/src/southbridge/nvidia/ck804/ide.c
index 5b0ba51312..e9791a55d6 100644
--- a/src/southbridge/nvidia/ck804/ide.c
+++ b/src/southbridge/nvidia/ck804/ide.c
@@ -23,7 +23,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
static void ide_init(struct device *dev)
{
diff --git a/src/southbridge/nvidia/ck804/lpc.c b/src/southbridge/nvidia/ck804/lpc.c
index 37baf994bc..50881086a5 100644
--- a/src/southbridge/nvidia/ck804/lpc.c
+++ b/src/southbridge/nvidia/ck804/lpc.c
@@ -36,7 +36,7 @@
#include <stdlib.h>
#include <assert.h>
#include <cpu/amd/powernow.h>
-#include "ck804.h"
+#include "chip.h"
#define CK804_CHIP_REV 2
diff --git a/src/southbridge/nvidia/ck804/nic.c b/src/southbridge/nvidia/ck804/nic.c
index 974ce0d4de..26a596d0e5 100644
--- a/src/southbridge/nvidia/ck804/nic.c
+++ b/src/southbridge/nvidia/ck804/nic.c
@@ -25,7 +25,7 @@
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <arch/io.h>
-#include "ck804.h"
+#include "chip.h"
static void nic_init(struct device *dev)
{
diff --git a/src/southbridge/nvidia/ck804/pci.c b/src/southbridge/nvidia/ck804/pci.c
index 92579800cc..94cfdb1356 100644
--- a/src/southbridge/nvidia/ck804/pci.c
+++ b/src/southbridge/nvidia/ck804/pci.c
@@ -24,7 +24,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
static void pci_init(struct device *dev)
{
diff --git a/src/southbridge/nvidia/ck804/pcie.c b/src/southbridge/nvidia/ck804/pcie.c
index 5e1c44970b..ef7707a362 100644
--- a/src/southbridge/nvidia/ck804/pcie.c
+++ b/src/southbridge/nvidia/ck804/pcie.c
@@ -23,7 +23,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
static void pcie_init(struct device *dev)
{
diff --git a/src/southbridge/nvidia/ck804/sata.c b/src/southbridge/nvidia/ck804/sata.c
index bcf42001be..8943520098 100644
--- a/src/southbridge/nvidia/ck804/sata.c
+++ b/src/southbridge/nvidia/ck804/sata.c
@@ -24,7 +24,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
#ifndef CK804_SATA_RESET_FOR_ATAPI
#define CK804_SATA_RESET_FOR_ATAPI 0
diff --git a/src/southbridge/nvidia/ck804/smbus.c b/src/southbridge/nvidia/ck804/smbus.c
index dd6a5f419f..ac0f9e5dd7 100644
--- a/src/southbridge/nvidia/ck804/smbus.c
+++ b/src/southbridge/nvidia/ck804/smbus.c
@@ -25,7 +25,7 @@
#include <device/pci_ops.h>
#include <device/smbus.h>
#include <arch/io.h>
-#include "ck804.h"
+#include "chip.h"
#include "smbus.h"
static int lsmbus_recv_byte(device_t dev)
diff --git a/src/southbridge/nvidia/ck804/usb.c b/src/southbridge/nvidia/ck804/usb.c
index 046028b139..ed67c33b2a 100644
--- a/src/southbridge/nvidia/ck804/usb.c
+++ b/src/southbridge/nvidia/ck804/usb.c
@@ -23,7 +23,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
static void usb1_init(struct device *dev)
{
diff --git a/src/southbridge/nvidia/ck804/usb2.c b/src/southbridge/nvidia/ck804/usb2.c
index 05632a2011..0597aac6c1 100644
--- a/src/southbridge/nvidia/ck804/usb2.c
+++ b/src/southbridge/nvidia/ck804/usb2.c
@@ -23,7 +23,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
-#include "ck804.h"
+#include "chip.h"
static void usb2_init(struct device *dev)
{