Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

efex

efex.ko is a small, one-shot ARM Linux kernel module for the Allwinner R528-based Elegoo Centauri Carbon. When loaded, it writes 0x5AA5A55A to physical address 0x07090108. The next reset is then expected to enter the Allwinner eFEX/FEL USB flashing mode.

Loading this module changes boot behavior. Use it only when you intend to recover or flash the target over USB, and only on hardware whose boot ROM uses this eFEX register. Unloading the module does not undo the write.

Prebuilt module

The repository intentionally includes efex.ko, so it can be copied directly to a compatible target. It is an ARMv7 EABI5 module with this embedded vermagic:

5.4.61 SMP preempt mod_unload ARMv7 p2v8

That string is only a first compatibility check: the running kernel's ABI and configuration must also match. On the printer, inspect it with uname -r and, before loading, use modinfo efex.ko if modinfo is present. Load and reboot only after confirming the target and recovery procedure:

insmod efex.ko
dmesg | tail -n 20
reboot

Successful load logs that FEL mode has been armed. A reboot is required for the boot ROM to observe the value.

Build prerequisites

Use these OpenCentauri repositories, both on their opencentauri branches:

Purpose Repository Required path
Kernel sources https://github.com/OpenCentauri/oc-linux configured, prepared ARM kernel tree
Kernel toolchain https://github.com/OpenCentauri/toolchain-kernel gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi

The compiler prefix is:

.../gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-

Clone the three repositories side by side (the default layout used by env.sh and the Makefile):

git clone --branch opencentauri https://github.com/OpenCentauri/oc-linux.git
git clone --branch opencentauri https://github.com/OpenCentauri/toolchain-kernel.git
git clone https://github.com/OpenCentauri/efex.git

Before building an external module, configure oc-linux with the exact target kernel configuration and prepare it. A full kernel build is the safest route, because it also creates the symbol-version data needed by configurations that enable it:

cd oc-linux
export ARCH=arm
export CROSS_COMPILE="$PWD/../toolchain-kernel/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-"
# Install the exact Centauri Carbon kernel .config here, then:
make olddefconfig
make -j"$(nproc)" zImage modules
cd ../efex
source ./env.sh
make

For a non-sibling layout, set these before sourcing env.sh:

export EFEX_KERNEL_DIR=/absolute/path/to/oc-linux
export EFEX_TOOLCHAIN_DIR=/absolute/path/to/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi
source ./env.sh
make

./rc.build is a convenience wrapper that sources env.sh and forwards its arguments to make. Run ./rc.build clean to remove generated build files.

Reproducing the bundled binary

The included binary was built with the Linaro 7.2.1 arm-linux-gnueabi- toolchain and has the vermagic shown above. make VERMAGIC=5.4.61 can set the embedded release string while building against a compatible prepared tree. It does not make an incompatible kernel configuration or ABI compatible.

TBD — provenance pin: the original artifact did not record the exact oc-linux commit and .config used for its build. Pin and record those values once the intended printer firmware/kernel build is selected; until then, treat the shipped module as compatible only with a kernel that accepts its complete ABI.

Source behavior

efex.c maps only the four-byte boot-mode register, writes the boot-ROM magic, and reads it back. The readback verifies the MMIO transaction, not a future boot-ROM decision. The mapping is released immediately; the hardware value persists until reset or other firmware clears it.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages