Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

hakios-config-test: redwood's arguments with its four big cores (cpus=4)

shimoku7431acfcbff358
diff --git a/tools/hakios-config-test.py b/tools/hakios-config-test.py
index b65ae74..8bf3c45 100755
--- a/tools/hakios-config-test.py
+++ b/tools/hakios-config-test.py
@@ -61,10 +61,11 @@ try:
a = args_of(run("args", "--config", cfg))
# the phone line from before there were configurations, plus the two things the SC7280 fragment turns on (the chip's identity
# and the sensors) and the two of redwood.config's panel (120 Hz frames, CoreAnimation clocked by the driver)
+ # and redwood.config's four big cores (cpus=4) instead of the line's eight
PANEL = ["fb_hz=120", "ca_vbl=1"]
- check("redwood: the project's phone line before configurations, plus socinfo and thermal, and the panel's 120 Hz",
- sorted(a) == sorted(OLD_PHONE_LINE + ["socinfo=1", "thermal=1"] + PANEL),
- "got %s\nwant %s" % (sorted(a), sorted(OLD_PHONE_LINE + ["socinfo=1", "thermal=1"] + PANEL)))
+ want = ["cpus=4" if x == "cpus=8" else x for x in OLD_PHONE_LINE] + ["socinfo=1", "thermal=1"] + PANEL
+ check("redwood: the project's phone line before configurations, plus socinfo and thermal, the panel's 120 Hz and the big cores",
+ sorted(a) == sorted(want), "got %s\nwant %s" % (sorted(a), sorted(want)))
check("redwood: kernel.ver carries the SoC", "-sc7280-" in r.stdout, r.stdout)
check("redwood: the .config is in Linux's form",
"CONFIG_GPU=y" in open(cfg).read() and "# CONFIG_CAM is not set" in open(cfg).read() and 'CONFIG_FIRMWARE="device"' in open(cfg).read())
@@ -79,7 +80,7 @@ try:
r = run("defconfig", "redwood", "open", "-o", o)
check("redwood + open: passes", r.returncode == 0, r.stdout + r.stderr)
check("redwood + open: nothing of the phone's own is loaded",
- sorted(args_of(run("args", "--config", o))) == sorted(("cpus=8 bootcpu=7 cpufreq=1 ufs=2 touchscreen=1 socinfo=1 thermal=1".split() + PANEL)),
+ sorted(args_of(run("args", "--config", o))) == sorted(("cpus=4 bootcpu=7 cpufreq=1 ufs=2 touchscreen=1 socinfo=1 thermal=1".split() + PANEL)),
run("args", "--config", o).stdout)
r = run("needs", "--config", o)
check("redwood + open: needs nothing", r.returncode == 0 and "nothing of the phone's own" in r.stdout, r.stdout)
@@ -104,11 +105,11 @@ try:
# the arguments straight from a defconfig, with no .config made (what `make qemu-open` asks for)
check("args --defconfig defconfig: cpus=1", args_of(run("args", "--defconfig", "defconfig")) == ["cpus=1"], run("args", "--defconfig", "defconfig").stdout)
check("args --defconfig redwood --fragment open: the open phone",
- sorted(args_of(run("args", "--defconfig", "redwood", "--fragment", "open"))) == sorted(("cpus=8 bootcpu=7 cpufreq=1 ufs=2 touchscreen=1 socinfo=1 thermal=1".split() + PANEL)))
+ sorted(args_of(run("args", "--defconfig", "redwood", "--fragment", "open"))) == sorted(("cpus=4 bootcpu=7 cpufreq=1 ufs=2 touchscreen=1 socinfo=1 thermal=1".split() + PANEL)))
check("args --defconfig redwood: the same as the .config's", sorted(args_of(run("args", "--defconfig", "redwood"))) == sorted(a))
# the order of the arguments is the table's: cpus first, as in the README's lines
- check("the arguments come in the order of the symbol table", args_of(run("args", "--config", cfg))[:3] == ["cpus=8", "bootcpu=7", "cpufreq=1"])
+ check("the arguments come in the order of the symbol table", args_of(run("args", "--config", cfg))[:3] == ["cpus=4", "bootcpu=7", "cpufreq=1"])
# savedefconfig round trip: the minimal defconfig, made a defconfig of its own, gives the same arguments
sd = run("savedefconfig", "--config", cfg)