The whole process of SPI transplantation based on S3C2440 processor

Publisher:masphiaLatest update time:2016-07-26 Source: eefocusKeywords:S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
environment

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

【Original】The whole process of SPI transplantation based on S3C2440 processor - Small.Box - Small box of small box

 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

【Original】The whole process of SPI transplantation based on S3C2440 processor - Small.Box - Small box of small box

 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!

Keywords:S3C2440 Reference address:The whole process of SPI transplantation based on S3C2440 processor

Previous article:Steps to port QWT to embedded Linux
Next article:SPI driver porting

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号