Changeset 3423

Show
Ignore:
Timestamp:
07/16/08 23:09:31 (3 months ago)
Author:
mjones
Message:

Clean up comments, whitespace, and copyright date in the AMD HT code.

Signed-off-by: Marc Jones <marc.jones@…>
Acked-by: Marc Jones <marc.jones@…>

Location:
trunk/coreboot-v2/src/northbridge/amd/amdht
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/coreboot-v2/src/northbridge/amd/amdht/h3ffeat.h

    r3052 r3423  
    22 * This file is part of the coreboot project. 
    33 * 
    4  * Copyright (C) 2007 Advanced Micro Devices, Inc. 
     4 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 
    55 * 
    66 * This program is free software; you can redistribute it and/or modify 
  • trunk/coreboot-v2/src/northbridge/amd/amdht/h3finit.c

    r3052 r3423  
    254254 
    255255        if (targetNode == 0) 
    256                 return;  // BSP has no predecessor, stop 
    257  
    258         // Search for the link that connects targetNode to its predecessor 
     256                return;  /*  BSP has no predecessor, stop */ 
     257 
     258        /*  Search for the link that connects targetNode to its predecessor */ 
    259259        currentPair = 0; 
    260260        while (pDat->PortList[currentPair*2+1].NodeID != targetNode) 
     
    267267        predecessorLink = pDat->PortList[currentPair*2].Link; 
    268268 
    269         // Recursively call self to ensure the route from the BSP to the Predecessor 
    270         // Node is established 
     269        /*  Recursively call self to ensure the route from the BSP to the Predecessor */ 
     270        /*  Node is established */ 
    271271        routeFromBSP(predecessorNode, actualTarget, pDat); 
    272272 
     
    602602        if (i != nodecnt) 
    603603        { 
    604                 // Keep building the permutation 
     604                /*  Keep building the permutation */ 
    605605                for (j = 0; j < nodecnt; j++) 
    606606                { 
    607                         // Make sure the degree matches 
     607                        /*  Make sure the degree matches */ 
    608608                        if (pDat->sysDegree[i] != pDat->dbDegree[j]) 
    609609                                continue; 
    610610 
    611                         // Make sure that j hasn't been used yet (ought to use a "used" 
    612                         // array instead, might be faster) 
     611                        /*  Make sure that j hasn't been used yet (ought to use a "used" */ 
     612                        /*  array instead, might be faster) */ 
    613613                        for (k = 0; k < i; k++) 
    614614                        { 
     
    624624                return FALSE; 
    625625        } else { 
    626                 // Test to see if the permutation is isomorphic 
     626                /*  Test to see if the permutation is isomorphic */ 
    627627                for (j = 0; j < nodecnt; j++) 
    628628                { 
     
    686686                if (graphHowManyNodes(pSelected) == size) 
    687687                { 
    688                         // Build Degree vector and Adjency Matrix for this entry 
     688                        /*  Build Degree vector and Adjency Matrix for this entry */ 
    689689                        for (i = 0; i < size; i++) 
    690690                        { 
     
    704704                        } 
    705705                        if (isoMorph(0, pDat)) 
    706                                 break;   // A matching topology was found 
     706                                break;  /*  A matching topology was found */ 
    707707                } 
    708708 
     
    713713        if (pSelected != NULL) 
    714714        { 
    715                 // Compute the reverse Permutation 
     715                /*  Compute the reverse Permutation */ 
    716716                for (i = 0; i < size; i++) 
    717717                { 
     
    719719                } 
    720720 
    721                 // Start with the last discovered node, and move towards the BSP 
     721                /*  Start with the last discovered node, and move towards the BSP */ 
    722722                for (i = size-1; i >= 0; i--) 
    723723                { 
     
    11721172                { 
    11731173                        if (pDat->HtBlock->AMD_CB_IgnoreLink && pDat->HtBlock->AMD_CB_IgnoreLink(node, link)) 
    1174                                 continue;   // Skip the link 
     1174                                continue;   /*  Skip the link */ 
    11751175 
    11761176                        if (node == 0 && link == compatLink) 
     
    12091209        for (i = 0; i < pDat->TotalLinks*2; i += 2) 
    12101210        { 
    1211                 ASSERT(pDat->PortList[i].Type < 2 && pDat->PortList[i].Link < pDat->nb->maxLinks);  // Data validation 
    1212                 ASSERT(pDat->PortList[i+1].Type < 2 && pDat->PortList[i+1].Link < pDat->nb->maxLinks); // data validation 
    1213                 ASSERT(!(pDat->PortList[i].Type == PORTLIST_TYPE_IO && pDat->PortList[i+1].Type == PORTLIST_TYPE_CPU));  // ensure src is closer to the bsp than dst 
     1211                ASSERT(pDat->PortList[i].Type < 2 && pDat->PortList[i].Link < pDat->nb->maxLinks);  /*  Data validation */ 
     1212                ASSERT(pDat->PortList[i+1].Type < 2 && pDat->PortList[i+1].Link < pDat->nb->maxLinks); /*  data validation */ 
     1213                ASSERT(!(pDat->PortList[i].Type == PORTLIST_TYPE_IO && pDat->PortList[i+1].Type == PORTLIST_TYPE_CPU));  /*  ensure src is closer to the bsp than dst */ 
    12141214 
    12151215                /* Regang is false unless we pass all conditions below */ 
     
    12181218 
    12191219                if ( (pDat->PortList[i].Type != PORTLIST_TYPE_CPU) || (pDat->PortList[i+1].Type != PORTLIST_TYPE_CPU)) 
    1220                         continue;        // Only process cpu to cpu links 
     1220                        continue;   /*  Only process cpu to cpu links */ 
    12211221 
    12221222                for (j = i+2; j < pDat->TotalLinks*2; j += 2) 
    12231223                { 
    12241224                        if ( (pDat->PortList[j].Type != PORTLIST_TYPE_CPU) || (pDat->PortList[j+1].Type != PORTLIST_TYPE_CPU) ) 
    1225                                 continue;   // Only process cpu to cpu links 
     1225                                continue;   /*  Only process cpu to cpu links */ 
    12261226 
    12271227                        if (pDat->PortList[i].NodeID != pDat->PortList[j].NodeID) 
    1228                                 continue;   // Links must be from the same source 
     1228                                continue;   /*  Links must be from the same source */ 
    12291229 
    12301230                        if (pDat->PortList[i+1].NodeID != pDat->PortList[j+1].NodeID) 
    1231                                 continue;   // Link must be to the same target 
     1231                                continue;   /*  Link must be to the same target */ 
    12321232 
    12331233                        if ((pDat->PortList[i].Link & 3) != (pDat->PortList[j].Link & 3)) 
    1234                                 continue;   // Ensure same source base port 
     1234                                continue;   /*  Ensure same source base port */ 
    12351235 
    12361236                        if ((pDat->PortList[i+1].Link & 3) != (pDat->PortList[j+1].Link & 3)) 
    1237                                 continue;   // Ensure same destination base port 
     1237                                continue;   /*  Ensure same destination base port */ 
    12381238 
    12391239                        if ((pDat->PortList[i].Link & 4) != (pDat->PortList[i+1].Link & 4)) 
    1240                                 continue;   // Ensure sublink0 routes to sublink0 
    1241  
    1242                         ASSERT((pDat->PortList[j].Link & 4) == (pDat->PortList[j+1].Link & 4)); // (therefore sublink1 routes to sublink1) 
     1240                                continue;   /*  Ensure sublink0 routes to sublink0 */ 
     1241 
     1242                        ASSERT((pDat->PortList[j].Link & 4) == (pDat->PortList[j+1].Link & 4)); /*  (therefore sublink1 routes to sublink1) */ 
    12431243 
    12441244                        if (pDat->HtBlock->AMD_CB_SkipRegang && 
    1245                             pDat->HtBlock->AMD_CB_SkipRegang(pDat->PortList[i].NodeID, 
     1245                                pDat->HtBlock->AMD_CB_SkipRegang(pDat->PortList[i].NodeID, 
    12461246                                                        pDat->PortList[i].Link & 0x03, 
    12471247                                                        pDat->PortList[i+1].NodeID, 
    12481248                                                        pDat->PortList[i+1].Link & 0x03)) 
    12491249                        { 
    1250                                 continue;   // Skip regang 
    1251                         } 
    1252  
    1253  
    1254                         pDat->PortList[i].Link &= 0x03; // Force to point to sublink0 
     1250                                continue;   /*  Skip regang */ 
     1251                        } 
     1252 
     1253 
     1254                        pDat->PortList[i].Link &= 0x03; /*  Force to point to sublink0 */ 
    12551255                        pDat->PortList[i+1].Link &= 0x03; 
    1256                         pDat->PortList[i].SelRegang = TRUE; // Enable link reganging 
     1256                        pDat->PortList[i].SelRegang = TRUE; /*  Enable link reganging */ 
    12571257                        pDat->PortList[i+1].SelRegang = TRUE; 
    12581258                        pDat->PortList[i].PrvWidthOutCap = HT_WIDTH_16_BITS; 
     
    12611261                        pDat->PortList[i+1].PrvWidthInCap = HT_WIDTH_16_BITS; 
    12621262 
    1263                         // Delete PortList[j, j+1], slow but easy to debug implementation 
     1263                        /*  Delete PortList[j, j+1], slow but easy to debug implementation */ 
    12641264                        pDat->TotalLinks--; 
    12651265                        Amdmemcpy(&(pDat->PortList[j]), &(pDat->PortList[j+2]), sizeof(sPortDescriptor)*(pDat->TotalLinks*2-j)); 
    12661266                        Amdmemset(&(pDat->PortList[pDat->TotalLinks*2]), INVALID_LINK, sizeof(sPortDescriptor)*2); 
    12671267 
    1268                         ////High performance, but would make debuging harder due to 'shuffling' of the records 
    1269                         ////Amdmemcpy(PortList[TotalPorts-2], PortList[j], SIZEOF(sPortDescriptor)*2); 
    1270                         ////TotalPorts -=2; 
    1271  
    1272                         break; // Exit loop, advance to PortList[i+2] 
     1268                        /* //High performance, but would make debuging harder due to 'shuffling' of the records */ 
     1269                        /* //Amdmemcpy(PortList[TotalPorts-2], PortList[j], SIZEOF(sPortDescriptor)*2); */ 
     1270                        /* //TotalPorts -=2; */ 
     1271 
     1272                        break; /*  Exit loop, advance to PortList[i+2] */ 
    12731273                } 
    12741274        } 
     
    14011401                for (i = 0; i < pDat->TotalLinks*2; i++) 
    14021402                { 
    1403                         if (pDat->PortList[i].Type != PORTLIST_TYPE_CPU) // Must be a CPU link 
     1403                        if (pDat->PortList[i].Type != PORTLIST_TYPE_CPU) /*  Must be a CPU link */ 
    14041404                                continue; 
    1405                         if (pDat->PortList[i].Link < 4) // Only look for for sublink1's 
     1405                        if (pDat->PortList[i].Link < 4) /*  Only look for for sublink1's */ 
    14061406                                continue; 
    14071407 
    14081408                        for (j = 0; j < pDat->TotalLinks*2; j++) 
    14091409                        { 
    1410                                 // Step 1. Find the matching sublink0 
     1410                                /*  Step 1. Find the matching sublink0 */ 
    14111411                                if (pDat->PortList[j].Type != PORTLIST_TYPE_CPU) 
    14121412                                        continue; 
     
    14161416                                        continue; 
    14171417 
    1418                                 // Step 2. Check for an illegal frequency ratio 
     1418                                /*  Step 2. Check for an illegal frequency ratio */ 
    14191419                                if (pDat->PortList[i].SelFrequency >= pDat->PortList[j].SelFrequency) 
    14201420                                { 
     
    14311431 
    14321432                                if (hiFreq == loFreq) 
    1433                                         break; // The frequencies are 1:1, no need to do anything 
     1433                                        break; /*  The frequencies are 1:1, no need to do anything */ 
    14341434 
    14351435                                downgrade = FALSE; 
     
    14371437                                if (hiFreq == 13) 
    14381438                                { 
    1439                                         if ((loFreq != 7) &&  //{13, 7} 2400MHz / 1200MHz 2:1 
    1440                                             (loFreq != 4) &&  //{13, 4} 2400MHz / 600MHz 4:1 
    1441                                             (loFreq != 2) )   //{13, 2} 2400MHz / 400MHz 6:1 
     1439                                        if ((loFreq != 7) &&  /* {13, 7} 2400MHz / 1200MHz 2:1 */ 
     1440                                                (loFreq != 4) &&  /* {13, 4} 2400MHz /  600MHz 4:1 */ 
     1441                                                (loFreq != 2) )   /* {13, 2} 2400MHz /  400MHz 6:1 */ 
    14421442                                                downgrade = TRUE; 
    14431443                                } 
    14441444                                else if (hiFreq == 11) 
    14451445                                { 
    1446                                         if ((loFreq != 6))      //{11, 6} 2000MHz / 1000MHz 2:1 
     1446                                        if ((loFreq != 6))    /* {11, 6} 2000MHz / 1000MHz 2:1 */ 
    14471447                                                downgrade = TRUE; 
    14481448                                } 
    14491449                                else if (hiFreq == 9) 
    14501450                                { 
    1451                                         if ((loFreq != 5) &&  //{ 9, 5} 1600MHz / 800MHz 2:1 
    1452                                             (loFreq != 2) &&  //{ 9, 2} 1600MHz / 400MHz 4:1 
    1453                                             (loFreq != 0) )   //{ 9, 0} 1600MHz / 200Mhz 8:1 
     1451                                        if ((loFreq != 5) &&  /* { 9, 5} 1600MHz /  800MHz 2:1 */ 
     1452                                                (loFreq != 2) &&  /* { 9, 2} 1600MHz /  400MHz 4:1 */ 
     1453                                                (loFreq != 0) )   /* { 9, 0} 1600MHz /  200Mhz 8:1 */ 
    14541454                                                downgrade = TRUE; 
    14551455                                } 
    14561456                                else if (hiFreq == 7) 
    14571457                                { 
    1458                                         if ((loFreq != 4) &&  //{ 7, 4} 1200MHz / 600MHz 2:1 
    1459                                             (loFreq != 0) )   //{ 7, 0} 1200MHz / 200MHz 6:1 
     1458                                        if ((loFreq != 4) &&  /* { 7, 4} 1200MHz /  600MHz 2:1 */ 
     1459                                                (loFreq != 0) )   /* { 7, 0} 1200MHz /  200MHz 6:1 */ 
    14601460                                                downgrade = TRUE; 
    14611461                                } 
    14621462                                else if (hiFreq == 5) 
    14631463                                { 
    1464                                         if ((loFreq != 2) &&  //{ 5, 2}  800MHz / 400MHz 2:1 
    1465                                             (loFreq != 0) )   //{ 5, 0}  800MHz / 200MHz 4:1 
     1464                                        if ((loFreq != 2) &&  /* { 5, 2}  800MHz /  400MHz 2:1 */ 
     1465                                                (loFreq != 0) )   /* { 5, 0}  800MHz /  200MHz 4:1 */ 
    14661466                                                downgrade = TRUE; 
    14671467                                } 
    14681468                                else if (hiFreq == 2) 
    14691469                                { 
    1470                                         if ((loFreq != 0))         //{ 2, 0}  400MHz / 200MHz 2:1 
     1470                                        if ((loFreq != 0))    /* { 2, 0}  400MHz /  200MHz 2:1 */ 
    14711471                                                downgrade = TRUE; 
    14721472                                } 
    14731473                                else 
    14741474                                { 
    1475                                         downgrade = TRUE; // no legal ratios for hiFreq 
    1476                                 } 
    1477  
    1478                                 // Step 3. Downgrade the higher of the two frequencies, and set nochanges to FALSE 
     1475                                        downgrade = TRUE; /*  no legal ratios for hiFreq */ 
     1476                                } 
     1477 
     1478                                /*  Step 3. Downgrade the higher of the two frequencies, and set nochanges to FALSE */ 
    14791479                                if (downgrade) 
    14801480                                { 
    1481                                         // Although the problem was with the port specified by hiIndex, we need to 
    1482                                         // downgrade both ends of the link. 
    1483                                         hiIndex = hiIndex & 0xFE; // Select the 'upstream' (i.e. even) port 
     1481                                        /*  Although the problem was with the port specified by hiIndex, we need to */ 
     1482                                        /*  downgrade both ends of the link. */ 
     1483                                        hiIndex = hiIndex & 0xFE; /*  Select the 'upstream' (i.e. even) port */ 
    14841484 
    14851485                                        temp = pDat->PortList[hiIndex].CompositeFrequencyCap; 
    14861486 
    1487                                         // Remove hiFreq from the list of valid frequencies 
    1488                                         temp = temp & ~((u32)1 << hiFreq); 
     1487                                        /*  Remove hiFreq from the list of valid frequencies */ 
     1488                                        temp = temp & ~((uint32)1 << hiFreq); 
    14891489                                        ASSERT (temp != 0); 
    1490                                         pDat->PortList[hiIndex].CompositeFrequencyCap = (u16)temp; 
    1491                                         pDat->PortList[hiIndex+1].CompositeFrequencyCap = (u16)temp; 
     1490                                        pDat->PortList[hiIndex].CompositeFrequencyCap = (uint16)temp; 
     1491                                        pDat->PortList[hiIndex+1].CompositeFrequencyCap = (uint16)temp; 
    14921492 
    14931493                                        for (k = 15; ; k--) 
     
    15041504                        } 
    15051505                } 
    1506         } while (changes); // Repeat until a valid configuration is reached 
     1506        } while (changes); /*  Repeat until a valid configuration is reached */ 
    15071507#endif /* HT_BUILD_NC_ONLY */ 
    15081508} 
     
    15511551        u8 i; 
    15521552 
    1553         // Traffic Distribution is only used when there are exactly two nodes in the system 
     1553        /*  Traffic Distribution is only used when there are exactly two nodes in the system */ 
    15541554        if (pDat->NodesDiscovered+1 != 2) 
    15551555                return; 
     
    15691569        ASSERT(linkCount != 0); 
    15701570        if (linkCount == 1) 
    1571                 return; // Don't setup Traffic Distribution if only one link is being used 
     1571                return; /*  Don't setup Traffic Distribution if only one link is being used */ 
    15721572 
    15731573        pDat->nb->writeTrafficDistribution(links01, links10, pDat->nb); 
  • trunk/coreboot-v2/src/northbridge/amd/amdht/h3ncmn.c

    r3052 r3423  
    334334        linkBase = makeLinkBase(node, link); 
    335335 
    336         // FN0_98/A4/C4 = LDT Type Register 
     336        /*  FN0_98/A4/C4 = LDT Type Register */ 
    337337        AmdPCIRead(linkBase + HTHOST_LINK_TYPE_REG, &linkType); 
    338338 
    339         // Verify LinkCon=1, InitComplete=1, NC=0, UniP-cLDT=0, LinkConPend=0 
     339        /*  Verify LinkCon=1, InitComplete=1, NC=0, UniP-cLDT=0, LinkConPend=0 */ 
    340340        return (linkType & HTHOST_TYPE_MASK) ==  HTHOST_TYPE_COHERENT; 
    341341#else 
     
    11121112                return 2; 
    11131113        } 
    1114         STOP_HERE; // This is an error internal condition 
     1114        STOP_HERE; /*  This is an error internal condition */ 
    11151115 
    11161116        return 0xFF;    // make the compiler happy. 
    1117  
    11181117} 
    11191118 
     
    11441143                return 4; 
    11451144        } 
    1146         STOP_HERE; // This is an internal error condition 
     1145        STOP_HERE; /*  This is an internal error condition */ 
    11471146 
    11481147        return 0xFF;    // make the compiler happy. 
     
    12631262                        AmdPCIReadBits(linkBase + HTHOST_FREQ_REV_REG, 31, 16, &temp); 
    12641263                        pDat->PortList[i].PrvFrequencyCap = (u16)temp & 0x7FFF 
    1265                                  & nb->northBridgeFreqMask(pDat->PortList[i].NodeID, pDat->nb); // Mask off bit 15, reserved value 
     1264                                & nb->northBridgeFreqMask(pDat->PortList[i].NodeID, pDat->nb); /*  Mask off bit 15, reserved value */ 
    12661265                } 
    12671266                else 
     
    13851384                                || (temp == HT_FREQUENCY_200M) || (temp == HT_FREQUENCY_400M)); 
    13861385                        AmdPCIWriteBits(linkBase + HTHOST_FREQ_REV_REG, 11, 8, &temp); 
    1387                         if (temp > HT_FREQUENCY_1000M) // Gen1 = 200Mhz -> 1000MHz, Gen3 = 1200MHz -> 2600MHz 
     1386                        if (temp > HT_FREQUENCY_1000M) /*  Gen1 = 200Mhz -> 1000MHz, Gen3 = 1200MHz -> 2600MHz */ 
    13881387                        { 
    13891388                                /* Enable  for Gen3 frequencies */