All Projects → repk → gxlimg

repk / gxlimg

Licence: BSD-2-Clause license
Boot Image creation tool for amlogic s905x (GXL)

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects
Meson
512 projects

Projects that are alternatives of or similar to gxlimg

khadas-openwrt
openwrt for Khadas boards
Stars: ✭ 25 (-40.48%)
Mutual labels:  amlogic, aarch64, s905x
rsync-static
Static RSync binaries compiled for x86, ARM, and ARM64. Useful for running on Android. Built daily
Stars: ✭ 40 (-4.76%)
Mutual labels:  arm, aarch64
Talks
schedule and materials about my presentations
Stars: ✭ 245 (+483.33%)
Mutual labels:  arm, aarch64
alpine-qbittorrent-openvpn
qBittorrent docker container with OpenVPN client running as unprivileged user on alpine linux
Stars: ✭ 230 (+447.62%)
Mutual labels:  arm, aarch64
Openwrt Node Packages
OpenWrt Project Node.js packages. v10.x LTS and v12.x LTS and v14.x LTS
Stars: ✭ 176 (+319.05%)
Mutual labels:  arm, aarch64
Simdjson
Parsing gigabytes of JSON per second
Stars: ✭ 15,115 (+35888.1%)
Mutual labels:  arm, aarch64
DLARM
DLARM: Dissertation for Computer Science Masters Degree at UFRGS
Stars: ✭ 24 (-42.86%)
Mutual labels:  arm, aarch64
Amie
A Minimalist Instruction Extender for the ARM architecture and IDA Pro
Stars: ✭ 136 (+223.81%)
Mutual labels:  arm, aarch64
equinix-metal-arm64-cluster
Arm and Equinix Metal have partnered to make powerful Neoverse based Armv8 bare metal infrastructure including latest generation Ampere systems — available for open source software developers to build, test and optimize for Arm64 architecture.
Stars: ✭ 71 (+69.05%)
Mutual labels:  arm, aarch64
Azote
Fast and lightweight AArch64 disassembler.
Stars: ✭ 24 (-42.86%)
Mutual labels:  arm, aarch64
Mandibule
linux elf injector for x86 x86_64 arm arm64
Stars: ✭ 171 (+307.14%)
Mutual labels:  arm, aarch64
pbp-packages
Package build scripts for using Arch Linux ARM with the Pinebook Pro laptop.
Stars: ✭ 3 (-92.86%)
Mutual labels:  arm, aarch64
Computelibrary
The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
Stars: ✭ 2,123 (+4954.76%)
Mutual labels:  arm, aarch64
Doesitarm
🦾 A list of reported app support for Apple Silicon and the new Apple M1 Macs
Stars: ✭ 3,200 (+7519.05%)
Mutual labels:  arm, aarch64
Cross
“Zero setup” cross compilation and “cross testing” of Rust crates
Stars: ✭ 2,461 (+5759.52%)
Mutual labels:  arm, aarch64
Tow-Boot
An opinionated distribution of U-Boot. — https://matrix.to/#/#Tow-Boot:matrix.org?via=matrix.org
Stars: ✭ 338 (+704.76%)
Mutual labels:  arm, aarch64
Docker Homebridge
Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
Stars: ✭ 1,847 (+4297.62%)
Mutual labels:  arm, aarch64
Build
Armbian Linux build framework
Stars: ✭ 1,827 (+4250%)
Mutual labels:  arm, aarch64
amlogic-s9xxx-openwrt
OpenWrt for Amlogic and Rockchip. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, rk3588, rk3568, rk3288, etc. including install to EMMC and update related functions.
Stars: ✭ 724 (+1623.81%)
Mutual labels:  amlogic, s905x
tensorflow-serving-arm
TensorFlow Serving ARM - A project for cross-compiling TensorFlow Serving targeting popular ARM cores
Stars: ✭ 75 (+78.57%)
Mutual labels:  arm, aarch64
gxlimg
======

Gxlimg is an amlogic s905x boot image creation tools. This has been made by
reverse engineering the aml_encrypt_gxl binary used to create boot image as
well as the BL2 arm binary that reads FIP header and loads BL3* and u-boot
images.

Some reverse engineering notes can be found in reveng directory, please note
that because I decompiled aml_encrypt_gxl by hand (not using a tool like IDA),
some mistakes could have slept in those notes. The purpose was first to
familiarized myself with subject such as ARM assembly and Arm Trust Firmware
(ATF).


I - Build instructions
----------------------

In order to build this tool just use the following:

 $ make

If you want some debug information and print use the following instead:

 $ make DEBUG=1

II.A - Create a boot image - automated version
----------------------------------------------

1) Compile u-boot:

  Compile mainline u-boot from http://git.denx.de/

   $ make CROSS_COMPILE=aarch64-elf- libretech-cc_defconfig
   $ make CROSS_COMPILE=aarch64-elf- all

  Replace aarch64-elf- with the prefix of your aarch64 toolchain.
  This should produce a u-boot-dtb.bin file.

2) Generate image

  Use the image target to generate the build/gxl-boot.bin image.

  $ make image UBOOT=<path/to/u-boot-dtb.bin>

II.B - Create a boot image - manual version
-------------------------------------------

In order to create a boot image for s905x board such as lepotato board, you
can follow those steps below.


1) Get BL* binaries:

  Follow instructions from here https://github.com/BayLibre/u-boot that build
  vendor u-boot in order to get BL* binaries.

2) Sign BL2:

  Use gxlimg as below to sign BL2 binary along with its DDR initialization
  datas:

   $ ./fip/blx_fix.sh fip/gxl/bl2_acs.bin zero_tmp fip/gxl/bl2_zero.bin \
     fip/gxl/bl21.bin fip/gxl/bl21_zero.bin bl2_new.bin bl2
   $ gxlimg -t bl2 -s bl2_new.bin bl2.bin.enc

3) Encrypt BL3*:

  Use the following to encrypt BL3* binary

   $ gxlimg -t bl3x -c ./fip/gxl/bl30_new.bin bl30.bin.enc
   $ gxlimg -t bl3x -c ./fip/gxl/bl31.img bl31.img.enc

4) Compile u-boot:

  Compile mainline u-boot from http://git.denx.de/

   $ make CROSS_COMPILE=aarch64-elf- libretech-cc_defconfig
   $ make CROSS_COMPILE=aarch64-elf- all

  Replace aarch64-elf- with the prefix of your aarch64 toolchain.
  This should produce a u-boot-dtb.bin file.

5) Encrypt u-boot:

  Encrypt the previously built u-boot image:

   $ gxlimg -t bl3x -c u-boot.bin u-boot.bin.enc

6) Create the final boot image:

  To create the final image issue the command below:

   $ gxlimg -t fip --bl2 ./bl2.bin.enc --bl30 ./bl30.bin.enc \
     --bl31 ./bl31.img.enc --bl33 ./u-boot.bin.enc ./gxl-boot.bin

II.c - Create USB boot files
----------------------------

The ROM USB Boot mode on GXL, GXM & AXG uses .usb.bl2 and .usb.tpl files to boot,
as used by pyamlboot (https://github.com/superna9999/pyamlboot)

The first binary contains the encrypted BL2 and the second the rest of the gxl-boot.bin

To generate:

$ dd if=gxl-boot.bin of=u-boot.bin.usb.bl2 bs=49152 count=1
$ dd if=gxl-boot.bin of=u-boot.bin.usb.tpl skip=49152 bs=1

Then copy them into files/<boardname>/u-boot.bin.usb.bl2 & files/<boardname>/u-boot.bin.usb.tpl
in the checkout source of pyamlboot, then follow instructions at:
https://github.com/superna9999/pyamlboot#booting-full-system-from-usb

III - Write the image to the SD card
------------------------------------

1) Prepare the SD card:

  First compute how many sectors gxl-boot.bin uses by getting its size and
  dividing it by 512.

  Let's say your gxl-boot.bin is 653312 Bytes thus you need 1276 sectors you
  can give you a little bit margin and choose a gap of 2048 sectors for your
  first partion.

  Then create the partition:

   $ sudo fdisk /dev/mmcpblk0
   $ n
   $ p
   $ 1
   $ 2048 # <- enter the number of sectors previously computed
   $ # <- take the whole remaining space for the partition
   $ w

  Then create a fs on it:

   $ mkfs.ext3 /dev/mmcblk0p1

  And copy or install a linux ARM file system.

2) Copy boot image to SD:

  The copy image to SD being careful to not erase the first 512 block (holding
  the MBR partition table)

   $ dd if=./gxl-boot.bin of=/dev/mmcblk0 bs=512 seek=1
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].