[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/9] nvram: add nrf51_soc flash read method
From: |
P J P |
Subject: |
Re: [PATCH v2 5/9] nvram: add nrf51_soc flash read method |
Date: |
Tue, 21 Jul 2020 12:17:47 +0530 (IST) |
+-- On Thu, 16 Jul 2020, Peter Maydell wrote --+
| > P J P <ppandit@redhat.com>
篋\x8E2020綛\xB46\xE6\x9C\x8825\xE6\x97ュ\x91\xA8\xE5\x9B\x9B
筝\x8A\xE5\x8D\x883:01\xE5\x86\x99\xE9\x81\x93鐚\x9A
| > > +static uint64_t flash_read(void *opaque, hwaddr offset, unsigned size)
| > > +{
| > > + NRF51NVMState *s = NRF51_NVM(opaque);
| > > +
| > > + assert(offset + size <= s->flash_size);
| > > + return ldl_le_p(s->storage + offset);
| > > +}
| >
| > The 'flash_ops' is for ROM, though I don't see where it calls
| > 'memory_region_rom_device_set_romd' to ROMD, so this MR is in MMIO mode
| > and it needs a read callback.
|
| I think that 'romd mode' (ie reads-go-directly-to-RAM) is the default:
| memory_region_initfn() sets romd_mode to true. So unless the device actively
| calls memory_region_rom_device_set_romd(mr, false) then the read callback
| can't be reached.
So, we go with g_assert_not_reached() ? We seem to have differing opinions
about these callbacks.
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D