Fix memory controller interface for PDM.

This commit is contained in:
Maxim Poliakovski 2021-09-30 22:55:10 +02:00
parent 22827642e4
commit 8c9f23daf4
3 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,7 @@ HMC::HMC() : MemCtrlBase()
this->name = "Highspeed Memory Controller";
/* add memory mapped I/O region for the HMC control register */
add_mmio_region(0x50F40000, 0xFFFF, this);
add_mmio_region(0x50F40000, 0x10000, this);
this->config_reg = 0ULL;
this->bit_pos = 0;

View File

@ -34,6 +34,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "hwcomponent.h"
#include "memctrlbase.h"
#include "mmiodevice.h"
#include <cinttypes>
class HMC : public MemCtrlBase, public MMIODevice {
public:

View File

@ -130,7 +130,7 @@ bool MemCtrlBase::add_mmio_region(uint32_t start_addr, uint32_t size, MMIODevice
AddressMapEntry *entry;
/* error if another region for the given range already exists */
if (find_range(start_addr) || find_range(start_addr + size))
if (find_range(start_addr) || find_range(start_addr + size - 1))
return false;
entry = new AddressMapEntry;