soc: per-vendor file for kernel map - #1442
Conversation
|
@themactep This could use your input Kernels should come out of the family filesTaking the point that a SoC does not have a kernel. This PR as it stands has It could not hold 7.1. It silently mispairs. Every family reaches two or three kernels — 33 a 3.10 branch labelled 4.4. Same for ProposalFamily files describe hardware. Which kernels a family runs becomes a # soc/ingenic/kernels.mk
# Which kernels each family runs. A family that does not list a version does
# not run it: asking for one is an error, not a fallback.
KERNEL_SITE := https://github.com/gtxaspec/thingino-linux
KERNEL_DEFAULT_t23 := 3.10.14
KERNEL_BRANCH_t23_3.10.14 := ingenic-t31
KERNEL_BRANCH_t23_4.4.94 := ingenic-t23-4.4.94
KERNEL_HASH_t23_4.4.94 := b8a1f1ed22272b844fd423871f4aca16e8b779ff
KERNEL_BRANCH_t23_7.1-rc1 := ingenic-7.1-rc1
KERNEL_DEFAULT_t20 := 3.10.14
KERNEL_BRANCH_t20_3.10.14 := ingenic-t31
KERNEL_BRANCH_t20_7.1-rc1 := ingenic-7.1-rc112 defaults, 33 branch rows, 1 hash — derived mechanically from what the family All of the resolution, in KERNEL_VERSION := $(or $(KERNEL_VERSION),$(KERNEL_DEFAULT_$(SOC_FAMILY)))
KERNEL_BRANCH := $(KERNEL_BRANCH_$(SOC_FAMILY)_$(KERNEL_VERSION))
KERNEL_HASH := $(KERNEL_HASH_$(SOC_FAMILY)_$(KERNEL_VERSION))
ifeq ($(KERNEL_BRANCH),)
$(error SoC family '$(SOC_FAMILY)' does not run kernel $(KERNEL_VERSION))
endifThis also removes the awkward part of the current PR rather than tidying it. Three things I would rather you decide
Happy to push this as an incremental commit on top of this branch rather than a |
ingenic-t31 branch is universal, it covers all xburst1 architecture soc families. |
|
Thanks for the correction, I've taken the kernel mapping out of the soc family.mk and put it into a vendor.mk -- open to suggestions where it goes:
|
|
Rebased onto master (merge commit) and reworked the kernel table. The three-tier lookup is gone. No behaviour change — every family crossed with every version, and with none Also dropped the re-alignment churn: adding Still open from above: where this file belongs — |
Rebase of themactep#1442 onto current master. The seven soc/ingenic/*.mk files conflicted with c45befa (per-model if/else ladders, single SOC_UBOOT resolved for the flash type); resolved by keeping master's structure and adding the SOC_UBOOT_VARIANT assignments the PR introduced. Kernel selection leaves thingino.mk's SOC_FAMILY chain: a vendor's kernels now live in kernels/<vendor>.mk, one chain per version, closing on SOC_ARCH. thingino.mk resolves the version from the defconfig symbols, includes that file, and turns a family/version with no branch into an error instead of a fallback. The ls-remote for KERNEL_HASH is now guarded on KERNEL_SITE being set. The U-Boot variant fragment chain moves into the family files as SOC_UBOOT_VARIANT. The two cameras-exp defconfigs set BR2_INGENIC_SOC_MODEL where they set the long-dead BR2_SOC_INGENIC_T23N/T31N symbols, which no Kconfig defines: as-is they resolve no SOC_MODEL and fail with "Unknown SoC model". Verified against master with a makefile harness: - kernel resolution, 12 families x (none, KERNEL_VERSION_4, KERNEL_VERSION_7, explicit 3.10.14/4.4.94/7.1-rc1): identical except where the new table rejects or fixes a silent mispair -- t10/t20/t21/t30/t33 with 4.4.94 now resolve ingenic-t31-4.4.94 instead of the 3.10 catch-all ingenic-t31, and a1/t40 with an explicit 3.10.14 error instead of taking their 4.4 branch. No defconfig in the tree reaches either case. t23's pinned hash unchanged. - U-Boot variant fragment: all 54 claimed models resolve the same fragment as the old chain, and every fragment named exists on disk. Signed-off-by: Paul Philippov <paul@themactep.com>
303ea43 to
986285f
Compare
Kernel selection leaves thingino.mk's SOC_FAMILY chain: a vendor's kernels now live in kernels/<vendor>.mk, one chain per version, closing on SOC_ARCH. thingino.mk resolves the version from the defconfig symbols, includes that file, and turns a family/version with no branch into an error instead of a fallback. The ls-remote for KERNEL_HASH is guarded on KERNEL_SITE being set, so a vendor that names its kernel through Buildroot symbols makes no network call. The U-Boot variant fragment chain moves out of thingino.mk into the family files as SOC_UBOOT_VARIANT, named by the family because the fragment is not always named after the model (t31zx uses t31x's). Rebased onto current master; the seven soc/ingenic/*.mk files conflicted with the per-model if/else ladder and single-SOC_UBOOT restructure (c45befa), resolved by keeping master's structure and adding the SOC_UBOOT_VARIANT assignments. Verified against master with a makefile harness: - kernel resolution, 12 families x (none, KERNEL_VERSION_4, KERNEL_VERSION_7, explicit 3.10.14/4.4.94/7.1-rc1): identical except where the table rejects or fixes a silent mispair -- t10/t20/t21/t30/t33 with 4.4.94 now resolve ingenic-t31-4.4.94 instead of the 3.10 catch-all ingenic-t31, and a1/t40 with an explicit 3.10.14 error instead of taking their 4.4 branch. No defconfig in the tree reaches either case. t23's pinned hash unchanged. - U-Boot variant fragment: all 54 claimed models resolve the same fragment as the old chain, and every fragment named exists on disk. Signed-off-by: Paul Philippov <paul@themactep.com>
986285f to
53fcdb9
Compare
|
Nice refactor — the kernel map move is clearly the right direction. One thing I'd push back on: the Of the 13 models that have a variant fragment, 12 have And that exception is already a rule in the tree: UBOOT_VARIANT_FRAGMENT := $(BR2_EXTERNAL)/configs/uboot/variants/$(SOC_MODEL_LESS_Z).configwith the existing If the goal is to address t31zx as its own thing, the right fix is in U-Boot: give T31ZX a real variant symbol (e.g. Two things worth a separate look (both pre-existing, not introduced here):
|
Follows #1426. That PR gave every SoC family its own makefile fragment; this one
moves the last thing still keyed on
SOC_FAMILYinthingino.mkinto thosefiles — the kernel — and retires a guard that turned out to be dead.
thingino.mkpicked the kernel branch with a 45-lineifeqchain, one arm perfamily, several nesting a second test on
KERNEL_VERSION. Every fact in itbelongs to a family that now has a file of its own.
What a family says now
Seven of the twelve families are exactly that — two plain assignments. The five
whose branch really does depend on the kernel version add a key:
and t23 pins a hash the same way,
KERNEL_HASH_4.4.94. The keyed form cannot beavoided for those five: the branches are not derivable by any naming rule, since
t23 changes base between versions, t41's 3.10 branch carries its own suffix, and
t40 and a1 use a single branch for both.
A family file cannot test
KERNEL_VERSIONitself —soc/<vendor>/*.mkisincluded before the version is settled — so
thingino.mkresolves the versionfirst and then dereferences, once per variable:
All three variables read the same way: the family states the value, a
version-keyed name overrides it.
The U-Boot variant fragment goes too
The other thing
thingino.mkstill dispatched onSOC_*was thirteen armsmapping a model to
configs/uboot/variants/<model>.config. It sat a few linesbelow
UBOOT_DEFCONFIG, which already readsSOC_UBOOT_NOR/_NANDfrom thefamily file — the same data split across two places. Families now set
SOC_UBOOT_VARIANTalongside the other threeSOC_UBOOT_*values:The family names the fragment rather than
thingino.mkderiving it fromSOC_MODEL, because the name is not always the model — t31zx uses t31x's. Only13 of 54 models have one; the absent case behaves like
SOC_UBOOT_NORalreadydoes.
The empty-KERNEL_VERSION guard was stale
ifeq ($(KERNEL_VERSION),)wrapped the whole version chain. Nothing in the treeassigns
KERNEL_VERSION— no defconfig, no workflow, no script; theMakefileonly reads it — so the only ways it could be non-empty were a hand-typed
make KERNEL_VERSION=xor an environment variable. For the command line theguard is redundant, because a command-line value already overrides any
makefile assignment whether the guard is there or not. So its entire remaining
job was honouring an environment variable nothing sets.
Dropping it is what lets a family state
KERNEL_VERSIONoutright instead offeeding a default into a chain that then decides.
soc/ingenic/vendor.mk
KERNEL_SITEand the 7.1 branch are true of every Ingenic family rather than ofany one of them, so repeating them twelve times would be the wrong home. They go
in
soc/ingenic/vendor.mk, which has no$(filter)— the directory is alreadythe vendor.
AGENTS.mdcovers both this and the version keys.Two things fall out
The
git ls-remoteis guarded onKERNEL_SITEbeing set rather than on avendor name. A vendor naming its kernel through
BR2_LINUX_KERNEL_CUSTOM_GITsets no
KERNEL_SITE, resolves nothing, and makes no network call on everymake. A property test, not a list of vendor names to keep updated.The catch-all is written down.
else KERNEL_BRANCH := ingenic-t31quietlygave t10, t20, t21, t30 and t33 the t31 kernel, and nothing said so.
The one behaviour change
KERNEL_VERSIONset in the environment is no longer honoured. Command-linemake KERNEL_VERSION=…still wins, as it always did and independently of thischange. Nothing in the repository sets it in the environment.
Deliberately not changed
c100 still resolves 3.10.14 unless a defconfig sets
KERNEL_VERSION_4=y, exactlyas today. It is 4.4-only in practice and this makes fixing that a one-line edit
to
soc/ingenic/c100.mk, but that is a behaviour change and does not belong ina refactor.
Verification
Every family × input combination, against master. 12 families against unset,
KERNEL_VERSION_4=y,KERNEL_VERSION_7=y, three explicit command-line versionsand one environment variable — 84 combinations, 75 identical. The 9 that
differ are all the environment case above, on the 9 families whose own version
is not already 4.4.94. Both harnesses run in this tree, the old one against
master's family files so its guard is not tripped by the new ones.
The matrix earned its keep twice: it caught a missing kernel default on a1 that
no camera defconfig would have exposed, and it caught the harness itself
measuring the wrong thing.
Every model, for the U-Boot fragment.
.confignever carriesUBOOT_VARIANT_FRAGMENT, so the board sweep cannot see it. All 54 models thefamily filters claim resolve the same fragment as the old chain, and every
fragment named exists on disk.
.configfor all 171 camera defconfigs: 171 identical, 0 differing, 0failures, against the same master baseline. Both passes on this branch so
OUTPUT_DIR— which contains the branch name — does not move; theBR2_EXTERNAL_THINGINO_VERSIONstamp is excluded since any commit changes it.