Repository navigation
novatek: add nt98566_ultimate SPI NAND defconfig, UBIFS packaging, and uImage sysupgrade witness - #2970
Conversation
PR Summary by QodoAdd NT98566 SPI NAND boot support and hardware RNG
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
openipc-ai
left a comment
There was a problem hiding this comment.
Thanks for the full NAND bring-up. The approach, a UBIFS rootfs with the kernel inside it booted by openipc-novatek U-Boot, matches what that U-Boot looks for (/boot/fitImage or /boot/uImage). Several things block the merge.
Changes requested
-
Register the board with CI.
python3 .github/scripts/ci-matrix.py --self-testcurrently fails with:nt98566_ultimate has a defconfig but nothing builds it; add it to ALL_BOARDS, or to UNBUILT_BOARDS with the reason if that is deliberate. Add it toALL_BOARDS. -
Drop
board/nt9856x/kernel/patches/andBR2_LINUX_KERNEL_PATCH. Kernel changes belong in OpenIPC/linux, and you've opened OpenIPC/linux#330 for that. The "bridge untilOPENIPC_KERNELis bumped" plan doesn't work here because there is no pin to bump:OPENIPC_KERNELisnovatek-nt9856x, and the defconfig downloads that branch's tarball. As soon as #330 merges, this board stops building. I checked: applying0001-spinand-add-fudan-fm25s01a.patchthe way Buildroot does (patch -p1 -t -N) to #330'sspinand.cgivesReversed (or previously applied) patch detected! Skipping patch.with exit 1, whichapply-patches.shturns intoPatch failed!. The patch also needs fuzz 2 against today's branch. Land #330 first (it needs one ECC change, see that PR), then remove the patches here. -
ultimatehas to keep the NOR package, or this needs a different home. All 30*_ultimate_defconfigs in the tree setBR2_TARGET_ROOTFS_SQUASHFS=y, and the 7 with NAND ship the NAND image in addition (e.g.hi3516ev300_ultimate: one kernel config,FLASH_SIZE="16", squashfs and UBI). This defconfig drops squashfs and builds the kernel with# CONFIG_MTD_SPINOR is not set, which would make nt98566 the only SoC whoseultimatehas no NOR image. Please keep SPI NOR in the kernel and build both rootfs types (FLASH_SIZE="16"), as the other NOR+NAND ultimates do. Watch the kernel cap while doing it: today'snt98566_liteuImage is about 1.86 MiB against the 2048 KB NOR limit. -
sysupgrade cannot verify a local archive of this package. On the
ubifslayout,verify_ubifs_rootfstakes the SoC from the FIT besiderootfs.ubifs(fit_soc "$(kernel_image)", which is/tmp/fitImage.<soc>). This package has no FIT, so a--urlupgrade passes on the artifact name, but an upgrade from a local archive dies withCannot verify the SoC of a UBIFS rootfs: no FIT kernel beside it names oneunless the user passes--force_soc. A device-profile camera dies on the platform check either way. The tree's existing route avoids all of this: shipboard/nt9856x/nand-fit.its(seehi3516ev200's).rootfs_script.shbuilds the FIT,OPENIPC_UBIFS_BOOTputs it in/boot, andREPACK_NAND_FITpackages it. That also removes the need for the newREPACK_NAND_UBIFSbranch in theMakefileand theexternal.mkchange. Right now those two key on any family that has aubinize-nand.cfgand no FIT, an implicit trigger that only nt9856x hits today. If a FIT doesn't fit Novatek's appended-DTB kernel, say why. The alternative is then to teachverify_ubifs_rootfsto read the SoC from theuImage.<soc>name field, with a case intest_sysupgrade.sh. -
Keep the kernel config to what the NAND board needs, and correct the description.
CONFIG_PWM,CONFIG_PWM_SYSFSandCONFIG_PWM_NA51055have nothing to do with SPI NAND, and nothing in the image uses them: drop them, or name the consumer. For the RNG, the description still says "rng.quality = 1000so crng initializes immediately" and "/dev/hwrngfast crng init". That assignment was removed after review, and with quality 0 the 4.19 hwrng core credits no entropy, so the claim no longer holds. Please update the text. I checked the RNG itself on a lab NT98566 and it works (details on linux#330), so keepingCONFIG_HW_RANDOM_NVTis fine once #330 provides the dependency. Also move theCONFIG_UBIFS_*block from the end ofnt98566.nand.configinto Kconfig order, i.e. regenerate the file rather than appending to it. -
Paste the hardware evidence. Please include the actual output from the Dahua board: the
makesize lines, the bootdmesg(spinand identify, UBI attach, rootfs mount),cat /proc/mtd,ubinfo -a,df, and onesysupgraderun from this package onto the installed camera. -
Squash the history. Commit 4 says "drop unused exfatprogs", commit 5 adds it back, and commit 6 is a review fixup. Rebase into logical commits (kernel config plus defconfig, packaging) with messages that describe the final state.
b217887 to
6c6a433
Compare
|
Addressed all review items and squashed into 3 clean commits (
Build output (
|
openipc-ai
left a comment
There was a problem hiding this comment.
Thanks, most of the first round is done. From that round, 1 (CI registration), 2 (local patches dropped), 4 (uImage SoC witness, with tests), 6 (evidence, including a local-archive sysupgrade without --force_soc) and 7 (squash) are resolved. On 3 you're right: drivers/mtd/spiflash/Kconfig has MTD_SPINOR ... depends on (MTD) && (!MTD_SPINAND), so one kernel can't serve both flashes, and a NAND-only ultimate is the only option on this SoC. I'm withdrawing that item.
The sysupgrade change looks right to me. It still takes the FIT first, falls back only to a real legacy header (27051956), reads the SoC with the same nor_split_soc the split NOR path uses, and the two new cases cover the matching and the foreign SoC.
Still to change
- Rebase on master.
.github/scripts/ci-matrix.pyconflicts (the majestic count in the self-test moved again). While the PR conflicts, GitHub creates nopull_requestruns, so this head has no CI at all. nt98566.nand.configlost the thermal sensor. Compared with master'snt98566.generic.config, the regenerated file turns offCONFIG_THERMAL,CONFIG_THERMAL_OF,CONFIG_THERMAL_GOV_STEP_WISE,CONFIG_IIOandCONFIG_NVT_ADC. Those came in with #2950 and give nt98566 itsthermal_zone0, which the temperature readout uses. Runningolddefconfigagainst a kernel tree without those symbols drops them silently. Please rebuild the file from the currentnt98566.generic.configso the only differences are the NAND/UBI/UBIFS,MTD_OF_PARTSandHW_RANDOM_NVTlines.- Port #2971 into the same file. Master's
nt98566.generic.configno longer requires a signed regulatory.db (CONFIG_CFG80211_REQUIRE_SIGNED_REGDBoff,CONFIG_CFG80211_CERTIFICATION_ONUS=y,CONFIG_SYSTEM_DATA_VERIFICATIONandCONFIG_SYSTEM_TRUSTED_KEYRINGoff), so the kernel build no longer needs host OpenSSL.nt98566.nand.configstill has the old values. Item 2's rebuild covers this if you start from today's master. - Update the
ubinize-nand.cfgcomment after the rebase. #2972 (now on master) adds 4 MiB of headroom to the rootfs volume.external.mkwrites thevol_sizeinto a copy of the board'subinize-nand.cfginside the sameifneqyour wildcard extends, so nt9856x picks it up automatically. Your file's comment ("No vol_size on rootfs: the volume is sized to its image") will then be wrong. Word it the wayhi3516ev200/ubinize-nand.cfgnow does, and checkubinfo -aon the board shows the rootfs volume 4 MiB above the image.
OpenIPC/linux#330 is approved. Merge order: #330, then this PR.
6c6a433 to
fca77b0
Compare
…CI entry Add nt98566_ultimate_defconfig, Kconfig-ordered nt98566.nand.config (SPI NAND + HWECC, UBI/UBIFS, OF partitions, HW_RANDOM_NVT), ubinize-nand.cfg (rootfs + autoresize rootfs_data), exfat-openipc + exfatprogs, and register nt98566_ultimate in ci-matrix.py. Note: Novatek's drivers/mtd/spiflash/Kconfig defines MTD_SPINOR with 'depends on (MTD) && (!MTD_SPINAND)', so a single NT98566 kernel cannot enable both SPI NOR and SPI NAND simultaneously; nt98566_ultimate is therefore SPI NAND only (nt98566_lite continues to cover SPI NOR). Depends on OpenIPC/linux#330 (FM25S01A + nvt-rng Kconfig) and OpenIPC/u-boot#211. Tested on Dahua DH-IPC-HFW2449SP-S-IL (Novatek NT98566 / NA51089, 128 MB DDR3, Fudan FM25S01A 128 MiB SPI NAND ID 0xA1 0xE4, SC430AI).
Trigger OPENIPC_UBIFS_BOOT when board/<family>/ubinize-nand.cfg exists
(not only when nand-fit.its exists) so /boot/uImage is embedded inside
rootfs.ubifs for OpenIPC/u-boot openipc-novatek (CONFIG_LEGACY_IMAGE_FORMAT=y,
no CONFIG_FIT, ubifsload /boot/uImage + loader DTB via ${fdtaddr}).
Add REPACK_NAND_UBIFS in Makefile to package uImage.<soc>,
rootfs.ubifs.<soc>, and rootfs.ubi.<soc> into the -nand- archive.
Tested on Dahua DH-IPC-HFW2449SP-S-IL (Novatek NT98566 / NA51089,
128 MB DDR3, Fudan FM25S01A 128 MiB SPI NAND, SC430AI).
When verifying a UBIFS rootfs from a local archive on boards whose U-Boot boots /boot/uImage rather than a FIT (e.g. openipc-novatek), fall back to checking the legacy uImage.<soc> beside rootfs.ubifs using nor_split_soc() if no FIT is present. Add matching and foreign SoC test cases in test_sysupgrade.sh. Tested live on Dahua DH-IPC-HFW2449SP-S-IL (NT98566) via 'sysupgrade --archive=/overlay/openipc.nt98566-nand-ultimate.tgz' without --force_soc.
fca77b0 to
050162e
Compare
|
Rebased onto latest
|
openipc-ai
left a comment
There was a problem hiding this comment.
Round 3 at 050162e: all requested changes are in.
- The local kernel patches are gone. FM25S01A and the NA51089 RNG now come from OpenIPC/linux (linux#330, merged), so Qodo's finding 4 is stale.
- nt98566.nand.config differs from master's nt98566.generic.config only in MTD/UBI/UBIFS/HW_RANDOM, and keeps the thermal and regdb options.
- The ubinize-nand.cfg comment matches the #2972 rootfs headroom.
- verify_ubifs_rootfs has a uImage SoC-witness fallback, covered by both new test_sysupgrade.sh cases.
- CI is green, including Firmware (nt98566_ultimate).
Adds
nt98566_ultimate_defconfigfor Novatek NT98566 (NA51089) 128 MiB SPI NAND boards running OpenIPC U-Boot (openipc-novatek), UBIFS-with-/boot/uImagepackaging, and legacyuImageSoC verification insysupgrade.Merge Order / Companion PRs
FM25S01Awith 1-bit ECC/threshold and enablesCONFIG_HW_RANDOM_NVTonNA51089). All local kernel patches andBR2_LINUX_KERNEL_PATCHhave been removed from this PR.openipc-novatek): novatek: na51089: add Fudan FM25S01A SPI NAND support u-boot#211.Commits
novatek: add nt98566_ultimate_defconfig, SPI NAND kernel config, and CI entry— addsnt98566_ultimate_defconfig, Kconfig-orderednt98566.nand.config(SPI NAND + HWECC, UBI/UBIFS, OF partitions,HW_RANDOM_NVT, no unused PWM),ubinize-nand.cfg(rootfs+ autoresizerootfs_data),exfat-openipc+exfatprogs, and registersnt98566_ultimatein.github/scripts/ci-matrix.py(--self-testpasses).build: package UBIFS-with-uImage NAND images for non-FIT U-Boots— enablesOPENIPC_UBIFS_BOOTwhenubinize-nand.cfgis present (embedding/boot/uImageinsiderootfs.ubifs) and addsREPACK_NAND_UBIFSto shipuImage.nt98566,rootfs.ubifs.nt98566, androotfs.ubi.nt98566inopenipc.nt98566-nand-ultimate.tgz.sysupgrade: accept legacy uImage SoC witness beside UBIFS rootfs— teachesverify_ubifs_rootfsto fall back tonor_split_soconuImage.<soc>when no FIT is present (with matching & foreign SoC tests intest_sysupgrade.sh).Notes on Review Points
!MTD_SPINOR): In Novatek's kernel (drivers/mtd/spiflash/Kconfig:27),config MTD_SPINORhasdepends on (MTD) && (!MTD_SPINAND). A single NT98566 kernel cannot enable both SPI NOR and SPI NAND simultaneously, so shipping a NOR image from aMTD_SPINAND=ybuild would not boot on SPI NOR (nt98566_lite_defconfigcovers SPI NOR)./boot/uImageinstead ofnand-fit.its:OpenIPC/u-boot(openipc-novatek) is built withCONFIG_LEGACY_IMAGE_FORMAT=y(noCONFIG_FIT) and passes the loader's DTB via${fdtaddr}(ubifsload ${baseaddr} /boot/uImage; bootm ${baseaddr}). The alternative you suggested (teachingverify_ubifs_rootfsto read the SoC fromuImage.<soc>+test_sysupgrade.shcoverage) is implemented here.nvt-rnguses defaultquality = 0(per novatek: nt9856x: add Fudan FM25S01A SPI NAND and enable nvt-rng on NA51089 linux#330).