Hi! We're discussing a clarification of the content license; please look over to Current events if you're interested in editing.

S3C6410 MemoryMap

From Htc-linux

Jump to: navigation, search

Contents

[edit] S3C6410 Architecture overview

[edit] Physical vs Virtual Memory Addresses

The GPIO table is not really in memory, the cpu maps memory and devices to specific ranges. (NAND Flash, SRAM (boot), SDRAM, GPIOS and registers, Devices etc).

[edit] Physical Memory Map

Start address End address VSize Step'Stone OneNAND Comments
0x00000000 0x07FFFFFF 128MB Int ROM +  ? SROM NAND0 Boot Image Mirrored at 0000.0000
0x08000000 0x0BFFFFFF 64MB Int ROM 32KB (Boot loader Internal ROM)
0x0C000000 0x0FFFFFFF 64MB NAND Ctrl. 4KB (Boot loader Internal SRAM)
Static Memory SROM, SRAM, NOR Flash, async NOR interface device, OneNAND Flash, and Steppingstone
0x10000000 0x17FFFFFF 128MB SROM
0x18000000 0x1FFFFFFF 128MB SROM
0x20000000 0x27FFFFFF 128MB SROM NAND0
0x28000000 0x2FFFFFFF 128MB SROM NAND1
0x30000000 0x37FFFFFF 128MB SROM
0x38000000 0x3FFFFFFF 128MB SROM
Dynamic Memory
0x40000000 0x47FFFFFF 128MB + ?
0x48000000 0x4FFFFFFF 128MB + ?
0x50000000 0x5FFFFFFF 256MB DRAM1 Video Engine use 0x522ee000/0x523a9800/0x52465000 (size 0xbb800, 768Kb)
..50000000 ..50FFFFFF 16MB DRAM0 #A Not Present ? Bank A Seems disabled on M900
..51000000 ..51FFFFFF 16MB DRAM0 Bank #B
..52000000 ..520BB7FF 768KB WinMo Video Buffer fill screen with haret : pfw 0x52000000 0x2EE00 0x00000000 or pfb 0x52000000 0xbb800 0x00
..520BB800 ..52FFFFFF 15MB DRAM0 Bank #C
..53000000 ..53FFFFFF 16MB DRAM0 Bank #D
0x60000000 0x6FFFFFFF 256MB DRAM1 Available memory for Acer devices : 60000000-63f00000 (64MB)
..60000000 ..63FFFFFF 64MB
Periphericals PERI Bus - Refer to S3C6410X User Manual for complete List (Memory Map)
0x70000000 0x7DFFFFFF 224MB AHB Bus (1MB Banks)
..71000000 ..710FFFFF TZIC0 (Trust IRQ Controller)
..71100000 ..711FFFFF TZIC1 (Trust IRQ Controller)
..71200000 ..712FFFFF VIC0 (Vectored IRQ Controller)
..71300000 ..713FFFFF VIC1 (Vectored IRQ Controller)
..74300000 ..743FFFFF USB Host
..75000000 ..750FFFFF DMA0
..75100000 ..751FFFFF DMA1
..77100000 ..771FFFFF LCD Controller
..7C000000 ..7C0FFFFF USB OTG
..7C100000 ....1FFFFF USB OTG SFR
..7C200000 ....2FFFFF MMC0 WIFI
..7C300000 ....3FFFFF MMC1 SDCard ?
..7C400000 ....4FFFFF MMC2
0x7E000000 0x7FFFFFFF 32MB APB Bus (4KB Banks)
..7E004000 ......4FFF Watchdog
..7E005000 ......50FF 256B RTC pdump 0x7e005050 0x040 to get device date
..7E00A000 ......AFFF 64*64B Keypad IF no change read on keypress, works with GPIOs K[15:8] L[7:0] + N[7:0] H[7:0]
..7E00B000 ......BFFF 128*32B ADC/Touch Screen working, data changes when i touch the screen
..7E00E000 ......EFFF CHIP_ID empty on my device
..7E00F000 ......FFFF System Controller (PLLs,Clocks)
..7F000000 ......0FFF TZPC
..7F001000 ......1FFF AC97
..7F002000 ......2FFF I2S Ch0
..7F003000 ......3FFF I2S Ch1
..7F004000 ......40FF 256B I2C seen 0xc0 slave address
..7F005000 ......5FFF UART COM1 (+0x000) / COM5 (+0x400) / COM4(GPS?) (+0xC00)
..7F006000 ......6FFF PWM
..7F008000 ......8FFF GPIO
..7F009000 ......9FFF PCM Ch0
..7F009000 ......AFFF PCM Ch1
..7F00B000 ......BFFF SPI0
..7F00C000 ......CFFF SPI1
..7F00D000 ......DFFF I2S V40
..7F00F000 ......FFFF 256B I2C1 seems not used


For example, the device SDRAM (DRAM1) is accessible from 3 different big blocs :

The biggest one is at 0x60000000 (to 0x63FFFFFF) (64MB)          Virtual Address = 0x80000000 or 0xA0000000
second one      is at 0x52000000 (to 0x53FFFFFF) (32MB)          Virtual Address = 0x84000000 or 0xA4000000
and last one    is at 0x51000000 (to 0x51FFFFFF) (16MB) = 112MB  Virtual Address = 0x86000000 or 0xA6000000

But where are the last 16 MB? dunno for the moment ;p

You can check the memory mapping with the HaRET command "DUMP MMU" http://pastebin.com/rnLYx10G

[edit] GPIO on S3C6410X

S3C6410 includes 187 multi-functional input/output port pins. There are 17 banks as listed below :

Port Pins count Muxed pins Control Size Muxing bit
GPIO A 8 UART/EINT 1 4
GPIO B 7 UART/IrDA/I2C/CF/Ext.DMA/EINT 1 4
GPIO C 8 SPI/SDMMC/I2S_V40/EINT 1 4
GPIO D 5 PCM/I2S/AC97/EINT 1 4
GPIO E 5 PCM/I2S/AC97 1 4
GPIO F 16 CAMIF/PWM/EINT 1 2
GPIO G 7 SDMMC/EINT 1 4
GPIO H 10 SDMMC/KEYPAD/CF/I2S_V40/EINT 2 4
GPIO I 16 LCD 1 2
GPIO J 12 LCD 1 2
GPIO K (1) 16 HostIF/HIS/KEYPAD/CF 2 4
GPIO L (1) 15 HostIF/KEYPAD/CF/OTG/EINT 2 4
GPIO M (1) 6 HostIF/CF/EINT 1 4
GPIO N (1) 16 EINT/KEYPAD 1 2
GPIO O 16 MemoryPort0/EINT 1 2
GPIO P 15 MemoryPort0/EINT 1 2
GPIO Q 9 MemoryPort0/EINT 1 2

The GPIO provides the following features :

  • Controls 127 External Interrupts
  • 187 multi-functional input/output ports
  • Controls pin states in Sleep Mode except GPK, GPL, GPM, and GPN (1)

HaRET can list blocs of physical memory with the PDUMP command.

[edit] GPIO Memory Dump

S36410X GPIO table is located at physical address 0x7f008000 (VA = 0xB2B0800 on WinMo) :

# PDUMP 0x7f008000 0x290
7f008000 | 22222222 00000033 00000000 00000000 | """"3...........  <--- GPIO A : rGPIOACON    rGPIOADAT   rGPIOAPUD   rGPIOACONSLP
7f008010 | 00000000 00000033 00000000 00000000 | ....3...........                rGPIOAPUDSLP reserved[3]
7f008020 | 02211011 00000060 00000040 00000000 | ..!.`...@.......  <--- GPIO B : rGPIOBCON    rGPIOBDAT   rGPIOBPUD   rGPIOBCONSLP
7f008030 | 00000000 00000060 00000040 00000000 | ....`...@.......                rGPIOBPUDSLP reserved[3]
7f008040 | 12222222 0000004d 00000094 00000000 | """.M...........  <--- GPIO C : same ...
7f008050 | 00000094 000000dd 00000094 00000094 | ................
7f008060 | 00011111 00000010 00000000 00000000 | ................  <--- GPIO D
7f008070 | 00000000 00000010 00000000 00000000 | ................
7f008080 | 00033333 00000007 00000000 00000000 | 33..............  <--- GPIO E
7f008090 | 00000000 00000007 00000000 00000000 | ................
7f0080a0 | b4000041 00008000 01555514 00000000 | A........UU.....  <--- GPIO F
7f0080b0 | 00000000 0000c000 01555514 00000000 | .........UU.....
7f0080c0 | 02222222 0000003e 00000000 00000000 | """.>...........  <--- GPIO G
7f0080d0 | 00000000 0000003e 00000000 00000000 | ....>...........
7f0080e0 | 11111111 00000011 00000000 00080000 | ................  <--- GPIO H : rGPIOHCON0   rGPIOHCON1   rGPIOHDAT   rGPIOHPUD
7f0080f0 | 00000000 00000000 00000000 00080000 | ................                rGPIOHCONSLP rGPIOHPUDSLP reserved[2] (this one is different, 2 control registers like K and L)
7f008100 | aaa1aa95 0000fdfc 00000000 00080000 | ................  <--- GPIO I
7f008110 | 00000000 00000104 00000000 0000fdfc | ................
7f008120 | 00aaaa94 000007ff 00000000 00000002 | ................  <--- GPIO J
7f008130 | 00000000 00000fff 00000000 00000fff | ................
7f008140 | 00000046 00000001 55555510 00000000 | F........UUU....  <--- GPIO O
7f008150 | 00000000 00555555 00000000 00555555 | ....UUU.....UUU.
7f008160 | 1545aaa0 000000e4 00001545 00030000 | ..E.....E.......  <--- GPIO P
7f008170 | 00000000 00000000 00030000 00575555 | ............UUW.
7f008180 | 00000014 00000000 00015540 00000000 | ........@U......  <--- GPIO Q
7f008190 | 00000000 00000000 00000000 00000000 | ................

7f0081a0 | bfcd1501 bfcd1501 bfcd1501 bfcd1501 | ................  <--- rSPCON / reserved[3];

7f0081b0 | 00000000 00000000 00000000 00000000 | ................  <--- rMEM0CONSTOP rMEM1CONSTOP reserved[2]
7f0081c0 | 00000000 00000000 00000000 00000000 | ................       rMEM0CONSLP0 rMEM0CONSLP1 rMEM1CONSLP / reserved
7f0081d0 | 10555551 00555555 10555551 00555555 | QUU.UUU.QUU.UUU.       rMEM0DRVCON  rMEM1DRVCON  reserved[10]
7f0081e0 |
7f0081f0 |
7f008200 | 00000000 00000000 00000000 00000000 | ................  <--- rEINT12CON rEINT34CON rEINT56CON rEINT78CON
7f008210 | 00000000 00000000 00000000 00000000 | ................       rEINT9CON  reserved[3]

7f008220 | 00000000 00000000 00000000 00000000 | ................  <--- rEINT12FLTCON rEINT34FLTCON rEINT56FLTCON rEINT78FLTCON
7f008230 | 00000000 00000000 00000000 00000000 | ................       rEINT9FLTCON  reserved[3]

7f008240 | 00ff7fff 3fff03ff 03ff007f 7fffffff | .......?........  <--- rEINT12MASK rEINT34MASK rEINT56MASK rEINT78MASK
7f008250 | 000001ff 3fff03ff 03ff01ff 7fffffff | .......?........       rEINT9MASK  reserved[3]

7f008260 | 00000000 00000000 00000000 00000000 | ................  <--- rEINT12PEND rEINT34PEND rEINT56PEND rEINT78PEND
7f008270 | 00000000 00000000 00000000 00000000 | ................       rEINT9PEND  reserved[3]

7f008280 | 000003ff 00000000 00000000 00000000 | ................  <--- rPRIORITY rSERVICE rSERVICEPEND reserved


Second bloc containing GPIOs is located some bytes after that (348):

# PDUMP 0x7f008800 0x0140
7f008800 | 11111011 11111111 00003816 00000080 | .........8......  <--- GPIO K : rGPIOKCON0 rGPIOKCON1 rGPIOKDAT rGPIOKPUD
7f008810 | 01111111 03333100 00006b6c 01800000 | .....13.lk......  <--- GPIO L : rGPIOKLON0 rGPIOLCON1 rGPIOLDAT rGPIOLPUD
7f008820 | 00113333 0000000f 00000000 00000000 | 33..............  <--- GPIO M : rGPIOMCON  rGPIOMDAT  rGPIOMPUD reserved
7f008830 | 06aaa66a 00004ed5 00000200 00000000 | j....N..........  <--- GPIO N : rGPIONCON  rGPIONDAT  rGPIONPUD reserved

7f008840 | 00000000 00000000 00000000 00000000 | ................  reserved[16]
7f008850 | 00000000 00000000 00000000 00000000 | ................
7f008860 | 00000000 00000000 00000000 00000000 | ................
7f008870 | 00000000 00000000 00000000 00000000 | ................

7f008880 | 00000010 00000000 00000000 00000000 | ................  <--- rSPCONSLP reserved[31]
7f008890 | 00000000 00000000 00000000 00000000 | ................
7f0088a0 | 00000000 00000000 00000000 00000000 | ................
7f0088b0 | 00000000 00000000 00000000 00000000 | ................
7f0088c0 | 00000000 00000000 00000000 00000000 | ................
7f0088d0 | 00000000 00000000 00000000 00000000 | ................
7f0088e0 | 00000000 00000000 00000000 00000000 | ................
7f0088f0 | 00000000 00000000 00000000 00000000 | ................

7f008900 | 01263223 00662620 00000000 00000000 | #2&. &f.........  <--- rEINT0CON0 rEINT0CON1 reserved[2]

7f008910 | 80808080 00008080 80000000 00008080 | ................  <--- rEINT0FLTCON0 rEINT0FLTCON1 rEINT0FLTCON2 rEINT0FLTCON3
7f008920 | 0807e028 00000000 00000000 00000000 | (...............       rEINT0MASK    rEINT0PEND    reserved[2]

7f008930 | 00000002 00000000 00000000 00000000 | ................  <--- rSLPEN