diff --git a/Development.md b/Development.md index d75cb9b1..c7681ea9 100644 --- a/Development.md +++ b/Development.md @@ -1,8 +1,9 @@ -# Elegoo Centauri Carbon 1 - Yocto Firmware Build +# Elegoo Centauri Carbon - Yocto Firmware Build -This repository contains a Yocto Project-based firmware build system for the Elegoo Centauri Carbon 1 3D printer. The mainboard of this printer is powered by an Allwinner r528 SoC. +This repository contains a Yocto Project-based firmware build system for the Elegoo Centauri Carbon 3D printer family. The mainboard of these printers is powered by an Allwinner R528 SoC. _**Unsure about what COSMOS is? [Check the FAQ to learn more](./FAQ.md)**_ + ## Prerequisites Before starting the build process, you need to install the required dependencies on your host system (Ubuntu/Debian is assumed): @@ -16,6 +17,67 @@ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential \ bmap-tools sunxi-tools ``` +## Build Configuration Options + +### Machine Selection (CC1 vs CC2) + +The build supports different machine configurations for the Centauri Carbon variants: + +| Machine | Description | +|---------|-------------| +| `elegoo-centauri-carbon1` | Original Centauri Carbon 1 (default) | +| `elegoo-centauri-carbon2` | Centauri Carbon 2 | + +The default in `build/conf/local.conf` is set to CC1: +```bash +MACHINE ?= "elegoo-centauri-carbon1" +``` + +To build for CC2, specify the machine on the command line: +```bash +MACHINE=elegoo-centauri-carbon2 bitbake opencentauri-image-usb +``` + +### Image Type Selection (USB vs eMMC) + +Choose the appropriate image type based on your target boot media: + +| Image Recipe | Target Media | Use Case | +|--------------|--------------|----------| +| `opencentauri-image-usb` | USB drive | Development, testing, or running from USB | +| `opencentauri-image-mmc` | Internal eMMC | Production installation on printer internal storage | + +#### USB Image (`opencentauri-image-usb`) +- Boots from USB drive +- Read-write root filesystem +- Suitable for development and testing +- Larger partition layout for USB storage + +**Important U-Boot Configuration for USB Builds:** +When building the USB image, the MMC environment storage options must be removed from the U-Boot defconfig for your target machine. These settings cause U-Boot to store its environment on the internal eMMC, which conflicts with USB boot. + +For **CC1**, edit: +- `meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo_centauri_carbon_defconfig` + +For **CC2**, edit: +- `meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo_centauri_carbon_defconfig` + +Remove (or ensure absent) these configuration options: +``` +CONFIG_ENV_IS_IN_MMC=y +CONFIG_ENV_OFFSET=0x1A66000 +CONFIG_ENV_OFFSET_REDUND=0x1AA5000 +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y +``` + +This is required for proper USB boot functionality. + +#### eMMC Image (`opencentauri-image-mmc`) +- Installs to internal eMMC storage +- Read-only SquashFS root with overlay filesystem for `/etc` on `/data` partition +- Optimized for production use +- Includes A/B boot partition scheme for safe updates via swupdate + ## How to Build 1. **Initialize the build environment:** @@ -24,25 +86,59 @@ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential \ source poky/oe-init-build-env build ``` -2. **Run BitBake:** - Once the environment is set up, you can start the build process for the target image. The primary image recipe for this project is `opencentauri-image`. +2. **Configure your target (if needed):** + Ensure `MACHINE` is set correctly in `build/conf/local.conf`: + ```bash + # For CC1 or CC2 + MACHINE ?= "elegoo-centauri-carbon1" + ``` + +3. **Run BitBake:** + Choose the appropriate image recipe for your target: + + **For USB booting:** + ```bash + bitbake opencentauri-image-usb + ``` + + **For eMMC/internal storage:** ```bash - bitbake opencentauri-image + bitbake opencentauri-image-mmc ``` + *Note: The first build will take a significant amount of time as it downloads and compiles all necessary packages from source.* +## Build Outputs + +After a successful build, the output files are located in: + +``` +tmp/deploy/images/elegoo-centauri-carbon1/ +``` + +### USB Image Outputs +- `opencentauri-image-usb-elegoo-centauri-carbon1.rootfs.wic.gz` - Compressed disk image for USB drives + +### eMMC Image Outputs +- `opencentauri-image-mmc-elegoo-centauri-carbon1.rootfs.wic.gz` - Full disk image for eMMC +- `bootA.img` - Extracted boot partition image (for swupdate) +- `bootlogos.img` - Extracted boot logos partition image (for swupdate) +- `rootfs.squashfs` - SquashFS root filesystem + ## Disk Space Requirements Building a complete Yocto image requires a substantial amount of disk space. Based on current build sizes, you should expect the project directory (including downloaded sources, build artifacts, and caches) to use approximately **38GB to 40GB** of disk space. Please ensure you have adequate free space before starting the build. ## Running on the Centauri Carbon 1 +### USB Boot Method (Development) + Note that the current install requires having a serial UART connected to the CC1 motherboard, as well as a FEL USB cable attached. This will prevent the toolhead from being plugged in! 1. **Install built firmware image to a USB drive.** *(Warning: This is a destructive operation! Replace `sdX` with your actual USB drive device like `sdb`, `sdc`, etc.)* ```bash - sudo bmaptool copy tmp/deploy/images/elegoo-centauri-carbon1/opencentauri-image-elegoo-centauri-carbon1.rootfs.wic.gz /dev/sdX + sudo bmaptool copy tmp/deploy/images/elegoo-centauri-carbon1/opencentauri-image-usb-elegoo-centauri-carbon1.rootfs.wic.gz /dev/sdX ``` 2. **Boot into FEL Mode.** @@ -76,6 +172,19 @@ Note that the current install requires having a serial UART connected to the CC1 5. **Access the Printer Interface.** Find the printer's IP address by running `ip a`. Access the Mainsail interface by visiting the printer's IP address via HTTP (port 80) in your web browser! +### eMMC Install Method (Production) + +For installing to internal eMMC storage, use the swupdate-based installation: + +1. Build the `opencentauri-upgrade` target. This recipe depends on `opencentauri-image-mmc` and produces the SWUpdate bundle: + ```bash + bitbake opencentauri-upgrade + ``` +2. Locate the generated `.swu` file in `tmp/deploy/images/elegoo-centauri-carbon1/` (e.g. `opencentauri-upgrade-elegoo-centauri-carbon1.swu`). +3. Copy the `.swu` file to a FAT32-formatted USB drive in the `install_opencentauri` folder, renaming it to `update.swu`. +4. Insert the USB drive into the printer +5. Import the `IMPORT_ME_DO_NOT_PRINT` file via the printer screen as you would for stock OpenCentauri + ## Configuration and Services - **Klipper Configuration:** In the current build, the Klipper `printer.cfg` is located in `/etc/klipper/config/printer.cfg`. @@ -83,3 +192,20 @@ Note that the current install requires having a serial UART connected to the CC1 ```bash service klipper restart ``` + +## Troubleshooting Build Issues + +### Clean Build +If you encounter build issues, try cleaning the specific package: +```bash +bitbake -c cleansstate +bitbake +``` + +### Full Reset +For a complete clean build (removes all build artifacts): +```bash +rm -rf tmp/ +source poky/oe-init-build-env build +bitbake +``` diff --git a/meta-opencentauri/conf/machine/elegoo-centauri-carbon1.conf b/meta-opencentauri/conf/machine/elegoo-centauri-carbon1.conf index 4ef21deb..ef57e52b 100644 --- a/meta-opencentauri/conf/machine/elegoo-centauri-carbon1.conf +++ b/meta-opencentauri/conf/machine/elegoo-centauri-carbon1.conf @@ -6,9 +6,9 @@ require conf/machine/include/sun8i.inc DEFAULTTUNE = "cortexa7thf-neon-vfpv4" -KERNEL_DEVICETREE = "allwinner/elegoo-centauri-carbon1.dtb" +KERNEL_DEVICETREE = "allwinner/elegoo-centauri-carbon.dtb" KERNEL_IMAGETYPE = "zImage" UBOOT_ENTRYPOINT = "0x43000000" SERIAL_CONSOLES = "115200;ttyS0" -UBOOT_MACHINE = "elegoo_centauri_carbon1_defconfig" +UBOOT_MACHINE = "elegoo_centauri_carbon_defconfig" diff --git a/meta-opencentauri/conf/machine/elegoo-centauri-carbon2.conf b/meta-opencentauri/conf/machine/elegoo-centauri-carbon2.conf new file mode 100644 index 00000000..c083c685 --- /dev/null +++ b/meta-opencentauri/conf/machine/elegoo-centauri-carbon2.conf @@ -0,0 +1,14 @@ +#@TYPE: Machine +#@NAME: Elegoo Centauri Carbon 2 +#@DESCRIPTION: Machine configuration for the Elegoo Centauri Carbon 2, based on the Allwinner R528 CPU + +require conf/machine/include/sun8i.inc + +DEFAULTTUNE = "cortexa7thf-neon-vfpv4" + +KERNEL_DEVICETREE = "allwinner/elegoo-centauri-carbon.dtb" +KERNEL_IMAGETYPE = "zImage" +UBOOT_ENTRYPOINT = "0x43000000" +SERIAL_CONSOLES = "115200;ttyS2" + +UBOOT_MACHINE = "elegoo_centauri_carbon_defconfig" diff --git a/meta-opencentauri/images/files/sw-description b/meta-opencentauri/images/files/sw-description index 65f6b9f1..a617e1f5 100644 --- a/meta-opencentauri/images/files/sw-description +++ b/meta-opencentauri/images/files/sw-description @@ -67,7 +67,7 @@ software = }, { name = "bootcmd_mainline"; - value = "run setargs_mainline; fatload mmc 0:${boot_part} 43000000 zImage; fatload mmc 0:${boot_part} 43800000 elegoo-centauri-carbon1.dtb; bootz 43000000 - 43800000"; + value = "run setargs_mainline; fatload mmc 0:${boot_part} 43000000 zImage; fatload mmc 0:${boot_part} 43800000 elegoo-centauri-carbon.dtb; bootz 43000000 - 43800000"; }, { name = "bootcmd"; @@ -152,7 +152,7 @@ software = }, { name = "bootcmd_mainline"; - value = "run setargs_mainline; fatload mmc 0:${boot_part} 43000000 zImage; fatload mmc 0:${boot_part} 43800000 elegoo-centauri-carbon1.dtb; bootz 43000000 - 43800000"; + value = "run setargs_mainline; fatload mmc 0:${boot_part} 43000000 zImage; fatload mmc 0:${boot_part} 43800000 elegoo-centauri-carbon.dtb; bootz 43000000 - 43800000"; }, { name = "bootcmd"; diff --git a/meta-opencentauri/images/opencentauri-image-base.bb b/meta-opencentauri/images/opencentauri-image-base.bb index 051ecb94..0683d7c8 100644 --- a/meta-opencentauri/images/opencentauri-image-base.bb +++ b/meta-opencentauri/images/opencentauri-image-base.bb @@ -14,7 +14,6 @@ CORE_IMAGE_EXTRA_INSTALL += "\ libgpiod \ libgpiod-tools \ kernel-modules \ - rtw88 \ wpa-supplicant \ iw \ kalico \ @@ -43,6 +42,10 @@ CORE_IMAGE_EXTRA_INSTALL += "\ v4l-utils \ " +CORE_IMAGE_EXTRA_INSTALL:append:elegoo-centauri-carbon1 = " \ + rtw88 \ +" + INITRAMFS_IMAGE = "core-image-tiny-initramfs" INITRAMFS_FSTYPES = "cpio.gz" INITRAMFS_IMAGE_BUNDLE = "1" diff --git a/meta-opencentauri/recipes-bsp/u-boot/files/0001-Add-elegoo-centauri-carbon1.dts.patch b/meta-opencentauri/recipes-bsp/u-boot/files/0001-Add-elegoo-centauri-carbon.dts.patch similarity index 90% rename from meta-opencentauri/recipes-bsp/u-boot/files/0001-Add-elegoo-centauri-carbon1.dts.patch rename to meta-opencentauri/recipes-bsp/u-boot/files/0001-Add-elegoo-centauri-carbon.dts.patch index 17128902..da5f50a3 100644 --- a/meta-opencentauri/recipes-bsp/u-boot/files/0001-Add-elegoo-centauri-carbon1.dts.patch +++ b/meta-opencentauri/recipes-bsp/u-boot/files/0001-Add-elegoo-centauri-carbon.dts.patch @@ -1,7 +1,7 @@ From 618c5a97497dd5934dc5e8a5b6861bdaa6af5916 Mon Sep 17 00:00:00 2001 From: James Turton Date: Mon, 16 Feb 2026 21:36:45 +0100 -Subject: [PATCH] Add elegoo-centauri-carbon1.dts +Subject: [PATCH] Add elegoo-centauri-carbon.dts Signed-off-by: James Turton Upstream-Status: Pending [Not submitted to upstream yet] @@ -17,7 +17,7 @@ index 04b9863b5d5..b28ed796445 100644 sun8i-v3-sl631-imx179.dtb \ sun8i-v3s-licheepi-zero.dtb dtb-$(CONFIG_MACH_SUN8I_R528) += \ -+ elegoo-centauri-carbon1.dtb \ ++ elegoo-centauri-carbon.dtb \ sun8i-t113s-mangopi-mq-r-t113.dtb dtb-$(CONFIG_MACH_SUN50I_H5) += \ sun50i-h5-bananapi-m2-plus.dtb \ diff --git a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1.dts b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo-centauri-carbon.dts similarity index 100% rename from meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1.dts rename to meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo-centauri-carbon.dts diff --git a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1.env b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo-centauri-carbon.env similarity index 90% rename from meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1.env rename to meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo-centauri-carbon.env index 78f62dd0..c349fa0f 100644 --- a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1.env +++ b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo-centauri-carbon.env @@ -4,5 +4,5 @@ systemAB_next=A boot_part=4 mmc_root=/dev/mmcblk0p5 setargs_mainline=setenv bootargs console=ttyS0,115200 earlycon=uart8250,mmio32,0x02500000 root=${mmc_root} rootwait -bootcmd_mainline=run setargs_mainline; fatload mmc 0:${boot_part} 43000000 zImage; fatload mmc 0:${boot_part} 43800000 elegoo-centauri-carbon1.dtb; bootz 43000000 - 43800000 +bootcmd_mainline=run setargs_mainline; fatload mmc 0:${boot_part} 43000000 zImage; fatload mmc 0:${boot_part} 43800000 elegoo-centauri-carbon.dtb; bootz 43000000 - 43800000 bootcmd=if test x${swu_mode} = xmainline; then run bootcmd_mainline; else run bootcmd_stock; fi diff --git a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo_centauri_carbon1_defconfig b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo_centauri_carbon_defconfig similarity index 90% rename from meta-opencentauri/recipes-bsp/u-boot/files/elegoo_centauri_carbon1_defconfig rename to meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo_centauri_carbon_defconfig index 613383be..0add0296 100644 --- a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo_centauri_carbon1_defconfig +++ b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon1/elegoo_centauri_carbon_defconfig @@ -1,6 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_SUNXI=y -CONFIG_DEFAULT_DEVICE_TREE="elegoo-centauri-carbon1" +CONFIG_DEFAULT_DEVICE_TREE="elegoo-centauri-carbon" CONFIG_SPL=y CONFIG_MACH_SUN8I_R528=y CONFIG_DRAM_CLK=792 @@ -28,7 +28,7 @@ CONFIG_CMD_USB=y # CONFIG_USE_BOOTARGS=y # CONFIG_BOOTARGS="console=ttyS0,115200 earlycon=uart8250,mmio32,0x02500000 root=/dev/sda2 rootwait" # CONFIG_USE_BOOTCOMMAND=y -# CONFIG_BOOTCOMMAND="fatload usb 0:1 43000000 zImage; fatload usb 0:1 43800000 elegoo-centauri-carbon1.dtb; bootz 43000000 - 43800000" +# CONFIG_BOOTCOMMAND="fatload usb 0:1 43000000 zImage; fatload usb 0:1 43800000 elegoo-centauri-carbon.dtb; bootz 43000000 - 43800000" # Display / splash screen CONFIG_VIDEO=y @@ -52,7 +52,7 @@ CONFIG_SPL_LOG_MAX_LEVEL=7 CONFIG_SPL_LOG_CONSOLE=y CONFIG_SPL_STACK_R_ADDR=0x47e00000 -CONFIG_ENV_SOURCE_FILE="elegoo-centauri-carbon1" +CONFIG_ENV_SOURCE_FILE="elegoo-centauri-carbon" CONFIG_ENV_SIZE=0x20000 CONFIG_ENV_OFFSET=0x1A66000 CONFIG_ENV_OFFSET_REDUND=0x1AA5000 diff --git a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo-centauri-carbon.dts b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo-centauri-carbon.dts new file mode 100644 index 00000000..ddd7dd7b --- /dev/null +++ b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo-centauri-carbon.dts @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (C) 2026 James Turton. + +/dts-v1/; + +#include +#include "sun8i-t113s.dtsi" + +/ { + model = "Elegoo Centauri Carbon 2"; + compatible = "widora,mangopi-mq-r-t113", "allwinner,sun8i-t113s"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + /* board wide 5V supply directly from the USB-C socket */ + reg_vcc5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "vcc-5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + /* SY8008 DC/DC regulator on the board */ + reg_3v3: regulator-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <®_vcc5v>; + }; + + /* SY8008 DC/DC regulator on the board, also supplying VDD-SYS */ + reg_vcc_core: regulator-core { + compatible = "regulator-fixed"; + regulator-name = "vcc-core"; + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + vin-supply = <®_vcc5v>; + }; + + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&pio 3 22 GPIO_ACTIVE_HIGH>; /* PD22 - backlight on/off */ + default-on; + }; +}; + +&cpu0 { + cpu-supply = <®_vcc_core>; +}; + +&cpu1 { + cpu-supply = <®_vcc_core>; +}; + +&dcxo { + clock-frequency = <24000000>; +}; + +&ehci1 { + status = "okay"; +}; + +&mmc2 { + pinctrl-0 = <&mmc2_pins>; + pinctrl-names = "default"; + vmmc-supply = <®_3v3>; + vqmmc-supply = <®_3v3>; + no-1-8-v; + cap-mmc-highspeed; + non-removable; + cap-mmc-hw-reset; + bus-width = <8>; + max-frequency = <52000000>; + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&pio { + vcc-pb-supply = <®_3v3>; + vcc-pd-supply = <®_3v3>; + vcc-pe-supply = <®_3v3>; + vcc-pf-supply = <®_3v3>; + vcc-pg-supply = <®_3v3>; + + uart0_pe_pins: uart0-pe-pins { + pins = "PE2", "PE3"; + function = "uart0"; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pe_pins>; + status = "okay"; +}; + +/* The USB-C socket has its CC pins pulled to GND, so is hardwired as a UFP. */ +&usb_otg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_vcc5v>; + status = "okay"; +}; + +&de { + status = "okay"; +}; + +&mixer0 { + status = "okay"; +}; + +&tcon_lcd0 { + status = "okay"; +}; + +&dphy { + status = "okay"; +}; + +&dsi { + pinctrl-names = "default"; + pinctrl-0 = <&dsi_4lane_pins>; + status = "okay"; + + panel@0 { + /* ===== CHANGE THIS to match your actual panel ===== */ + compatible = "simple-panel"; + reg = <0>; + backlight = <&backlight>; + enable-gpios = <&pio 1 8 GPIO_ACTIVE_HIGH>; /* PB8 - panel enable */ + power-supply = <®_3v3>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <20000000>; + hactive = <532>; + vactive = <300>; + hback-porch = <80>; + hfront-porch = <98>; + hsync-len = <4>; + vback-porch = <20>; + vfront-porch = <138>; + vsync-len = <4>; + }; + }; + + port { + panel_in: endpoint { + remote-endpoint = <&dsi_out_panel>; + }; + }; + }; + + port { + dsi_out_panel: endpoint { + remote-endpoint = <&panel_in>; + }; + }; +}; diff --git a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo-centauri-carbon.env b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo-centauri-carbon.env new file mode 100644 index 00000000..c349fa0f --- /dev/null +++ b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo-centauri-carbon.env @@ -0,0 +1,8 @@ +swu_version=0.0.0 +swu_mode=mainline +systemAB_next=A +boot_part=4 +mmc_root=/dev/mmcblk0p5 +setargs_mainline=setenv bootargs console=ttyS0,115200 earlycon=uart8250,mmio32,0x02500000 root=${mmc_root} rootwait +bootcmd_mainline=run setargs_mainline; fatload mmc 0:${boot_part} 43000000 zImage; fatload mmc 0:${boot_part} 43800000 elegoo-centauri-carbon.dtb; bootz 43000000 - 43800000 +bootcmd=if test x${swu_mode} = xmainline; then run bootcmd_mainline; else run bootcmd_stock; fi diff --git a/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo_centauri_carbon_defconfig b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo_centauri_carbon_defconfig new file mode 100644 index 00000000..a7f15ad0 --- /dev/null +++ b/meta-opencentauri/recipes-bsp/u-boot/files/elegoo-centauri-carbon2/elegoo_centauri_carbon_defconfig @@ -0,0 +1,57 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_DEFAULT_DEVICE_TREE="elegoo-centauri-carbon" +CONFIG_SPL=y +CONFIG_MACH_SUN8I_R528=y +CONFIG_DRAM_CLK=792 +CONFIG_DRAM_ZQ=8092667 +CONFIG_SUNXI_MINIMUM_DRAM_MB=128 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_DRAM_SUNXI_ODT_EN=0 +CONFIG_DRAM_SUNXI_TPR0=0x004a2195 +CONFIG_DRAM_SUNXI_TPR11=0x340000 +CONFIG_DRAM_SUNXI_TPR12=0x46 +CONFIG_DRAM_SUNXI_TPR13=0x34000100 +CONFIG_CONS_INDEX=1 +#CONFIG_DEBUG_UART=y +#CONFIG_DEBUG_UART_8250=y +#CONFIG_DEBUG_UART_BASE=0x02500000 +#CONFIG_DEBUG_UART_CLOCK=24000000 +#CONFIG_DEBUG_UART_8250_WORD=y +#CONFIG_DEBUG_UART_8250_SHIFT=2 +#CONFIG_DEBUG_UART_ANNOUNCE=y +#CONFIG_USB_HOST=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_OHCI_HCD=y +CONFIG_CMD_USB=y +CONFIG_BOOTDELAY=3 +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="console=ttyS0,115200 earlycon=uart8250,mmio32,0x02500000 root=/dev/sda2 rootwait" +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="fatload usb 0:1 43000000 zImage; fatload usb 0:1 43800000 elegoo-centauri-carbon.dtb; bootz 43000000 - 43800000" +CONFIG_PREBOOT="load mmc 0:1 0x43000000 bootlogo.bmp; bmp display 0x43000000; usb start" + +# Display / splash screen +CONFIG_VIDEO=y +CONFIG_DM_VIDEO=y +CONFIG_VIDEO_DE2=y +CONFIG_VIDEO_DT_SIMPLEFB=y +CONFIG_DISPLAY=y +CONFIG_VIDEO_LCD_IF_PARALLEL=y +CONFIG_VIDEO_LCD_DCLK_PHASE=0 +CONFIG_VIDEO_MIPI_DSI=y +CONFIG_VIDEO_DW_MIPI_DSI=y +CONFIG_VIDEO_SIMPLE=y +CONFIG_SPLASH_SCREEN=y +CONFIG_SPLASH_SCREEN_ALIGN=y +CONFIG_BACKLIGHT_GPIO=y +CONFIG_BMP=y +CONFIG_BMP_16BPP=y +CONFIG_BMP_24BPP=y +CONFIG_BMP_32BPP=y +CONFIG_CMD_BMP=y + +CONFIG_SPL_LOG=y +CONFIG_SPL_LOG_MAX_LEVEL=7 +CONFIG_SPL_LOG_CONSOLE=y +CONFIG_SPL_STACK_R_ADDR=0x47e00000 diff --git a/meta-opencentauri/recipes-bsp/u-boot/u-boot_2024.01.bbappend b/meta-opencentauri/recipes-bsp/u-boot/u-boot_2024.01.bbappend index 44d49992..a720faf3 100644 --- a/meta-opencentauri/recipes-bsp/u-boot/u-boot_2024.01.bbappend +++ b/meta-opencentauri/recipes-bsp/u-boot/u-boot_2024.01.bbappend @@ -1,8 +1,10 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -SRC_URI:append:elegoo-centauri-carbon1 = "file://elegoo-centauri-carbon1.dts;subdir=git/arch/${ARCH}/dts \ - file://elegoo_centauri_carbon1_defconfig;subdir=git/configs \ - file://elegoo-centauri-carbon1.env;subdir=git/board/sunxi \ - file://0001-Add-elegoo-centauri-carbon1.dts.patch \ +SRC_URI:append = " \ + file://elegoo-centauri-carbon.dts;subdir=git/arch/${ARCH}/dts \ + file://elegoo_centauri_carbon_defconfig;subdir=git/configs \ + file://elegoo-centauri-carbon.env;subdir=git/board/sunxi \ + file://0001-Add-elegoo-centauri-carbon.dts.patch \ file://0001-Fix-ac-remmaping-on-R528-S3.patch \ - file://0001-sunxi-r528-add-display-support-with-RB-channel-swap.patch" + file://0001-sunxi-r528-add-display-support-with-RB-channel-swap.patch \ +" diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/0001-Add-elegoo-centauri-carbon1.dts.patch b/meta-opencentauri/recipes-kernel/linux/linux-mainline/0001-Add-elegoo-centauri-carbon.dts.patch similarity index 89% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/0001-Add-elegoo-centauri-carbon1.dts.patch rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/0001-Add-elegoo-centauri-carbon.dts.patch index 43667e3c..8061e0e1 100644 --- a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/0001-Add-elegoo-centauri-carbon1.dts.patch +++ b/meta-opencentauri/recipes-kernel/linux/linux-mainline/0001-Add-elegoo-centauri-carbon.dts.patch @@ -1,7 +1,7 @@ From 451a6ee57c64fde1680be378394b62d91254d7f0 Mon Sep 17 00:00:00 2001 From: James Turton Date: Mon, 16 Feb 2026 22:16:21 +0100 -Subject: [PATCH] Add elegoo-centauri-carbon1.dts +Subject: [PATCH] Add elegoo-centauri-carbon.dts --- arch/arm/boot/dts/allwinner/Makefile | 1 + @@ -15,7 +15,7 @@ index 296be33ec..c103a1ef9 100644 DTC_FLAGS_sun8i-h3-bananapi-m2-plus-v1.2 := -@ DTC_FLAGS_sun8i-h3-orangepi-pc-plus := -@ dtb-$(CONFIG_MACH_SUN8I) += \ -+ elegoo-centauri-carbon1.dtb \ ++ elegoo-centauri-carbon.dtb \ sun8i-a23-evb.dtb \ sun8i-a23-gt90h-v4.dtb \ sun8i-a23-inet86dz.dtb \ diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/0001-Add-support-for-r528-msgbox-and-remoteproc.patch b/meta-opencentauri/recipes-kernel/linux/linux-mainline/0001-Add-support-for-r528-msgbox-and-remoteproc.patch similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/0001-Add-support-for-r528-msgbox-and-remoteproc.patch rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/0001-Add-support-for-r528-msgbox-and-remoteproc.patch diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/0002-drm-add-RB-channel-swap-support-for-panels-with-swap.patch b/meta-opencentauri/recipes-kernel/linux/linux-mainline/0002-drm-add-RB-channel-swap-support-for-panels-with-swap.patch similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/0002-drm-add-RB-channel-swap-support-for-panels-with-swap.patch rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/0002-drm-add-RB-channel-swap-support-for-panels-with-swap.patch diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/elegoo-centauri-carbon1.dts b/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/elegoo-centauri-carbon.dts similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/elegoo-centauri-carbon1.dts rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/elegoo-centauri-carbon.dts diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon2/elegoo-centauri-carbon.dts b/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon2/elegoo-centauri-carbon.dts new file mode 100644 index 00000000..02d984c0 --- /dev/null +++ b/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon2/elegoo-centauri-carbon.dts @@ -0,0 +1,371 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (C) 2026 James Turton. + +/dts-v1/; + +#include +#include +#include "sun8i-t113s.dtsi" + +/ { + model = "Elegoo Centauri Carbon 1"; + compatible = "widora,mangopi-mq-r-t113", "allwinner,sun8i-t113s"; + + aliases { + serial0 = &uart0; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + serial4 = &uart4; + i2c2 = &i2c2; + }; + + chosen { + stdout-path = "serial2:115200n8"; + }; + + /* board wide 5V supply directly from the USB-C socket */ + reg_vcc5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "vcc-5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + /* SY8008 DC/DC regulator on the board */ + reg_3v3: regulator-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <®_vcc5v>; + }; + + /* SY8008 DC/DC regulator on the board, also supplying VDD-SYS */ + reg_vcc_core: regulator-core { + compatible = "regulator-fixed"; + regulator-name = "vcc-core"; + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + vin-supply = <®_vcc5v>; + }; + + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&pio 3 22 GPIO_ACTIVE_HIGH>; /* PD22 */ + default-on; + }; + + panel { + compatible = "panel-dpi"; + bus-format = <0x1013>; + power-supply = <®_3v3>; + backlight = <&backlight>; + enable-gpios = <&pio 1 8 GPIO_ACTIVE_HIGH>; /* PB8 */ + + port { + panel_in: endpoint { + remote-endpoint = <&tcon_lcd0_out_panel>; + }; + }; + + panel-timing { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hback-porch = <39>; + hfront-porch = <8>; + hsync-len = <4>; + vback-porch = <8>; + vfront-porch = <8>; + vsync-len = <4>; + de-active = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <1>; + }; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* + * Reserve memory for the DSP firmware. + * Adjust base and size to match your firmware's linker script. + * This region must not overlap with Linux kernel memory. + * + * Common configurations: + * - SRAM only (small firmware): use the DSP SRAM region + * - DDR carveout (large firmware): reserve a DDR region + */ + dsp_reserved: dsp@42000000 { + reg = <0x42000000 0x00100000>; /* 1 MiB example */ + no-map; + }; + + /* + * Shared memory for RPMsg virtio vrings and buffers. + * This must be accessible by both ARM and DSP. + */ + vdev0buffer: vdev0buffer@42100000 { + compatible = "shared-dma-pool"; + reg = <0x42100000 0x40000>; /* 256 KiB */ + no-map; + }; + + vdev0vring0: vdev0vring0@42140000 { + reg = <0x42140000 0x2000>; /* 8 KiB */ + no-map; + }; + + vdev0vring1: vdev0vring1@42142000 { + reg = <0x42142000 0x2000>; /* 8 KiB */ + no-map; + }; + }; + + soc { + msgbox: mailbox@3003000 { + compatible = "allwinner,sunxi-r528-msgbox"; + reg = <0x03003000 0x1000>, /* ARM CPUX_MSGBOX (local/RX) */ + <0x01701000 0x1000>; /* DSP_MSGBOX (remote/TX) */ + reg-names = "local", "remote"; + clocks = <&ccu CLK_BUS_MSGBOX0>; + resets = <&ccu RST_BUS_MSGBOX0>; + interrupts = ; + #mbox-cells = <1>; + status = "okay"; + }; + + dsp: dsp@1700000 { + compatible = "allwinner,sunxi-r528-hifi4-rproc"; + reg = <0x01700000 0x100>; + reg-names = "cfg"; + + allwinner,sram = <&syscon>; + + clocks = <&ccu CLK_DSP>, + <&ccu CLK_BUS_DSP_CFG>; + clock-names = "dsp", "cfg"; + + resets = <&ccu RST_DSP>, + <&ccu RST_BUS_DSP_CFG>, + <&ccu RST_BUS_DSP_DBG>; + reset-names = "dsp", "cfg", "dbg"; + + /* + * Mailbox channels: + * Channel 0 = RX from DSP (MSGBOX channels 0-3) + * Channel 4 = TX to DSP (MSGBOX channels 4-7) + */ + mboxes = <&msgbox 0>, /* RX: DSP -> ARM */ + <&msgbox 4>; /* TX: ARM -> DSP */ + mbox-names = "rx", "tx"; + + memory-region = <&dsp_reserved>, + <&vdev0buffer>, + <&vdev0vring0>, + <&vdev0vring1>; + + /* + * Firmware file loaded from /lib/firmware/. + * Can be overridden at runtime via: + * echo my_fw.elf > /sys/class/remoteproc/remoteproc0/firmware + */ + firmware-name = "dsp0.elf"; + + status = "okay"; + }; + }; +}; + +&cpu0 { + cpu-supply = <®_vcc_core>; +}; + +&cpu1 { + cpu-supply = <®_vcc_core>; +}; + +&dcxo { + clock-frequency = <24000000>; +}; + +&mmc2 { + pinctrl-0 = <&mmc2_pins>; + pinctrl-names = "default"; + vmmc-supply = <®_3v3>; + vqmmc-supply = <®_3v3>; + no-1-8-v; + cap-mmc-highspeed; + non-removable; + cap-mmc-hw-reset; + bus-width = <8>; + max-frequency = <52000000>; + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&pio { + vcc-pb-supply = <®_3v3>; + vcc-pd-supply = <®_3v3>; + vcc-pe-supply = <®_3v3>; + vcc-pf-supply = <®_3v3>; + vcc-pg-supply = <®_3v3>; + + uart0_pf_pins: uart0-pf-pins { + pins = "PF2", "PF4"; + function = "uart0"; + }; + + uart1_pe_pins: uart1-pe-pins { + pins = "PE10", "PE11"; + function = "uart1"; + }; + + uart2_pe_pins: uart0-pe-pins { + pins = "PE2", "PE3"; + function = "uart2"; + }; + + uart3_pd_pins: uart3-pd-pins { + pins = "PD10", "PD11"; + function = "uart3"; + }; + + uart4_pe_pins: uart4-pe-pins { + pins = "PE4", "PE5"; + function = "uart4"; + }; + + lcd_rgb24_pins: lcd-rgb24-pins { + pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", + "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", + "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", + "PD18", "PD19", "PD20", "PD21", + "PB2", "PB3", "PB4", "PB5", "PB6", "PB7"; + function = "lcd0"; + drive-strength = <30>; + }; + + // pwm7_pd22_pin: pwm7-pd22-pin { + // pins = "PD22"; + // function = "pwm7"; + // }; + + i2c2_pins: i2c2-pins { + pins = "PB0", "PB1"; + function = "i2c2"; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pf_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pe_pins>; + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pe_pins>; + status = "okay"; +}; + +&uart3 { + pinctrl-names = "default"; + pinctrl-0 = <&uart3_pd_pins>; + status = "okay"; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pe_pins>; + status = "okay"; +}; + +/* The USB-C socket has its CC pins pulled to GND, so is hardwired as a UFP. */ +&usb_otg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_vcc5v>; + status = "okay"; +}; + + +// &pwm { +// pinctrl-names = "default"; +// pinctrl-0 = <&pwm7_pd22_pin>; +// status = "okay"; +// }; + +&de { + status = "okay"; +}; + +&mixer0 { + status = "okay"; +}; + +&tcon_lcd0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd_rgb24_pins>; + status = "okay"; +}; + +&tcon_lcd0_out { + tcon_lcd0_out_panel: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_in>; + }; +}; + +&syscon { + compatible = "allwinner,sun20i-d1-system-control", + "syscon"; +}; + +&i2c2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + goodix: touchscreen@5d { + compatible = "goodix,gt911"; + reg = <0x5d>; + interrupt-parent = <&pio>; + interrupts = <4 1 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PE1) */ + irq-gpios = <&pio 4 1 GPIO_ACTIVE_HIGH>; /* INT (PE1) */ + reset-gpios = <&pio 4 0 GPIO_ACTIVE_HIGH>; /* RST (PE0) */ + }; +}; + +&wdt { + status = "okay"; +}; diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/fragment.cfg b/meta-opencentauri/recipes-kernel/linux/linux-mainline/fragment.cfg similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/fragment.cfg rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/fragment.cfg diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/kernel-size-reduction.cfg b/meta-opencentauri/recipes-kernel/linux/linux-mainline/kernel-size-reduction.cfg similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/kernel-size-reduction.cfg rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/kernel-size-reduction.cfg diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/squashfs-overlayfs.cfg b/meta-opencentauri/recipes-kernel/linux/linux-mainline/squashfs-overlayfs.cfg similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/squashfs-overlayfs.cfg rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/squashfs-overlayfs.cfg diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/sunxi-r528-msgbox.c b/meta-opencentauri/recipes-kernel/linux/linux-mainline/sunxi-r528-msgbox.c similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/sunxi-r528-msgbox.c rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/sunxi-r528-msgbox.c diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/sunxi_r528_remoteproc.c b/meta-opencentauri/recipes-kernel/linux/linux-mainline/sunxi_r528_remoteproc.c similarity index 100% rename from meta-opencentauri/recipes-kernel/linux/linux-mainline/elegoo-centauri-carbon1/sunxi_r528_remoteproc.c rename to meta-opencentauri/recipes-kernel/linux/linux-mainline/sunxi_r528_remoteproc.c diff --git a/meta-opencentauri/recipes-kernel/linux/linux-mainline_%.bbappend b/meta-opencentauri/recipes-kernel/linux/linux-mainline_%.bbappend index 2c36d680..4e1e5058 100644 --- a/meta-opencentauri/recipes-kernel/linux/linux-mainline_%.bbappend +++ b/meta-opencentauri/recipes-kernel/linux/linux-mainline_%.bbappend @@ -4,11 +4,11 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" PACKAGE_ARCH = "${MACHINE_ARCH}" -SRC_URI:append:elegoo-centauri-carbon1 = " \ - file://elegoo-centauri-carbon1.dts;subdir=linux-6.6.85/arch/${ARCH}/boot/dts/allwinner \ +SRC_URI:append = " \ + file://elegoo-centauri-carbon.dts;subdir=linux-6.6.85/arch/${ARCH}/boot/dts/allwinner \ file://sunxi-r528-msgbox.c;subdir=linux-6.6.85/drivers/mailbox \ file://sunxi_r528_remoteproc.c;subdir=linux-6.6.85/drivers/remoteproc \ - file://0001-Add-elegoo-centauri-carbon1.dts.patch \ + file://0001-Add-elegoo-centauri-carbon.dts.patch \ file://0001-Add-support-for-r528-msgbox-and-remoteproc.patch \ file://0002-drm-add-RB-channel-swap-support-for-panels-with-swap.patch \ file://fragment.cfg \ diff --git a/meta-opencentauri/recipes-support/swupdate/files/elegoo-centauri-carbon2/hwrevision b/meta-opencentauri/recipes-support/swupdate/files/elegoo-centauri-carbon2/hwrevision new file mode 100644 index 00000000..596c7163 --- /dev/null +++ b/meta-opencentauri/recipes-support/swupdate/files/elegoo-centauri-carbon2/hwrevision @@ -0,0 +1 @@ +elegoo-centauri-carbon2 1.0