The officially official Devuan Forum!

You are not logged in.

#1 2019-11-14 03:35:44

tuxd3v
Member
Registered: 2019-11-14
Posts: 99  

[ ARM64 ] build, for Orange PI One Plus

Hello All,
As you probably know, there are an effort, to bring Sunxi Hardware to mainline( Leaving behind each proprietary, vendor builders, tool-chains, and blobs.. we hope ) here :

I started doing some Devuan builds for Sunxi boards, with the objective to have a complete Devuan arm64 build..
In the next Iterations, will be also there  a 'Desktop' build type..possibly with Equinox Desktop Environment-EDE

In this case, there is a v0.7beta Server build.

Features & Versions:

1) - Arm Trusted Firmware  - v2.2 ( built for arm64 )
     U-boot boot-loader       - v2020.01 ( built for arm64 )
2) - Linux Kernel                - Stable 5.6.3 ( built for arm64 )
3) - UserSpace                  - Devuan Beowulf ( for arm64 )

4) - ChangeLog                  - update kernel,pwm driver, pmu driver
5) - Problems & to be done - After coming to Beowulf, its impossible to auto-mount zramfs as swap, automatically..

1) BootLoader( ATF + u-boot )

Disk Partitioning scheme:

# parted /dev/mmcblk0
(...)                                                         
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  101MB   99.6MB  primary  ext2
 2      101MB   1700MB  1599MB  primary  ext4

a)   - Bootloader( Arm Trusted Firmware + U-Boot ), is between [ beginning - 1st partition ]( starting at sector 16( 8KiB ), til 1MiB )
  a1) - The Bootloader will search for a file called 'boot.scr', and after initialise the u-boot environment, will execute that script..
  a2) - In  'boot.scr', for this image, it will point to 'Orange PI One Plus' Device Tree Binary File by default( was tested there.. )..
  a3) - If you have other board than  'Orange PI One Plus', please Read Bellow in the 'Notes Section'..   
b)  - 1st Partition( after BootLoader ) is mounted as  '/boot'
c)  - 2nd Partition is mounted as rootfs '/'

NOTA!
The Bootloader in a) usually takes ~600KiB..
Each time a bootloader is built, all area [ 8KiB - 1MiB ], needs to be clean first( so that you can flash the new bootloader.. because could still be there any bits of the previous one.. which could lead to unpredictable consequences.. ).

If you have Other Board than 'Orange PI One Plus', situation described in a3):
The 'boot.cmd' script( format, Human Readable ):

# setup MAC address
setenv ethaddr 7E:8C:70:59:B5:70
# set console to tty0
setenv console tty0
# Send debug info to uart, and also display
setenv stdout serial,vga
setenv stderr serial,vga
setenv bootargs debug=on earlyprintk=serial,tty0,115200n8 console=tty0 console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootfstype=ext4 fsck.repair=yes rootwait
setenv fdtfile allwinner/sun50i-h6-orangepi-one-plus.dtb
load mmc 0:2 0x43000000 usr/lib/linux-image-5.6.3/${fdtfile}
load mmc 0:1 0x42000000 vmlinuz
booti 0x42000000 - 0x43000000

Write this Image, to a sd-card, then mount it, and change the 'boot.cmd' script to point to your board..
# You can find a list of supported boards in: '/usr/lib/linux-image-5.6.3/allwinner'
# Edit the file 'boot.cmd', with 'vi' for example.
# change the line:

setenv fdtfile allwinner/sun50i-h6-orangepi-one-plus.dtb

to

setenv fdtfile allwinner/your_board.dtb

Save the file,
# Generate the real script file( binary ), 'boot.scr'

mkimage -C none -A arm64 -T script -d boot.cmd boot.scr

2) - Linux Kernel

Packages:

There are 3 packages installed( in the future will be at least Userspace Panfrost mesa-3d graphics drivers more.. for a desktop version..):

~# dpkg -l |grep -E "(linux-.*(headers|image|libc-dev))"
ii  linux-headers-5.6.3        5.6.3-11                           arm64        Linux kernel headers for 5.6.3 on arm64
ii  linux-image-5.6.3          5.6.3-11                           arm64        Linux kernel, version 5.6.3
ii  linux-libc-dev:arm64       5.6.3-11                           arm64        Linux support headers for userspace development

The target will be to reach, at least Linux kernel 5.8, or more if needed, have lot of new features for ARM hardware.. ), and also work in the Device Tree Bindings, for each board..


3) - UserSpace -Users & Passwords:

1) root      - password 'toor'
2) devuan - password 'devuan'

NOTA!
SSH is enabled, so that you can login, but root login, is disabled, you should login as 'devuan', only then switch to 'root', if you want to.. for that,
After Login as 'devuan', issue:

sudo su -

And type your 'devuan' password, that's it..

4) - Changelog

a) kernel update to 5.5.0 5.6.3,
b) Thermal driver( as patch )., will be officially added to kernel 5.6..( added on kernel 5.6.3 )
c) Hardware VPU Decode Acceleration, now supports( MJPEG, MPEG2, H.264, HEVC/H.265 )( CEDRUS driver )
d) 3d Video Driver - Pandrost( Kernel Side )
e) Allwiner Crypto Driver
f) { IR, RTC, SPDIF } Kernel Driver test Handlers, including decoders for RAW IR( NEC, RC5(x/sz), RC6, JVC, Sony. SANYO, Sharp, MCE Keyboard/mouse, XMP )
g) Its now possible to boot, without assigning '/dev/urandom' to crng, but a dedicated TRNG driver will come, possibly on 5.6 Kernel it will possibly be merged in the next month, so expect it for 5.7 maybe....
i) PWM driver
j) PMU driver
k) disable red Led, change green to trigger [activity]

5) - Problems and testings to be done..

a) After migration to beowulf, its impossible, for now, to automount zramfs as swap, automatically.. you need to issue

swapon -a

it could be related with several packages, including those(  most probably): init init-system-helpers initscripts insserv eudev mawk sed
b) - Testing is needed, on camera interfaces { BT656, Parallel } merged in Kernel 5.4 for Allwinner Multiple aarch64 SoCs drivers sun8i-csi ..
c) - Compile V4l2 Cedrus driver, test it via libvdpau..
d) - Test IR driver shipped in Kernel 5.4 for Allwinner A64/H6..
e) - Compile UserSpace Mesa Panfrost Driver stack( userspace counterpart for kernel space one.. )
f) - USB Driver is still in PIO mode, no DMA yet, and uses some CPU, with transfers rate of ~10MB/s..
g) - Test PWM

For this image, to reach more Supported Hardware and Users, your help is also needed smile
Testing devuan-beowulf-sunxi-arm64-0.7-beta, and posting your feedback.
SHA256sum:

$ sha256sum devuan_beowulf_3.0.0_arm64_orangepi_one_plus_0.7.img.xz 
bb1ac4021a12f36b6993f71b45aee266c5e655e5c0340a1f9b26be412905fa58 devuan_beowulf_3.0.0_arm64_orangepi_one_plus_0.7.img.xz

Best Regards,
tux

Last edited by tuxd3v (2020-04-14 02:36:27)


Best Regards,
tux

Offline

Board footer