Changeset 5073


Ignore:
Timestamp:
Feb 1, 2010 11:51:18 PM (3 years ago)
Author:
linux_junkie
Message:

Alot of it is trivial clean ups and 830 is now able to initialize one row/side of memory at a time.
Signed-off-by: Joseph Smith <joe@…>
Acked-by: Stefan Reinauer <stepan@…>

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mainboard/rca/rm4100/auto.c

    r5069 r5073  
    7070 
    7171#include "northbridge/intel/i82830/raminit.c" 
    72 #include "lib/generic_sdram.c" 
    7372 
    7473/** 
     
    104103static void main(unsigned long bist) 
    105104{ 
    106         static const struct mem_controller memctrl[] = { 
    107                 { 
    108                         .d0 = PCI_DEV(0, 0, 0), 
    109                         .channel0 = {0x50, 0x51}, 
    110                 } 
    111         }; 
    112  
    113105        if (bist == 0) 
    114106                early_mtrr_init(); 
     
    130122        mb_early_setup(); 
    131123 
    132         /* SDRAM init */ 
    133         sdram_set_registers(memctrl); 
    134         sdram_set_spd_registers(memctrl); 
    135         sdram_enable(0, memctrl); 
     124        /* Initialize memory */ 
     125        sdram_initialize(); 
    136126 
    137127        /* Check RAM. */ 
  • trunk/src/mainboard/thomson/ip1000/auto.c

    r5069 r5073  
    7070 
    7171#include "northbridge/intel/i82830/raminit.c" 
    72 #include "lib/generic_sdram.c" 
    7372 
    7473/** 
     
    104103static void main(unsigned long bist) 
    105104{ 
    106         static const struct mem_controller memctrl[] = { 
    107                 { 
    108                         .d0 = PCI_DEV(0, 0, 0), 
    109                         .channel0 = {0x50, 0x51}, 
    110                 } 
    111         }; 
    112  
    113105        if (bist == 0) 
    114106                early_mtrr_init(); 
     
    130122        mb_early_setup(); 
    131123 
    132         /* SDRAM init */ 
    133         sdram_set_registers(memctrl); 
    134         sdram_set_spd_registers(memctrl); 
    135         sdram_enable(0, memctrl); 
     124        /* Initialize memory */ 
     125        sdram_initialize(); 
    136126 
    137127        /* Check RAM. */ 
  • trunk/src/northbridge/intel/i82830/raminit.c

    r3653 r5073  
    22 * This file is part of the coreboot project. 
    33 * 
    4  * Copyright (C) 2008 Joseph Smith <joe@smittys.pointclark.net> 
     4 * Copyright (C) 2008-2010 Joseph Smith <joe@settoplinux.org> 
    55 * 
    66 * This program is free software; you can redistribute it and/or modify 
     
    6868 
    6969/*----------------------------------------------------------------------------- 
    70 SDRAM configuration functions. 
     70DIMM-initialization functions. 
    7171-----------------------------------------------------------------------------*/ 
    7272 
    73 /* Send the specified RAM command to all DIMMs. */ 
    74  
    75 static void do_ram_command(const struct mem_controller *ctrl, uint32_t command, 
    76                            uint32_t addr_offset) 
    77 { 
    78         int i; 
    79         uint8_t dimm_start, dimm_end; 
     73static void do_ram_command(uint32_t command) 
     74{ 
    8075        uint32_t reg32; 
    8176 
    8277        /* Configure the RAM command. */ 
    83         reg32 = pci_read_config32(ctrl->d0, DRC); 
     78        reg32 = pci_read_config32(NORTHBRIDGE, DRC); 
    8479        /* Clear bits 29, 10-8, 6-4. */ 
    8580        reg32 &= 0xdffff88f; 
    8681        reg32 |= command << 4; 
    87         pci_write_config32(ctrl->d0, DRC, reg32); 
    88  
    89         /* Send the ram command to each row of memory. 
    90          * (DIMM_SOCKETS * 2) is the maximum number of rows possible. 
    91          * Note: Each DRB defines the upper boundary address of  
    92          * each SDRAM row in 32-MB granularity. 
    93          */ 
     82        pci_write_config32(NORTHBRIDGE, DRC, reg32); 
     83        PRINT_DEBUG("RAM command 0x"); 
     84        PRINT_DEBUG_HEX32(reg32); 
     85        PRINT_DEBUG("\r\n"); 
     86} 
     87 
     88static void ram_read32(uint8_t dimm_start, uint32_t offset) 
     89{ 
     90        if (offset == 0x55aa55aa) { 
     91                PRINT_DEBUG("  Reading RAM at 0x"); 
     92                PRINT_DEBUG_HEX32(dimm_start * 32 * 1024 * 1024); 
     93                PRINT_DEBUG(" => 0x"); 
     94                PRINT_DEBUG_HEX32(read32(dimm_start * 32 * 1024 * 1024)); 
     95                PRINT_DEBUG("\r\n"); 
     96 
     97                PRINT_DEBUG("  Writing RAM at 0x"); 
     98                PRINT_DEBUG_HEX32(dimm_start * 32 * 1024 * 1024); 
     99                PRINT_DEBUG(" <= 0x"); 
     100                PRINT_DEBUG_HEX32(offset); 
     101                PRINT_DEBUG("\r\n"); 
     102                write32(dimm_start * 32 * 1024 * 1024, offset); 
     103 
     104                PRINT_DEBUG("  Reading RAM at 0x"); 
     105                PRINT_DEBUG_HEX32(dimm_start * 32 * 1024 * 1024); 
     106                PRINT_DEBUG(" => 0x"); 
     107                PRINT_DEBUG_HEX32(read32(dimm_start * 32 * 1024 * 1024)); 
     108                PRINT_DEBUG("\r\n"); 
     109        } else { 
     110                PRINT_DEBUG("  Sending RAM command to 0x"); 
     111                PRINT_DEBUG_HEX32((dimm_start * 32 * 1024 * 1024) + offset); 
     112                PRINT_DEBUG("\r\n"); 
     113                read32((dimm_start * 32 * 1024 * 1024) + offset); 
     114        } 
     115} 
     116 
     117static void initialize_dimm_rows(void) 
     118{ 
     119        int i, row; 
     120        uint8_t dimm_start, dimm_end; 
     121        unsigned device; 
     122 
    94123        dimm_start = 0; 
    95124 
    96         for (i = 0; i < (DIMM_SOCKETS * 2); i++) { 
    97                 dimm_end = pci_read_config8(ctrl->d0, DRB + i); 
     125        for (row = 0; row < (DIMM_SOCKETS * 2); row++) { 
     126 
     127                switch (row) { 
     128                        case 0: 
     129                                device = DIMM_SPD_BASE; 
     130                                break; 
     131                        case 1: 
     132                                device = DIMM_SPD_BASE; 
     133                                break; 
     134                        case 2: 
     135                                device = DIMM_SPD_BASE + 1; 
     136                                break; 
     137                        case 3: 
     138                                device = DIMM_SPD_BASE + 1; 
     139                                break; 
     140                } 
     141 
     142                dimm_end = pci_read_config8(NORTHBRIDGE, DRB + row); 
     143 
    98144                if (dimm_end > dimm_start) { 
    99                         PRINT_DEBUG("    Sending RAM command 0x"); 
    100                         PRINT_DEBUG_HEX32(reg32); 
    101                         PRINT_DEBUG(" to 0x"); 
    102                         PRINT_DEBUG_HEX32((dimm_start * 32 * 1024 * 1024) + addr_offset); 
    103                         PRINT_DEBUG("\r\n"); 
    104                         read32((dimm_start * 32 * 1024 * 1024) + addr_offset); 
     145                        print_debug("Initializing SDRAM Row "); 
     146                        print_debug_hex8(row); 
     147                        print_debug("\r\n"); 
     148 
     149                        /* NOP command */ 
     150                        PRINT_DEBUG(" NOP "); 
     151                        do_ram_command(RAM_COMMAND_NOP); 
     152                        ram_read32(dimm_start, 0); 
     153                        udelay(200); 
     154 
     155                        /* Pre-charge all banks (at least 200 us after NOP) */ 
     156                        PRINT_DEBUG(" Pre-charging all banks "); 
     157                        do_ram_command(RAM_COMMAND_PRECHARGE); 
     158                        ram_read32(dimm_start, 0); 
     159                        udelay(1); 
     160 
     161                        /* 8 CBR refreshes (Auto Refresh) */ 
     162                        PRINT_DEBUG(" 8 CBR refreshes "); 
     163                        for (i = 0; i < 8; i++) { 
     164                                do_ram_command(RAM_COMMAND_CBR); 
     165                                ram_read32(dimm_start, 0); 
     166                                udelay(1); 
     167                        } 
     168 
     169                        /* MRS command */ 
     170                        /* TODO: Set offset 0x1d0 according to DRT values */ 
     171                        PRINT_DEBUG(" MRS "); 
     172                        do_ram_command(RAM_COMMAND_MRS); 
     173                        ram_read32(dimm_start, 0x1d0); 
     174                        udelay(2); 
     175 
     176                        /* Set GMCH-M Mode Select bits back to NORMAL operation mode */ 
     177                        PRINT_DEBUG(" Normal operation mode "); 
     178                        do_ram_command(RAM_COMMAND_NORMAL); 
     179                        ram_read32(dimm_start, 0); 
     180                        udelay(1); 
     181 
     182                        /* Perform a dummy memory read/write cycle */ 
     183                        PRINT_DEBUG(" Performing dummy read/write\r\n"); 
     184                        ram_read32(dimm_start, 0x55aa55aa); 
     185                        udelay(1); 
    105186                } 
    106187                /* Set the start of the next DIMM. */ 
     
    123204        int i, module_density, dimm_banks; 
    124205        sz.side1 = 0; 
    125         module_density = spd_read_byte(device, 31); 
    126         dimm_banks = spd_read_byte(device, 5); 
     206        module_density = spd_read_byte(device, SPD_DENSITY_OF_EACH_ROW_ON_MODULE); 
     207        dimm_banks = spd_read_byte(device, SPD_NUM_DIMM_BANKS); 
    127208 
    128209        /* Find the size of side1. */ 
     
    164245} 
    165246 
    166 static void spd_set_dram_size(const struct mem_controller *ctrl) 
     247static void set_dram_row_boundaries(void) 
    167248{ 
    168249        int i, value, drb1, drb2; 
     
    171252                struct dimm_size sz; 
    172253                unsigned device; 
    173                 device = ctrl->channel0[i]; 
     254                device = DIMM_SPD_BASE + i; 
    174255                drb1 = 0; 
    175256                drb2 = 0; 
    176257 
    177258                /* First check if a DIMM is actually present. */ 
    178                 if (spd_read_byte(device, 2) == 0x4) { 
     259                if (spd_read_byte(device, SPD_MEMORY_TYPE) == 0x4) { 
    179260                        print_debug("Found DIMM in slot "); 
    180261                        print_debug_hex8(i); 
     
    191272                        print_debug(" on side 2\r\n"); 
    192273 
     274                        /* - Memory compatibility checks - */ 
    193275                        /* Test for PC133 (i82830 only supports PC133) */ 
    194276                        /* PC133 SPD9 - cycle time is always 75 */ 
    195                         if (spd_read_byte(device, 9) != 0x75) { 
     277                        if (spd_read_byte(device, SPD_MIN_CYCLE_TIME_AT_CAS_MAX) != 0x75) { 
    196278                                print_err("SPD9 DIMM Is Not PC133 Compatable\r\n"); 
    197279                                die("HALT\r\n"); 
    198280                        } 
    199281                        /* PC133 SPD10 - access time is always 54 */ 
    200                         if (spd_read_byte(device, 10) != 0x54) { 
     282                        if (spd_read_byte(device, SPD_ACCESS_TIME_FROM_CLOCK) != 0x54) { 
    201283                                print_err("SPD10 DIMM Is Not PC133 Compatable\r\n"); 
    202284                                die("HALT\r\n"); 
     
    226308                                die("HALT\r\n"); 
    227309                        } 
     310                        /* - End Memory compatibility checks - */ 
    228311 
    229312                        /* We need to divide size by 32 to set up the 
     
    245328                /* Set the value for DRAM Row Boundary Registers */ 
    246329                if (i == 0) { 
    247                         pci_write_config8(ctrl->d0, DRB, drb1); 
    248                         pci_write_config8(ctrl->d0, DRB + 1, drb1 + drb2); 
     330                        pci_write_config8(NORTHBRIDGE, DRB, drb1); 
     331                        pci_write_config8(NORTHBRIDGE, DRB + 1, drb1 + drb2); 
    249332                        PRINT_DEBUG("DRB 0x"); 
    250333                        PRINT_DEBUG_HEX8(DRB); 
     
    258341                        PRINT_DEBUG("\r\n"); 
    259342                } else if (i == 1) { 
    260                         value = pci_read_config8(ctrl->d0, DRB + 1); 
    261                         pci_write_config8(ctrl->d0, DRB + 2, value + drb1); 
    262                         pci_write_config8(ctrl->d0, DRB + 3, 
    263                                           value + drb1 + drb2); 
     343                        value = pci_read_config8(NORTHBRIDGE, DRB + 1); 
     344                        pci_write_config8(NORTHBRIDGE, DRB + 2, value + drb1); 
     345                        pci_write_config8(NORTHBRIDGE, DRB + 3, value + drb1 + drb2); 
    264346                        PRINT_DEBUG("DRB2 0x"); 
    265347                        PRINT_DEBUG_HEX8(DRB + 2); 
     
    277359                         * not initialize properly if we don't. 
    278360                         */ 
    279                         value = pci_read_config8(ctrl->d0, DRB + 3); 
    280                         pci_write_config8(ctrl->d0, DRB + 4, value); 
    281                         pci_write_config8(ctrl->d0, DRB + 5, value); 
    282                 } 
    283         } 
    284 } 
    285  
    286 static void set_dram_row_attributes(const struct mem_controller *ctrl) 
     361                        value = pci_read_config8(NORTHBRIDGE, DRB + 3); 
     362                        pci_write_config8(NORTHBRIDGE, DRB + 4, value); 
     363                        pci_write_config8(NORTHBRIDGE, DRB + 5, value); 
     364                } 
     365        } 
     366} 
     367 
     368static void set_dram_row_attributes(void) 
    287369{ 
    288370        int i, dra, col, width, value; 
     
    290372        for (i = 0; i < DIMM_SOCKETS; i++) { 
    291373                unsigned device; 
    292                 device = ctrl->channel0[i]; 
     374                device = DIMM_SPD_BASE + i; 
    293375 
    294376                /* First check if a DIMM is actually present. */ 
    295                 if (spd_read_byte(device, 2) == 0x4) { 
     377                if (spd_read_byte(device, SPD_MEMORY_TYPE) == 0x4) { 
    296378                        print_debug("Found DIMM in slot "); 
    297379                        print_debug_hex8(i); 
     
    301383 
    302384                        /* columns */ 
    303                         col = spd_read_byte(device, 4); 
     385                        col = spd_read_byte(device, SPD_NUM_COLUMNS); 
    304386 
    305387                        /* data width */ 
    306                         width = spd_read_byte(device, 6); 
     388                        width = spd_read_byte(device, SPD_MODULE_DATA_WIDTH_LSB); 
    307389 
    308390                        /* calculate page size in bits */ 
     
    313395 
    314396                        /* # of banks of DIMM (single or double sided) */ 
    315                         value = spd_read_byte(device, 5); 
     397                        value = spd_read_byte(device, SPD_NUM_DIMM_BANKS); 
    316398 
    317399                        if (value == 1) { 
     
    356438 
    357439                /* Set the value for DRAM Row Attribute Registers */ 
    358                 pci_write_config8(ctrl->d0, DRA + i, dra); 
     440                pci_write_config8(NORTHBRIDGE, DRA + i, dra); 
    359441                PRINT_DEBUG("DRA 0x"); 
    360442                PRINT_DEBUG_HEX8(DRA + i); 
     
    365447} 
    366448 
    367 static void set_dram_timing(const struct mem_controller *ctrl) 
     449static void set_dram_timing(void) 
    368450{ 
    369451        /* Set the value for DRAM Timing Register */ 
    370452        /* TODO: Configure the value according to SPD values. */ 
    371         pci_write_config32(ctrl->d0, DRT, 0x00000010); 
    372 } 
    373  
    374 static void set_dram_buffer_strength(const struct mem_controller *ctrl) 
     453        pci_write_config32(NORTHBRIDGE, DRT, 0x00000010); 
     454} 
     455 
     456static void set_dram_buffer_strength(void) 
    375457{ 
    376458        /* TODO: This needs to be set according to the DRAM tech 
     
    381463 
    382464        /* Set the value for System Memory Buffer Strength Control Registers */ 
    383         pci_write_config32(ctrl->d0, BUFF_SC, 0xFC9B491B); 
     465        pci_write_config32(NORTHBRIDGE, BUFF_SC, 0xFC9B491B); 
    384466} 
    385467 
     
    388470-----------------------------------------------------------------------------*/ 
    389471 
    390 static void sdram_set_registers(const struct mem_controller *ctrl) 
     472static void sdram_set_registers(void) 
     473{ 
     474        PRINT_DEBUG("Setting initial sdram registers....\r\n"); 
     475 
     476        /* Calculate the value for DRT DRAM Timing Register */ 
     477        set_dram_timing(); 
     478 
     479        /* Setup System Memory Buffer Strength Control Registers */ 
     480        set_dram_buffer_strength(); 
     481 
     482        /* Setup DRAM Row Boundary Registers */ 
     483        set_dram_row_boundaries(); 
     484 
     485        /* Setup DRAM Row Attribute Registers */ 
     486        set_dram_row_attributes(); 
     487 
     488        PRINT_DEBUG("Initial sdram registers have been set.\r\n"); 
     489} 
     490 
     491static void northbridge_set_registers(void) 
    391492{ 
    392493        uint16_t value; 
    393494        int igd_memory = 0; 
    394495 
    395         PRINT_DEBUG("Setting initial registers....\r\n"); 
     496        PRINT_DEBUG("Setting initial nothbridge registers....\r\n"); 
     497 
     498        /* Set the value for Fixed DRAM Hole Control Register */ 
     499        pci_write_config8(NORTHBRIDGE, FDHC, 0x00); 
     500 
     501        /* Set the value for Programable Attribute Map Registers 
     502         * Ideally, this should be R/W for as many ranges as possible. 
     503         */ 
     504        pci_write_config8(NORTHBRIDGE, PAM0, 0x30); 
     505        pci_write_config8(NORTHBRIDGE, PAM1, 0x33); 
     506        pci_write_config8(NORTHBRIDGE, PAM2, 0x33); 
     507        pci_write_config8(NORTHBRIDGE, PAM3, 0x33); 
     508        pci_write_config8(NORTHBRIDGE, PAM4, 0x33); 
     509        pci_write_config8(NORTHBRIDGE, PAM5, 0x33); 
     510        pci_write_config8(NORTHBRIDGE, PAM6, 0x33); 
     511 
     512        /* Set the value for System Management RAM Control Register */ 
     513        pci_write_config8(NORTHBRIDGE, SMRAM, 0x02); 
    396514 
    397515        /* Set the value for GMCH Control Register #0 */ 
    398         pci_write_config16(ctrl->d0, GCC0, 0xA072); 
     516        pci_write_config16(NORTHBRIDGE, GCC0, 0xA072); 
     517 
     518        /* Set the value for Aperture Base Configuration Register */ 
     519        pci_write_config32(NORTHBRIDGE, APBASE, 0x00000008); 
    399520 
    400521        /* Set the value for GMCH Control Register #1 */ 
     
    410531                break; 
    411532        default: /* No memory */ 
    412                 pci_write_config16(ctrl->d0, GCC1, 0x0002); 
     533                pci_write_config16(NORTHBRIDGE, GCC1, 0x0002); 
    413534                igd_memory = 0x0; 
    414535        } 
    415536 
    416         value = pci_read_config16(ctrl->d0, GCC1); 
     537        value = pci_read_config16(NORTHBRIDGE, GCC1); 
    417538        value |= igd_memory << 4; 
    418         pci_write_config16(ctrl->d0, GCC1, value); 
    419  
    420         /* Set the value for Aperture Base Configuration Register */ 
    421         pci_write_config32(ctrl->d0, APBASE, 0x00000008); 
    422  
    423         /* Set the value for Register Range Base Address Register */ 
    424         pci_write_config32(ctrl->d0, RRBAR, 0x00000000); 
    425  
    426         /* Set the value for Fixed DRAM Hole Control Register */ 
    427         pci_write_config8(ctrl->d0, FDHC, 0x00); 
    428  
    429         /* Set the value for Programable Attribute Map Registers 
    430          * Ideally, this should be R/W for as many ranges as possible. 
    431          */ 
    432         pci_write_config8(ctrl->d0, PAM0, 0x30); 
    433         pci_write_config8(ctrl->d0, PAM1, 0x33); 
    434         pci_write_config8(ctrl->d0, PAM2, 0x33); 
    435         pci_write_config8(ctrl->d0, PAM3, 0x33); 
    436         pci_write_config8(ctrl->d0, PAM4, 0x33); 
    437         pci_write_config8(ctrl->d0, PAM5, 0x33); 
    438         pci_write_config8(ctrl->d0, PAM6, 0x33); 
    439  
    440         /* Set the value for DRAM Throttling Control Register */ 
    441         pci_write_config32(ctrl->d0, DTC, 0x00000000); 
    442  
    443         /* Set the value for System Management RAM Control Register */ 
    444         pci_write_config8(ctrl->d0, SMRAM, 0x02); 
    445  
    446         /* Set the value for Extended System Management RAM Control Register */ 
    447         pci_write_config8(ctrl->d0, ESMRAMC, 0x38); 
    448  
    449         PRINT_DEBUG("Initial registers have been set.\r\n"); 
    450 } 
    451  
    452 static void sdram_set_spd_registers(const struct mem_controller *ctrl) 
    453 { 
    454         spd_set_dram_size(ctrl); 
    455         set_dram_row_attributes(ctrl); 
    456         set_dram_timing(ctrl); 
    457         set_dram_buffer_strength(ctrl); 
    458 } 
    459  
    460 static void sdram_enable(int controllers, const struct mem_controller *ctrl) 
     539        pci_write_config16(NORTHBRIDGE, GCC1, value); 
     540 
     541        PRINT_DEBUG("Initial northbridge registers have been set.\r\n"); 
     542} 
     543 
     544static void sdram_initialize(void) 
    461545{ 
    462546        int i; 
    463547        uint32_t reg32; 
    464548 
     549        /* Setup Initial SDRAM Registers */ 
     550        sdram_set_registers(); 
     551 
    465552        /* 0. Wait until power/voltages and clocks are stable (200us). */ 
    466553        udelay(200); 
    467554 
    468         /* 1. Apply NOP. */ 
    469         PRINT_DEBUG("RAM Enable 1: Apply NOP\r\n"); 
    470         do_ram_command(ctrl, RAM_COMMAND_NOP, 0); 
    471         udelay(200); 
    472  
    473         /* 2. Precharge all. Wait tRP. */ 
    474         PRINT_DEBUG("RAM Enable 2: Precharge all\r\n"); 
    475         do_ram_command(ctrl, RAM_COMMAND_PRECHARGE, 0); 
    476         udelay(1); 
    477  
    478         /* 3. Perform 8 refresh cycles. Wait tRC each time. */ 
    479         PRINT_DEBUG("RAM Enable 3: CBR\r\n"); 
    480         for (i = 0; i < 8; i++) { 
    481                 do_ram_command(ctrl, RAM_COMMAND_CBR, 0); 
    482                 udelay(1); 
    483         } 
    484  
    485         /* 4. Mode register set. Wait two memory cycles. */ 
    486         /* TODO: Set offset according to DRT values */ 
    487         PRINT_DEBUG("RAM Enable 4: Mode register set\r\n"); 
    488         do_ram_command(ctrl, RAM_COMMAND_MRS, 0x1d0); 
    489         udelay(2); 
    490  
    491         /* 5. Normal operation (enables refresh) */ 
    492         PRINT_DEBUG("RAM Enable 5: Normal operation\r\n"); 
    493         do_ram_command(ctrl, RAM_COMMAND_NORMAL, 0); 
    494         udelay(1); 
    495  
    496         /* 6. Enable refresh and Set initialization complete. */ 
    497         PRINT_DEBUG("RAM Enable 6: Enable Refresh and IC\r\n"); 
    498         reg32 = pci_read_config32(ctrl->d0, DRC); 
    499         reg32 |= ((RAM_COMMAND_REFRESH << 8) | (RAM_COMMAND_IC << 29)); 
    500         pci_write_config32(ctrl->d0, DRC, reg32); 
     555        /* Initialize each row of memory one at a time */ 
     556        initialize_dimm_rows(); 
     557 
     558        /* Enable Refresh */ 
     559        PRINT_DEBUG("Enabling Refresh\r\n"); 
     560        reg32 = pci_read_config32(NORTHBRIDGE, DRC); 
     561        reg32 |= (RAM_COMMAND_REFRESH << 8); 
     562        pci_write_config32(NORTHBRIDGE, DRC, reg32); 
     563 
     564        /* Set initialization complete */ 
     565        PRINT_DEBUG("Setting initialization complete\r\n"); 
     566        reg32 = pci_read_config32(NORTHBRIDGE, DRC); 
     567        reg32 |= (RAM_COMMAND_IC << 29); 
     568        pci_write_config32(NORTHBRIDGE, DRC, reg32); 
     569 
     570        /* Setup Initial Northbridge Registers */ 
     571        northbridge_set_registers(); 
    501572 
    502573        PRINT_DEBUG("Northbridge following SDRAM init:\r\n"); 
  • trunk/src/northbridge/intel/i82830/raminit.h

    r3129 r5073  
    22 * This file is part of the coreboot project. 
    33 * 
    4  * Copyright (C) 2008 Joseph Smith <joe@smittys.pointclark.net> 
     4 * Copyright (C) 2008-2010 Joseph Smith <joe@settoplinux.org> 
    55 * 
    66 * This program is free software; you can redistribute it and/or modify 
     
    2222#define NORTHBRIDGE_INTEL_I82830_RAMINIT_H 
    2323 
     24/* 82830 Northbridge PCI device */ 
     25#define NORTHBRIDGE     PCI_DEV(0, 0, 0) 
     26 
    2427/* The 82830 supports max. 2 dual-sided SO-DIMMs. */ 
    2528#define DIMM_SOCKETS    2 
    2629 
    27 struct mem_controller { 
    28         device_t d0; 
    29         uint16_t channel0[DIMM_SOCKETS]; 
    30 }; 
     30/* DIMM0 is at 0x50, DIMM1 is at 0x51. */ 
     31#define DIMM_SPD_BASE   0x50 
    3132 
    3233#endif /* NORTHBRIDGE_INTEL_I82830_RAMINIT_H */ 
Note: See TracChangeset for help on using the changeset viewer.