- Timestamp:
- Oct 27, 2023 12:49:16 PM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 159706
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r101597 r101619 2716 2716 PPDMIBASE pBase = NULL; 2717 2717 int vrc = ptrVM.vtable()->pfnPDMR3QueryDeviceLun(ptrVM.rawUVM(), "acpi", 0, 0, &pBase); 2718 /** @todo r=aeichner Think about a prettier way to do this without relying on hardocded device/driver names. */ 2719 if (vrc == VERR_PDM_DEVICE_INSTANCE_NOT_FOUND) /* Try GPIO device for ARM VMs */ 2720 vrc = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(), "arm-pl061-gpio", 0, 0, "GpioButton", &pBase); 2718 2721 if (RT_SUCCESS(vrc)) 2719 2722 { … … 2823 2826 vrc = VERR_PDM_MISSING_INTERFACE; 2824 2827 } 2828 2829 if (vrc == VERR_PDM_DEVICE_INSTANCE_NOT_FOUND) 2830 { 2831 /* Might be an ARM VM. */ 2832 /** @todo r=aeichner Think about a prettier way to do this without relying on hardocded device/driver names, 2833 * and this shouldn't be here as it is not about ACPI but needs a dedicated interface. */ 2834 vrc = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(), "arm-pl061-gpio", 0, 0, "GpioButton", &pBase); 2835 if (RT_SUCCESS(vrc)) 2836 { 2837 Assert(pBase); 2838 PPDMIEVENTBUTTONPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIEVENTBUTTONPORT); 2839 if (pPort) 2840 { 2841 bool fEntered = false; 2842 vrc = pPort->pfnQueryGuestCanHandleButtonEvents(pPort, &fEntered); 2843 if (RT_SUCCESS(vrc)) 2844 *aEntered = fEntered; 2845 } 2846 else 2847 vrc = VERR_PDM_MISSING_INTERFACE; 2848 } 2849 } 2825 2850 } 2826 2851 … … 2850 2875 PPDMIBASE pBase = NULL; 2851 2876 int vrc = ptrVM.vtable()->pfnPDMR3QueryDeviceLun(ptrVM.rawUVM(), "acpi", 0, 0, &pBase); 2877 /** @todo r=aeichner Think about a prettier way to do this without relying on hardocded device/driver names. */ 2878 if (vrc == VERR_PDM_DEVICE_INSTANCE_NOT_FOUND) /* Try GPIO device for ARM VMs */ 2879 vrc = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(), "arm-pl061-gpio", 0, 0, "GpioButton", &pBase); 2852 2880 if (RT_SUCCESS(vrc)) 2853 2881 { -
trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp
r101577 r101619 248 248 0x01, 0x0a, 0x104); VRC(); 249 249 vrc = RTFdtNodePropertyAddEmpty( hFdt, "always-on"); VRC(); 250 vrc = RTFdtNodePropertyAddString( hFdt, "compatible", "arm,armv 7-timer"); VRC();250 vrc = RTFdtNodePropertyAddString( hFdt, "compatible", "arm,armv8-timer"); VRC(); 251 251 vrc = RTFdtNodeFinalize(hFdt); 252 252 … … 258 258 vrc = RTFdtNodePropertyAddString( hFdt, "compatible", "fixed-clock"); VRC(); 259 259 vrc = RTFdtNodeFinalize(hFdt); 260 261 /* Configure gpio keys (non functional at the moment). */262 vrc = RTFdtNodeAdd(hFdt, "gpio-keys"); VRC();263 vrc = RTFdtNodePropertyAddString(hFdt, "compatible", "gpio-keys"); VRC();264 265 vrc = RTFdtNodeAdd(hFdt, "poweroff"); VRC();266 vrc = RTFdtNodePropertyAddCellsU32(hFdt, "gpios", 3, idPHandleGpio, 3, 0); VRC();267 vrc = RTFdtNodePropertyAddU32( hFdt, "linux,code", 0x74); VRC();268 vrc = RTFdtNodePropertyAddString( hFdt, "label", "GPIO Key Poweroff"); VRC();269 vrc = RTFdtNodeFinalize(hFdt); VRC();270 271 vrc = RTFdtNodeFinalize(hFdt); VRC();272 260 273 261 /* … … 535 523 vrc = RTFdtNodeFinalize(hFdt); VRC(); 536 524 525 /* Configure gpio keys. */ 537 526 InsertConfigNode(pDevices, "arm-pl061-gpio",&pDev); 538 527 InsertConfigNode(pDev, "0", &pInst); … … 550 539 "arm,pl061", "arm,primecell"); VRC(); 551 540 vrc = RTFdtNodePropertyAddCellsU64(hFdt, "reg", 2, 0x09030000, _4K); VRC(); 541 vrc = RTFdtNodeFinalize(hFdt); VRC(); 542 543 InsertConfigNode(pInst, "LUN#0", &pLunL0); 544 InsertConfigString(pLunL0, "Driver", "GpioButton"); 545 InsertConfigNode(pLunL0, "Config", &pCfg); 546 InsertConfigInteger(pCfg, "PowerButtonGpio", 3); 547 InsertConfigInteger(pCfg, "SleepButtonGpio", 4); 548 549 vrc = RTFdtNodeAdd(hFdt, "gpio-keys"); VRC(); 550 vrc = RTFdtNodePropertyAddString(hFdt, "compatible", "gpio-keys"); VRC(); 551 552 vrc = RTFdtNodeAdd(hFdt, "poweroff"); VRC(); 553 vrc = RTFdtNodePropertyAddCellsU32(hFdt, "gpios", 3, idPHandleGpio, 3, 0); VRC(); 554 vrc = RTFdtNodePropertyAddU32( hFdt, "linux,code", 0x74); VRC(); 555 vrc = RTFdtNodePropertyAddString( hFdt, "label", "GPIO Key Poweroff"); VRC(); 556 vrc = RTFdtNodeFinalize(hFdt); VRC(); 557 558 vrc = RTFdtNodeAdd(hFdt, "suspend"); VRC(); 559 vrc = RTFdtNodePropertyAddCellsU32(hFdt, "gpios", 3, idPHandleGpio, 4, 0); VRC(); 560 vrc = RTFdtNodePropertyAddU32( hFdt, "linux,code", 0xcd); VRC(); 561 vrc = RTFdtNodePropertyAddString( hFdt, "label", "GPIO Key Suspend"); VRC(); 562 vrc = RTFdtNodeFinalize(hFdt); 563 552 564 vrc = RTFdtNodeFinalize(hFdt); VRC(); 553 565
Note:
See TracChangeset
for help on using the changeset viewer.