fix some more warnings
authorStefan Reinauer <stepan@coresystems.de>
Wed, 7 Jul 2010 21:59:06 +0000 (21:59 +0000)
committerStefan Reinauer <stepan@openbios.org>
Wed, 7 Jul 2010 21:59:06 +0000 (21:59 +0000)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5658 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

16 files changed:
src/cpu/amd/model_10xxx/init_cpus.c
src/cpu/amd/model_fxx/init_cpus.c
src/include/cpu/amd/multicore.h
src/northbridge/amd/amdk8/amdk8.h
src/northbridge/amd/amdk8/amdk8_f.h
src/northbridge/amd/amdk8/amdk8_pre_f.h
src/northbridge/amd/amdk8/coherent_ht.c
src/northbridge/amd/amdk8/raminit_f_dqs.c
src/northbridge/amd/amdk8/setup_resource_map.c
src/southbridge/amd/rs780/rs780_gfx.c
src/southbridge/amd/sb600/sb600_smbus.c
src/southbridge/amd/sb600/sb600_smbus.h
src/southbridge/amd/sb700/sb700.h
src/southbridge/amd/sb700/sb700_early_setup.c
src/southbridge/amd/sb700/sb700_smbus.c
src/southbridge/amd/sb700/sb700_smbus.h

index 43a62256f5eea2f5174746625d08fb4936a024d5..15e9ed4f85077cd2b337d71b39340e691193ca4f 100644 (file)
@@ -244,7 +244,7 @@ static void wait_ap_started(u32 ap_apicid, void *gp)
        }
 }
 
-static void wait_all_other_cores_started(u32 bsp_apicid)
+void wait_all_other_cores_started(u32 bsp_apicid)
 {
        // all aps other than core0
        printk(BIOS_DEBUG, "started ap apicid: ");
index 3fad4e19e33af8714b9edb12799676ab5ad0753f..23edfa08ae67222224566f994a796deafb175d6a 100644 (file)
@@ -178,12 +178,12 @@ static void wait_ap_started(u32 ap_apicid, void *gp)
        }
 }
 
-static void wait_all_aps_started(u32 bsp_apicid)
+void wait_all_aps_started(u32 bsp_apicid)
 {
        for_each_ap(bsp_apicid, 0, wait_ap_started, (void *)0);
 }
 
-static void wait_all_other_cores_started(u32 bsp_apicid)
+void wait_all_other_cores_started(u32 bsp_apicid)
 {
        // all aps other than core0
        printk(BIOS_DEBUG, "started ap apicid: ");
index 47328ef80d0380d97456bb7bcd5c60c867f653ee..21cb23c9ebee4a293251392c4252454c5c3879f1 100644 (file)
@@ -38,6 +38,9 @@ struct node_core_id get_node_core_id(u32 nb_cfg_54);
 struct device;
 u32 get_apicid_base(u32 ioapic_num);
 void amd_sibling_init(struct device *cpu);
+#else
+void wait_all_other_cores_started(u32 bsp_apicid);
+void wait_all_aps_started(u32 bsp_apicid);
 #endif
 
 #endif /* CPU_AMD_QUADCORE_H */
index 3f849c0c8aa21738cff008cdb029d2d1c152e8ba..cc970c5906e58a78c8ab38a30d816433a0b8108a 100644 (file)
@@ -8,8 +8,9 @@
         #include "amdk8_pre_f.h"
 #endif
 
-#ifndef __ROMCC__
+#ifdef __PRE_RAM__
 void showallroutes(int level, device_t dev);
+void setup_resource_map_offset(const unsigned int *register_values, int max, unsigned offset_pci_dev, unsigned offset_io_base);
 #endif
 
 #endif /* AMDK8_H */
index 283e32e235e93e211bedf283fcd82ec4f558bef1..769f5980ba6a3c296cf4496c672ca695020bd5ef 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef AMDK8_F_H
-
 #define AMDK8_F_H
+
 /* Definitions of various K8 registers */
 /* Function 0 */
 #define HT_TRANSACTION_CONTROL 0x68
index 95293ee23667f36eb8d936c15e83c11de9ce9811..dae2d97cd392e18103110e930eb51016364ecdb0 100644 (file)
@@ -1,5 +1,4 @@
 #ifndef AMDK8_PRE_F_H
-
 #define AMDK8_PRE_F_H
 
 /* Definitions of various K8 registers */
index 293abc7067d27d1356a260d7b9b16decf68bdbd1..ad787caabd8a83ea5138dea28c2b4a606e248fb3 100644 (file)
@@ -206,12 +206,12 @@ static void enable_routing(u8 node)
        print_spew(" done.\n");
 }
 
+#if CONFIG_MAX_PHYSICAL_CPUS > 1
 static void fill_row(u8 node, u8 row, u32 value)
 {
        pci_write_config32(NODE_HT(node), 0x40+(row<<2), value);
 }
 
-#if CONFIG_MAX_PHYSICAL_CPUS > 1
 static u8 link_to_register(int ldt)
 {
        /*
@@ -447,28 +447,33 @@ static void setup_row_direct_x(u8 temp, u8 source, u8 dest, u8 linkn)
 }
 
 #if CROSS_BAR_47_56
-static void opt_broadcast_rt(u8 source, u8 dest, u8 kickout) {
+static void opt_broadcast_rt(u8 source, u8 dest, u8 kickout)
+{
        uint32_t val;
        val = get_row(source, dest);
        val -= link_connection(source, kickout)<<16;
        fill_row(source, dest, val);
 }
 
-static void opt_broadcast_rt_group(const u8 *conn, int num) {
+static void opt_broadcast_rt_group(const u8 *conn, int num)
+{
        int i;
 
        for(i=0; i<num; i+=3) {
                opt_broadcast_rt(conn[i], conn[i+1],conn[i+2]);
        }
 }
-static void opt_broadcast_rt_plus(u8 source, u8 dest, u8 kickout) {
+
+static void opt_broadcast_rt_plus(u8 source, u8 dest, u8 kickout)
+{
        uint32_t val;
        val = get_row(source, dest);
        val += link_connection(source, kickout)<<16;
        fill_row(source, dest, val);
 }
 
-static void opt_broadcast_rt_plus_group(const u8 *conn, int num) {
+static void opt_broadcast_rt_plus_group(const u8 *conn, int num)
+{
        int i;
 
        for(i=0; i<num; i+=3) {
@@ -477,27 +482,22 @@ static void opt_broadcast_rt_plus_group(const u8 *conn, int num) {
 }
 #endif
 
-static void setup_row_direct(u8 source, u8 dest, u8 linkn){
+static void setup_row_direct(u8 source, u8 dest, u8 linkn)
+{
        setup_row_direct_x(source, source, dest, linkn);
 }
 
-static void setup_remote_row_direct(u8 source, u8 dest, u8 linkn){
+static void setup_remote_row_direct(u8 source, u8 dest, u8 linkn)
+{
        setup_row_direct_x(7, source, dest, linkn);
 }
 
 static void setup_temp_row(u8 source, u8 dest)
 {
-       /* copy val from (source, dest) to (source,7) */
-       fill_row(source,7,get_row(source,dest));
+       /* copy value from (source, dest) to (source,7) */
+       fill_row(source, 7, get_row(source, dest));
 }
 
-#if 0
-static void clear_temp_row(u8 source)
-{
-       fill_row(source, 7, DEFAULT);
-}
-#endif
-
 static void setup_remote_node(u8 node)
 {
        static const uint8_t pci_reg[] = {
@@ -670,7 +670,8 @@ static void setup_uniprocessor(void)
 }
 
 #if CONFIG_MAX_PHYSICAL_CPUS > 2
-static int optimize_connection_group(const u8 *opt_conn, int num) {
+static int optimize_connection_group(const u8 *opt_conn, int num) 
+{
        int needs_reset = 0;
        int i;
        for(i=0; i<num; i+=2) {
index 81e38ecc6d9946cf01c7baa8bd19f9dbeb23e48d..5303a67b322faee207b61c0120680a59f8bc60bd 100644 (file)
@@ -1717,6 +1717,7 @@ static unsigned int range_to_mtrr(unsigned int reg,
        return reg;
 }
 
+#if CONFIG_MEM_TRAIN_SEQ == 1
 static void set_top_mem_ap(unsigned tom_k, unsigned tom2_k)
 {
        msr_t msr;
@@ -1730,6 +1731,7 @@ static void set_top_mem_ap(unsigned tom_k, unsigned tom2_k)
        msr.hi = (tom_k & 0xffc00000) >> 22;
        wrmsr(TOP_MEM, msr);
 }
+#endif
 
 static void setup_mtrr_dqs(unsigned tom_k, unsigned tom2_k)
 {
@@ -1802,6 +1804,7 @@ static void set_htic_bit(unsigned i, unsigned val, unsigned bit)
 }
 
 
+#if CONFIG_MEM_TRAIN_SEQ == 1
 static unsigned get_htic_bit(unsigned i, unsigned bit)
 {
        uint32_t dword;
@@ -1816,6 +1819,7 @@ static void wait_till_sysinfo_in_ram(void)
                if(get_htic_bit(0, 9)) return;
        }
 }
+#endif
 
 static void set_sysinfo_in_ram(unsigned val)
 {
index f7621a421f622d02ecfc6908eba61bb44e4f6a8f..8d1052e845fb7649e18d0593a5a7706ee78d09ce 100644 (file)
@@ -1,6 +1,8 @@
+#include "amdk8.h"
+
 #define RES_DEBUG 0
 
-static void setup_resource_map_offset(const unsigned int *register_values, int max, unsigned offset_pci_dev, unsigned offset_io_base)
+void setup_resource_map_offset(const unsigned int *register_values, int max, unsigned offset_pci_dev, unsigned offset_io_base)
 {
        int i;
 #if RES_DEBUG
index 753af0079f3679aec74c2fce67b1b735d430d321..7decabdac339207a34a7f5f6da5352038a6a8e9e 100644 (file)
@@ -96,33 +96,33 @@ typedef struct _MMIORANGE
 
 MMIORANGE MMIO[8], CreativeMMIO[8];
 
+#define CIM_STATUS u32
+#define CIM_SUCCESS 0x00000000
+#define CIM_ERROR      0x80000000
+#define CIM_UNSUPPORTED        0x80000001
+#define CIM_DISABLEPORT 0x80000002
+
+#define        MMIO_ATTRIB_NP_ONLY     1
+#define MMIO_ATTRIB_BOTTOM_TO_TOP 1<<1
+#define MMIO_ATTRIB_SKIP_ZERO 1<<2
+
+#ifdef DONT_TRUST_RESOURCE_ALLOCATION
 static MMIORANGE* AllocMMIO(MMIORANGE* pMMIO)
 {
        int i;
-       for (i=0; i<8; i++)
-       {
+       for (i=0; i<8; i++) {
                if (pMMIO[i].Limit == 0)
                                return &pMMIO[i];
        }
        return 0;
 }
+
 static void FreeMMIO(MMIORANGE* pMMIO)
 {
        pMMIO->Base = 0;
        pMMIO->Limit = 0;
 }
 
-#define CIM_STATUS u32
-#define CIM_SUCCESS 0x00000000
-#define CIM_ERROR      0x80000000
-#define CIM_UNSUPPORTED        0x80000001
-#define CIM_DISABLEPORT 0x80000002
-
-#define        MMIO_ATTRIB_NP_ONLY     1
-#define MMIO_ATTRIB_BOTTOM_TO_TOP 1<<1
-#define MMIO_ATTRIB_SKIP_ZERO 1<<2
-
-#ifdef DONT_TRUST_RESOURCE_ALLOCATION
 static u32 SetMMIO(u32 Base, u32 Limit, u8 Attribute, MMIORANGE *pMMIO)
 {
        int i;
@@ -584,7 +584,6 @@ static void rs780_internal_gfx_enable(device_t dev)
 {
        u32 l_dword;
        int i;
-       device_t k8_f0 = 0, k8_f2 = 0;
        device_t nb_dev = dev_find_slot(0, 0);
        msr_t sysmem;
 
@@ -617,7 +616,7 @@ static void rs780_internal_gfx_enable(device_t dev)
 
        /* LPC DMA Deadlock workaround? */
        /* GFX_InitCommon*/
-       k8_f0 = dev_find_slot(0, PCI_DEVFN(0x18, 0));
+       device_t k8_f0 = dev_find_slot(0, PCI_DEVFN(0x18, 0));
        l_dword = pci_read_config32(k8_f0, 0x68);
        l_dword &= ~(3 << 21);
        l_dword |= (1 << 21);
@@ -632,7 +631,7 @@ static void rs780_internal_gfx_enable(device_t dev)
 #if (CONFIG_GFXUMA == 1)
        /* GFX_InitUMA. */
        /* Copy CPU DDR Controller to NB MC. */
-       k8_f2 = dev_find_slot(0, PCI_DEVFN(0x18, 2));
+       device_t k8_f2 = dev_find_slot(0, PCI_DEVFN(0x18, 2));
        for (i = 0; i < 12; i++)
        {
                l_dword = pci_read_config32(k8_f2, 0x40 + i * 4);
index 9e14930b099963507948b7b6730b6403442c1882..8174ce8d44c132cf4416a457f849a2efd202ca65 100644 (file)
@@ -60,7 +60,7 @@ static int smbus_wait_until_done(u32 smbus_io_base)
        return -3;              /* timeout */
 }
 
-static int do_smbus_recv_byte(u32 smbus_io_base, u32 device)
+int do_smbus_recv_byte(u32 smbus_io_base, u32 device)
 {
        u8 byte;
 
@@ -87,8 +87,7 @@ static int do_smbus_recv_byte(u32 smbus_io_base, u32 device)
        return byte;
 }
 
-static int do_smbus_send_byte(u32 smbus_io_base, u32 device,
-                             u8 val)
+int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val)
 {
        u8 byte;
 
index 07457761446664ec277d061cb5c1303169d9b7a6..684d0e62c483c3001e9c0f55fb6aade963453591 100644 (file)
@@ -20,8 +20,6 @@
 #ifndef SB600_SMBUS_H
 #define SB600_SMBUS_H
 
-//#include <stdint.h>
-
 #define SMBHSTSTAT 0x0
 #define SMBSLVSTAT 0x1
 #define SMBHSTCTRL 0x2
@@ -58,6 +56,8 @@
 #define axindxp_reg(reg, mask, val)    \
        alink_ax_indx(1, (reg), (mask), (val))
 
+int do_smbus_recv_byte(u32 smbus_io_base, u32 device);
+int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val);
 int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address);
 int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val);
 
index 81a358bcb126f517a2e9ba275d0f2df6a346c887..bf7b2975181b289f3dd9228f9229c17debf21d5d 100644 (file)
@@ -49,4 +49,9 @@ extern void set_sm_enable_bits(device_t sm_dev, u32 reg_pos, u32 mask, u32 val);
 
 void sb700_enable(device_t dev);
 
+#ifdef __PRE_RAM__
+void sb700_lpc_port80(void);
+void sb700_pci_port80(void);
+#endif
+
 #endif /* SB700_H */
index 4315c39545fe3b28158e6584c7af024e72876a24..22f804ac230e321e36accbdc1d44be03e74cd579 100644 (file)
@@ -231,7 +231,7 @@ void soft_reset(void)
        outb(0x06, 0x0cf9);
 }
 
-static void sb700_pci_port80(void)
+void sb700_pci_port80(void)
 {
        u8 byte;
        device_t dev;
@@ -276,7 +276,7 @@ static void sb700_pci_port80(void)
        pci_write_config8(dev, 0x4A, byte);
 }
 
-static void sb700_lpc_port80(void)
+void sb700_lpc_port80(void)
 {
        u8 byte;
        device_t dev;
index ec3f94c7bc4a502efe9f21b1daaacab392ccdcd5..65e69125687976608b7dc88d63482cac0df7dbb1 100644 (file)
@@ -63,7 +63,7 @@ static int smbus_wait_until_done(u32 smbus_io_base)
        return -3;              /* timeout */
 }
 
-static int do_smbus_recv_byte(u32 smbus_io_base, u32 device)
+int do_smbus_recv_byte(u32 smbus_io_base, u32 device)
 {
        u8 byte;
 
@@ -90,7 +90,7 @@ static int do_smbus_recv_byte(u32 smbus_io_base, u32 device)
        return byte;
 }
 
-static int do_smbus_send_byte(u32 smbus_io_base, u32 device,
+int do_smbus_send_byte(u32 smbus_io_base, u32 device,
                              u8 val)
 {
        u8 byte;
index 6acfa9909045eb7d27ced8aa130402836fef3df5..c21a1dc0a2c40c09fab3c255129687becbfcdb9b 100644 (file)
@@ -56,6 +56,8 @@
 #define axindxp_reg(reg, mask, val)    \
        alink_ax_indx(1, (reg), (mask), (val))
 
+int do_smbus_recv_byte(u32 smbus_io_base, u32 device);
+int do_smbus_send_byte(u32 smbus_io_base, u32 device, u8 val);
 int do_smbus_read_byte(u32 smbus_io_base, u32 device, u32 address);
 int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val);