I use and build a kernel 4.14 which is already running on a ARM processor.
Now I would include the MCP23S08 driver (pinctrl-mcp23s08.c)
For that, I use make menuconfig to enable the driver. Unfortunately, I could not find an entry for the Pin Control subsystem in which the driver should be.
For testing, I checked out the kernel 4.17 in which the entry Device Driver->Pin Controlls exist. According to the entry in LKDD I think something changed in the configuration method between kernel 4.14 and 4.15.
Does someone now, how to activate the Pin Control subsystem in kernel 4.14? Thank you for any hint!
Ok, I found a way to enable the Pin control subsystem:
At least in that kernel version (4.14) the pin control subsystem is a machine configuration. I activated it in the /arch/arm/mach-*/Kconfig file. After that, the entry was shown in the kernel menuconfig.
Related
Helo All,
I am trying to learn embedded linux.
Please provide clarity on below:
As DTB provides Board and SOC related information will it be sufficient to make sure correct drivers will be enabled?
How a correct driver will get selected and will it happen during build time or kernel runtime based on the DTB?
How are drivers for platform devices(UART, SPI, I2C etc) handled in Linux? I mean as different SOC's have different implementations(register and bit fields will be different) of these peripherals how a single driver will be able to handle both SOC's?
Is it sufficient to have well defined DTB about board and kernel to make Linux up and running on any platform.
Thanks,
Suraj
I have a arm board, I connect it with my linux (host) system via a wire. I insert sd card with vmlinux.uimg in the arm processor and use minicom on host system. Now I want to debug vmlinux on arm board using gdb. What all thing I need to do? I tried using gdbserver on minicom and gdb on host. But I don't know how exactly it work... Where should I copy vmlinux and how should I debug...
Complete answers depend on your Linux version, development and target setup. Here are some research links,
gdb kernel debugging
kgdb, kgdb docbook or formatted docbook
You need to configure your kernel with KGDB support and you can use the console as a link to control KGDB from your development machine. You need copies of the vmlinux object files on the development machine; easy if it is also the build machine. There are script for GDB to access handy information in the kernel. This is the info in the GDB kernel debugging link.
You do not use gdbserver; this is for user space linux processes. The tool for debugging the kernel is kgdb and this requires code to be put into the kernel. Normally the program gdbserver is using kernel facilities to control a process. This won't work for the kernel itself.
It is possible that not all serial ports will support kgdb. Some versions of Linux allowed kgdb over the network. However, it is not present in as many kernels as the serial port. You can activate kgdb over serial with a kernel parameter kdbgoc, sysfs or magic sysreq. Some devices (and Linux versions) may have support for JTAG type kgdb.
I am compiling my own Linux kernel and userland tools for a PXE environment meant for cloning and reimaging. Right now, I'm sticking to a specific kernel version and using preconfigured .config's for building the Linux kernel.
I need to change from using preconfigured .config's to automatically generating the default configuration for the specified architecture, and then enabling all ethernet, ATA, SATA, and SCSI drivers.
The reason I want to do this is:
Updating the kernel means updating the preconfigured .config's, which takes too much time to manually do. The way I'm doing it now is using menuconfig, enabling the options I need, and saving the resulting .config to my repository.
I know the kernel I'm building is missing some drivers because I've encountered some PC's that were not able to mount the NFS share because Linux could not find an ethernet device (which I've verified by booting an Ubuntu CD, which did find the ethernet device). I want an automated way of building any Linux kernel version that will guarantee that ALL drivers I need are pulled in.
Using a distribution's configuration pulls in too many unnecessary drivers and features for my purposes. It lengthens the kernel build time from 10-15 mintues to an hour or more, and the resulting image is too big.
Does anyone know how to write a Bash script to accomplish this?
Have you considered using a text editor to modify the .config file.
Then you can modify it using search and replace.
Plus, there are other choices for configuring the kernel than the menu-driven "menuconfig".
Sorry for the long description of my problem :-)
I have been handed a task to perform simple reads and writes to/from an I2C device on our new PC based board design. The board will be built using Portwell's Qseven mini PC which uses an Intel Tunnel Creek (ATOM) processor (essentially an x86 processor) and an EG20T IOH chip.
The I2C slave device is a TI AIC3254 audio codec. OS is Ubuntu 10.04 LTS 32 bit.
uname -a
Linux Torchwood 2.6.32-41-generic #88-Ubuntu SMP Thu Mar 29 13:08:43 UTC 2012 i686 GNU/Linux
The PC portion of this device will be essentially a general purpose PC.
The PC/OS needs to load the codec (registers) via I2C at system init. After that the codec will be controlled by an Atmel processor which will be a second master on the I2C bus (remaining silent until init is complete). The ATOM will have no additional direct interaction with the AIC3254.
All that I need to do, as far as I know, is to copy the codec's "program" to it over the I2C bus then read it back (poor man's load check).
It seems the logical approach is to use a userspace program to talk to the AIC3254 rather than try to create a device driver. However, after I modprobe i2c-dev; depmod -a no I2C bus appears in /dev and i2cdetect from i2c_tools finds no buses (devices?).
What I need is some understanding of Linux I2C access coding. Complete noob here.
Do I need a device driver after all? I don't need any fancy interface for general programs too use, just one simple read/write to bus/page/register. Perhaps a simple char mode driver? I've read something that suggests such things exist.
Do I need to put a *new_device* and *delete_device* file in /sys/bus/i2c/devices/i2c-0/?
Even with i2c-dev.ko installed no i2c-x "file" appears in /sys/bus/i2c/devices/ What am I missing here?
Can I assume or find out if this kernel knows about EG20T IOH chips? Or are these chips generic enough that i2c-dev can deal with them?
Will I need i2c-core.ko? It isn't found on the Ubuntu image. What do I need to apt-get to have it if I need it?
Do I have any use for the i2c-algo_???.ko's?
Sorry to be such a noob. Thanks for any help.
I think you need to add i2c support in your board support file when you build the kernel for the target. We use an Atmel based board to do i2c, and during kernel init, it calls i2c_register_board_info() to register the i2c devices. Then you can access them using i2c-tools, and userspace apps. Note we are using 3.2.6 kernel, but similar calls are likely needed for 2.6 kernels
I'm looking for either a kernel mode call that I can make from a driver, a userland utility, or a system call that will ask the Kernel to look at the PCI bus and either completely re-run its initialization, or initialize a specific device. Specifically, I need the Kernel to recognize a device that was added to the bus after boot and then configure its address space, interrupt, and other configuration parameters, and finally enable the device so that I can load the driver for it (unless this all happens as part of the driver load).
I'm stuck on the 2.4.x series Kernel for this, and am currently working with 2.4.20, but will be moving to 2.4.37 if it matters. The distro is a stripped down Red Hat 7.3 running in a ram disk, but I can add in whatever tools are needed to get this working (as long as they play nice with 2.4 series).
If some background would help clarify what I'm trying to do: From a cold boot, once in Linux I use GPIO to program an FPGA. Part of the FPGA, once programmed, implements a simple PCI device. Currently, after programming the FPGA, I reboot the system and Linux recognizes the device after coming up and loads the driver for it.
Instead of needing that reboot, I'd like to simply ask the Kernel to do whatever it does during boot up to find PCI devices (I have the Kernel configured to find PCI devices on its own, instead of asking the BIOS for that information, so the BIOS won't need to know about this device (I hope)).
I believe that Linux is capable of seeing the device after it is programmed but before a reboot, because scanpci will show the device after I program it, as will lspci -H 1. I just need a way to get it into /proc/pci, configured and enabled.
This below command will help the user to rescan it complete root hub.
echo "1" > /sys/class/pci_bus/0000\:00/rescan
You could speed up the reboot with kexec, if you don't figure out how to get the PCI scan redone. You could ask this on the LKML, if you haven't already.
unloading/reloading the module doesn't help, does it?
http://www.linuxjournal.com/article/5633 suggests you should be able to do it with 2.4 kernels using pcihpfs.
If that isn't working, maybe the driver doesn't support hotplug?
It would probably crash the system if you reconfigured the addresses of other PCI devices while they are in use.
A better way would be to just configure the new card. If your kernel has support for Cardus devices, it already knows how to configure a newly-inserted PCI device (which is what Cardbus is). You just need to figure out how to get the kernel to do it...
It should be possible for a kernel module to do this. Even if you can't get built-in hotplug code, you should be able to set the pci resources using calls to pci_bus_write_config_dword() and friends. There is probably some IRQ routing setup to do as well.