s3c2440 Storage System and I/O Space

Publisher:RainbowMelodyLatest update time:2016-08-08 Source: eefocusKeywords:s3c2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
I have been using the Friendly Arm board for a while. I have gradually forgotten the knowledge of the storage system and I/O space. The reason is that when I was doing other development, I always used the built-in startup code and never cared about the storage space configuration of the board. Recently, I was working on the network card driver, and suddenly I didn't know what the address of the network card was, so I took some time to summarize it. Enough nonsense. Let's get started.

1. Storage resources on board

Two 32M SDRAMs.

A 2M NOR FLASH

A 128M (some are 64M) NAND FLASH

The above resources can be found by looking at the schematic diagram.

2. I/O resources on the board

       The I/O space on this board (S3C2440 to be exact) is mapped to the storage space using the storage mapping method, which means that the I/O space takes up storage space.

3. Differences between various memories and their respective uses

       Why are there so many storage devices on this board? The reason is very simple. Each storage device has a different purpose, and in order to take into account the needs of the majority of users, there must be different storage devices. Let's talk about SDRAM first. (When writing this, I suddenly remembered that I forgot to mention SRAM. SRAM is a static random access memory. It has the characteristics of not losing data when power is off and does not need to be refreshed frequently. It has a fast storage speed and is equivalent to the memory of a PC. It seems that this thing equivalent to memory is very important, but why didn't I mention it just now? The reason is very simple. Because there is no such thing. In fact, if random access memory is needed, SDRAM is a random access memory, but it needs to be constantly refreshed to maintain the data (level) inside. Speaking of this, the role of SDRAM should also be understood by the students. In other words, our board has 64M of memory, which is enough.

Next, let's talk about NOR FLASH. NOR FLASH is a ROM with SRAM interface characteristics. But NOR FLASH is only 2M, which is too little. Yes, it is very little, but we have NAND FLASH, which is also ROM, so we can say that this board has a 130M (66M) hard disk. This is enough, and we can save several Linux.

Let's talk about NAND FLASH. NAND FLASH can be made very large, but its speed is not as fast as NOR FLASH. NOR FLASH can be made fast but not large, so speed and capacity are a contradiction. In order to overcome this contradiction, this board has both types of FLASH. Each has its own use. In addition, beginners must know the difference between NAND FLASH and NOR FLASH startup. This is related to their characteristics, let's talk about it next.

4.NOR FLASH boot and NAND FLASH boot

       There is an S2 switch on the development board. When it is turned to the NOR end, it is NOR boot. On the contrary, when it is turned to the other end, it is NAND FLASH boot. Let's talk about the difference between the two boots first, and then talk about how the hardware is booted and how the space is sometimes allocated. When S2 is turned to NAND FLASH boot, the program runs on NAND FLASH. In fact, there is also a 4K-byte steppingstone buffer inside (actually this is an SRAM). When NAND FALSH boot is selected, this buffer is mapped to address 0x0000_0000, and it is responsible for copying the code on NAND FLASH to SDRAM (as we all know, the program runs on RAM when it is running, how can it run on FLASH? In fact, it just copies the code on FLASH). The thing responsible for copying this code is the legendary BIOS.

What is the difference when S2 is set at one end of NOR FLASH? When NOR FLASH is selected for startup, the 2M NOR FLASH is mapped to address 0x0000_0000, and the program runs from here. So can the program run from NOR FLASH? Of course not, then why can it be started here? In fact, this NOR FLASH has already installed BIOS (if some readers do not know what BIOS is, then temporarily assume that its function is to copy code from FLASH to SDRAM)

4, S3C2410 S3C2440 NAND storage system

       As we all know, 32 bits can address 4G space. However, S3C2440 divides 4G in the storage space like this:

(Only the lowest 1G is displayed during the process)

 

 

       0x4000_0000 has only 3G of space left, so it is allocated like this:

When OM[1:0]=01 or 10: 0x4000_0000-0x4000_0fff. These 4 bytes are the steppingstone mentioned above. 0x4000_0fff_0x4800_0000 is not used. The space of 0x4800_0000-0x6000_0000 is the special function register. You will find that all registers are within this range. 0x6000_0000-0Xffff_ffff is still unused.

When OM[1:0]=00, as shown in the figure above, the steppingstone just mentioned is mapped to ox000_0000, which is the BOOT INTERNAL SRAM on the way. The others are the same.

Actually, S3C2440 divides the lower 1G space into 8 blocks. As can be seen from the figure, the starting addresses of the 0th to 6th blocks are unchanged. The address of the seventh segment is variable (its address is determined by how much the sixth block needs, anyway, the sixth and seventh are connected together). The first 6 blocks can be ROM SRAM. The last two blocks can be not only ROM, SRAM, but also SDRAM. Actually, to put it simply, only the last two blocks can be SDRAM. That is to say, SDRAM must be mapped to these two blocks. Mini2440 chooses to map to the seventh block, so the starting address of SDRAM is 0x3000_0000 (this is why the manual sets the initial value of DNW to this when loading the test program, it is to load the program directly to SDRAM, this is just for experiment and it will be lost after power failure. So it is impossible to do this when making products).

I just said that S3C2440 divides the storage space into 8 blocks. Why does it do this? In fact, it is very simple. Even if it does not do this, we will do it. Let's do the math first: 128M per block, that is, 27 address lines are needed for addressing. And 8 blocks are followed by 8 chip select pins corresponding to each one. Speaking of this, smart readers will surely think that these 8 chip select pins are actually decoded by 3 address lines. So a total of 30 address lines are used, and 30 are just 1G. Haha.

That's about it. There should be a lot to be improved, but this is still helpful for beginners, right?

 

 


S3C2440 Memory Controller Detailed Explanation

 

 


       The width of BANK0 bus is determined by OM[1:0] pins. When OM[1:0]=01, the booting ROM data width is 16 bits. When [1:0]=10, the booting ROM data width is 32 bits. When OM[1:0]=00, boot from NAND FLASH. On the Friendly Arm S3C2440 development board, the OM1 pin is directly grounded.

 

 

 

s3c2440 storage system and I/O space understanding - Wornyong - Intelligent IoT, embedded in you and me!
 According to this table, we can find the connection method of the BANK selection pin of SDRAM. For example, the SDRAM we use is two HYNIX HY57V561620(L)T, whose specifications are 4*4M*16bit (two pieces are used to configure a 32-bit bus width), the BANK size is 4M*16=64MB, the bus width is 32 bits, the device size is 4*BANK size=256Mb (M bit), and the register configuration is (4M*16*4B)*2 (M bit). According to the table above, the BANK address pins (BA[1:0]) on the SDRAM are connected to A[25:24] of S3C2440.
s3c2440 storage system and I/O space understanding - Wornyong - Intelligent IoT, embedded in you and me!
 
 The table above shows the register control address bus connection method. We use two SDRAMs configured with a 32-bit bus width, so the A[12:0] on the SDRAM is connected to the A[14:2] pins of the S3C2440.
       The specific connection method between the S3C2440 and the two SDRAMs is shown in the figure below:
s3c2440 storage system and I/O space understanding - Wornyong - Intelligent IoT, embedded in you and me!

 

 As an ARM engineer, you only need to understand the working timing of SDRAM. The specific read and write control is completed by the register controller. As an FPGA engineer, you need to understand the working principle and timing of SDRAM in detail. I will not go into details here. As an ARM engineer, the most important thing is to accurately configure the registers related to SDRAM.

 


 

Software programmable big-endian and small-endian modes;

       Address space: Each bank can address 128MB (a total of 8 banks with 1GB space);

       Programmable access bit width: BANK0 is 16 or 32 bits, other BANKs are 8, 16 or 32 bits;

       8 memory banks, 6 of which are used for ROM or SRAM, and 2 for ROM, SRAM or SDRAM;

       The starting address of BANK0~BANK6 is fixed;

       The starting address and size of BANK7 are programmable;

       The access cycle of all memory banks is programmable;

       External wait signal can extend the bus cycle;

       Supports SDRAM self-refresh and power-down modes.

 

s3c2440 storage system and I/O space understanding - Wornyong - Intelligent IoT, embedded in you and me!

Keywords:s3c2440 Reference address:s3c2440 Storage System and I/O Space

Previous article:Learning infrared remote control based on LPC1114
Next article:Why are PC=PC+8 in both ARM3-stage and 5-stage pipelines?

Recommended ReadingLatest update time:2024-11-15 17:50

s3c2440 bare metal-bss clearing principle and implementation
1. Introduction of bss clearing (why we need to clear bss) Let’s give an example first: #include "s3c2440_soc.h" #include "uart.h" char g_Char = 'A'; //.data char g_Char3 = 'a'; const char g_Char2 = 'B'; //.rodata int g_A = 0; //bss int g_B; //bss int main(void) { uart0_init(); puts("nrg_A = "); printHex(g_
[Microcontroller]
ARM9_S3C2440 Learning (I) 7 working modes of ARM system
1. The ARM system CPU has the following 7 working modes: 1. User mode (usr): normal program execution state 2. Fast interrupt mode (fiq): 3. Interrupt mode (irq): 4. Management mode (svc): protection mode used by the operating system 5. System mode (sys): running privileged operating system tasks 6. Data access termin
[Microcontroller]
Detailed explanation of S3C2440 serial port and its interrupt system
The S3C2440A's Universal Asynchronous Receiver/Transmitter (UART) is equipped with three independent asynchronous serial I/O (SIO) ports, each of which can be operated in interrupt-based or DMA-based mode. In other words, the UART can generate interrupts or DMA requests to perform data transfer between the CPU and the
[Microcontroller]
Detailed explanation of S3C2440 serial port and its interrupt system
11-S3C2440 driver learning (V) Embedded Linux-Network device driver (II) Transplanting DM9000C network card driver
We have implemented a virtual network card driver. Now we are writing and porting the DM9000C network card driver for the real network card chip DM9000C. 1. Transplantation Analysis For protocol drivers, our main job is often to match existing drivers with our hardware. Protocol functions are often already formed an
[Microcontroller]
11-S3C2440 driver learning (V) Embedded Linux-Network device driver (II) Transplanting DM9000C network card driver
S3C2440 startup
This article was written after studying S3C2440 for a while. If there are any mistakes, please correct them. It will be very grateful! S3C2440 has two startup modes 1. NandFlash boot mode NangFlash is cheap, but it is not directly connected to the CPU bus. However, there is a NandFlash controller in S3C2440, which is
[Microcontroller]
Basic use of s3c2440 serial port
How to write UART program? 1. Serial port initialization Step 1: Set the pin ① Set the pins for the serial port. GPH2, 3 for TX0, RX0 Clear the bit, then set ② Set TX0 and RX0 internal pull-up, that is, configure the GPHUP register step2: Set baud rate (UBRDIV0) — 115200 == PCLK = 50MHz = UBRDIV0 = 26 ① Set UCON0 - Se
[Microcontroller]
LCD Experiment Study Notes (9): UART
The s3c2440 contains three universal asynchronous receivers and transmitters that can work in interrupt mode or DMA mode. Each UART contains two 64-byte FIFOs for receiving and transmitting data. Programmable baud rate, 1 or 2 stop bits, 5/6/7/8 data bits and parity status. There are generally three serial lines, Tx
[Microcontroller]
Design of LCD1602 driver based on S3C2440
Development target platform: linux -2.6.28+S3C2440+CRAMFS/YAFFS2   Development environment: UBUNTU-9.04+ arm - linux -gcc-3.4.1   This time we need to develop a simple character LCD driver on s3c2440, the details are as follows:   LCD1602 has a total of 16 pins, 3 control signals RS, RW, RE, and 8 data lines DB0~DB7,
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号