coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
tracker.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <device/mmio.h>
5 #include <soc/addressmap.h>
6 #include <soc/tracker.h>
7 #include <soc/tracker_common.h>
8 
9 __weak void tracker_setup(void)
10 {
11  /* do nothing. */
12 }
13 
14 static void tracker_dump_data(void)
15 {
16  int i, j, k;
17  int size;
18  uintptr_t reg;
19  struct tracker *tra;
20 
21  for (j = 0; j < TRACKER_NUM; j++) {
22  tra = &tracker_data[j];
23 
24  if (!(read32((void *)(tra->base_addr)) & tra->timeout))
25  continue;
26 
27  printk(BIOS_INFO, "**Dump %s debug register start**\n", tra->str);
28  for (k = 0; k < 2; k++) {
29  size = 2 * tra->entry;
30  for (i = 0; i < size; i++) {
31  reg = tra->base_addr + tra->offset[k] + i * 4;
32  printk(BIOS_INFO, "%#lx:%#x,", reg, read32((void *)reg));
33 
34  if (i % 4 == 3 || i == size - 1)
35  printk(BIOS_INFO, "\n");
36  }
37  }
38 
39  printk(BIOS_INFO, "**Dump %s debug register end**\n", tra->str);
40  }
41 }
42 
43 void bustracker_init(void)
44 {
46  tracker_setup();
47 }
static uint32_t read32(const void *addr)
Definition: mmio.h:22
#define printk(level,...)
Definition: stdlib.h:16
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
const struct smm_save_state_ops *legacy_ops __weak
Definition: save_state.c:8
unsigned long uintptr_t
Definition: stdint.h:21
const char * str
uintptr_t base_addr
u32 offset[2]
void bustracker_init(void)
Definition: tracker.c:43
__weak void tracker_setup(void)
Definition: tracker.c:9
static void tracker_dump_data(void)
Definition: tracker.c:14
struct tracker tracker_data[]
Definition: tracker_v1.c:12
@ TRACKER_NUM
Definition: tracker_v1.h:13