The following is an overview of the basic features of the memory controller: -Little/big endian (selectable by a software) -Address Space: 128 Mbytes per bank (total 1 GB/8 banks) -Programmable access size (8/16/32-bit) for all banks blocks t bank0 (16/32-bit) -Total 8 memory banks Six memory banks for Rom, SRAM, etc. Remaining two memory banks for Rom, SRAM, SDRAM, etc. -Seven fixed memory bank start address -One flexible memory bank start address and programmable bank size -Programmable access cycles for all memory banks -External wait to extend the bus cycles Supporting self-refresh and power down mode in SDRAM The size of bank6 and bank7 must be the same, and the starting address of bank7 varies according to the size of bank6. The memory ing diagram of S3C2410A After resetting is as follows: The width of bank0 (ngcs0) Data Bus is determined by OM [1:0: Om [1:0] = 00 NAND flash mode 01 16-bit 10 32-bit 11 Test Mode 2) Take figure 2 (with nwait signal) as an example to describe the read operation process of the processor's bus to describe the overall read and write processes of flash. At the beginning of the first clock cycle, the system address bus provides the address of the bucket to be accessed. After the TACs time, the chip selection signal is also provided accordingly (the online address information of the current address is locked ), after the tcso time, the processor will show whether the current operation is read (NOE is low) or write (New is low), and prepare the data on the bus within the tacc time, after the tacc time (and view the nwait signal, if it is low, the current bus is extended to Y for a clock cycle), NOE is increased, and data from the data line is locked. Such a bus operation is basically complete Figure 2 bus read operations with nwait Signals Related registers Data width and wait control register: BwsconIP address 0x48000000 Bwscon is a group of four digits, controlling bank0 to bank7. Taking bank7 as an example, the four digits are: st7 [31], ws7 [30], dw7 [] St7: Start/disable the data mask pin of the SDRAM. For the SDRAM, this bit is 0; For the SRAM, this bit is 1. Determine SRAM for using UB/LB for bank 7. 0 = not using UB/lb (the pins are dedicated nwbe [3: 0]) 1 = Using UB/lb (the pins are dedicated NBE [3: 0]) NBE [3:0] is the 'and 'signal nwbe [3:0] And noe. Ws7: whether to use the memory's wait signal, usually set to 0 Dw7: Use two digits to set the memory Bit Width:-8 bits,-16 bits, 10-32 bits, and 11-retained. Similar to this, other banks have four digits corresponding to bank0, which are determined by the hardware jumper and read-only. Bank control register (bankconn: nGCS0-nGCS5): reset value: 0x0700 Bankcon0IP address 0x48000004 Bankcon1IP address 0x48000008 Bankcon2Address 0x4800000c Bankcon3IP address 0x48000010 Bankcon4IP address 0x48000014 Bankcon5IP address 0x48000018 Bank control register (bankconn: nGCS6-nGCS7): reset value: 0x0700 Bankcon6Address 0x481_1c Bankcon7IP address 0x48000020 Each bank control register only uses [] bits, mainly to control the size of each parameter in the read/write sequence, such as TACs and TCOs. For bank6 and bank7, use [] to control the storage mode of bank6 and bank7. 00 indicates using ROM or SRAM storage, and 11 indicates using SDRAM storage. This development board uses two pieces of memory with 32 Mbyte and 16 Bit Width to form a memory with 64 Mbyte and 32 bit width. Therefore, the bwscon corresponding bit is 0010. For this development board, bwscon can be set to 0x22111110: in fact, we only need to set the four bits corresponding to bank6 to 0010. The other values have no effect, this value is provided in the reference manual. 2. BANKCON0-BANKCON5: we are useless, use the default 0x00000700 3. BANKCON6-BANKCON7: set to 0x00018005 Of the eight banks, only bank6 and bank7 can use SRAM or SDRAM, so BANKCON6-7 is a little different from BANKCON0-5: A. MT ([16: 15]): used to set the outside of the bank is SRAM or SDRAM: SRAM-0b00, SDRAM-0b11 B. When MT = 0b11, you also need to set two parameters: Trcd ([3: 2]): Ras to CAS delay, set as recommendation value 0b01 Scan ([1:0]): The column address bits of SDRAM, for this development board uses the SDRAM HY57V561620CT-H, column address bits is 9, so scan = 0b01. If you use another type of SDRAM, you need to check its Data Manual to determine the scan value:-8 bits,-9 bits, 10-10 bits Refresh control register: RefreshAddress: x4821324 Refresh (SDRAM refresh control register): Set to 0x008e0000 + r_cnt Address 0, where r_cnt is used to control the update cycle of the SDRAM, occupying the [] bit of the refresh register. Its value can be calculated as follows (the clock frequency of the SDRAM is hclk ): R_cnt = 2 ^ 11 + 1-SDRAM clock frequency (MHz) * SDRAM refresh cycle (US) When the PLL is not used, the SDRAM clock frequency is equal to the crystal oscillator frequency 12 MHz; the SDRAM refresh cycle is indicated in the Data Manual of the SDRAM, which is used in the data manual of the SDRAM HY57V561620CT-H of this development board, we can see this line "8192 refresh cycles/64ms": Therefore, the refresh cycle is 64 ms/8192 = 7.8125 us. In this experiment, r_cnt = 2 ^ 11 + 1-12*7.8125 = 1955, Refresh = 0x008e0000 + 1955 = 0x008e07a3 Banksize register: BanksizeIP address 0x48000028 Burst_en [7] ARM core burst operation allowed 0 -- prohibit unexpected operations 1-Allow burst operations Reserved [6] not used Scke_en [5] scke allow control 0 = SDRAM scke disabled 1 = SDRAM scke allowed Sclk_en [4] sclk is only allowed in the access cycle of the SDRAM During the Period of power consumption reduction. Sclk changes to 'L' during access 0 = sclk always activated 1 = SDRAM is only activated during access (recommended) Reserved [3] not used Bk76map [2: 0] bank6/7 storage ing 010 = 128 MB/128 MB 001 = 64 MB/64 MB 000 = 32 MB/32 MB 111 = 16 Mb/16 MB 110 = 8 Mb/8 Mb 101 = 4 MB/4 MB 100 = 2 MB/2 MB Bit [7] = 1: Enable burst operation Bit [5] = 1: SDRAM power down mode enable Bit [4] = 1: sclk is active only during the access (recommended) Bit [2:1] = 010: bank6, bank7 corresponding address space and BANK0-5 is different. The BANK0-5 address space is fixed 128 m, the address range is (x * 128 M) to (x + 1) * m, X represents 0 to 5. However, the starting address of bank7 is variable. You can use "Table 5-1" in Chapter 5th of the S3C2410 Data Manual. in "Bank 6/7 addresses", we learned the relationship between the address ranges of bank6 and 7 and the address space. This development board only uses 64 MB space of bank6. We can make the bits [2: 1] = 010 (128 M/128 M) or 001 (64 m/64 m): It doesn't matter, the extra space program will detect and will not use non-existent memory. Both the introduced Bootloader and Linux kernel perform memory detection. Bit [6] and bit [3] are not used SDRAM mode register settings register (mrsr ): Mrsrb6Address 0x4820.2c Mrsrb7IP address 0x48000030 Can let us modify only the bit [] (CL), SDRAM HY57V561620CT-H does not support Cl = 1, so the bit [] value is 010 (CL = 2) or 011 (CL = 3 ). |