Synology DS213j

This forum is for supported devices using an ARMv7 Marvell SoC.

Synology DS213j

Postby pohl7452 » Sat Dec 02, 2023 11:47 am

I'd like to play with my Synology Diskstation DS213j and install Arch Linux Arm. Unfortunately the Marvell Armada 370 88F6707 CPU is one of the few armv7-a CPUs which is lacking support for neon fpu instructions. Hence the current armv7h build with neon enabled wouldn't boot.

[code]
/proc/cpuinfo
Processor : Marvell PJ4Bv7 Processor rev 1 (v7l)
BogoMIPS : 1196.85
Features : swp half thumb fastmult vfp edsp vfpv3 vfpv3d16 tls
CPU implementer : 0x56
CPU architecture: 7
CPU variant : 0x1
CPU part : 0x581
CPU revision : 1

Hardware : Marvell Armada-370
Revision : 0000
Serial : 0000000000000000
[/code]

I was able to debootstrap a armhf Debian rootfs and boot a Debian kernel, but this is only half the fun as I am very much hooked to Arch Linux. My question is, how difficult would it be to compile an armv7h Arch rootfs without neon support?

I got the cross toolchain compiled with crosstool-ng and a little hello world test on the original Synology DSM was successful. I also have the linux-armv7 kernel cross compiled with my custom makepkg.conf

[code]
# makepkg-arm.conf
# make sure this is in the same dir as makepkg-arm or adjust makepkg-arm
#
source /etc/makepkg.conf

CARCH="armv7h"
CHOST="arm-unknown-linux-gnueabihf"

export PATH='/home/alex/x-tools/arm-unknown-linux-gnueabihf/bin':${PATH}
export ARCH='arm'
export CROSS_COMPILE='arm-unknown-linux-gnueabihf-'

#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS=""
CFLAGS="-march=armv7-a+mp+sec -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
LTOFLAGS=""
[/code]

Combine kernel with the synology device tree and make it bootable by u-boot:
[code]
cat zImage dtbs/armada-370-synology-ds213j.dtb > zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n linux-armv7-6.2.10-1 -d zImage.fdt uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x08000000 -e 0x08000000 -n initramfs-6.2.10-1 -d initramfs-linux.img uInitrd
[/code]

From the uboot prompt TFTP boot the kernel:
[code]
setenv initrd_addr 0x03000000
setenv serverip 192.168.6.77
setenv bootargs "${console} root=PARTUUID=e0453fa9-02 rw rootwait earlycon"
dhcp
tftp ${loadaddr} ${serverip}:${image_name}
tftp ${initrd_addr} ${serverip}:${initrd_name}
bootm ${loadaddr} ${initrd_addr}
[/code]

The kernel boots but panics when executing [code]init[/code] as the current arch rootfs is compiled with neon enabled. How difficult would it be to compile at least the rootfs with a basic set of packages without neon?

References:
[url]https://archlinuxarm.org/forum/viewtopic.php?f=3&t=15721[/url]
[url]https://archlinuxarm.org/forum/viewtopic.php?t=6163[/url]
[url]https://archlinuxarm.org/forum/viewtopic.php?f=28&t=1218[/url]
pohl7452
 
Posts: 7
Joined: Wed Apr 22, 2020 5:47 am

Re: Synology DS213j

Postby graysky » Sat Dec 02, 2023 11:51 am

Doubtful:make_clickable_callback(MAGIC_URL_LOCAL, ' ', 'https://archlinuxarm.org/forum', 'viewtopic.php?f=3&t=15721', ' class="postlink-local"')
graysky
Developer
 
Posts: 1731
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Synology DS213j

Postby pohl7452 » Sat Dec 02, 2023 5:36 pm

I am aware of this forum post (see list of references). I am wondering how the current arch arm rootfs is being built? Is there a build script I could modify to remove the neon fpu and enable vfpv3-d16 instead? I guess nobody is building all the packages in the rootfs "by hand".

references:
[url]https://archlinuxarm.org/about/downloads[/url]
[url]https://archlinuxarm.org/forum/viewtopic.php?f=28&t=1218[/url]
pohl7452
 
Posts: 7
Joined: Wed Apr 22, 2020 5:47 am

Re: Synology DS213j

Postby graysky » Sat Dec 02, 2023 7:39 pm

The toolchain PKGBUILDs are available on github (glibc, gcc, etc.) You can take a look.
graysky
Developer
 
Posts: 1731
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000


Return to Marvell

Who is online

Users browsing this forum: No registered users and 2 guests