diff options
Diffstat (limited to 'src/devices/cpu/arm7/lpc210x.cpp')
-rw-r--r-- | src/devices/cpu/arm7/lpc210x.cpp | 66 |
1 files changed, 25 insertions, 41 deletions
diff --git a/src/devices/cpu/arm7/lpc210x.cpp b/src/devices/cpu/arm7/lpc210x.cpp index d2964589e01..9e9c51c620a 100644 --- a/src/devices/cpu/arm7/lpc210x.cpp +++ b/src/devices/cpu/arm7/lpc210x.cpp @@ -15,6 +15,9 @@ #include "emu.h" #include "lpc210x.h" +#include "arm7core.h" + + DEFINE_DEVICE_TYPE(LPC2103, lpc210x_device, "lpc2103", "NXP LPC2103") void lpc210x_device::lpc2103_map(address_map &map) @@ -37,22 +40,23 @@ void lpc210x_device::lpc2103_map(address_map &map) map(0xE01FC100, 0xE01FC103).rw(FUNC(lpc210x_device::apbdiv_r), FUNC(lpc210x_device::apbdiv_w)); map(0xE01FC1a0, 0xE01FC1a3).rw(FUNC(lpc210x_device::scs_r), FUNC(lpc210x_device::scs_w)); - map(0xFFFFF000, 0xFFFFF2ff).rw(FUNC(lpc210x_device::vic_r), FUNC(lpc210x_device::vic_w)); // interrupt controller + map(0xfffff000, 0xffffffff).m(m_vic, FUNC(vic_pl190_device::map)); // interrupt controller } lpc210x_device::lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, LPC2103, tag, owner, clock, 4, ARCHFLAG_T, ENDIANNESS_LITTLE) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0, address_map_constructor(FUNC(lpc210x_device::lpc2103_map), this)) + , m_vic(*this, "vic") { } -READ32_MEMBER(lpc210x_device::arm_E01FC088_r) +uint32_t lpc210x_device::arm_E01FC088_r() { return 0xffffffff; } -READ32_MEMBER(lpc210x_device::flash_r) +uint32_t lpc210x_device::flash_r(offs_t offset) { uint32_t ret = (m_flash[offset * 4 + 3] << 24) | (m_flash[offset * 4 + 2] << 16) | @@ -61,7 +65,7 @@ READ32_MEMBER(lpc210x_device::flash_r) return ret; } -WRITE32_MEMBER(lpc210x_device::flash_w) +void lpc210x_device::flash_w(offs_t offset, uint32_t data) { // } @@ -98,32 +102,9 @@ void lpc210x_device::device_reset() m_TxPR[1] = 0; } -/* VIC (Vectored Interrupt Controller) */ - -READ32_MEMBER( lpc210x_device::vic_r ) -{ - switch (offset*4) - { - default: - logerror("%s unhandled read from VIC offset %08x mem_mask %08x\n", machine().describe_context(), offset * 4, mem_mask); - } - - return 0x00000000; -} - - -WRITE32_MEMBER( lpc210x_device::vic_w ) -{ - switch (offset * 4) - { - default: - logerror("%s unhandled write VIC offset %02x data %08x mem_mask %08x\n", machine().describe_context(), offset * 4, data, mem_mask); - } -} - /* PIN Select block */ -READ32_MEMBER( lpc210x_device::pin_r ) +uint32_t lpc210x_device::pin_r(offs_t offset, uint32_t mem_mask) { switch (offset*4) { @@ -135,7 +116,7 @@ READ32_MEMBER( lpc210x_device::pin_r ) } -WRITE32_MEMBER( lpc210x_device::pin_w ) +void lpc210x_device::pin_w(offs_t offset, uint32_t data, uint32_t mem_mask) { switch (offset * 4) { @@ -146,7 +127,7 @@ WRITE32_MEMBER( lpc210x_device::pin_w ) /* MAM block (memory conttroller) */ -READ32_MEMBER( lpc210x_device::mam_r ) +uint32_t lpc210x_device::mam_r(offs_t offset, uint32_t mem_mask) { switch (offset*4) { @@ -158,7 +139,7 @@ READ32_MEMBER( lpc210x_device::mam_r ) } -WRITE32_MEMBER( lpc210x_device::mam_w ) +void lpc210x_device::mam_w(offs_t offset, uint32_t data, uint32_t mem_mask) { switch (offset * 4) { @@ -169,7 +150,7 @@ WRITE32_MEMBER( lpc210x_device::mam_w ) /* FIO block */ -READ32_MEMBER( lpc210x_device::fio_r ) +uint32_t lpc210x_device::fio_r(offs_t offset, uint32_t mem_mask) { switch (offset*4) { @@ -181,7 +162,7 @@ READ32_MEMBER( lpc210x_device::fio_r ) } -WRITE32_MEMBER( lpc210x_device::fio_w ) +void lpc210x_device::fio_w(offs_t offset, uint32_t data, uint32_t mem_mask) { switch (offset * 4) { @@ -193,35 +174,35 @@ WRITE32_MEMBER( lpc210x_device::fio_w ) /* APB Divider */ -READ32_MEMBER( lpc210x_device::apbdiv_r ) +uint32_t lpc210x_device::apbdiv_r(offs_t offset, uint32_t mem_mask) { logerror("%s unhandled read from APBDIV offset %08x mem_mask %08x\n", machine().describe_context(), offset * 4, mem_mask); return 0x00000000; } -WRITE32_MEMBER( lpc210x_device::apbdiv_w ) +void lpc210x_device::apbdiv_w(offs_t offset, uint32_t data, uint32_t mem_mask) { logerror("%s unhandled write APBDIV offset %02x data %08x mem_mask %08x\n", machine().describe_context(),offset * 4, data, mem_mask); } /* Syscon misc registers */ -READ32_MEMBER( lpc210x_device::scs_r ) +uint32_t lpc210x_device::scs_r(offs_t offset, uint32_t mem_mask) { logerror("%s unhandled read from SCS offset %08x mem_mask %08x\n", machine().describe_context(),offset * 4, mem_mask); return 0x00000000; } -WRITE32_MEMBER( lpc210x_device::scs_w ) +void lpc210x_device::scs_w(offs_t offset, uint32_t data, uint32_t mem_mask) { logerror("%s unhandled write SCS offset %02x data %08x mem_mask %08x\n", machine().describe_context(),offset * 4, data, mem_mask); } /* PLL Phase Locked Loop */ -READ32_MEMBER( lpc210x_device::pll_r ) +uint32_t lpc210x_device::pll_r(offs_t offset, uint32_t mem_mask) { switch (offset*4) { @@ -233,7 +214,7 @@ READ32_MEMBER( lpc210x_device::pll_r ) } -WRITE32_MEMBER( lpc210x_device::pll_w ) +void lpc210x_device::pll_w(offs_t offset, uint32_t data, uint32_t mem_mask) { switch (offset * 4) { @@ -245,7 +226,7 @@ WRITE32_MEMBER( lpc210x_device::pll_w ) /* Timers */ -uint32_t lpc210x_device::read_timer(address_space &space, int timer, int offset, uint32_t mem_mask) +uint32_t lpc210x_device::read_timer(int timer, int offset, uint32_t mem_mask) { switch (offset*4) { @@ -260,7 +241,7 @@ uint32_t lpc210x_device::read_timer(address_space &space, int timer, int offset, } -void lpc210x_device::write_timer(address_space &space, int timer, int offset, uint32_t data, uint32_t mem_mask) +void lpc210x_device::write_timer(int timer, int offset, uint32_t data, uint32_t mem_mask) { switch (offset * 4) { @@ -278,4 +259,7 @@ void lpc210x_device::write_timer(address_space &space, int timer, int offset, ui void lpc210x_device::device_add_mconfig(machine_config &config) { + PL190_VIC(config, m_vic, 0); + m_vic->out_irq_cb().set_inputline(*this, ARM7_IRQ_LINE); + m_vic->out_fiq_cb().set_inputline(*this, ARM7_FIRQ_LINE); } |