Add support for sdm845 mainline Android devices: beryllium, enchilada, fajita

This commit is contained in:
jld3103 2021-05-19 16:45:03 +02:00
parent 3383f2774a
commit 31af1bc923
23 changed files with 91 additions and 1 deletions

2
.gitignore vendored
View File

@ -7,6 +7,7 @@
/src/linux-rockchip
/src/linux-sunxi
/src/linux-librem5
/src/linux-sdm845
/src/busybox
/src/u-boot
/src/u-boot-librem5
@ -15,6 +16,7 @@
/*.dtb
/*.img.xz
/*.gz
/*.gz-dtb
/*.bin
/*.tar.bz2
/*.tar.xz

View File

@ -1,7 +1,7 @@
CROSS_FLAGS = ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
CROSS_FLAGS_BOOT = CROSS_COMPILE=aarch64-linux-gnu-
all: pine64-pinephone.img.xz pine64-pinetab.img.xz purism-librem5.tar.xz
all: pine64-pinephone.img.xz pine64-pinetab.img.xz purism-librem5.tar.xz xiaomi-beryllium-tianma.img xiaomi-beryllium-ebbg.img oneplus-enchilada.img oneplus-fajita.img
pine64-pinephone.img: fat-pine64-pinephone.img u-boot-sunxi-with-spl.bin
@ -67,6 +67,28 @@ fat-pine64-pinebookpro.img: initramfs-pine64-pinebookpro.gz kernel-rockchip.gz s
@mmd -i $@ extlinux
@mcopy -i $@ src/pine64-pinebookpro.conf ::extlinux/extlinux.conf
kernel-xiaomi-beryllium-tianma.gz-dtb: kernel-sdm845.gz dtbs/sdm845/sdm845-xiaomi-beryllium-tianma.dtb
cat kernel-sdm845.gz dtbs/sdm845/sdm845-xiaomi-beryllium-tianma.dtb > $@
kernel-xiaomi-beryllium-ebbg.gz-dtb: kernel-sdm845.gz dtbs/sdm845/sdm845-xiaomi-beryllium-ebbg.dtb
cat kernel-sdm845.gz dtbs/sdm845/sdm845-xiaomi-beryllium-ebbg.dtb > $@
kernel-oneplus-enchilada.gz-dtb: kernel-sdm845.gz dtbs/sdm845/sdm845-oneplus-enchilada.dtb
cat kernel-sdm845.gz dtbs/sdm845/sdm845-oneplus-enchilada.dtb > $@
kernel-oneplus-fajita.gz-dtb: kernel-sdm845.gz dtbs/sdm845/sdm845-oneplus-fajita.dtb
cat kernel-sdm845.gz dtbs/sdm845/sdm845-oneplus-fajita.dtb > $@
boot-%.img: initramfs-%.gz kernel-%.gz-dtb
rm -f $@
$(eval BASE := $(shell cat src/deviceinfo_$* | grep base | cut -d "\"" -f 2))
$(eval SECOND := $(shell cat src/deviceinfo_$* | grep second | cut -d "\"" -f 2))
$(eval KERNEL := $(shell cat src/deviceinfo_$* | grep kernel | cut -d "\"" -f 2))
$(eval RAMDISK := $(shell cat src/deviceinfo_$* | grep ramdisk | cut -d "\"" -f 2))
$(eval TAGS := $(shell cat src/deviceinfo_$* | grep tags | cut -d "\"" -f 2))
$(eval PAGESIZE := $(shell cat src/deviceinfo_$* | grep pagesize | cut -d "\"" -f 2))
mkbootimg --kernel kernel-$*.gz-dtb --ramdisk initramfs-$*.gz --base $(BASE) --second_offset $(SECOND) --kernel_offset $(KERNEL) --ramdisk_offset $(RAMDISK) --tags_offset $(TAGS) --pagesize $(PAGESIZE) -o $@
%.img.xz: %.img
@echo "XZ $@"
@xz -c $< > $@
@ -132,6 +154,24 @@ kernel-librem5.gz: src/linux_config_librem5 src/linux-librem5
dtbs/librem5/imx8mq-librem5-r2.dtb: kernel-librem5.gz
kernel-sdm845.gz: src/linux-sdm845
@echo "MAKE $@"
@mkdir -p build/linux-sdm845
@mkdir -p dtbs/sdm845
@$(MAKE) -C src/linux-sdm845 O=../../build/linux-sdm845 $(CROSS_FLAGS) defconfig sdm845.config
@printf "CONFIG_USB_ETH=n" >> build/linux-sdm845/.config
@$(MAKE) -C src/linux-sdm845 O=../../build/linux-sdm845 $(CROSS_FLAGS)
@cp build/linux-sdm845/arch/arm64/boot/Image.gz $@
@cp build/linux-sdm845/arch/arm64/boot/dts/qcom/sdm845-{xiaomi-beryllium-*,oneplus-enchilada,oneplus-fajita}.dtb dtbs/sdm845/
dtbs/sdm845/sdm845-xiaomi-beryllium-ebbg.dtb: kernel-sdm845.gz
dtbs/sdm845/sdm845-xiaomi-beryllium-tianma.dtb: kernel-sdm845.gz
dtbs/sdm845/sdm845-oneplus-enchilada.dtb: kernel-sdm845.gz
dtbs/sdm845/sdm845-oneplus-fajita.dtb: kernel-sdm845.gz
%.scr: src/%.txt
@echo "MKIMG $@"
@mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d $< $@
@ -186,6 +226,12 @@ src/linux-librem5:
@wget -c https://source.puri.sm/Librem5/linux-next/-/archive/pureos/5.9.16+librem5.2/linux-next-pureos-5.9.16+librem5.2.tar.gz
@tar -xvf linux-next-pureos-5.9.16+librem5.2.tar.gz --strip-components 1 -C src/linux-librem5
src/linux-sdm845:
@echo "WGET linux-sdm845"
@mkdir src/linux-sdm845
@wget -c https://gitlab.com/sdm845-mainline/sdm845-linux/-/archive/sdm845-stable/sdm845-linux-sdm845-stable.tar.gz
@tar -xvf sdm845-linux-sdm845-stable.tar.gz --strip-components 1 -C src/linux-sdm845
src/arm-trusted-firmware:
@echo "WGET arm-trusted-firmware"
@mkdir src/arm-trusted-firmware
@ -232,6 +278,7 @@ cleanfast:
@rm -vf *.bin
@rm -vf *.cpio
@rm -vf *.gz
@rm -vf *.gz-dtb
@rm -vf *.scr
@rm -vf splash/*.gz
@rm -vf *.lst

View File

@ -5,6 +5,9 @@ A swiss army knife for mobile devices, currently supporting:
- Pine64 PineTab
- Pine64 PinePhone
- Purism Librem 5
- Xiaomi Pocophone F1
- OnePlus 6
- OnePlus 6T
You can use this to flash a image **directly to eMMC**, troubleshooting a broken system, and a lot more.
@ -32,6 +35,10 @@ In case eMMC isn't showing up try to charge your battery and try again. There ar
Extract the downloaded JumpDrive release archive for the Librem 5, put the device into flash mode, then run the `boot-purism-librem5.sh` script from the release.
### Xiaomi Pocophone F1 / OnePlus 6 / OnePlus 6T
Boot the image using `fastboot boot`.
### Building
The dependencies are:
@ -44,6 +51,9 @@ Additional dependencies for the Purism Librem 5:
- arm-none-eabi- toolchain
- uuu
Additional dependencies for the Xiaomi Pocophone F1 / OnePlus 6 / OnePlus 6T:
- mkbootimg
```shell-session
$ git submodule update --init --recursive
Downloads the projects to build

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
splash/oneplus-fajita.ppm Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
xiaomi-beryllium-error.ppm

View File

@ -0,0 +1 @@
xiaomi-beryllium.ppm

Binary file not shown.

View File

@ -0,0 +1 @@
xiaomi-beryllium-error.ppm

View File

@ -0,0 +1 @@
xiaomi-beryllium.ppm

BIN
splash/xiaomi-beryllium.ppm Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
deviceinfo_sdm845

View File

@ -0,0 +1 @@
deviceinfo_sdm845

6
src/deviceinfo_sdm845 Normal file
View File

@ -0,0 +1,6 @@
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="4096"

View File

@ -0,0 +1 @@
deviceinfo_sdm845

View File

@ -0,0 +1 @@
deviceinfo_sdm845

View File

@ -0,0 +1,5 @@
PLATFORM=oneplus-enchilada
MANUFACTURER=OnePlus
PRODUCT="OnePlus 6"
EMMC=/dev/sda17
SD=/dev/mmcblk0

View File

@ -0,0 +1,5 @@
PLATFORM=oneplus-fajita
MANUFACTURER=OnePlus
PRODUCT="OnePlus 6T"
EMMC=/dev/sda17
SD=/dev/mmcblk0

View File

@ -0,0 +1 @@
info-xiaomi-beryllium.sh

View File

@ -0,0 +1 @@
info-xiaomi-beryllium.sh

View File

@ -0,0 +1,5 @@
PLATFORM=xiaomi-beryllium
MANUFACTURER=Xiaomi
PRODUCT="Pocophone F1"
EMMC=/dev/sda21
SD=/dev/mmcblk0