source:
rtems/bsps/arm/lm3s69xx/0001-target-arm-Fixed-ARMv7-M-SHPR-access.patch
@
74a6b33f
Last change on this file since 74a6b33f was eb36d11, checked in by Sebastian Huber <sebastian.huber@…>, on 04/25/18 at 13:06:08 | |
---|---|
|
|
File size: 4.0 KB |
-
hw/arm_gic.c
From 0c8e700376cec0c7b5a70f999b5e286efc321423 Mon Sep 17 00:00:00 2001 From: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Fri, 16 Dec 2011 19:46:40 +0100 Subject: [PATCH 1/4] target-arm: Fixed ARMv7-M SHPR access According to "ARMv7-M Architecture Reference Manual" issue D section "B3.2.10 System Handler Prioriy Register 1, SHPR1", "B3.2.11 System Handler Prioriy Register 2, SHPR2", and "B3.2.12 System Handler Prioriy Register 3, SHPR3". Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> --- hw/arm_gic.c | 16 ++++++++++++++-- hw/armv7m_nvic.c | 19 ------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/hw/arm_gic.c b/hw/arm_gic.c index 9b52119..5139d95 100644
a b static uint32_t gic_dist_readb(void *opaque, target_phys_addr_t offset) 356 356 if (GIC_TEST_TRIGGER(irq + i)) 357 357 res |= (2 << (i * 2)); 358 358 } 359 #else 360 } else if (0xd18 <= offset && offset < 0xd24) { 361 /* System Handler Priority. */ 362 irq = offset - 0xd14; 363 res = GIC_GET_PRIORITY(irq, cpu); 359 364 #endif 360 365 } else if (offset < 0xfe0) { 361 366 goto bad_reg; … … static uint32_t gic_dist_readl(void *opaque, target_phys_addr_t offset) 387 392 gic_state *s = (gic_state *)opaque; 388 393 uint32_t addr; 389 394 addr = offset; 390 if (addr < 0x100 || addr > 0xd00) 395 if (addr < 0x100 || (addr > 0xd00 && addr != 0xd18 && addr != 0xd1c 396 && addr != 0xd20)) 391 397 return nvic_readl(s, addr); 392 398 #endif 393 399 val = gic_dist_readw(opaque, offset); … … static void gic_dist_writeb(void *opaque, target_phys_addr_t offset, 528 534 GIC_CLEAR_TRIGGER(irq + i); 529 535 } 530 536 } 537 #else 538 } else if (0xd18 <= offset && offset < 0xd24) { 539 /* System Handler Priority. */ 540 irq = offset - 0xd14; 541 s->priority1[irq][0] = value & 0xff; 531 542 #endif 532 543 } else { 533 544 /* 0xf00 is only handled for 32-bit writes. */ … … static void gic_dist_writel(void *opaque, target_phys_addr_t offset, 553 564 #ifdef NVIC 554 565 uint32_t addr; 555 566 addr = offset; 556 if (addr < 0x100 || (addr > 0xd00 && addr != 0xf00)) { 567 if (addr < 0x100 || (addr > 0xd00 && addr != 0xd18 && addr != 0xd1c 568 && addr != 0xd20 && addr != 0xf00)) { 557 569 nvic_writel(s, addr, value); 558 570 return; 559 571 } -
hw/armv7m_nvic.c
diff --git a/hw/armv7m_nvic.c b/hw/armv7m_nvic.c index bf8c3c5..65b575e 100644
a b static uint32_t nvic_readl(void *opaque, uint32_t offset) 195 195 case 0xd14: /* Configuration Control. */ 196 196 /* TODO: Implement Configuration Control bits. */ 197 197 return 0; 198 case 0xd18: case 0xd1c: case 0xd20: /* System Handler Priority. */199 irq = offset - 0xd14;200 val = 0;201 val |= s->gic.priority1[irq++][0];202 val |= s->gic.priority1[irq++][0] << 8;203 val |= s->gic.priority1[irq++][0] << 16;204 val |= s->gic.priority1[irq][0] << 24;205 return val;206 198 case 0xd24: /* System Handler Status. */ 207 199 val = 0; 208 200 if (s->gic.irq_state[ARMV7M_EXCP_MEM].active) val |= (1 << 0); … … static void nvic_writel(void *opaque, uint32_t offset, uint32_t value) 335 327 case 0xd14: /* Configuration Control. */ 336 328 /* TODO: Implement control registers. */ 337 329 goto bad_reg; 338 case 0xd18: case 0xd1c: case 0xd20: /* System Handler Priority. */339 {340 int irq;341 irq = offset - 0xd14;342 s->gic.priority1[irq++][0] = value & 0xff;343 s->gic.priority1[irq++][0] = (value >> 8) & 0xff;344 s->gic.priority1[irq++][0] = (value >> 16) & 0xff;345 s->gic.priority1[irq][0] = (value >> 24) & 0xff;346 gic_update(&s->gic);347 }348 break;349 330 case 0xd24: /* System Handler Control. */ 350 331 /* TODO: Real hardware allows you to set/clear the active bits 351 332 under some circumstances. We don't implement this. */
Note: See TracBrowser
for help on using the repository browser.