summaryrefslogtreecommitdiff
path: root/src/northbridge/intel
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2012-04-18 21:13:33 +0300
committerPatrick Georgi <patrick@georgi-clan.de>2012-04-21 09:39:27 +0200
commit93b4ed91f6b1027c370da9bdd6d86664dcda671b (patch)
tree2179e83c8bd8e3c6c361331af75275aa4dc45e00 /src/northbridge/intel
parent97c064f0346874dcf02d4b2700a7e7c7913b24c9 (diff)
Intel e7505: build as separate object file
No longer include northbridge files directly in the source for mainboard romstage.c and fix includes. Also make required adjustments to function declarations. Change-Id: Iafdcc0766ed44c64cc628e5935eef2c6372f5f22 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/906 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/northbridge/intel')
-rw-r--r--src/northbridge/intel/e7505/Makefile.inc2
-rw-r--r--src/northbridge/intel/e7505/debug.c42
-rw-r--r--src/northbridge/intel/e7505/debug.h15
-rw-r--r--src/northbridge/intel/e7505/raminit.c15
-rw-r--r--src/northbridge/intel/e7505/raminit.h5
5 files changed, 61 insertions, 18 deletions
diff --git a/src/northbridge/intel/e7505/Makefile.inc b/src/northbridge/intel/e7505/Makefile.inc
index 23eada5ad3..8c50e404b2 100644
--- a/src/northbridge/intel/e7505/Makefile.inc
+++ b/src/northbridge/intel/e7505/Makefile.inc
@@ -1 +1,3 @@
ramstage-y += northbridge.c
+romstage-y += raminit.c
+romstage-y += debug.c
diff --git a/src/northbridge/intel/e7505/debug.c b/src/northbridge/intel/e7505/debug.c
index 07f15968e5..87569a5981 100644
--- a/src/northbridge/intel/e7505/debug.c
+++ b/src/northbridge/intel/e7505/debug.c
@@ -1,9 +1,20 @@
+
+#include <device/pci_def.h>
+#include <console/console.h>
+#include <stdlib.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
+#include <spd.h>
+
+#include "raminit.h"
+#include "debug.h"
+
/*
* generic debug code, used by mainboard specific romstage.c
*
*/
-#if 1
-static void print_debug_pci_dev(unsigned dev)
+
+void print_debug_pci_dev(unsigned dev)
{
print_debug("PCI: ");
print_debug_hex8((dev >> 16) & 0xff);
@@ -13,7 +24,7 @@ static void print_debug_pci_dev(unsigned dev)
print_debug_hex8((dev >> 8) & 7);
}
-static inline void print_pci_devices(void)
+void print_pci_devices(void)
{
device_t dev;
for(dev = PCI_DEV(0, 0, 0);
@@ -31,7 +42,7 @@ static inline void print_pci_devices(void)
}
}
-static void dump_pci_device(unsigned dev)
+void dump_pci_device(unsigned dev)
{
int i;
print_debug_pci_dev(dev);
@@ -58,7 +69,7 @@ static void dump_pci_device(unsigned dev)
print_debug("\n");
}
-static inline void dump_pci_devices(void)
+void dump_pci_devices(void)
{
device_t dev;
for(dev = PCI_DEV(0, 0, 0);
@@ -75,7 +86,7 @@ static inline void dump_pci_devices(void)
}
}
-static inline void dump_pci_devices_on_bus(unsigned busn)
+void dump_pci_devices_on_bus(unsigned busn)
{
device_t dev;
for(dev = PCI_DEV(busn, 0, 0);
@@ -92,7 +103,7 @@ static inline void dump_pci_devices_on_bus(unsigned busn)
}
}
-static inline void dump_spd_registers(const struct mem_controller *ctrl)
+void dump_spd_registers(const struct mem_controller *ctrl)
{
int i;
print_debug("\n");
@@ -121,7 +132,7 @@ static inline void dump_spd_registers(const struct mem_controller *ctrl)
print_debug(": ");
#endif
}
- status = smbus_read_byte(device, j);
+ status = spd_read_byte(device, j);
if (status < 0) {
break;
}
@@ -158,7 +169,7 @@ static inline void dump_spd_registers(const struct mem_controller *ctrl)
print_debug(": ");
#endif
}
- status = smbus_read_byte(device, j);
+ status = spd_read_byte(device, j);
if (status < 0) {
break;
}
@@ -174,13 +185,13 @@ static inline void dump_spd_registers(const struct mem_controller *ctrl)
}
}
}
-static inline void dump_smbus_registers(void)
+void dump_smbus_registers(void)
{
unsigned device;
print_debug("\n");
for(device = 1; device < 0x80; device++) {
int j;
- if( smbus_read_byte(device, 0) < 0 ) continue;
+ if( spd_read_byte(device, 0) < 0 ) continue;
#if !defined(__ROMCC__)
printk(BIOS_DEBUG, "smbus: %02x", device);
#else
@@ -190,7 +201,7 @@ static inline void dump_smbus_registers(void)
for(j = 0; j < 256; j++) {
int status;
unsigned char byte;
- status = smbus_read_byte(device, j);
+ status = spd_read_byte(device, j);
if (status < 0) {
break;
}
@@ -215,7 +226,7 @@ static inline void dump_smbus_registers(void)
}
}
-static inline void dump_io_resources(unsigned port)
+void dump_io_resources(unsigned port)
{
int i;
@@ -249,7 +260,7 @@ static inline void dump_io_resources(unsigned port)
}
}
-static inline void dump_mem(unsigned start, unsigned end)
+void dump_mem(unsigned start, unsigned end)
{
unsigned i;
print_debug("dump_mem:");
@@ -271,5 +282,4 @@ static inline void dump_mem(unsigned start, unsigned end)
#endif
}
print_debug("\n");
- }
-#endif
+}
diff --git a/src/northbridge/intel/e7505/debug.h b/src/northbridge/intel/e7505/debug.h
new file mode 100644
index 0000000000..a517fc0c2d
--- /dev/null
+++ b/src/northbridge/intel/e7505/debug.h
@@ -0,0 +1,15 @@
+#ifndef E7505_DEBUG_H
+#define E7505_DEBUG_H
+
+void print_debug_pci_dev(unsigned dev);
+void print_pci_devices(void);
+void dump_pci_device(unsigned dev);
+void dump_pci_devices(void);
+void dump_pci_devices_on_bus(unsigned busn);
+void dump_spd_registers(const struct mem_controller *ctrl);
+void dump_smbus_registers(void);
+void dump_io_resources(unsigned port);
+void dump_mem(unsigned start, unsigned end);
+
+#endif
+
diff --git a/src/northbridge/intel/e7505/raminit.c b/src/northbridge/intel/e7505/raminit.c
index 1d10a8cd73..fd4e2d051d 100644
--- a/src/northbridge/intel/e7505/raminit.c
+++ b/src/northbridge/intel/e7505/raminit.c
@@ -11,14 +11,25 @@
/* converted to C 6/2004 yhlu */
+
+#include <stdint.h>
+#include <device/pci_def.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
+#include <arch/cpu.h>
+#include <stdlib.h>
+#include <console/console.h>
+
#include <cpu/x86/mtrr.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/msr.h>
#include <assert.h>
#include <spd.h>
#include <sdram_mode.h>
-#include <stdlib.h>
+
+#include "raminit.h"
#include "e7505.h"
+#include "debug.h"
/*-----------------------------------------------------------------------------
Definitions:
@@ -1899,7 +1910,7 @@ void e7505_mch_done(const struct mem_controller *memctrl)
DUMPNORTH();
}
-static int bios_reset_detected(void)
+int e7505_mch_is_ready(void)
{
uint32_t dword = pci_read_config32(MCHDEV, DRC);
return !!(dword & DRC_DONE);
diff --git a/src/northbridge/intel/e7505/raminit.h b/src/northbridge/intel/e7505/raminit.h
index a38d722d15..8eb4990364 100644
--- a/src/northbridge/intel/e7505/raminit.h
+++ b/src/northbridge/intel/e7505/raminit.h
@@ -18,5 +18,10 @@ struct mem_controller {
void e7505_mch_init(const struct mem_controller *memctrl);
void e7505_mch_scrub_ecc(unsigned long ret_addr);
void e7505_mch_done(const struct mem_controller *memctrl);
+int e7505_mch_is_ready(void);
+
+
+/* Mainboard exports this. */
+int spd_read_byte(unsigned device, unsigned address);
#endif /* RAMINIT_H */