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
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 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 @@
 	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 @@
 	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 @@
 		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 @@
 		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)) {