Adapted from the resource at timingcard.com with some RHEL specific additions.
Install prerequisite packages
yum install -y ncurses-devel make gcc bc bison flex elfutils-libelf-devel openssl-devel grub2 i2c-tools git patch
Clone TAP GitHub repository
cd ~/Downloads
git clone https://github.com/opencomputeproject/Time-Appliance-Project
Install the latest kernel keys
sudo dnf -y install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
dnf --enablerepo=elrepo-kernel install kernel-ml
reboot
Acquire the full kernel source from online - use ALMALinux/Oracle Linux
The wget URL and resultant file names will likely require modifying based on your hardware needs and which kernel is most current.
cd ~/Downloads
mkdir tmp; cd tmp
wget https://almalinux.pkgs.org/9/almalinux-baseos-x86_64/kernel-5.14.0-162.6.1.el9_1.src.rpm
rpm2cpio kernel-5.14.0-162.6.1.el9_1.src.rpm | cpio -idmv
cp linux-5.14.0-162.6.1.el9_1.tar.xz /usr/src/kernels
cd /usr/src/kernels
tar -xvf linux-5.14.0-162.6.1.el9_1.tar.xz
mv linux-5.14.0-162.6.1.el9_1 5.14.0-162.6.1.el9_1
ln -s 5.14.0-162.6.1.el9_1 5.14.0
rm linux-5.14.0-162.6.1.el9_1.tar.xz
cd 5.14.0
Copy existing kernel config to kernel source
cp -v /boot/config-5.14.0-162.6.1.el9.elrepo.x86_64 .config
make menuconfig
Search (using /) for the following parameters and make sure they're set appropriately:
CONFIG_MTD=m
CONFIG_MTD_SPI_NOR=m
CONFIG_SPI=y
CONFIG_SPI_ALTERA=m
CONFIG_SPI_BITBANG=m
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SPI_XILINX=m
CONFIG_I2C=y
CONFIG_I2C_OCORES=m
CONFIG_I2C_XILINX=m
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_EEPROM_AT24=m
CONFIG_PTP_1588_CLOCK_OCP=m
In Device Drivers/PTP clock support enable Opencompute Timecard as PTP Clock (Location: -> Device Drivers -> PTP clock support -> OpenCompute TimeCard as PTP clock)
In Cryptographic API/Certificates for signature checking/certs remove rhel.pem
NOTE: SKIP FOR 5.17.4 Temporary debug step as of 3-17-2022, patch the kernel with these two patches to fix issues related to FPGA SPI Flash update.
patch -p1 < ~/Time-Appliance-Project/Time-Card/DRV/0001-spi-xilinx-Inhibit-transmitter-while-filling-TX-FIFO.patch
patch -p1 < ~/Time-Appliance-Project/Time-Card/DRV/0001-spi-nor-Send-soft-reset-before-probing-flash.patch
Build and install this kernel
(amend -j12 to whatever an appropriate number of threads/cores you wish)
make bzImage -j12; make modules -j12; make -j12; make INSTALL_MOD_STRIP=1 modules_install; make install;
Reboot
reboot
Enable all UART peripherals
grubby --update-kernel=ALL --args=8250.nr_uarts=8
reboot
Confirm enumeration of all enabled UART peripherals on next reboot
cat /proc/cmdline
BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.16.0 root=/dev/mapper/cs-root ro crashkernel=auto resume=/dev/mapper/cs-swap rd.lvm.lv=cs/root rd.lvm.lv=cs/swap rhgb quiet 8250.nr_uarts=8
Install drivers from Time Appliance Project repository
cd ~/Downloads/Time-Appliance-Project/Time-Card/DRV/
Edit the script to look something like:
case "$DIST" in
debian*|ubuntu)
KDIR=/usr/src/linux-headers-${KVER}
;;
redhatenterpriselinux)
KDIR=/usr/src/kernels/${KVER}
;;
esac
Run the remake script
./remake
modprobe ptp_ocp
Follow the remaining steps from the guide at timingcard.com to verify the installation.