mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
hw/sd/pl181: Replace disabled fprintf()s by trace events
Convert disabled DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200705204630.4133-9-f4bug@amsat.org>
This commit is contained in:
parent
26c607b86b
commit
583d09f078
2 changed files with 19 additions and 17 deletions
|
@ -17,15 +17,7 @@
|
||||||
#include "qemu/module.h"
|
#include "qemu/module.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
|
#include "trace.h"
|
||||||
//#define DEBUG_PL181 1
|
|
||||||
|
|
||||||
#ifdef DEBUG_PL181
|
|
||||||
#define DPRINTF(fmt, ...) \
|
|
||||||
do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0)
|
|
||||||
#else
|
|
||||||
#define DPRINTF(fmt, ...) do {} while(0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PL181_FIFO_LEN 16
|
#define PL181_FIFO_LEN 16
|
||||||
|
|
||||||
|
@ -158,7 +150,7 @@ static void pl181_fifo_push(PL181State *s, uint32_t value)
|
||||||
n = (s->fifo_pos + s->fifo_len) & (PL181_FIFO_LEN - 1);
|
n = (s->fifo_pos + s->fifo_len) & (PL181_FIFO_LEN - 1);
|
||||||
s->fifo_len++;
|
s->fifo_len++;
|
||||||
s->fifo[n] = value;
|
s->fifo[n] = value;
|
||||||
DPRINTF("FIFO push %08x\n", (int)value);
|
trace_pl181_fifo_push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t pl181_fifo_pop(PL181State *s)
|
static uint32_t pl181_fifo_pop(PL181State *s)
|
||||||
|
@ -172,7 +164,7 @@ static uint32_t pl181_fifo_pop(PL181State *s)
|
||||||
value = s->fifo[s->fifo_pos];
|
value = s->fifo[s->fifo_pos];
|
||||||
s->fifo_len--;
|
s->fifo_len--;
|
||||||
s->fifo_pos = (s->fifo_pos + 1) & (PL181_FIFO_LEN - 1);
|
s->fifo_pos = (s->fifo_pos + 1) & (PL181_FIFO_LEN - 1);
|
||||||
DPRINTF("FIFO pop %08x\n", (int)value);
|
trace_pl181_fifo_pop(value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +176,7 @@ static void pl181_do_command(PL181State *s)
|
||||||
|
|
||||||
request.cmd = s->cmd & PL181_CMD_INDEX;
|
request.cmd = s->cmd & PL181_CMD_INDEX;
|
||||||
request.arg = s->cmdarg;
|
request.arg = s->cmdarg;
|
||||||
DPRINTF("Command %d %08x\n", request.cmd, request.arg);
|
trace_pl181_command_send(request.cmd, request.arg);
|
||||||
rlen = sdbus_do_command(&s->sdbus, &request, response);
|
rlen = sdbus_do_command(&s->sdbus, &request, response);
|
||||||
if (rlen < 0)
|
if (rlen < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -201,16 +193,16 @@ static void pl181_do_command(PL181State *s)
|
||||||
s->response[2] = ldl_be_p(&response[8]);
|
s->response[2] = ldl_be_p(&response[8]);
|
||||||
s->response[3] = ldl_be_p(&response[12]) & ~1;
|
s->response[3] = ldl_be_p(&response[12]) & ~1;
|
||||||
}
|
}
|
||||||
DPRINTF("Response received\n");
|
trace_pl181_command_response_pending();
|
||||||
s->status |= PL181_STATUS_CMDRESPEND;
|
s->status |= PL181_STATUS_CMDRESPEND;
|
||||||
} else {
|
} else {
|
||||||
DPRINTF("Command sent\n");
|
trace_pl181_command_sent();
|
||||||
s->status |= PL181_STATUS_CMDSENT;
|
s->status |= PL181_STATUS_CMDSENT;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
DPRINTF("Timeout\n");
|
trace_pl181_command_timeout();
|
||||||
s->status |= PL181_STATUS_CMDTIMEOUT;
|
s->status |= PL181_STATUS_CMDTIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,11 +254,11 @@ static void pl181_fifo_run(PL181State *s)
|
||||||
s->status |= PL181_STATUS_DATAEND;
|
s->status |= PL181_STATUS_DATAEND;
|
||||||
/* HACK: */
|
/* HACK: */
|
||||||
s->status |= PL181_STATUS_DATABLOCKEND;
|
s->status |= PL181_STATUS_DATABLOCKEND;
|
||||||
DPRINTF("Transfer Complete\n");
|
trace_pl181_fifo_transfer_complete();
|
||||||
}
|
}
|
||||||
if (s->datacnt == 0 && s->fifo_len == 0) {
|
if (s->datacnt == 0 && s->fifo_len == 0) {
|
||||||
s->datactrl &= ~PL181_DATA_ENABLE;
|
s->datactrl &= ~PL181_DATA_ENABLE;
|
||||||
DPRINTF("Data engine idle\n");
|
trace_pl181_data_engine_idle();
|
||||||
} else {
|
} else {
|
||||||
/* Update FIFO bits. */
|
/* Update FIFO bits. */
|
||||||
bits = PL181_STATUS_TXACTIVE | PL181_STATUS_RXACTIVE;
|
bits = PL181_STATUS_TXACTIVE | PL181_STATUS_RXACTIVE;
|
||||||
|
|
|
@ -62,3 +62,13 @@ milkymist_memcard_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value
|
||||||
# pxa2xx_mmci.c
|
# pxa2xx_mmci.c
|
||||||
pxa2xx_mmci_read(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x"
|
pxa2xx_mmci_read(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x"
|
||||||
pxa2xx_mmci_write(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x"
|
pxa2xx_mmci_write(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x"
|
||||||
|
|
||||||
|
# pl181.c
|
||||||
|
pl181_command_send(uint8_t cmd, uint32_t arg) "sending CMD%02d arg 0x%08" PRIx32
|
||||||
|
pl181_command_sent(void) "command sent"
|
||||||
|
pl181_command_response_pending(void) "response received"
|
||||||
|
pl181_command_timeout(void) "command timeouted"
|
||||||
|
pl181_fifo_push(uint32_t data) "FIFO push 0x%08" PRIx32
|
||||||
|
pl181_fifo_pop(uint32_t data) "FIFO pop 0x%08" PRIx32
|
||||||
|
pl181_fifo_transfer_complete(void) "FIFO transfer complete"
|
||||||
|
pl181_data_engine_idle(void) "data engine idle"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue