summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-07-04 16:14:37 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-07-14 19:48:00 +0200
commit7b23ae0e8938eb71453cbc28c2cc74c14a4039ae (patch)
tree6f57fc077140b22a2f1d8b509baac3384c38eb7b /src/northbridge
parent06ff7268f67d1345fd115fda0879d781eac2d6b1 (diff)
downloadcoreboot-7b23ae0e8938eb71453cbc28c2cc74c14a4039ae.tar.xz
AGESA: Trace execution with AGESAWRAPPER()
Implement logging just once to have uniform output. Change-Id: I8db694a3bf6b1af459bdf98f7acb99edf4dd07f7 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/6180 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/amd/agesa/agesawrapper_call.h36
-rw-r--r--src/northbridge/amd/agesa/family10/northbridge.c6
-rw-r--r--src/northbridge/amd/agesa/family12/northbridge.c18
-rw-r--r--src/northbridge/amd/agesa/family14/northbridge.c13
-rw-r--r--src/northbridge/amd/agesa/family15/northbridge.c7
-rw-r--r--src/northbridge/amd/agesa/family15tn/northbridge.c15
-rw-r--r--src/northbridge/amd/agesa/family16kb/northbridge.c15
7 files changed, 53 insertions, 57 deletions
diff --git a/src/northbridge/amd/agesa/agesawrapper_call.h b/src/northbridge/amd/agesa/agesawrapper_call.h
new file mode 100644
index 0000000000..e654b8a4b6
--- /dev/null
+++ b/src/northbridge/amd/agesa/agesawrapper_call.h
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _AGESAWRAPPER_CALL_H_
+#define _AGESAWRAPPER_CALL_H_
+
+#include <stdint.h>
+#include <console/console.h>
+#include "AGESA.h"
+
+static inline u32 do_agesawrapper(AGESA_STATUS (*func)(void), const char *name)
+{
+ AGESA_STATUS ret;
+ printk(BIOS_DEBUG, "agesawrapper_%s() entry\n", name);
+ ret = func();
+ printk(BIOS_DEBUG, "agesawrapper_%s() AGESA_STATUS = %x\n", name, ret);
+ return (u32)ret;
+}
+
+#define AGESAWRAPPER(func) do_agesawrapper(agesawrapper_ ## func, #func)
+
+#endif
diff --git a/src/northbridge/amd/agesa/family10/northbridge.c b/src/northbridge/amd/agesa/family10/northbridge.c
index 4b2d003462..d3d64791c5 100644
--- a/src/northbridge/amd/agesa/family10/northbridge.c
+++ b/src/northbridge/amd/agesa/family10/northbridge.c
@@ -831,13 +831,9 @@ static void amdfam10_domain_read_resources(device_t dev)
static void amdfam10_domain_enable_resources(device_t dev)
{
- u32 val;
/* Must be called after PCI enumeration and resource allocation */
printk(BIOS_DEBUG, "\nFam10 - %s: AmdInitMid.\n", __func__);
- val = agesawrapper_amdinitmid();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmid failed: %x \n", val);
- }
+ AGESAWRAPPER(amdinitmid);
printk(BIOS_DEBUG, " ader - leaving %s.\n", __func__);
}
diff --git a/src/northbridge/amd/agesa/family12/northbridge.c b/src/northbridge/amd/agesa/family12/northbridge.c
index 7d71624b6f..65212dce10 100644
--- a/src/northbridge/amd/agesa/family12/northbridge.c
+++ b/src/northbridge/amd/agesa/family12/northbridge.c
@@ -36,6 +36,7 @@
#include "northbridge.h"
#include "sb_cimx.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
//#define FX_DEVS NODE_NUMS
#define FX_DEVS 1
@@ -766,15 +767,9 @@ printk(BIOS_DEBUG, " adsr - leaving this lovely routine.\n");
static void domain_enable_resources(device_t dev)
{
-// u32 val;
/* Must be called after PCI enumeration and resource allocation */
-// printk(BIOS_DEBUG, "\nFam12h - northbridge.c - %s - agesawrapper_amdinitmid - Start.\n",__func__);
printk(BIOS_DEBUG, "\nFam12h - northbridge.c - %s - Start.\n",__func__);
-// val = agesawrapper_amdinitmid ();
-// if(val) {
-// printk(BIOS_DEBUG, "agesawrapper_amdinitmid failed: %x \n", val);
-// }
-// printk(BIOS_DEBUG, "Fam12h - northbridge.c - %s - agesawrapper_amdinitmid - End.\n",__func__);
+// AGESAWRAPPER(amdinitmid);
printk(BIOS_DEBUG, "Fam12h - northbridge.c - %s - End.\n",__func__);
}
@@ -810,8 +805,6 @@ static void cpu_bus_set_resources(device_t dev)
static void cpu_bus_init(device_t dev)
{
- u32 val;
-
printk(BIOS_DEBUG, "\nFam12h - northbridge.c - %s - Start.\n",__func__);
initialize_cpus(dev->link_list);
@@ -830,12 +823,7 @@ static void cpu_bus_init(device_t dev)
#endif // #if CONFIG_SOUTHBRIDGE_AMD_CIMX_SB900
/* Must be called after PCI enumeration and resource allocation */
- printk(BIOS_DEBUG, "\nFam12h - northbridge.c - %s - agesawrapper_amdinitmid - Start.\n",__func__);
- val = agesawrapper_amdinitmid ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmid failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Fam12h - northbridge.c - %s - agesawrapper_amdinitmid - End.\n",__func__);
+ AGESAWRAPPER(amdinitmid);
printk(BIOS_DEBUG, "Fam12h - northbridge.c - %s - End.\n",__func__);
}
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index 41de9cc297..57502e915b 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -35,6 +35,7 @@
#include <cpu/amd/mtrr.h>
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "northbridge.h"
#if CONFIG_AMD_SB_CIMX
#include <sb_cimx.h>
@@ -758,8 +759,6 @@ static void domain_set_resources(device_t dev)
static void domain_enable_resources(device_t dev)
{
- u32 val;
-
#if CONFIG_AMD_SB_CIMX
if (!acpi_is_wakeup_s3()) {
sb_After_Pci_Init();
@@ -772,14 +771,8 @@ static void domain_enable_resources(device_t dev)
/* Must be called after PCI enumeration and resource allocation */
printk(BIOS_DEBUG, "\nFam14h - %s\n", __func__);
- if (!acpi_is_wakeup_s3()) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmid ");
- val = agesawrapper_amdinitmid ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
- }
+ if (!acpi_is_wakeup_s3())
+ AGESAWRAPPER(amdinitmid);
printk(BIOS_DEBUG, " ader - leaving domain_enable_resources.\n");
}
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index eada06f415..34f58d33a2 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -40,6 +40,7 @@
#include <cpu/amd/amdfam15.h>
#include <cpuRegisters.h>
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "northbridge.h"
#define MAX_NODE_NUMS (MAX_NODES * MAX_DIES)
@@ -588,13 +589,9 @@ static void domain_read_resources(device_t dev)
static void domain_enable_resources(device_t dev)
{
- u32 val;
/* Must be called after PCI enumeration and resource allocation */
printk(BIOS_DEBUG, "\nFam15 - %s: AmdInitMid.\n", __func__);
- val = agesawrapper_amdinitmid();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmid failed: %x \n", val);
- }
+ AGESAWRAPPER(amdinitmid);
printk(BIOS_DEBUG, " Fam15 - leaving %s.\n", __func__);
}
diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c
index 8241f54694..3e2c6350a2 100644
--- a/src/northbridge/amd/agesa/family15tn/northbridge.c
+++ b/src/northbridge/amd/agesa/family15tn/northbridge.c
@@ -41,6 +41,7 @@
#include <cpu/amd/amdfam15.h>
#include <cpuRegisters.h>
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "northbridge.h"
#define MAX_NODE_NUMS (MAX_NODES * MAX_DIES)
@@ -555,20 +556,12 @@ static void domain_read_resources(device_t dev)
static void domain_enable_resources(device_t dev)
{
- u32 val;
if (acpi_is_wakeup_s3())
- agesawrapper_fchs3laterestore();
+ AGESAWRAPPER(fchs3laterestore);
/* Must be called after PCI enumeration and resource allocation */
- printk(BIOS_DEBUG, "\nFam15 - %s: AmdInitMid.\n", __func__);
- if (!acpi_is_wakeup_s3()) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmid ");
- val = agesawrapper_amdinitmid ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
- }
+ if (!acpi_is_wakeup_s3())
+ AGESAWRAPPER(amdinitmid);
printk(BIOS_DEBUG, " ader - leaving %s.\n", __func__);
}
diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c
index 5b431411a2..5572282799 100644
--- a/src/northbridge/amd/agesa/family16kb/northbridge.c
+++ b/src/northbridge/amd/agesa/family16kb/northbridge.c
@@ -41,6 +41,7 @@
#include <cpu/amd/amdfam16.h>
#include <cpuRegisters.h>
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "northbridge.h"
#define MAX_NODE_NUMS (MAX_NODES * MAX_DIES)
@@ -559,20 +560,12 @@ static void domain_read_resources(device_t dev)
static void domain_enable_resources(device_t dev)
{
- u32 val;
if (acpi_is_wakeup_s3())
- agesawrapper_fchs3laterestore();
+ AGESAWRAPPER(fchs3laterestore);
/* Must be called after PCI enumeration and resource allocation */
- printk(BIOS_DEBUG, "\nFam16 - domain_enable_resources: AmdInitMid.\n");
- if (!acpi_is_wakeup_s3()) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmid ");
- val = agesawrapper_amdinitmid ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
- }
+ if (!acpi_is_wakeup_s3())
+ AGESAWRAPPER(amdinitmid);
printk(BIOS_DEBUG, " ader - leaving domain_enable_resources.\n");
}