Hardware: S3C2440 (ARM920T)
Embedded operating system: Linux 2.6.24 kernel
File system: Yaffs2 file system
Server: SuSe10.0 Linux server
Step 1: Kernel Configuration
You need to select the above options in the kernel:
Many netizens have emailed to say that the Linux 2.6.24 kernel does not have the two options Samsung S3C2440 series SPI or Samsung S3C24XX series SPI and User mode SPI device driver support in the SPI options.
Actually, the Linux 2.6.24 kernel is already compatible with SPI operations. It's just that this option is not selected in Linux 2.6.24/drivers/spi/Kconfig. For the reason, see the following instructions: Open Linux 2.6.24/drivers/spi/Kconfig
Find the following options:
config SPI_BITBANG
tristate "Bitbanging SPI master"
depends on SPI_MASTER #&& EXPERIMENTAL
help
With a few GPIO pins, your system can bitbang the SPI protocol.
Select this to get SPI support through I/O pins (GPIO, parallel
port, etc). Or, some systems' SPI master controller drivers use
this code to manage the per-word or per-transfer accesses to the
hardware shift registers.
This is library code, and is automatically selected by drivers that
need it. You only need to select this explicitly to support driver
modules that aren't part of this kernel tree.
When using SPI, you need to turn on the Bitbanging SPI master, but the dependent condition is EXPERIMENTAL. Here we remove this condition and then find:
config SPI_S3C24XX
tristate "Samsung S3C24XX series SPI"
depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL
select SPI_BITBANG
help
SPI driver for Samsung S3C24XX series ARM SoCs
config SPI_S3C2440
tristate "Samsung S3C2440 series SPI"
depends on SPI_MASTER && ARCH_S3C2410
select SPI_BITBANG
help
Added by SmallBox at 2011.02.18 SPI driver for Samsung S3C24XX series ARM SoCs
The blue words above are added by me. To distinguish them from the default configuration of the Linux kernel! Save the changes here and exit. Then open the Makefile file in this directory and make the following changes:
Add to:
obj-$(CONFIG_SPI_S3C2440) += spi_s3c24xx.o
Here is a note: If you don't want to add the options I added to Kconfig, you don't need to modify the Makefile file here, because it already supports S3C24XX!
Save and exit after modification!
The following files need to be modified in Linux2.6.24:
1) Open smallbox@linux-server:/home/Linux2.6.24/arch/arm/plat-s3c24xx/devs.c and add the following statement
It should be noted here that compilation errors will occur after adding. You also need to add the corresponding header file:
#include
#include
#include
If there are still errors, it may be that you have not added enough header files. Continue searching and adding until Make succeeds;
2) Open smallbox @linux-server:/home/Linux2.6.24/arch/arm/mach-s3c2440 /mach-hyh2440.c file and add
static struct platform_device *utu2440_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
&s3c_device_usbgadget,
&s3c_device_ts,
&s3c_device_dm9000,
&s3c_device_nand,
&s3c_device_sound,
&s3c_device_buttons,
&s3c_device_rtc,
&s3c_device_sdi,
&s3c_device_spi0,
};
Save and exit!
Finally, you can make it. Download your kernel, start your hardware, and you will find the spidev0.1 device under dev!
Previous article:Steps to port QWT to embedded Linux
Next article:SPI driver porting
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- It seems that I have a good relationship with Shide——Part 2
- 【Silicon Labs BG22-EK4108A Bluetooth Development Review】I. Hardware Appreciation and Development Environment Introduction
- [ESP32-S2-Kaluga-1 Review] 4. LCD example compilation pitfalls
- HuaDa MCU FLASH operation instructions and precautions
- I am working on a product for traffic security equipment recently. The project has high safety requirements and heavy tasks. I am having a headache recently...
- Several issues on key-controlled 8X8LED dot matrix screen displaying graphics program
- FAQ: PolarFire SoC FPGA Secure Boot | Microchip Security Solutions Seminar Series 12
- Some Problems on Measuring AC Current with Current Transformer
- Simulation of staying up late is harmful to health
- [RVB2601 Creative Application Development] + RTC Clock Display Experiment