2.6.14 kernel, according to the posts on the Internet, the workload is not very large, now let's sort out the ideas, let's start with the hardware, the LCD model I use is LTV350QV-F04. 320×240, here 320×240 is the number of pixels, 320 is horizontal, 240 is vertical. Let's ignore the control signal, let's take a look at the data line, that is, the RGB (red green and blue) line, the hardware connection here determines the LCD's BPP, 16BPP or 24BPP, my development board uses a 5:6:5 16BPP connection. For the relationship between BPP and connection, please refer to pages 387-390 of the 2410 manual.
Next, we need to configure the registers related to the LCD. For this part of the configuration, please refer to the description of the LCD control register starting from p397 of 2410. The following code is made by a hero on the Internet. I will use it to explain the register initialization method:
Add the following content to /linux/arch/arm/mach-s3c2410/mach-smdk2410.c.
static struct s3c2410fb_mach_info smdk2410_lcdcfg __initdata = {
.regs = {
.lcdcon1 = S3C2410_LCDCON1_TFT16BPP | \
S3C2410_LCDCON1_TFT | \
S3C2410_LCDCON1_CLKVAL(0x03),
.lcdcon2 = S3C2410_LCDCON2_VBPD(3) | \
S3C2410_LCDCON2_LINEVAL(239) | \
S3C2410_LCDCON2_VFPD(5) | \
S3C2410_LCDCON2_VSPW(15),
.lcdcon3 = S3C2410_LCDCON3_HBPD(5) | \
S3C2410_LCDCON3_HOZVAL(319) | \
S3C2410_LCDCON3_HFPD(15),
.lcdcon4 = S3C2410_LCDCON4_MVAL(13) | \
S3C2410_LCDCON4_HSPW(8),
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
},
.lpcsel = 0xf82,
.gpccon = 0xaa955699,
.gpccon_mask = 0xffc003cc,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa95aaa1,
.gpdcon_mask = 0xffc0fff0,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
.fixed_syncs = 1,
.width = 320,
.height = 240,
.xres = {
.min = 320,
.max = 320,
.defval = 320,
},
.yres = {
.max = 240,
.min = 240,
.defval = 240,
},
.bpp = {
.min = 16,
.max = 16,
.defval = 16,
},
};First of all, we should be thankful that the kernel provides us with the s3c2410fb_mach_info structure (the structure is defined in /include/asm/arch-s3c2410/fb.h), so that we can simply add the relevant parameters (this reminds me of my undergraduate days when I knew nothing, but I still did experiments with a test box). For LCDCON1, the first two items are not much to say, but the last item about CLKVAL is very important. The driver that comes with my development board sets this value to 10, and a guy from Huaheng said that for 320×240 boards, it is generally set to 7. Let's try setting it to 10 first.
Let's look at LCDCON2 again. The LCD manual does not have typical values for the four values of VBPD, VFPD, VSPW, and LINEVAL. So I had to refer to the original driver. The original driver is as follows: lcdcon2: LCD2_VBPD(3) | LCD2_VFPD(5) | LCD2_VSPW(15). No LINEVAL value is assigned. Is there no such item in the 2.4 kernel, or is the default setting sufficient? Let's look at the LINEVAL in the manual.
LINEVAL [23:14] TFT/STN: These bits determine the vertical size of the LCD panel. 0000000000 (initial) This insurance is still added. Similarly, in LCDCON3, there is no shadow of HOZVAL, so it is also added. The others are the same as this hero's, including LCDCON4 and LCDCON5.
The next lpcsel is used to determine whether to use the lpc3600 chip. I don't seem to need to choose it. Set it to zero first and then ask if there is any problem.
The following is the configuration of the GPIO port. These GPIO ports are multi-function IOs. Here they are configured as VDn. According to my development board, GPCCON can be configured as all a, because except for the 16 pins used for LCD, the others are idle and there is no need to spend time on them. I don't know what GPCCON_MASK is for? Most posts have all f. GPCUP is the pull-up resistor function, which I don't need, so I have all f.
I don't know what fixed_syncs is. The built-in driver has a syncs of 0, so it is also set to 0 here. The rest is self-explanatory.
Next is to add the initialization code, still in mach-smdk2410.c, add the following code:
static void __init sdmk2410_lcdinit(void)
{
set_s3c2410fb_info(&smdk2410_lcdcfg __initdata );
}
Then add LCD initialization in MACHINE_START(SMDK2410, "SMDK2410").
.init_machine = sdmk2410_lcdinit,
Some people also added set_s3c2410fb_info(&smdk2410_lcdcfg __initdata ); directly to static void __init smdk2410_map_io(void), which I think is more reasonable. The next step is to add the necessary header files:
#include
#include
#include
#include
#include
#include
//#include
//#include
//#include
#include
#include
#include
#include
#include
#include
#include
#include
OK, I'm going to start compiling the kernel!!!
Note that some of the header files I provided will cause compilation errors. For any header file that causes errors, just comment it out. My friend said that just adding fb.h will do the trick, but I didn't try it. I just commented out the header files that caused the errors. Then I saw the little penguin.
Previous article:Summary of clock frequency based on S3C2410
Next article:s3c2410 startup code analysis
- 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
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- Design of three-coordinated distributed control system based on TMS320F2812 DSP
- Several ways to accurately delay the microcontroller
- Application Development Notes | Mir MYD-YA15XC-T LoRa Wireless Communication Example
- Advanced Driver Assistance System Solution Series Introduction—Digital Camera
- Prize-winning quiz | ADI application tour - water quality and gas monitoring
- #The best content of the "Interview with famous teachers" in the Electronic Competition#The second issue - Professor Chen Nan from Xidian University
- CH563 implements remote file management system based on FTP
- FreeRTOS porting on GD32VF103 processor!
- Inline function optimization of C6000
- Low power ink screen terminal