home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / neat.doc < prev    next >
Text File  |  1990-01-12  |  18KB  |  432 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                 82C212X Page/Interleave and EMS Memory Controller
  7.  
  8. 1. Features
  9.    A. Page mode access includeing single bank, 2 way and 4 way page 
  10.       interleaved, providing higher performance over conventional
  11.       DRAM accessing schemes
  12.    B. Supports 100ns DRAMs at 16MHz using page interleaved operation
  13.    C. Supports up to 8Mbytes of on board memory
  14.    D. Provides automatic remapping of RAM resident in 640K to 1Mbyte area
  15.       to the top of the 1Mbyte address space
  16.    E. Supports Lotus Intel Microsoft-Expanded Memory System (LIM-EMS 4.0)
  17.       address transiation logic
  18.    F. Shadow RAM feature for efficient BIOS execution
  19.    G. OS/2 optimization feature allows fast switching between protected 
  20.       and real mode
  21.    H. Staggered refresh to reduce power supply
  22.  
  23. 2. Register Description
  24.    Index register port: 22h
  25.    Data  register port: 23h
  26.  
  27.    A. PROCCLK Register RA0 - Index 60h
  28.       bit 7,6 - 82C211 revision number. 00 is the initial number
  29.       bit 5 - Alternate CPU reset. A low to high transition in this bit
  30.               activates a CPU reset. Once active, it remains active for 
  31.               16 PROCCLK cycles and then goes low.
  32.       bit 4 - Processor clock select is by default set to zero and
  33.               selects PROCCLK = CLK2IN (high speed).
  34.               If high, it selects PROCCLK = BCLK (low speed).
  35.       bit 3 - Reserved.
  36.       bit 2 - Local bus READY timeout NMI enable. A one enables the NMI and 
  37.               a zero disables it. Default is 0.
  38.       bit 1 - Reserved.
  39.       bit 0 - Local bus READY timeout. A one indicates that READY timeout
  40.               has occured 128 PROCCLK cycles has occured after -AF16 has 
  41.               been asserted. A zero indicates that READY timeout has not
  42.               occurred.
  43.  
  44.    B. Command Delay Register RA1 - Index 61h
  45.       bit 7 - Address hold time delay. A one enable extra address bus hold
  46.               time and A zero disables it. Default is 0.
  47.       bit 6 - Quick mode enable. A zero enables Quick mode and a one disables
  48.               it. Default is 1.
  49.       bit 5,4 - AT Bus 16 bit memory command delay. Specifies between 0 and 3 
  50.               BCLK cycle command delays for 16 bit AT memory cycles. Default
  51.               is 0.
  52.       bit 3,2 - AT Bus 8 bit memory command delay. Specifies between 0 and 3 
  53.               BCLK cycle command delays for 8 bit AT memory cycles. Default
  54.               is 1.
  55.       bit 1,0 - AT Bus I/O cycle command delay. Specifies between 0 and 3 
  56.               BCLK cycle command delays for AT I/O cycles. Default is 1.
  57.  
  58.    C. Wait State Register RA2 - Index 62h
  59.       bit 7,6 - Reserved.
  60.       bit 5,4 - 16 bit AT cycle wait state generation. Default is 11
  61.            00 - 0 wait state
  62.            01 - 1 wait state
  63.            10 - 2 wait states
  64.            11 - 3 wait states (default)
  65.       bit 3,2 - 8 bit AT cycle wait state generation. Default is 11.
  66.            00 - 2 wait state
  67.            01 - 3 wait state
  68.            10 - 4 wait states
  69.            11 - 5 wait states (default)
  70.       bit 1,0 - Bus clock (BCLK) source select. Default is 00.
  71.            00 - BCLK = CLK2IN/2 (default, SYNC)
  72.            01 - BCLK = CLK2IN
  73.            10 - BCLK = ATCLK (ASYNC)
  74.            11 - Reserved
  75.  
  76.  
  77.    D. Version Register RB0 - Index 64h
  78.       bit 7 - NEAT memory controller identifier. 0 = 82C212.
  79.       bit 6,5 - 82C212 revision number.
  80.            00 = initial revision number.
  81.            01 = 82C212B
  82.       bit 4-0 - Reserved and default to 0.
  83.  
  84.    E. ROM Configuration Register RB1 - Index 65h
  85.       bit 7 - Shadow RAM at C0000h-CFFFFh in Read/Write mode.
  86.           0 - Read/Write (default), 1 - Read only (Write protected).
  87.       bit 6 - Shadow RAM at D0000h-DFFFFh in Read/Write mode.
  88.           0 - Read/Write (default), 1 - Read only (Write protected).
  89.       bit 5 - Shadow RAM at E0000h-EFFFFh in Read/Write mode.
  90.           0 - Read/Write (default), 1 - Read only (Write protected).
  91.       bit 4 - Shadow RAM at F0000h-FFFFFh in Read/Write mode.
  92.           0 - Read/Write (default), 1 - Read only (Write protected).
  93.       bit 3 - ROM at C0000h-CFFFFh (EGA). 
  94.           0 - ROM enabled, Shadow RAM disabled. -ROMCS is generated. 
  95.           1 - Shadow RAM enabled (Default).
  96.       bit 2 - ROM at D0000h-DFFFFh. 
  97.           0 - ROM enabled, Shadow RAM disabled. -ROMCS is generated. 
  98.           1 - Shadow RAM enabled (Default).
  99.       bit 1 - ROM at E0000h-EFFFFh. 
  100.           0 - ROM enabled, Shadow RAM disabled. -ROMCS is generated. 
  101.           1 - Shadow RAM enabled (Default).
  102.       bit 0 - ROM at F0000h-FFFFFh. 
  103.           0 - ROM enabled, Shadow RAM disabled. -ROMCS is generated. 
  104.           1 - Shadow RAM enabled (Default).
  105.  
  106.    F. Memory Enable-1 Register RB2 - Index 66h
  107.       bit 7 - Address map RAM on system board is 80000h-9FFFFh area.
  108.           0 - on the I/O channel,    1 - on the system board
  109.       bit 6 - Address map RAM on system board is 40000h-7FFFFh area.
  110.           0 - on the system board,   1 - on the I/O channel
  111.       bit 5 - Address map RAM on system board is 00000h-3FFFFh area.
  112.           0 - on the system board,   1 - on the I/O channel
  113.       bit 4-0 - Reserved and default to 0.
  114.  
  115.    G. Memory Enable-2 Register RB3 - Index 67h
  116.       bit 7 - Enable Shadow RAM in AC000h-AFFFFh area.
  117.           0 - Disable,    1 - Enable
  118.       bit 6 - Enable Shadow RAM in A8000h-ABFFFh area.
  119.           0 - Disable,    1 - Enable
  120.       bit 5 - Enable Shadow RAM in A4000h-A7FFFh area.
  121.           0 - Disable,    1 - Enable
  122.       bit 4 - Enable Shadow RAM in A0000h-A3FFFh area.
  123.           0 - Disable,    1 - Enable
  124.       bit 3 - Enable Shadow RAM in BC000h-BFFFFh area.
  125.           0 - Disable,    1 - Enable
  126.       bit 2 - Enable Shadow RAM in B8000h-BBFFFh area.
  127.           0 - Disable,    1 - Enable
  128.       bit 1 - Enable Shadow RAM in B4000h-B7FFFh area.
  129.           0 - Disable,    1 - Enable
  130.       bit 0 - Enable Shadow RAM in B0000h-B3FFFh area.
  131.           0 - Disable,    1 - Enable
  132.  
  133.  
  134.    H. Memory Enable-3 Register RB4 - Index 68h
  135.       bit 7 - Enable Shadow RAM in DC000h-DFFFFh area.
  136.           0 - Disable,    1 - Enable
  137.       bit 6 - Enable Shadow RAM in D8000h-DFFFFh area.
  138.           0 - Disable,    1 - Enable
  139.       bit 5 - Enable Shadow RAM in D4000h-D7FFFh area.
  140.           0 - Disable,    1 - Enable
  141.       bit 4 - Enable Shadow RAM in D0000h-D3FFFh area.
  142.           0 - Disable,    1 - Enable
  143.       bit 3 - Enable Shadow RAM in CC000h-CFFFFh area.
  144.           0 - Disable,    1 - Enable
  145.       bit 2 - Enable Shadow RAM in C8000h-CBFFFh area.
  146.           0 - Disable,    1 - Enable
  147.       bit 1 - Enable Shadow RAM in C4000h-C7FFFh area.
  148.           0 - Disable,    1 - Enable
  149.       bit 0 - Enable Shadow RAM in C0000h-C3FFFh area.
  150.           0 - Disable,    1 - Enable
  151.  
  152.    I. Memory Enable-4 Register RB5 - Index 69h
  153.       bit 7 - Enable Shadow RAM in FC000h-FFFFFh area.
  154.           0 - Disable,    1 - Enable
  155.       bit 6 - Enable Shadow RAM in F8000h-FFFFFh area.
  156.           0 - Disable,    1 - Enable
  157.       bit 5 - Enable Shadow RAM in F4000h-F7FFFh area.
  158.           0 - Disable,    1 - Enable
  159.       bit 4 - Enable Shadow RAM in F0000h-F3FFFh area.
  160.           0 - Disable,    1 - Enable
  161.       bit 3 - Enable Shadow RAM in EC000h-EFFFFh area.
  162.           0 - Disable,    1 - Enable
  163.       bit 2 - Enable Shadow RAM in E8000h-EBFFFh area.
  164.           0 - Disable,    1 - Enable
  165.       bit 1 - Enable Shadow RAM in E4000h-E7FFFh area.
  166.           0 - Disable,    1 - Enable
  167.       bit 0 - Enable Shadow RAM in E0000h-E3FFFh area.
  168.           0 - Disable,    1 - Enable
  169.  
  170.    J. Bank 0/1 Enable Register RB6 - Index 6Ah
  171.       bit 7,6 - The DRAM types used on the system board. POST/BIOS should
  172.               use the DRAM configuration data stored in the CMOS RAM of the
  173.               82C206 IPC
  174.            00 - Disable
  175.            01 - 256K and 64K bit DRAMs used (for 640 Kbyte combination only)
  176.            10 - 256K bit DRAMs used (default)
  177.            11 - 1M bit DRAMs used
  178.       bit 5 - Number of RAM banks used.
  179.           0 - one bank, non-interleaved mode (default)
  180.           1 - two banks
  181.       bit 4-0 - Reserved and default to 0.
  182.  
  183.  
  184.    H. DRAM Configuration Register RB7 - Index 6Bh
  185.       bit 7 - Page/Interleaved mode enable.
  186.           0 - disable (default),  1 - enable
  187.       bit 6 - 640Kbyte to 1Mbyte RAM relocation bit.
  188.           0 - not relocate local RAM.
  189.           1 - relocate local RAM from 0A0000-0F0000h to 100000-15FFFFh,
  190.               provided total local RAM is 1Mbyte only.
  191.       bit 5 - RAM access wait states.
  192.           0 - 0 wait state,  1 - 1 wait state
  193.       bit 4 - EMS enable bit.
  194.           0 - disable (default), 1 - enable
  195.       bit 3,2 - EMS memory access wait states.
  196.       bit 1,0 - ROM access wait states control.
  197.            11 - 3 wait states (default)
  198.  
  199.    J. Bank 2/3 Enable Register RB8 - Index 6Ch
  200.       bit 7,6 - The DRAM types used on the system board. 
  201.            00 - Disable (default)
  202.            01 - Reserved
  203.            10 - 256K bit DRAMs used (default)
  204.            11 - 1M bit DRAMs used
  205.       bit 5 - Number of RAM banks used.
  206.           0 - one bank, non-interleaved mode (default)
  207.           1 - two banks
  208.       bit 4 - 2-way/4-way page interleaved mode.
  209.           0 - 2-way page interleaved mode
  210.           1 - 4-way page interleaved mode 
  211.               if all 4 banks are the DRAM type (default)
  212.       bit 3-0 - Reserved and default to 0.
  213.  
  214.    K. EMS Base Address Register RB9 - Index 6Dh
  215.       bit 7-4 - select the expanded memory base addresses.
  216.       7 6 5 4 |    EMS Base Addresses
  217.       -------------------------------------
  218.       0 0 0 0 | C0000h,C4000h,C8000h,CC000h
  219.       0 0 0 1 | C4000h,C8000h,CC000h,D0000h
  220.       0 0 1 0 | C8000h,CC000h,D0000h,D4000h
  221.       0 0 1 1 | CC000h,D0000h,D4000h,D8000h
  222.       0 1 0 0 | D0000h,D4000h,D8000h,DC000h
  223.       0 1 0 1 | D4000h,D8000h,DC000h,E0000h
  224.       0 1 1 0 | D8000h,DC000h,E0000h,E4000h
  225.       0 1 1 1 | DC000h,E0000h,E4000h,E8000h
  226.       1 0 0 0 | E0000h,E4000h,E8000h,EC000h
  227.       others  | Reserved
  228.       -------------------------------------
  229.       bit 3-0 - the EMS page register I/O base address
  230.       3 2 1 0 |    I/O Base Port
  231.       -------------------------------------
  232.       0 0 0 0 | 208h/209h
  233.       0 0 0 1 | 218h/219h
  234.       0 1 0 1 | 258h/259h
  235.       0 1 1 0 | 268h/269h
  236.       1 0 1 0 | 2A8h/2A9h
  237.       1 0 1 1 | 2B8h/2B9h
  238.       1 1 1 0 | 2E8h/2E9h
  239.       others  | Reserved
  240.       -------------------------------------
  241.  
  242.  
  243.    L. EMS Address Extension Register RB10 - Index 6Eh
  244.       bit 7,6 - EMS Page 0 address extension bits
  245.       (A22,A21) Block of EMS Memory
  246.           0 0 - 0 Mbyte to 2 Mbyte
  247.           0 1 - 2 Mbyte to 4 Mbyte
  248.           1 0 - 4 Mbyte to 6 Mbyte
  249.           1 1 - 6 Mbyte to 8 Mbyte
  250.       bit 5,4 - EMS Page 1 address extension bits
  251.       (A22,A21) Block of EMS Memory
  252.           0 0 - 0 Mbyte to 2 Mbyte
  253.           0 1 - 2 Mbyte to 4 Mbyte
  254.           1 0 - 4 Mbyte to 6 Mbyte
  255.           1 1 - 6 Mbyte to 8 Mbyte
  256.       bit 3,2 - EMS Page 2 address extension bits
  257.       (A22,A21) Block of EMS Memory
  258.           0 0 - 0 Mbyte to 2 Mbyte
  259.           0 1 - 2 Mbyte to 4 Mbyte
  260.           1 0 - 4 Mbyte to 6 Mbyte
  261.           1 1 - 6 Mbyte to 8 Mbyte
  262.       bit 1,0 - EMS Page 3 address extension bits
  263.       (A22,A21) Block of EMS Memory
  264.           0 0 - 0 Mbyte to 2 Mbyte
  265.           0 1 - 2 Mbyte to 4 Mbyte
  266.           1 0 - 4 Mbyte to 6 Mbyte
  267.           1 1 - 6 Mbyte to 8 Mbyte
  268.    L. EMS Address Extension Register RB11 - Index 6Fh
  269.       bit 7-5 - to set the EMS memory space size 
  270.         0 0 0 | 1 Mbyte to 1.5 Mbytes (0.5 Mbytes)
  271.         0 0 1 | 1 Mbyte to 2 Mbytes (1 Mbytes)
  272.         0 1 0 | 1 Mbyte to 3 Mbytes (2 Mbytes)
  273.         0 1 1 | 1 Mbyte to 4 Mbytes (3 Mbytes)
  274.         1 0 0 | 1 Mbyte to 5 Mbytes (4 Mbytes)
  275.         1 0 1 | 1 Mbyte to 6 Mbytes (5 Mbytes)
  276.         1 1 0 | 1 Mbyte to 7 Mbytes (6 Mbytes)
  277.         1 1 1 | 1 Mbyte to 8 Mbytes (7 Mbytes)
  278.       bit 4 - external EMS Mapper Enable
  279.         0 - disable (default),  1 - enable
  280.       bit 3 - Reserved
  281.       bit 2 - to enable the RAS time_out counter for page mode operation
  282.         0 - disable (default),  1 - enable
  283.       bit 1 - Address line A20 control and provides OS/2 optimization
  284.               while switching between real and protected modes
  285.         0 - A20 = CPUA20 (default),  1 - A20 = 0
  286.       bit 0 - Reserved
  287.  
  288.  
  289. 3. Programming flow
  290.   A. Main flow 
  291.    (1). Disable NMI and Parity Check
  292.    (2). Initialize 82C206 (01h) and 82C212x (60-6Fh) chip's values
  293.    (3). Determine and set DRAM type
  294.    (4). Determine and set none/2-way/4-way Page Interleaved
  295.    (5). Determine and set EMS size
  296.    (6). Determine and set On system board/ On I/O channel
  297.    (7). Determine and set RAM BIOS/ ROM BIOS mode
  298.    (8). Determine and set relocatable/none-relocatable 640k-1Mbyte
  299.  
  300.   B. Data area
  301.    (1). Index 34h of CMOS byte
  302.        bit 7     - 0 = EMS disable, 1 = EMS enable
  303.        bit 6,5,4 - EMS size (index 6Fh of 82C212x)
  304.        bit 3     - 0 = cannot set RAM BIOS, 1 = can set RAM BIOS
  305.        bit 2     - 1 = force cold start
  306.        bit 1     - 
  307.             a. during NEAT testing interval
  308.                 0 = check and initialize 82C212x, 1 = skip
  309.             b. during later POST testing interval
  310.                 0 = normal keyboard, 1 = manufacture board test
  311.        bit 0     - 0 = ROM BIOS, 1 = RAM BIOS
  312.  
  313.    (2). index 11h of CMOS byte 
  314.         - functions in on_board base memory enable/disable 
  315.           it will be stealed to save on_board base memory flag
  316.        bit 7 --- 512k to 640k (1:enable, 0:disable)  
  317.        bit 6 --- 256k to 511k (0:enable, 1:disable)  
  318.        bit 5 ---   0k to 255k (0:enable, 1:disable) 
  319.        bit 4 --- reserved
  320.        bit 3 --- reserved
  321.        bit 2 --- reserved
  322.        bit 1 --- reserved
  323.        bit 0 --- hard_disk physical format (0:hd_1, 1:hd_2) 
  324.  
  325.   C. the DRAM types of possible combination of Bank 0,1,2,3
  326.                     Bank0    Bank1    Bank2    Bank3
  327.             0  --  Disable  Disable  Disable  Disable
  328.             1  --    256K     None    None     None
  329.             2  --    256K     64K     None     None
  330.             3  --    256K     256K    None     None
  331.             4  --    1M       None    None     None
  332.             5  --    1M       1M      None     None
  333.             6  --    256K     64K     256K     None
  334.             7  --    256K     64K     256K     256K
  335.             8  --    256K     64K     1M       None
  336.             9  --    256K     64K     1M       1M
  337.            10  --    256K     256K    256K     None
  338.            11  --    256K     256K    256K     256K
  339.            12  --    256K     256K    1M       None
  340.            13  --    256K     256K    1M       1M
  341.            14  --    1M       1M      1M       None
  342.            15  --    1M       1M      1M       1M
  343.  
  344.   D. Program Description Language
  345.  
  346.     Start:
  347.     Disable NMI
  348.     Disable parity check and Clear parity error
  349.     Set 82C206 initial value 
  350.     ( index 01h of Neat = 0C0h )
  351.     IF not warm boot THEN
  352.        Set PROCCLK = CLK2IN, Disable Local bus READY timeout NMI
  353.        ( index 60h of Neat = 042h )
  354.     ENDIF
  355.     Enable extra address bus hold time and Quick mode,
  356.     AT Bus 16 bit memory command delay = 0 BCLK cycle,
  357.     AT Bus 8 bit memory command delay = 1 BCLK cycle,
  358.     AT Bus I/O cycle command delay = 1 BCLK cycle
  359.     ( index 61h of Neat = 0C5h )
  360.     IF Version 82C212 THEN
  361.        16 bit AT cycle = 3 wait states
  362.        8 bit AT cycle = 3 wait states
  363.        Bus Clock (BCLK) = ATCLK (Asynchronous)
  364.        ( index 62h of Neat = 03Eh )
  365.        EMS memory size = 1Mbyte to 2 Mbytes
  366.        Disable external EMS Mapper
  367.        Disable RAS time_out counter
  368.        A20 = CPUA20
  369.        ( index 6Fh of Neat = 020h )
  370.     ELSE IF Version 82C212B or others THEN
  371.        16 bit AT cycle = 3 wait states
  372.        8 bit AT cycle = 3 wait states
  373.        Bus Clock (BCLK) = ATCLK (Asynchronous)
  374.        ( index 62h of Neat = 0BEh )
  375.        EMS memory size = 1Mbyte to 2 Mbytes
  376.        Disable external EMS Mapper
  377.        Disable RAS time_out counter
  378.        A20 = 0
  379.        ( index 06Fh of Neat = 022h )
  380.     ENDIF
  381.        ( index 065h of Neat = 00Eh ) ; Enable ROM BIOS (F0000-FFFFFh)
  382.        ( index 066h of Neat = 080h ) ; Enable On system board 640K
  383.        ( index 067h of Neat = 000h ) ; Disable A0000-BFFFFh Shadow RAM
  384.        ( index 068h of Neat = 000h ) ; Disable C0000-DFFFFh Shadow RAM
  385.        ( index 069h of Neat = 000h ) ; Disable E0000-FFFFFh Shadow RAM
  386.        ( index 06Ah of Neat = 0E0h ) ; bank 0/1 = 1M bit DRAMs used, 2 banks
  387.        ( index 06Bh of Neat = 027h ) ; Disable Page/Interleaved mode,
  388.                                      ; non_relocatable, 1 RAM wait state 
  389.                                      ; 3 ROM wait states
  390.        ( index 06Ch of Neat = 000h ) ; Disable bank 2/3
  391.        ( index 06Dh of Neat = 042h ) ; Select unsed combination of EMS 
  392.        ( index 06Eh of Neat = 000h ) ; EMS Page 0-3 addr = 0 Mbyte to 2 Mbyte
  393.  
  394.      Check DRAM types of combination of Bank 0,1,2,3 and Set Neat
  395.      IF Bank 0,1,2,3 are same THEN 
  396.         Set DRAM to 4-way page interleaved 
  397.         Enable page interleaved 
  398.         Set RAM = 0 wait state
  399.      ELSE IF Bank 0,1 are same or Bank 2,3 are same THEN 
  400.         Set DRAM to 2-way page interleaved
  401.         Enable page interleaved 
  402.         Set RAM = 0 wait state
  403.      ELSE 
  404.         Set RAM = 1 wait state
  405.      ENDIF
  406.      IF Check CMOS sum (10h- 2Dh) error THEN
  407.         Set index 34h of CMOS byte = 0
  408.      ENDIF
  409.      IF bit 7 of index 34h of CMOS byte = 1 THEN
  410.         Enable EMS
  411.         Check ans set EMS size according to bit 6,5,4 of index 34h of CMOS byte
  412.      ELSE
  413.         Disable EMS
  414.      ENDIF
  415.      Enable on board system memory
  416.      Set bit 3 of index 34 of CMOS byte = 0 (cannot use RAM BIOS) (default)
  417.      IF bit 0 of index 34 of CMOS byte = 0 (ROM BIOS) THEN
  418.         IF memory = 1M byte THEN
  419.            Set relocatable
  420.         ELSE
  421.            Set non_relocatable
  422.            IF memory >= 1Mb THEN
  423.               IF move ROM BIOS to RAM BIOS no error THEN
  424.                  Set bit 3 of index 34 of CMOS byte = 1 (can use RAM BIOS)
  425.               ENDIF
  426.            ENDIF
  427.         ENDIF
  428.      ENDIF
  429.      set [SS] = 0 ans [SP] = 08000h
  430.      End:
  431.  
  432.