Repository navigation
fullhan: FH885xV200, FH865x, FH885x V100, FH8626V100 and FH8632 machines - #207
Conversation
Ten machines in hw/arm/fullhan.c over one memory map of mostly DesignWare blocks, with Fullhan's own devices as hw/*/fh-*.c: * fh-intc (DW APB ICTL; byte reads of FINALSTATUS for find_first_bit), fh-timer (DW APB timers clocked from the PMU), fh-uart (16550 + USR), fh-gpio, fh-spi (DW SSI with the SPIC data window, swap and 32-bit frames; fast-read dummies clocked as 8), fh-axi-dmac / fh-ahb-dmac, fh-i2c, fh-wdt, fh-rtc (v2 command interface, FH8632's v1), fh-pmu (chip IDs, boot strap, resets, the timer clock as a QEMU Clock, PTS), fh-efuse, fh-pts, fh-aes (AES/DES/3DES in ECB/CBC/CTR/CFB/OFB through QEMU's ciphers) and fh-sadc (the three register layouts); * the GMAC on xm-dwmac (new phy-id / phy-addr properties), MMC on hisi-himci, USB on dwc2-usb, the FH865x GIC-400 on a15mpcore_priv; * a mask ROM stand-in that loads the boot header's image, past FH865x's DDR-sizing ramboot; the SPI NOR from flash-file= (written back); * sensor=: a GalaxyCore model (GC4653, GC2053, GC2063, GC2093, GC1054) or the MIS2006 / JX-F37 ones on I2C0, for the vendor apps and ipcinfo. QEMU patches: 0012 (CCSIDR of a missing cache reads the L1 D-cache's, for FH865x's U-Boot), 0013 (m25p80 clears WEL after program / erase, for the 3.0.8 kernels' m25p80), 0014 (dwc2 GHWCFG properties and host descriptor DMA, for the 3.0.8 kernels' fh_otg). Camera dumps boot through the vendor U-Boot to their applications; the OpenIPC fh8852v200 / fh8852v100 releases boot to a login with a DHCP lease and a JFFS2 overlay (qemu-boot/test-fullhan-boot.sh, in CI). The ARC coprocessor and the media blocks are not modelled.
PR Summary by QodoAdd ten Fullhan camera SoC machines and firmware boot support
AI Description
Diagram
High-Level Assessment
Files changed (30)
|
Code Review by Qodo
1.
|
| if (s->xfer != want || (cmd & CMD_RESTART)) { | ||
| s->raw |= INTR_START_DET | INTR_ACTIVITY; | ||
| if (i2c_start_transfer(s->bus, addr, rd)) { | ||
| fh_i2c_abort(s, ABRT_7B_ADDR_NOACK); |
There was a problem hiding this comment.
4. Repeated-start reads retain the old transfer 🐞 Bug ≡ Correctness
fh_i2c_data_cmd() calls i2c_start_transfer() for a repeated start without ending its active QEMU I²C transfer. A write-then-repeated-start-read sequence therefore skips the target's transfer-end handling; the other I²C controller explicitly performs that transition before starting again.
Agent Prompt
## Issue description
Repeated-start commands start another QEMU I²C transfer without closing the active one.
## Fix Focus Areas
- qemu/hw/i2c/fh-i2c.c[161-177]
## Recommended Fix
End an active bus transfer before calling `i2c_start_transfer()` for a direction change or explicit restart, and keep the controller's transfer state consistent on failure.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Partly: QEMU's I2C core treats a start on a busy bus as a repeated start by design (no END in between, matching I2C, where there is no STOP), so that is intended. The real gap was a repeated start to a different address keeping the old target; fixed in 3de1e4e by ending the first transfer in that case.
…reads * fh-axi-dmac / fh-ahb-dmac: a failed read or write stops the channel with SRC_DEC_ERR / DST_DEC_ERR (AXI) or ERR (AHB) instead of carrying on to transfer-complete; every loop iteration spends the yield budget, so a cycle of zero-length LLIs no longer pins the main loop. * fh-spi: in EEPROM mode the response is clocked in once the command phase is over (the next register read, or 10 us after the last command frame), not between the frames of a multi-frame command. * fh-i2c: a repeated start to another address ends the transfer with the first target before addressing the second. * fh-aes: transfers move through a fixed 4 KiB buffer, not one sized by the guest's DMA length. * dwc2 (patch 0014): isochronous channels under descriptor DMA are refused (LOG_UNIMP, XactErr) rather than read with the non-isochronous descriptor layout. * test-fullhan.py: every machine's chip / package IDs and a migration round trip for all ten.
…ckend CI builds QEMU without gnutls, nettle or gcrypt, and the stub backend refuses every cipher: the engine moved no data and test-fullhan.py's AES checks read back zeros. AES now uses crypto/aes.h, which QEMU always builds; DES and 3DES still need a backend and are logged as unimplemented without one, and the qtest skips the DES check when the build has none.
Adds Fullhan's camera SoCs: ten machines in
hw/arm/fullhan.cover one memory map of mostly DesignWare blocks, Fullhan's own devices ashw/*/fh-*.c. Details indocs/fullhan.md.Machines:
fh8852v200,fh8856v200,fh8858v200,fh8652,fh8656,fh8658,fh8852v100,fh8856v100,fh8626v100,fh8632.Devices
qom-set /machine/sadc chN).xm-dwmac(newphy-id/phy-addrproperties), MMC onhisi-himci, USB ondwc2-usb, the FH865x GIC-400.sensor=on I2C0: GalaxyCore GC4653 / GC2053 / GC2063 / GC2093 / GC1054, MIS2006, JX-F37.flash-file=, written back), past FH865x's DDR-sizing ramboot.QEMU patches
fh_otg).Tested
fh8852v200/fh8852v100boot to a login with a DHCP lease and a JFFS2 overlay:qemu-boot/test-fullhan-boot.sh, added to CI.qemu/tests/test-fullhan.py(qtest, all generations; AES against FIPS-197 / SP 800-38A vectors), added to CI.usb-netpings overfh_otg.Not modelled: the ARC625 coprocessor and the ISP / VPU / encoder / JPEG blocks (only binaries in the SDKs), hence no video or audio; PWM, IR receiver.