Physical Address to DRAM Address
   Mapping
                                         2048 (16 pages)
64 KB aligned                            1920 (15 pages)
                     Bank 4m     Bank 4m+1 (m = 0 or 1) Bank 4m+2 Bank 4m+3              Unused Portion
                                                                                         1/16 for 1920*1080
                    System Adr    System Adr                System Adr     System Adr
                    (decimal)      (decimal)                 (decimal)     (decimal)     6/16 for 1280*720
     Row Adr n
                       0~127        128~256                  1792~1919     1920~2047     19/64 for 720*480
                    2048~2175      2176~2303                 3840~3967     3968~4095
                         |             |                         |             |
                         |             |     No bank             |             |        Dual 2KB page size
                   63488~63615   63616~63743 conflict      65280~65407    65408~65535   DRAM (4KB total)
 Line 0~31                                   case for
                  Bank 4m + 2    Bank 4m + 3 rectangular   Bank 4m       Bank 4m + 1    CA[4:0] = HA[6:2]
                                             DRAM                                       CA[9:5] = HA[15:11]
                    System Adr    System Adr                System Adr     System Adr
                       (hex)         (hex)
                                             access            (hex)          (hex)
                                                                                        BA[0] = HA[7]
                   10000~1007f   10080~100ff               10700~1077f    10780~107ff   BA[1] = HA[8]^HA[16]
    Row Adr n+4    10800~1087f   10880~108ff               10f00~10f7f    10f80~10fff   RA[1:0] = HA[10:9]
                         |            |                          |              |       RA[12:2] =HA[26 :16]
                         |            |                          |              |
 Line 32~63        1f800~1f87f   1f880~1f8ff               1ff00~1ff7f    1ff80~1ffff
Memory Holes for Video (Boda7503) Data
              1920*1080
              1280*720                            640*480
    0000000


                          Video Data                        Video Data
    1000000


    2000000


                          Memory hole with
    3000000
                          discontinuous address

    4000000


    5000000


    6000000


    7000000
Pros/Cons for the Address Mapping
   Advantage
      Simple DRAM memory address mapping
      All engines and processors see straight forward linear
       address layout
   Disadvantage
      Create unused scattered holes in system memory for
       video (Boda7503 generated) data
      The unused holes are difficult for software to utilize
Alternative Mapping to Reclaim Memory Holes
                                        2048 (16 pages)
64 KB aligned                           1920 (15 pages)
                     Bank 4m     Bank 4m+1 (m = 0 or 1) Bank 4m+2 Bank 4m+3             Continuous
                                                                                        address
                                 System Adr               System Adr    System Adr
                    System Adr
     Row Adr n         (hex)
                                     (hex)                    (hex)         (hex)
                                   100000~                  e00000~       f00000~
                       0~fff
                                    100fff                   e00fff        f00fff
                                                                                     Dual 2KB page size
                                                                                     DRAM (4KB total)

                  Bank 4m + 2    Bank 4m + 3              Bank 4m      Bank 4m + 1   CA[9:0] = HA[11:2]
                                                                                     BA[0] = HA[20]
                                                          System Adr
                                                                                     BA[1] =
                    System Adr
                                 System Adr
                                                              (hex)
                                                                        System Adr   HA[21]^HA[12]
    Row Adr n+4        (hex)
                                     (hex)
                                                            e01000~
                                                                            (hex)    RA[1:0] = HA[23:22]
                                   101000~                                f01000~
                    1000~1fff
                                    101fff
                                                             e01fff
                                                                           f01fff    RA[9:2] =HA[19:12]
                                                                                     RA[12:10] = HA[26:24]




                                                                        System Adr
                                                                            (hex)
                                                                          fff000~
                                                                           ffffff
Alternative Mapping to Reclaim Memory Holes

        Default Address Space                              Address Space of Extra Mapping
  00000000                                                      80000000



  01000000                 Same Video Data                      81000000
                           With different address
  02000000                                                      82000000



  03000000                                                      83000000


  04000000                                                      84000000


  05000000              Memory hole with                        85000000
                        discontinuous address
  06000000                                                      86000000


  07000000                                Memory hole with      87000000
                                          continuous address
MIPS Virtual to Physical Address Mapping
             Virtual Address                  Physical Address
 FFFFFFFF                                                         FFFFFFFF    Same Repetitive
             Kernal Mapped     kseg3                                          DRAM Mapping
 E0000000                                                                    (A[30:29] ignored)
 DFFFFFFF
            Supervisor Mapped kseg2
 C0000000                                      Alternative DRAM
 BFFFFFFF   Kernal Unmapped                         Mapping
                            kseg1
               Uncached                                                       Same Repetitive
 A0000000                                                                     DRAM Mapping
 9FFFFFFF
            Kernal Unmapped kseg0                                            (A[30:29] ignored)
                                                                  80000000
 80000000
                                                                  7FFFFFFF
 7FFFFFFF




                                                Default DRAM
              User Mapped      useg/kuseg         Mapping
                                                                              The upper 96MB
                                                                                DRAM space
                                                                  20000000
                                               SPI_Flash/Device 1A000000      overlapped with
                                       96MB
                                                   512MB                     SPI/Device can be
                                                                               accessed here
 00000000                                                         00000000
MIPS Virtual to Physical Address Mapping
   Kseg1/kseg0 cannot access alternate DRAM mapping
    region
   For 512MB DRAM, 96MB is wasted if software use only
    kseg1/kseg0
   Software must configure MMU for kseg3/kseg2/useg to
    access alternative DRAM mapping space or the 96MB
    DRAM space that conflicts with SPI_Flash/Device space
    on kseg1/kseg0.

Memory mapping plan

  • 1.
    Physical Address toDRAM Address Mapping 2048 (16 pages) 64 KB aligned 1920 (15 pages) Bank 4m Bank 4m+1 (m = 0 or 1) Bank 4m+2 Bank 4m+3 Unused Portion 1/16 for 1920*1080 System Adr System Adr System Adr System Adr (decimal) (decimal) (decimal) (decimal) 6/16 for 1280*720 Row Adr n 0~127 128~256 1792~1919 1920~2047 19/64 for 720*480 2048~2175 2176~2303 3840~3967 3968~4095 | | | | | | No bank | | Dual 2KB page size 63488~63615 63616~63743 conflict 65280~65407 65408~65535 DRAM (4KB total) Line 0~31 case for Bank 4m + 2 Bank 4m + 3 rectangular Bank 4m Bank 4m + 1 CA[4:0] = HA[6:2] DRAM CA[9:5] = HA[15:11] System Adr System Adr System Adr System Adr (hex) (hex) access (hex) (hex) BA[0] = HA[7] 10000~1007f 10080~100ff 10700~1077f 10780~107ff BA[1] = HA[8]^HA[16] Row Adr n+4 10800~1087f 10880~108ff 10f00~10f7f 10f80~10fff RA[1:0] = HA[10:9] | | | | RA[12:2] =HA[26 :16] | | | | Line 32~63 1f800~1f87f 1f880~1f8ff 1ff00~1ff7f 1ff80~1ffff
  • 2.
    Memory Holes forVideo (Boda7503) Data 1920*1080 1280*720 640*480 0000000 Video Data Video Data 1000000 2000000 Memory hole with 3000000 discontinuous address 4000000 5000000 6000000 7000000
  • 3.
    Pros/Cons for theAddress Mapping  Advantage  Simple DRAM memory address mapping  All engines and processors see straight forward linear address layout  Disadvantage  Create unused scattered holes in system memory for video (Boda7503 generated) data  The unused holes are difficult for software to utilize
  • 4.
    Alternative Mapping toReclaim Memory Holes 2048 (16 pages) 64 KB aligned 1920 (15 pages) Bank 4m Bank 4m+1 (m = 0 or 1) Bank 4m+2 Bank 4m+3 Continuous address System Adr System Adr System Adr System Adr Row Adr n (hex) (hex) (hex) (hex) 100000~ e00000~ f00000~ 0~fff 100fff e00fff f00fff Dual 2KB page size DRAM (4KB total) Bank 4m + 2 Bank 4m + 3 Bank 4m Bank 4m + 1 CA[9:0] = HA[11:2] BA[0] = HA[20] System Adr BA[1] = System Adr System Adr (hex) System Adr HA[21]^HA[12] Row Adr n+4 (hex) (hex) e01000~ (hex) RA[1:0] = HA[23:22] 101000~ f01000~ 1000~1fff 101fff e01fff f01fff RA[9:2] =HA[19:12] RA[12:10] = HA[26:24] System Adr (hex) fff000~ ffffff
  • 5.
    Alternative Mapping toReclaim Memory Holes Default Address Space Address Space of Extra Mapping 00000000 80000000 01000000 Same Video Data 81000000 With different address 02000000 82000000 03000000 83000000 04000000 84000000 05000000 Memory hole with 85000000 discontinuous address 06000000 86000000 07000000 Memory hole with 87000000 continuous address
  • 6.
    MIPS Virtual toPhysical Address Mapping Virtual Address Physical Address FFFFFFFF FFFFFFFF Same Repetitive Kernal Mapped kseg3 DRAM Mapping E0000000 (A[30:29] ignored) DFFFFFFF Supervisor Mapped kseg2 C0000000 Alternative DRAM BFFFFFFF Kernal Unmapped Mapping kseg1 Uncached Same Repetitive A0000000 DRAM Mapping 9FFFFFFF Kernal Unmapped kseg0 (A[30:29] ignored) 80000000 80000000 7FFFFFFF 7FFFFFFF Default DRAM User Mapped useg/kuseg Mapping The upper 96MB DRAM space 20000000 SPI_Flash/Device 1A000000 overlapped with 96MB 512MB SPI/Device can be accessed here 00000000 00000000
  • 7.
    MIPS Virtual toPhysical Address Mapping  Kseg1/kseg0 cannot access alternate DRAM mapping region  For 512MB DRAM, 96MB is wasted if software use only kseg1/kseg0  Software must configure MMU for kseg3/kseg2/useg to access alternative DRAM mapping space or the 96MB DRAM space that conflicts with SPI_Flash/Device space on kseg1/kseg0.