Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPS patch 2 fails #13

Open
willis936 opened this issue Feb 17, 2021 · 2 comments
Open

PPS patch 2 fails #13

willis936 opened this issue Feb 17, 2021 · 2 comments

Comments

@willis936
Copy link

willis936 commented Feb 17, 2021

I am following this guide:

https://github.com/twteamware/raspberrypi-ptp/blob/master/pps-generator.md

I’m running a raspberry pi 4 and have the 5.10.16 kernel cloned (branch rpi-5.10.y, commit raspberrypi/linux@99f6839). Applying 0001-pps-add-gpio-PPS-signal-generator.patch succeeds but 0002-add-DT-overlay-for-pps-gen-gpio-generator.patch fails.

$ git am ../raspberrypi-ptp/patches/0002-add-DT-overlay-for-pps-gen-gpio-generator.patch
Applying: add DT overlay for pps-gen-gpio generator
error: patch failed: arch/arm/boot/dts/overlays/Makefile:83
error: arch/arm/boot/dts/overlays/Makefile: patch does not apply
Patch failed at 0001 add DT overlay for pps-gen-gpio generator
$ git am --show-current-patch
From 2e9ca9cc2fc94222c750e37f7f7a36b6643ebccd Mon Sep 17 00:00:00 2001
From: Andrea Galbusera <[email protected]>
Date: Tue, 20 Feb 2018 09:38:28 +0000
Subject: [PATCH 2/2] add DT overlay for pps-gen-gpio generator

Signed-off-by: Andrea Galbusera <[email protected]>
---
 arch/arm/boot/dts/overlays/Makefile                |  1 +
 .../arm/boot/dts/overlays/pps-gen-gpio-overlay.dts | 35 ++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 arch/arm/boot/dts/overlays/pps-gen-gpio-overlay.dts

diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
index eae6a665..5ffffbe6 100644
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -83,6 +83,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        pitft28-resistive.dtbo \
        pitft35-resistive.dtbo \
        pps-gpio.dtbo \
+       pps-gen-gpio.dtbo \
        pwm.dtbo \
        pwm-2chan.dtbo \
        qca7000.dtbo \
diff --git a/arch/arm/boot/dts/overlays/pps-gen-gpio-overlay.dts b/arch/arm/boot/dts/overlays/pps-gen-gpio-overlay.dts
new file mode 100644
:

https://github.com/twteamware/raspberrypi-ptp/blob/master/patches/0002-add-DT-overlay-for-pps-gen-gpio-generator.patch

@willis936
Copy link
Author

Here is a copy of the script I made that implements this repo.

#!/bin/bash
# Download/compile raspberry pi 4 kernel with PTP
# https://github.com/twteamware/raspberrypi-ptp/

# source directory
SRCDIR=/srv
KERNELBRANCH=rpi-5.10.y
KERNEL=kernel7l
BCMVER=2711

# install necessary packages
apt -y update
apt -y upgrade
apt install -y git bc bison flex libssl-dev make ethtool linuxptp libncurses5-dev

# configure linuxptp
sed -i -e 's/time_stamping.*$/time_stamping\t\tsoftware/' /etc/linuxptp/ptp4l.conf

# download/update PTP
cd $SRCDIR
git clone https://github.com/twteamware/raspberrypi-ptp
cd $SRCDIR/raspberrypi-ptp
git pull
git reset --hard

# download/update the kernel source
cd $SRCDIR
git clone --depth=1 https://github.com/raspberrypi/linux
cd $SRCDIR/linux
git checkout $KERNELBRANCH
git pull
# clean up
make distclean
git branch -D pps-generator-patches
git reset --hard

# initial config
make bcm$[BCMVER]_defconfig

# apply PPS output patches
git checkout -b pps-generator-patches
git config user.email "[email protected]"
git config user.name "pi"
git am $SRCDIR/raspberrypi-ptp/patches/0001-pps-add-gpio-PPS-signal-generator.patch
git am $SRCDIR/raspberrypi-ptp/patches/0002-add-DT-overlay-for-pps-gen-gpio-generator.patch

# PTP support
echo 'CONFIG_NETWORK_PHY_TIMESTAMPING=y' >> .config
echo 'CONFIG_PTP_1588_CLOCK=y' >> .config

# PPS output
echo 'CONFIG_PPS_GENERATOR_GPIO=y' >> .config

# apply config changes
make olddefconfig

# compile
make -j4 zImage modules dtbs

# backup kernel
rsync -a --delete /boot /bootBACKUP

# update kernel
make modules_install
cp arch/arm/boot/dts/*.dtb /boot/
cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
cp arch/arm/boot/dts/overlays/README /boot/overlays/
cp arch/arm/boot/zImage /boot/$KERNEL.img

# clean up
git checkout $KERNELBRANCH
git branch -D pps-generator-patches
make distclean
git reset --hard

@JackWinch
Copy link

I'm not sure why this patch fails to apply. If so required, I could take a look.

However, this project is not compatible with the 5.10 kernel, as it makes use of now deprecated and removed components of the in-kernel API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants