====== Ten64 ======
The [[https://traverse.com.au/products/ten64-networking-platform/|Ten64 networking platform]] is a product by Traverse Technologies and they kindly provided me with a full system.
It's a NXP LS1088a based platform featuring DPAA2 [[https://github.com/mcusim/freebsd-src/commits/lx2160acex7-dev|(FreeBSD driver development)]] support with 8xGE + 2xSFP+, USB3, multiple mPCIe slots, ..
See their [[https://ten64doc.traverse.com.au/|excellent documentation]] for all the details.
//insert nice photos of the machine here//
Traverse Technologies recently published a [[https://forum.traverse.com.au/t/freebsd-preview-for-ten64/173|FreeBSD preview for Ten64]] image.
I am just jotting down my notes regarding %%FreeBSD%% support here.
===== Current status (20220921) =====
* FDT support for MDIO for GE0-7 (copper ports) was developed for [[/DmitrySalychev|DmitrySalychev]]'s DPAA2 driver [[https://github.com/mcusim/freebsd-src/pull/16|DPAA2: FDT MDIO support #16 pull request]]
* %%FreeBSD%% is lacking (generic) SFP+ FDT support currently; to be added another day.
* Support for the PCA9540 I2C MUX for the SFP+s was done: [[https://reviews.freebsd.org/D35701|Review D35701]] [[https://cgit.FreeBSD.org/src/commit/?id=97dbd37753ae1bf9c4f6a23e46e21f0a9f408c82|commit to main]] and [[https://cgit.FreeBSD.org/src/commit/?id=ab82f64eb5b3f23beee5610a2ce8d1fdb4732522|commit to stable/13]].
* LS1088a clockgen support was developed [[https://reviews.freebsd.org/D35617|FreeBSD review D35617]] [[https://cgit.freebsd.org/src/commit/?id=8154df37a55948aca8358ade68b659d1aa71b755|commit to main]] [[https://cgit.FreeBSD.org/src/commit/?id=ce28b75973d14af0203cf69115cbaa3f7f604bf7|commit to stable/13]] and helps:
* SD card probes properly. I tested with MMCCAM and reading the SD card was fine.
* Mathew %%McBride%%'s ds1307 extensions for the Epson RX-8035 is out-of-tree work in progress. Compiling the ''%%device ds1307%%'' into the kernel or loading the module from loader seems to make things happy.
* If loaded as module from multi-user we do not get the time set even if manually triggering a ''%%sysctl debug.clock_do_io=1%%''. Reason for this is that ''%%vfs_moutroot()%%'' is responsible to have the clock set and calls ''%%CLOCK_GETTIME()%%'' indirectly so that log files or other timestamps do not appear to go backwards (if no RTC is found it'll use the vfs root node date?). Look for the ''%%inittodr()%%'' call.
* There seems to be still an issue restoring hours; I lost 8 of them over night ... to be investigated. Matt might have solved this.
* [[https://reviews.freebsd.org/D35837|Review D35837]] for RTC. [[https://cgit.FreeBSD.org/src/commit/?id=2486b446db8270a7d6dc7f3c6df0a88c4745b527|commit to main]] [[https://cgit.FreeBSD.org/src/commit/?id=eff466bc5eaa6aa9b290cb7957807a0dbd9905ce|MFC to stable/13]]
* SSD seems to work fine
* USB3 and PCIe (M.2) put something in each and was detected flawlessly.
* We need more I2C mux bits for SFP and Admin LED from what I can see. Should be quick to do.
* First one done (see PCA9540 above)
* Second one (ti,tca9539) here [[https://reviews.freebsd.org/D35702|Review D35702]] [[https://cgit.FreeBSD.org/src/commit/?id=c4b98101c5b1dc34d077f078d04d777df3cf9e38|commit to main]] [[https://cgit.FreeBSD.org/src/commit/?id=74c7b2d74adfaa8f95bc502a42daa56aebf91f2b|commit to stable/13]] gives you Admin led support (and other bits); need to compile into the kernel or load from loader it seems ... try this: ''%%sh -c 'while : ; do echo "0" > /dev/led/ten64:admin && sleep 1 && echo "1" >> /dev/led/ten64:admin && sleep 3; done'%%'' will turn the LED off for 1s and then on for 3s. Look at [[https://www.freebsd.org/cgi/man.cgi?query=led&sektion=4|led(4)]] for more ideas like morse ...
* Optional and only //nice to have// would be proper [[https://ww1.microchip.com/downloads/en/DeviceDoc/VMDS-10423.pdf|VSC8514]] mii support.
I need to go and see what else then. ''%%soctherm%%'' timeouts probably? That's WIP now. [[https://reviews.freebsd.org/D35759|Review D35759]] limits the number of sites to the values found in device-tree for the %%SoC%% as a first step. Next is to deal with the differences of the [[/SoCs|SoCs]], [[https://reviews.freebsd.org/D35764|Review D35764]]. [[https://cgit.FreeBSD.org/src/commit/?id=394453302bca7a5147db126ce01a3497eb3415f7|commit 1 to main]] and [[https://cgit.FreeBSD.org/src/commit/?id=fe88072dc69fcd64b42d8512ad214c0fe009ad8e|commit 2 to main]], [[https://cgit.FreeBSD.org/src/commit/?id=b3189b3295d6bd2342001c35dacb24ac6365dc2b|commit to stable/13]], [[https://cgit.FreeBSD.org/src/commit/?id=0aa629f69dbe9b78aac2c008fdb0e8201b782154|commit to stable/13]].
hw.temperature.core-cluster: 58.0C
hw.temperature.soc: 57.0C
root@ten64-01:~ # sysctl hw.temperature
hw.temperature.core-cluster: 55.0C
hw.temperature.soc: 55.0C
''%%uart0: console (115131,n,8,1)%%'' - where does this odd value come from?
Here's a list of device compat strings, not disabled, with no driver attached:
1 arm,mmu-500 (no driver attached) -- iommu
8 arm,sp805-wdt (no driver attached)
1 fsl,dpaa2-console (no driver attached) -- I got code for DDB for this already
1 fsl,dpaa2-ptp (no driver attached)
1 fsl,ls1088a-ftm-alarm (no driver attached)
1 fsl,ls1088a-rcpm (no driver attached)
1 fsl,sec-v5.0 (no driver attached)
1 gpio-keys (no driver attached)
* Fan control: [[https://ten64doc.traverse.com.au/hardware/fan-control/|EMC2301]] support but I have not idea how on %%FreeBSD%% we would link the temperature //thermal-zones// information an fan control etc. all together. powered?
* More of the [[https://ten64doc.traverse.com.au/hardware/i2c/|I2C]] devices.
===== How to switch between MDIO and FIXED for interfaces =====
If you want to make use of link-state and media information and be able to set it for the 8 GE ports you want to follow the [[https://ten64doc.traverse.com.au/network/managementmodes/|documentation]] and do the following in the U-Boot console once:
env delete gbemode
saveenv
reset
You do **not** want to do the same for ''%%sfpmode%%'' just yet until %%FreeBSD%% grows FDT/SFP support.
===== How to netboot =====
I am not sure what the proper method is but I ended up adjusting the U-Boot menu and added a ''%%run setup_distroboot_efi && %%'' before the ''%%run dhcp%%'' which makes sure all the bits needed for DPAA2 are loaded.