From 35b62810c3a4b8e2924109905334f054425f16ba Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 22 Oct 2021 09:00:09 -0700 Subject: [PATCH] Update submodule --- cortex-a.py | 157 ------------------ hw/mcu/broadcom | 2 +- src/portable/broadcom/synopsys/dcd_synopsys.c | 10 +- .../broadcom/synopsys/synopsys_common.h | 6 +- 4 files changed, 10 insertions(+), 165 deletions(-) delete mode 100644 cortex-a.py diff --git a/cortex-a.py b/cortex-a.py deleted file mode 100644 index 9de16bae9..000000000 --- a/cortex-a.py +++ /dev/null @@ -1,157 +0,0 @@ -class Armv8AException(gdb.Command): - def __init__ (self): - super (Armv8AException, self).__init__ ("armv8a-exception", gdb.COMMAND_USER) - - def print_data_abort(self, frame, iss): - isv = (iss >> 23) & 0x1 - sas = (iss >> 21) & 0x3 - sse = (iss >> 20) & 0x1 - srt = (iss >> 15) & 0x1f - sf = (iss >> 14) & 0x1 - ar = (iss >> 13) & 0x1 - vncr = (iss >> 12) & 0x1 - _set = (iss >> 10) & 0x3 - fnv = (iss >> 9) & 0x1 - ea = (iss >> 8) & 0x1 - cm = (iss >> 7) & 0x1 - s1ptw = (iss >> 6) & 0x1 - wnr = (iss >> 5) & 0x1 - dfsc = iss & 0x1f - if isv: - # print("isv valid", sas, sse, srt, sf, ar) - access_sizes = ("Byte", "Halfword", "Word", "Doubleword") - print("Access size:", access_sizes[sas]) - print("Sign extended:", "Yes" if sse else "No") - print("Register:", hex(srt), "64-bit" if sf else "32-bit") - print("Acquire/Release:", "Yes" if ar else "No") - if dfsc == 0b010000: - print("Not on translation table walk") - if not fnv: - value = int(frame.read_register("FAR_EL2")) - print("FAR", hex(value)) - elif dfsc == 0b000101: - print("translation fault level 1") - elif dfsc == 0b010001: - print("tag check fault") - elif dfsc == 0b100001: - print("alignment fault") - else: - print(bin(dfsc)) - print(vncr, _set, fnv, ea, cm, s1ptw, wnr, dfsc) - - def print_instruction_abort(self, frame, iss): - _set = (iss >> 10) & 0x3 - fnv = (iss >> 9) & 0x1 - ea = (iss >> 8) & 0x1 - s1ptw = (iss >> 6) & 0x1 - ifsc = iss & 0x1f - if ifsc == 0b010000: - print("Not on translation table walk") - if not fnv: - value = int(frame.read_register("FAR_EL2")) - print("FAR", hex(value)) - elif ifsc == 0b00101: - print("translation fault level 1") - elif ifsc == 0b01001: - print("access flag fault level 1") - # elif dfsc == 0b100001: - # print("alignment fault") - else: - print(bin(ifsc)) - - def invoke (self, arg, from_tty): - frame = gdb.selected_frame() - value = int(frame.read_register("ESR_EL2")) - if value == 0: - return None - iss2 = (value >> 32) & 0x1ff - ec = (value >> 26) & 0x3ff - il = (value >> 25) & 0x1 - iss = value & 0xffffff - if ec == 0b000000: - print("Unknown fault") - elif ec == 0b000001: - print("Trapped WF*") - elif ec == 0b000011: - print("Trapped MCR or MRC") - elif ec == 0b000100: - print("Trapped MCRR or MRRC") - elif ec == 0b000101: - print("Trapped MCR or MRC") - elif ec == 0b000110: - print("Trapped LDC or STC") - elif ec == 0b000111: - print("Trapped SIMD") - elif ec == 0b001000: - print("Trapped VMRS") - elif ec == 0b001001: - print("Trapped pointer authentication") - elif ec == 0b001010: - print("Trapped LD64B or ST64B*") - elif ec == 0b001100: - print("Trapped MRRC") - elif ec == 0b001101: - print("Branch target exception") - elif ec == 0b001110: - print("Illegal execution state") - elif ec == 0b010001: - print("SVC instruction") - elif ec == 0b010010: - print("HVC instruction") - elif ec == 0b010011: - print("SMC instruction") - elif ec == 0b010101: - print("SVC instruction") - elif ec == 0b010110: - print("HVC instruction") - elif ec == 0b010111: - print("SMC instruction") - elif ec == 0b011000: - print("Trapped MRS, MRS or system instruction") - elif ec == 0b011001: - print("Trapped SVE") - elif ec == 0b011010: - print("Trapped ERET") - elif ec == 0b011100: - print("Failed pointer authentication") - elif ec == 0b100000: - print("Instruction abort from lower level") - elif ec == 0b100001: - print("Instruction abort from same level") - self.print_instruction_abort(frame, iss) - elif ec == 0b100010: - print("PC alignment failure") - elif ec == 0b100100: - print("Data abort from lower level") - elif ec == 0b100101: - print("Data abort from same level") - self.print_data_abort(frame, iss) - elif ec == 0b100110: - print("SP alignment fault") - elif ec == 0b101000: - print("32-bit floating point exception") - elif ec == 0b101100: - print("64-bit floating point exception") - elif ec == 0b101111: - print("SError interrupt") - elif ec == 0b110000: - print("Breakpoint from lower level") - elif ec == 0b110001: - print("Breakpoint from same level") - elif ec == 0b110010: - print("Software step from lower level") - elif ec == 0b110011: - print("Software step from same level") - elif ec == 0b110100: - print ("Watch point from same level") - elif ec == 0b110101: - print("Watch point from lower level") - elif ec == 0b111000: - print("Breakpoint in aarch32 mode") - elif ec == 0b111010: - print("Vector catch in aarch32") - elif ec == 0b111100: - print("Brk instruction in aarch64") - print(hex(int(value)), iss2, bin(ec), il, iss) - -Armv8AException() diff --git a/hw/mcu/broadcom b/hw/mcu/broadcom index e5343acda..7a8f4b747 160000 --- a/hw/mcu/broadcom +++ b/hw/mcu/broadcom @@ -1 +1 @@ -Subproject commit e5343acdad77b8cf4a8d09b732a11ecef17d148a +Subproject commit 7a8f4b7471ad4aad2e808b3a4cc88b4c23b529f2 diff --git a/src/portable/broadcom/synopsys/dcd_synopsys.c b/src/portable/broadcom/synopsys/dcd_synopsys.c index e70e5d4f3..32cfd6d2a 100644 --- a/src/portable/broadcom/synopsys/dcd_synopsys.c +++ b/src/portable/broadcom/synopsys/dcd_synopsys.c @@ -31,6 +31,8 @@ #include "synopsys_common.h" +#include "broadcom/interrupts.h" + // Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval) // We disable SOF for now until needed later on #define USE_SOF 0 @@ -116,10 +118,10 @@ TU_VERIFY_STATIC(sizeof(USB_OTG_GlobalTypeDef) == 0x140, "size is incorrect"); // MACRO TYPEDEF CONSTANT ENUM //--------------------------------------------------------------------+ -#define RHPORT_REGS_BASE 0xfe980000 +#define RHPORT_REGS_BASE USB_OTG_GLOBAL_BASE #define GLOBAL_BASE(_port) ((USB_OTG_GlobalTypeDef*) RHPORT_REGS_BASE) -#define DEVICE_BASE(_port) (USB_OTG_DeviceTypeDef *) (RHPORT_REGS_BASE + USB_OTG_DEVICE_BASE) +#define DEVICE_BASE(_port) (USB_OTG_DeviceTypeDef *) (USB_OTG_DEVICE_BASE) #define OUT_EP_BASE(_port) (USB_OTG_OUTEndpointTypeDef *) (RHPORT_REGS_BASE + USB_OTG_OUT_ENDPOINT_BASE) #define IN_EP_BASE(_port) (USB_OTG_INEndpointTypeDef *) (RHPORT_REGS_BASE + USB_OTG_IN_ENDPOINT_BASE) #define FIFO_BASE(_port, _x) ((volatile uint32_t *) (RHPORT_REGS_BASE + USB_OTG_FIFO_BASE + (_x) * USB_OTG_FIFO_SIZE)) @@ -572,13 +574,13 @@ void dcd_init (uint8_t rhport) void dcd_int_enable (uint8_t rhport) { (void) rhport; - // NVIC_EnableIRQ(RHPORT_IRQn); + // BP_EnableIRQ(USB_IRQn); } void dcd_int_disable (uint8_t rhport) { (void) rhport; - // NVIC_DisableIRQ(RHPORT_IRQn); + // BP_DisableIRQ(USB_IRQn); } void dcd_set_address (uint8_t rhport, uint8_t dev_addr) diff --git a/src/portable/broadcom/synopsys/synopsys_common.h b/src/portable/broadcom/synopsys/synopsys_common.h index 2ec6f4487..81ce3b4a9 100644 --- a/src/portable/broadcom/synopsys/synopsys_common.h +++ b/src/portable/broadcom/synopsys/synopsys_common.h @@ -169,12 +169,12 @@ typedef struct /*!< USB registers base address */ #define USB_OTG_FS_PERIPH_BASE 0x50000000UL -#define USB_OTG_GLOBAL_BASE 0x00000000UL -#define USB_OTG_DEVICE_BASE 0x00000800UL +// #define USB_OTG_GLOBAL_BASE 0x00000000UL +// #define USB_OTG_DEVICE_BASE 0x00000800UL #define USB_OTG_IN_ENDPOINT_BASE 0x00000900UL #define USB_OTG_OUT_ENDPOINT_BASE 0x00000B00UL #define USB_OTG_EP_REG_SIZE 0x00000020UL -#define USB_OTG_HOST_BASE 0x00000400UL +// #define USB_OTG_HOST_BASE 0x00000400UL #define USB_OTG_HOST_PORT_BASE 0x00000440UL #define USB_OTG_HOST_CHANNEL_BASE 0x00000500UL #define USB_OTG_HOST_CHANNEL_SIZE 0x00000020UL