Compile the Linux system that supports NAND FLASH driver and yaffs2 file system according to the transplantation document, then burn the kernel image into FLASH, and then burn the root_2.6.31.bin image on the CD into FLASH. In this way, the most basic environment for testing the driver is established on the target board. At the same time, the compiled source code becomes the kernel tree environment for compiling the driver on the host machine.
When compiling the driver, you can use: make -C /.../.../linux-2.6.31/ SUBDIRS=$PWD modules
Note: Makefile is required; /.../.../linux-2.6.31/ is the kernel tree directory
If you want to compile the LED driver of TX2440A, that is, the TX2440_led.c source file in the CD, there is a sentence in the Makefile file:
obj-m := TX2440_led.o.
When compiling the LED driver, you should also note that you need to modify the arch/arm/plat-s3c2440/common-smdk.c source file in the source code. In arch/arm/plat-s3c24xx/common-smdk.c, set GPF0-GPF3 as outputs, all outputting low levels. Just modify the smdk_machine_init function
void __init smdk_machine_init(void)
{
/* Configure the LEDs (even if we have no LED support)*/
s3c2410_gpio_cfgpin(S3C2410_GPF(0), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_cfgpin(S3C2410_GPF(3), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_setpin(S3C2410_GPF(0), 0);
s3c2410_gpio_setpin(S3C2410_GPF(1), 0);
s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
s3c2410_gpio_setpin(S3C2410_GPF(3), 0);
s3c2410_gpio_setpin(S3C2410_GPF(4), 1);
s3c2410_gpio_setpin(S3C2410_GPF(5), 1);
s3c2410_gpio_setpin(S3C2410_GPF(6), 1);
s3c2410_gpio_setpin(S3C2410_GPF(7), 1);
if (machine_is_smdk2443())
smdk_nand_info.twrph0 = 50;
s3c_device_nand.dev.platform_data = &smdk_nand_info;
platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
s3c_pm_init();
}
The code is generated by codehl software and then copied by opening it in Word.
From this, you can also think that you can also add the code added in the smdk_machine_init function in the driver, and the effect is the same.
Previous article:s3c2440 three clocks
Next article:Export functions available to Linux kernel ARM platform drivers
Recommended ReadingLatest update time:2024-11-16 16:34
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Research on three-phase all-solid-state high-efficiency LED tunnel lighting system based on chip drive_Li Jian
- Follow me Season 2 Episode 1 All Code + Library
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Learn embedded development from engineers——Based on STM32 and μC/OS-III
- What is the output/input impedance value of CC2xxx?
- [TI recommended course] #[High Precision Lab] Operational Amplifier: 16 Fully Differential Amplifier#
- EEWORLD University Hall----Live Replay: Infineon & Intron Explanation- How to Choose a Suitable Automotive MOSFET
- Amway uses LT768 to realize TFT industrial serial port screen solution
- Neopixel Christmas Tree
- Gigabit Network Contactless Connector-SK202 Review Unboxing
- What are the methods of wireless bridge relay transmission?
- Diode selection
- The computer will automatically restart when the LabVIEW program is running