From owner-svn-src-head@FreeBSD.ORG Fri Jul 24 16:54:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 708DC106564A; Fri, 24 Jul 2009 16:54:23 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 443828FC16; Fri, 24 Jul 2009 16:54:23 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6OGsMho015768; Fri, 24 Jul 2009 16:54:22 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6OGsM1d015766; Fri, 24 Jul 2009 16:54:22 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200907241654.n6OGsM1d015766@svn.freebsd.org> From: Jack F Vogel Date: Fri, 24 Jul 2009 16:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195850 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 16:54:23 -0000 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;