How Do I add New ethernet device to Kernel Config file - linux-kernel

I wanted to add a new device for Kernel compiled for vexpress board.I would want to see new device option should come under meuconfig program.
make ARCH=arm versatile_defconfig
make ARCH=arm menuconfig
I would want to see TI device support under --Ethernet Driver Support under menuconfig.
Also doing so would allow me to compile .o files related TI driver code provided in Linux kernel?
EDIT: I have added two snapshots of vexpress menuconfig and Keystone menuconfig,I would want to have support for TI devices in vexpress meuconfig which is second snapshot here.

You can edit file: .../drivers/net/Kconfig and add there your entry for enabling TI device:
config TI_ETHER_NET
tristate "TI Ethernet support"
depends on PCI
help
This is my driver for TI device
and then copy your drivers source into .../drivers/net/ and add appropriate entry to Makefile in this directory:
obj-$(CONFIG_TI_ETHER_NET) += your_driver.o

Related

buildroot raspberrypi3_defconfig how to enable SPI?

I'm trying to make a RPI3 buildroot image with CAN interface.
So far I don't see any device in /sys/bus/spi/devices
Please help
What I did are below
At the buildroot terminal "make raspberrypi3_defconfig" then enabled those below via "make xconfig" and "make linux-xconfig"
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV
BR2_PACKAGE_IPROUTE2
NET
CAN
CAN_DEV
SPI
CAN_MCP251X
After that I flashed sdcard.img to an SD card then I add those two lines below to config.txt
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25
I expected to see spi0.0 but I don't see any device in /sys/bus/spi/devices
Can you please help?
Thank you

adding RT PRMEEPT_rt patch in imx6ullevk and building yocto rootfs using core-image-rt-sdk in yocto toaster

im using imx6ull , where i need to enable prmeept_rt patch, i have enabled
--->General setup
-->(X) Fully Preemptible Kernel (Real-Time)
in Linux kernel 5.4.3 by using patch-5.4.3-rt1.patch.xz and created kernel image and i tried to boot the board with rootfs build (poky branch is kirkstone) using core-image-minimal image recipe it was not providing me root access ,
So i tried to build another rootfs (poky branch is kirkstone) using core-image-rt-sdk image recipe in yocto toaster it is showing error. as
Nothing PROVIDES 'core-image-rt-sdk'
core-image-rt-sdk was skiped : Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it
how to build rootfs using core-image-rt-sdk image recipe .
any suggestions will be more help full

Why Xorg server fails on system created with Buildroot for Raspberry Pi4?

I am trying to create my own system for Raspberry Pi4 using Buildroot.
Target is to make custom OS with Xorg, Qt5 and OpenGLESv2 HW rendering. I create my custom Buildroot configuration, nothing specific yet. Very similar to default raspberry pi4 buildroot config but enabled Xorg/Mesa/OpenGLES. My config is that:
BR2_arm=y
BR2_cortex_a72=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_CCACHE=y
BR2_CCACHE_DIR="$(BR2_EXTERNAL_I_TREE_PATH)/../.buildroot-ccache"
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="MyHost"
BR2_TARGET_GENERIC_ISSUE="Welcome to MyHost"
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_TARGET_GENERIC_ROOT_PASSWD="4rt56gbd"
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/users.txt"
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_I_TREE_PATH)/rootfs_overlay/"
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="--add-miniuart-bt-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,967d45b29ca2902f031b867809d72e3b3d623e7a)/linux-967d45b29ca2902f031b867809d72e3b3d623e7a.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX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IA_100DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_75DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_TYPE1=y
BR2_PACKAGE_XFONT_FONT_ARABIC_MISC=y
BR2_PACKAGE_XFONT_FONT_BH_100DPI=y
BR2_PACKAGE_XFONT_FONT_BH_75DPI=y
BR2_PACKAGE_XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI=y
BR2_PACKAGE_XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI=y
BR2_PACKAGE_XFONT_FONT_BH_TTF=y
BR2_PACKAGE_XFONT_FONT_BH_TYPE1=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_100DPI=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_75DPI=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_TYPE1=y
BR2_PACKAGE_XFONT_FONT_CRONYX_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_DAEWOO_MISC=y
BR2_PACKAGE_XFONT_FONT_DEC_MISC=y
BR2_PACKAGE_XFONT_FONT_IBM_TYPE1=y
BR2_PACKAGE_XFONT_FONT_ISAS_MISC=y
BR2_PACKAGE_XFONT_FONT_JIS_MISC=y
BR2_PACKAGE_XFONT_FONT_MICRO_MISC=y
BR2_PACKAGE_XFONT_FONT_MISC_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_MISC_ETHIOPIC=y
BR2_PACKAGE_XFONT_FONT_MISC_MELTHO=y
BR2_PACKAGE_XFONT_FONT_MUTT_MISC=y
BR2_PACKAGE_XFONT_FONT_SCHUMACHER_MISC=y
BR2_PACKAGE_XFONT_FONT_SCREEN_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_SONY_MISC=y
BR2_PACKAGE_XFONT_FONT_SUN_MISC=y
BR2_PACKAGE_XFONT_FONT_WINITZKI_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_XFREE86_TYPE1=y
BR2_PACKAGE_XDATA_XCURSOR_THEMES=y
BR2_PACKAGE_NODM=y
BR2_PACKAGE_XTERM=y
BR2_PACKAGE_OPENBOX=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_X=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_LIBDRI2=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_S6=y
BR2_PACKAGE_S6_LINUX_UTILS=y
BR2_PACKAGE_S6_PORTABLE_UTILS=y
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
BR2_PACKAGE_UTIL_LINUX_KILL=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
First issue comes with X server.
It starts working but very strange/ubnormal. Xorg logs show me lines:
(II) xfree86: Adding drm device (/dev/dri/card1)
(II) xfree86: Adding drm device (/dev/dri/card0)
(II) no primary bus or device found falling back to sys/devices/platform/gpu/drm/card1
But on normal Raspbian OS X server first adds card0 then card1. And makes fall back to card0. Why my Xorg starts with card1?
I think this is my main issue, because of that later GLX extension does not start. And so I cannot make OpenGLES working in my system.
In my config.txt i have line
dtoverlay=vc4-fkms-v3d
and I belive vc4 drivers start properly because I see /dev/dri/card0 /dev/dri/card1 and /dev/dri/renderD128 devices
Maybe someone had similar experience?
What I am doing wrong?
My fault in question.
I was wrong that issue was in order of /dev/dri/card? adding by Xorg.
Issue was different. xserver built in buildroot needs libglamor enabled? this should be enabled in buildroot config. If enabled then es2_info reports no issue with OpenGLES.. besides that in my case still glmark2-es2 does not work with error "Failed to open bo 1: Permission denied"

Linux dynamic kernel loading with overloading device tree

I want to make my own protocol driver for my custom made spi board. The platform on which I want to attach it is a raspberry Pi4 with arm32. I want to load it dynamically with an overlay device tree.
I can build the driver file but the following isn't clear:
Where should the driver exactly placed? I tried /lib/modules/5.4.79-v7, /lib/modules/5.4.79-v7/build
I made in the config.txt an entry dtoverlays= driver.ko and placed the dtbo under /boot/overlays. Is this correct?
Can the driver be loaded at runtime without a second reboot after I placed the overlay file in the right folder.
Is the driver first loaded if the function "spi_new_device" is called or can it be done in this way?
If I call sudo insmod .ko the driver is loaded with:
rpi4: loading out-of-tree module taints kernel.
The probe function isn't called yet.
Where should the driver exactly placed? I tried /lib/modules/5.4.79-v7, /lib/modules/5.4.79-v7/build
Answer: The driver is placed under /lib/modules/5.4.79-v7/extra if it is an extra module and build with.
make -C /lib/modules/`uname -r`/build M=$PWD modules_install
I made in the config.txt an entry dtoverlays= driver.ko and placed the dtbo under /boot/overlays. Is this correct?
Answer: It can be done in this way with rpi.
Can the driver be loaded at runtime without a second reboot after I placed the overlay file in the right folder.
Answer: If the driver is installed under extra it is not loaded. Also it is not loaded after reboot. The driver must be loaded with "modprobe" but without the extension ".ko". Modprobe search the driver under lib/modules.

why buildroot fails to make the .config?

I'm somehow new to buildroot makefile and I created my own configuration file for a new operating system. After typing
make menuconfig
I saw that the buildroot has made the .config file. but when I type
make
it gives the following error:
linux/linux.mk:69: *** No kernel device tree source specified, check your BR2_LINUX_KERNEL_USE_INTREE_DTS / BR2_LINUX_KERNEL_USE_CUSTOM_DTS settings. Stop.
what does it mean ? what did I forget to include in buildroot configuration menu ?
I searched the internet and didn't find anything useful ... I've looked at the build root documentation and didn't find anything neither ....
In addition to the buildroot .config, you need a linux config. You can create one by:
make linux-menuconfig
See:
How do I configure the Linux kernel within Buildroot?
http://buildroot.org/downloads/manual/manual.html#kernel-custom
Which board do you plan to run the produced image on? Which platform are you building for? Check the output of the following command:
grep ^BR2_ARCH .config
If it is i386 or x86_64, you likely do not need Device Tree support, so just disable it using make menuconfig (search for BR2_LINUX_KERNEL_USE_INTREE_DTS or BR2_LINUX_KERNEL_USE_CUSTOM_DTS by pressing /).
Also check out http://elinux.org/Device_Tree for a detailed description of Device Tree.
It means that you don't have a device tree source file set. There's several different reasons for this. The first thing to check is:
make menuconfig
Select the Kernel options. Near the bottom is the option for "Device tree source". If that's set to "Use a custom device tree file" and you don't have a good path set in the next option, "Device Tree Source file paths", then you will get this error. Alternatively, if it's set to "Use a device tree present in the kernel" and the "Device Tree Source file names" option is blank or the name(s) have .dts at the end, you may get this error.

Resources