Changeset 1462


Ignore:
Timestamp:
11/08/11 12:55:24 (7 months ago)
Author:
stefanct
Message:

ichspi: print flash descriptor dependent information only when it is valid

Also, fix some coding style issues.

Signed-off-by: Stefan Tauner <stefan.tauner@…>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ichspi.c

    r1461 r1462  
    10931093                        int i; 
    10941094                        msg_pspew("The data was:\n"); 
    1095                         for(i=0; i<count; i++){ 
     1095                        for (i = 0; i < count; i++){ 
    10961096                                msg_pspew("%3d: 0x%02x\n", i, data[i]); 
    10971097                        } 
     
    16451645                                  "Range (PR) restrictions still apply.\n"); 
    16461646 
    1647                 tmp2 = mmio_readw(ich_spibar + ICH9_REG_HSFC); 
    1648                 msg_pdbg("0x06: 0x%04x (HSFC)\n", tmp2); 
    1649                 prettyprint_ich9_reg_hsfc(tmp2); 
     1647                if (desc_valid) { 
     1648                        tmp2 = mmio_readw(ich_spibar + ICH9_REG_HSFC); 
     1649                        msg_pdbg("0x06: 0x%04x (HSFC)\n", tmp2); 
     1650                        prettyprint_ich9_reg_hsfc(tmp2); 
     1651                } 
    16501652 
    16511653                tmp = mmio_readl(ich_spibar + ICH9_REG_FADDR); 
    16521654                msg_pdbg("0x08: 0x%08x (FADDR)\n", tmp); 
    1653                 tmp = mmio_readl(ich_spibar + ICH9_REG_FRAP); 
    1654                 msg_pdbg("0x50: 0x%08x (FRAP)\n", tmp); 
    1655                 msg_pdbg("BMWAG 0x%02x, ", ICH_BMWAG(tmp)); 
    1656                 msg_pdbg("BMRAG 0x%02x, ", ICH_BMRAG(tmp)); 
    1657                 msg_pdbg("BRWA 0x%02x, ", ICH_BRWA(tmp)); 
    1658                 msg_pdbg("BRRA 0x%02x\n", ICH_BRRA(tmp)); 
    1659  
    1660                 /* print out the FREGx registers along with FRAP access bits */ 
    1661                 for(i = 0; i < 5; i++) 
    1662                         do_ich9_spi_frap(tmp, i); 
     1655 
     1656                if (desc_valid) { 
     1657                        tmp = mmio_readl(ich_spibar + ICH9_REG_FRAP); 
     1658                        msg_pdbg("0x50: 0x%08x (FRAP)\n", tmp); 
     1659                        msg_pdbg("BMWAG 0x%02x, ", ICH_BMWAG(tmp)); 
     1660                        msg_pdbg("BMRAG 0x%02x, ", ICH_BMRAG(tmp)); 
     1661                        msg_pdbg("BRWA 0x%02x, ", ICH_BRWA(tmp)); 
     1662                        msg_pdbg("BRRA 0x%02x\n", ICH_BRRA(tmp)); 
     1663 
     1664                        /* Decode and print FREGx and FRAP registers */ 
     1665                        for (i = 0; i < 5; i++) 
     1666                                do_ich9_spi_frap(tmp, i); 
     1667                } 
    16631668 
    16641669                /* try to disable PR locks before printing them */ 
    16651670                if (!ichspi_lock) 
    1666                         for(i = 0; i < 5; i++) 
     1671                        for (i = 0; i < 5; i++) 
    16671672                                ich9_set_pr(i, 0, 0); 
    1668                 for(i = 0; i < 5; i++) 
     1673                for (i = 0; i < 5; i++) 
    16691674                        prettyprint_ich9_reg_pr(i); 
    16701675 
     
    16871692                msg_pdbg("0x9C: 0x%08x (OPMENU+4)\n", 
    16881693                             mmio_readl(ich_spibar + ICH9_REG_OPMENU + 4)); 
    1689                 if (ich_generation == CHIPSET_ICH8) { 
     1694                if (ich_generation == CHIPSET_ICH8 && desc_valid) { 
    16901695                        tmp = mmio_readl(ich_spibar + ICH8_REG_VSCC); 
    16911696                        msg_pdbg("0xC1: 0x%08x (VSCC)\n", tmp); 
     
    16971702                                     ichspi_bbar); 
    16981703 
    1699                         tmp = mmio_readl(ich_spibar + ICH9_REG_LVSCC); 
    1700                         msg_pdbg("0xC4: 0x%08x (LVSCC)\n", tmp); 
    1701                         msg_pdbg("LVSCC: "); 
    1702                         prettyprint_ich_reg_vscc(tmp, MSG_DEBUG); 
    1703  
    1704                         tmp = mmio_readl(ich_spibar + ICH9_REG_UVSCC); 
    1705                         msg_pdbg("0xC8: 0x%08x (UVSCC)\n", tmp); 
    1706                         msg_pdbg("UVSCC: "); 
    1707                         prettyprint_ich_reg_vscc(tmp, MSG_DEBUG); 
    1708  
    1709                         tmp = mmio_readl(ich_spibar + ICH9_REG_FPB); 
    1710                         msg_pdbg("0xD0: 0x%08x (FPB)\n", tmp); 
     1704                        if (desc_valid) { 
     1705                                tmp = mmio_readl(ich_spibar + ICH9_REG_LVSCC); 
     1706                                msg_pdbg("0xC4: 0x%08x (LVSCC)\n", tmp); 
     1707                                msg_pdbg("LVSCC: "); 
     1708                                prettyprint_ich_reg_vscc(tmp, MSG_DEBUG); 
     1709 
     1710                                tmp = mmio_readl(ich_spibar + ICH9_REG_UVSCC); 
     1711                                msg_pdbg("0xC8: 0x%08x (UVSCC)\n", tmp); 
     1712                                msg_pdbg("UVSCC: "); 
     1713                                prettyprint_ich_reg_vscc(tmp, MSG_DEBUG); 
     1714 
     1715                                tmp = mmio_readl(ich_spibar + ICH9_REG_FPB); 
     1716                                msg_pdbg("0xD0: 0x%08x (FPB)\n", tmp); 
     1717                        } 
    17111718                        ich_set_bbar(0); 
    17121719                } 
Note: See TracChangeset for help on using the changeset viewer.