v86 0.3.7 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +64 -108
- package/build/libv86-debug.js +12677 -0
- package/build/libv86-debug.mjs +732 -0
- package/build/libv86.js +710 -0
- package/build/libv86.mjs +636 -0
- package/build/v86-debug.wasm +0 -0
- package/build/v86-fallback.wasm +0 -0
- package/build/v86.wasm +0 -0
- package/package.json +12 -35
- package/bios/.gitignore +0 -1
- package/bios/COPYING.LESSER +0 -165
- package/bios/bochs-bios.bin +0 -0
- package/bios/bochs-vgabios.bin +0 -0
- package/bios/fetch-and-build-seabios.sh +0 -13
- package/bios/seabios/.config +0 -113
- package/bios/seabios/.config.old +0 -114
- package/bios/seabios/.gitignore +0 -4
- package/bios/seabios/COPYING +0 -674
- package/bios/seabios/COPYING.LESSER +0 -165
- package/bios/seabios/Makefile +0 -286
- package/bios/seabios/README +0 -17
- package/bios/seabios/docs/Build_overview.md +0 -104
- package/bios/seabios/docs/Contributing.md +0 -20
- package/bios/seabios/docs/Debugging.md +0 -111
- package/bios/seabios/docs/Developer_Documentation.md +0 -25
- package/bios/seabios/docs/Developer_links.md +0 -86
- package/bios/seabios/docs/Download.md +0 -27
- package/bios/seabios/docs/Execution_and_code_flow.md +0 -178
- package/bios/seabios/docs/Linking_overview.md +0 -160
- package/bios/seabios/docs/Mailinglist.md +0 -8
- package/bios/seabios/docs/Memory_Model.md +0 -253
- package/bios/seabios/docs/README +0 -5
- package/bios/seabios/docs/Releases.md +0 -482
- package/bios/seabios/docs/Runtime_config.md +0 -193
- package/bios/seabios/docs/SeaBIOS.md +0 -17
- package/bios/seabios/docs/SeaVGABIOS.md +0 -39
- package/bios/seabios/out/autoconf.h +0 -117
- package/bios/seabios/out/include/config/acpi/dsdt.h +0 -0
- package/bios/seabios/out/include/config/acpi.h +0 -0
- package/bios/seabios/out/include/config/ahci.h +0 -0
- package/bios/seabios/out/include/config/apmbios.h +0 -0
- package/bios/seabios/out/include/config/ata/dma.h +0 -0
- package/bios/seabios/out/include/config/ata/pio32.h +0 -0
- package/bios/seabios/out/include/config/ata.h +0 -0
- package/bios/seabios/out/include/config/auto.conf +0 -69
- package/bios/seabios/out/include/config/auto.conf.cmd +0 -9
- package/bios/seabios/out/include/config/boot.h +0 -0
- package/bios/seabios/out/include/config/bootorder.h +0 -0
- package/bios/seabios/out/include/config/build/vgabios.h +0 -0
- package/bios/seabios/out/include/config/call32/smm.h +0 -0
- package/bios/seabios/out/include/config/cdrom/boot.h +0 -0
- package/bios/seabios/out/include/config/cdrom/emu.h +0 -0
- package/bios/seabios/out/include/config/debug/level.h +0 -0
- package/bios/seabios/out/include/config/drives.h +0 -0
- package/bios/seabios/out/include/config/entry/extrastack.h +0 -0
- package/bios/seabios/out/include/config/esp/scsi.h +0 -0
- package/bios/seabios/out/include/config/flash/floppy.h +0 -0
- package/bios/seabios/out/include/config/floppy.h +0 -0
- package/bios/seabios/out/include/config/fw/romfile/load.h +0 -0
- package/bios/seabios/out/include/config/hardware/irq.h +0 -0
- package/bios/seabios/out/include/config/kbd/call/int15/4f.h +0 -0
- package/bios/seabios/out/include/config/keyboard.h +0 -0
- package/bios/seabios/out/include/config/lpt.h +0 -0
- package/bios/seabios/out/include/config/lsi/scsi.h +0 -0
- package/bios/seabios/out/include/config/malloc/uppermemory.h +0 -0
- package/bios/seabios/out/include/config/megasas.h +0 -0
- package/bios/seabios/out/include/config/mouse.h +0 -0
- package/bios/seabios/out/include/config/mpt/scsi.h +0 -0
- package/bios/seabios/out/include/config/mptable.h +0 -0
- package/bios/seabios/out/include/config/mtrr/init.h +0 -0
- package/bios/seabios/out/include/config/optionroms.h +0 -0
- package/bios/seabios/out/include/config/override/pci/id.h +0 -0
- package/bios/seabios/out/include/config/pcibios.h +0 -0
- package/bios/seabios/out/include/config/pirtable.h +0 -0
- package/bios/seabios/out/include/config/pmm.h +0 -0
- package/bios/seabios/out/include/config/pmtimer.h +0 -0
- package/bios/seabios/out/include/config/pnpbios.h +0 -0
- package/bios/seabios/out/include/config/ps2port.h +0 -0
- package/bios/seabios/out/include/config/pvscsi.h +0 -0
- package/bios/seabios/out/include/config/qemu/hardware.h +0 -0
- package/bios/seabios/out/include/config/qemu.h +0 -0
- package/bios/seabios/out/include/config/rom/size.h +0 -0
- package/bios/seabios/out/include/config/rtc/timer.h +0 -0
- package/bios/seabios/out/include/config/s3/resume.h +0 -0
- package/bios/seabios/out/include/config/sdcard.h +0 -0
- package/bios/seabios/out/include/config/serial.h +0 -0
- package/bios/seabios/out/include/config/tcgbios.h +0 -0
- package/bios/seabios/out/include/config/threads.h +0 -0
- package/bios/seabios/out/include/config/tristate.conf +0 -4
- package/bios/seabios/out/include/config/tsc/timer.h +0 -0
- package/bios/seabios/out/include/config/use/smm.h +0 -0
- package/bios/seabios/out/include/config/vga/allocate/extra/stack.h +0 -0
- package/bios/seabios/out/include/config/vga/bochs/stdvga.h +0 -0
- package/bios/seabios/out/include/config/vga/bochs.h +0 -0
- package/bios/seabios/out/include/config/vga/did.h +0 -0
- package/bios/seabios/out/include/config/vga/extra/stack/size.h +0 -0
- package/bios/seabios/out/include/config/vga/fixup/asm.h +0 -0
- package/bios/seabios/out/include/config/vga/pci.h +0 -0
- package/bios/seabios/out/include/config/vga/stdvga/ports.h +0 -0
- package/bios/seabios/out/include/config/vga/vbe.h +0 -0
- package/bios/seabios/out/include/config/vga/vid.h +0 -0
- package/bios/seabios/out/include/config/vgahooks.h +0 -0
- package/bios/seabios/out/include/config/virtio/blk.h +0 -0
- package/bios/seabios/out/include/config/virtio/scsi.h +0 -0
- package/bios/seabios/out/include/config/xen.h +0 -0
- package/bios/seabios/out/scripts/kconfig/conf +0 -0
- package/bios/seabios/out/scripts/kconfig/conf.o +0 -0
- package/bios/seabios/out/scripts/kconfig/zconf.hash.c +0 -289
- package/bios/seabios/out/scripts/kconfig/zconf.lex.c +0 -2420
- package/bios/seabios/out/scripts/kconfig/zconf.tab.c +0 -2538
- package/bios/seabios/out/scripts/kconfig/zconf.tab.o +0 -0
- package/bios/seabios/scripts/acpi_extract.py +0 -366
- package/bios/seabios/scripts/acpi_extract_preprocess.py +0 -41
- package/bios/seabios/scripts/buildrom.py +0 -56
- package/bios/seabios/scripts/buildversion.py +0 -134
- package/bios/seabios/scripts/checkrom.py +0 -95
- package/bios/seabios/scripts/checkstack.py +0 -226
- package/bios/seabios/scripts/checksum.py +0 -16
- package/bios/seabios/scripts/encodeint.py +0 -21
- package/bios/seabios/scripts/gen-offsets.sh +0 -17
- package/bios/seabios/scripts/kconfig/.gitignore +0 -22
- package/bios/seabios/scripts/kconfig/Makefile +0 -331
- package/bios/seabios/scripts/kconfig/POTFILES.in +0 -12
- package/bios/seabios/scripts/kconfig/check.sh +0 -13
- package/bios/seabios/scripts/kconfig/conf.c +0 -718
- package/bios/seabios/scripts/kconfig/confdata.c +0 -1250
- package/bios/seabios/scripts/kconfig/expr.c +0 -1168
- package/bios/seabios/scripts/kconfig/expr.h +0 -241
- package/bios/seabios/scripts/kconfig/gconf.c +0 -1542
- package/bios/seabios/scripts/kconfig/gconf.glade +0 -661
- package/bios/seabios/scripts/kconfig/images.c +0 -326
- package/bios/seabios/scripts/kconfig/kxgettext.c +0 -235
- package/bios/seabios/scripts/kconfig/lex.zconf.c +0 -2430
- package/bios/seabios/scripts/kconfig/list.h +0 -131
- package/bios/seabios/scripts/kconfig/lkc.h +0 -200
- package/bios/seabios/scripts/kconfig/lkc_proto.h +0 -57
- package/bios/seabios/scripts/kconfig/lxdialog/.gitignore +0 -4
- package/bios/seabios/scripts/kconfig/lxdialog/BIG.FAT.WARNING +0 -4
- package/bios/seabios/scripts/kconfig/lxdialog/check-lxdialog.sh +0 -87
- package/bios/seabios/scripts/kconfig/lxdialog/checklist.c +0 -332
- package/bios/seabios/scripts/kconfig/lxdialog/dialog.h +0 -257
- package/bios/seabios/scripts/kconfig/lxdialog/inputbox.c +0 -301
- package/bios/seabios/scripts/kconfig/lxdialog/menubox.c +0 -437
- package/bios/seabios/scripts/kconfig/lxdialog/textbox.c +0 -408
- package/bios/seabios/scripts/kconfig/lxdialog/util.c +0 -713
- package/bios/seabios/scripts/kconfig/lxdialog/yesno.c +0 -114
- package/bios/seabios/scripts/kconfig/mconf.c +0 -1036
- package/bios/seabios/scripts/kconfig/menu.c +0 -697
- package/bios/seabios/scripts/kconfig/merge_config.sh +0 -150
- package/bios/seabios/scripts/kconfig/nconf.c +0 -1556
- package/bios/seabios/scripts/kconfig/nconf.gui.c +0 -656
- package/bios/seabios/scripts/kconfig/nconf.h +0 -96
- package/bios/seabios/scripts/kconfig/qconf.cc +0 -1795
- package/bios/seabios/scripts/kconfig/qconf.h +0 -338
- package/bios/seabios/scripts/kconfig/streamline_config.pl +0 -647
- package/bios/seabios/scripts/kconfig/symbol.c +0 -1373
- package/bios/seabios/scripts/kconfig/util.c +0 -157
- package/bios/seabios/scripts/kconfig/zconf.gperf +0 -48
- package/bios/seabios/scripts/kconfig/zconf.hash.c_shipped +0 -289
- package/bios/seabios/scripts/kconfig/zconf.l +0 -363
- package/bios/seabios/scripts/kconfig/zconf.lex.c_shipped +0 -2420
- package/bios/seabios/scripts/kconfig/zconf.tab.c_shipped +0 -2538
- package/bios/seabios/scripts/kconfig/zconf.y +0 -733
- package/bios/seabios/scripts/layoutrom.py +0 -705
- package/bios/seabios/scripts/python23compat.py +0 -14
- package/bios/seabios/scripts/readserial.py +0 -190
- package/bios/seabios/scripts/tarball.sh +0 -36
- package/bios/seabios/scripts/test-build.sh +0 -90
- package/bios/seabios/scripts/transdump.py +0 -53
- package/bios/seabios/scripts/vgafixup.py +0 -96
- package/bios/seabios/src/Kconfig +0 -579
- package/bios/seabios/src/apm.c +0 -215
- package/bios/seabios/src/asm-offsets.c +0 -23
- package/bios/seabios/src/biosvar.h +0 -130
- package/bios/seabios/src/block.c +0 -623
- package/bios/seabios/src/block.h +0 -121
- package/bios/seabios/src/bmp.c +0 -117
- package/bios/seabios/src/boot.c +0 -793
- package/bios/seabios/src/bootsplash.c +0 -255
- package/bios/seabios/src/bregs.h +0 -80
- package/bios/seabios/src/byteorder.h +0 -71
- package/bios/seabios/src/cdrom.c +0 -322
- package/bios/seabios/src/clock.c +0 -506
- package/bios/seabios/src/code16gcc.s +0 -1
- package/bios/seabios/src/config.h +0 -108
- package/bios/seabios/src/cp437.c +0 -275
- package/bios/seabios/src/cp437.h +0 -1
- package/bios/seabios/src/disk.c +0 -779
- package/bios/seabios/src/e820map.c +0 -152
- package/bios/seabios/src/e820map.h +0 -26
- package/bios/seabios/src/entryfuncs.S +0 -165
- package/bios/seabios/src/farptr.h +0 -208
- package/bios/seabios/src/font.c +0 -139
- package/bios/seabios/src/fw/acpi-dsdt-cpu-hotplug.dsl +0 -78
- package/bios/seabios/src/fw/acpi-dsdt-dbug.dsl +0 -26
- package/bios/seabios/src/fw/acpi-dsdt-hpet.dsl +0 -36
- package/bios/seabios/src/fw/acpi-dsdt-isa.dsl +0 -102
- package/bios/seabios/src/fw/acpi-dsdt-pci-crs.dsl +0 -90
- package/bios/seabios/src/fw/acpi-dsdt.dsl +0 -342
- package/bios/seabios/src/fw/acpi-dsdt.hex +0 -554
- package/bios/seabios/src/fw/acpi.c +0 -685
- package/bios/seabios/src/fw/biostables.c +0 -491
- package/bios/seabios/src/fw/coreboot.c +0 -569
- package/bios/seabios/src/fw/csm.c +0 -347
- package/bios/seabios/src/fw/dev-pci.h +0 -52
- package/bios/seabios/src/fw/dev-piix.h +0 -29
- package/bios/seabios/src/fw/dev-q35.h +0 -52
- package/bios/seabios/src/fw/lzmadecode.c +0 -398
- package/bios/seabios/src/fw/lzmadecode.h +0 -67
- package/bios/seabios/src/fw/mptable.c +0 -197
- package/bios/seabios/src/fw/mtrr.c +0 -105
- package/bios/seabios/src/fw/multiboot.c +0 -111
- package/bios/seabios/src/fw/paravirt.c +0 -624
- package/bios/seabios/src/fw/paravirt.h +0 -63
- package/bios/seabios/src/fw/pciinit.c +0 -1187
- package/bios/seabios/src/fw/pirtable.c +0 -103
- package/bios/seabios/src/fw/q35-acpi-dsdt.dsl +0 -450
- package/bios/seabios/src/fw/romfile_loader.c +0 -259
- package/bios/seabios/src/fw/romfile_loader.h +0 -91
- package/bios/seabios/src/fw/shadow.c +0 -208
- package/bios/seabios/src/fw/smbios.c +0 -585
- package/bios/seabios/src/fw/smm.c +0 -269
- package/bios/seabios/src/fw/smp.c +0 -194
- package/bios/seabios/src/fw/ssdt-misc.dsl +0 -104
- package/bios/seabios/src/fw/ssdt-misc.hex +0 -88
- package/bios/seabios/src/fw/ssdt-pcihp.dsl +0 -36
- package/bios/seabios/src/fw/ssdt-pcihp.hex +0 -38
- package/bios/seabios/src/fw/ssdt-proc.dsl +0 -48
- package/bios/seabios/src/fw/ssdt-proc.hex +0 -35
- package/bios/seabios/src/fw/xen.c +0 -149
- package/bios/seabios/src/fw/xen.h +0 -125
- package/bios/seabios/src/gen-defs.h +0 -19
- package/bios/seabios/src/hw/ahci.c +0 -697
- package/bios/seabios/src/hw/ahci.h +0 -201
- package/bios/seabios/src/hw/ata.c +0 -1046
- package/bios/seabios/src/hw/ata.h +0 -163
- package/bios/seabios/src/hw/blockcmd.c +0 -372
- package/bios/seabios/src/hw/blockcmd.h +0 -114
- package/bios/seabios/src/hw/dma.c +0 -67
- package/bios/seabios/src/hw/esp-scsi.c +0 -241
- package/bios/seabios/src/hw/esp-scsi.h +0 -8
- package/bios/seabios/src/hw/floppy.c +0 -741
- package/bios/seabios/src/hw/lsi-scsi.c +0 -221
- package/bios/seabios/src/hw/lsi-scsi.h +0 -8
- package/bios/seabios/src/hw/megasas.c +0 -405
- package/bios/seabios/src/hw/megasas.h +0 -8
- package/bios/seabios/src/hw/mpt-scsi.c +0 -319
- package/bios/seabios/src/hw/mpt-scsi.h +0 -8
- package/bios/seabios/src/hw/nvme-int.h +0 -199
- package/bios/seabios/src/hw/nvme.c +0 -708
- package/bios/seabios/src/hw/nvme.h +0 -17
- package/bios/seabios/src/hw/pci.c +0 -133
- package/bios/seabios/src/hw/pci.h +0 -47
- package/bios/seabios/src/hw/pci_ids.h +0 -2632
- package/bios/seabios/src/hw/pci_regs.h +0 -556
- package/bios/seabios/src/hw/pcidevice.c +0 -192
- package/bios/seabios/src/hw/pcidevice.h +0 -76
- package/bios/seabios/src/hw/pic.c +0 -115
- package/bios/seabios/src/hw/pic.h +0 -60
- package/bios/seabios/src/hw/ps2port.c +0 -543
- package/bios/seabios/src/hw/ps2port.h +0 -67
- package/bios/seabios/src/hw/pvscsi.c +0 -333
- package/bios/seabios/src/hw/pvscsi.h +0 -8
- package/bios/seabios/src/hw/ramdisk.c +0 -108
- package/bios/seabios/src/hw/rtc.c +0 -100
- package/bios/seabios/src/hw/rtc.h +0 -75
- package/bios/seabios/src/hw/sdcard.c +0 -572
- package/bios/seabios/src/hw/serialio.c +0 -113
- package/bios/seabios/src/hw/serialio.h +0 -29
- package/bios/seabios/src/hw/timer.c +0 -259
- package/bios/seabios/src/hw/tpm_drivers.c +0 -636
- package/bios/seabios/src/hw/tpm_drivers.h +0 -127
- package/bios/seabios/src/hw/usb-ehci.c +0 -650
- package/bios/seabios/src/hw/usb-ehci.h +0 -177
- package/bios/seabios/src/hw/usb-hid.c +0 -442
- package/bios/seabios/src/hw/usb-hid.h +0 -29
- package/bios/seabios/src/hw/usb-hub.c +0 -205
- package/bios/seabios/src/hw/usb-hub.h +0 -64
- package/bios/seabios/src/hw/usb-msc.c +0 -222
- package/bios/seabios/src/hw/usb-msc.h +0 -10
- package/bios/seabios/src/hw/usb-ohci.c +0 -568
- package/bios/seabios/src/hw/usb-ohci.h +0 -144
- package/bios/seabios/src/hw/usb-uas.c +0 -289
- package/bios/seabios/src/hw/usb-uas.h +0 -9
- package/bios/seabios/src/hw/usb-uhci.c +0 -571
- package/bios/seabios/src/hw/usb-uhci.h +0 -128
- package/bios/seabios/src/hw/usb-xhci.c +0 -1161
- package/bios/seabios/src/hw/usb-xhci.h +0 -133
- package/bios/seabios/src/hw/usb.c +0 -499
- package/bios/seabios/src/hw/usb.h +0 -254
- package/bios/seabios/src/hw/virtio-blk.c +0 -211
- package/bios/seabios/src/hw/virtio-blk.h +0 -43
- package/bios/seabios/src/hw/virtio-pci.c +0 -501
- package/bios/seabios/src/hw/virtio-pci.h +0 -151
- package/bios/seabios/src/hw/virtio-ring.c +0 -147
- package/bios/seabios/src/hw/virtio-ring.h +0 -121
- package/bios/seabios/src/hw/virtio-scsi.c +0 -220
- package/bios/seabios/src/hw/virtio-scsi.h +0 -47
- package/bios/seabios/src/jpeg.c +0 -1055
- package/bios/seabios/src/kbd.c +0 -599
- package/bios/seabios/src/list.h +0 -91
- package/bios/seabios/src/malloc.c +0 -561
- package/bios/seabios/src/malloc.h +0 -70
- package/bios/seabios/src/memmap.h +0 -21
- package/bios/seabios/src/misc.c +0 -195
- package/bios/seabios/src/mouse.c +0 -342
- package/bios/seabios/src/optionroms.c +0 -475
- package/bios/seabios/src/output.c +0 -584
- package/bios/seabios/src/output.h +0 -68
- package/bios/seabios/src/pcibios.c +0 -241
- package/bios/seabios/src/pmm.c +0 -176
- package/bios/seabios/src/pnpbios.c +0 -88
- package/bios/seabios/src/post.c +0 -337
- package/bios/seabios/src/resume.c +0 -157
- package/bios/seabios/src/romfile.c +0 -146
- package/bios/seabios/src/romfile.h +0 -21
- package/bios/seabios/src/romlayout.S +0 -698
- package/bios/seabios/src/sercon.c +0 -677
- package/bios/seabios/src/serial.c +0 -317
- package/bios/seabios/src/sha1.c +0 -147
- package/bios/seabios/src/sha1.h +0 -8
- package/bios/seabios/src/stacks.c +0 -771
- package/bios/seabios/src/stacks.h +0 -68
- package/bios/seabios/src/std/LegacyBios.h +0 -985
- package/bios/seabios/src/std/acpi.h +0 -323
- package/bios/seabios/src/std/bda.h +0 -174
- package/bios/seabios/src/std/disk.h +0 -175
- package/bios/seabios/src/std/mptable.h +0 -77
- package/bios/seabios/src/std/multiboot.h +0 -260
- package/bios/seabios/src/std/optionrom.h +0 -59
- package/bios/seabios/src/std/pirtable.h +0 -35
- package/bios/seabios/src/std/pmm.h +0 -19
- package/bios/seabios/src/std/pnpbios.h +0 -24
- package/bios/seabios/src/std/smbios.h +0 -167
- package/bios/seabios/src/std/tcg.h +0 -554
- package/bios/seabios/src/std/vbe.h +0 -156
- package/bios/seabios/src/std/vga.h +0 -63
- package/bios/seabios/src/string.c +0 -251
- package/bios/seabios/src/string.h +0 -31
- package/bios/seabios/src/system.c +0 -357
- package/bios/seabios/src/tcgbios.c +0 -2014
- package/bios/seabios/src/tcgbios.h +0 -19
- package/bios/seabios/src/types.h +0 -156
- package/bios/seabios/src/util.h +0 -251
- package/bios/seabios/src/version.c +0 -5
- package/bios/seabios/src/vgahooks.c +0 -355
- package/bios/seabios/src/x86.c +0 -23
- package/bios/seabios/src/x86.h +0 -277
- package/bios/seabios/vgasrc/Kconfig +0 -211
- package/bios/seabios/vgasrc/bochsdisplay.c +0 -59
- package/bios/seabios/vgasrc/bochsvga.c +0 -447
- package/bios/seabios/vgasrc/bochsvga.h +0 -57
- package/bios/seabios/vgasrc/cbvga.c +0 -337
- package/bios/seabios/vgasrc/clext.c +0 -627
- package/bios/seabios/vgasrc/geodevga.c +0 -434
- package/bios/seabios/vgasrc/geodevga.h +0 -89
- package/bios/seabios/vgasrc/ramfb.c +0 -163
- package/bios/seabios/vgasrc/stdvga.c +0 -485
- package/bios/seabios/vgasrc/stdvga.h +0 -81
- package/bios/seabios/vgasrc/stdvgaio.c +0 -186
- package/bios/seabios/vgasrc/stdvgamodes.c +0 -534
- package/bios/seabios/vgasrc/swcursor.c +0 -96
- package/bios/seabios/vgasrc/vbe.c +0 -432
- package/bios/seabios/vgasrc/vgabios.c +0 -1131
- package/bios/seabios/vgasrc/vgabios.h +0 -88
- package/bios/seabios/vgasrc/vgaentry.S +0 -161
- package/bios/seabios/vgasrc/vgafb.c +0 -661
- package/bios/seabios/vgasrc/vgafb.h +0 -42
- package/bios/seabios/vgasrc/vgafonts.c +0 -785
- package/bios/seabios/vgasrc/vgahw.h +0 -152
- package/bios/seabios/vgasrc/vgainit.c +0 -202
- package/bios/seabios/vgasrc/vgalayout.lds.S +0 -23
- package/bios/seabios/vgasrc/vgautil.h +0 -103
- package/bios/seabios/vgasrc/vgaversion.c +0 -6
- package/bios/seabios-debug.bin +0 -0
- package/bios/seabios-debug.config +0 -117
- package/bios/seabios.bin +0 -0
- package/bios/seabios.config +0 -114
- package/bios/vgabios-debug.bin +0 -0
- package/bios/vgabios.bin +0 -0
- package/build/binaries.js +0 -1
- package/build/index-debug.cjs +0 -1
- package/build/index-debug.js +0 -1
- package/build/index.cjs +0 -1
- package/build/index.js +0 -1
- package/v86.css +0 -259
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
// (qemu-emulated) lsi53c895a boot support.
|
|
2
|
-
//
|
|
3
|
-
// Copyright (C) 2012 Red Hat Inc.
|
|
4
|
-
//
|
|
5
|
-
// Authors:
|
|
6
|
-
// Gerd Hoffmann <kraxel@redhat.com>
|
|
7
|
-
//
|
|
8
|
-
// based on virtio-scsi.c which is written by:
|
|
9
|
-
// Paolo Bonzini <pbonzini@redhat.com>
|
|
10
|
-
//
|
|
11
|
-
// This file may be distributed under the terms of the GNU LGPLv3 license.
|
|
12
|
-
|
|
13
|
-
#include "biosvar.h" // GET_GLOBALFLAT
|
|
14
|
-
#include "block.h" // struct drive_s
|
|
15
|
-
#include "blockcmd.h" // scsi_drive_setup
|
|
16
|
-
#include "config.h" // CONFIG_*
|
|
17
|
-
#include "fw/paravirt.h" // runningOnQEMU
|
|
18
|
-
#include "malloc.h" // free
|
|
19
|
-
#include "output.h" // dprintf
|
|
20
|
-
#include "pcidevice.h" // foreachpci
|
|
21
|
-
#include "pci_ids.h" // PCI_DEVICE_ID_VIRTIO_BLK
|
|
22
|
-
#include "pci_regs.h" // PCI_VENDOR_ID
|
|
23
|
-
#include "stacks.h" // run_thread
|
|
24
|
-
#include "std/disk.h" // DISK_RET_SUCCESS
|
|
25
|
-
#include "string.h" // memset
|
|
26
|
-
#include "util.h" // usleep
|
|
27
|
-
|
|
28
|
-
#define LSI_REG_DSTAT 0x0c
|
|
29
|
-
#define LSI_REG_ISTAT0 0x14
|
|
30
|
-
#define LSI_REG_DSP0 0x2c
|
|
31
|
-
#define LSI_REG_DSP1 0x2d
|
|
32
|
-
#define LSI_REG_DSP2 0x2e
|
|
33
|
-
#define LSI_REG_DSP3 0x2f
|
|
34
|
-
#define LSI_REG_SIST0 0x42
|
|
35
|
-
#define LSI_REG_SIST1 0x43
|
|
36
|
-
|
|
37
|
-
#define LSI_ISTAT0_DIP 0x01
|
|
38
|
-
#define LSI_ISTAT0_SIP 0x02
|
|
39
|
-
#define LSI_ISTAT0_INTF 0x04
|
|
40
|
-
#define LSI_ISTAT0_CON 0x08
|
|
41
|
-
#define LSI_ISTAT0_SEM 0x10
|
|
42
|
-
#define LSI_ISTAT0_SIGP 0x20
|
|
43
|
-
#define LSI_ISTAT0_SRST 0x40
|
|
44
|
-
#define LSI_ISTAT0_ABRT 0x80
|
|
45
|
-
|
|
46
|
-
struct lsi_lun_s {
|
|
47
|
-
struct drive_s drive;
|
|
48
|
-
struct pci_device *pci;
|
|
49
|
-
u32 iobase;
|
|
50
|
-
u8 target;
|
|
51
|
-
u8 lun;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
int
|
|
55
|
-
lsi_scsi_process_op(struct disk_op_s *op)
|
|
56
|
-
{
|
|
57
|
-
if (!CONFIG_LSI_SCSI)
|
|
58
|
-
return DISK_RET_EBADTRACK;
|
|
59
|
-
struct lsi_lun_s *llun_gf =
|
|
60
|
-
container_of(op->drive_fl, struct lsi_lun_s, drive);
|
|
61
|
-
u16 target = GET_GLOBALFLAT(llun_gf->target);
|
|
62
|
-
u16 lun = GET_GLOBALFLAT(llun_gf->lun);
|
|
63
|
-
u8 cdbcmd[16];
|
|
64
|
-
int blocksize = scsi_fill_cmd(op, cdbcmd, sizeof(cdbcmd));
|
|
65
|
-
if (blocksize < 0)
|
|
66
|
-
return default_process_op(op);
|
|
67
|
-
u32 iobase = GET_GLOBALFLAT(llun_gf->iobase);
|
|
68
|
-
u32 dma = ((scsi_is_read(op) ? 0x01000000 : 0x00000000) |
|
|
69
|
-
(op->count * blocksize));
|
|
70
|
-
u8 msgout[] = {
|
|
71
|
-
0x80 | lun, // select lun
|
|
72
|
-
0x08,
|
|
73
|
-
};
|
|
74
|
-
u8 status = 0xff;
|
|
75
|
-
u8 msgin_tmp[2];
|
|
76
|
-
u8 msgin = 0xff;
|
|
77
|
-
|
|
78
|
-
u32 script[] = {
|
|
79
|
-
/* select target, send scsi command */
|
|
80
|
-
0x40000000 | target << 16, // select target
|
|
81
|
-
0x00000000,
|
|
82
|
-
0x06000001, // msgout
|
|
83
|
-
(u32)MAKE_FLATPTR(GET_SEG(SS), &msgout),
|
|
84
|
-
0x02000010, // scsi command
|
|
85
|
-
(u32)MAKE_FLATPTR(GET_SEG(SS), cdbcmd),
|
|
86
|
-
|
|
87
|
-
/* handle disconnect */
|
|
88
|
-
0x87820000, // phase == msgin ?
|
|
89
|
-
0x00000018,
|
|
90
|
-
0x07000002, // msgin
|
|
91
|
-
(u32)MAKE_FLATPTR(GET_SEG(SS), &msgin_tmp),
|
|
92
|
-
0x50000000, // re-select
|
|
93
|
-
0x00000000,
|
|
94
|
-
0x07000002, // msgin
|
|
95
|
-
(u32)MAKE_FLATPTR(GET_SEG(SS), &msgin_tmp),
|
|
96
|
-
|
|
97
|
-
/* dma data, get status, raise irq */
|
|
98
|
-
dma, // dma data
|
|
99
|
-
(u32)op->buf_fl,
|
|
100
|
-
0x03000001, // status
|
|
101
|
-
(u32)MAKE_FLATPTR(GET_SEG(SS), &status),
|
|
102
|
-
0x07000001, // msgin
|
|
103
|
-
(u32)MAKE_FLATPTR(GET_SEG(SS), &msgin),
|
|
104
|
-
0x98080000, // dma irq
|
|
105
|
-
0x00000000,
|
|
106
|
-
};
|
|
107
|
-
u32 dsp = (u32)MAKE_FLATPTR(GET_SEG(SS), &script);
|
|
108
|
-
|
|
109
|
-
outb(dsp & 0xff, iobase + LSI_REG_DSP0);
|
|
110
|
-
outb((dsp >> 8) & 0xff, iobase + LSI_REG_DSP1);
|
|
111
|
-
outb((dsp >> 16) & 0xff, iobase + LSI_REG_DSP2);
|
|
112
|
-
outb((dsp >> 24) & 0xff, iobase + LSI_REG_DSP3);
|
|
113
|
-
|
|
114
|
-
for (;;) {
|
|
115
|
-
u8 dstat = inb(iobase + LSI_REG_DSTAT);
|
|
116
|
-
u8 sist0 = inb(iobase + LSI_REG_SIST0);
|
|
117
|
-
u8 sist1 = inb(iobase + LSI_REG_SIST1);
|
|
118
|
-
if (sist0 || sist1) {
|
|
119
|
-
goto fail;
|
|
120
|
-
}
|
|
121
|
-
if (dstat & 0x04) {
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
usleep(5);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (msgin == 0 && status == 0) {
|
|
128
|
-
return DISK_RET_SUCCESS;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
fail:
|
|
132
|
-
return DISK_RET_EBADTRACK;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
static void
|
|
136
|
-
lsi_scsi_init_lun(struct lsi_lun_s *llun, struct pci_device *pci, u32 iobase,
|
|
137
|
-
u8 target, u8 lun)
|
|
138
|
-
{
|
|
139
|
-
memset(llun, 0, sizeof(*llun));
|
|
140
|
-
llun->drive.type = DTYPE_LSI_SCSI;
|
|
141
|
-
llun->drive.cntl_id = pci->bdf;
|
|
142
|
-
llun->pci = pci;
|
|
143
|
-
llun->target = target;
|
|
144
|
-
llun->lun = lun;
|
|
145
|
-
llun->iobase = iobase;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
static int
|
|
149
|
-
lsi_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
|
|
150
|
-
{
|
|
151
|
-
struct lsi_lun_s *tmpl_llun =
|
|
152
|
-
container_of(tmpl_drv, struct lsi_lun_s, drive);
|
|
153
|
-
struct lsi_lun_s *llun = malloc_fseg(sizeof(*llun));
|
|
154
|
-
if (!llun) {
|
|
155
|
-
warn_noalloc();
|
|
156
|
-
return -1;
|
|
157
|
-
}
|
|
158
|
-
lsi_scsi_init_lun(llun, tmpl_llun->pci, tmpl_llun->iobase,
|
|
159
|
-
tmpl_llun->target, lun);
|
|
160
|
-
|
|
161
|
-
char *name = znprintf(MAXDESCSIZE, "lsi %pP %d:%d",
|
|
162
|
-
llun->pci, llun->target, llun->lun);
|
|
163
|
-
int prio = bootprio_find_scsi_device(llun->pci, llun->target, llun->lun);
|
|
164
|
-
int ret = scsi_drive_setup(&llun->drive, name, prio);
|
|
165
|
-
free(name);
|
|
166
|
-
if (ret)
|
|
167
|
-
goto fail;
|
|
168
|
-
return 0;
|
|
169
|
-
|
|
170
|
-
fail:
|
|
171
|
-
free(llun);
|
|
172
|
-
return -1;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
static void
|
|
176
|
-
lsi_scsi_scan_target(struct pci_device *pci, u32 iobase, u8 target)
|
|
177
|
-
{
|
|
178
|
-
struct lsi_lun_s llun0;
|
|
179
|
-
|
|
180
|
-
lsi_scsi_init_lun(&llun0, pci, iobase, target, 0);
|
|
181
|
-
|
|
182
|
-
if (scsi_rep_luns_scan(&llun0.drive, lsi_scsi_add_lun) < 0)
|
|
183
|
-
scsi_sequential_scan(&llun0.drive, 8, lsi_scsi_add_lun);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
static void
|
|
187
|
-
init_lsi_scsi(void *data)
|
|
188
|
-
{
|
|
189
|
-
struct pci_device *pci = data;
|
|
190
|
-
u32 iobase = pci_enable_iobar(pci, PCI_BASE_ADDRESS_0);
|
|
191
|
-
if (!iobase)
|
|
192
|
-
return;
|
|
193
|
-
pci_enable_busmaster(pci);
|
|
194
|
-
|
|
195
|
-
dprintf(1, "found lsi53c895a at %pP, io @ %x\n", pci, iobase);
|
|
196
|
-
|
|
197
|
-
// reset
|
|
198
|
-
outb(LSI_ISTAT0_SRST, iobase + LSI_REG_ISTAT0);
|
|
199
|
-
|
|
200
|
-
int i;
|
|
201
|
-
for (i = 0; i < 7; i++)
|
|
202
|
-
lsi_scsi_scan_target(pci, iobase, i);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
void
|
|
206
|
-
lsi_scsi_setup(void)
|
|
207
|
-
{
|
|
208
|
-
ASSERT32FLAT();
|
|
209
|
-
if (!CONFIG_LSI_SCSI || !runningOnQEMU())
|
|
210
|
-
return;
|
|
211
|
-
|
|
212
|
-
dprintf(3, "init lsi53c895a\n");
|
|
213
|
-
|
|
214
|
-
struct pci_device *pci;
|
|
215
|
-
foreachpci(pci) {
|
|
216
|
-
if (pci->vendor != PCI_VENDOR_ID_LSI_LOGIC
|
|
217
|
-
|| pci->device != PCI_DEVICE_ID_LSI_53C895A)
|
|
218
|
-
continue;
|
|
219
|
-
run_thread(init_lsi_scsi, pci);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
// MegaRAID SAS boot support.
|
|
2
|
-
//
|
|
3
|
-
// Copyright (C) 2012 Hannes Reinecke, SUSE Linux Products GmbH
|
|
4
|
-
//
|
|
5
|
-
// Authors:
|
|
6
|
-
// Hannes Reinecke <hare@suse.de>
|
|
7
|
-
//
|
|
8
|
-
// based on virtio-scsi.c which is written by:
|
|
9
|
-
// Paolo Bonzini <pbonzini@redhat.com>
|
|
10
|
-
//
|
|
11
|
-
// This file may be distributed under the terms of the GNU LGPLv3 license.
|
|
12
|
-
|
|
13
|
-
#include "biosvar.h" // GET_GLOBALFLAT
|
|
14
|
-
#include "block.h" // struct drive_s
|
|
15
|
-
#include "blockcmd.h" // scsi_drive_setup
|
|
16
|
-
#include "config.h" // CONFIG_*
|
|
17
|
-
#include "malloc.h" // free
|
|
18
|
-
#include "output.h" // dprintf
|
|
19
|
-
#include "pci.h" // pci_config_readl
|
|
20
|
-
#include "pcidevice.h" // foreachpci
|
|
21
|
-
#include "pci_ids.h" // PCI_DEVICE_ID_XXX
|
|
22
|
-
#include "pci_regs.h" // PCI_VENDOR_ID
|
|
23
|
-
#include "stacks.h" // yield
|
|
24
|
-
#include "std/disk.h" // DISK_RET_SUCCESS
|
|
25
|
-
#include "string.h" // memset
|
|
26
|
-
#include "util.h" // timer_calc
|
|
27
|
-
|
|
28
|
-
#define MFI_DB 0x0 // Doorbell
|
|
29
|
-
#define MFI_OMSG0 0x18 // Outbound message 0
|
|
30
|
-
#define MFI_IDB 0x20 // Inbound doorbell
|
|
31
|
-
#define MFI_ODB 0x2c // Outbound doorbell
|
|
32
|
-
#define MFI_IQP 0x40 // Inbound queue port
|
|
33
|
-
#define MFI_OSP0 0xb0 // Outbound scratch pad0
|
|
34
|
-
#define MFI_IQPL 0xc0 // Inbound queue port (low bytes)
|
|
35
|
-
#define MFI_IQPH 0xc4 // Inbound queue port (high bytes)
|
|
36
|
-
|
|
37
|
-
#define MFI_STATE_MASK 0xf0000000
|
|
38
|
-
#define MFI_STATE_WAIT_HANDSHAKE 0x60000000
|
|
39
|
-
#define MFI_STATE_BOOT_MESSAGE_PENDING 0x90000000
|
|
40
|
-
#define MFI_STATE_READY 0xb0000000
|
|
41
|
-
#define MFI_STATE_OPERATIONAL 0xc0000000
|
|
42
|
-
#define MFI_STATE_FAULT 0xf0000000
|
|
43
|
-
|
|
44
|
-
/* MFI Commands */
|
|
45
|
-
typedef enum {
|
|
46
|
-
MFI_CMD_INIT = 0x00,
|
|
47
|
-
MFI_CMD_LD_READ,
|
|
48
|
-
MFI_CMD_LD_WRITE,
|
|
49
|
-
MFI_CMD_LD_SCSI_IO,
|
|
50
|
-
MFI_CMD_PD_SCSI_IO,
|
|
51
|
-
MFI_CMD_DCMD,
|
|
52
|
-
MFI_CMD_ABORT,
|
|
53
|
-
MFI_CMD_SMP,
|
|
54
|
-
MFI_CMD_STP
|
|
55
|
-
} mfi_cmd_t;
|
|
56
|
-
|
|
57
|
-
struct megasas_cmd_frame {
|
|
58
|
-
u8 cmd; /*00h */
|
|
59
|
-
u8 sense_len; /*01h */
|
|
60
|
-
u8 cmd_status; /*02h */
|
|
61
|
-
u8 scsi_status; /*03h */
|
|
62
|
-
|
|
63
|
-
u8 target_id; /*04h */
|
|
64
|
-
u8 lun; /*05h */
|
|
65
|
-
u8 cdb_len; /*06h */
|
|
66
|
-
u8 sge_count; /*07h */
|
|
67
|
-
|
|
68
|
-
u32 context; /*08h */
|
|
69
|
-
u32 context_64; /*0Ch */
|
|
70
|
-
|
|
71
|
-
u16 flags; /*10h */
|
|
72
|
-
u16 timeout; /*12h */
|
|
73
|
-
u32 data_xfer_len; /*14h */
|
|
74
|
-
|
|
75
|
-
union {
|
|
76
|
-
struct {
|
|
77
|
-
u32 opcode; /*18h */
|
|
78
|
-
u8 mbox[12]; /*1Ch */
|
|
79
|
-
u32 sgl_addr; /*28h */
|
|
80
|
-
u32 sgl_len; /*32h */
|
|
81
|
-
u32 pad; /*34h */
|
|
82
|
-
} dcmd;
|
|
83
|
-
struct {
|
|
84
|
-
u32 sense_buf_lo; /*18h */
|
|
85
|
-
u32 sense_buf_hi; /*1Ch */
|
|
86
|
-
u8 cdb[16]; /*20h */
|
|
87
|
-
u32 sgl_addr; /*30h */
|
|
88
|
-
u32 sgl_len; /*34h */
|
|
89
|
-
} pthru;
|
|
90
|
-
struct {
|
|
91
|
-
u8 pad[22]; /*18h */
|
|
92
|
-
} gen;
|
|
93
|
-
};
|
|
94
|
-
} __attribute__ ((packed));
|
|
95
|
-
|
|
96
|
-
struct mfi_ld_list_s {
|
|
97
|
-
u32 count;
|
|
98
|
-
u32 reserved_0;
|
|
99
|
-
struct {
|
|
100
|
-
u8 target;
|
|
101
|
-
u8 lun;
|
|
102
|
-
u16 seq;
|
|
103
|
-
u8 state;
|
|
104
|
-
u8 reserved_1[3];
|
|
105
|
-
u64 size;
|
|
106
|
-
} lds[64];
|
|
107
|
-
} __attribute__ ((packed));
|
|
108
|
-
|
|
109
|
-
#define MEGASAS_POLL_TIMEOUT 60000 // 60 seconds polling timeout
|
|
110
|
-
|
|
111
|
-
struct megasas_lun_s {
|
|
112
|
-
struct drive_s drive;
|
|
113
|
-
struct megasas_cmd_frame *frame;
|
|
114
|
-
u32 iobase;
|
|
115
|
-
u16 pci_id;
|
|
116
|
-
u8 target;
|
|
117
|
-
u8 lun;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
static int megasas_fire_cmd(u16 pci_id, u32 ioaddr,
|
|
121
|
-
struct megasas_cmd_frame *frame)
|
|
122
|
-
{
|
|
123
|
-
u32 frame_addr = (u32)frame;
|
|
124
|
-
int frame_count = 1;
|
|
125
|
-
u8 cmd_state;
|
|
126
|
-
|
|
127
|
-
dprintf(2, "Frame 0x%x\n", frame_addr);
|
|
128
|
-
if (pci_id == PCI_DEVICE_ID_LSI_SAS2004 ||
|
|
129
|
-
pci_id == PCI_DEVICE_ID_LSI_SAS2008) {
|
|
130
|
-
outl(0, ioaddr + MFI_IQPH);
|
|
131
|
-
outl(frame_addr | frame_count << 1 | 1, ioaddr + MFI_IQPL);
|
|
132
|
-
} else if (pci_id == PCI_DEVICE_ID_DELL_PERC5 ||
|
|
133
|
-
pci_id == PCI_DEVICE_ID_LSI_SAS1064R ||
|
|
134
|
-
pci_id == PCI_DEVICE_ID_LSI_VERDE_ZCR) {
|
|
135
|
-
outl(frame_addr >> 3 | frame_count, ioaddr + MFI_IQP);
|
|
136
|
-
} else {
|
|
137
|
-
outl(frame_addr | frame_count << 1 | 1, ioaddr + MFI_IQP);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
u32 end = timer_calc(MEGASAS_POLL_TIMEOUT);
|
|
141
|
-
do {
|
|
142
|
-
for (;;) {
|
|
143
|
-
cmd_state = GET_LOWFLAT(frame->cmd_status);
|
|
144
|
-
if (cmd_state != 0xff)
|
|
145
|
-
break;
|
|
146
|
-
if (timer_check(end)) {
|
|
147
|
-
warn_timeout();
|
|
148
|
-
return -1;
|
|
149
|
-
}
|
|
150
|
-
yield();
|
|
151
|
-
}
|
|
152
|
-
} while (cmd_state == 0xff);
|
|
153
|
-
|
|
154
|
-
if (cmd_state == 0 || cmd_state == 0x2d)
|
|
155
|
-
return 0;
|
|
156
|
-
dprintf(1, "ERROR: Frame 0x%x, status 0x%x\n", frame_addr, cmd_state);
|
|
157
|
-
return -1;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
int
|
|
161
|
-
megasas_process_op(struct disk_op_s *op)
|
|
162
|
-
{
|
|
163
|
-
if (!CONFIG_MEGASAS)
|
|
164
|
-
return DISK_RET_EBADTRACK;
|
|
165
|
-
u8 cdb[16];
|
|
166
|
-
int blocksize = scsi_fill_cmd(op, cdb, sizeof(cdb));
|
|
167
|
-
if (blocksize < 0)
|
|
168
|
-
return default_process_op(op);
|
|
169
|
-
struct megasas_lun_s *mlun_gf =
|
|
170
|
-
container_of(op->drive_fl, struct megasas_lun_s, drive);
|
|
171
|
-
struct megasas_cmd_frame *frame = GET_GLOBALFLAT(mlun_gf->frame);
|
|
172
|
-
u16 pci_id = GET_GLOBALFLAT(mlun_gf->pci_id);
|
|
173
|
-
int i;
|
|
174
|
-
|
|
175
|
-
memset_fl(frame, 0, sizeof(*frame));
|
|
176
|
-
SET_LOWFLAT(frame->cmd, MFI_CMD_LD_SCSI_IO);
|
|
177
|
-
SET_LOWFLAT(frame->cmd_status, 0xFF);
|
|
178
|
-
SET_LOWFLAT(frame->target_id, GET_GLOBALFLAT(mlun_gf->target));
|
|
179
|
-
SET_LOWFLAT(frame->lun, GET_GLOBALFLAT(mlun_gf->lun));
|
|
180
|
-
SET_LOWFLAT(frame->flags, 0x0001);
|
|
181
|
-
SET_LOWFLAT(frame->data_xfer_len, op->count * blocksize);
|
|
182
|
-
SET_LOWFLAT(frame->cdb_len, 16);
|
|
183
|
-
|
|
184
|
-
for (i = 0; i < 16; i++) {
|
|
185
|
-
SET_LOWFLAT(frame->pthru.cdb[i], cdb[i]);
|
|
186
|
-
}
|
|
187
|
-
dprintf(2, "pthru cmd 0x%x count %d bs %d\n",
|
|
188
|
-
cdb[0], op->count, blocksize);
|
|
189
|
-
|
|
190
|
-
if (op->count) {
|
|
191
|
-
SET_LOWFLAT(frame->pthru.sgl_addr, (u32)op->buf_fl);
|
|
192
|
-
SET_LOWFLAT(frame->pthru.sgl_len, op->count * blocksize);
|
|
193
|
-
SET_LOWFLAT(frame->sge_count, 1);
|
|
194
|
-
}
|
|
195
|
-
SET_LOWFLAT(frame->context, (u32)frame);
|
|
196
|
-
|
|
197
|
-
if (megasas_fire_cmd(pci_id, GET_GLOBALFLAT(mlun_gf->iobase), frame) == 0)
|
|
198
|
-
return DISK_RET_SUCCESS;
|
|
199
|
-
|
|
200
|
-
dprintf(2, "pthru cmd 0x%x failed\n", cdb[0]);
|
|
201
|
-
return DISK_RET_EBADTRACK;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
static int
|
|
205
|
-
megasas_add_lun(struct pci_device *pci, u32 iobase, u8 target, u8 lun)
|
|
206
|
-
{
|
|
207
|
-
struct megasas_lun_s *mlun = malloc_fseg(sizeof(*mlun));
|
|
208
|
-
char *name;
|
|
209
|
-
int prio, ret = 0;
|
|
210
|
-
|
|
211
|
-
if (!mlun) {
|
|
212
|
-
warn_noalloc();
|
|
213
|
-
return -1;
|
|
214
|
-
}
|
|
215
|
-
memset(mlun, 0, sizeof(*mlun));
|
|
216
|
-
mlun->drive.type = DTYPE_MEGASAS;
|
|
217
|
-
mlun->drive.cntl_id = pci->bdf;
|
|
218
|
-
mlun->pci_id = pci->device;
|
|
219
|
-
mlun->target = target;
|
|
220
|
-
mlun->lun = lun;
|
|
221
|
-
mlun->iobase = iobase;
|
|
222
|
-
mlun->frame = memalign_low(256, sizeof(struct megasas_cmd_frame));
|
|
223
|
-
if (!mlun->frame) {
|
|
224
|
-
warn_noalloc();
|
|
225
|
-
free(mlun);
|
|
226
|
-
return -1;
|
|
227
|
-
}
|
|
228
|
-
name = znprintf(MAXDESCSIZE, "MegaRAID SAS (PCI %pP) LD %d:%d"
|
|
229
|
-
, pci, target, lun);
|
|
230
|
-
prio = bootprio_find_scsi_device(pci, target, lun);
|
|
231
|
-
ret = scsi_drive_setup(&mlun->drive, name, prio);
|
|
232
|
-
free(name);
|
|
233
|
-
if (ret) {
|
|
234
|
-
free(mlun->frame);
|
|
235
|
-
free(mlun);
|
|
236
|
-
ret = -1;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return ret;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
static void megasas_scan_target(struct pci_device *pci, u32 iobase)
|
|
243
|
-
{
|
|
244
|
-
struct mfi_ld_list_s ld_list;
|
|
245
|
-
struct megasas_cmd_frame *frame = memalign_tmp(256, sizeof(*frame));
|
|
246
|
-
if (!frame) {
|
|
247
|
-
warn_noalloc();
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
memset(&ld_list, 0, sizeof(ld_list));
|
|
252
|
-
memset_fl(frame, 0, sizeof(*frame));
|
|
253
|
-
|
|
254
|
-
frame->cmd = MFI_CMD_DCMD;
|
|
255
|
-
frame->cmd_status = 0xFF;
|
|
256
|
-
frame->sge_count = 1;
|
|
257
|
-
frame->flags = 0x0011;
|
|
258
|
-
frame->data_xfer_len = sizeof(ld_list);
|
|
259
|
-
frame->dcmd.opcode = 0x03010000;
|
|
260
|
-
frame->dcmd.sgl_addr = (u32)MAKE_FLATPTR(GET_SEG(SS), &ld_list);
|
|
261
|
-
frame->dcmd.sgl_len = sizeof(ld_list);
|
|
262
|
-
frame->context = (u32)frame;
|
|
263
|
-
|
|
264
|
-
if (megasas_fire_cmd(pci->device, iobase, frame) == 0) {
|
|
265
|
-
dprintf(2, "%d LD found\n", ld_list.count);
|
|
266
|
-
int i;
|
|
267
|
-
for (i = 0; i < ld_list.count; i++) {
|
|
268
|
-
dprintf(2, "LD %d:%d state 0x%x\n",
|
|
269
|
-
ld_list.lds[i].target, ld_list.lds[i].lun,
|
|
270
|
-
ld_list.lds[i].state);
|
|
271
|
-
if (ld_list.lds[i].state != 0) {
|
|
272
|
-
megasas_add_lun(pci, iobase,
|
|
273
|
-
ld_list.lds[i].target, ld_list.lds[i].lun);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
static int megasas_transition_to_ready(struct pci_device *pci, u32 ioaddr)
|
|
280
|
-
{
|
|
281
|
-
u32 fw_state = 0, new_state, mfi_flags = 0;
|
|
282
|
-
|
|
283
|
-
if (pci->device == PCI_DEVICE_ID_LSI_SAS1064R ||
|
|
284
|
-
pci->device == PCI_DEVICE_ID_DELL_PERC5)
|
|
285
|
-
new_state = inl(ioaddr + MFI_OMSG0) & MFI_STATE_MASK;
|
|
286
|
-
else
|
|
287
|
-
new_state = inl(ioaddr + MFI_OSP0) & MFI_STATE_MASK;
|
|
288
|
-
|
|
289
|
-
while (fw_state != new_state) {
|
|
290
|
-
switch (new_state) {
|
|
291
|
-
case MFI_STATE_FAULT:
|
|
292
|
-
dprintf(1, "ERROR: fw in fault state\n");
|
|
293
|
-
return -1;
|
|
294
|
-
break;
|
|
295
|
-
case MFI_STATE_WAIT_HANDSHAKE:
|
|
296
|
-
mfi_flags = 0x08;
|
|
297
|
-
/* fallthrough */
|
|
298
|
-
case MFI_STATE_BOOT_MESSAGE_PENDING:
|
|
299
|
-
mfi_flags |= 0x10;
|
|
300
|
-
if (pci->device == PCI_DEVICE_ID_LSI_SAS2004 ||
|
|
301
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2008 ||
|
|
302
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2208 ||
|
|
303
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS3108) {
|
|
304
|
-
outl(mfi_flags, ioaddr + MFI_DB);
|
|
305
|
-
} else {
|
|
306
|
-
outl(mfi_flags, ioaddr + MFI_IDB);
|
|
307
|
-
}
|
|
308
|
-
break;
|
|
309
|
-
case MFI_STATE_OPERATIONAL:
|
|
310
|
-
mfi_flags = 0x07;
|
|
311
|
-
if (pci->device == PCI_DEVICE_ID_LSI_SAS2004 ||
|
|
312
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2008 ||
|
|
313
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2208 ||
|
|
314
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS3108) {
|
|
315
|
-
outl(mfi_flags, ioaddr + MFI_DB);
|
|
316
|
-
if (pci->device == PCI_DEVICE_ID_LSI_SAS2208 ||
|
|
317
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS3108) {
|
|
318
|
-
int j = 0;
|
|
319
|
-
u32 doorbell;
|
|
320
|
-
|
|
321
|
-
while (j < MEGASAS_POLL_TIMEOUT) {
|
|
322
|
-
doorbell = inl(ioaddr + MFI_DB) & 1;
|
|
323
|
-
if (!doorbell)
|
|
324
|
-
break;
|
|
325
|
-
msleep(20);
|
|
326
|
-
j++;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
} else {
|
|
330
|
-
outl(mfi_flags, ioaddr + MFI_IDB);
|
|
331
|
-
}
|
|
332
|
-
break;
|
|
333
|
-
case MFI_STATE_READY:
|
|
334
|
-
dprintf(2, "MegaRAID SAS fw ready\n");
|
|
335
|
-
return 0;
|
|
336
|
-
}
|
|
337
|
-
// The current state should not last longer than poll timeout
|
|
338
|
-
u32 end = timer_calc(MEGASAS_POLL_TIMEOUT);
|
|
339
|
-
for (;;) {
|
|
340
|
-
if (timer_check(end)) {
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
yield();
|
|
344
|
-
fw_state = new_state;
|
|
345
|
-
if (pci->device == PCI_DEVICE_ID_LSI_SAS1064R ||
|
|
346
|
-
pci->device == PCI_DEVICE_ID_DELL_PERC5)
|
|
347
|
-
new_state = inl(ioaddr + MFI_OMSG0) & MFI_STATE_MASK;
|
|
348
|
-
else
|
|
349
|
-
new_state = inl(ioaddr + MFI_OSP0) & MFI_STATE_MASK;
|
|
350
|
-
if (new_state != fw_state) {
|
|
351
|
-
break;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
dprintf(1, "ERROR: fw in state %x\n", new_state & MFI_STATE_MASK);
|
|
356
|
-
return -1;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
static void
|
|
360
|
-
init_megasas(void *data)
|
|
361
|
-
{
|
|
362
|
-
struct pci_device *pci = data;
|
|
363
|
-
u32 bar = PCI_BASE_ADDRESS_2;
|
|
364
|
-
if (!(pci_config_readl(pci->bdf, bar) & PCI_BASE_ADDRESS_IO_MASK))
|
|
365
|
-
bar = PCI_BASE_ADDRESS_0;
|
|
366
|
-
u32 iobase = pci_enable_iobar(pci, bar);
|
|
367
|
-
if (!iobase)
|
|
368
|
-
return;
|
|
369
|
-
pci_enable_busmaster(pci);
|
|
370
|
-
|
|
371
|
-
dprintf(1, "found MegaRAID SAS at %pP, io @ %x\n", pci, iobase);
|
|
372
|
-
|
|
373
|
-
// reset
|
|
374
|
-
if (megasas_transition_to_ready(pci, iobase) == 0)
|
|
375
|
-
megasas_scan_target(pci, iobase);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
void
|
|
379
|
-
megasas_setup(void)
|
|
380
|
-
{
|
|
381
|
-
ASSERT32FLAT();
|
|
382
|
-
if (!CONFIG_MEGASAS)
|
|
383
|
-
return;
|
|
384
|
-
|
|
385
|
-
dprintf(3, "init megasas\n");
|
|
386
|
-
|
|
387
|
-
struct pci_device *pci;
|
|
388
|
-
foreachpci(pci) {
|
|
389
|
-
if (pci->vendor != PCI_VENDOR_ID_LSI_LOGIC &&
|
|
390
|
-
pci->vendor != PCI_VENDOR_ID_DELL)
|
|
391
|
-
continue;
|
|
392
|
-
if (pci->device == PCI_DEVICE_ID_LSI_SAS1064R ||
|
|
393
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS1078 ||
|
|
394
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS1078DE ||
|
|
395
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2108 ||
|
|
396
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2108E ||
|
|
397
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2004 ||
|
|
398
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2008 ||
|
|
399
|
-
pci->device == PCI_DEVICE_ID_LSI_VERDE_ZCR ||
|
|
400
|
-
pci->device == PCI_DEVICE_ID_DELL_PERC5 ||
|
|
401
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS2208 ||
|
|
402
|
-
pci->device == PCI_DEVICE_ID_LSI_SAS3108)
|
|
403
|
-
run_thread(init_megasas, pci);
|
|
404
|
-
}
|
|
405
|
-
}
|