Author: jfv
Date: Fri Jul 24 16:54:22 2009
New Revision: 195850
URL: http://svn.freebsd.org/changeset/base/195850

Log:
  A small number of systems in the ICH9/10 family have a flash
  part that is made up of 8K banks rather than 4K, if these
  systems are using bank 1 then the last change in this code
  breaks the bank read, resulting in an invalid checksum of
  the eeprom during driver load. This change fixes this.
  
  Approved by:  re

Modified:
  head/sys/dev/e1000/e1000_ich8lan.c

Modified: head/sys/dev/e1000/e1000_ich8lan.c
==============================================================================
--- head/sys/dev/e1000/e1000_ich8lan.c  Fri Jul 24 15:37:02 2009        
(r195849)
+++ head/sys/dev/e1000/e1000_ich8lan.c  Fri Jul 24 16:54:22 2009        
(r195850)
@@ -307,7 +307,6 @@ static s32 e1000_init_nvm_params_ich8lan
 {
        struct e1000_nvm_info *nvm = &hw->nvm;
        struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
-       union ich8_hws_flash_status hsfsts;
        u32 gfpreg, sector_base_addr, sector_end_addr;
        s32 ret_val = E1000_SUCCESS;
        u16 i;
@@ -346,20 +345,6 @@ static s32 e1000_init_nvm_params_ich8lan
        /* Adjust to word count */
        nvm->flash_bank_size /= sizeof(u16);
 
-       /*
-        * Make sure the flash bank size does not overwrite the 4k
-        * sector ranges. We may have 64k allotted to us but we only care
-        * about the first 2 4k sectors. Therefore, if we have anything less
-        * than 64k set in the HSFSTS register, we will reduce the bank size
-        * down to 4k and let the rest remain unused. If berasesz == 3, then
-        * we are working in 64k mode. Otherwise we are not.
-        */
-       if (nvm->flash_bank_size > E1000_SHADOW_RAM_WORDS) {
-               hsfsts.regval = E1000_READ_FLASH_REG16(hw, ICH_FLASH_HSFSTS);
-               if (hsfsts.hsf_status.berasesz != 3)
-                       nvm->flash_bank_size = E1000_SHADOW_RAM_WORDS;
-       }
-
        nvm->word_size = E1000_SHADOW_RAM_WORDS;
 
        /* Clear shadow ram */
@@ -1961,13 +1946,8 @@ static s32 e1000_erase_flash_bank_ich8la
                iteration = 1;
                break;
        case 2:
-               if (hw->mac.type == e1000_ich9lan) {
-                       sector_size = ICH_FLASH_SEG_SIZE_8K;
-                       iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_8K;
-               } else {
-                       ret_val = -E1000_ERR_NVM;
-                       goto out;
-               }
+               sector_size = ICH_FLASH_SEG_SIZE_8K;
+               iteration = 1;
                break;
        case 3:
                sector_size = ICH_FLASH_SEG_SIZE_64K;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to