laurentiuduca / rtnet-preempt_rt

8 stars 2 forks source link

Compiling for beaglebone black fails #1

Closed NikolaSzucsich closed 1 year ago

NikolaSzucsich commented 1 year ago

Hi,

I'm trying to cross compile a linux kernel for beaglebone black, but when I run make -j`nproc` ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CONFIG_DEBUG_INFO=y INSTALL_MOD_PATH=../rtnet/modules zImage am335x-boneblack.dtb modules, the compilation fails at the RTnet TI CPSW driver:

In file included from net/rtnet/drivers/ticpsw/cpsw.c:49:
net/rtnet/drivers/ticpsw/cpts.h:118:2: error: unknown type name ‘rtdm_lock_t’
  118 |  rtdm_lock_t lock; /* protects time registers */
      |  ^~~~~~~~~~~
net/rtnet/drivers/ticpsw/cpts.h:120:22: error: field ‘cc’ has incomplete type
  120 |  struct cyclecounter cc;
      |                      ^~
net/rtnet/drivers/ticpsw/cpts.h:121:21: error: field ‘tc’ has incomplete type
  121 |  struct timecounter tc;
      |                     ^~
net/rtnet/drivers/ticpsw/cpsw.c: In function ‘cpsw_hwtstamp_v1’:
net/rtnet/drivers/ticpsw/cpsw.c:1002:54: error: ‘struct cpsw_platform_data’ has no member named ‘cpts_active_slave’; did you mean ‘active_slave’?
 1002 |  struct cpsw_slave *slave = &priv->slaves[priv->data.cpts_active_slave];
      |                                                      ^~~~~~~~~~~~~~~~~
      |                                                      active_slave
net/rtnet/drivers/ticpsw/cpsw.c: In function ‘cpsw_hwtstamp_v2’:
net/rtnet/drivers/ticpsw/cpsw.c:1025:54: error: ‘struct cpsw_platform_data’ has no member named ‘cpts_active_slave’; did you mean ‘active_slave’?
 1025 |  struct cpsw_slave *slave = &priv->slaves[priv->data.cpts_active_slave];
      |                                                      ^~~~~~~~~~~~~~~~~
      |                                                      active_slave
net/rtnet/drivers/ticpsw/cpsw.c: In function ‘cpsw_probe_dt’:
net/rtnet/drivers/ticpsw/cpsw.c:1372:25: error: too few arguments to function ‘of_get_phy_mode’
 1372 |    slave_data->phy_if = of_get_phy_mode(slave_node);
      |                         ^~~~~~~~~~~~~~~
In file included from net/rtnet/drivers/ticpsw/cpsw.c:44:
./include/linux/of_net.h:15:12: note: declared here
   15 | extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);
      |            ^~~~~~~~~~~~~~~
At top level:
net/rtnet/drivers/ticpsw/cpsw.c:1044:12: warning: ‘cpsw_hwtstamp_ioctl’ defined but not used [-Wunused-function]
 1044 | static int cpsw_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
      |            ^~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:283: net/rtnet/drivers/ticpsw/cpsw.o] Error 1
make[3]: *** [scripts/Makefile.build:500: net/rtnet/drivers/ticpsw] Error 2
make[2]: *** [scripts/Makefile.build:500: net/rtnet/drivers] Error 2
make[1]: *** [scripts/Makefile.build:500: net/rtnet] Error 2

Unfortunately I can't find the typedef of rtdm_lock_t.

I'm using Debian 5.10.162-1 (2023-01-21) with Kernel 5.10.0-21-amd64 to do the compilation. I followed your guide and used make ARCH=amd menuconfig to apply the kernel configuration changes. The only thing I could not toggle was ACPI Support because it does not exist.

Thank you in advance!

Best regards, Nikola

laurentiuduca commented 1 year ago

Hello,

Type rtdm_lock_t is defined only in xenomai 3 rtnet, not on rtnet-preempt_rt. I do not remember exactly, but reading again, I see that the driver for bbb is not ported to rtnet-preempt_rt; to port it one should change rtdm with equivalent preempt_rt linux kernel data structures.

However this driver is too old an obsolete so I will remove bbb from rtnet-preempt_rt. Thanks for the issue.