FreeBSD on AmigaOne X5000

Justin Hibbits jrh29 at alumni.cwru.edu
Thu Jan 18 17:11:23 UTC 2018


Hi Al,

FreeBSD runs pretty well on the AmigaOne X5000, but there are some
gotchas right now.  It needs a minor change to the dts in order to use
the ethernet controller, and you currently have to make an
execute-in-place uImage, for 64-bit kernels anyway.

The former is impossible to work around, because the device tree is
just incorrect with regard to the PHY hookups (it lists TBI
connections, but the AmigaOne X5000 uses rgmii, which puts all
connections through dtsec0's mdio).  You can find my working device
tree at https://people.freebsd.org/~jhibbits/cyrus_p5020_amiga2.dtb .

The latter I'm currently working on, and plan to have ubldr loading
64-bit kernels in the next couple weeks, so we won't need to build
uImages.  But, for now, the way I do it is:

buildkernel with KERNCONF=QORIQ64

Using NetBSD's 'mkubootimage' (easy enough to build on FreeBSD with
some minor tweaks to the source), run:

mkubootimage -A powerpc -C none -T kernel -O linux -a 0x3ffffc0 -e
<entrypoint from readelf -h> -N "FreeBSD AmigaOne X5000"
amiga64.uImage /path/to/built/kernel

Then I can boot that image via either dhcp or sata (Be sure to load it
to 0x3ffffc0, for some reason uboot doesn't copy the image when loaded
to the default loadaddr of 0x01000000).

Booting from SATA you need to create an MBR partition scheme, and the
first partition must be FAT, since uboot doesn't know how to read
FreeBSD disklabels and UFS.  I made two partitions: 128MB FAT to put
the kernel, ubldr, and dtb; and the rest of my disk is a BSD disklabel
volume, partitioned like a normal FreeBSD system.  You would put the
dtb and uImage in the FAT partition, and set the uboot bootargs
environment variable to 'vfs.root.mountfrom=ufs:/dev/ada0s2a'
(assuming /dev/ada0s2a is the root you create, as my example is)


As for what you can do to help, that depends on your skill set.

If you're happy in the kernel:
* I have some patches to drm2 so it can load the radeonkms driver, but
it crashes due to TLB synchronization issues between the two cores,
that might be interesting to look at.
* Performance improvements:  CPU0 is seeing a very high decrementer
interrupt count, measured with vmstat -i.  I think this might be uboot
messing up the clock frequency information populating, but I'm not
sure.  Maybe test that.
* There are still device drivers missing for things like the XMOS and CPLD.

If you'd prefer userspace, once you have FreeBSD installed, and able
to use the network:
* Build a kernel with ZFS (just add "options ZFS" to the QORIQ config,
or create your own), and test building everything with poudriere.
Report any bugs and panics you see.  Just hammer away.
* It's pretty boringly stable up in userspace, so it's hard for me to
think of anything more.

Let me know what you're interested in, and I can point you to
somewhere you can help.

Glad to see interest in this!

- Justin

On Wed, Jan 17, 2018 at 5:20 PM, Al Zick <al at familysafeinternet.com> wrote:
> Hi,
>
> Would it be possible to find out about how much progress has been made on
> the FreeBSD port to the AmigaOne X5000 in the last few months and if there
> is anything that I can do to help?
>
> Kind Regards,
> Al
>
>
> _______________________________________________
> freebsd-ppc at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
> To unsubscribe, send any mail to "freebsd-ppc-unsubscribe at freebsd.org"


More information about the freebsd-ppc mailing list