summaryrefslogtreecommitdiffstats
path: root/mboxd_lpc.c
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2017-04-27 14:48:58 +1000
committerAndrew Jeffery <andrew@aj.id.au>2017-05-04 01:20:23 +0000
commit2851959877213f23fe5317b9a738d06db41a6666 (patch)
treeefaa77cff69a17ae7b97a943fb7a25062c5cf46d /mboxd_lpc.c
parent5a3a0664b63feba8aff288a5691a9f873e4ea6eb (diff)
downloadphosphor-mboxd-2851959877213f23fe5317b9a738d06db41a6666.tar.gz
phosphor-mboxd-2851959877213f23fe5317b9a738d06db41a6666.zip
mboxd: Introduce a new DEBUG log level
Currently there is no output on the console unless -v is specified on the command line which enables error output. A second -v will provide info output. We probably want error output irrespective of whether a -v was given on the command line because people generally want to know why their program stopped working. Make error output unconditional. A single -v will give minimal informational output which is a good level to see what the daemon is doing without barfing all over the console. A second -v will enable debug output which will print highly verbose information which will be useful for debugging. Probably don't enable this under normal circumstances. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Change-Id: I3da25f7e4e9e976c17389fcceb1d85ef98de7e0a
Diffstat (limited to 'mboxd_lpc.c')
-rw-r--r--mboxd_lpc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mboxd_lpc.c b/mboxd_lpc.c
index c8f69b6..0529b14 100644
--- a/mboxd_lpc.c
+++ b/mboxd_lpc.c
@@ -61,7 +61,7 @@ int __init_lpc_dev(struct mbox_context *context, const char *path)
int fd;
/* Open LPC Device */
- MSG_OUT("Opening %s\n", path);
+ MSG_DBG("Opening %s\n", path);
fd = open(path, O_RDWR | O_SYNC);
if (fd < 0) {
MSG_ERR("Couldn't open %s with flags O_RDWR: %s\n",
@@ -72,7 +72,7 @@ int __init_lpc_dev(struct mbox_context *context, const char *path)
context->fds[LPC_CTRL_FD].fd = fd;
/* Find Size of Reserved Memory Region */
- MSG_OUT("Getting buffer size...\n");
+ MSG_DBG("Getting buffer size...\n");
if (ioctl(fd, ASPEED_LPC_CTRL_IOCTL_GET_SIZE, &map) < 0) {
MSG_ERR("Couldn't get lpc control buffer size: %s\n",
strerror(errno));
@@ -82,9 +82,9 @@ int __init_lpc_dev(struct mbox_context *context, const char *path)
context->mem_size = map.size;
/* Map at the top of the 28-bit LPC firmware address space-0 */
context->lpc_base = 0x0FFFFFFF & -context->mem_size;
-
+
/* mmap the Reserved Memory Region */
- MSG_OUT("Mapping in %u bytes of %s\n", context->mem_size, path);
+ MSG_DBG("Mapping in 0x%.8x bytes of %s\n", context->mem_size, path);
context->mem = mmap(NULL, context->mem_size, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);
if (context->mem == MAP_FAILED) {
@@ -138,8 +138,8 @@ int point_to_flash(struct mbox_context *context)
return -MBOX_R_PARAM_ERROR;
}
- MSG_OUT("Pointing HOST LPC bus at the actual flash\n");
- MSG_OUT("Assuming %dMB of flash: HOST LPC 0x%08x\n",
+ MSG_INFO("Pointing HOST LPC bus at the flash\n");
+ MSG_INFO("Assuming %dMB of flash: HOST LPC 0x%08x\n",
context->flash_size >> 20, map.addr);
if (ioctl(context->fds[LPC_CTRL_FD].fd, ASPEED_LPC_CTRL_IOCTL_MAP, &map)
@@ -178,9 +178,9 @@ int point_to_memory(struct mbox_context *context)
return 0; /* LPC Bus already points to reserved memory area */
}
- MSG_OUT("Pointing HOST LPC bus at memory region %p of size 0x%.8x\n",
+ MSG_INFO("Pointing HOST LPC bus at memory region %p of size 0x%.8x\n",
context->mem, context->mem_size);
- MSG_OUT("LPC address 0x%.8x\n", map.addr);
+ MSG_INFO("LPC address 0x%.8x\n", map.addr);
if (ioctl(context->fds[LPC_CTRL_FD].fd, ASPEED_LPC_CTRL_IOCTL_MAP,
&map)) {
OpenPOWER on IntegriCloud