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
configs: the common kernel's configuration (311 symbols, every one documented), a SoC fragment, a phone fragment
shimokufefce235f775
diff --git a/Makefile b/Makefileindex 1b8da5d..9853988 100644--- a/Makefile+++ b/Makefile@@ -18,7 +18,8 @@# to copy to a FAT32 volume (UEFI-native boot, no fastboot; docs/uefi-boot.md)## Configuration, the way Linux's make does it (configs/, tools/hakios-config.py; docs/configs.md):-# make redwood_defconfig .config from configs/defconfig + configs/redwood_defconfig (any NAME_defconfig)+# make redwood_defconfig .config from configs/defconfig + redwood_defconfig, which is common_defconfig + sc7280.config + redwood.config+# (any NAME_defconfig; make common_defconfig is the common kernel alone; docs/configs.md)# make virt.config lay a fragment (configs/virt.config) over the .config there is# make config show the .config: its symbols, the kernel's arguments, the firmware it wants# make savedefconfig the .config as a minimal defconfigdiff --git a/configs/common_defconfig b/configs/common_defconfignew file mode 100644index 0000000..e811039--- /dev/null+++ b/configs/common_defconfig@@ -0,0 +1,1008 @@+#+# HakiOS common defconfig: every setting there is, with what it does.+# Made by tools/hakios-config.py listing common; the values are the ones that file sets, and tests/CI check that it names every symbol.+#+# 311 symbols in 17 groups; 9 are set.+#++#+# Build facts (3)+#++# the directory of the phone under devices/ this configuration is for+# CONFIG_DEVICE is not set++# the SoC family (sc7280: SM7325, QCM6490); it is part of the kernel's version string+# CONFIG_SOC is not set++# "device": options may use firmware pulled from your own phone (fw-*/); "none": the open configuration, nothing of ...+CONFIG_FIRMWARE="device"++#+# CPU, memory and boot (21)+#++# CPU cores the kernel uses, 1 to 8; one if not set+# CONFIG_CPUS is not set++# the core the kernel runs on, 0 to 7; 7 is the biggest core (the loader keeps core 0)+# CONFIG_BOOTCPU is not set++# set the boot core to its top speed+# CONFIG_CPUFREQ is not set++# read by the patch to Apple's files (kernel)+# CONFIG_APPLOG is not set++# read by the patch to Apple's files (kernel)+# CONFIG_APPLOG_NAME is not set++# every MS milliseconds, how busy each of our cores was meanwhile, in percent, to the loader's log (tools/frames.py ...+# CONFIG_CPULOAD is not set++# the memory's bus clock managers ("BCM") in the command database the boot loader left, with what is needed to vote ...+# CONFIG_DDR is not set++# read by hakios.cpufreq.c (kernel)+# CONFIG_DDR_REST is not set++# read by hakios.cpufreq.c (kernel)+# CONFIG_DDR_VOTE is not set++# read by GenericARMPE.cpp (kernel)+# CONFIG_MACHINE_NAME is not set++# read by hakios.cpufreq.c (kernel)+# CONFIG_MEMBENCH is not set++# read by the patch to Apple's files, loader.c (kernel and loader)+# CONFIG_RD is not set++# read by the patch to Apple's files (kernel)+# CONFIG_REGTRACE is not set++# read by loader_return.c (kernel)+# CONFIG_RETURN_CPU is not set++# read by loader_return.c (kernel)+# CONFIG_RETURN_PANIC is not set++# read by the patch to Apple's files (kernel)+# CONFIG_SMALL_CORES is not set++# read by GenericARMPE.cpp (kernel)+# CONFIG_SMALL_CORES_AFTER is not set++# read by the patch to Apple's files (kernel)+# CONFIG_SYSSLEEP is not set++# read by the patch to Apple's files, user_exception_trace.c (kernel)+# CONFIG_SYSTRACE is not set++# read by the patch to Apple's files (kernel)+# CONFIG_SYSTRACE_NAME is not set++# read by the patch to Apple's files (kernel)+# CONFIG_XPCPROXY_IDVERSION is not set++#+# Storage and APFS (44)+#++# the phone's storage: 1 a survey, read only; 2 the loader's block service, through which the kernel reads it (the ...+CONFIG_UFS=2++# let the kernel write, to the partition `darwin` and nowhere else (writes to the phone's storage: it is the one ... [requires CONFIG_UFS=2]+# CONFIG_UFS_WRITE is not set++# keep /private/var across reboots, in the partition `darwin` [requires CONFIG_UFS_WRITE]+# CONFIG_VAR_STORE is not set++# read by apfs_vfsops.c (kernel)+# CONFIG_APFS_CHEAP is not set++# walk the whole volume and print only the totals+# CONFIG_APFS_CHECK is not set++# read by hakios.apfs_check.c (kernel)+# CONFIG_APFS_CHUNK is not set++# no file is read at all, only looked up and stat'ed -- how long the walk itself takes, the directories and the inodes+# CONFIG_APFS_CONTENTS is not set++# go no deeper than N levels below where the walk starts (1 = only the entries of that directory; 0 = no limit)+# CONFIG_APFS_DEPTH is not set++# the device to mount for modes 1 to 3 and 6 (default rvblk0)+# CONFIG_APFS_DEV is not set++# read by hakios.apfs_check.c (kernel)+# CONFIG_APFS_HASH is not set++# stop after N entries (and say how memory stood on the way): for finding out what a walk that never comes back runs ...+# CONFIG_APFS_MAX is not set++# read by apfs_vfsops.c (kernel)+# CONFIG_APFS_META_CLUSTER is not set++# where to mount it for mode 6 (default /private/var/apfs-check)+# CONFIG_APFS_MNT is not set++# at most N threads on one request, the caller's included (default: four, or the processors if fewer -- see ...+# CONFIG_APFS_PAR is not set++# read by apfs_vfsops.c (kernel)+# CONFIG_APFS_ROOT_C is not set++# read by apfs_vfsops.c (kernel)+# CONFIG_APFS_ROOT_V is not set++# read by apfs_vfsops.c (kernel)+# CONFIG_APFS_ROUND is not set++# directories not to go into, as paths inside the volume, comma separated+# CONFIG_APFS_SKIP is not set++# read by hakios.sparse.c (kernel)+# CONFIG_APFS_SPARSE is not set++# how many bytes of payload (default 40000)+# CONFIG_APFS_STORE_LEN is not set++# the writer's own number, kept in the header (default 0)+# CONFIG_APFS_STORE_NOTE is not set++# which pattern (default 1); a different seed is a different payload+# CONFIG_APFS_STORE_SEED is not set++# walk only that part of the volume+# CONFIG_APFS_SUBTREE is not set++# how many, for mode 5 (default 4)+# CONFIG_APFS_THREADS is not set++# read by apfs_vfsops.c (kernel)+# CONFIG_APFS_UBC_READ is not set++# a volume for user space in an ordinary boot+# CONFIG_APFS_VOLUME is not set++# read by hakios.apfs_check.c (kernel)+# CONFIG_APFS_VOLUME_AT is not set++# one of N walkers; a subdirectory is left on the shared stack (par_push)+# CONFIG_APFS_WALKERS is not set++# where in the file (default 0)+# CONFIG_APFS_WRITE_AT is not set++# what to fill them with (default 0xa5)+# CONFIG_APFS_WRITE_BYTE is not set++# how many bytes (default 4096, at most APFS_WRITE_MAX)+# CONFIG_APFS_WRITE_LEN is not set++# the file in it, by path from the volume's root+# CONFIG_APFS_WRITE_PATH is not set++# what one request through the loader costs, by size+# CONFIG_UFS_BENCH is not set++# read by hakios.ufs.c (kernel)+# CONFIG_UFS_CHECK is not set++# through this kernel's own driver instead, its own transfer list in the controller for the run, if all is as ...+# CONFIG_UFS_NATIVE is not set++# read by hakios.ufs.c (kernel)+# CONFIG_UFS_NATIVE_BENCH is not set++# read by hakios.ufshc.c (kernel)+# CONFIG_UFS_NATIVE_BUFFER is not set++# what this kernel's own driver reads is what the loader reads, byte for byte+# CONFIG_UFS_NATIVE_CHECK is not set++# read by hakios.ufshc.c (kernel)+# CONFIG_UFS_NATIVE_HANG is not set++# read by hakios.ufshc.c (kernel)+# CONFIG_UFS_NATIVE_LEAVE is not set++# read by hakios.ufshc.c (kernel)+# CONFIG_UFS_NATIVE_SLOTS is not set++# read by hakios.ufshc.c (kernel)+# CONFIG_UFS_NATIVE_SPIN is not set++# read by hakios.ufs.c (kernel)+# CONFIG_VAR_SAVE_MS is not set++# read by hakios.virtio_blk.c (kernel)+# CONFIG_VIRTIO_BLK is not set++#+# Touch and buttons (8)+#++# the touch screen, and the power and volume buttons+CONFIG_TOUCHSCREEN=y++# read by hakios.buttons.c (kernel)+# CONFIG_BUTTONS is not set++# read by hakios.buttons.c (kernel)+# CONFIG_BUTTONS_STEPS is not set++# read by hakios.goodix.c (kernel)+# CONFIG_TOUCH_FLIP is not set++# read by hakios.goodix.c (kernel)+# CONFIG_TOUCH_POLL_US is not set++# the chip reports twice as often (Xiaomi's game mode; 240 otherwise)+# CONFIG_TOUCH_RATE is not set++# the bus at N Hz (Android's device tree gives the chip 5 MHz)+# CONFIG_TOUCH_SPI_HZ is not set++# read by hakios.virtio_input.c (kernel)+# CONFIG_VIRTIO_INPUT is not set++#+# GPU and display (67)+#++# rendering on Adreno (an image built with GL=1; the GPU's firmware from your phone) [needs fw-gpu/ from the phone]+CONFIG_GPU=y++# read by hakios.adreno.c (kernel)+# CONFIG_ADRENO is not set++# read by hakios.adreno.c (kernel)+# CONFIG_ADRENO_BLIND is not set++# read by hakios.adreno.c (kernel)+# CONFIG_ADRENO_DIRTY is not set++# the newest step waits like that before every single access+# CONFIG_ADRENO_FINE is not set++# read by hakios.adreno.c (kernel)+# CONFIG_ADRENO_KEEP is not set++# step K alone (what steps 6 to 10 need, they check for themselves: within one session of the loader, power and clocks ...+# CONFIG_ADRENO_ONLY is not set++# how long the newest step waits after announcing a group of accesses (default 2200)+# CONFIG_ADRENO_PAUSE is not set++# when all is over, go back to the loader instead of starting the system+# CONFIG_ADRENO_RETURN is not set++# leave out the steps whose bits are set (bit 2 = step 2)+# CONFIG_ADRENO_SKIP is not set++# step 17 asks the GMU for the 3D core's Nth speed: 1 315 MHz, 2 450 MHz, 3 550 MHz (the default: the most this ...+# CONFIG_ADRENO_SPEED is not set++# step 18 leaves the core's second stream out (0) or gives it an empty context of its own (2): what the SMMU then ...+# CONFIG_ADRENO_STREAM1 is not set++# after the last step, say once a second for S seconds (default 20) that the machine is still alive, and what was ...+# CONFIG_ADRENO_WATCH is not set++# before any step: read what the firmware left the display controller doing (display_probe() below; two clocks are ...+# CONFIG_DISPLAY_PROBE is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_FB_BEAT is not set++# which pixels of the panel each frame changed (it costs: the panel's memory is slow to read)+# CONFIG_FB_DIFF is not set++# the picture is scaled to the panel nearest neighbour, as it once was+# CONFIG_FB_FILTER is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_FB_HZ is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_FB_QUEUE is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_FB_THREADS is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_FBHEIGHT is not set++# the same 375 x 812 points drawn at two pixels a point instead of three+# CONFIG_FBSCALE is not set++# log the first N calls of every selector (default 3)+# CONFIG_FBTRACE is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_FBWIDTH is not set++# the surface's memory, as before+# CONFIG_GLBLIT is not set++# read by eagl.c (user space)+# CONFIG_GLCENSUS is not set++# read by eagl.c (user space)+# CONFIG_GLCOPY is not set++# read by eagl.c (user space)+# CONFIG_GLENV is not set++# read by eagl.c (user space)+# CONFIG_GLFETCH is not set++# read by eagl.c (user space)+# CONFIG_GLFRAMES is not set++# read by eagl.c (user space)+# CONFIG_GLGROUP is not set++# read by eagl.c (user space)+# CONFIG_GLNUMBERS is not set++# leave such draws as they are; 2: also those without a texture; 3: the two with a colour matrix drawn plainly too+# CONFIG_GLPLAIN is not set++# as the shaders say.+# CONFIG_GLPRECISION is not set++# read by eagl.c (user space)+# CONFIG_GLSHADERS is not set++# the first texture of that size there is (names are handed out afresh every run)+# CONFIG_GLSHOW is not set++# read by eagl.c (user space)+# CONFIG_GLSHOW_PART is not set++# read by eagl.c (user space)+# CONFIG_GLSHOW_ZOOM is not set++# the draws of those programs are left out of the picture, which says what in it is their work+# CONFIG_GLSKIP is not set++# read by eagl.c (user space)+# CONFIG_GLSLOW is not set++# read by eagl.c (user space)+# CONFIG_GLSYNC is not set++# read by eagl.c (user space)+# CONFIG_GLTRACE is not set++# read by eagl.c (user space)+# CONFIG_GLTRACE_AT is not set++# read by eagl.c (user space)+# CONFIG_GLTRACE_CORNERS is not set++# read by eagl.c (user space)+# CONFIG_GLTRACE_DRAWS is not set++# read by eagl.c (user space)+# CONFIG_GLTRACE_FRAMES is not set++# read by eagl.c (user space)+# CONFIG_GLTRACE_FUNCTION is not set++# read by eagl.c (user space)+# CONFIG_GLTRACE_LIT is not set++# the pixel a listed draw has left in the middle of itself (the matrix is CoreAnimation's, the last it gave)+# CONFIG_GLTRACE_LOOK is not set++# a line about a draw, if any of its first corners is inside the rectangle (or the rectangle inside them)+# CONFIG_GLTRACE_PLACE is not set++# the text of the shaders the program of a traced draw is made of, the first time that program draws+# CONFIG_GLTRACE_SHADERS is not set++# what the program of a traced draw was given, by the names its shaders use (coord_arg, texmat0, ...)+# CONFIG_GLTRACE_UNIFORMS is not set++# read by eagl.c (user space)+# CONFIG_GLWAIT is not set++# read by hakios.gpu.cpp (kernel)+# CONFIG_GPU_CACHED is not set++# read by hakios.adreno.c (kernel)+# CONFIG_GPU_EXACT is not set++# read by hakios.gpu.cpp (kernel)+# CONFIG_GPU_KEEP is not set++# read by hakios.adreno.c (kernel)+# CONFIG_GPU_LOG is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_REC_MB is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_REC_RING is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_REC_SECS is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_REC_START is not set++# read by MiniIOMobileFramebuffer.cpp (kernel)+# CONFIG_REC_STEP is not set++# kept memory is given out as it is (to see what the clearing costs; a surface is then not all zeroes)+# CONFIG_SURF_CLEAR is not set++# log the first N surfaces created (default 24)+# CONFIG_SURFTRACE is not set++# read by MiniIOSurface.cpp (kernel)+# CONFIG_SURFTRACE_OF is not set++# a line for every wait of a program's for the GPU that took a millisecond or more ("tl: f KIND US at US"), for ...+# CONFIG_TOUCH_LAT is not set++# read by eagl.c (user space)+# CONFIG_VBLUR is not set++#+# Audio and battery (30)+#++# the audio DSP; the battery level in the UI and charging state come through it [needs fw-audio/ from the phone]+CONFIG_ADSP=y++# the speakers (4 is what the README's phone line uses) [needs fw-audio/ from the phone] [requires CONFIG_ADSP]+CONFIG_SOUND=4++# the microphone (4 is what the README's phone line uses) [needs fw-audio/ from the phone] [requires CONFIG_ADSP]+# CONFIG_MIC is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_AGAIN is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_APR_WAIT is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_KEEP is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_LISTEN is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_NEW is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_PAUSE is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_RETURN is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_STEP is not set++# read by hakios.adsp.c (kernel)+# CONFIG_ADSP_WAIT is not set++# read by hakios.adsp.c, hakios.battery.c, loader.c (kernel and loader)+# CONFIG_BATTERY is not set++# every property once, for the log (which number is which on this phone's firmware)+# CONFIG_BATTMGR is not set++# read by hakios.mic.c (kernel)+# CONFIG_MIC_ADC is not set++# read by hakios.mic.c (kernel)+# CONFIG_MIC_INPUT is not set++# read by hakios.mic.c (kernel)+# CONFIG_MIC_MAIN is not set++# read by hakios.mic.c (kernel)+# CONFIG_MIC_SECS is not set++# read by hakios.mic.c (kernel)+# CONFIG_MIC_TAP is not set++# read by hakios.mic.c (kernel)+# CONFIG_MIC_TEST is not set++# read by hakios.audio.c (kernel)+# CONFIG_REC_SOUND is not set++# read by hakios.audio.c (kernel)+# CONFIG_REC_SOUND_FED is not set++# read by hakios.audio.c (kernel)+# CONFIG_REC_SOUND_MIC is not set++# read by hakios.sound.c (kernel)+# CONFIG_SOUND_BELOW is not set++# read by hakios.sound.c (kernel)+# CONFIG_SOUND_GAIN is not set++# read by hakios.sound.c (kernel)+# CONFIG_SOUND_GUARD_AS is not set++# read by hakios.sound.c (kernel)+# CONFIG_SOUND_PAUSE is not set++# read by hakios.sound.c (kernel)+# CONFIG_SOUND_SECS is not set++# reads registers and nothing else: the pins, the power names (below)+# CONFIG_SPEAKER_PROBE is not set++# read by hakios.virtio_sound.c (kernel)+# CONFIG_VIRTIO_SOUND is not set++#+# Wi-Fi (31)+#++# Wi-Fi: the radio, its driver, a connection (also fw-wifi/mac and fw-wifi/network) [needs fw-wifi/ from the phone]+CONFIG_WIFI=y++# start the DSP although the one before it was shut down without having acknowledged a stop: THAT HAS RESET THE PHONE, ...+# CONFIG_WIFI_AGAIN is not set++# step 14 also asks that service a question (its capabilities) and writes down the beginning of an answer+# CONFIG_WIFI_ASK is not set++# read by lx_80211.c (kernel)+# CONFIG_WIFI_BA is not set++# read by hakios.wlfw.c (kernel)+# CONFIG_WIFI_CAL is not set++# read by hakios.wifi.c (kernel)+# CONFIG_WIFI_DIRTY is not set++# with wifi=1: the network of fw/network is not joined at the start+# CONFIG_WIFI_FILE is not set++# such a step waits like that before every single write and call+# CONFIG_WIFI_FINE is not set++# read by lx_bus.c (kernel)+# CONFIG_WIFI_HOLD is not set++# read by lx_bus.c (kernel)+# CONFIG_WIFI_IRQ is not set++# read by lx_bus.c (kernel)+# CONFIG_WIFI_JOIN is not set++# when the steps are over the DSP and the link stay up while the system runs, for whoever uses sys/hakios.qrtr.h; ...+# CONFIG_WIFI_KEEP is not set++# how long step 14 waits for the Wi-Fi firmware's service (default 3)+# CONFIG_WIFI_LISTEN is not set++# read by hakios.wifi.c (kernel)+# CONFIG_WIFI_LOUD is not set++# read by hakios.wifi.c, lx_bus.c (kernel)+# CONFIG_WIFI_LX is not set++# read by lx_base.c (kernel)+# CONFIG_WIFI_LX_STEP is not set++# the radio's own address for the driver (hakios_wifi_radio_address() below; xl takes it from a file that is not in ...+# CONFIG_WIFI_MAC is not set++# read by hakios.wlfw.c (kernel)+# CONFIG_WIFI_MISSION is not set++# steps K and later have not been seen to work (default: the last one)+# CONFIG_WIFI_NEW is not set++# read by hakios.wifi.c (kernel)+# CONFIG_WIFI_PAUSE is not set++# read by lx_bus.c (kernel)+# CONFIG_WIFI_QUIET is not set++# step 16 does read (2: whatever mode the firmware is in)+# CONFIG_WIFI_RADIO_READ is not set++# read by hakios.wlfw.c (kernel)+# CONFIG_WIFI_READY is not set++# when all is over, go back to the loader instead of starting the system+# CONFIG_WIFI_RETURN is not set++# read by lx_bus.c (kernel)+# CONFIG_WIFI_SCAN is not set++# before any step: read what the boot chain has set up in the SMMU for the radio's stream (smmu_look() below; nothing ...+# CONFIG_WIFI_SMMU is not set++# read by lx_bus.c (kernel)+# CONFIG_WIFI_STATION is not set++# read by hakios.wifi.c (kernel)+# CONFIG_WIFI_STEP is not set++# how long step 11 watches for the DSP to say that it is up (default 10)+# CONFIG_WIFI_WAIT is not set++# read by hakios.wifi.c (kernel)+# CONFIG_WIFI_WATCH is not set++# read by lx_80211.c (kernel)+# CONFIG_WIFI_WIDE is not set++#+# Cellular (53)+#++# the modem beside the system: its firmware, file systems, IPA, SIM, NAS [needs fw-modem/ from the phone] [requires CONFIG_UFS=2]+CONFIG_MODEM=y++# start the modem although a kernel before this one left it shut down [requires CONFIG_MODEM]+CONFIG_MODEM_AGAIN=y++# the modem's RMTFS buffer, an address below 4 GB (0xa8000000 on the reference phone) [requires CONFIG_MODEM]+# CONFIG_MODEM_BUFFER is not set++# a session to that APN instead of the default profile+# CONFIG_MODEM_APN is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_DATA_NOBIND is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_DATA_OFF is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_DATA_WAIT is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_DPM_OFF is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_BUS_OFF is not set++# none of this. modem_ipa_data_trace=1: a line per packet.+# CONFIG_MODEM_IPA_DATA_OFF is not set++# read by hakios.cell.c, hakios.ipa.c (kernel)+# CONFIG_MODEM_IPA_DATA_TRACE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_FW is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_FW_AT is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_GSI_ENABLE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_ITEM is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_NO_PROBE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_QUIET is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_RAW is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_ROUTES is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_SKIP_UC is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_IPA_SMMU_OFF is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_KEEP is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_LISTEN is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_NAS_WAIT is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_NEW is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_NO_IPA_QMI is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_NO_NAV is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_NO_TFTP is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_ONLINE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_PAUSE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_RETURN is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_RMTFS_DELAY is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_RMTFS_RW_FAKE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_RMTFS_RW_OFF is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_SHARE_OFF is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_SHARE_TEST is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_SIM_PROBE_OFF is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_SIM_SWITCH_OFF is not set++# the steps once the root is there, then back to the loader if modem_return=1 says so+# CONFIG_MODEM_STEP is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_WAIT is not set++# read by hakios.mpss.c (kernel)+# CONFIG_MODEM_WDA_OFF is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_CMD_DB is not set++# read by hakios.ipa.c (kernel)+# CONFIG_SOC_GSI_BASE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_IMEM is not set++# read by hakios.ipa.c (kernel)+# CONFIG_SOC_IPA_BASE is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_IPA_FW is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_IPA_STREAM is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_IPA_STREAM_UC is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_MPSS_MEM is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_PAS_IPA is not set++# read by hakios.mpss.c (kernel)+# CONFIG_SOC_PAS_MPSS is not set++# where SMEM is (also the modem driver's argument; 0x80900000 on the reference phone)+# CONFIG_SOC_SMEM is not set++#+# Cameras (13)+#++# the cameras (5 is what the README uses) [needs fw-camera/ from the phone]+# CONFIG_CAM is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_AFTER is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_FAKE is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_FAKE_FPS is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_FRAMES is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_GAIN is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_KEEP_MB is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_MODE is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_PATTERN is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_SENSOR is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_SETTLE is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_SHUTTER is not set++# read by hakios.camera.c (kernel)+# CONFIG_CAM_VBLANK is not set++#+# Haptics and torch (5)+#++# the vibration motor (5 is what the README's phone line uses) [needs fw-haptic/ from the phone]+# CONFIG_HAPTIC is not set++# read by hakios.haptic.c (kernel)+# CONFIG_HAPTIC_EFFECT is not set++# a look, reading only: the arbiter's channel for the module and who may write through it, the module's type, its ...+# CONFIG_TORCH is not set++# read by hakios.torch.c (kernel)+# CONFIG_TORCH_MAX_S is not set++# read by hakios.torch.c (kernel)+# CONFIG_TORCH_SECS is not set++#+# Chip, thermal and PMIC (10)+#++# read the chip's identity from the firmware's shared memory: kern.hakios.soc_* (SoC number, revision, board)+# CONFIG_SOCINFO is not set++# read the SoC's 27 temperature sensors: kern.hakios.thermal_* and a line in the log; read only+# CONFIG_THERMAL is not set++# how often the sensors are read, in milliseconds (200 to 60000; 2000) [requires CONFIG_THERMAL]+# CONFIG_THERMAL_POLL is not set++# hand control back to the loader when the hottest sensor reads this many degrees three times in a row (0: never; ... [requires CONFIG_THERMAL]+# CONFIG_THERMAL_STOP is not set++# list every block of the power-management chips the SPMI arbiter shows, and read the PMIC's clock; read only+# CONFIG_PMIC is not set++# only the clock, not the inventory of every block+# CONFIG_PMIC_LIST is not set++# read by hakios.socinfo.c (kernel)+# CONFIG_SOC_SMEM_SIZE is not set++# a summary line this often (0: only on a rise; 60)+# CONFIG_THERMAL_LOG is not set++# read by hakios.thermal.c (kernel)+# CONFIG_THERMAL_TM0 is not set++# read by hakios.thermal.c (kernel)+# CONFIG_THERMAL_TM1 is not set++#+# Network (3)+#++# a log line for each of the first N frames on the network interfaces+# CONFIG_NET_TRACE is not set++# a log line for every name asked of a DNS server and every TCP connection begun (the names go to the log: for ...+# CONFIG_NET_NAMES is not set++# QEMU's virtio network device as en0 (QEMU only; its bus address means nothing on a phone)+# CONFIG_VIRTIO_NET is not set++#+# Security stand-ins (1)+#++# read by kern_minimac.c (kernel)+# CONFIG_PRIVS is not set++#+# Debugging (6)+#++# read by user_exception_trace.c (kernel)+# CONFIG_USTACKS is not set++# read by user_exception_trace.c (kernel)+# CONFIG_USTACKS_AT is not set++# read by user_exception_trace.c (kernel)+# CONFIG_USTACKS_COUNT is not set++# read by user_exception_trace.c (kernel)+# CONFIG_USTACKS_MS is not set++# read by user_exception_trace.c (kernel)+# CONFIG_USTACKS_THREADS is not set++# read by user_exception_trace.c (kernel)+# CONFIG_USTACKS_TNAME is not set++#+# Loader (4)+#++# read by loader.c (loader)+# CONFIG_CPUMASK is not set++# read by loader.c (loader)+# CONFIG_GAMUT is not set++# read by loader.c (loader)+# CONFIG_SERIAL is not set++# read by loader.c (loader)+# CONFIG_UFS_PROBE is not set++#+# User space (11)+#++# read by inject_sb.c (user space)+# CONFIG_AUTOUNLOCK is not set++# CoreAnimation's frame clock from the display driver's refresh notifications+# CONFIG_CA_VBL is not set++# read by inject.c (user space)+# CONFIG_CAENV is not set++# read by inject_sb.c (user space)+# CONFIG_CC_FADE is not set++# not even with a GPU; gl=1: also without one, by Mesa's software driver (slow; for working on eagl.c in QEMU)+# CONFIG_GL is not set++# read by inject.c (user space)+# CONFIG_GLCOMPILE is not set++# read by inject.c (user space)+# CONFIG_GLNO is not set++# read by inject.c (user space)+# CONFIG_GLSB3 is not set++# the renderer is made to answer that it has those functions after all+# CONFIG_GLYES is not set++# the root is to be the iOS root volume on /dev/DEV -- the phone's flash, read only+# CONFIG_ROOT_APFS is not set++# read by inject_sb.c (user space)+# CONFIG_SWITCHER_WALLPAPER is not set++#+# Extra arguments (1)+#++# more kernel arguments, as `name=value` words in quotes; each name must be one docs/boot-args.md lists+# CONFIG_BOOTARGS is not set+diff --git a/configs/redwood.config b/configs/redwood.confignew file mode 100644index 0000000..a3a9aa5--- /dev/null+++ b/configs/redwood.config@@ -0,0 +1,6 @@+# HakiOS fragment: the POCO X5 Pro 5G (redwood, devices/redwood) -- what is true of this phone and of no other with the same SoC.+# The vibration motor's variant (5), and where the modem's remote-file-system buffer is in its memory map (a number taken from the+# phone's own device tree; tools/soc-args.py makes it for a phone that has another).+CONFIG_DEVICE="redwood"+CONFIG_HAPTIC=5+CONFIG_MODEM_BUFFER=0xa8000000diff --git a/configs/redwood_defconfig b/configs/redwood_defconfigindex 38bc654..4883307 100644--- a/configs/redwood_defconfig+++ b/configs/redwood_defconfig@@ -1,19 +1,7 @@-# HakiOS defconfig for the POCO X5 Pro 5G (redwood, SM7325, devices/redwood): the arguments the project's own phone line uses.-# It is exactly what `make phone` and tools/modem-cycle.sh passed before there were configurations, so choosing it changes nothing.+# HakiOS defconfig for the POCO X5 Pro 5G (redwood, SM7325, devices/redwood): the common kernel's configuration, the SC7280 family's+# facts and this phone's own, put together the way Android puts a device's kernel configuration together.+# What the project's own phone line uses, with the sensors read (and the run stopped at 105 degrees) as the only addition.# Needs the phone's own firmware pulled from your phone (devices/redwood/pull-firmware.sh): `tools/hakios-config.py needs`.-CONFIG_DEVICE="redwood"-CONFIG_SOC="sc7280"-CONFIG_FIRMWARE="device"-CONFIG_CPUS=8-CONFIG_BOOTCPU=7-CONFIG_CPUFREQ=y-CONFIG_UFS=2-CONFIG_TOUCHSCREEN=y-CONFIG_GPU=y-CONFIG_ADSP=y-CONFIG_SOUND=4-CONFIG_WIFI=y-CONFIG_HAPTIC=5-CONFIG_MODEM=y-CONFIG_MODEM_AGAIN=y-CONFIG_MODEM_BUFFER=0xa8000000+#include common_defconfig+#include sc7280.config+#include redwood.configdiff --git a/configs/sc7280.config b/configs/sc7280.confignew file mode 100644index 0000000..5b84b44--- /dev/null+++ b/configs/sc7280.config@@ -0,0 +1,10 @@+# HakiOS fragment: the Qualcomm SC7280 family (SM7325, QCM6490: "yupik", "kodiak") -- what is true of the SoC, whatever phone it is in.+# The processor has eight cores and the biggest is core 7; the temperature sensors, the chip-identity memory and the PMIC arbiter are+# at the addresses of this family (the kernel's defaults, which a port to another SoC overrides: soc_smem, thermal_tm0/1 ...).+# The sensors are read and the run is stopped at 105 degrees (CONFIG_THERMAL_STOP): this is the protection of a phone left alone.+CONFIG_SOC="sc7280"+CONFIG_CPUS=8+CONFIG_BOOTCPU=7+CONFIG_CPUFREQ=y+CONFIG_SOCINFO=y+CONFIG_THERMAL=ydiff --git a/configs/symbols.tsv b/configs/symbols.tsvnew file mode 100644index 0000000..bfbeb5d--- /dev/null+++ b/configs/symbols.tsv@@ -0,0 +1,282 @@+ADRENO arg adreno GPU and display k hakios.adreno.c+ADRENO_BLIND arg adreno_blind GPU and display k hakios.adreno.c+ADRENO_DIRTY arg adreno_dirty GPU and display k hakios.adreno.c+ADRENO_FINE arg adreno_fine GPU and display k hakios.adreno.c the newest step waits like that before every single access+ADRENO_KEEP arg adreno_keep GPU and display k hakios.adreno.c+ADRENO_ONLY arg adreno_only GPU and display k hakios.adreno.c step K alone (what steps 6 to 10 need, they check for themselves: within one session of the loader, power and clocks stay as an earlier run left them)+ADRENO_PAUSE arg adreno_pause GPU and display k hakios.adreno.c how long the newest step waits after announcing a group of accesses (default 2200)+ADRENO_RETURN arg adreno_return GPU and display k hakios.adreno.c when all is over, go back to the loader instead of starting the system+ADRENO_SKIP arg adreno_skip GPU and display k hakios.adreno.c leave out the steps whose bits are set (bit 2 = step 2)+ADRENO_SPEED arg adreno_speed GPU and display k hakios.adreno.c step 17 asks the GMU for the 3D core's Nth speed: 1 315 MHz, 2 450 MHz, 3 550 MHz (the default: the most this phone's GPU is rated for)+ADRENO_STREAM1 arg adreno_stream1 GPU and display k hakios.adreno.c step 18 leaves the core's second stream out (0) or gives it an empty context of its own (2): what the SMMU then records shows what the core+ADRENO_WATCH arg adreno_watch GPU and display k hakios.adreno.c after the last step, say once a second for S seconds (default 20) that the machine is still alive, and what was written last+ADSP_AGAIN arg adsp_again Audio and battery k hakios.adsp.c+ADSP_APR_WAIT arg adsp_apr_wait Audio and battery k hakios.adsp.c+ADSP_KEEP arg adsp_keep Audio and battery k hakios.adsp.c+ADSP_LISTEN arg adsp_listen Audio and battery k hakios.adsp.c+ADSP_NEW arg adsp_new Audio and battery k hakios.adsp.c+ADSP_PAUSE arg adsp_pause Audio and battery k hakios.adsp.c+ADSP_RETURN arg adsp_return Audio and battery k hakios.adsp.c+ADSP_STEP arg adsp_step Audio and battery k hakios.adsp.c+ADSP_WAIT arg adsp_wait Audio and battery k hakios.adsp.c+APFS_CHEAP arg apfs_cheap Storage and APFS k apfs_vfsops.c+APFS_CHECK arg apfs_check Storage and APFS k hakios.apfs_check.c walk the whole volume and print only the totals+APFS_CHUNK arg apfs_chunk Storage and APFS k hakios.apfs_check.c+APFS_CONTENTS arg apfs_contents Storage and APFS k hakios.apfs_check.c no file is read at all, only looked up and stat'ed -- how long the walk itself takes, the directories and the inodes+APFS_DEPTH arg apfs_depth Storage and APFS k hakios.apfs_check.c go no deeper than N levels below where the walk starts (1 = only the entries of that directory; 0 = no limit)+APFS_DEV arg apfs_dev Storage and APFS k hakios.apfs_check.c the device to mount for modes 1 to 3 and 6 (default rvblk0)+APFS_HASH arg apfs_hash Storage and APFS k hakios.apfs_check.c+APFS_MAX arg apfs_max Storage and APFS k hakios.apfs_check.c stop after N entries (and say how memory stood on the way): for finding out what a walk that never comes back runs into+APFS_META_CLUSTER arg apfs_meta_cluster Storage and APFS k apfs_vfsops.c+APFS_MNT arg apfs_mnt Storage and APFS k hakios.apfs_check.c where to mount it for mode 6 (default /private/var/apfs-check)+APFS_PAR arg apfs_par Storage and APFS k apfs_vfsops.c at most N threads on one request, the caller's included (default: four, or the processors if fewer -- see apfs_pool_start(); 1 turns the helpers off)+APFS_ROOT_C arg apfs_root_c Storage and APFS k apfs_vfsops.c+APFS_ROOT_V arg apfs_root_v Storage and APFS k apfs_vfsops.c+APFS_ROUND arg apfs_round Storage and APFS k apfs_vfsops.c+APFS_SKIP arg apfs_skip Storage and APFS k hakios.apfs_check.c directories not to go into, as paths inside the volume, comma separated+APFS_SPARSE arg apfs_sparse Storage and APFS k hakios.sparse.c+APFS_STORE_LEN arg apfs_store_len Storage and APFS k hakios.apfs_check.c how many bytes of payload (default 40000)+APFS_STORE_NOTE arg apfs_store_note Storage and APFS k hakios.apfs_check.c the writer's own number, kept in the header (default 0)+APFS_STORE_SEED arg apfs_store_seed Storage and APFS k hakios.apfs_check.c which pattern (default 1); a different seed is a different payload+APFS_SUBTREE arg apfs_subtree Storage and APFS k hakios.apfs_check.c walk only that part of the volume+APFS_THREADS arg apfs_threads Storage and APFS k hakios.apfs_check.c how many, for mode 5 (default 4)+APFS_UBC_READ arg apfs_ubc_read Storage and APFS k apfs_vfsops.c+APFS_VOLUME arg apfs_volume Storage and APFS k hakios.apfs_check.c a volume for user space in an ordinary boot+APFS_VOLUME_AT arg apfs_volume_at Storage and APFS k hakios.apfs_check.c+APFS_WALKERS arg apfs_walkers Storage and APFS k hakios.apfs_check.c one of N walkers; a subdirectory is left on the shared stack (par_push)+APFS_WRITE_AT arg apfs_write_at Storage and APFS k hakios.apfs_check.c where in the file (default 0)+APFS_WRITE_BYTE arg apfs_write_byte Storage and APFS k hakios.apfs_check.c what to fill them with (default 0xa5)+APFS_WRITE_LEN arg apfs_write_len Storage and APFS k hakios.apfs_check.c how many bytes (default 4096, at most APFS_WRITE_MAX)+APFS_WRITE_PATH arg apfs_write_path Storage and APFS k hakios.apfs_check.c the file in it, by path from the volume's root+APPLOG arg applog CPU, memory and boot k (patch)+APPLOG_NAME arg applog_name CPU, memory and boot k (patch)+AUTOUNLOCK arg autounlock User space u inject_sb.c+BATTERY arg battery Audio and battery kl hakios.adsp.c,hakios.battery.c,loader.c+BATTMGR arg battmgr Audio and battery k hakios.adsp.c every property once, for the log (which number is which on this phone's firmware)+BUTTONS arg buttons Touch and buttons k hakios.buttons.c+BUTTONS_STEPS arg buttons_steps Touch and buttons k hakios.buttons.c+CA_VBL arg ca_vbl User space u inject.c CoreAnimation's frame clock from the display driver's refresh notifications+CAENV arg caenv User space u inject.c+CAM_AFTER arg cam_after Cameras k hakios.camera.c+CAM_FAKE arg cam_fake Cameras k hakios.camera.c+CAM_FAKE_FPS arg cam_fake_fps Cameras k hakios.camera.c+CAM_FRAMES arg cam_frames Cameras k hakios.camera.c+CAM_GAIN arg cam_gain Cameras k hakios.camera.c+CAM_KEEP_MB arg cam_keep_mb Cameras k hakios.camera.c+CAM_MODE arg cam_mode Cameras k hakios.camera.c+CAM_PATTERN arg cam_pattern Cameras k hakios.camera.c+CAM_SENSOR arg cam_sensor Cameras k hakios.camera.c+CAM_SETTLE arg cam_settle Cameras k hakios.camera.c+CAM_SHUTTER arg cam_shutter Cameras k hakios.camera.c+CAM_VBLANK arg cam_vblank Cameras k hakios.camera.c+CC_FADE arg cc_fade User space u inject_sb.c+CPULOAD arg cpuload CPU, memory and boot k hakios.cpufreq.c every MS milliseconds, how busy each of our cores was meanwhile, in percent, to the loader's log (tools/frames.py shows it per gesture)+CPUMASK arg cpumask Loader l loader.c+DDR arg ddr CPU, memory and boot k hakios.cpufreq.c the memory's bus clock managers ("BCM") in the command database the boot loader left, with what is needed to vote for bandwidth on them -- only read+DDR_REST arg ddr_rest CPU, memory and boot k hakios.cpufreq.c+DDR_VOTE arg ddr_vote CPU, memory and boot k hakios.cpufreq.c+DISPLAY_PROBE arg display_probe GPU and display k hakios.adreno.c before any step: read what the firmware left the display controller doing (display_probe() below; two clocks are turned on, nothing else written)+FB_BEAT arg fb_beat GPU and display k MiniIOMobileFramebuffer.cpp+FB_DIFF arg fb_diff GPU and display k MiniIOMobileFramebuffer.cpp which pixels of the panel each frame changed (it costs: the panel's memory is slow to read)+FB_FILTER arg fb_filter GPU and display k MiniIOMobileFramebuffer.cpp the picture is scaled to the panel nearest neighbour, as it once was+FB_HZ arg fb_hz GPU and display k MiniIOMobileFramebuffer.cpp+FB_QUEUE arg fb_queue GPU and display k MiniIOMobileFramebuffer.cpp+FB_THREADS arg fb_threads GPU and display k MiniIOMobileFramebuffer.cpp+FBHEIGHT arg fbheight GPU and display k MiniIOMobileFramebuffer.cpp+FBSCALE arg fbscale GPU and display k MiniIOMobileFramebuffer.cpp the same 375 x 812 points drawn at two pixels a point instead of three+FBTRACE arg fbtrace GPU and display k MiniIOMobileFramebuffer.cpp log the first N calls of every selector (default 3)+FBWIDTH arg fbwidth GPU and display k MiniIOMobileFramebuffer.cpp+GAMUT arg gamut Loader l loader.c+GL arg gl User space u inject.c,inject_sb.c not even with a GPU; gl=1: also without one, by Mesa's software driver (slow; for working on eagl.c in QEMU)+GLBLIT arg glblit GPU and display u eagl.c the surface's memory, as before+GLCENSUS arg glcensus GPU and display u eagl.c+GLCOMPILE arg glcompile User space u inject.c+GLCOPY arg glcopy GPU and display u eagl.c+GLENV arg glenv GPU and display u eagl.c+GLFETCH arg glfetch GPU and display u eagl.c+GLFRAMES arg glframes GPU and display u eagl.c+GLGROUP arg glgroup GPU and display u eagl.c+GLNO arg glno User space u inject.c+GLNUMBERS arg glnumbers GPU and display u eagl.c+GLPLAIN arg glplain GPU and display u eagl.c leave such draws as they are; 2: also those without a texture; 3: the two with a colour matrix drawn plainly too+GLPRECISION arg glprecision GPU and display u eagl.c as the shaders say.+GLSB3 arg glsb3 User space u inject.c+GLSHADERS arg glshaders GPU and display u eagl.c+GLSHOW arg glshow GPU and display u eagl.c the first texture of that size there is (names are handed out afresh every run)+GLSHOW_PART arg glshow_part GPU and display u eagl.c+GLSHOW_ZOOM arg glshow_zoom GPU and display u eagl.c+GLSKIP arg glskip GPU and display u eagl.c the draws of those programs are left out of the picture, which says what in it is their work+GLSLOW arg glslow GPU and display u eagl.c+GLSYNC arg glsync GPU and display u eagl.c+GLTRACE arg gltrace GPU and display u eagl.c+GLTRACE_AT arg gltrace_at GPU and display u eagl.c+GLTRACE_CORNERS arg gltrace_corners GPU and display u eagl.c+GLTRACE_DRAWS arg gltrace_draws GPU and display u eagl.c+GLTRACE_FRAMES arg gltrace_frames GPU and display u eagl.c+GLTRACE_FUNCTION arg gltrace_function GPU and display u eagl.c+GLTRACE_LIT arg gltrace_lit GPU and display u eagl.c+GLTRACE_LOOK arg gltrace_look GPU and display u eagl.c the pixel a listed draw has left in the middle of itself (the matrix is CoreAnimation's, the last it gave)+GLTRACE_PLACE arg gltrace_place GPU and display u eagl.c a line about a draw, if any of its first corners is inside the rectangle (or the rectangle inside them)+GLTRACE_SHADERS arg gltrace_shaders GPU and display u eagl.c the text of the shaders the program of a traced draw is made of, the first time that program draws+GLTRACE_UNIFORMS arg gltrace_uniforms GPU and display u eagl.c what the program of a traced draw was given, by the names its shaders use (coord_arg, texmat0, ...)+GLWAIT arg glwait GPU and display u eagl.c+GLYES arg glyes User space u inject.c the renderer is made to answer that it has those functions after all+GPU_CACHED arg gpu_cached GPU and display k hakios.gpu.cpp+GPU_EXACT arg gpu_exact GPU and display k hakios.adreno.c+GPU_KEEP arg gpu_keep GPU and display k hakios.gpu.cpp+GPU_LOG arg gpu_log GPU and display k hakios.adreno.c+HAPTIC_EFFECT arg haptic_effect Haptics and torch k hakios.haptic.c+MACHINE_NAME arg machine_name CPU, memory and boot k GenericARMPE.cpp+MEMBENCH arg membench CPU, memory and boot k hakios.cpufreq.c+MIC_ADC arg mic_adc Audio and battery k hakios.mic.c+MIC_INPUT arg mic_input Audio and battery k hakios.mic.c+MIC_MAIN arg mic_main Audio and battery k hakios.mic.c+MIC_SECS arg mic_secs Audio and battery k hakios.mic.c+MIC_TAP arg mic_tap Audio and battery k hakios.mic.c+MIC_TEST arg mic_test Audio and battery k hakios.mic.c+MODEM_APN arg modem_apn Cellular k hakios.mpss.c a session to that APN instead of the default profile+MODEM_DATA_NOBIND arg modem_data_nobind Cellular k hakios.mpss.c+MODEM_DATA_OFF arg modem_data_off Cellular k hakios.mpss.c+MODEM_DATA_WAIT arg modem_data_wait Cellular k hakios.mpss.c+MODEM_DPM_OFF arg modem_dpm_off Cellular k hakios.mpss.c+MODEM_IPA arg modem_ipa Cellular k hakios.mpss.c+MODEM_IPA_BUS_OFF arg modem_ipa_bus_off Cellular k hakios.mpss.c+MODEM_IPA_DATA_OFF arg modem_ipa_data_off Cellular k hakios.ipa.c none of this. modem_ipa_data_trace=1: a line per packet.+MODEM_IPA_DATA_TRACE arg modem_ipa_data_trace Cellular k hakios.cell.c,hakios.ipa.c+MODEM_IPA_FW arg modem_ipa_fw Cellular k hakios.mpss.c+MODEM_IPA_FW_AT arg modem_ipa_fw_at Cellular k hakios.mpss.c+MODEM_IPA_GSI_ENABLE arg modem_ipa_gsi_enable Cellular k hakios.mpss.c+MODEM_IPA_ITEM arg modem_ipa_item Cellular k hakios.mpss.c+MODEM_IPA_NO_PROBE arg modem_ipa_no_probe Cellular k hakios.mpss.c+MODEM_IPA_QUIET arg modem_ipa_quiet Cellular k hakios.mpss.c+MODEM_IPA_RAW arg modem_ipa_raw Cellular k hakios.mpss.c+MODEM_IPA_ROUTES arg modem_ipa_routes Cellular k hakios.mpss.c+MODEM_IPA_SKIP_UC arg modem_ipa_skip_uc Cellular k hakios.mpss.c+MODEM_IPA_SMMU_OFF arg modem_ipa_smmu_off Cellular k hakios.mpss.c+MODEM_KEEP arg modem_keep Cellular k hakios.mpss.c+MODEM_LISTEN arg modem_listen Cellular k hakios.mpss.c+MODEM_NAS_WAIT arg modem_nas_wait Cellular k hakios.mpss.c+MODEM_NEW arg modem_new Cellular k hakios.mpss.c+MODEM_NO_IPA_QMI arg modem_no_ipa_qmi Cellular k hakios.mpss.c+MODEM_NO_NAV arg modem_no_nav Cellular k hakios.mpss.c+MODEM_NO_TFTP arg modem_no_tftp Cellular k hakios.mpss.c+MODEM_ONLINE arg modem_online Cellular k hakios.mpss.c+MODEM_PAUSE arg modem_pause Cellular k hakios.mpss.c+MODEM_RETURN arg modem_return Cellular k hakios.mpss.c+MODEM_RMTFS_DELAY arg modem_rmtfs_delay Cellular k hakios.mpss.c+MODEM_RMTFS_RW_FAKE arg modem_rmtfs_rw_fake Cellular k hakios.mpss.c+MODEM_RMTFS_RW_OFF arg modem_rmtfs_rw_off Cellular k hakios.mpss.c+MODEM_SHARE_OFF arg modem_share_off Cellular k hakios.mpss.c+MODEM_SHARE_TEST arg modem_share_test Cellular k hakios.mpss.c+MODEM_SIM_PROBE_OFF arg modem_sim_probe_off Cellular k hakios.mpss.c+MODEM_SIM_SWITCH_OFF arg modem_sim_switch_off Cellular k hakios.mpss.c+MODEM_STEP arg modem_step Cellular k hakios.mpss.c the steps once the root is there, then back to the loader if modem_return=1 says so+MODEM_WAIT arg modem_wait Cellular k hakios.mpss.c+MODEM_WDA_OFF arg modem_wda_off Cellular k hakios.mpss.c+PMIC_LIST arg pmic_list Chip, thermal and PMIC k hakios.pmic.c only the clock, not the inventory of every block+PRIVS arg privs Security stand-ins k kern_minimac.c+RD arg rd CPU, memory and boot kl (patch),loader.c+REC_MB arg rec_mb GPU and display k MiniIOMobileFramebuffer.cpp+REC_RING arg rec_ring GPU and display k MiniIOMobileFramebuffer.cpp+REC_SECS arg rec_secs GPU and display k MiniIOMobileFramebuffer.cpp+REC_SOUND arg rec_sound Audio and battery k hakios.audio.c+REC_SOUND_FED arg rec_sound_fed Audio and battery k hakios.audio.c+REC_SOUND_MIC arg rec_sound_mic Audio and battery k hakios.audio.c+REC_START arg rec_start GPU and display k MiniIOMobileFramebuffer.cpp+REC_STEP arg rec_step GPU and display k MiniIOMobileFramebuffer.cpp+REGTRACE arg regtrace CPU, memory and boot k (patch)+RETURN_CPU arg return_cpu CPU, memory and boot k loader_return.c+RETURN_PANIC arg return_panic CPU, memory and boot k loader_return.c+ROOT_APFS arg root_apfs User space u init.c the root is to be the iOS root volume on /dev/DEV -- the phone's flash, read only+SERIAL arg serial Loader l loader.c+SMALL_CORES arg small_cores CPU, memory and boot k (patch)+SMALL_CORES_AFTER arg small_cores_after CPU, memory and boot k GenericARMPE.cpp+SOC_CMD_DB hex soc_cmd_db Cellular k hakios.mpss.c+SOC_GSI_BASE hex soc_gsi_base Cellular k hakios.ipa.c+SOC_IMEM hex soc_imem Cellular k hakios.mpss.c+SOC_IPA_BASE hex soc_ipa_base Cellular k hakios.ipa.c+SOC_IPA_FW arg soc_ipa_fw Cellular k hakios.mpss.c+SOC_IPA_STREAM arg soc_ipa_stream Cellular k hakios.mpss.c+SOC_IPA_STREAM_UC arg soc_ipa_stream_uc Cellular k hakios.mpss.c+SOC_MPSS_MEM hex soc_mpss_mem Cellular k hakios.mpss.c+SOC_PAS_IPA arg soc_pas_ipa Cellular k hakios.mpss.c+SOC_PAS_MPSS arg soc_pas_mpss Cellular k hakios.mpss.c+SOC_SMEM hex soc_smem Cellular k hakios.mpss.c,hakios.socinfo.c where SMEM is (also the modem driver's argument; 0x80900000 on the reference phone)+SOC_SMEM_SIZE hex soc_smem_size Chip, thermal and PMIC k hakios.socinfo.c+SOUND_BELOW arg sound_below Audio and battery k hakios.sound.c+SOUND_GAIN arg sound_gain Audio and battery k hakios.sound.c+SOUND_GUARD_AS arg sound_guard_as Audio and battery k hakios.sound.c+SOUND_PAUSE arg sound_pause Audio and battery k hakios.sound.c+SOUND_SECS arg sound_secs Audio and battery k hakios.sound.c+SPEAKER_PROBE arg speaker_probe Audio and battery k hakios.speaker.c reads registers and nothing else: the pins, the power names (below)+SURF_CLEAR arg surf_clear GPU and display k MiniIOSurface.cpp kept memory is given out as it is (to see what the clearing costs; a surface is then not all zeroes)+SURFTRACE arg surftrace GPU and display k MiniIOSurface.cpp log the first N surfaces created (default 24)+SURFTRACE_OF arg surftrace_of GPU and display k MiniIOSurface.cpp+SWITCHER_WALLPAPER arg switcher_wallpaper User space u inject_sb.c+SYSSLEEP arg syssleep CPU, memory and boot k (patch)+SYSTRACE arg systrace CPU, memory and boot k (patch),user_exception_trace.c+SYSTRACE_NAME arg systrace_name CPU, memory and boot k (patch)+THERMAL_LOG arg thermal_log Chip, thermal and PMIC k hakios.thermal.c a summary line this often (0: only on a rise; 60)+THERMAL_TM0 arg thermal_tm0 Chip, thermal and PMIC k hakios.thermal.c+THERMAL_TM1 arg thermal_tm1 Chip, thermal and PMIC k hakios.thermal.c+TORCH arg torch Haptics and torch kl hakios.torch.c,loader.c a look, reading only: the arbiter's channel for the module and who may write through it, the module's type, its registers, the PMIC's temperature+TORCH_MAX_S arg torch_max_s Haptics and torch k hakios.torch.c+TORCH_SECS arg torch_secs Haptics and torch k hakios.torch.c+TOUCH_FLIP arg touch_flip Touch and buttons k hakios.goodix.c+TOUCH_LAT arg touch_lat GPU and display ku MiniIOMobileFramebuffer.cpp,eagl.c,hakios.goodix.c,hakios.gpu.cpp,hakios.input.c,inject.c,inject_sb.c a line for every wait of a program's for the GPU that took a millisecond or more ("tl: f KIND US at US"), for telling apart what holds a frame up+TOUCH_POLL_US arg touch_poll_us Touch and buttons k hakios.goodix.c+TOUCH_RATE arg touch_rate Touch and buttons k hakios.goodix.c the chip reports twice as often (Xiaomi's game mode; 240 otherwise)+TOUCH_SPI_HZ arg touch_spi_hz Touch and buttons k hakios.goodix.c the bus at N Hz (Android's device tree gives the chip 5 MHz)+UFS_BENCH arg ufs_bench Storage and APFS k hakios.ufs.c what one request through the loader costs, by size+UFS_CHECK arg ufs_check Storage and APFS k hakios.ufs.c+UFS_NATIVE arg ufs_native Storage and APFS kl hakios.ufs.c,loader.c through this kernel's own driver instead, its own transfer list in the controller for the run, if all is as expected; 2: only look; 3: a dry run --+UFS_NATIVE_BENCH arg ufs_native_bench Storage and APFS k hakios.ufs.c+UFS_NATIVE_BUFFER hex ufs_native_buffer Storage and APFS k hakios.ufshc.c+UFS_NATIVE_CHECK arg ufs_native_check Storage and APFS k hakios.ufs.c what this kernel's own driver reads is what the loader reads, byte for byte+UFS_NATIVE_HANG arg ufs_native_hang Storage and APFS k hakios.ufshc.c+UFS_NATIVE_LEAVE arg ufs_native_leave Storage and APFS k hakios.ufshc.c+UFS_NATIVE_SLOTS arg ufs_native_slots Storage and APFS k hakios.ufshc.c+UFS_NATIVE_SPIN arg ufs_native_spin Storage and APFS k hakios.ufshc.c+UFS_PROBE arg ufs_probe Loader l loader.c+USTACKS arg ustacks Debugging k user_exception_trace.c+USTACKS_AT arg ustacks_at Debugging k user_exception_trace.c+USTACKS_COUNT arg ustacks_count Debugging k user_exception_trace.c+USTACKS_MS arg ustacks_ms Debugging k user_exception_trace.c+USTACKS_THREADS arg ustacks_threads Debugging k user_exception_trace.c+USTACKS_TNAME arg ustacks_tname Debugging k user_exception_trace.c+VAR_SAVE_MS arg var_save_ms Storage and APFS k hakios.ufs.c+VBLUR arg vblur GPU and display u eagl.c+VIRTIO_BLK arg virtio_blk Storage and APFS k hakios.virtio_blk.c+VIRTIO_INPUT arg virtio_input Touch and buttons k hakios.virtio_input.c+VIRTIO_SOUND arg virtio_sound Audio and battery k hakios.virtio_sound.c+WIFI_AGAIN arg wifi_again Wi-Fi k hakios.wifi.c start the DSP although the one before it was shut down without having acknowledged a stop: THAT HAS RESET THE PHONE, twice of two+WIFI_ASK arg wifi_ask Wi-Fi k hakios.wifi.c step 14 also asks that service a question (its capabilities) and writes down the beginning of an answer+WIFI_BA arg wifi_ba Wi-Fi k lx_80211.c+WIFI_CAL arg wifi_cal Wi-Fi k hakios.wlfw.c+WIFI_DIRTY arg wifi_dirty Wi-Fi k hakios.wifi.c+WIFI_FILE arg wifi_file Wi-Fi k hakios.wifi.c with wifi=1: the network of fw/network is not joined at the start+WIFI_FINE arg wifi_fine Wi-Fi k hakios.wifi.c such a step waits like that before every single write and call+WIFI_HOLD arg wifi_hold Wi-Fi k lx_bus.c+WIFI_IRQ arg wifi_irq Wi-Fi k lx_bus.c+WIFI_JOIN arg wifi_join Wi-Fi k lx_bus.c+WIFI_KEEP arg wifi_keep Wi-Fi k hakios.wifi.c when the steps are over the DSP and the link stay up while the system runs, for whoever uses sys/hakios.qrtr.h; stopped when the run ends+WIFI_LISTEN arg wifi_listen Wi-Fi k hakios.wifi.c how long step 14 waits for the Wi-Fi firmware's service (default 3)+WIFI_LOUD arg wifi_loud Wi-Fi k hakios.wifi.c+WIFI_LX arg wifi_lx Wi-Fi k hakios.wifi.c,lx_bus.c+WIFI_LX_STEP arg wifi_lx_step Wi-Fi k lx_base.c+WIFI_MAC arg wifi_mac Wi-Fi k hakios.wifi.c the radio's own address for the driver (hakios_wifi_radio_address() below; xl takes it from a file that is not in the repository)+WIFI_MISSION arg wifi_mission Wi-Fi k hakios.wlfw.c+WIFI_NEW arg wifi_new Wi-Fi k hakios.wifi.c steps K and later have not been seen to work (default: the last one)+WIFI_PAUSE arg wifi_pause Wi-Fi k hakios.wifi.c+WIFI_QUIET arg wifi_quiet Wi-Fi k lx_bus.c+WIFI_RADIO_READ arg wifi_radio_read Wi-Fi k hakios.wifi.c step 16 does read (2: whatever mode the firmware is in)+WIFI_READY arg wifi_ready Wi-Fi k hakios.wlfw.c+WIFI_RETURN arg wifi_return Wi-Fi k hakios.wifi.c when all is over, go back to the loader instead of starting the system+WIFI_SCAN arg wifi_scan Wi-Fi k lx_bus.c+WIFI_SMMU arg wifi_smmu Wi-Fi k hakios.wifi.c before any step: read what the boot chain has set up in the SMMU for the radio's stream (smmu_look() below; nothing is written)+WIFI_STATION arg wifi_station Wi-Fi k lx_bus.c+WIFI_STEP arg wifi_step Wi-Fi k hakios.wifi.c+WIFI_WAIT arg wifi_wait Wi-Fi k hakios.wifi.c how long step 11 watches for the DSP to say that it is up (default 10)+WIFI_WATCH arg wifi_watch Wi-Fi k hakios.wifi.c+WIFI_WIDE arg wifi_wide Wi-Fi k lx_80211.c+XPCPROXY_IDVERSION arg xpcproxy_idversion CPU, memory and boot k (patch)diff --git a/docs/boot-args.md b/docs/boot-args.mdindex 5b02b97..0cb7d72 100644--- a/docs/boot-args.md+++ b/docs/boot-args.md@@ -12,115 +12,115 @@ Layers: **K** the kernel, **L** the loader, **U** user space (through `sysctl ke| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `adreno` | K | `hakios.adreno.c` | | |-| `adreno_blind` | K | `hakios.adreno.c` | | |-| `adreno_dirty` | K | `hakios.adreno.c` | | |-| `adreno_fine` | K | `hakios.adreno.c` | | |-| `adreno_keep` | K | `hakios.adreno.c` | | |-| `adreno_only` | K | `hakios.adreno.c` | | |-| `adreno_pause` | K | `hakios.adreno.c` | | |-| `adreno_return` | K | `hakios.adreno.c` | | |-| `adreno_skip` | K | `hakios.adreno.c` | | |-| `adreno_speed` | K | `hakios.adreno.c` | | |-| `adreno_stream1` | K | `hakios.adreno.c` | | |-| `adreno_watch` | K | `hakios.adreno.c` | | |-| `display_probe` | K | `hakios.adreno.c` | | |-| `fb_beat` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fb_diff` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fb_filter` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fb_hz` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fb_queue` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fb_threads` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fbheight` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fbscale` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fbtrace` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `fbwidth` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `glblit` | U | `eagl.c` | | |-| `glcensus` | U | `eagl.c` | | |-| `glcopy` | U | `eagl.c` | | |-| `glenv` | U | `eagl.c` | | |-| `glfetch` | U | `eagl.c` | | |-| `glframes` | U | `eagl.c` | | |-| `glgroup` | U | `eagl.c` | | |-| `glnumbers` | U | `eagl.c` | | |-| `glplain` | U | `eagl.c` | | |-| `glprecision` | U | `eagl.c` | | |-| `glshaders` | U | `eagl.c` | | |-| `glshow` | U | `eagl.c` | | |-| `glshow_part` | U | `eagl.c` | | |-| `glshow_zoom` | U | `eagl.c` | | |-| `glskip` | U | `eagl.c` | | |-| `glslow` | U | `eagl.c` | | |-| `glsync` | U | `eagl.c` | | |-| `gltrace` | U | `eagl.c` | | |-| `gltrace_at` | U | `eagl.c` | | |-| `gltrace_corners` | U | `eagl.c` | | |-| `gltrace_draws` | U | `eagl.c` | | |-| `gltrace_frames` | U | `eagl.c` | | |-| `gltrace_function` | U | `eagl.c` | | |-| `gltrace_lit` | U | `eagl.c` | | |-| `gltrace_look` | U | `eagl.c` | | |-| `gltrace_place` | U | `eagl.c` | | |-| `gltrace_shaders` | U | `eagl.c` | | |-| `gltrace_uniforms` | U | `eagl.c` | | |-| `glwait` | U | `eagl.c` | | |+| `adreno` | K | `hakios.adreno.c` | `CONFIG_ADRENO` | |+| `adreno_blind` | K | `hakios.adreno.c` | `CONFIG_ADRENO_BLIND` | |+| `adreno_dirty` | K | `hakios.adreno.c` | `CONFIG_ADRENO_DIRTY` | |+| `adreno_fine` | K | `hakios.adreno.c` | `CONFIG_ADRENO_FINE` | |+| `adreno_keep` | K | `hakios.adreno.c` | `CONFIG_ADRENO_KEEP` | |+| `adreno_only` | K | `hakios.adreno.c` | `CONFIG_ADRENO_ONLY` | |+| `adreno_pause` | K | `hakios.adreno.c` | `CONFIG_ADRENO_PAUSE` | |+| `adreno_return` | K | `hakios.adreno.c` | `CONFIG_ADRENO_RETURN` | |+| `adreno_skip` | K | `hakios.adreno.c` | `CONFIG_ADRENO_SKIP` | |+| `adreno_speed` | K | `hakios.adreno.c` | `CONFIG_ADRENO_SPEED` | |+| `adreno_stream1` | K | `hakios.adreno.c` | `CONFIG_ADRENO_STREAM1` | |+| `adreno_watch` | K | `hakios.adreno.c` | `CONFIG_ADRENO_WATCH` | |+| `display_probe` | K | `hakios.adreno.c` | `CONFIG_DISPLAY_PROBE` | |+| `fb_beat` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FB_BEAT` | |+| `fb_diff` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FB_DIFF` | |+| `fb_filter` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FB_FILTER` | |+| `fb_hz` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FB_HZ` | |+| `fb_queue` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FB_QUEUE` | |+| `fb_threads` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FB_THREADS` | |+| `fbheight` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FBHEIGHT` | |+| `fbscale` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FBSCALE` | |+| `fbtrace` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FBTRACE` | |+| `fbwidth` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_FBWIDTH` | |+| `glblit` | U | `eagl.c` | `CONFIG_GLBLIT` | |+| `glcensus` | U | `eagl.c` | `CONFIG_GLCENSUS` | |+| `glcopy` | U | `eagl.c` | `CONFIG_GLCOPY` | |+| `glenv` | U | `eagl.c` | `CONFIG_GLENV` | |+| `glfetch` | U | `eagl.c` | `CONFIG_GLFETCH` | |+| `glframes` | U | `eagl.c` | `CONFIG_GLFRAMES` | |+| `glgroup` | U | `eagl.c` | `CONFIG_GLGROUP` | |+| `glnumbers` | U | `eagl.c` | `CONFIG_GLNUMBERS` | |+| `glplain` | U | `eagl.c` | `CONFIG_GLPLAIN` | |+| `glprecision` | U | `eagl.c` | `CONFIG_GLPRECISION` | |+| `glshaders` | U | `eagl.c` | `CONFIG_GLSHADERS` | |+| `glshow` | U | `eagl.c` | `CONFIG_GLSHOW` | |+| `glshow_part` | U | `eagl.c` | `CONFIG_GLSHOW_PART` | |+| `glshow_zoom` | U | `eagl.c` | `CONFIG_GLSHOW_ZOOM` | |+| `glskip` | U | `eagl.c` | `CONFIG_GLSKIP` | |+| `glslow` | U | `eagl.c` | `CONFIG_GLSLOW` | |+| `glsync` | U | `eagl.c` | `CONFIG_GLSYNC` | |+| `gltrace` | U | `eagl.c` | `CONFIG_GLTRACE` | |+| `gltrace_at` | U | `eagl.c` | `CONFIG_GLTRACE_AT` | |+| `gltrace_corners` | U | `eagl.c` | `CONFIG_GLTRACE_CORNERS` | |+| `gltrace_draws` | U | `eagl.c` | `CONFIG_GLTRACE_DRAWS` | |+| `gltrace_frames` | U | `eagl.c` | `CONFIG_GLTRACE_FRAMES` | |+| `gltrace_function` | U | `eagl.c` | `CONFIG_GLTRACE_FUNCTION` | |+| `gltrace_lit` | U | `eagl.c` | `CONFIG_GLTRACE_LIT` | |+| `gltrace_look` | U | `eagl.c` | `CONFIG_GLTRACE_LOOK` | |+| `gltrace_place` | U | `eagl.c` | `CONFIG_GLTRACE_PLACE` | |+| `gltrace_shaders` | U | `eagl.c` | `CONFIG_GLTRACE_SHADERS` | |+| `gltrace_uniforms` | U | `eagl.c` | `CONFIG_GLTRACE_UNIFORMS` | |+| `glwait` | U | `eagl.c` | `CONFIG_GLWAIT` | || `gpu` | K | `hakios.adreno.c` | `CONFIG_GPU` | |-| `gpu_cached` | K | `hakios.gpu.cpp` | | |-| `gpu_exact` | K | `hakios.adreno.c` | | |-| `gpu_keep` | K | `hakios.gpu.cpp` | | |-| `gpu_log` | K | `hakios.adreno.c` | | |-| `rec_mb` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `rec_ring` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `rec_secs` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `rec_start` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `rec_step` | K | `MiniIOMobileFramebuffer.cpp` | | |-| `surf_clear` | K | `MiniIOSurface.cpp` | | |-| `surftrace` | K | `MiniIOSurface.cpp` | | |-| `surftrace_of` | K | `MiniIOSurface.cpp` | | |-| `touch_lat` | KU | `MiniIOMobileFramebuffer.cpp`, `eagl.c`, `hakios.goodix.c`, `hakios.gpu.cpp`, `hakios.input.c`, `inject.c`, `inject_sb.c` | | |-| `vblur` | U | `eagl.c` | | |+| `gpu_cached` | K | `hakios.gpu.cpp` | `CONFIG_GPU_CACHED` | |+| `gpu_exact` | K | `hakios.adreno.c` | `CONFIG_GPU_EXACT` | |+| `gpu_keep` | K | `hakios.gpu.cpp` | `CONFIG_GPU_KEEP` | |+| `gpu_log` | K | `hakios.adreno.c` | `CONFIG_GPU_LOG` | |+| `rec_mb` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_REC_MB` | |+| `rec_ring` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_REC_RING` | |+| `rec_secs` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_REC_SECS` | |+| `rec_start` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_REC_START` | |+| `rec_step` | K | `MiniIOMobileFramebuffer.cpp` | `CONFIG_REC_STEP` | |+| `surf_clear` | K | `MiniIOSurface.cpp` | `CONFIG_SURF_CLEAR` | |+| `surftrace` | K | `MiniIOSurface.cpp` | `CONFIG_SURFTRACE` | |+| `surftrace_of` | K | `MiniIOSurface.cpp` | `CONFIG_SURFTRACE_OF` | |+| `touch_lat` | KU | `MiniIOMobileFramebuffer.cpp`, `eagl.c`, `hakios.goodix.c`, `hakios.gpu.cpp`, `hakios.input.c`, `inject.c`, `inject_sb.c` | `CONFIG_TOUCH_LAT` | |+| `vblur` | U | `eagl.c` | `CONFIG_VBLUR` | |## Security stand-ins (1)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `privs` | K | `kern_minimac.c` | | |+| `privs` | K | `kern_minimac.c` | `CONFIG_PRIVS` | |## Wi-Fi (31)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|| `wifi` | K | `hakios.wifi.c` | `CONFIG_WIFI` | |-| `wifi_again` | K | `hakios.wifi.c` | | |-| `wifi_ask` | K | `hakios.wifi.c` | | |-| `wifi_ba` | K | `lx_80211.c` | | implied by wifi=1 |-| `wifi_cal` | K | `hakios.wlfw.c` | | |-| `wifi_dirty` | K | `hakios.wifi.c` | | |-| `wifi_file` | K | `hakios.wifi.c` | | |-| `wifi_fine` | K | `hakios.wifi.c` | | |-| `wifi_hold` | K | `lx_bus.c` | | |-| `wifi_irq` | K | `lx_bus.c` | | implied by wifi=1 |-| `wifi_join` | K | `lx_bus.c` | | |-| `wifi_keep` | K | `hakios.wifi.c` | | implied by wifi=1 |-| `wifi_listen` | K | `hakios.wifi.c` | | |-| `wifi_loud` | K | `hakios.wifi.c` | | |-| `wifi_lx` | K | `hakios.wifi.c`, `lx_bus.c` | | implied by wifi=1 (as 2) |-| `wifi_lx_step` | K | `lx_base.c` | | |-| `wifi_mac` | K | `hakios.wifi.c` | | |-| `wifi_mission` | K | `hakios.wlfw.c` | | |-| `wifi_new` | K | `hakios.wifi.c` | | |-| `wifi_pause` | K | `hakios.wifi.c` | | |-| `wifi_quiet` | K | `lx_bus.c` | | |-| `wifi_radio_read` | K | `hakios.wifi.c` | | |-| `wifi_ready` | K | `hakios.wlfw.c` | | |-| `wifi_return` | K | `hakios.wifi.c` | | |-| `wifi_scan` | K | `lx_bus.c` | | |-| `wifi_smmu` | K | `hakios.wifi.c` | | implied by wifi=1 (as 2) |-| `wifi_station` | K | `lx_bus.c` | | implied by wifi=1 |-| `wifi_step` | K | `hakios.wifi.c` | | |-| `wifi_wait` | K | `hakios.wifi.c` | | |-| `wifi_watch` | K | `hakios.wifi.c` | | |-| `wifi_wide` | K | `lx_80211.c` | | implied by wifi=1 |+| `wifi_again` | K | `hakios.wifi.c` | `CONFIG_WIFI_AGAIN` | |+| `wifi_ask` | K | `hakios.wifi.c` | `CONFIG_WIFI_ASK` | |+| `wifi_ba` | K | `lx_80211.c` | `CONFIG_WIFI_BA` | implied by wifi=1 |+| `wifi_cal` | K | `hakios.wlfw.c` | `CONFIG_WIFI_CAL` | |+| `wifi_dirty` | K | `hakios.wifi.c` | `CONFIG_WIFI_DIRTY` | |+| `wifi_file` | K | `hakios.wifi.c` | `CONFIG_WIFI_FILE` | |+| `wifi_fine` | K | `hakios.wifi.c` | `CONFIG_WIFI_FINE` | |+| `wifi_hold` | K | `lx_bus.c` | `CONFIG_WIFI_HOLD` | |+| `wifi_irq` | K | `lx_bus.c` | `CONFIG_WIFI_IRQ` | implied by wifi=1 |+| `wifi_join` | K | `lx_bus.c` | `CONFIG_WIFI_JOIN` | |+| `wifi_keep` | K | `hakios.wifi.c` | `CONFIG_WIFI_KEEP` | implied by wifi=1 |+| `wifi_listen` | K | `hakios.wifi.c` | `CONFIG_WIFI_LISTEN` | |+| `wifi_loud` | K | `hakios.wifi.c` | `CONFIG_WIFI_LOUD` | |+| `wifi_lx` | K | `hakios.wifi.c`, `lx_bus.c` | `CONFIG_WIFI_LX` | implied by wifi=1 (as 2) |+| `wifi_lx_step` | K | `lx_base.c` | `CONFIG_WIFI_LX_STEP` | |+| `wifi_mac` | K | `hakios.wifi.c` | `CONFIG_WIFI_MAC` | |+| `wifi_mission` | K | `hakios.wlfw.c` | `CONFIG_WIFI_MISSION` | |+| `wifi_new` | K | `hakios.wifi.c` | `CONFIG_WIFI_NEW` | |+| `wifi_pause` | K | `hakios.wifi.c` | `CONFIG_WIFI_PAUSE` | |+| `wifi_quiet` | K | `lx_bus.c` | `CONFIG_WIFI_QUIET` | |+| `wifi_radio_read` | K | `hakios.wifi.c` | `CONFIG_WIFI_RADIO_READ` | |+| `wifi_ready` | K | `hakios.wlfw.c` | `CONFIG_WIFI_READY` | |+| `wifi_return` | K | `hakios.wifi.c` | `CONFIG_WIFI_RETURN` | |+| `wifi_scan` | K | `lx_bus.c` | `CONFIG_WIFI_SCAN` | |+| `wifi_smmu` | K | `hakios.wifi.c` | `CONFIG_WIFI_SMMU` | implied by wifi=1 (as 2) |+| `wifi_station` | K | `lx_bus.c` | `CONFIG_WIFI_STATION` | implied by wifi=1 |+| `wifi_step` | K | `hakios.wifi.c` | `CONFIG_WIFI_STEP` | |+| `wifi_wait` | K | `hakios.wifi.c` | `CONFIG_WIFI_WAIT` | |+| `wifi_watch` | K | `hakios.wifi.c` | `CONFIG_WIFI_WATCH` | |+| `wifi_wide` | K | `lx_80211.c` | `CONFIG_WIFI_WIDE` | implied by wifi=1 |## Cellular (53)@@ -128,172 +128,172 @@ Layers: **K** the kernel, **L** the loader, **U** user space (through `sysctl ke|---|---|---|---|---|| `modem` | K | `hakios.mpss.c` | `CONFIG_MODEM` | || `modem_again` | K | `hakios.mpss.c` | `CONFIG_MODEM_AGAIN` | |-| `modem_apn` | K | `hakios.mpss.c` | | |+| `modem_apn` | K | `hakios.mpss.c` | `CONFIG_MODEM_APN` | || `modem_buffer` | K | `hakios.mpss.c` | `CONFIG_MODEM_BUFFER` | |-| `modem_data_nobind` | K | `hakios.mpss.c` | | |-| `modem_data_off` | K | `hakios.mpss.c` | | |-| `modem_data_wait` | K | `hakios.mpss.c` | | |-| `modem_dpm_off` | K | `hakios.mpss.c` | | |-| `modem_ipa` | K | `hakios.mpss.c` | | |-| `modem_ipa_bus_off` | K | `hakios.mpss.c` | | |-| `modem_ipa_data_off` | K | `hakios.ipa.c` | | |-| `modem_ipa_data_trace` | K | `hakios.cell.c`, `hakios.ipa.c` | | |-| `modem_ipa_fw` | K | `hakios.mpss.c` | | |-| `modem_ipa_fw_at` | K | `hakios.mpss.c` | | |-| `modem_ipa_gsi_enable` | K | `hakios.mpss.c` | | |-| `modem_ipa_item` | K | `hakios.mpss.c` | | |-| `modem_ipa_no_probe` | K | `hakios.mpss.c` | | |-| `modem_ipa_quiet` | K | `hakios.mpss.c` | | |-| `modem_ipa_raw` | K | `hakios.mpss.c` | | |-| `modem_ipa_routes` | K | `hakios.mpss.c` | | |-| `modem_ipa_skip_uc` | K | `hakios.mpss.c` | | |-| `modem_ipa_smmu_off` | K | `hakios.mpss.c` | | |-| `modem_keep` | K | `hakios.mpss.c` | | |-| `modem_listen` | K | `hakios.mpss.c` | | |-| `modem_nas_wait` | K | `hakios.mpss.c` | | |-| `modem_new` | K | `hakios.mpss.c` | | |-| `modem_no_ipa_qmi` | K | `hakios.mpss.c` | | |-| `modem_no_nav` | K | `hakios.mpss.c` | | |-| `modem_no_tftp` | K | `hakios.mpss.c` | | |-| `modem_online` | K | `hakios.mpss.c` | | |-| `modem_pause` | K | `hakios.mpss.c` | | |-| `modem_return` | K | `hakios.mpss.c` | | |-| `modem_rmtfs_delay` | K | `hakios.mpss.c` | | |-| `modem_rmtfs_rw_fake` | K | `hakios.mpss.c` | | |-| `modem_rmtfs_rw_off` | K | `hakios.mpss.c` | | |-| `modem_share_off` | K | `hakios.mpss.c` | | |-| `modem_share_test` | K | `hakios.mpss.c` | | |-| `modem_sim_probe_off` | K | `hakios.mpss.c` | | |-| `modem_sim_switch_off` | K | `hakios.mpss.c` | | |-| `modem_step` | K | `hakios.mpss.c` | | |-| `modem_wait` | K | `hakios.mpss.c` | | |-| `modem_wda_off` | K | `hakios.mpss.c` | | |-| `soc_cmd_db` | K | `hakios.mpss.c` | | |-| `soc_gsi_base` | K | `hakios.ipa.c` | | |-| `soc_imem` | K | `hakios.mpss.c` | | |-| `soc_ipa_base` | K | `hakios.ipa.c` | | |-| `soc_ipa_fw` | K | `hakios.mpss.c` | | |-| `soc_ipa_stream` | K | `hakios.mpss.c` | | |-| `soc_ipa_stream_uc` | K | `hakios.mpss.c` | | |-| `soc_mpss_mem` | K | `hakios.mpss.c` | | |-| `soc_pas_ipa` | K | `hakios.mpss.c` | | |-| `soc_pas_mpss` | K | `hakios.mpss.c` | | |-| `soc_smem` | K | `hakios.mpss.c`, `hakios.socinfo.c` | | |+| `modem_data_nobind` | K | `hakios.mpss.c` | `CONFIG_MODEM_DATA_NOBIND` | |+| `modem_data_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_DATA_OFF` | |+| `modem_data_wait` | K | `hakios.mpss.c` | `CONFIG_MODEM_DATA_WAIT` | |+| `modem_dpm_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_DPM_OFF` | |+| `modem_ipa` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA` | |+| `modem_ipa_bus_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_BUS_OFF` | |+| `modem_ipa_data_off` | K | `hakios.ipa.c` | `CONFIG_MODEM_IPA_DATA_OFF` | |+| `modem_ipa_data_trace` | K | `hakios.cell.c`, `hakios.ipa.c` | `CONFIG_MODEM_IPA_DATA_TRACE` | |+| `modem_ipa_fw` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_FW` | |+| `modem_ipa_fw_at` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_FW_AT` | |+| `modem_ipa_gsi_enable` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_GSI_ENABLE` | |+| `modem_ipa_item` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_ITEM` | |+| `modem_ipa_no_probe` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_NO_PROBE` | |+| `modem_ipa_quiet` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_QUIET` | |+| `modem_ipa_raw` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_RAW` | |+| `modem_ipa_routes` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_ROUTES` | |+| `modem_ipa_skip_uc` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_SKIP_UC` | |+| `modem_ipa_smmu_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_IPA_SMMU_OFF` | |+| `modem_keep` | K | `hakios.mpss.c` | `CONFIG_MODEM_KEEP` | |+| `modem_listen` | K | `hakios.mpss.c` | `CONFIG_MODEM_LISTEN` | |+| `modem_nas_wait` | K | `hakios.mpss.c` | `CONFIG_MODEM_NAS_WAIT` | |+| `modem_new` | K | `hakios.mpss.c` | `CONFIG_MODEM_NEW` | |+| `modem_no_ipa_qmi` | K | `hakios.mpss.c` | `CONFIG_MODEM_NO_IPA_QMI` | |+| `modem_no_nav` | K | `hakios.mpss.c` | `CONFIG_MODEM_NO_NAV` | |+| `modem_no_tftp` | K | `hakios.mpss.c` | `CONFIG_MODEM_NO_TFTP` | |+| `modem_online` | K | `hakios.mpss.c` | `CONFIG_MODEM_ONLINE` | |+| `modem_pause` | K | `hakios.mpss.c` | `CONFIG_MODEM_PAUSE` | |+| `modem_return` | K | `hakios.mpss.c` | `CONFIG_MODEM_RETURN` | |+| `modem_rmtfs_delay` | K | `hakios.mpss.c` | `CONFIG_MODEM_RMTFS_DELAY` | |+| `modem_rmtfs_rw_fake` | K | `hakios.mpss.c` | `CONFIG_MODEM_RMTFS_RW_FAKE` | |+| `modem_rmtfs_rw_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_RMTFS_RW_OFF` | |+| `modem_share_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_SHARE_OFF` | |+| `modem_share_test` | K | `hakios.mpss.c` | `CONFIG_MODEM_SHARE_TEST` | |+| `modem_sim_probe_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_SIM_PROBE_OFF` | |+| `modem_sim_switch_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_SIM_SWITCH_OFF` | |+| `modem_step` | K | `hakios.mpss.c` | `CONFIG_MODEM_STEP` | |+| `modem_wait` | K | `hakios.mpss.c` | `CONFIG_MODEM_WAIT` | |+| `modem_wda_off` | K | `hakios.mpss.c` | `CONFIG_MODEM_WDA_OFF` | |+| `soc_cmd_db` | K | `hakios.mpss.c` | `CONFIG_SOC_CMD_DB` | |+| `soc_gsi_base` | K | `hakios.ipa.c` | `CONFIG_SOC_GSI_BASE` | |+| `soc_imem` | K | `hakios.mpss.c` | `CONFIG_SOC_IMEM` | |+| `soc_ipa_base` | K | `hakios.ipa.c` | `CONFIG_SOC_IPA_BASE` | |+| `soc_ipa_fw` | K | `hakios.mpss.c` | `CONFIG_SOC_IPA_FW` | |+| `soc_ipa_stream` | K | `hakios.mpss.c` | `CONFIG_SOC_IPA_STREAM` | |+| `soc_ipa_stream_uc` | K | `hakios.mpss.c` | `CONFIG_SOC_IPA_STREAM_UC` | |+| `soc_mpss_mem` | K | `hakios.mpss.c` | `CONFIG_SOC_MPSS_MEM` | |+| `soc_pas_ipa` | K | `hakios.mpss.c` | `CONFIG_SOC_PAS_IPA` | |+| `soc_pas_mpss` | K | `hakios.mpss.c` | `CONFIG_SOC_PAS_MPSS` | |+| `soc_smem` | K | `hakios.mpss.c`, `hakios.socinfo.c` | `CONFIG_SOC_SMEM` | |## Audio and battery (31)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|| `adsp` | K | `hakios.adsp.c` | `CONFIG_ADSP` | |-| `adsp_again` | K | `hakios.adsp.c` | | |-| `adsp_apr_wait` | K | `hakios.adsp.c` | | |-| `adsp_keep` | K | `hakios.adsp.c` | | |-| `adsp_listen` | K | `hakios.adsp.c` | | |-| `adsp_new` | K | `hakios.adsp.c` | | |-| `adsp_pause` | K | `hakios.adsp.c` | | |-| `adsp_return` | K | `hakios.adsp.c` | | |-| `adsp_step` | K | `hakios.adsp.c` | | |-| `adsp_wait` | K | `hakios.adsp.c` | | |-| `battery` | KL | `hakios.adsp.c`, `hakios.battery.c`, `loader.c` | | |+| `adsp_again` | K | `hakios.adsp.c` | `CONFIG_ADSP_AGAIN` | |+| `adsp_apr_wait` | K | `hakios.adsp.c` | `CONFIG_ADSP_APR_WAIT` | |+| `adsp_keep` | K | `hakios.adsp.c` | `CONFIG_ADSP_KEEP` | |+| `adsp_listen` | K | `hakios.adsp.c` | `CONFIG_ADSP_LISTEN` | |+| `adsp_new` | K | `hakios.adsp.c` | `CONFIG_ADSP_NEW` | |+| `adsp_pause` | K | `hakios.adsp.c` | `CONFIG_ADSP_PAUSE` | |+| `adsp_return` | K | `hakios.adsp.c` | `CONFIG_ADSP_RETURN` | |+| `adsp_step` | K | `hakios.adsp.c` | `CONFIG_ADSP_STEP` | |+| `adsp_wait` | K | `hakios.adsp.c` | `CONFIG_ADSP_WAIT` | |+| `battery` | KL | `hakios.adsp.c`, `hakios.battery.c`, `loader.c` | `CONFIG_BATTERY` | || `battery_shared_pa` | K | `hakios.battery.c` | | the loader (the address of its charger page) |-| `battmgr` | K | `hakios.adsp.c` | | |+| `battmgr` | K | `hakios.adsp.c` | `CONFIG_BATTMGR` | || `mic` | K | `hakios.mic.c` | `CONFIG_MIC` | |-| `mic_adc` | K | `hakios.mic.c` | | |-| `mic_input` | K | `hakios.mic.c` | | |-| `mic_main` | K | `hakios.mic.c` | | |-| `mic_secs` | K | `hakios.mic.c` | | |-| `mic_tap` | K | `hakios.mic.c` | | |-| `mic_test` | K | `hakios.mic.c` | | |-| `rec_sound` | K | `hakios.audio.c` | | |-| `rec_sound_fed` | K | `hakios.audio.c` | | |-| `rec_sound_mic` | K | `hakios.audio.c` | | |+| `mic_adc` | K | `hakios.mic.c` | `CONFIG_MIC_ADC` | |+| `mic_input` | K | `hakios.mic.c` | `CONFIG_MIC_INPUT` | |+| `mic_main` | K | `hakios.mic.c` | `CONFIG_MIC_MAIN` | |+| `mic_secs` | K | `hakios.mic.c` | `CONFIG_MIC_SECS` | |+| `mic_tap` | K | `hakios.mic.c` | `CONFIG_MIC_TAP` | |+| `mic_test` | K | `hakios.mic.c` | `CONFIG_MIC_TEST` | |+| `rec_sound` | K | `hakios.audio.c` | `CONFIG_REC_SOUND` | |+| `rec_sound_fed` | K | `hakios.audio.c` | `CONFIG_REC_SOUND_FED` | |+| `rec_sound_mic` | K | `hakios.audio.c` | `CONFIG_REC_SOUND_MIC` | || `sound` | K | `hakios.sound.c` | `CONFIG_SOUND` | |-| `sound_below` | K | `hakios.sound.c` | | |-| `sound_gain` | K | `hakios.sound.c` | | |-| `sound_guard_as` | K | `hakios.sound.c` | | |-| `sound_pause` | K | `hakios.sound.c` | | |-| `sound_secs` | K | `hakios.sound.c` | | |-| `speaker_probe` | K | `hakios.speaker.c` | | |-| `virtio_sound` | K | `hakios.virtio_sound.c` | | |+| `sound_below` | K | `hakios.sound.c` | `CONFIG_SOUND_BELOW` | |+| `sound_gain` | K | `hakios.sound.c` | `CONFIG_SOUND_GAIN` | |+| `sound_guard_as` | K | `hakios.sound.c` | `CONFIG_SOUND_GUARD_AS` | |+| `sound_pause` | K | `hakios.sound.c` | `CONFIG_SOUND_PAUSE` | |+| `sound_secs` | K | `hakios.sound.c` | `CONFIG_SOUND_SECS` | |+| `speaker_probe` | K | `hakios.speaker.c` | `CONFIG_SPEAKER_PROBE` | |+| `virtio_sound` | K | `hakios.virtio_sound.c` | `CONFIG_VIRTIO_SOUND` | |## Cameras (13)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|| `cam` | KL | `hakios.camera.c`, `loader.c` | `CONFIG_CAM` | |-| `cam_after` | K | `hakios.camera.c` | | |-| `cam_fake` | K | `hakios.camera.c` | | |-| `cam_fake_fps` | K | `hakios.camera.c` | | |-| `cam_frames` | K | `hakios.camera.c` | | |-| `cam_gain` | K | `hakios.camera.c` | | |-| `cam_keep_mb` | K | `hakios.camera.c` | | |-| `cam_mode` | K | `hakios.camera.c` | | |-| `cam_pattern` | K | `hakios.camera.c` | | |-| `cam_sensor` | K | `hakios.camera.c` | | |-| `cam_settle` | K | `hakios.camera.c` | | |-| `cam_shutter` | K | `hakios.camera.c` | | |-| `cam_vblank` | K | `hakios.camera.c` | | |+| `cam_after` | K | `hakios.camera.c` | `CONFIG_CAM_AFTER` | |+| `cam_fake` | K | `hakios.camera.c` | `CONFIG_CAM_FAKE` | |+| `cam_fake_fps` | K | `hakios.camera.c` | `CONFIG_CAM_FAKE_FPS` | |+| `cam_frames` | K | `hakios.camera.c` | `CONFIG_CAM_FRAMES` | |+| `cam_gain` | K | `hakios.camera.c` | `CONFIG_CAM_GAIN` | |+| `cam_keep_mb` | K | `hakios.camera.c` | `CONFIG_CAM_KEEP_MB` | |+| `cam_mode` | K | `hakios.camera.c` | `CONFIG_CAM_MODE` | |+| `cam_pattern` | K | `hakios.camera.c` | `CONFIG_CAM_PATTERN` | |+| `cam_sensor` | K | `hakios.camera.c` | `CONFIG_CAM_SENSOR` | |+| `cam_settle` | K | `hakios.camera.c` | `CONFIG_CAM_SETTLE` | |+| `cam_shutter` | K | `hakios.camera.c` | `CONFIG_CAM_SHUTTER` | |+| `cam_vblank` | K | `hakios.camera.c` | `CONFIG_CAM_VBLANK` | |## Touch and buttons (8)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `buttons` | K | `hakios.buttons.c` | | |-| `buttons_steps` | K | `hakios.buttons.c` | | |-| `touch_flip` | K | `hakios.goodix.c` | | |-| `touch_poll_us` | K | `hakios.goodix.c` | | |-| `touch_rate` | K | `hakios.goodix.c` | | |-| `touch_spi_hz` | K | `hakios.goodix.c` | | |+| `buttons` | K | `hakios.buttons.c` | `CONFIG_BUTTONS` | |+| `buttons_steps` | K | `hakios.buttons.c` | `CONFIG_BUTTONS_STEPS` | |+| `touch_flip` | K | `hakios.goodix.c` | `CONFIG_TOUCH_FLIP` | |+| `touch_poll_us` | K | `hakios.goodix.c` | `CONFIG_TOUCH_POLL_US` | |+| `touch_rate` | K | `hakios.goodix.c` | `CONFIG_TOUCH_RATE` | |+| `touch_spi_hz` | K | `hakios.goodix.c` | `CONFIG_TOUCH_SPI_HZ` | || `touchscreen` | K | `hakios.buttons.c`, `hakios.goodix.c` | `CONFIG_TOUCHSCREEN` | |-| `virtio_input` | K | `hakios.virtio_input.c` | | |+| `virtio_input` | K | `hakios.virtio_input.c` | `CONFIG_VIRTIO_INPUT` | |## Storage and APFS (43)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `apfs_cheap` | K | `apfs_vfsops.c` | | |-| `apfs_check` | K | `hakios.apfs_check.c` | | |-| `apfs_chunk` | K | `hakios.apfs_check.c` | | |-| `apfs_contents` | K | `hakios.apfs_check.c` | | |-| `apfs_depth` | K | `hakios.apfs_check.c` | | |-| `apfs_dev` | K | `hakios.apfs_check.c` | | |-| `apfs_hash` | K | `hakios.apfs_check.c` | | |-| `apfs_max` | K | `hakios.apfs_check.c` | | |-| `apfs_meta_cluster` | K | `apfs_vfsops.c` | | |-| `apfs_mnt` | K | `hakios.apfs_check.c` | | |-| `apfs_par` | K | `apfs_vfsops.c` | | |-| `apfs_root_c` | K | `apfs_vfsops.c` | | |-| `apfs_root_v` | K | `apfs_vfsops.c` | | |-| `apfs_round` | K | `apfs_vfsops.c` | | |-| `apfs_skip` | K | `hakios.apfs_check.c` | | |-| `apfs_sparse` | K | `hakios.sparse.c` | | |-| `apfs_store_len` | K | `hakios.apfs_check.c` | | |-| `apfs_store_note` | K | `hakios.apfs_check.c` | | |-| `apfs_store_seed` | K | `hakios.apfs_check.c` | | |-| `apfs_subtree` | K | `hakios.apfs_check.c` | | |-| `apfs_threads` | K | `hakios.apfs_check.c` | | |-| `apfs_ubc_read` | K | `apfs_vfsops.c` | | |-| `apfs_volume` | K | `hakios.apfs_check.c` | | |-| `apfs_volume_at` | K | `hakios.apfs_check.c` | | |-| `apfs_walkers` | K | `hakios.apfs_check.c` | | |-| `apfs_write_at` | K | `hakios.apfs_check.c` | | |-| `apfs_write_byte` | K | `hakios.apfs_check.c` | | |-| `apfs_write_len` | K | `hakios.apfs_check.c` | | |-| `apfs_write_path` | K | `hakios.apfs_check.c` | | |-| `ufs_bench` | K | `hakios.ufs.c` | | |-| `ufs_check` | K | `hakios.ufs.c` | | |-| `ufs_native` | KL | `hakios.ufs.c`, `loader.c` | | |-| `ufs_native_bench` | K | `hakios.ufs.c` | | |-| `ufs_native_buffer` | K | `hakios.ufshc.c` | | |-| `ufs_native_check` | K | `hakios.ufs.c` | | |-| `ufs_native_hang` | K | `hakios.ufshc.c` | | |-| `ufs_native_leave` | K | `hakios.ufshc.c` | | |-| `ufs_native_slots` | K | `hakios.ufshc.c` | | |-| `ufs_native_spin` | K | `hakios.ufshc.c` | | |+| `apfs_cheap` | K | `apfs_vfsops.c` | `CONFIG_APFS_CHEAP` | |+| `apfs_check` | K | `hakios.apfs_check.c` | `CONFIG_APFS_CHECK` | |+| `apfs_chunk` | K | `hakios.apfs_check.c` | `CONFIG_APFS_CHUNK` | |+| `apfs_contents` | K | `hakios.apfs_check.c` | `CONFIG_APFS_CONTENTS` | |+| `apfs_depth` | K | `hakios.apfs_check.c` | `CONFIG_APFS_DEPTH` | |+| `apfs_dev` | K | `hakios.apfs_check.c` | `CONFIG_APFS_DEV` | |+| `apfs_hash` | K | `hakios.apfs_check.c` | `CONFIG_APFS_HASH` | |+| `apfs_max` | K | `hakios.apfs_check.c` | `CONFIG_APFS_MAX` | |+| `apfs_meta_cluster` | K | `apfs_vfsops.c` | `CONFIG_APFS_META_CLUSTER` | |+| `apfs_mnt` | K | `hakios.apfs_check.c` | `CONFIG_APFS_MNT` | |+| `apfs_par` | K | `apfs_vfsops.c` | `CONFIG_APFS_PAR` | |+| `apfs_root_c` | K | `apfs_vfsops.c` | `CONFIG_APFS_ROOT_C` | |+| `apfs_root_v` | K | `apfs_vfsops.c` | `CONFIG_APFS_ROOT_V` | |+| `apfs_round` | K | `apfs_vfsops.c` | `CONFIG_APFS_ROUND` | |+| `apfs_skip` | K | `hakios.apfs_check.c` | `CONFIG_APFS_SKIP` | |+| `apfs_sparse` | K | `hakios.sparse.c` | `CONFIG_APFS_SPARSE` | |+| `apfs_store_len` | K | `hakios.apfs_check.c` | `CONFIG_APFS_STORE_LEN` | |+| `apfs_store_note` | K | `hakios.apfs_check.c` | `CONFIG_APFS_STORE_NOTE` | |+| `apfs_store_seed` | K | `hakios.apfs_check.c` | `CONFIG_APFS_STORE_SEED` | |+| `apfs_subtree` | K | `hakios.apfs_check.c` | `CONFIG_APFS_SUBTREE` | |+| `apfs_threads` | K | `hakios.apfs_check.c` | `CONFIG_APFS_THREADS` | |+| `apfs_ubc_read` | K | `apfs_vfsops.c` | `CONFIG_APFS_UBC_READ` | |+| `apfs_volume` | K | `hakios.apfs_check.c` | `CONFIG_APFS_VOLUME` | |+| `apfs_volume_at` | K | `hakios.apfs_check.c` | `CONFIG_APFS_VOLUME_AT` | |+| `apfs_walkers` | K | `hakios.apfs_check.c` | `CONFIG_APFS_WALKERS` | |+| `apfs_write_at` | K | `hakios.apfs_check.c` | `CONFIG_APFS_WRITE_AT` | |+| `apfs_write_byte` | K | `hakios.apfs_check.c` | `CONFIG_APFS_WRITE_BYTE` | |+| `apfs_write_len` | K | `hakios.apfs_check.c` | `CONFIG_APFS_WRITE_LEN` | |+| `apfs_write_path` | K | `hakios.apfs_check.c` | `CONFIG_APFS_WRITE_PATH` | |+| `ufs_bench` | K | `hakios.ufs.c` | `CONFIG_UFS_BENCH` | |+| `ufs_check` | K | `hakios.ufs.c` | `CONFIG_UFS_CHECK` | |+| `ufs_native` | KL | `hakios.ufs.c`, `loader.c` | `CONFIG_UFS_NATIVE` | |+| `ufs_native_bench` | K | `hakios.ufs.c` | `CONFIG_UFS_NATIVE_BENCH` | |+| `ufs_native_buffer` | K | `hakios.ufshc.c` | `CONFIG_UFS_NATIVE_BUFFER` | |+| `ufs_native_check` | K | `hakios.ufs.c` | `CONFIG_UFS_NATIVE_CHECK` | |+| `ufs_native_hang` | K | `hakios.ufshc.c` | `CONFIG_UFS_NATIVE_HANG` | |+| `ufs_native_leave` | K | `hakios.ufshc.c` | `CONFIG_UFS_NATIVE_LEAVE` | |+| `ufs_native_slots` | K | `hakios.ufshc.c` | `CONFIG_UFS_NATIVE_SLOTS` | |+| `ufs_native_spin` | K | `hakios.ufshc.c` | `CONFIG_UFS_NATIVE_SPIN` | || `ufs_shared_pa` | K | `hakios.ufs.c` | | the loader (the address of its block-service page) || `ufs_write` | KL | `hakios.ufs.c`, `loader.c` | `CONFIG_UFS_WRITE` | |-| `var_save_ms` | K | `hakios.ufs.c` | | |-| `virtio_blk` | K | `hakios.virtio_blk.c` | | |+| `var_save_ms` | K | `hakios.ufs.c` | `CONFIG_VAR_SAVE_MS` | |+| `virtio_blk` | K | `hakios.virtio_blk.c` | `CONFIG_VIRTIO_BLK` | |## Network (3)@@ -308,25 +308,25 @@ Layers: **K** the kernel, **L** the loader, **U** user space (through `sysctl ke| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|| `haptic` | K | `hakios.haptic.c` | `CONFIG_HAPTIC` | |-| `haptic_effect` | K | `hakios.haptic.c` | | |-| `torch` | KL | `hakios.torch.c`, `loader.c` | | |-| `torch_max_s` | K | `hakios.torch.c` | | |-| `torch_secs` | K | `hakios.torch.c` | | |+| `haptic_effect` | K | `hakios.haptic.c` | `CONFIG_HAPTIC_EFFECT` | |+| `torch` | KL | `hakios.torch.c`, `loader.c` | `CONFIG_TORCH` | |+| `torch_max_s` | K | `hakios.torch.c` | `CONFIG_TORCH_MAX_S` | |+| `torch_secs` | K | `hakios.torch.c` | `CONFIG_TORCH_SECS` | |## Chip, thermal and PMIC (10)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `pmic` | K | `hakios.pmic.c` | | |-| `pmic_list` | K | `hakios.pmic.c` | | |-| `soc_smem_size` | K | `hakios.socinfo.c` | | |-| `socinfo` | K | `hakios.socinfo.c` | | |-| `thermal` | K | `hakios.thermal.c` | | |-| `thermal_log` | K | `hakios.thermal.c` | | |-| `thermal_poll` | K | `hakios.thermal.c` | | |-| `thermal_stop` | K | `hakios.thermal.c` | | |-| `thermal_tm0` | K | `hakios.thermal.c` | | |-| `thermal_tm1` | K | `hakios.thermal.c` | | |+| `pmic` | K | `hakios.pmic.c` | `CONFIG_PMIC` | |+| `pmic_list` | K | `hakios.pmic.c` | `CONFIG_PMIC_LIST` | |+| `soc_smem_size` | K | `hakios.socinfo.c` | `CONFIG_SOC_SMEM_SIZE` | |+| `socinfo` | K | `hakios.socinfo.c` | `CONFIG_SOCINFO` | |+| `thermal` | K | `hakios.thermal.c` | `CONFIG_THERMAL` | |+| `thermal_log` | K | `hakios.thermal.c` | `CONFIG_THERMAL_LOG` | |+| `thermal_poll` | K | `hakios.thermal.c` | `CONFIG_THERMAL_POLL` | |+| `thermal_stop` | K | `hakios.thermal.c` | `CONFIG_THERMAL_STOP` | |+| `thermal_tm0` | K | `hakios.thermal.c` | `CONFIG_THERMAL_TM0` | |+| `thermal_tm1` | K | `hakios.thermal.c` | `CONFIG_THERMAL_TM1` | |## Version (1)@@ -338,66 +338,66 @@ Layers: **K** the kernel, **L** the loader, **U** user space (through `sysctl ke| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `applog` | K | `(patch)` | | |-| `applog_name` | K | `(patch)` | | |+| `applog` | K | `(patch)` | `CONFIG_APPLOG` | |+| `applog_name` | K | `(patch)` | `CONFIG_APPLOG_NAME` | || `bootcpu` | KL | `loader.c`, `loader_return.c` | `CONFIG_BOOTCPU` | || `cpufreq` | K | `hakios.cpufreq.c` | `CONFIG_CPUFREQ` | |-| `cpuload` | K | `hakios.cpufreq.c` | | |-| `ddr` | K | `hakios.cpufreq.c` | | |-| `ddr_rest` | K | `hakios.cpufreq.c` | | |-| `ddr_vote` | K | `hakios.cpufreq.c` | | |+| `cpuload` | K | `hakios.cpufreq.c` | `CONFIG_CPULOAD` | |+| `ddr` | K | `hakios.cpufreq.c` | `CONFIG_DDR` | |+| `ddr_rest` | K | `hakios.cpufreq.c` | `CONFIG_DDR_REST` | |+| `ddr_vote` | K | `hakios.cpufreq.c` | `CONFIG_DDR_VOTE` | || `epoch` | K | `GenericARMPE.cpp` | | xl (the host's clock) || `hv_wdt_pet` | K | `loader_return.c` | | the loader, when it has armed the watchdog (the runner also passes it) || `loader_return_after` | KL | `loader.c`, `loader_return.c` | | xl (XL_SECS) |-| `machine_name` | K | `GenericARMPE.cpp` | | |-| `membench` | K | `hakios.cpufreq.c` | | |-| `rd` | KL | `(patch)`, `loader.c` | | |-| `regtrace` | K | `(patch)` | | |-| `return_cpu` | K | `loader_return.c` | | |-| `return_panic` | K | `loader_return.c` | | |-| `small_cores` | K | `(patch)` | | |-| `small_cores_after` | K | `GenericARMPE.cpp` | | |-| `syssleep` | K | `(patch)` | | |-| `systrace` | K | `(patch)`, `user_exception_trace.c` | | |-| `systrace_name` | K | `(patch)` | | |-| `xpcproxy_idversion` | K | `(patch)` | | |+| `machine_name` | K | `GenericARMPE.cpp` | `CONFIG_MACHINE_NAME` | |+| `membench` | K | `hakios.cpufreq.c` | `CONFIG_MEMBENCH` | |+| `rd` | KL | `(patch)`, `loader.c` | `CONFIG_RD` | |+| `regtrace` | K | `(patch)` | `CONFIG_REGTRACE` | |+| `return_cpu` | K | `loader_return.c` | `CONFIG_RETURN_CPU` | |+| `return_panic` | K | `loader_return.c` | `CONFIG_RETURN_PANIC` | |+| `small_cores` | K | `(patch)` | `CONFIG_SMALL_CORES` | |+| `small_cores_after` | K | `GenericARMPE.cpp` | `CONFIG_SMALL_CORES_AFTER` | |+| `syssleep` | K | `(patch)` | `CONFIG_SYSSLEEP` | |+| `systrace` | K | `(patch)`, `user_exception_trace.c` | `CONFIG_SYSTRACE` | |+| `systrace_name` | K | `(patch)` | `CONFIG_SYSTRACE_NAME` | |+| `xpcproxy_idversion` | K | `(patch)` | `CONFIG_XPCPROXY_IDVERSION` | |## Debugging (6)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `ustacks` | K | `user_exception_trace.c` | | |-| `ustacks_at` | K | `user_exception_trace.c` | | |-| `ustacks_count` | K | `user_exception_trace.c` | | |-| `ustacks_ms` | K | `user_exception_trace.c` | | |-| `ustacks_threads` | K | `user_exception_trace.c` | | |-| `ustacks_tname` | K | `user_exception_trace.c` | | |+| `ustacks` | K | `user_exception_trace.c` | `CONFIG_USTACKS` | |+| `ustacks_at` | K | `user_exception_trace.c` | `CONFIG_USTACKS_AT` | |+| `ustacks_count` | K | `user_exception_trace.c` | `CONFIG_USTACKS_COUNT` | |+| `ustacks_ms` | K | `user_exception_trace.c` | `CONFIG_USTACKS_MS` | |+| `ustacks_threads` | K | `user_exception_trace.c` | `CONFIG_USTACKS_THREADS` | |+| `ustacks_tname` | K | `user_exception_trace.c` | `CONFIG_USTACKS_TNAME` | |## Loader (6)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `cpumask` | L | `loader.c` | | |+| `cpumask` | L | `loader.c` | `CONFIG_CPUMASK` | || `cpus` | L | `loader.c` | `CONFIG_CPUS` | |-| `gamut` | L | `loader.c` | | |-| `serial` | L | `loader.c` | | |+| `gamut` | L | `loader.c` | `CONFIG_GAMUT` | |+| `serial` | L | `loader.c` | `CONFIG_SERIAL` | || `ufs` | L | `loader.c` | `CONFIG_UFS` | |-| `ufs_probe` | L | `loader.c` | | |+| `ufs_probe` | L | `loader.c` | `CONFIG_UFS_PROBE` | |## User space (13)| Argument | Layer | Read by | Configuration | Set by ||---|---|---|---|---|-| `autounlock` | U | `inject_sb.c` | | |-| `ca_vbl` | U | `inject.c` | | |-| `caenv` | U | `inject.c` | | |-| `cc_fade` | U | `inject_sb.c` | | |-| `gl` | U | `inject.c`, `inject_sb.c` | | |-| `glcompile` | U | `inject.c` | | |-| `glno` | U | `inject.c` | | |-| `glsb3` | U | `inject.c` | | |-| `glyes` | U | `inject.c` | | |-| `root_apfs` | U | `init.c` | | |+| `autounlock` | U | `inject_sb.c` | `CONFIG_AUTOUNLOCK` | |+| `ca_vbl` | U | `inject.c` | `CONFIG_CA_VBL` | |+| `caenv` | U | `inject.c` | `CONFIG_CAENV` | |+| `cc_fade` | U | `inject_sb.c` | `CONFIG_CC_FADE` | |+| `gl` | U | `inject.c`, `inject_sb.c` | `CONFIG_GL` | |+| `glcompile` | U | `inject.c` | `CONFIG_GLCOMPILE` | |+| `glno` | U | `inject.c` | `CONFIG_GLNO` | |+| `glsb3` | U | `inject.c` | `CONFIG_GLSB3` | |+| `glyes` | U | `inject.c` | `CONFIG_GLYES` | |+| `root_apfs` | U | `init.c` | `CONFIG_ROOT_APFS` | || `sb_delay` | U | `inject_sb.c` | | xl (XL_SB_DELAY) |-| `switcher_wallpaper` | U | `inject_sb.c` | | |+| `switcher_wallpaper` | U | `inject_sb.c` | `CONFIG_SWITCHER_WALLPAPER` | || `var_store` | U | `init.c` | `CONFIG_VAR_STORE` | |diff --git a/docs/configs.md b/docs/configs.mdindex af71cda..15dcb8c 100644--- a/docs/configs.md+++ b/docs/configs.md@@ -1,33 +1,40 @@-# Configurations: defconfigs, fragments and a `.config`+# Configurations: the common kernel, a SoC, a phone-A Linux kernel is configured with a `.config` made from a `<device>_defconfig` (`make redwood_defconfig`), and an-Android kernel adds fragments on top (`merge_config.sh`). This kernel does the same, with one difference that is the-whole design: **its options are not compiled in.** XNU takes them from the boot-arguments, so a configuration here is+A Linux kernel is configured with a `.config` made from a defconfig, and an Android kernel is put together from layers: the+common kernel's `gki_defconfig`, the SoC vendor's fragment, the device's. This kernel does the same, with one difference that+is the whole design: **its options are not compiled in.** XNU takes them from the boot-arguments, so a configuration here isa file of `CONFIG_*` symbols that `tools/hakios-config.py` turns into the kernel's command line.```configs/defconfig what every configuration starts from: the OPEN one (nothing of a phone's own, one core)-configs/redwood_defconfig the POCO X5 Pro 5G (redwood, SM7325): what the project's own phone line uses+configs/common_defconfig THE COMMON KERNEL: every setting there is, each with what it does (about 1000 lines)+configs/sc7280.config the Qualcomm SC7280 family (SM7325, QCM6490): eight cores, the sensors, the chip's identity+configs/redwood.config the POCO X5 Pro 5G: its vibration motor, where its modem's buffer is+configs/redwood_defconfig a phone: #include common_defconfig, sc7280.config, redwood.config (three lines)configs/open.config fragment: the open profile (CONFIG_FIRMWARE="none")configs/virt.config fragment: QEMU's virt machine (virtio network)configs/trace.config fragment: log a line for each of the first frames on the network interfacesconfigs/persist.config fragment: keep /private/var across reboots (THIS WRITES TO THE PHONE, partition `darwin`)+configs/symbols.tsv the symbols that are made from the source (see below); do not edit```+The common kernel does not say which phone it is for. A phone is the common kernel plus the facts of its SoC plus its own, which+is how Android builds a device's kernel; a new device adds a fragment and a three-line defconfig, not a new copy of everything.+## Use```bash-make redwood_defconfig # .config = configs/defconfig + configs/redwood_defconfig+make redwood_defconfig # .config = defconfig + common_defconfig + sc7280.config + redwood.configmake redwood_defconfig FRAGMENTS=trace # ... and a fragment on top+make common_defconfig # the common kernel alone, for a phone that has no fragments yetmake virt.config # lay a fragment over the .config there ismake config # show it: symbols, the kernel's arguments, the firmware it wantsmake savedefconfig # the .config as a minimal defconfig (what differs from configs/defconfig)make phone # with a .config, ITS arguments are the kernel's```-The same without make: `tools/hakios-config.py defconfig|merge|args|check|show|needs|savedefconfig|list|help`.-`tools/hakios-config.py help GPU` says what a symbol means, what it needs and what it requires. `make doctor`-checks the host.+The same without make: `tools/hakios-config.py defconfig|merge|args|check|show|needs|savedefconfig|list|listing|complete|help`.+`tools/hakios-config.py help GPU` says what a symbol means, what it needs and what it requires. `make doctor` checks the host.## What a symbol is@@ -36,15 +43,45 @@ checks the host.Three symbols are facts about the build, not arguments: `CONFIG_DEVICE`, `CONFIG_SOC` (it goes into the kernel's versionstring, see [versioning.md](versioning.md)) and `CONFIG_FIRMWARE`.-The table of symbols is the `SYMBOLS` list at the top of `tools/hakios-config.py`; it is the one place that says-which symbol is which argument.+There are two kinds of symbol, and the difference is honest:++- **The stable switches** are written by hand in the `SYMBOLS` table at the top of `tools/hakios-config.py`: they have a+ meaning, a type, a range, a firmware they need, a symbol they require (`CONFIG_SOUND` requires `CONFIG_ADSP`). About thirty.+- **The rest** are made from the source. Every argument that the kernel, the loader or user space reads+ ([boot-args.md](boot-args.md)) gets a symbol, except the few that the loader and the runner set themselves (`epoch`, the time+ of the run ...). They are typed as "a switch (`y` is 1), a number as written, or a quoted text", and the one-line meaning is+ taken from the source where the file that reads the argument has a documentation line for it; where it has none, the line+ says which file reads it and nothing more. They are `configs/symbols.tsv`, made by `tools/boot-args.py --symbols`, and CI fails+ when a driver adds an argument and the file is not made again. Most of these are the knobs of bring-up (a driver's steps and+ pauses, traces, test modes); they are here so that a run is written down in one file with typos refused, not because each one+ is a feature.++## `common_defconfig`: every setting, documented++Linux's defconfigs list only what differs from the defaults. This one lists **every** symbol, set or `# CONFIG_X is not set`,+each under a comment that says what it does, in groups (GPU and display, Wi-Fi, Cellular, Storage ...). That is why it is a+thousand lines long, and why a reader of one file can see every setting the kernel has. It is made, not written:++```bash+tools/hakios-config.py listing common > configs/common_defconfig # after changing a value or adding a driver+tools/hakios-config.py complete common # it must name every symbol (CI runs this, in the tests)+```++Change a value by editing the line and running `listing common` again: the file reads back the same.++## `#include`: putting a device together++A line `#include NAME` in a defconfig or fragment (a comment to any other reader) stands for `configs/NAME`, `NAME_defconfig` or+`NAME.config`, laid first; the including file wins over what it includes; a loop is an error. This is the whole of+`redwood_defconfig`. The order for `make redwood_defconfig` is `defconfig` (open, one core), then the common kernel, then the+SoC, then the phone, then the fragments you named.## What is checked, and why-- **Types and ranges.** A bool is `y` or not set, a hex number starts with `0x`, `CONFIG_CPUS` is 1 to 8. A typo in- a name gets a suggestion (`no symbol CONFIG_GPUU (did you mean CONFIG_GPU?)`).-- **Dependencies.** `CONFIG_VAR_STORE` requires `CONFIG_UFS_WRITE`, which requires `CONFIG_UFS=2`; `CONFIG_SOUND`- requires `CONFIG_ADSP`; the modem requires the storage service.+- **Types and ranges.** A bool is `y` or not set, a hex number starts with `0x`, `CONFIG_CPUS` is 1 to 8, `CONFIG_THERMAL_STOP`+ is 0 to 160. A typo in a name gets a suggestion (`no symbol CONFIG_GPUU (did you mean CONFIG_GPU?)`).+- **Dependencies.** `CONFIG_VAR_STORE` requires `CONFIG_UFS_WRITE`, which requires `CONFIG_UFS=2`; `CONFIG_SOUND` requires+ `CONFIG_ADSP`; `CONFIG_THERMAL_STOP` requires `CONFIG_THERMAL`; the modem requires the storage service.- **Firmware.** `CONFIG_FIRMWARE="none"` is the open profile: *nothing of the phone's own is loaded.* The check refusesa configuration that says `none` and still asks for the GPU, Wi-Fi, audio, haptics, cameras or the modem, because eachof those uses firmware pulled from the owner's own phone (`fw-*/`, never in this repository).@@ -53,29 +90,33 @@ which symbol is which argument.## `CONFIG_BOOTARGS`: Linux's `CONFIG_CMDLINE`-For an argument that has no symbol of its own: `CONFIG_BOOTARGS="fb_beat=2 loader_return_after=5"`. It is not an-escape from the checks. Every name must be one the source reads ([boot-args.md](boot-args.md), made by-`tools/boot-args.py` from the code, and checked in CI), so `fb_beet=2` is an error with a suggestion rather than a-silent no-op; an argument that a symbol already sets (`cpus=8`) is refused with the name of the symbol; a word is-`name=value` with no space, quote or backslash in it; and the words count towards the 607 characters.+For an argument that has no symbol of its own, or a value the symbols cannot say: `CONFIG_BOOTARGS="fb_beat=2 loader_return_after=5"`. It is not an+escape from the checks. Every name must be one the source reads ([boot-args.md](boot-args.md)), so `fb_beet=2` is an error with a+suggestion rather than a silent no-op; an argument that a symbol already sets (`cpus=8`) is refused with the name of the symbol; a+word is `name=value` with no space, quote or backslash in it; and the words count towards the 607 characters.## What is the same as Linux, and what is not| | Linux / Android | here ||---|---|---|-| a device | `arch/arm64/configs/<device>_defconfig` | `configs/<device>_defconfig` |+| the common kernel | `gki_defconfig` | `common_defconfig` |+| a SoC, a device | vendor and device fragments, `build.config` | `sc7280.config`, `redwood.config`, `#include` || a fragment | `kernel/configs/*.config`, `merge_config.sh` | `configs/*.config`, `make NAME.config` || the result | `.config`, compiled in | `.config`, becomes the boot-arguments || a minimal config | `make savedefconfig` | `make savedefconfig` || a command line baked in | `CONFIG_CMDLINE` | `CONFIG_BOOTARGS` (names checked) || an option that needs a blob | `CONFIG_EXTRA_FIRMWARE` | `CONFIG_FIRMWARE="device"` / `"none"`, and `needs` || the version | `uname -r` | `kern.hakios.version`, `kernel.ver=` |+| how many options | thousands, in Kconfig | about 310, one for each argument the source reads |++The last row is the honest one. This is not Kconfig and has no thousand options: the kernel is not built from its options. The number+of symbols is the number of arguments the code reads, and it grows when a driver adds one.## A new device-`tools/new-device.py` makes `devices/<name>/` from a phone's own device tree; its defconfig is a file of a few-lines, `configs/<name>_defconfig`, that starts from the open one and turns on only what that phone has been shown-to do.+`tools/new-device.py` makes `devices/<name>/` from a phone's own device tree. Its configuration is a fragment and a defconfig of a few+lines: `configs/<name>.config` with what is true of that phone only, and `configs/<name>_defconfig` that includes the common kernel, the+SoC's fragment and that one, and nothing more until the phone has been shown to do it.## What a configuration does not dodiff --git a/tools/boot-args-test.py b/tools/boot-args-test.pyindex b1d16c2..d4cd463 100755--- a/tools/boot-args-test.py+++ b/tools/boot-args-test.py@@ -86,6 +86,12 @@ try:check("the groups: the GPU file's argument is under GPU and display", "## GPU and display" in run(d, "--markdown").stdout)check("the page says which layers read ku_both", "| `ku_both` | KLU |" in run(d, "--markdown").stdout, run(d, "--markdown").stdout[-400:])+ # the symbols: one for each argument, its meaning where the source documents it, none for what the tools set+ symbols = {l.split("\t")[2]: l.split("\t") for l in run(d, "--symbols").stdout.splitlines()}+ check("a symbol for each argument (and none for loader_return_after-style ones set by the tools)", "k_direct" in symbols and "u_helper" in symbols, sorted(symbols))+ check("the symbol's name is the argument's, upper case", symbols["k_tunable"][0] == "K_TUNABLE", symbols.get("k_tunable"))+ check("an argument read as text still gets a symbol", "k_string" in symbols, sorted(symbols))+ check("without a documentation line the meaning is who reads it", "read by hakios.adreno.c" in symbols["k_direct"][6] or symbols["k_direct"][6] == "", symbols["k_direct"])# the check: missing files; current files; a driver that adds an argument; a table symbol nobody readsr = run(d, "--check")check("--check: files missing -> fails and says what to run", r.returncode != 0 and "boot-args.py --markdown" in r.stdout, r.stdout)@@ -93,6 +99,7 @@ try:os.makedirs(os.path.join(d, "configs"), exist_ok=True)open(os.path.join(d, "docs", "boot-args.md"), "w", newline="\n").write(run(d, "--markdown").stdout)open(os.path.join(d, "configs", "boot-args.lst"), "w", newline="\n").write(run(d, "--lst").stdout)+ open(os.path.join(d, "configs", "symbols.tsv"), "w", newline="\n").write(run(d, "--symbols").stdout)check("--check: current files -> passes", run(d, "--check").returncode == 0, run(d, "--check").stdout)open(os.path.join(d, "xnu", "files", "bsd", "dev", "hakios.adreno.c"), "a").write('void more(void) { PE_parse_boot_argn("a_new_one", &v, 4); }\n')subprocess.run(["git", "-C", d, "add", "-A"], check=True, capture_output=True)@@ -103,6 +110,7 @@ try:subprocess.run(["git", "-C", d, "add", "-A"], check=True, capture_output=True)open(os.path.join(d, "docs", "boot-args.md"), "w", newline="\n").write(run(d, "--markdown").stdout)open(os.path.join(d, "configs", "boot-args.lst"), "w", newline="\n").write(run(d, "--lst").stdout)+ open(os.path.join(d, "configs", "symbols.tsv"), "w", newline="\n").write(run(d, "--symbols").stdout)r = run(d, "--check")check("--check: a configuration symbol whose argument nobody reads -> fails", r.returncode != 0 and "nobody_reads_this" in r.stdout, r.stdout)finally:diff --git a/tools/boot-args.py b/tools/boot-args.pyindex 5a6afba..69ca561 100755--- a/tools/boot-args.py+++ b/tools/boot-args.py@@ -1,12 +1,14 @@#!/usr/bin/env python3"""The catalogue of every boot-argument that the kernel, the loader and user space read.-usage: tools/boot-args.py [--markdown | --lst | --check] [--root DIR]+usage: tools/boot-args.py [--markdown | --lst | --symbols | --check] [--root DIR](none) the catalogue, as text, grouped by driver--markdown the catalogue as docs/boot-args.md has it--lst the names, as configs/boot-args.lst has them (what tools/hakios-config.py checks CONFIG_BOOTARGS against)- --check exit 1 if docs/boot-args.md or configs/boot-args.lst is out of date with the source (CI runs this)+ --symbols a CONFIG_ symbol for each argument that has none in the table of tools/hakios-config.py, as configs/symbols.tsv has them+ (name, kind, argument, group, layers, files, one-line meaning where the source has a documentation line for it)+ --check exit 1 if docs/boot-args.md, configs/boot-args.lst or configs/symbols.tsv is out of date with the source (CI runs this)Why it exists. The kernel of this port is configured on its command line, and every driver reads its ownarguments: 194 in the kernel's files, 14 in the loader, 26 in user space. A handful of them are stable switches@@ -37,6 +39,7 @@ KERNEL = re.compile(r'PE_parse_boot_arg(?:n|_str)?\(\s*"([A-Za-z0-9_.\-]+)"')# XNU's TUNABLE(type, variable, "boot-arg name", default) reads the argument at start-up, in the files of the display and GPU# drivers (C++) and in the sandbox stand-in: static TUNABLE(uint32_t, gOnTheBeat, "fb_beat", 1). Also TUNABLE_WRITEABLE and# TUNABLE_STR. (TUNABLE_DT, whose third argument is a device-tree path with slashes, does not match.)+STRING = re.compile(r'PE_parse_boot_arg_str\(\s*"([A-Za-z0-9_.\-]+)"') # an argument read as textTUNABLE = re.compile(r'\bTUNABLE\w*\(\s*[^,()]+,\s*[^,()]+,\s*"([A-Za-z0-9_.\-]+)"')# Three drivers read their options through a small function that is given the name as a string, and the name is the# literal at the call: option("modem_again") in hakios.mpss.c and hakios.adsp.c (a static function in each), and for@@ -99,9 +102,10 @@ def tracked(root):return [p.decode() for p in out.split(b"\0") if p]-def scan(root):- """{name: {"kernel": {files}, "loader": {files}, "user": {files}}} found in the tracked source."""- found = collections.defaultdict(lambda: {"kernel": set(), "loader": set(), "user": set()})+def scan(root, keep=None):+ """{name: {"kernel": {files}, "loader": {files}, "user": {files}, "str": {files}}} found in the tracked source.+ `keep`, if given, is filled with {file name: text} of every source file read (the descriptions are taken from it)."""+ found = collections.defaultdict(lambda: {"kernel": set(), "loader": set(), "user": set(), "str": set()})for f in tracked(root):if not f.endswith((".c", ".cpp", ".m", ".h", ".patch")):continue@@ -110,6 +114,8 @@ def scan(root):except OSError:continuebase = os.path.basename(f)+ if keep is not None and f != "xnu/hakios.patch":+ keep[base] = textif f == "xnu/hakios.patch":text = "\n".join(l[1:] for l in text.splitlines() if l.startswith("+") and not l.startswith("+++"))base = "(patch)"@@ -117,6 +123,8 @@ def scan(root):if f.startswith(("xnu/", "drivers/", "wifi/lx/src/")):for m in KERNEL.finditer(text):found[m.group(1)]["kernel"].add(base)+ for m in STRING.finditer(text):+ found[m.group(1)]["str"].add(base)for m in WRAPPED.finditer(text):found[m.group(1)]["kernel"].add(base)for m in TUNABLE.finditer(text):@@ -155,6 +163,83 @@ def symbols(root):return out+# ---- symbols: one CONFIG_ symbol for each argument the table of tools/hakios-config.py does not already have -----------------++# arguments that the loader or the runner sets, not the person (SET_BY, except the ones wifi=1 implies): no symbol+def given_by_tools(name):+ why = SET_BY.get(name, "")+ return bool(why) and not why.startswith("implied")+++# arguments whose value is an address or a window: 0x... (a decimal one would be a mistake)+HEX_NAME = re.compile(r"(_pa|_base|_buffer|_addr|_mem)$|^soc_(?!ipa_fw|pas_|ipa_stream)")++COMMENT_LINE = re.compile(r"^\s*(?:/\*+|\*+/?|//+)\s?(.*)$")+++def _clean(text):+ return re.sub(r"\s+", " ", text).strip(" */-:;,")+++def _sentence(text, limit=150):+ text = _clean(text)+ m = re.search(r"(?<=[a-z0-9\)])\.(?:\s|$)", text)+ if m and m.start() > 30:+ text = text[:m.start()]+ if len(text) > limit:+ text = text[:limit].rsplit(" ", 1)[0]+ return text+++# a description that ends like this was cut in the middle of a sentence: it is not used+UNFINISHED = re.compile(r"(,|\band|\bor|\bwhich is what|\bthe|\bof|\bto|\bwith|\bin|\bfor|\bis|\bas|\ba|\bby|\bwhere|\bthat|\bnot|\bit|\(\w*)$")+++def describe(name, files, texts):+ """The one-line meaning of an argument, when a file that reads it has a documentation line for it: a comment that starts+ with `name=value` (or just the name) and then, after two spaces or a colon or a dash, says what it does. "" if not."""+ pattern = re.compile(r"^(?:boot-?args?[:\s]+)?(?:the )?" + re.escape(name) + r"(?:=[^\s:]*)?(?:\s{2,}|\s*:\s+|\s+--?\s+)(?:[-:]\s*)?"+ r"([A-Za-z(].{9,})$", re.I)+ for f in sorted(files):+ lines = texts.get(f, "").splitlines()+ for i, line in enumerate(lines):+ m = COMMENT_LINE.match(line)+ hit = pattern.match(m.group(1).strip()) if m else None+ if not hit:+ continue+ text = hit.group(1)+ if i + 1 < len(lines) and len(_clean(text)) < 90 and not _clean(text).endswith("."):+ nxt = COMMENT_LINE.match(lines[i + 1])+ if nxt and nxt.group(1).strip() and not re.match(r"^[a-z0-9_]+(=|\s{2,})", nxt.group(1).strip()):+ text += " " + nxt.group(1)+ text = _sentence(text)+ if len(text) >= 15 and not UNFINISHED.search(text) and text.count("(") == text.count(")") and not re.match(r"(and|or|then|but)", text):+ return text+ return ""+++def sym_name(arg):+ return re.sub(r"[^A-Z0-9]", "_", arg.upper())+++def symbol_rows(found, texts, curated):+ """[(NAME, kind, arg, group, layers, files, description)] for every argument without a symbol of its own in the table of+ tools/hakios-config.py. kind is "arg": y (= 1), a number, or a quoted string; "hex" for an address."""+ rows = []+ for arg, d in sorted(found.items()):+ if arg in curated or given_by_tools(arg):+ continue+ files = sorted(d["kernel"] | d["loader"] | d["user"])+ kind = "hex" if HEX_NAME.search(arg) else "arg"+ rows.append((sym_name(arg), kind, arg, group_of(d["kernel"] | d["loader"] | d["user"]), layers(d), ",".join(files),+ describe(arg, d["kernel"] | d["loader"] | d["user"], texts)))+ return rows+++def tsv(rows):+ return "".join("\t".join(r) + "\n" for r in rows)++def layers(d):return "".join(letter for key, letter in (("kernel", "k"), ("loader", "l"), ("user", "u")) if d[key])@@ -203,26 +288,34 @@ def main():what = ap.add_mutually_exclusive_group()what.add_argument("--markdown", action="store_true")what.add_argument("--lst", action="store_true")+ what.add_argument("--symbols", action="store_true")what.add_argument("--check", action="store_true")ap.add_argument("--root", default=ROOT)args = ap.parse_args()root = os.path.abspath(args.root)- found = scan(root)+ texts = {}+ found = scan(root, keep=texts)config = symbols(root)+ rows = symbol_rows(found, texts, set(config))+ for row in rows:+ config[row[2]] = "CONFIG_" + row[0]if args.markdown:sys.stdout.write(markdown(found, config))+ elif args.symbols:+ sys.stdout.write(tsv(rows))elif args.lst:sys.stdout.write(lst(found))elif args.check:bad = 0- for rel, want in (("docs/boot-args.md", markdown(found, config)), ("configs/boot-args.lst", lst(found))):+ for rel, want in (("docs/boot-args.md", markdown(found, config)), ("configs/boot-args.lst", lst(found)),+ ("configs/symbols.tsv", tsv(rows))):path = os.path.join(root, rel)have = open(path, encoding="utf-8", newline="").read().replace("\r\n", "\n") if os.path.isfile(path) else Noneif have != want:bad += 1print("boot-args: %s is %s: run tools/boot-args.py --%s > %s" % (- rel, "missing" if have is None else "out of date with the source", "markdown" if rel.endswith(".md") else "lst", rel))+ rel, "missing" if have is None else "out of date with the source", "markdown" if rel.endswith(".md") else "symbols" if rel.endswith(".tsv") else "lst", rel))unknown = sorted(a for a in config if a not in found)for a in unknown:bad += 1diff --git a/tools/hakios-config-test.py b/tools/hakios-config-test.pyindex 015653c..1625ff4 100755--- a/tools/hakios-config-test.py+++ b/tools/hakios-config-test.py@@ -49,8 +49,9 @@ try:r = run("defconfig", "redwood", "-o", cfg)check("defconfig redwood: makes the .config", r.returncode == 0 and os.path.isfile(cfg), r.stdout + r.stderr)a = args_of(run("args", "--config", cfg))- check("redwood: the same arguments as the project's phone line before configurations", sorted(a) == sorted(OLD_PHONE_LINE),- "got %s\nwant %s" % (sorted(a), sorted(OLD_PHONE_LINE)))+ # the phone line from before there were configurations, plus the two things the SC7280 fragment turns on: the chip's identity and the sensors+ check("redwood: the project's phone line before configurations, plus socinfo and thermal", sorted(a) == sorted(OLD_PHONE_LINE + ["socinfo=1", "thermal=1"]),+ "got %s\nwant %s" % (sorted(a), sorted(OLD_PHONE_LINE + ["socinfo=1", "thermal=1"])))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())@@ -65,7 +66,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".split()),+ sorted(args_of(run("args", "--config", o))) == sorted("cpus=8 bootcpu=7 cpufreq=1 ufs=2 touchscreen=1 socinfo=1 thermal=1".split()),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)@@ -90,7 +91,7 @@ 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".split()))+ 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()))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@@ -175,6 +176,49 @@ try:problems, _ = hc.check(dict(base, BOOTARGS='"%s"' % long))check("BOOTARGS counts toward the length limit", any("the end of it would be lost" in p for p in problems), problems)+ # the common kernel's configuration: not named after a phone, and a phone's defconfig is only what it includes+ r = run("defconfig", "common", "-o", os.path.join(work, "common"))+ check("common_defconfig passes its own checks", r.returncode == 0, r.stdout + r.stderr)+ check("common names every symbol there is", run("complete", "common").returncode == 0, run("complete", "common").stdout)+ listed = run("listing", "common").stdout+ with open(os.path.join(ROOT, "configs", "common_defconfig"), encoding="utf-8", newline="") as f:+ check("common_defconfig is what `listing common` makes of it (nothing edited by hand drifted)",+ f.read().replace("\r\n", "\n") == listed, "run: tools/hakios-config.py listing common > configs/common_defconfig")+ check("the listing has hundreds of symbols, each with a comment above it",+ listed.count("\nCONFIG_") + listed.count("\n# CONFIG_") >= 300 and listed.count("\n# ") > 600, listed.count("\n"))+ with open(os.path.join(ROOT, "configs", "redwood_defconfig"), encoding="utf-8") as f:+ includes = [l.split()[1] for l in f if l.startswith("#include ")]+ check("redwood_defconfig is the common one, the SoC's and the phone's, put together", includes == ["common_defconfig", "sc7280.config", "redwood.config"], includes)+ check("the common configuration does not say which phone: no device, no SoC",+ not any(l.startswith(("CONFIG_DEVICE=", "CONFIG_SOC=")) for l in listed.splitlines()))+ # #include: a fragment can put others first; a loop is an error, not a hang+ fake3 = os.path.join(work, "fake3")+ os.makedirs(os.path.join(fake3, "configs"))+ for name, text in (("defconfig", 'CONFIG_FIRMWARE="none"\n'), ("a.config", "#include b.config\nCONFIG_CPUS=2\n"), ("b.config", "CONFIG_CPUS=4\nCONFIG_BOOTCPU=1\n"),+ ("x.config", "#include y.config\n"), ("y.config", "#include x.config\n")):+ with open(os.path.join(fake3, "configs", name), "w", encoding="utf-8", newline="\n") as f:+ f.write(text)+ out3 = os.path.join(work, "out3")+ r = run("defconfig", "defconfig", "a", "-o", out3, root=fake3)+ check("#include: the included file is laid first, the including one wins", args_of(run("args", "--config", out3, root=fake3)) == ["cpus=2", "bootcpu=1"],+ run("args", "--config", out3, root=fake3).stdout + r.stderr)+ r = run("defconfig", "defconfig", "x", "-o", out3, root=fake3)+ check("#include: a loop is refused", r.returncode != 0 and "includes itself" in (r.stdout + r.stderr), r.stdout + r.stderr)+ # the generated symbols: any argument the source reads, typed and checked+ hc.SYMBOLS # (loaded above)+ problems, a = hc.check({"ADRENO_KEEP": "y", "FB_BEAT": "2", "APFS_SKIP": '"/a,/b"', "FIRMWARE": '"device"'})+ check("a generated symbol: y is =1, a number is as it is, a quoted text is the text", not problems and a == ["adreno_keep=1", "apfs_skip=/a,/b", "fb_beat=2"], (problems, a)) # (the generated ones, by name)+ problems, _ = hc.check({"FB_BEAT": "fast"})+ check("a generated symbol: a word that is none of those is an error", any("CONFIG_FB_BEAT is y, a number" in p for p in problems), problems)+ problems, _ = hc.check({"FB_BEAT": '"a b"'})+ check("a generated symbol: a text with a space in it is an error", any("CONFIG_FB_BEAT" in p for p in problems), problems)+ problems, _ = hc.check({"THERMAL_STOP": "105"})+ check("THERMAL_STOP requires THERMAL", any("requires CONFIG_THERMAL" in p for p in problems), problems)+ problems, _ = hc.check({"THERMAL": "y", "THERMAL_STOP": "500"})+ check("THERMAL_STOP is at most 160 degrees", any("THERMAL_STOP" in p for p in problems), problems)+ check("there are as many symbols as arguments the source reads, less the ones the tools set",+ len(hc.SYMBOLS) >= 300 and len({s[0] for s in hc.SYMBOLS}) == len(hc.SYMBOLS), len(hc.SYMBOLS))+# help, show, listr = run("help", "gpu")check("help GPU: the argument, the firmware", "gpu=1" in r.stdout and "fw-gpu/" in r.stdout, r.stdout)diff --git a/tools/hakios-config.py b/tools/hakios-config.pyindex 24d922d..5f6d867 100755--- a/tools/hakios-config.py+++ b/tools/hakios-config.py@@ -25,6 +25,7 @@ Where this differs from Linux's, on purpose:refuses what cannot fit, because a command line that is too long loses its tail without an error."""import argparse+import collectionsimport difflibimport osimport re@@ -66,13 +67,60 @@ SYMBOLS = [("NET_NAMES", "bool", "net_names", "a log line for every name asked of a DNS server and every TCP connection begun ""(the names go to the log: for debugging only)", None, None),("VIRTIO_NET", "bool", "virtio_net", "QEMU's virtio network device as en0 (QEMU only; its bus address means nothing on a phone)", None, None),+ ("SOCINFO", "bool", "socinfo", "read the chip's identity from the firmware's shared memory: kern.hakios.soc_* (SoC number, revision, board)", None, None),+ ("THERMAL", "bool", "thermal", "read the SoC's 27 temperature sensors: kern.hakios.thermal_* and a line in the log; read only", None, None),+ ("THERMAL_POLL", "int", "thermal_poll", "how often the sensors are read, in milliseconds (200 to 60000; 2000)", None, "THERMAL"),+ ("THERMAL_STOP", "int", "thermal_stop", "hand control back to the loader when the hottest sensor reads this many degrees three times in a row "+ "(0: never; 105): the protection of a phone left running unattended", None, "THERMAL"),+ ("PMIC", "bool", "pmic", "list every block of the power-management chips the SPMI arbiter shows, and read the PMIC's clock; read only", None, None),# Linux's CONFIG_CMDLINE: whatever the symbols above do not cover, as name=value words in quotes. It is not an escape# from the checks: every name must be one the source reads (configs/boot-args.lst), so a typo is an error, not a no-op.("BOOTARGS", "args", None, "more kernel arguments, as `name=value` words in quotes; each name must be one docs/boot-args.md lists", None, None),]++# The group a symbol is listed under in the documented defconfig (the generated ones carry theirs in configs/symbols.tsv)+GROUP_OF = {+ "DEVICE": "Build facts", "SOC": "Build facts", "FIRMWARE": "Build facts",+ "CPUS": "CPU, memory and boot", "BOOTCPU": "CPU, memory and boot", "CPUFREQ": "CPU, memory and boot",+ "UFS": "Storage and APFS", "UFS_WRITE": "Storage and APFS", "VAR_STORE": "Storage and APFS",+ "TOUCHSCREEN": "Touch and buttons", "GPU": "GPU and display",+ "ADSP": "Audio and battery", "SOUND": "Audio and battery", "MIC": "Audio and battery",+ "WIFI": "Wi-Fi", "HAPTIC": "Haptics and torch", "CAM": "Cameras",+ "MODEM": "Cellular", "MODEM_AGAIN": "Cellular", "MODEM_BUFFER": "Cellular",+ "NET_TRACE": "Network", "NET_NAMES": "Network", "VIRTIO_NET": "Network",+ "SOCINFO": "Chip, thermal and PMIC", "THERMAL": "Chip, thermal and PMIC", "THERMAL_POLL": "Chip, thermal and PMIC",+ "THERMAL_STOP": "Chip, thermal and PMIC", "PMIC": "Chip, thermal and PMIC", "BOOTARGS": "Extra arguments",+}+LAYER_OF = {}+RELAXED = re.compile(r"[A-Za-z0-9_.,:/+@=\-]+") # what a text value may hold: no space, no quote, no backslash+++def load_generated():+ """The symbols tools/boot-args.py made for the arguments the table above does not name (configs/symbols.tsv): one+ CONFIG_ symbol for each argument that is read anywhere in the source. Nothing if the file is not there."""+ path = os.path.join(ROOT, "configs", "symbols.tsv")+ rows = []+ if os.path.isfile(path):+ for line in open(path, encoding="utf-8"):+ f = line.rstrip("\n").split("\t")+ if len(f) < 7:+ continue+ name, kind, arg, group, layers, files, text = f[:7]+ if name in {s[0] for s in SYMBOLS}:+ continue+ GROUP_OF[name] = group+ LAYER_OF[name] = (layers, files)+ rows.append((name, kind, arg, text or "read by %s (%s)" % (files.replace("(patch)", "the patch to Apple's files").replace(",", ", "),+ "".join({"k": "kernel", "l": "loader", "u": "user space"}[c] + "/" for c in layers).rstrip("/").replace("/", " and ")),+ None, None))+ return rows+++GENERATED = load_generated()+SYMBOLS += GENERATEDBY_NAME = {s[0]: s for s in SYMBOLS}FIRMWARE_VALUES = ("device", "none")-RANGES = {"CPUS": (1, 8), "BOOTCPU": (0, 7), "UFS": (1, 2)}+RANGES = {"CPUS": (1, 8), "BOOTCPU": (0, 7), "UFS": (1, 2), "THERMAL_POLL": (200, 60000), "THERMAL_STOP": (0, 160)}class ConfigError(Exception):@@ -103,7 +151,7 @@ def parse(path):if name not in BY_NAME:close = difflib.get_close_matches(name, BY_NAME, n=1)raise ConfigError("%s:%d: no symbol CONFIG_%s%s" % (path, n, name, " (did you mean CONFIG_%s?)" % close[0] if close else ""))- if value == "n" and BY_NAME[name][1] == "bool":+ if value == "n" and BY_NAME[name][1] in ("bool", "arg"):unset.add(name)values.pop(name, None)continue@@ -119,6 +167,15 @@ def typed(name, value):if value != "y":raise ConfigError("CONFIG_%s is a bool: y, or not set (got %s)" % (name, value))return True+ if kind == "arg":+ # a switch (y: the argument is 1), a number as it is written, or a quoted text (a list, a name, a path)+ if value == "y":+ return "1"+ if re.fullmatch(r"-?(0[xX][0-9a-fA-F]+|[0-9]+)", value):+ return value+ if len(value) >= 2 and value[0] == '"' and value[-1] == '"' and RELAXED.fullmatch(value[1:-1]):+ return value[1:-1]+ raise ConfigError('CONFIG_%s is y, a number, or a text in quotes of letters, digits and . , : / + @ = - (got %s)' % (name, value))if kind in ("int", "hex"):if kind == "hex" and not value.lower().startswith("0x"):raise ConfigError("CONFIG_%s is a hex number and starts with 0x (got %s)" % (name, value))@@ -188,13 +245,29 @@ def overlay(config, files):return result+def expand(root, path, seen=()):+ """`path` preceded by the files it includes: a line `#include NAME` in a defconfig or fragment (a comment to every other+ reader) stands for configs/NAME, NAME_defconfig or NAME.config, laid first. This is how a device's defconfig is the common one+ plus its SoC's and its own (the way Android's build.config puts a kernel's configuration together), and it is why redwood_defconfig+ is three lines."""+ if path in seen:+ raise ConfigError("%s includes itself (%s)" % (rel(root, path), " -> ".join(os.path.basename(p) for p in seen + (path,))))+ files = []+ for line in open(path, encoding="utf-8"):+ m = re.match(r"#include\s+(\S+)\s*$", line)+ if m:+ files += expand(root, find_config(root, m.group(1)), seen + (path,))+ return files + [path]++def resolve(root, names):- """The files for `defconfig NAME FRAGMENT...`: the base, the device's defconfig, then the fragments."""+ """The files for `defconfig NAME FRAGMENT...`: the base, the device's defconfig, then the fragments (each with what it includes)."""files = [find_config(root, "defconfig")]device = names[0] if names else "defconfig"if device not in ("defconfig", ""):- files.append(find_config(root, device if device.endswith("_defconfig") else device + "_defconfig"))- files += [find_config(root, f) for f in names[1:]]+ files += expand(root, find_config(root, device if device.endswith("_defconfig") else device + "_defconfig"))+ for f in names[1:]:+ files += expand(root, find_config(root, f))return files@@ -315,7 +388,9 @@ def cmd_defconfig(a):def cmd_merge(a):- files = [find_config(a.root, f) for f in a.fragments]+ files = []+ for f in a.fragments:+ files += expand(a.root, find_config(a.root, f))config = overlay(load(a.config), files)problems, args = check(config)write_config(config, a.config, [".config"] + [rel(a.root, f) for f in files])@@ -419,6 +494,67 @@ def cmd_list(a):return 0+GROUP_ORDER = ["Build facts", "CPU, memory and boot", "Storage and APFS", "Touch and buttons", "GPU and display", "Audio and battery",+ "Wi-Fi", "Cellular", "Cameras", "Haptics and torch", "Chip, thermal and PMIC", "Network", "Security stand-ins",+ "Debugging", "Loader", "User space", "Version", "Extra arguments"]+++def listing(config, title_lines):+ """The documented defconfig of `config`: every symbol there is, by group, each with its meaning in a comment above it and its value+ (or `# CONFIG_X is not set`) under it. Linux's defconfigs list only what differs from the defaults; this one lists everything,+ because here a symbol's default is "the kernel decides" and a reader should see every setting there is."""+ by_group = collections.defaultdict(list)+ for sym in SYMBOLS:+ by_group[GROUP_OF.get(sym[0], "User space")].append(sym)+ out = list(title_lines)+ out += ["# %d symbols in %d groups; %d are set." % (len(SYMBOLS), len([g for g in by_group if by_group[g]]), len(config)), "#", ""]+ for group in GROUP_ORDER + sorted(g for g in by_group if g not in GROUP_ORDER):+ syms = by_group.get(group)+ if not syms:+ continue+ out += ["#", "# %s (%d)" % (group, len(syms)), "#", ""]+ for name, kind, arg, help_, needs, requires in syms:+ text = help_ if len(help_) <= 118 else help_[:117].rsplit(" ", 1)[0] + " ..."+ note = ""+ if needs:+ note += " [needs %s/ from the phone]" % needs+ if requires:+ note += " [requires CONFIG_%s]" % requires+ out.append("# %s%s" % (text, note))+ out.append("CONFIG_%s=%s" % (name, config[name]) if name in config else "# CONFIG_%s is not set" % name)+ out.append("")+ return "\n".join(out) + "\n"+++def cmd_listing(a):+ """listing NAME: the documented defconfig of NAME (a defconfig or fragment, with what it includes) on stdout."""+ files = resolve(a.root, [a.name] + a.fragments)+ config = overlay({}, files)+ title = ["#", "# HakiOS %s defconfig: every setting there is, with what it does." % a.name,+ "# Made by tools/hakios-config.py listing %s; the values are the ones that file sets, and tests/CI check that it names every symbol." % a.name,+ "#"]+ sys.stdout.write(listing(config, title))+ return 0+++def cmd_complete(a):+ """complete NAME: a defconfig (NAME) must name every symbol, set or `is not set`; the ones it leaves out are said."""+ path = find_config(a.root, a.name if a.name.endswith("_defconfig") else a.name + "_defconfig")+ named = set()+ for line in open(path, encoding="utf-8"):+ m = re.match(r"(?:# )?CONFIG_([A-Z0-9_]+)(?:=| is not set)", line.strip())+ if m:+ named.add(m.group(1))+ missing = [s[0] for s in SYMBOLS if s[0] not in named]+ for name in missing[:30]:+ print("hakios-config: %s does not name CONFIG_%s" % (rel(a.root, path), name))+ if len(missing) > 30:+ print("hakios-config: ... and %d more" % (len(missing) - 30))+ if not missing:+ print("hakios-config: %s names all %d symbols" % (rel(a.root, path), len(SYMBOLS)))+ return 1 if missing else 0++def cmd_help(a):name = a.symbol.upper()name = name[len("CONFIG_"):] if name.startswith("CONFIG_") else name@@ -430,7 +566,7 @@ def cmd_help(a):print("CONFIG_%s (%s)" % (name, kind))print(" " + help_)if arg:- print(" boot-argument: %s=%s" % (arg, {"bool": "1", "hex": "0x...", "int": "N", "str": "..."}[kind]))+ print(" boot-argument: %s=%s" % (arg, {"bool": "1", "hex": "0x...", "int": "N", "str": "...", "arg": "1, N or text", "args": "..."}[kind]))if needs:print(" needs firmware pulled from your phone: %s/" % needs)if requires:@@ -463,6 +599,13 @@ def main():("savedefconfig", cmd_savedefconfig, "the .config as a minimal defconfig"),("list", cmd_list, "the defconfigs and fragments in configs/")):sub.add_parser(name, parents=[common], help=text).set_defaults(fn=fn)+ p = sub.add_parser("listing", parents=[common], help="the documented defconfig of NAME, every symbol, on stdout")+ p.add_argument("name")+ p.add_argument("fragments", nargs="*")+ p.set_defaults(fn=cmd_listing)+ p = sub.add_parser("complete", parents=[common], help="a defconfig must name every symbol")+ p.add_argument("name")+ p.set_defaults(fn=cmd_complete)p = sub.add_parser("help", parents=[common], help="what a symbol means")p.add_argument("symbol")p.set_defaults(fn=cmd_help)diff --git a/tools/new-device.py b/tools/new-device.pyindex 81ae975..7e742d7 100755--- a/tools/new-device.py+++ b/tools/new-device.py@@ -193,6 +193,19 @@ says where its numbers came from; that is the map of what to rewrite.{checklist}+## Configuration++The kernel's settings are layered the way an Android kernel's are: the common kernel, the SoC's, this phone's+(`docs/configs.md`). Two short files make this phone a configuration:++ configs/{name}.config CONFIG_DEVICE="{name}" and whatever is true of this phone only+ configs/{name}_defconfig #include common_defconfig+ #include <the SoC's fragment: sc7280.config for the SC7280 family>+ #include {name}.config++Then `make {name}_defconfig`. Turn on only what this phone has been shown to do; `tools/hakios-config.py check` says what the+choice needs.+## FirmwarePulled from your own phone, never committed: `devices/{reference}/pull-firmware.sh`, or