diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2015-02-03 08:05:55 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2015-02-16 23:14:02 +0100 |
commit | 413e3da8c039360079c0c6a93f28456d0d80ff76 (patch) | |
tree | a614af76dbe7e4d28a058378a6cff0d47409fe13 /src/southbridge/nvidia | |
parent | facf0b93615bb0b5680ef80dcf1680bec337d69f (diff) | |
download | coreboot-staging-413e3da8c039360079c0c6a93f28456d0d80ff76.zip coreboot-staging-413e3da8c039360079c0c6a93f28456d0d80ff76.tar.gz |
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.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/bootblock.c | 7 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/chip.h | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/ck804.c | 4 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/ck804.h | 14 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/early_setup.c | 21 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/early_setup_car.c | 14 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/enable_usbdebug.c | 6 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/ht.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/ide.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/lpc.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/nic.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/pci.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/pcie.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/sata.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/smbus.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/usb.c | 2 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/usb2.c | 2 |
18 files changed, 30 insertions, 60 deletions
diff --git a/src/southbridge/nvidia/ck804/ac97.c b/src/southbridge/nvidia/ck804/ac97.c index 8b0e0bb..f7feb4e 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 6e68404..39584f1 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 2d839aa..3d81a2f 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 353a4bd..2258dda 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 7ec57a4..f26c563 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 ecbf219..b93c07c 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 6044e3d..2df3434 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 97e8ecb..8673001 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 f5ea249..83b29b1 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 5b0ba51..e9791a5 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 37baf99..5088108 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 974ce0d..26a596d 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 9257980..94cfdb1 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 5e1c449..ef7707a 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 bcf4200..8943520 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 dd6a5f4..ac0f9e5 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 046028b..ed67c33 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 05632a2..0597aac 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) { |