https://discuss.haiku-os.org/t/my-progress-on-real-risc-v-hardware/10963/31 Haiku Community My progress on real RISC-V hardware Development OS X512 July 11, 2021, 12:33pm #20 I uploaded photos with default Linux installed on NVMe disk. Tablet works as UART terminal. Haiku is not yet ready for GUI boot for now. CIMG4710 CIMG4711 23 Likes X512 July 11, 2021, 7:04pm #21 I managed to get PCI configuration space access and PCI bus enumeration working. pci_controller_init() hostCtrlType: sifive reg[0]: (0xe00000000, 0x100000000) reg[1]: (0xdf0000000, 0x10000000) reg[2]: (0x100d0000, 0x1000) configRegs: (0x60070000, 0x10000) dbiRegs: (0xe00000000, 0x100000000) interrupt-map: bus: 0, dev: 0, fn: 0, childIrq: 1, parentIrq: (10, 57) bus: 0, dev: 0, fn: 0, childIrq: 2, parentIrq: (10, 58) bus: 0, dev: 0, fn: 0, childIrq: 3, parentIrq: (10, 59) bus: 0, dev: 0, fn: 0, childIrq: 4, parentIrq: (10, 60) ranges: IOPORT (0x81000000): child: 60080000, parent: 60080000, len: 10000 MMIO32 (0x82000000): child: 60090000, parent: 60090000, len: ff70000 MMIO32 (0x82000000): child: 70000000, parent: 70000000, len: 1000000 MMIO64 (0xc3000000): child: 2000000000, parent: 2000000000, len: 2000000000 ATU: 0: base: 0x70000000, limit: 0x70ffffff, target: 0x70000000, ctrl1: 0x0, ctrl2: 0x80000000 1: base: 0x60080000, limit: 0x6008ffff, target: 0x60080000, ctrl1: 0x2, ctrl2: 0x80000000 AllocRegs() AllocRegsForDevice(bus: 0, device: 0, function: 0) vendorID: 0xf15e deviceID: 0x00 headerType: bridge primaryBus: 0 secondaryBus: 1 subordinateBus: 7 bar[0]: MMIO64, adr: 0x70000000, size: 0x100000 rom_bar: adr: 0x70100000, size: 0x10000 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 1, device: 0, function: 0) vendorID: 0x1b21 deviceID: 0x2824 headerType: bridge primaryBus: 1 secondaryBus: 2 subordinateBus: 7 bar[0]: MMIO32, adr: 0x0, size: 0x0 bar[1]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 2, device: 0, function: 0) vendorID: 0x1b21 deviceID: 0x2824 headerType: bridge primaryBus: 2 secondaryBus: 3 subordinateBus: 3 bar[0]: MMIO32, adr: 0x0, size: 0x0 bar[1]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 2, device: 2, function: 0) vendorID: 0x1b21 deviceID: 0x2824 headerType: bridge primaryBus: 2 secondaryBus: 4 subordinateBus: 4 bar[0]: MMIO32, adr: 0x0, size: 0x0 bar[1]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 2, device: 3, function: 0) vendorID: 0x1b21 deviceID: 0x2824 headerType: bridge primaryBus: 2 secondaryBus: 5 subordinateBus: 5 bar[0]: MMIO32, adr: 0x0, size: 0x0 bar[1]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 2, device: 4, function: 0) vendorID: 0x1b21 deviceID: 0x2824 headerType: bridge primaryBus: 2 secondaryBus: 6 subordinateBus: 6 bar[0]: MMIO32, adr: 0x0, size: 0x0 bar[1]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 2, device: 8, function: 0) vendorID: 0x1b21 deviceID: 0x2824 headerType: bridge primaryBus: 2 secondaryBus: 7 subordinateBus: 7 bar[0]: MMIO32, adr: 0x0, size: 0x0 bar[1]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 4, device: 0, function: 0) vendorID: 0x1b21 deviceID: 0x1142 headerType: generic bar[0]: MMIO64, adr: 0x70200000, size: 0x8000 bar[2]: MMIO32, adr: 0x0, size: 0x0 bar[3]: MMIO32, adr: 0x0, size: 0x0 bar[4]: MMIO32, adr: 0x0, size: 0x0 bar[5]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 6, device: 0, function: 0) vendorID: 0x1987 deviceID: 0x5013 headerType: generic bar[0]: MMIO64, adr: 0x70300000, size: 0x4000 bar[2]: MMIO32, adr: 0x0, size: 0x0 bar[3]: MMIO32, adr: 0x0, size: 0x0 bar[4]: MMIO32, adr: 0x0, size: 0x0 bar[5]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x0, size: 0x0 intLine: 57 intPin: INTA# AllocRegsForDevice(bus: 7, device: 0, function: 0) vendorID: 0x1002 deviceID: 0x683f headerType: ?(128) bar[0]: MMIO64, adr: 0x2000000000, size: 0x10000000 bar[2]: MMIO64, adr: 0x70400000, size: 0x40000 bar[4]: IOPORT, adr: 0x60080000, size: 0x100 bar[5]: MMIO32, adr: 0x0, size: 0x0 rom_bar: adr: 0x70440000, size: 0x20000 intLine: 57 intPin: INTA# PCI: FixupDevices: checking bus 1 behind f15e:0000 PCI: FixupDevices: checking bus 2 behind 1b21:2824 PCI: FixupDevices: checking bus 3 behind 1b21:2824 PCI: FixupDevices: checking bus 4 behind 1b21:2824 PCI: FixupDevices: checking bus 5 behind 1b21:2824 PCI: FixupDevices: checking bus 6 behind 1b21:2824 PCI: FixupDevices: checking bus 7 behind 1b21:2824 PCI: dom 0, bus 0, dev 0, func 0, changed PCI bridge control from 0x0000 to 0x0003 PCI: dom 0, bus 1, dev 0, func 0, changed PCI bridge control from 0x0008 to 0x000b PCI: dom 0, bus 2, dev 0, func 0, changed PCI bridge control from 0x0000 to 0x0003 PCI: dom 0, bus 2, dev 2, func 0, changed PCI bridge control from 0x0000 to 0x0003 PCI: dom 0, bus 2, dev 3, func 0, changed PCI bridge control from 0x0000 to 0x0003 PCI: dom 0, bus 2, dev 4, func 0, changed PCI bridge control from 0x0000 to 0x0003 PCI: dom 0, bus 2, dev 8, func 0, changed PCI bridge control from 0x0008 to 0x000b PCI: [dom 0, bus 0] bus 0, device 0, function 0: vendor f15e, device 0000, revision 00 PCI: class_base 06, class_function 04, class_api 00 PCI: line_size 08, latency 00, header_type 01, BIST 00 PCI: subsystem_id 0000, subsystem_vendor_id 0040 PCI: primary_bus 00, secondary_bus 01, subordinate_bus 07, secondary_latency 00 PCI: I/O window 0000-0fff PCI: memory window 70200000-704fffff PCI: prefetchable memory window 0000002000000000-000000200fffffff PCI: bridge_control 0003, secondary_status 0000 PCI: interrupt_line 39, interrupt_pin 01 PCI: ROM base host 70100000, pci 70100000, size ?? PCI: base reg 0: host 70000000, pci 70000000, size 00100000, flags 04 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PM, MSI, PCIe PCI: Extended capabilities: Advanced Error Reporting, Secondary PCIe, Vendor Unique PCI: [dom 0, bus 1] bus 1, device 0, function 0: vendor 1b21, device 2824, revision 01 PCI: class_base 06, class_function 04, class_api 00 PCI: line_size 08, latency 00, header_type 01, BIST 00 PCI: subsystem_id 0000, subsystem_vendor_id 0040 PCI: primary_bus 01, secondary_bus 02, subordinate_bus 07, secondary_latency 00 PCI: I/O window 60080000-60080fff PCI: memory window 70200000-704fffff PCI: prefetchable memory window 0000002000000000-000000200fffffff PCI: bridge_control 000b, secondary_status 0000 PCI: interrupt_line 39, interrupt_pin 01 PCI: ROM base host 00000000, pci 00000000, size ?? PCI: base reg 0: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PM, MSI, PCIe, subvendor PCI: Extended capabilities: Advanced Error Reporting, Power Budgeting, Latency Tolerance Reporting, Multicast, Secondary PCIe, Vendor Unique PCI: [dom 0, bus 2] bus 2, device 0, function 0: vendor 1b21, device 2824, revision 01 PCI: class_base 06, class_function 04, class_api 00 PCI: line_size 08, latency 00, header_type 01, BIST 00 PCI: subsystem_id 0000, subsystem_vendor_id 0040 PCI: primary_bus 02, secondary_bus 03, subordinate_bus 03, secondary_latency 00 PCI: I/O window 60080000-6007ffff PCI: memory window 70200000-701fffff PCI: prefetchable memory window 0000002000000000-0000001fffffffff PCI: bridge_control 0003, secondary_status 0000 PCI: interrupt_line 39, interrupt_pin 01 PCI: ROM base host 00000000, pci 00000000, size ?? PCI: base reg 0: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PM, MSI, PCIe, subvendor PCI: Extended capabilities: Advanced Error Reporting, Power Budgeting, Latency Tolerance Reporting, Multicast, Secondary PCIe, Vendor Unique PCI: [dom 0, bus 2] bus 2, device 2, function 0: vendor 1b21, device 2824, revision 01 PCI: class_base 06, class_function 04, class_api 00 PCI: line_size 08, latency 00, header_type 01, BIST 00 PCI: subsystem_id 0000, subsystem_vendor_id 0040 PCI: primary_bus 02, secondary_bus 04, subordinate_bus 04, secondary_latency 00 PCI: I/O window 60080000-6007ffff PCI: memory window 70200000-702fffff PCI: prefetchable memory window 0000002000000000-0000001fffffffff PCI: bridge_control 0003, secondary_status 0000 PCI: interrupt_line 39, interrupt_pin 01 PCI: ROM base host 00000000, pci 00000000, size ?? PCI: base reg 0: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PM, MSI, PCIe, subvendor PCI: Extended capabilities: Advanced Error Reporting, Power Budgeting, Latency Tolerance Reporting, Multicast, Secondary PCIe, Vendor Unique PCI: [dom 0, bus 4] bus 3, device 0, function 0: vendor 1b21, device 1142, revision 00 PCI: class_base 0c, class_function 03, class_api 30 PCI: line_size 08, latency 00, header_type 00, BIST 00 PCI: ROM base host 00000000, pci 00000000, size 00000000 PCI: cardbus_CIS 00000000, subsystem_id 1142, subsystem_vendor_id 1b21 PCI: interrupt_line 39, interrupt_pin 01, min_grant 00, max_latency 00 PCI: base reg 0: host 70200000, pci 70200000, size 00008000, flags 04 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 2: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 3: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 4: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 5: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: MSI, MSI-X, PM, PCIe PCI: Extended capabilities: Virtual Channel PCI: [dom 0, bus 2] bus 2, device 3, function 0: vendor 1b21, device 2824, revision 01 PCI: class_base 06, class_function 04, class_api 00 PCI: line_size 08, latency 00, header_type 01, BIST 00 PCI: subsystem_id 0000, subsystem_vendor_id 0040 PCI: primary_bus 02, secondary_bus 05, subordinate_bus 05, secondary_latency 00 PCI: I/O window 60080000-6007ffff PCI: memory window 70300000-702fffff PCI: prefetchable memory window 0000002000000000-0000001fffffffff PCI: bridge_control 0003, secondary_status 0000 PCI: interrupt_line 39, interrupt_pin 01 PCI: ROM base host 00000000, pci 00000000, size ?? PCI: base reg 0: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PM, MSI, PCIe, subvendor PCI: Extended capabilities: Advanced Error Reporting, Power Budgeting, Latency Tolerance Reporting, Multicast, Secondary PCIe, Vendor Unique PCI: [dom 0, bus 2] bus 2, device 4, function 0: vendor 1b21, device 2824, revision 01 PCI: class_base 06, class_function 04, class_api 00 PCI: line_size 08, latency 00, header_type 01, BIST 00 PCI: subsystem_id 0000, subsystem_vendor_id 0040 PCI: primary_bus 02, secondary_bus 06, subordinate_bus 06, secondary_latency 00 PCI: I/O window 60080000-6007ffff PCI: memory window 70300000-703fffff PCI: prefetchable memory window 0000002000000000-0000001fffffffff PCI: bridge_control 0003, secondary_status 0000 PCI: interrupt_line 39, interrupt_pin 01 PCI: ROM base host 00000000, pci 00000000, size ?? PCI: base reg 0: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PM, MSI, PCIe, subvendor PCI: Extended capabilities: Advanced Error Reporting, Power Budgeting, Latency Tolerance Reporting, Multicast, Secondary PCIe, Vendor Unique PCI: [dom 0, bus 6] bus 4, device 0, function 0: vendor 1987, device 5013, revision 01 PCI: class_base 01, class_function 08, class_api 02 PCI: line_size 08, latency 00, header_type 00, BIST 00 PCI: ROM base host 00000000, pci 00000000, size 00000000 PCI: cardbus_CIS 00000000, subsystem_id 5013, subsystem_vendor_id 1987 PCI: interrupt_line 39, interrupt_pin 01, min_grant 00, max_latency 00 PCI: base reg 0: host 70300000, pci 70300000, size 00004000, flags 04 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 2: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 3: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 4: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 5: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PCIe, MSI-X, MSI, PM PCI: Extended capabilities: Latency Tolerance Reporting, L1 Power Management Substates, Advanced Error Reporting, Secondary PCIe PCI: [dom 0, bus 2] bus 2, device 8, function 0: vendor 1b21, device 2824, revision 01 PCI: class_base 06, class_function 04, class_api 00 PCI: line_size 08, latency 00, header_type 01, BIST 00 PCI: subsystem_id 0000, subsystem_vendor_id 0040 PCI: primary_bus 02, secondary_bus 07, subordinate_bus 07, secondary_latency 00 PCI: I/O window 60080000-60080fff PCI: memory window 70400000-704fffff PCI: prefetchable memory window 0000002000000000-000000200fffffff PCI: bridge_control 000b, secondary_status 0000 PCI: interrupt_line 39, interrupt_pin 01 PCI: ROM base host 00000000, pci 00000000, size ?? PCI: base reg 0: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: PM, MSI, PCIe, subvendor PCI: Extended capabilities: Advanced Error Reporting, Power Budgeting, Latency Tolerance Reporting, Multicast, Secondary PCIe, Vendor Unique PCI: [dom 0, bus 7] bus 5, device 0, function 0: vendor 1002, device 683f, revision 87 PCI: class_base 03, class_function 00, class_api 00 PCI: line_size 08, latency 00, header_type 80, BIST 00 PCI: ROM base host 70440000, pci 70440000, size 00020000 PCI: cardbus_CIS 00000000, subsystem_id 7250, subsystem_vendor_id 1787 PCI: interrupt_line 39, interrupt_pin 01, min_grant 00, max_latency 00 PCI: base reg 0: host 00000000, pci 00000000, size 10000000, flags 0c PCI: base reg 1: host 00000020, pci 00000020, size 00000000, flags 00 PCI: base reg 2: host 70400000, pci 70400000, size 00040000, flags 04 PCI: base reg 3: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 4: host 00000000, pci 60080000, size 00000100, flags 01 PCI: base reg 5: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: vendspec, PM, PCIe, MSI PCI: Extended capabilities: Vendor Unique, Advanced Error Reporting, Resizable Bar, Secondary PCIe PCI: [dom 0, bus 7] bus 5, device 0, function 1: vendor 1002, device aab0, revision 00 PCI: class_base 04, class_function 03, class_api 00 PCI: line_size 08, latency 00, header_type 80, BIST 00 PCI: ROM base host 00000000, pci 00000000, size 00000000 PCI: cardbus_CIS 00000000, subsystem_id aab0, subsystem_vendor_id 1787 PCI: interrupt_line ff, interrupt_pin 02, min_grant 00, max_latency 00 PCI: base reg 0: host 70460000, pci 70460000, size 00004000, flags 04 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 2: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 3: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 4: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 5: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: vendspec, PM, PCIe, MSI PCI: Extended capabilities: Vendor Unique, Advanced Error Reporting PCI: [dom 0, bus 7] bus 5, device 0, function 2: vendor 1002, device ad18, revision 00 PCI: class_base 04, class_function 80, class_api 00 PCI: line_size 08, latency 00, header_type 80, BIST 00 PCI: ROM base host 00000000, pci 00000000, size 00000000 PCI: cardbus_CIS 00000000, subsystem_id ad18, subsystem_vendor_id 1787 PCI: interrupt_line ff, interrupt_pin 03, min_grant 00, max_latency 00 PCI: base reg 0: host 70464000, pci 70464000, size 00000080, flags 04 PCI: base reg 1: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 2: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 3: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 4: host 00000000, pci 00000000, size 00000000, flags 00 PCI: base reg 5: host 00000000, pci 00000000, size 00000000, flags 00 PCI: Capabilities: vendspec, PM, PCIe, MSI PCI: Extended capabilities: Vendor Unique, Advanced Error Reporting XHCI controller and NVMe disk are recognized, but currently not working properly because of not working PCI interrupts. usb xhci: failed to get pci x86 module usb xhci -1: interface version: 0x0100 usb xhci -1: structural parameters: 1:0x04000840 2:0x000000f1 3:0x00000000 usb xhci -1: capability parameters: 0x0200e081 INIT: main: done... begin idle loop on cpu 0 arch_thread_init_kthread_stack(0xffffffc006aab000(xhci event thread)) arch_thread_init_kthread_stack(0xffffffc006aaa500(xhci finish thread)) arch_int_enable_io_interrupt(57) usb xhci -1: starting XHCI host controller usb xhci -1: successfully started the controller module: Search for bus_managers/pci/x86/v1 failed. usb uhci: failed to get pci x86 module usb uhci: no devices found module: Search for bus_managers/pci/x86/v1 failed. usb ohci: failed to get pci x86 module usb ohci: no devices found module: Search for bus_managers/pci/x86/v1 failed. usb ehci: failed to get pci x86 module usb ehci: no devices found arch_thread_init_kthread_stack(0xffffffc006aaaa80(usb explore)) usb hub 2: port 0: new device connected usb error control pipe 7: timeout waiting for queued request to complete usb xhci 0: cancel queued transfers (1) for pipe 0xffffffc00096ede8 (0) usb xhci 0: transfer error on slot 1 endpoint 1: Stopped usb error xhci 0: TRB 0x81671020 was not found in the endpoint! usb error xhci 0: failed to get the device descriptor: Operation timed out usb hub 2: port 0 was warm reset nvme_disk: attached to NVMe device "SPCC M.2 PCIe SSD (7EF607140B6800005305)" nvme_disk: maximum transfer size: 262144 nvme_disk: qpair count: 8 nvme_disk: timed out waiting for interrupt! NVMe driver even managed to read something with not working interrupts: [ 0] partition type: 5b193300-fc78-40cd-8002-e86c45580b47 unique id: caa86a79-eb57-4306-ae66-61ba1975c038 start block: 34 end block: 2081 size: 0.999 MB attributes: 0 name: primary [ 1] partition type: 2e54b353-1271-4842-806f-e436d6af6985 unique id: 5c2ddb18-ceaa-4389-aeba-6838e33cc54c start block: 2082 end block: 10273 size: 3.999 MB attributes: 0 name: primary [ 2] partition type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 unique id: 912a9078-3af3-4e50-8d29-c544030e486e start block: 16384 end block: 282623 size: 129.999 MB attributes: 4 name: boot [ 3] partition type: 0fc63daf-8483-4772-8e79-3d69d8477de4 unique id: 2a34702b-93d3-44ff-8129-9c68a8e94119 start block: 286720 end block: 249204735 size: 121541.999 MB attributes: 0 name: root 32 Likes dcatt July 11, 2021, 8:37pm #22 You know everyone in the Haiku community is cheering you on, right? This is great stuff! 11 Likes X512 July 12, 2021, 11:46pm #23 It seems that PCI pin interrupts are not supported and MSI interrupts need to be implemented. Current PCI MSI driver interface is defined as x86-specific. I think that architecture-specific MSI interrupts handling is a bad idea and PCI MSI driver API should be made architecture-independent. 15 Likes X512 July 15, 2021, 6:53pm #24 I managed to get interrupts working and now it progress to userland and running launch_daemon, but after that something goes wrong. Real problem with interrupts was not PCI, it was PLIC (interrupt controller). First PLIC require setting CPU core ID (HART (HARdwate Thread) ID in RISC-V terminology) when working with interrupts. Zero ID was used before because SMP was not used when testing on emulator. HiFive Unmatched never boots from core No. 0 because zero core is a special embedded core with lower performance and machine mode only supported. It is not suitable for running general purpose OS. So actually 5 cores are present: 4 regular cores with ID 1...4 and one embedded core with ID 0. U-boot pass boot core ID by FDT table (/chosen/boot-hartid). I passed it to kernel args and used for interrupt controller. That is not all. PLIC can separately handle interrupts from different cores and machine and supervisor mode. Context ID is used to identify interrupt handler target. Usually it is calculated by context = mode + 2*hartId, but not in this case. Special embedded core with ID 0 have no supervisor mode so context IDs become shifted by one. For regular cores formula become context = mode + 2*hartId - 1. I am currently not sure how to detect and handle this in a proper way, shift is currently hardcoded. After PLIC fixed interrupts started working and USB and NVMe disks are now successful read. Maybe implementing PCI MSI interrupt handling was not required and old interrupt pins are working, but MSI is already implemented and working anyway (with some hacks). UART log. 17 Likes X512 July 15, 2021, 7:42pm #25 Currently I hit #15569. PMA: bad value for allocate (163792 bytes) usb error xhci 0: failed to allocate TRBs PANIC: failed to queue data transfer: Out of memory Welcome to Kernel Debugging Land... Thread 627 "launch_daemon" running on CPU 0 Stack: FP: 0xffffffc00246cbf0 FP: 0xffffffc00246cd00, PC: 0xffffffc00215a875 arch_debug_call_with_fault_handler + 91 FP: 0xffffffc00246cd50, PC: 0xffffffc0020d24eb debug_call_with_fault_handler.localalias.7 + 129 FP: 0xffffffc00246cde0, PC: 0xffffffc0020d3b15 _ZL20kernel_debugger_loopPKcS0_Pvi + 299 FP: 0xffffffc00246ce50, PC: 0xffffffc0020d3e01 _ZL24kernel_debugger_internalPKcS0_Pvi + 135 FP: 0xffffffc00246ce90, PC: 0xffffffc0020d4149 panic + 101 FP: 0xffffffc00246cf20, PC: 0xffffffc00243e30b _Z22usb_disk_transfer_dataP13disk_device_sbPvm.localalias .12 + 253 FP: 0xffffffc00246cfb0, PC: 0xffffffc00243e7a3 _Z23usb_disk_operation_bulkP12device_lun_sPhmPvPmbP7err_a ct.localalias.8 + 505 FP: 0xffffffc00246d010, PC: 0xffffffc00243eb2f _ZL19usb_disk_block_readP12device_lun_sjtPvPm + 277 FP: 0xffffffc00246d070, PC: 0xffffffc00243ecb5 _ZL13usb_disk_readPvlS_Pm + 147 FP: 0xffffffc00246d0f0, PC: 0xffffffc0021159eb _ZL14synchronous_ioP9IORequestR4DoIO + 89 FP: 0xffffffc00246d120, PC: 0xffffffc002124d47 vfs_synchronous_io + 49 FP: 0xffffffc00246d170, PC: 0xffffffc0020ef979 _ZL8devfs_ioP9fs_volumeP8fs_vnodePvP9IORequest + 20 5 FP: 0xffffffc00246d1c0, PC: 0xffffffc002124a99 vfs_vnode_io.localalias.0 + 37 FP: 0xffffffc00246d2c0, PC: 0xffffffc002124bfb _ZL26do_iterative_fd_io_iteratePvP9IORequestPb + 27 1 FP: 0xffffffc00246d310, PC: 0xffffffc00212503b do_iterative_fd_io + 193 FP: 0xffffffc00246d360, PC: 0xffffffc002124a99 vfs_vnode_io.localalias.0 + 37 FP: 0xffffffc00246d3f0, PC: 0xffffffc00208521b cache_prefetch_vnode.localalias.0 + 483 FP: 0xffffffc00246d5e0, PC: 0xffffffc0021433fd _ZL12_vm_map_fileiPKcPPvjmjjbilb + 935 FP: 0xffffffc00246d6a0, PC: 0xffffffc0021461fb _user_map_file + 221 FP: 0xffffffc00246d6e0, PC: 0xffffffc0020a67cd syscall_dispatcher + 1705 FP: 0xffffffc00246d7d0, PC: 0xffffffc00215bb37 STrap + 575 FP: 0xffffffc00246d8d0, PC: 0xffffffc002159b0d SVecU + 109 FP: 0x3df7b039e0, PC: 0x2686252d87 0x15d87 FP: 0x3df7b04ee0, PC: 0x268624a5ef 0xd5ef FP: 0x3df7b04f70, PC: 0x26862484ed 0xb4ed FP: 0x3df7b04fd0, PC: 0x26862488cd 0xb8cd FP: 0x3df7b05000, PC: 0x268624f72d 0x1272d FP: 0xffffffc00246d900, PC: 0xffffffc00215c3a7 arch_thread_enter_userspace + 145 FP: 0xffffffc00246da30, PC: 0xffffffc0020b01bb _ZL15enter_userspacePN7BKernel6ThreadEP24UserThread EntryArguments + 109 FP: 0xffffffc00246da90, PC: 0xffffffc0020b1cfb thread_enter_userspace_new_team + 57 FP: 0xffffffc00246df80, PC: 0xffffffc0020aa6b5 _ZL33team_create_thread_start_internalPv + 651 FP: 0xffffffc00246df90, PC: 0xffffffc0020abeff _ZL24team_create_thread_startPv + 15 FP: 0xffffffc00246dfb0, PC: 0xffffffc0020b4e87 _ZL19common_thread_entryPv + 57 FP: 0x0, PC: 0xffffffc0021599e5 arch_thread_entry + 3 kdebug> 6 Likes X512 July 15, 2021, 8:07pm #26 After adding some hack to cache prefetch and adding radeon_hd driver to image, it now runs userland and attempts to initialize graphics card, but fails. Something seems wrong with PCI register allocation. radeon_hd: device_open: open(name = graphics/radeon_hd_050000) radeon_hd: card(0): radeon_hd_init: called radeon_hd: radeon_hd_init: card(0): Radeon Cape Verde 1002:683F radeon_hd: radeon_hd_init: Error: found 0MB video ram, using PCI bar size... radeon_hd: radeon_hd_init: mapping a frame buffer of 256MB out of 0MB video ram radeon_hd: card(0): radeon_hd_getbios: called radeon_hd: radeon_hd_getbios: ACPI ATRM AtomBIOS TODO radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 0 at 0x0 radeon_hd: radeon_hd_getbios: No base found at PCI FB BAR radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 1 at 0x0 radeon_hd: radeon_hd_getbios: PCI ROM decode enabled radeon_hd: mapAtomBIOS: seeking AtomBIOS @ 0x70440000 [size: 0x20000] radeon_hd: mapAtomBIOS: AtomBIOS verified and locked radeon_hd: radeon_hd_getbios: AtomBIOS found using active method 2 at 0x70440000 radeon_hd: card(0): radeon_hd_init didn't find VESA EDID modes. radeon_hd: card(0): radeon_hd_init completed successfully! radeon_hd: card(0): GPU thermal status: 40C radeon_hd: device_ioctl: accelerant: radeon_hd.accelerant 8 Likes tialaramex July 15, 2021, 8:11pm #27 Subclass 0x80 (for that "mystery" element of the Radeon chipset) is vendor defined. so it is likely to be fine to entirely ignore this mysterious PCI device entry, especially this early in the bring-up. 2 Likes X512 July 15, 2021, 8:52pm #28 Video driver progressed a bit. Now it traps because of attempt to write to illegal physical address. radeon_hd: init_hardware radeon_hd: init_driver radeon_hd: init_driver: GPU(0) Radeon HD 7750, revision = 0x87 radeon_hd: publish_devices radeon_hd: find_device loaded driver /boot/system/add-ons/kernel/drivers/dev/graphics/radeon_hd vesa: init_hardware() radeon_hd: device_open: open(name = graphics/radeon_hd_050000) radeon_hd: card(0): radeon_hd_init: called radeon_hd: radeon_hd_init: card(0): Radeon Cape Verde 1002:683F radeon_hd: radeon_hd_init: Error: found 0MB video ram, using PCI bar size... radeon_hd: radeon_hd_init: mapping a frame buffer of 256MB out of 0MB video ram radeon_hd: card(0): radeon_hd_getbios: called radeon_hd: radeon_hd_getbios: ACPI ATRM AtomBIOS TODO radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 0 at 0x0 radeon_hd: radeon_hd_getbios: No base found at PCI FB BAR radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 1 at 0x0 radeon_hd: radeon_hd_getbios: PCI ROM decode enabled radeon_hd: mapAtomBIOS: seeking AtomBIOS @ 0x70440000 [size: 0x20000] radeon_hd: mapAtomBIOS: AtomBIOS verified and locked radeon_hd: radeon_hd_getbios: AtomBIOS found using active method 2 at 0x70440000 radeon_hd: card(0): radeon_hd_init didn't find VESA EDID modes. radeon_hd: card(0): radeon_hd_init completed successfully! radeon_hd: card(0): GPU thermal status: 41C radeon_hd: device_ioctl: accelerant: radeon_hd.accelerant radeon_hd: radeon_init_accelerant enter radeon_hd: radeon_dump_bios: Dumping AtomBIOS as ATOM_DEBUG is set... radeon_hd: radeon_dump_bios: AtomBIOS dumped to /boot/system/cache/tmp/radeon_hd_bios_1002_683f_0.bin radeon_hd: radeon_init_bios: init AtomBIOS for this card as it is not not posted radeon_hd: atom_op_calltable: table: unknown (80) Last message repeated 4 times. radeon_hd: radeon_gpu_probe: table 2.2 radeon_hd: gpio_general_populate: general GPIO @ 0, valid: true, hwPin: 0x1 radeon_hd: gpio_general_populate: general GPIO @ 1, valid: true, hwPin: 0x2 radeon_hd: gpio_general_populate: general GPIO @ 2, valid: true, hwPin: 0x3 radeon_hd: gpio_general_populate: general GPIO @ 3, valid: true, hwPin: 0x4 radeon_hd: gpio_general_populate: general GPIO @ 4, valid: true, hwPin: 0x5 radeon_hd: gpio_general_populate: general GPIO @ 5, valid: true, hwPin: 0x6 radeon_hd: gpio_i2c_populate: i2c GPIO @ 6, valid: true, hwPin: 0x90 radeon_hd: gpio_i2c_populate: i2c GPIO @ 7, valid: true, hwPin: 0x91 radeon_hd: gpio_i2c_populate: i2c GPIO @ 8, valid: true, hwPin: 0x92 radeon_hd: gpio_i2c_populate: i2c GPIO @ 9, valid: true, hwPin: 0x93 radeon_hd: gpio_i2c_populate: i2c GPIO @ 10, valid: true, hwPin: 0x94 radeon_hd: gpio_i2c_populate: i2c GPIO @ 11, valid: true, hwPin: 0x95 radeon_hd: gpio_i2c_populate: i2c GPIO @ 12, valid: true, hwPin: 0x96 radeon_hd: gpio_i2c_populate: i2c GPIO @ 13, valid: true, hwPin: 0x97 radeon_hd: connector_probe: found 3 potential display paths. radeon_hd: pll_limit_probe: table 2.2 radeon_hd: pll_limit_probe: referenceFreq: 27000; pllOutMin: 600000; pllOutMax: 1200000; pllInMin: 6750;pllInMax: 27000 radeon_hd: pll_limit_probe: table 2.2 radeon_hd: pll_limit_probe: referenceFreq: 27000; pllOutMin: 600000; pllOutMax: 1200000; pllInMin: 6750;pllInMax: 27000 radeon_hd: pll_limit_probe: table 2.2 radeon_hd: pll_limit_probe: referenceFreq: 27000; pllOutMin: 600000; pllOutMax: 1200000; pllInMin: 6750;pllInMax: 27000 radeon_hd: Currently detected connectors============= radeon_hd: Connector #0) radeon_hd: + connector: HDMI A radeon_hd: + i2c gpio table id: 7 radeon_hd: - gpio hw pin: 0x91 radeon_hd: - gpio valid: true radeon_hd: - i2c valid: true radeon_hd: + hpd gpio table id: 0 radeon_hd: - gpio hw pin: 0x1 radeon_hd: - gpio valid: true radeon_hd: + encoder: TMDS radeon_hd: - id: 30 radeon_hd: - type: Internal Kaleidoscope UNIPHY radeon_hd: - capabilities: 0x0 radeon_hd: - enumeration: 1 radeon_hd: - is bridge: false radeon_hd: + external encoder: none radeon_hd: + flags: radeon_hd: * device DFP1 support radeon_hd: Connector #1) radeon_hd: + connector: DVI-D (Digital Only) radeon_hd: + i2c gpio table id: 6 radeon_hd: - gpio hw pin: 0x90 radeon_hd: - gpio valid: true radeon_hd: - i2c valid: true radeon_hd: + hpd gpio table id: 1 radeon_hd: - gpio hw pin: 0x2 radeon_hd: - gpio valid: true radeon_hd: + encoder: TMDS radeon_hd: - id: 30 radeon_hd: - type: Internal Kaleidoscope UNIPHY radeon_hd: - capabilities: 0x0 radeon_hd: - enumeration: 2 radeon_hd: - is bridge: false radeon_hd: + external encoder: none radeon_hd: + flags: radeon_hd: * device DFP2 support radeon_hd: Connector #2) radeon_hd: + connector: VGA radeon_hd: + i2c gpio table id: 10 radeon_hd: - gpio hw pin: 0x94 radeon_hd: - gpio valid: true radeon_hd: - i2c valid: true radeon_hd: + hpd gpio table id: 0 radeon_hd: - gpio hw pin: 0x1 radeon_hd: - gpio valid: true radeon_hd: + encoder: TV DAC radeon_hd: - id: 21 radeon_hd: - type: Internal Kaleidoscope DAC1 radeon_hd: - capabilities: 0x0 radeon_hd: - enumeration: 1 radeon_hd: - is bridge: false radeon_hd: + external encoder: none radeon_hd: + flags: radeon_hd: * device CRT1 support radeon_hd: ========================================== radeon_hd: encoder_init: called radeon_hd: transmitter_dig_setup: connector 0, pixelClock: 0 radeon_hd: transmitter_dig_setup: table 1.5 radeon_hd: encoder_pick_dig: connector 0 radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 0 radeon_hd: transmitter_dig_setup: table 1.5 radeon_hd: encoder_pick_dig: connector 1 radeon_hd: pll_set_external: set external pll clock to 600000 radeon_hd: pll_set_external: table 1.6 radeon_hd: dp_setup_connectors radeon_hd: detect_displays: connector(0): bit-banging ddc for EDID. DDC: ddc2_read: DDC information read failure Last message repeated 3 times. radeon_hd: detect_displays: connector(1): bit-banging ddc for EDID. radeon_hd: connector_read_edid: found edid monitor on connector #1 radeon_hd: detect_displays: connector(1): found EDID data. radeon_hd: init_registers, registers for ATI chipset Cape Verde crt #0 loaded radeon_hd: detect_displays: connector(2): bit-banging ddc for EDID. DDC: ddc2_read: DDC information read failure Last message repeated 3 times. radeon_hd: Currently detected monitors=============== radeon_hd: Display #0 attached = true radeon_hd: + connector ID: 1 radeon_hd: + connector type: DVI-D (Digital Only) radeon_hd: + encoder type: TMDS radeon_hd: + limits: Vert Min/Max: 56/75 radeon_hd: + limits: Horz Min/Max: 30/80 radeon_hd: Display #1 attached = false radeon_hd: ========================================== radeon_hd: radeon_gpu_mc_setup: vramStart: 0x0, vramEnd: 0xFFFFFFF radeon_hd: radeon_gpu_ring_setup called radeon_hd: RingQueue: Requested 1048576 bytes for GFX RingQueue. radeon_hd: RingQueue: Allocating 1048576 bytes for GFX RingQueue. radeon_hd: radeon_gpu_ring_boot called radeon_hd: radeon_gpu_ring_boot: TODO radeon_hd: radeon_init_accelerant done radeon_hd: radeon_get_edid_info radeon_hd: encoder_output_lock: true radeon_hd: display_crtc_lock radeon_hd: encoder_dpms_set: display 0, power: false radeon_hd: encoder_dpms_set_dig: display 0, power: false radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 0 radeon_hd: transmitter_dig_setup: table 1.5 radeon_hd: encoder_pick_dig: connector 1 radeon_hd: display_crtc_dpms: crtc 0 dpms powerdown radeon_hd: display_crtc_blank radeon_hd: display_crtc_power radeon_hd: encoder_assign_crtc radeon_hd: encoder_assign_crtc: table 1.2 radeon_hd: encoder_pick_dig: connector 1 radeon_hd: encoder_crtc_scratch: display 0 radeon_hd: radeon_set_display_mode: pll 0 selected for connector 1 radeon_hd: pll_asic_ss_probe: ss match found radeon_hd: pll_setup_flags: CRTC: 0, PLL: 0 radeon_hd: pll_adjust: table 1.3 radeon_hd: pll_adjust: was: 64996, now: 64990 radeon_hd: pll_compute_post_divider: vco = 600000 radeon_hd: pll_compute_post_divider: postDiv = 9 radeon_hd: pll_compute: using minimum reference divider radeon_hd: pll_compute: performing fractional feedback calculations radeon_hd: pll_compute: Calculated pixel clock of 65000 based on: radeon_hd: pll_compute: referenceFrequency: 27000; referenceDivider: 3 radeon_hd: pll_compute: feedbackDivider: 65; feedbackDividerFrac: 0 radeon_hd: pll_compute: postDivider: 9 radeon_hd: pll_compute: pixel clock 64990 was changed to 65000 radeon_hd: pll_set: table 1.6 radeon_hd: pll_set: set adjusted pixel clock 65000 (was 64996) radeon_hd: atom_op_jump: Error: AtomBIOS stuck in loop for more then 5 seconds. (404531 identical jmp op's) radeon_hd: atom_execute_table_locked: AtomBIOS parser aborted calling operation DELAY_MICROSEC (0x51) @ 0xC2D9 radeon_hd: atom_execute_table: AtomBIOS parser was aborted in table SetPixelClock (0xC) radeon_hd: display_crtc_ss radeon_hd: display_crtc_ss: external SS, ignoring SS request radeon_hd: display_crtc_set_dtd called to do 1024x768 radeon_hd: display_crtc_fb_set: Framebuffer at: 0x0 radeon_hd: display_crtc_fb_set: Set SurfaceAddress High: 0x0 radeon_hd: display_crtc_fb_set: Set SurfaceAddress: 0x0 radeon_hd: display_crtc_fb_set: fb: 1024x768 (32 bpp) radeon_hd: display_crtc_fb_set: fb pitch: 1024 radeon_hd: display_dce45_crtc_load_lut: crtcID 0 radeon_hd: display_crtc_scale radeon_hd: encoder_mode_set: display 0 radeon_hd: encoder_dig_setup radeon_hd: encoder_pick_dig: connector 1 radeon_hd: encoder_dig_setup: table 1.4 radeon_hd: encoder_dig_setup radeon_hd: encoder_pick_dig: connector 1 radeon_hd: encoder_dig_setup: table 1.4 radeon_hd: encoder_apply_quirks: display 0 radeon_hd: display_crtc_dpms: crtc 0 dpms powerup radeon_hd: display_crtc_power radeon_hd: display_crtc_blank radeon_hd: encoder_dpms_set: display 0, power: true radeon_hd: encoder_dpms_set_dig: display 0, power: true radeon_hd: encoder_dig_setup radeon_hd: encoder_pick_dig: connector 1 radeon_hd: encoder_dig_setup: table 1.4 radeon_hd: encoder_dig_setup radeon_hd: encoder_pick_dig: connector 1 radeon_hd: encoder_dig_setup: table 1.4 radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 65000 radeon_hd: transmitter_dig_setup: table 1.5 radeon_hd: encoder_pick_dig: connector 1 radeon_hd: display_crtc_lock radeon_hd: encoder_output_lock: false radeon_hd: Current DisplayPort Info ================= radeon_hd: Connector #0) DP: false radeon_hd: Connector #1) DP: false radeon_hd: Connector #2) DP: false radeon_hd: ========================================== radeon_hd: D1CRTC_STATUS Value: 0x2 radeon_hd: D2CRTC_STATUS Value: 0x0 radeon_hd: D1CRTC_CONTROL Value: 0x0 radeon_hd: D2CRTC_CONTROL Value: 0x0 radeon_hd: D1GRPH_ENABLE Value: 0x0 radeon_hd: D2GRPH_ENABLE Value: 0x0 radeon_hd: D1SCL_ENABLE Value: 0x0 radeon_hd: D2SCL_ENABLE Value: 0x0 radeon_hd: D1CRTC_BLANK_CONTROL Value: 0x0 radeon_hd: D2CRTC_BLANK_CONTROL Value: 0x0 radeon_hd: radeon_get_frame_buffer_config radeon_hd: display_crtc_dpms: crtc 0 dpms powerup radeon_hd: display_crtc_power radeon_hd: display_crtc_blank radeon_hd: encoder_dpms_set: display 0, power: true radeon_hd: encoder_dpms_set_dig: display 0, power: true radeon_hd: encoder_dig_setup radeon_hd: encoder_pick_dig: connector 1 radeon_hd: encoder_dig_setup: table 1.4 radeon_hd: encoder_dig_setup radeon_hd: encoder_pick_dig: connector 1 radeon_hd: encoder_dig_setup: table 1.4 radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 65000 radeon_hd: transmitter_dig_setup: table 1.5 radeon_hd: encoder_pick_dig: connector 1 arch_thread_init_kthread_stack(0xffffffc006aa7e80(create_app_meta_mime (s))) arch_thread_enter_uspace() arch_thread_init_kthread_stack(0xffffffc006aa7e80(input_server)) arch_thread_enter_uspace() STrap(exception storeAccessFault) sstatus: (ie: {}, pie: {s}, spp: u, sum: 0) sie: {sTimer, sExtern} sip: {} stval: 0xffffffc12b802000 tp: 0xffffffc006aa7380(app_server) PANIC: unhandled STrap Welcome to Kernel Debugging Land... Thread 632 "app_server" running on CPU 0 Stack: FP: 0xffffffc002495400 FP: 0xffffffc002495510, PC: 0xffffffc00215a645 arch_debug_call_with_fault_handler + 91 FP: 0xffffffc002495560, PC: 0xffffffc0020d22b1 debug_call_with_fault_handler.localalias.7 + 129 FP: 0xffffffc0024955f0, PC: 0xffffffc0020d38db _ZL20kernel_debugger_loopPKcS0_Pvi + 299 FP: 0xffffffc002495660, PC: 0xffffffc0020d3bc7 _ZL24kernel_debugger_internalPKcS0_Pvi + 135 FP: 0xffffffc0024956a0, PC: 0xffffffc0020d3f0f panic + 101 FP: 0xffffffc0024957d0, PC: 0xffffffc00215b857 STrap + 399 FP: 0xffffffc0024958d0, PC: 0xffffffc0021598dd SVecU + 109 FP: 0x3eb9959830, PC: 0x26f907fc87 0xe7c87 FP: 0x3eb9959880, PC: 0x26f908004f 0xe804f FP: 0x3eb99598e0, PC: 0x26f906796d 0xcf96d FP: 0x3eb9959980, PC: 0x26f908164b 0xe964b FP: 0x3eb99599d0, PC: 0x26f907f6c9 0xe76c9 FP: 0x3eb9959a90, PC: 0x26f9079da9 0xe1da9 FP: 0x3eb9959b00, PC: 0x26f9018351 0x80351 FP: 0x3eb9959bb0, PC: 0x26f901bef7 0x83ef7 FP: 0x3eb9959bf0, PC: 0x26f90109f7 0x789f7 FP: 0x3eb9959ca0, PC: 0x26f9010c0f 0x78c0f FP: 0x3eb9959ef0, PC: 0x22bd968b69 0x141b69 FP: 0x3eb9959f50, PC: 0x22bd96f919 0x148919 FP: 0x3eb9959f70, PC: 0x22bd9660d9 0x13f0d9 FP: 0x3eb9959fa0, PC: 0x26f900fec7 0x77ec7 FP: 0x3eb9959fd0, PC: 0x26f9010239 0x78239 FP: 0x3eb995a000, PC: 0x2dca6fe743 0x12743 FP: 0xffffffc002495900, PC: 0xffffffc00215c177 arch_thread_enter_userspace + 145 FP: 0xffffffc002495a30, PC: 0xffffffc0020aff81 _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 109 FP: 0xffffffc002495a90, PC: 0xffffffc0020b1ac1 thread_enter_userspace_new_team + 57 FP: 0xffffffc002495f80, PC: 0xffffffc0020aa47b _ZL33team_create_thread_start_internalPv + 651 FP: 0xffffffc002495f90, PC: 0xffffffc0020abcc5 _ZL24team_create_thread_startPv + 15 FP: 0xffffffc002495fb0, PC: 0xffffffc0020b4c4d _ZL19common_thread_entryPv + 57 FP: 0x0, PC: 0xffffffc0021597b5 arch_thread_entry + 3 kdebug> If someone (@kallisti5?) knows how radeon_hd driver works, please tell what is happening. 10 Likes kallisti5 July 15, 2021, 10:04pm #29 # X512: If someone (@kallisti5?) knows how radeon_hd driver works, please tell what is happening. heh. This is the first time my radeon_hd driver has run on anything except x86 :slight_smile: Here's a rundown: * AMD cards have something called "atombios". Essentially there is code that executes from the card itself. atombios has it's own simple ISA + opcode design. * Atombios has a data and function area. + data contains important card + state information + function is the list of functions (applications?) available to execute on the card and where they live. The host's driver executes the atombios functions to do various things on the card in a card-specific way. I would enable ATOMBIOS tracing. It will give you a LOT of insight into what Atombios is doing down to the opcodes being issued. https://git.haiku-os.org/haiku/tree/src/add-ons/accelerants/radeon_hd /atombios/atom.cpp#n44 15 Likes X512 July 17, 2021, 9:39am #30 After some obvious fixes such as proper handling of 64 bit PCI BARs and enabling MMIO decoding and also using VGA connector it started to display something. Now it crash in app_server Deskbar thread. "storeAccessFault" is illegal attempt to write to physical memory. STrap(exception storeAccessFault) sstatus: (ie: {}, pie: {s}, spp: u, sum: 0) sie: {sTimer, sExtern} sip: {} stval: 0xffffffc12b802be4 tp: 0xffffffc001468440(w:699:Deskbar) PANIC: unhandled STrap Welcome to Kernel Debugging Land... Thread 721 "w:699:Deskbar" running on CPU 0 Stack: FP: 0xffffffc00252a960 FP: 0xffffffc00252aa70, PC: 0xffffffc00215a645 arch_debug_call_with_fault_handler + 91 FP: 0xffffffc00252aac0, PC: 0xffffffc0020d22b1 debug_call_with_fault_handler.localalias.7 + 129 FP: 0xffffffc00252ab50, PC: 0xffffffc0020d38db _ZL20kernel_debugger_loopPKcS0_Pvi + 299 FP: 0xffffffc00252abc0, PC: 0xffffffc0020d3bc7 _ZL24kernel_debugger_internalPKcS0_Pvi + 135 FP: 0xffffffc00252ac00, PC: 0xffffffc0020d3f0f panic + 101 FP: 0xffffffc00252ad30, PC: 0xffffffc00215b857 STrap + 399 FP: 0xffffffc00252ae30, PC: 0xffffffc0021598dd SVecU + 109 FP: 0x366d9c4cb0, PC: 0x165e8acc87 0xe7c87 FP: 0x366d9c4d00, PC: 0x165e8ad04f 0xe804f FP: 0x366d9c4d60, PC: 0x165e89496d 0xcf96d FP: 0x366d9c4e00, PC: 0x165e8ae64b 0xe964b FP: 0x366d9c4e50, PC: 0x165e8ac6c9 0xe76c9 FP: 0x366d9c4e80, PC: 0x165e87d049 0xb8049 FP: 0x366d9c4f40, PC: 0x165e874fbf 0xaffbf FP: 0x366d9c4fd0, PC: 0x165e86fd3b 0xaad3b FP: 0x366d9c4fe0, PC: 0x165e852b05 0x8db05 FP: 0x366d9c5000, PC: 0x1416808f85 0x3bf85 FP: 0xffffffc00252ae60, PC: 0xffffffc00215c177 arch_thread_enter_userspace + 145 FP: 0xffffffc00252af90, PC: 0xffffffc0020aff81 _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 109 FP: 0xffffffc00252afb0, PC: 0xffffffc0020b4c71 _ZL19common_thread_entryPv + 93 FP: 0x0, PC: 0xffffffc0021597b5 arch_thread_entry + 3 kdebug> CIMG4712 27 Likes X512 July 17, 2021, 4:14pm #31 I finally managed to run desktop. Crashes was caused by unaligned access to framebuffer, access seems to require 16 byte alignment. I made some quick hack to enforce alignment in app_server when copying to front buffer, but it currently introduce artifacts. I don't know why 16 byte alignment is required, radeon_hd driver works fine on Acer W500 tablet without alignment tricks. CIMG4716 37 Likes frankps July 17, 2021, 4:23pm #32 Congratulations. What an achievement! :tada: So looking forward to get a RISC computer dedicated to run Haiku :grinning: 5 Likes Diver July 17, 2021, 4:33pm #33 This is simply astonishing! Hats off and kudos to you for your hard work and mad skills! 8 Likes brunobastardi July 17, 2021, 4:56pm #34 Wow wtf, unbelievable work... Congtats and Nastrowie for the dektop to show. We should consider a prize for your archivement. Just great very fast straight forward process. Nice and it makes me confident to hold on Haiku developement efforts. Like a light in the dark... Fascinating. 2 Likes zuzulo July 17, 2021, 8:46pm #35 @jt15s Maybe you can promote this achievement by a blog post ? 2 Likes X512 July 17, 2021, 8:48pm #36 Maybe fix artifacts first? 5 Likes waddlesplash July 17, 2021, 10:07pm #37 Would enabling write-combining, the way VESA & Framebuffer drivers do, potentially fix this problem? It may get the CPU to write a full cache line at a time instead of unaligned bytes. 1 Like X512 July 17, 2021, 10:15pm #38 I fixed problem by using 32 bit copy per step. It seems that 64 bit access should use 64 bit (8 byte) aligned pointers. CIMG4717 7 Likes X512 July 17, 2021, 10:25pm #39 # waddlesplash: It may get the CPU to write a full cache line at a time instead of unaligned bytes. Memory types are not yet implemented for RISC-V. - previous page * Home * Categories * FAQ/Guidelines * Terms of Service * Privacy Policy Powered by Discourse, best viewed with JavaScript enabled