Changeset 1529 for trunk/board_enable.c


Ignore:
Timestamp:
May 5, 2012 10:43:42 PM (13 months ago)
Author:
hailfinger
Message:

Function to enable the flash interface on w83697 family SuperIO chips.
Not hooked up to the superio detection framework yet.

Signed-off-by: David Borg <borg.db@…>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/board_enable.c

    r1526 r1529  
    379379        } 
    380380        w836xx_ext_leave(port); 
     381} 
     382 
     383/** 
     384 * Enable MEMW# and set ROM size to max. 
     385 * Supported chips: 
     386 * W83697HF/F/HG, W83697SF/UF/UG 
     387 */ 
     388void w83697xx_memw_enable(uint16_t port) 
     389{ 
     390        w836xx_ext_enter(port); 
     391        if (!(sio_read(port, 0x24) & 0x02)) { /* Flash ROM enabled? */ 
     392                if((sio_read(port, 0x2A) & 0xF0) == 0xF0) { 
     393 
     394                /* CR24 Bits 7 & 2 must be set to 0 enable the flash ROM    */ 
     395                /* address segments 000E0000h ~ 000FFFFFh on W83697SF/UF/UG */ 
     396                /* These bits are reserved on W83697HF/F/HG                 */ 
     397                /* Shouldn't be needed though.                              */ 
     398 
     399                /* CR28 Bit3 must be set to 1 to enable flash access to     */ 
     400                /* FFE80000h ~ FFEFFFFFh on W83697SF/UF/UG.                 */ 
     401                /* This bit is reserved on W83697HF/F/HG which default to 0 */ 
     402                        sio_mask(port, 0x28, 0x08, 0x08); 
     403 
     404                        /* Enable MEMW# and set ROM size select to max. (4M)*/ 
     405                        sio_mask(port, 0x24, 0x28, 0x38); 
     406 
     407                } else { 
     408                        msg_perr("WARNING: Flash interface in use by GPIO!\n"); 
     409                } 
     410        } else { 
     411                msg_pinfo("BIOS ROM is disabled\n"); 
     412        } 
     413        w836xx_ext_leave(port); 
    381414} 
    382415 
Note: See TracChangeset for help on using the changeset viewer.