summaryrefslogtreecommitdiffstats
path: root/board_enable.c
diff options
context:
space:
mode:
authorDavid Borg <borg.db@gmail.com>2012-05-05 20:43:42 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-05-05 20:43:42 +0000
commitb02c62be279671bb64ae008bd9d2f5cb58b60922 (patch)
treedb47bdf25e2bc864c97581b7de1f9a097fcb628b /board_enable.c
parent96c2dfc10f35cca18dc9643dd23c8663d42ed53d (diff)
downloadast2050-flashrom-b02c62be279671bb64ae008bd9d2f5cb58b60922.zip
ast2050-flashrom-b02c62be279671bb64ae008bd9d2f5cb58b60922.tar.gz
Function to enable the flash interface on w83697 family SuperIO chips
Not hooked up to the superio detection framework yet. Corresponding to flashrom svn r1529. Signed-off-by: David Borg <borg.db@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'board_enable.c')
-rw-r--r--board_enable.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/board_enable.c b/board_enable.c
index 0522590..440a77a 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -380,6 +380,39 @@ static void w836xx_memw_enable(uint16_t port)
w836xx_ext_leave(port);
}
+/**
+ * Enable MEMW# and set ROM size to max.
+ * Supported chips:
+ * W83697HF/F/HG, W83697SF/UF/UG
+ */
+void w83697xx_memw_enable(uint16_t port)
+{
+ w836xx_ext_enter(port);
+ if (!(sio_read(port, 0x24) & 0x02)) { /* Flash ROM enabled? */
+ if((sio_read(port, 0x2A) & 0xF0) == 0xF0) {
+
+ /* CR24 Bits 7 & 2 must be set to 0 enable the flash ROM */
+ /* address segments 000E0000h ~ 000FFFFFh on W83697SF/UF/UG */
+ /* These bits are reserved on W83697HF/F/HG */
+ /* Shouldn't be needed though. */
+
+ /* CR28 Bit3 must be set to 1 to enable flash access to */
+ /* FFE80000h ~ FFEFFFFFh on W83697SF/UF/UG. */
+ /* This bit is reserved on W83697HF/F/HG which default to 0 */
+ sio_mask(port, 0x28, 0x08, 0x08);
+
+ /* Enable MEMW# and set ROM size select to max. (4M)*/
+ sio_mask(port, 0x24, 0x28, 0x38);
+
+ } else {
+ msg_perr("WARNING: Flash interface in use by GPIO!\n");
+ }
+ } else {
+ msg_pinfo("BIOS ROM is disabled\n");
+ }
+ w836xx_ext_leave(port);
+}
+
/*
* Suited for:
* - EPoX EP-8K5A2: VIA KT333 + VT8235
OpenPOWER on IntegriCloud