[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH arm-devs v1 04/15] xilinx_spips: Add verbose LQS
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH arm-devs v1 04/15] xilinx_spips: Add verbose LQSPI debug output |
Date: |
Mon, 8 Apr 2013 08:54:35 +1000 |
On Sat, Apr 6, 2013 at 4:42 AM, Peter Maydell <address@hidden> wrote:
> On 3 April 2013 05:32, Peter Crosthwaite <address@hidden> wrote:
>> You really need this is you want to track a guest banging on LQSPI.
>>
>> Signed-off-by: Peter Crosthwaite <address@hidden>
>> ---
>>
>> hw/xilinx_spips.c | 5 ++++-
>> 1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/hw/xilinx_spips.c b/hw/xilinx_spips.c
>> index a8691d5..29636ce 100644
>> --- a/hw/xilinx_spips.c
>> +++ b/hw/xilinx_spips.c
>> @@ -456,10 +456,13 @@ lqspi_read(void *opaque, hwaddr addr, unsigned int
>> size)
>> int i;
>> XilinxQSPIPS *q = opaque;
>> XilinxSPIPS *s = opaque;
>> + uint32_t ret;
>>
>> if (addr >= q->lqspi_cached_addr &&
>> addr <= q->lqspi_cached_addr + LQSPI_CACHE_SIZE - 4) {
>> - return q->lqspi_buf[(addr - q->lqspi_cached_addr) >> 2];
>> + ret = q->lqspi_buf[(addr - q->lqspi_cached_addr) >> 2];
>> + DB_PRINT("addr: %08x, data: %08x\n", (unsigned)addr, (unsigned)ret);
>> + return ret;
>> } else {
>> int flash_addr = (addr / num_effective_busses(s));
>> int slave = flash_addr >> LQSPI_ADDRESS_BITS;
>
> I'd recommend keeping the scope of the variable inside the if {} personally,
> but if you prefer this way round that's fine.
>
I'm usually the same, but for return temporaries I usually define on
top level as they have a habit of getting reused and its verbose if
multiple ifs all define their own ret tempory. All personal pref I
guess.
Regards,
Peter
> -- PMM
>
- [Qemu-devel] [PATCH arm-devs v1 00/15] Xilinx SPIPS fixes round 2, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 01/15] xilinx_spips: seperate SPI and QSPI as two classes, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 02/15] xilinx_spips: Make interrupts clear on read, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 03/15] xilinx_spips: Inhibit interrupts in LQSPI mode, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 04/15] xilinx_spips: Add verbose LQSPI debug output, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 05/15] xilinx_spips: lqspi: Dont trash config register, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 06/15] xilinx_spips: Fix QSPI FIFO size, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 07/15] xilinx_spips: Trash LQ page cache on mode change, Peter Crosthwaite, 2013/04/03
- [Qemu-devel] [PATCH arm-devs v1 08/15] xilinx_spips: Add automatic start support, Peter Crosthwaite, 2013/04/03