[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH 6/7] arm: Instantiate nRF51 peripherals
From: |
Steffen Görtz |
Subject: |
Re: [Qemu-arm] [PATCH 6/7] arm: Instantiate nRF51 peripherals |
Date: |
Tue, 21 Aug 2018 13:43:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
Hi Peter,
>> +
>> +static uint64_t clock_read(void *opaque, hwaddr addr, unsigned int size)
>> +{
>> + qemu_log_mask(LOG_UNIMP, "%s: 0x%" HWADDR_PRIx " [%u]\n",
>> + __func__, addr, size);
>> + return 1;
>> +}
>> +
>> +static void clock_write(void *opaque, hwaddr addr, uint64_t data,
>> + unsigned int size)
>> +{
>> + qemu_log_mask(LOG_UNIMP, "%s: 0x%" HWADDR_PRIx " <- 0x%" PRIx64 "
>> [%u]\n",
>> + __func__, addr, data, size);
>> +}
>> +
>> +static const MemoryRegionOps clock_ops = {
>> + .read = clock_read,
>> + .write = clock_write
>> +};
>
> You don't need to roll your own "do nothing but log" device:
> you can use the TYPE_UNIMPLEMENTED_DEVICE to do this.
>
Until we have a more proper STUB for POWER/CLOCK/MPU peripherals we actually
need this,
because the unimplemented device will return 0 on reads which will cause guest
code to stall.
Agree to and regarded the rest of your remarks.
Steffen
- [Qemu-arm] [PATCH 4/7] arm: Add additional datasheets and copyright lines, (continued)
- [Qemu-arm] [PATCH 4/7] arm: Add additional datasheets and copyright lines, Steffen Görtz, 2018/08/11
- [Qemu-arm] [PATCH 5/7] arm: Improve error propagation in nRF51 SOC, Steffen Görtz, 2018/08/11
- [Qemu-arm] [PATCH 1/7] hw/arm/nrf51_soc: nRF51 Calculate peripheral id from base address, Steffen Görtz, 2018/08/11
- [Qemu-arm] [PATCH 7/7] arm: Instantiate Microbit board-level devices, Steffen Görtz, 2018/08/11
- [Qemu-arm] [PATCH 6/7] arm: Instantiate nRF51 peripherals, Steffen Görtz, 2018/08/11