All Projects → crust-firmware → crust

crust-firmware / crust

Licence: other
SCP (power management) firmware for sunxi SoCs

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
assembly
5116 projects
shell
77523 projects

Projects that are alternatives of or similar to crust

printrboardmodernmarlin
Printrboard and Modern Marlin
Stars: ✭ 55 (-54.55%)
Mutual labels:  firmware
robocup-firmware
Georgia Tech RoboJackets Firmware for the RoboCup Small Size League
Stars: ✭ 22 (-81.82%)
Mutual labels:  firmware
FreiKey
My fully custom ergonomic two piece Bluetooth keyboard
Stars: ✭ 16 (-86.78%)
Mutual labels:  firmware
thinx-device-api
Remote IoT Device Management Platform
Stars: ✭ 19 (-84.3%)
Mutual labels:  firmware
OpenWare
Firmware for OWL devices
Stars: ✭ 23 (-80.99%)
Mutual labels:  firmware
home
Monorepo for all home automation related development, including integrated firmware, PCBs, configuration, and bridges
Stars: ✭ 104 (-14.05%)
Mutual labels:  firmware
platform-ststm8
ST STM8: development platform for PlatformIO
Stars: ✭ 30 (-75.21%)
Mutual labels:  firmware
po-util
Classic Edition of po-util: The Ultimate Local Particle Experience for Linux and macOS
Stars: ✭ 51 (-57.85%)
Mutual labels:  firmware
README
All Huawei modifications README, compilation instructions, etc
Stars: ✭ 72 (-40.5%)
Mutual labels:  firmware
SuperLEDstrip
No description or website provided.
Stars: ✭ 13 (-89.26%)
Mutual labels:  firmware
kobopatch-patches
Patches for use with kobopatch.
Stars: ✭ 134 (+10.74%)
Mutual labels:  firmware
ESP32 BLE OTA Arduino
OTA update on ESP32 via BLE
Stars: ✭ 41 (-66.12%)
Mutual labels:  firmware
SnowFlakeProject
All open source data of the snow flake project.
Stars: ✭ 37 (-69.42%)
Mutual labels:  firmware
lucidgloves
Arduino/ESP32 based DIY VR Haptic gloves. Compatible with SteamVR via OpenGloves.
Stars: ✭ 1,149 (+849.59%)
Mutual labels:  firmware
pinetime-hypnos
Zephyr firmware for the nRF52832 PineTime smartwatch
Stars: ✭ 52 (-57.02%)
Mutual labels:  firmware
smbusb
USB SMBus Interface
Stars: ✭ 93 (-23.14%)
Mutual labels:  firmware
Tinymovr
Compact brushless motor controller with integrated absolute encoder and CAN Bus.
Stars: ✭ 90 (-25.62%)
Mutual labels:  firmware
nodebots-interchange
Project related to creating hardware backpacks for your nodebot to make them more capable.
Stars: ✭ 47 (-61.16%)
Mutual labels:  firmware
firmware-analysis-plus
Simulate firmware with one click of firmadyne (使用 firmadyne 一键模拟固件)
Stars: ✭ 84 (-30.58%)
Mutual labels:  firmware
firmware
The Firmware for the Freifunk Bielefeld Community
Stars: ✭ 23 (-80.99%)
Mutual labels:  firmware

Crust: Libre SCP firmware for Allwinner sunxi SoCs

CI status

What is it?

The crust is the lowest-level component of a delicious fruit pie. Similarly, Crust is the lowest-level firmware component that runs on $FRUIT (Banana, Orange, Lichee) Pi single-board computers and other Allwinner-based devices, such as the Pine64 Pinebook and PinePhone.

Crust improves battery life and thermal performance by implementing a deep sleep state. During deep sleep, the CPU cores, the DRAM controller, and most onboard peripherals are powered down, reducing power consumption by 80% or more compared to an idle device. On boards without a PMIC, Crust is also responsible for orderly power-off and power-on of the device.

For this to work, Crust runs outside the main CPU and DRAM, on a dedicated always-on microprocessor called a System Control Processor (SCP). Crust is designed to run on a specific SCP implementation, Allwinner's AR100.

Note that Crust only provides the mechanism for deep sleep. It does not dictate any system sleep policy. Specifically, Crust does not decide when to go to sleep; the Linux kernel or userspace does that. And with one exception (listening for IR remote control key presses), Crust does not decide when to wake the system up, either; the hardware, as programmed by Linux, does that. Crust is designed to be a mostly-invisible implementation detail of the Linux power management interface.

See Crust's ABI documentation for a detailed description of how Crust interacts with Linux and other firmware components at runtime.

Interested users and contributors are encouraged to join #linux-sunxi on OFTC to discuss the firmware and its integration with other software.

Supported devices

Crust supports any board with a SoC listed in the table below. There is no board-specific code needed for basic functionality. Boards that are tested and known to work have a defconfig file in the repository. For everything else, use the defconfig for a similar board, or run make config or make nconfig to choose the appropriate options (there aren't many).

SoC Support level SCPI CPU cores CPU subsystem DRAM PMIC
A64 Production/stable Yes Yes Yes Yes Yes
A83T Known to compile Yes No No No No
H3 Working beta Yes Yes Yes Yes N/A
H5 Production/stable Yes Yes Yes Yes N/A
H6 Production/stable Yes Yes Yes Yes Yes

Prerequisites

Crust supports mainline Linux only. It completely replaces Allwinner's bespoke, proprietary firmware with a libre solution that supports standard protocols and is developed entirely in the open with community input. Effort is underway to upstream all changes to third-party projects; however, some patches are currently still needed.

  • ARM Trusted Firmware-A: upstream support for Crust was merged in commit c335ad480d41, and is present in all releases starting with v2.3. Optional patches for improved support are available in the crust branch of the crust-firmware fork.
  • Linux: while Linux does not directly communicate with Crust, it requires some small patches to cleanly share the clock controller and PMIC bus controller hardware with Crust. They are available in the crust-minimal branch of the crust-firmware fork. Those patches, plus additional optional changes for reduced power consumption (helpful even if you are not using Crust), are available in the crust branch.
  • U-Boot: upstream support for loading Crust into SRAM was merged in commit 18261b855223, and is present in all releases starting with v2021.01-rc1. It is also possible to load Crust by padding your ATF binary to 48KiB (64KiB for H6) and then concatenating Crust onto the end.

Note: The default PMIC bus configuration for most H6 boards is not compatible with versions of Linux before commit 531fdbeedeb8. To use Crust on those boards with older versions of Linux, you must explicitly select CONFIG_I2C_PINS_PL0_PL1, or you may use the Crust v0.4 release.

Building the firmware

An easy way to get all the pieces in the right places, with the right patches, is to use the Makefile in the crust-firmware meta repository. See the README file there for further instructions. Alternatively, you can build each firmware component individually. See the README.sunxi64 file in the U-Boot source tree for more details. Installation of the combined U-Boot+ATF+Crust binary works the same as for U-Boot without Crust.

Building Crust requires a cross-compiler targeting the or1k architecture (OpenRISC 1000, not RISC-V), which is officially supported in upstream GCC starting with GCC 9.1.0. Prebuilt toolchains are available from musl.cc, bootlin, and possibly your Linux distribution's package archive.

If your cross toolchain has a different tuple (the toolchain's libc is not relevant when compiling freestanding firmware programs), or if it is not in your PATH, export CROSS_COMPILE or edit the top of the Makefile to provide the appropriate prefix or full path.

Run make to build the firmware, which will be placed at build/scp/scp.bin. Adding V=1 to the command line will perform a verbose build, showing you the commands as they run. Set SRC, OBJ, or TGT as necessary if you want to do an out-of-tree build.

Contributing

The success of the crust firmware project is made possible by community support. For more information regarding community contributions, please reference the crust firmware contribution guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].