糸川直樹 / ITOKAWA,NAOKI
2016-12-22 17:02:53 UTC
Hello,
I could make ptp4l working on Raspberry Pi, then I'd like to write about it.
- Raspberry Pi 3 Model B
- write image of Raspbian Jessie with Pixel to microSD
- installed linuxPTP v1.8
- installed ethtool
*** Rebuilding kernel configuration ***
(1) Make directory of kernel
$ cd
$ mkdir kernel
$ cd kernel
(2) Download kernel
$ git clone --depth=1 https://github.com/raspberrypi/linux
$ sudo apt-get update
$ sudo apt-get install bc
(3) Configuration of kernal
$ cd linux
$ KERNEL=kernel7
$ make bcm2709_defconfig
(4) Configuration with menuconfig
$ sudo apt-get install libncurses5-dev
$ make menuconfig
Activate following three configuration with "menu-config"
CONFIG_PPS
CONFIG_NETWORK_PHY_TIMESTAMPING
PTP_1588_CLOCK
Save configuration.
(5) Modify ethernet driver
Search "drivers/net/usb/smsc95xx.c", and edit it with vi editor.
Add a sentence " .get_ts_info = ethtool_op_get_ts_info,"
to end of " smsc95xx_ethtool_ops = "
static const struct ethtool_ops smsc95xx_ethtool_ops = {
.get_link = usbnet_get_link,
.nway_reset = usbnet_nway_reset,
.get_drvinfo = usbnet_get_drvinfo,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
.get_settings = smsc95xx_get_settings,
.set_settings = smsc95xx_set_settings,
.get_eeprom_len = smsc95xx_ethtool_get_eeprom_len,
.get_eeprom = smsc95xx_ethtool_get_eeprom,
.set_eeprom = smsc95xx_ethtool_set_eeprom,
.get_regs_len = smsc95xx_ethtool_getregslen,
.get_regs = smsc95xx_ethtool_getregs,
.get_wol = smsc95xx_ethtool_get_wol,
.set_wol = smsc95xx_ethtool_set_wol,
.get_ts_info = ethtool_op_get_ts_info,
};
(6) Name extraversion of rebuilding kernel
$ cd ~/kernel/linux
$ vi Makefile
edit extraversion in Makefile such as;
EXTRAVERSION = ptprpi
(7) Building kernel
$ make -j4 zImage modules dtbs
$ sudo make modules_install
$ sudo cp arch/arm/boot/dts/*.dtb /boot/
$ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
$ sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
$ sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img
(8) Reboot in new kernel
$ sudo shutdown -r now
----------------------------
In my case, ptp4l on rpi has become working with these procedure.
Thank you.
Best Regards,
Naoki Itokawa
I could make ptp4l working on Raspberry Pi, then I'd like to write about it.
- Raspberry Pi 3 Model B
- write image of Raspbian Jessie with Pixel to microSD
- installed linuxPTP v1.8
- installed ethtool
*** Rebuilding kernel configuration ***
(1) Make directory of kernel
$ cd
$ mkdir kernel
$ cd kernel
(2) Download kernel
$ git clone --depth=1 https://github.com/raspberrypi/linux
$ sudo apt-get update
$ sudo apt-get install bc
(3) Configuration of kernal
$ cd linux
$ KERNEL=kernel7
$ make bcm2709_defconfig
(4) Configuration with menuconfig
$ sudo apt-get install libncurses5-dev
$ make menuconfig
Activate following three configuration with "menu-config"
CONFIG_PPS
CONFIG_NETWORK_PHY_TIMESTAMPING
PTP_1588_CLOCK
Save configuration.
(5) Modify ethernet driver
Search "drivers/net/usb/smsc95xx.c", and edit it with vi editor.
Add a sentence " .get_ts_info = ethtool_op_get_ts_info,"
to end of " smsc95xx_ethtool_ops = "
static const struct ethtool_ops smsc95xx_ethtool_ops = {
.get_link = usbnet_get_link,
.nway_reset = usbnet_nway_reset,
.get_drvinfo = usbnet_get_drvinfo,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
.get_settings = smsc95xx_get_settings,
.set_settings = smsc95xx_set_settings,
.get_eeprom_len = smsc95xx_ethtool_get_eeprom_len,
.get_eeprom = smsc95xx_ethtool_get_eeprom,
.set_eeprom = smsc95xx_ethtool_set_eeprom,
.get_regs_len = smsc95xx_ethtool_getregslen,
.get_regs = smsc95xx_ethtool_getregs,
.get_wol = smsc95xx_ethtool_get_wol,
.set_wol = smsc95xx_ethtool_set_wol,
.get_ts_info = ethtool_op_get_ts_info,
};
(6) Name extraversion of rebuilding kernel
$ cd ~/kernel/linux
$ vi Makefile
edit extraversion in Makefile such as;
EXTRAVERSION = ptprpi
(7) Building kernel
$ make -j4 zImage modules dtbs
$ sudo make modules_install
$ sudo cp arch/arm/boot/dts/*.dtb /boot/
$ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
$ sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
$ sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img
(8) Reboot in new kernel
$ sudo shutdown -r now
----------------------------
In my case, ptp4l on rpi has become working with these procedure.
Thank you.
Best Regards,
Naoki Itokawa