Changeset 5155
- Timestamp:
- Feb 24, 2010 2:09:09 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/northbridge/intel/e7501/raminit.c (modified) (45 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/northbridge/intel/e7501/raminit.c
r3624 r5155 808 808 //---------------------------------------------------------------------------------- 809 809 // Function: do_ram_command 810 // Parameters: ctrl - PCI addresses of memory controller functions, and 811 // SMBus addresses of DIMM slots on the mainboard 810 // Parameters: 812 811 // command - specifies the command to be sent to the DIMMs: 813 812 // RAM_COMMAND_NOP - No Operation … … 822 821 // Description: Send the specified command to all DIMMs. 823 822 // 824 static void do_ram_command(const struct mem_controller *ctrl, uint8_t command, 825 uint16_t jedec_mode_bits) 823 static void do_ram_command(uint8_t command, uint16_t jedec_mode_bits) 826 824 { 827 825 int i; … … 831 829 832 830 // Configure the RAM command 833 dram_controller_mode = pci_read_config32( ctrl->d0, DRC);831 dram_controller_mode = pci_read_config32(PCI_DEV(0, 0, 0), DRC); 834 832 dram_controller_mode &= 0xFFFFFF8F; 835 833 dram_controller_mode |= command; 836 pci_write_config32( ctrl->d0, DRC, dram_controller_mode);834 pci_write_config32(PCI_DEV(0, 0, 0), DRC, dram_controller_mode); 837 835 838 836 // RAM_COMMAND_NORMAL is an exception. … … 866 864 for (i = 0; i < (MAX_NUM_CHANNELS * MAX_DIMM_SOCKETS_PER_CHANNEL); ++i) { 867 865 868 uint8_t dimm_end_64M_multiple = pci_read_config8( ctrl->d0, DRB_ROW_0 + i);866 uint8_t dimm_end_64M_multiple = pci_read_config8(PCI_DEV(0, 0, 0), DRB_ROW_0 + i); 869 867 if (dimm_end_64M_multiple > dimm_start_64M_multiple) { 870 868 … … 891 889 //---------------------------------------------------------------------------------- 892 890 // Function: set_ram_mode 893 // Parameters: ctrl - PCI addresses of memory controller functions, and 894 // SMBus addresses of DIMM slots on the mainboard 895 // jedec_mode_bits - for mode register set & extended mode register set 896 // commands, bits 0-12 contain the register value in JEDEC format. 891 // Parameters: jedec_mode_bits - for mode register set & extended mode register set 892 // commands, bits 0-12 contain the register value in JEDEC format. 897 893 // Return Value: None 898 894 // Description: Set the mode register of all DIMMs. The proper CAS# latency 899 895 // setting is added to the mode bits specified by the caller. 900 896 // 901 static void set_ram_mode( const struct mem_controller *ctrl,uint16_t jedec_mode_bits)897 static void set_ram_mode(uint16_t jedec_mode_bits) 902 898 { 903 899 ASSERT(!(jedec_mode_bits & SDRAM_CAS_MASK)); 904 900 905 uint32_t dram_cas_latency = pci_read_config32( ctrl->d0, DRT) & DRT_CAS_MASK;901 uint32_t dram_cas_latency = pci_read_config32(PCI_DEV(0, 0, 0), DRT) & DRT_CAS_MASK; 906 902 907 903 switch (dram_cas_latency) { … … 919 915 } 920 916 921 do_ram_command( ctrl,RAM_COMMAND_MRS, jedec_mode_bits);917 do_ram_command(RAM_COMMAND_MRS, jedec_mode_bits); 922 918 } 923 919 … … 928 924 //---------------------------------------------------------------------------------- 929 925 // Function: configure_dimm_row_boundaries 930 // Parameters: ctrl - PCI addresses of memory controller functions, and 931 // SMBus addresses of DIMM slots on the mainboard 926 // Parameters: 932 927 // dimm_log2_num_bits - log2(number of bits) for each side of the DIMM 933 928 // total_dram_64M_multiple - total DRAM in the system (as a … … 939 934 // present in the specified DIMM. 940 935 // 941 static uint8_t configure_dimm_row_boundaries( const struct mem_controller *ctrl,936 static uint8_t configure_dimm_row_boundaries( 942 937 struct dimm_size dimm_log2_num_bits, 943 938 uint8_t total_dram_64M_multiple, … … 968 963 969 964 // Configure the boundary address for the row on side 1 970 pci_write_config8( ctrl->d0, DRB_ROW_0+(dimm_index<<1), total_dram_64M_multiple);965 pci_write_config8(PCI_DEV(0, 0, 0), DRB_ROW_0+(dimm_index<<1), total_dram_64M_multiple); 971 966 972 967 // If the DIMMs are double-sided, add the capacity of side 2 this DIMM pair … … 976 971 977 972 // Configure the boundary address for the row (if any) on side 2 978 pci_write_config8( ctrl->d0, DRB_ROW_1+(dimm_index<<1), total_dram_64M_multiple);973 pci_write_config8(PCI_DEV(0, 0, 0), DRB_ROW_1+(dimm_index<<1), total_dram_64M_multiple); 979 974 980 975 // Update boundaries for rows subsequent to these. … … 982 977 983 978 for(i=dimm_index+1; i<MAX_DIMM_SOCKETS_PER_CHANNEL; i++) { 984 pci_write_config8( ctrl->d0, DRB_ROW_0+(i<<1), total_dram_64M_multiple);985 pci_write_config8( ctrl->d0, DRB_ROW_1+(i<<1), total_dram_64M_multiple);979 pci_write_config8(PCI_DEV(0, 0, 0), DRB_ROW_0+(i<<1), total_dram_64M_multiple); 980 pci_write_config8(PCI_DEV(0, 0, 0), DRB_ROW_1+(i<<1), total_dram_64M_multiple); 986 981 } 987 982 … … 1009 1004 // Configure the E7501's DRAM row boundaries 1010 1005 // Start by zeroing out the temporary initial configuration 1011 pci_write_config32( ctrl->d0, DRB_ROW_0, 0);1012 pci_write_config32( ctrl->d0, DRB_ROW_4, 0);1006 pci_write_config32(PCI_DEV(0, 0, 0), DRB_ROW_0, 0); 1007 pci_write_config32(PCI_DEV(0, 0, 0), DRB_ROW_4, 0); 1013 1008 1014 1009 for(i = 0; i < MAX_DIMM_SOCKETS_PER_CHANNEL; i++) { … … 1031 1026 die("Bad SPD value\r\n"); 1032 1027 1033 total_dram_64M_multiple = configure_dimm_row_boundaries( ctrl,sz, total_dram_64M_multiple, i);1028 total_dram_64M_multiple = configure_dimm_row_boundaries(sz, total_dram_64M_multiple, i); 1034 1029 } 1035 1030 … … 1065 1060 uint16_t top_of_low_memory = total_dram_128M_multiple << 11; 1066 1061 1067 pci_write_config16( ctrl->d0, TOLM, top_of_low_memory);1062 pci_write_config16(PCI_DEV(0, 0, 0), TOLM, top_of_low_memory); 1068 1063 1069 1064 } else { … … 1077 1072 // Put TOLM at 3 GB 1078 1073 1079 pci_write_config16( ctrl->d0, TOLM, 0xc000);1074 pci_write_config16(PCI_DEV(0, 0, 0), TOLM, 0xc000); 1080 1075 1081 1076 // Define a remap window to make the RAM that would appear from 3 GB - 4 GB … … 1090 1085 } 1091 1086 1092 pci_write_config16( ctrl->d0, REMAPBASE, remap_base);1093 pci_write_config16( ctrl->d0, REMAPLIMIT, remap_limit);1087 pci_write_config16(PCI_DEV(0, 0, 0), REMAPBASE, remap_base); 1088 pci_write_config16(PCI_DEV(0, 0, 0), REMAPLIMIT, remap_limit); 1094 1089 } 1095 1090 } … … 1097 1092 //---------------------------------------------------------------------------------- 1098 1093 // Function: initialize_ecc 1099 // Parameters: ctrl - PCI addresses of memory controller functions, and 1100 // SMBus addresses of DIMM slots on the mainboard 1094 // Parameters: None 1101 1095 // Return Value: None 1102 1096 // Description: If we're configured to use ECC, initialize the SDRAM and 1103 1097 // clear the E7501's ECC error flags. 1104 1098 // 1105 static void initialize_ecc( const struct mem_controller *ctrl)1099 static void initialize_ecc(void) 1106 1100 { 1107 1101 uint32_t dram_controller_mode; 1108 1102 1109 1103 /* Test to see if ECC support is enabled */ 1110 dram_controller_mode = pci_read_config32( ctrl->d0, DRC);1104 dram_controller_mode = pci_read_config32(PCI_DEV(0, 0, 0), DRC); 1111 1105 dram_controller_mode >>= 20; 1112 1106 dram_controller_mode &= 3; … … 1117 1111 RAM_DEBUG_MESSAGE("Initializing ECC state...\r\n"); 1118 1112 /* Initialize ECC bits , use ECC zero mode (new to 7501)*/ 1119 pci_write_config8( ctrl->d0, MCHCFGNS, 0x06);1120 pci_write_config8( ctrl->d0, MCHCFGNS, 0x07);1113 pci_write_config8(PCI_DEV(0, 0, 0), MCHCFGNS, 0x06); 1114 pci_write_config8(PCI_DEV(0, 0, 0), MCHCFGNS, 0x07); 1121 1115 1122 1116 // Wait for scrub cycle to complete 1123 1117 do { 1124 byte = pci_read_config8( ctrl->d0, MCHCFGNS);1118 byte = pci_read_config8(PCI_DEV(0, 0, 0), MCHCFGNS); 1125 1119 1126 1120 } while ( (byte & 0x08 ) == 0); 1127 1121 1128 pci_write_config8( ctrl->d0, MCHCFGNS, byte & 0xfc);1122 pci_write_config8(PCI_DEV(0, 0, 0), MCHCFGNS, byte & 0xfc); 1129 1123 RAM_DEBUG_MESSAGE("ECC state initialized.\r\n"); 1130 1124 1131 1125 /* Clear the ECC error bits */ 1132 pci_write_config8( ctrl->d0f1, DRAM_FERR, 0x03);1133 pci_write_config8( ctrl->d0f1, DRAM_NERR, 0x03);1126 pci_write_config8(PCI_DEV(0, 0, 1), DRAM_FERR, 0x03); 1127 pci_write_config8(PCI_DEV(0, 0, 1), DRAM_NERR, 0x03); 1134 1128 1135 1129 // Clear DRAM Interface error bits (write-one-clear) 1136 pci_write_config32( ctrl->d0f1, FERR_GLOBAL, 1<<18);1137 pci_write_config32( ctrl->d0f1, NERR_GLOBAL, 1<<18);1130 pci_write_config32(PCI_DEV(0, 0, 1), FERR_GLOBAL, 1<<18); 1131 pci_write_config32(PCI_DEV(0, 0, 1), NERR_GLOBAL, 1<<18); 1138 1132 1139 1133 // Start normal ECC scrub 1140 pci_write_config8( ctrl->d0, MCHCFGNS, 5);1134 pci_write_config8(PCI_DEV(0, 0, 0), MCHCFGNS, 5); 1141 1135 } 1142 1136 … … 1162 1156 uint8_t slowest_ras_cas_delay = 0; 1163 1157 uint8_t slowest_active_to_precharge_delay = 0; 1164 uint32_t current_cas_latency = pci_read_config32( ctrl->d0, DRT) & DRT_CAS_MASK;1158 uint32_t current_cas_latency = pci_read_config32(PCI_DEV(0, 0, 0), DRT) & DRT_CAS_MASK; 1165 1159 1166 1160 // CAS# latency must be programmed beforehand … … 1201 1195 1202 1196 /* Read the initial state */ 1203 dram_timing = pci_read_config32( ctrl->d0, DRT);1197 dram_timing = pci_read_config32(PCI_DEV(0, 0, 0), DRT); 1204 1198 1205 1199 /* Trp */ … … 1261 1255 dram_timing |= (1<<28); // 4 clocks 1262 1256 1263 pci_write_config32( ctrl->d0, DRT, dram_timing);1257 pci_write_config32(PCI_DEV(0, 0, 0), DRT, dram_timing); 1264 1258 1265 1259 return; … … 1352 1346 */ 1353 1347 1354 dram_timing = pci_read_config32( ctrl->d0, DRT);1348 dram_timing = pci_read_config32(PCI_DEV(0, 0, 0), DRT); 1355 1349 dram_timing &= ~(DRT_CAS_MASK); 1356 1350 1357 maybe_dram_read_timing = pci_read_config16( ctrl->d0, MAYBE_DRDCTL);1351 maybe_dram_read_timing = pci_read_config16(PCI_DEV(0, 0, 0), MAYBE_DRDCTL); 1358 1352 maybe_dram_read_timing &= 0xF00C; 1359 1353 … … 1364 1358 else if (system_compatible_cas_latencies & SPD_CAS_LATENCY_2_5) { 1365 1359 1366 uint32_t dram_row_attributes = pci_read_config32( ctrl->d0, DRA);1360 uint32_t dram_row_attributes = pci_read_config32(PCI_DEV(0, 0, 0), DRA); 1367 1361 1368 1362 dram_timing |= DRT_CAS_2_5; … … 1385 1379 die("No CAS# latencies compatible with all DIMMs!!\r\n"); 1386 1380 1387 pci_write_config32( ctrl->d0, DRT, dram_timing);1381 pci_write_config32(PCI_DEV(0, 0, 0), DRT, dram_timing); 1388 1382 1389 1383 /* set master DLL reset */ 1390 dword = pci_read_config32( ctrl->d0, 0x88);1384 dword = pci_read_config32(PCI_DEV(0, 0, 0), 0x88); 1391 1385 dword |= (1<<26); 1392 pci_write_config32( ctrl->d0, 0x88, dword);1386 pci_write_config32(PCI_DEV(0, 0, 0), 0x88, dword); 1393 1387 1394 1388 dword &= 0x0c0007ff; /* patch try register 88 is undocumented tnz */ 1395 1389 dword |= 0xd2109800; 1396 1390 1397 pci_write_config32( ctrl->d0, 0x88, dword);1398 1399 1400 pci_write_config16( ctrl->d0, MAYBE_DRDCTL, maybe_dram_read_timing);1401 1402 dword = pci_read_config32( ctrl->d0, 0x88); /* reset master DLL reset */1391 pci_write_config32(PCI_DEV(0, 0, 0), 0x88, dword); 1392 1393 1394 pci_write_config16(PCI_DEV(0, 0, 0), MAYBE_DRDCTL, maybe_dram_read_timing); 1395 1396 dword = pci_read_config32(PCI_DEV(0, 0, 0), 0x88); /* reset master DLL reset */ 1403 1397 dword &= ~(1<<26); 1404 pci_write_config32( ctrl->d0, 0x88, dword);1398 pci_write_config32(PCI_DEV(0, 0, 0), 0x88, dword); 1405 1399 1406 1400 return; … … 1427 1421 1428 1422 // Initial settings 1429 uint32_t controller_mode = pci_read_config32( ctrl->d0, DRC);1423 uint32_t controller_mode = pci_read_config32(PCI_DEV(0, 0, 0), DRC); 1430 1424 uint32_t system_refresh_mode = (controller_mode >> 8) & 7; 1431 1425 … … 1508 1502 1509 1503 // Configure the E7501 1510 pci_write_config32( ctrl->d0, DRC, controller_mode);1504 pci_write_config32(PCI_DEV(0, 0, 0), DRC, controller_mode); 1511 1505 } 1512 1506 … … 1563 1557 1564 1558 /* Write the new row attributes register */ 1565 pci_write_config32( ctrl->d0, DRA, row_attributes);1559 pci_write_config32(PCI_DEV(0, 0, 0), DRA, row_attributes); 1566 1560 } 1567 1561 1568 1562 //---------------------------------------------------------------------------------- 1569 1563 // Function: enable_e7501_clocks 1570 // Parameters: ctrl - PCI addresses of memory controller functions, and 1571 // SMBus addresses of DIMM slots on the mainboard 1572 // dimm_mask - bitmask of populated DIMMs on the board - see 1564 // Parameters: dimm_mask - bitmask of populated DIMMs on the board - see 1573 1565 // spd_get_supported_dimms() 1574 1566 // Return Value: None … … 1576 1568 // for unpopulated sockets (to reduce EMI). 1577 1569 // 1578 static void enable_e7501_clocks( const struct mem_controller *ctrl,uint8_t dimm_mask)1570 static void enable_e7501_clocks(uint8_t dimm_mask) 1579 1571 { 1580 1572 int i; 1581 uint8_t clock_disable = pci_read_config8( ctrl->d0, CKDIS);1573 uint8_t clock_disable = pci_read_config8(PCI_DEV(0, 0, 0), CKDIS); 1582 1574 1583 1575 for (i = 0; i < MAX_DIMM_SOCKETS_PER_CHANNEL; i++) { … … 1591 1583 } 1592 1584 1593 pci_write_config8( ctrl->d0, CKDIS, clock_disable);1585 pci_write_config8(PCI_DEV(0, 0, 0), CKDIS, clock_disable); 1594 1586 } 1595 1587 … … 1606 1598 // Description: DDR Receive FIFO RE-Sync (?) 1607 1599 // 1608 static void RAM_RESET_DDR_PTR( const struct mem_controller *ctrl)1600 static void RAM_RESET_DDR_PTR(void) 1609 1601 { 1610 1602 uint8_t byte; 1611 byte = pci_read_config8( ctrl->d0, 0x88);1603 byte = pci_read_config8(PCI_DEV(0, 0, 0), 0x88); 1612 1604 byte |= (1 << 4); 1613 pci_write_config8( ctrl->d0, 0x88, byte);1614 1615 byte = pci_read_config8( ctrl->d0, 0x88);1605 pci_write_config8(PCI_DEV(0, 0, 0), 0x88, byte); 1606 1607 byte = pci_read_config8(PCI_DEV(0, 0, 0), 0x88); 1616 1608 byte &= ~(1 << 4); 1617 pci_write_config8( ctrl->d0, 0x88, byte);1609 pci_write_config8(PCI_DEV(0, 0, 0), 0x88, byte); 1618 1610 } 1619 1611 1620 1612 //---------------------------------------------------------------------------------- 1621 1613 // Function: ram_set_d0f0_regs 1622 // Parameters: ctrl - PCI addresses of memory controller functions, and 1623 // SMBus addresses of DIMM slots on the mainboard 1614 // Parameters: None 1624 1615 // Return Value: None 1625 1616 // Description: Set E7501 registers that are either independent of DIMM specifics, … … 1630 1621 // configuration register offset, mask, and bits to set. 1631 1622 // 1632 static void ram_set_d0f0_regs( const struct mem_controller *ctrl)1623 static void ram_set_d0f0_regs(void) 1633 1624 { 1634 1625 int i; … … 1652 1643 ASSERT((bits_to_mask & bits_to_set) == 0); 1653 1644 1654 register_value = pci_read_config32( ctrl->d0, register_offset);1645 register_value = pci_read_config32(PCI_DEV(0, 0, 0), register_offset); 1655 1646 register_value &= bits_to_mask; 1656 1647 register_value |= bits_to_set; 1657 1648 1658 pci_write_config32( ctrl->d0, register_offset, register_value);1649 pci_write_config32(PCI_DEV(0, 0, 0), register_offset, register_value); 1659 1650 } 1660 1651 } … … 1679 1670 //---------------------------------------------------------------------------------- 1680 1671 // Function: ram_set_rcomp_regs 1681 // Parameters: ctrl - PCI addresses of memory controller functions, and 1682 // SMBus addresses of DIMM slots on the mainboard 1672 // Parameters: None 1683 1673 // Return Value: None 1684 1674 // Description: Set the E7501's (undocumented) RCOMP registers. … … 1689 1679 // between the E7501 and these two chips. 1690 1680 // 1691 static void ram_set_rcomp_regs( const struct mem_controller *ctrl)1681 static void ram_set_rcomp_regs(void) 1692 1682 { 1693 1683 uint32_t dword; … … 1697 1687 1698 1688 /*enable access to the rcomp bar*/ 1699 dword = pci_read_config32( ctrl->d0, MAYBE_MCHTST);1689 dword = pci_read_config32(PCI_DEV(0, 0, 0), MAYBE_MCHTST); 1700 1690 dword |= (1<<22); 1701 pci_write_config32( ctrl->d0, MAYBE_MCHTST, dword);1691 pci_write_config32(PCI_DEV(0, 0, 0), MAYBE_MCHTST, dword); 1702 1692 1703 1693 1704 1694 // Set the RCOMP MMIO base address 1705 pci_write_config32( ctrl->d0, MAYBE_SMRBASE, RCOMP_MMIO);1695 pci_write_config32(PCI_DEV(0, 0, 0), MAYBE_SMRBASE, RCOMP_MMIO); 1706 1696 1707 1697 // Block RCOMP updates while we configure the registers … … 1790 1780 1791 1781 /*disable access to the rcomp bar */ 1792 dword = pci_read_config32( ctrl->d0, MAYBE_MCHTST);1782 dword = pci_read_config32(PCI_DEV(0, 0, 0), MAYBE_MCHTST); 1793 1783 dword &= ~(1<<22); 1794 pci_write_config32( ctrl->d0, MAYBE_MCHTST, dword);1784 pci_write_config32(PCI_DEV(0, 0, 0), MAYBE_MCHTST, dword); 1795 1785 1796 1786 } … … 1812 1802 static void sdram_enable(int controllers, const struct mem_controller *ctrl) 1813 1803 { 1814 uint8_t dimm_mask = pci_read_config16( ctrl->d0, SKPD);1804 uint8_t dimm_mask = pci_read_config16(PCI_DEV(0, 0, 0), SKPD); 1815 1805 uint32_t dram_controller_mode; 1816 1806 … … 1829 1819 /* 3. Apply NOP */ 1830 1820 RAM_DEBUG_MESSAGE("Ram Enable 3\r\n"); 1831 do_ram_command( ctrl,RAM_COMMAND_NOP, 0);1821 do_ram_command(RAM_COMMAND_NOP, 0); 1832 1822 EXTRA_DELAY 1833 1823 1834 1824 /* 4 Precharge all */ 1835 1825 RAM_DEBUG_MESSAGE("Ram Enable 4\r\n"); 1836 do_ram_command( ctrl,RAM_COMMAND_PRECHARGE, 0);1826 do_ram_command(RAM_COMMAND_PRECHARGE, 0); 1837 1827 EXTRA_DELAY 1838 1828 … … 1840 1830 /* 5. Issue EMRS to enable DLL */ 1841 1831 RAM_DEBUG_MESSAGE("Ram Enable 5\r\n"); 1842 do_ram_command( ctrl,RAM_COMMAND_EMRS, SDRAM_EXTMODE_DLL_ENABLE | SDRAM_EXTMODE_DRIVE_NORMAL);1832 do_ram_command(RAM_COMMAND_EMRS, SDRAM_EXTMODE_DLL_ENABLE | SDRAM_EXTMODE_DRIVE_NORMAL); 1843 1833 EXTRA_DELAY 1844 1834 1845 1835 /* 6. Reset DLL */ 1846 1836 RAM_DEBUG_MESSAGE("Ram Enable 6\r\n"); 1847 set_ram_mode( ctrl,E7501_SDRAM_MODE | SDRAM_MODE_DLL_RESET);1837 set_ram_mode(E7501_SDRAM_MODE | SDRAM_MODE_DLL_RESET); 1848 1838 EXTRA_DELAY 1849 1839 … … 1857 1847 /* 7 Precharge all */ 1858 1848 RAM_DEBUG_MESSAGE("Ram Enable 7\r\n"); 1859 do_ram_command( ctrl,RAM_COMMAND_PRECHARGE, 0);1849 do_ram_command(RAM_COMMAND_PRECHARGE, 0); 1860 1850 EXTRA_DELAY 1861 1851 1862 1852 /* 8 Now we need 2 AUTO REFRESH / CBR cycles to be performed */ 1863 1853 RAM_DEBUG_MESSAGE("Ram Enable 8\r\n"); 1864 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1854 do_ram_command(RAM_COMMAND_CBR, 0); 1865 1855 EXTRA_DELAY 1866 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1856 do_ram_command(RAM_COMMAND_CBR, 0); 1867 1857 EXTRA_DELAY 1868 1858 /* And for good luck 6 more CBRs */ 1869 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1859 do_ram_command(RAM_COMMAND_CBR, 0); 1870 1860 EXTRA_DELAY 1871 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1861 do_ram_command(RAM_COMMAND_CBR, 0); 1872 1862 EXTRA_DELAY 1873 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1863 do_ram_command(RAM_COMMAND_CBR, 0); 1874 1864 EXTRA_DELAY 1875 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1865 do_ram_command(RAM_COMMAND_CBR, 0); 1876 1866 EXTRA_DELAY 1877 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1867 do_ram_command(RAM_COMMAND_CBR, 0); 1878 1868 EXTRA_DELAY 1879 do_ram_command( ctrl,RAM_COMMAND_CBR, 0);1869 do_ram_command(RAM_COMMAND_CBR, 0); 1880 1870 EXTRA_DELAY 1881 1871 1882 1872 /* 9 mode register set */ 1883 1873 RAM_DEBUG_MESSAGE("Ram Enable 9\r\n"); 1884 set_ram_mode( ctrl,E7501_SDRAM_MODE | SDRAM_MODE_NORMAL);1874 set_ram_mode(E7501_SDRAM_MODE | SDRAM_MODE_NORMAL); 1885 1875 EXTRA_DELAY 1886 1876 1887 1877 /* 10 DDR Receive FIFO RE-Sync */ 1888 1878 RAM_DEBUG_MESSAGE("Ram Enable 10\r\n"); 1889 RAM_RESET_DDR_PTR( ctrl);1879 RAM_RESET_DDR_PTR(); 1890 1880 EXTRA_DELAY 1891 1881 1892 1882 /* 11 normal operation */ 1893 1883 RAM_DEBUG_MESSAGE("Ram Enable 11\r\n"); 1894 do_ram_command( ctrl,RAM_COMMAND_NORMAL, 0);1884 do_ram_command(RAM_COMMAND_NORMAL, 0); 1895 1885 EXTRA_DELAY 1896 1886 … … 1900 1890 1901 1891 /* Finally enable refresh */ 1902 dram_controller_mode = pci_read_config32( ctrl->d0, DRC);1892 dram_controller_mode = pci_read_config32(PCI_DEV(0, 0, 0), DRC); 1903 1893 dram_controller_mode |= (1 << 29); 1904 pci_write_config32( ctrl->d0, DRC, dram_controller_mode);1894 pci_write_config32(PCI_DEV(0, 0, 0), DRC, dram_controller_mode); 1905 1895 EXTRA_DELAY 1906 1896 1907 initialize_ecc( ctrl);1908 1909 dram_controller_mode = pci_read_config32( ctrl->d0, DRC); /* FCS_EN */1897 initialize_ecc(); 1898 1899 dram_controller_mode = pci_read_config32(PCI_DEV(0, 0, 0), DRC); /* FCS_EN */ 1910 1900 dram_controller_mode |= (1<<17); // NOTE: undocumented reserved bit 1911 pci_write_config32( ctrl->d0, DRC, dram_controller_mode);1901 pci_write_config32(PCI_DEV(0, 0, 0), DRC, dram_controller_mode); 1912 1902 1913 1903 RAM_DEBUG_MESSAGE("Northbridge following SDRAM init:\r\n"); … … 1941 1931 } else { 1942 1932 1943 enable_e7501_clocks( ctrl,dimm_mask);1933 enable_e7501_clocks(dimm_mask); 1944 1934 1945 1935 RAM_DEBUG_MESSAGE("setting based on SPD data...\r\n"); … … 1948 1938 configure_e7501_dram_controller_mode(ctrl, dimm_mask); 1949 1939 configure_e7501_cas_latency(ctrl, dimm_mask); 1950 RAM_RESET_DDR_PTR( ctrl);1940 RAM_RESET_DDR_PTR(); 1951 1941 1952 1942 configure_e7501_dram_timing(ctrl, dimm_mask); … … 1964 1954 // configure_e7501_ram_addresses() without having to regenerate the bitmask 1965 1955 // of usable DIMMs. 1966 pci_write_config16( ctrl->d0, SKPD, dimm_mask);1956 pci_write_config16(PCI_DEV(0, 0, 0), SKPD, dimm_mask); 1967 1957 } 1968 1958 … … 1980 1970 DUMPNORTH(); 1981 1971 1982 ram_set_rcomp_regs( ctrl);1983 ram_set_d0f0_regs( ctrl);1972 ram_set_rcomp_regs(); 1973 ram_set_d0f0_regs(); 1984 1974 } 1985 1975
Note: See TracChangeset
for help on using the changeset viewer.
