diff options
author | Timothy Pearson <tpearson@raptorengineeringinc.com> | 2015-10-28 02:59:40 -0500 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2015-10-30 16:01:13 +0100 |
commit | ab95702f1e4c4e9ca1c33516877308ce9d94e0ca (patch) | |
tree | 8c1b1b8fd1f10b33c42bf698dcf8567ba3f2b317 /src/mainboard/asus/kfsn4-dre_k8/bootblock.c | |
parent | 529fd81f640fa514ea4c443dd561086e7c582a64 (diff) | |
download | coreboot-ab95702f1e4c4e9ca1c33516877308ce9d94e0ca.tar.xz |
mainboard: Add initial K8-compatible version of the KFSN4-DRE
This is a clone of the original Family 10h-compatible ASUS
KFSN4-DRE board, modified for basic K8 support to allow for
future K8 Socket F Opteron testing.
TEST: Booted KFSN4-DRE with 1 Opteron 8222 processor
KNOWN ISSUES:
* Second CPU package fails to initialize AP
This prevents use of a secondary CPU package
* Second memory channel of at least CPU package #0
does not function (crash at CAR handoff)
Change-Id: I591725babe685fa50a0d7473b17005fbd258056e
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: http://review.coreboot.org/12212
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/mainboard/asus/kfsn4-dre_k8/bootblock.c')
-rw-r--r-- | src/mainboard/asus/kfsn4-dre_k8/bootblock.c | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/mainboard/asus/kfsn4-dre_k8/bootblock.c b/src/mainboard/asus/kfsn4-dre_k8/bootblock.c new file mode 100644 index 0000000000..885cd598b6 --- /dev/null +++ b/src/mainboard/asus/kfsn4-dre_k8/bootblock.c @@ -0,0 +1,85 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering + * Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc. + */ + +#include <pc80/mc146818rtc.h> + +#include <superio/winbond/common/winbond.h> +#include <superio/winbond/w83627thg/w83627thg.h> + +#define GPIO_DEV PNP_DEV(0x2e, W83627THG_GPIO3) + +#define WINBOND_ENTRY_KEY 0x87 +#define WINBOND_EXIT_KEY 0xAA + +/* Enable configuration: pass entry key '0x87' into index port dev. */ +static void pnp_enter_conf_state(pnp_devfn_t dev) +{ + u16 port = dev >> 8; + outb(WINBOND_ENTRY_KEY, port); + outb(WINBOND_ENTRY_KEY, port); +} + +/* Disable configuration: pass exit key '0xAA' into index port dev. */ +static void pnp_exit_conf_state(pnp_devfn_t dev) +{ + u16 port = dev >> 8; + outb(WINBOND_EXIT_KEY, port); +} + +uint8_t bootblock_read_recovery_jumper(pnp_devfn_t dev) +{ + uint8_t recovery_enabled = 0; + + pnp_enter_conf_state(dev); + pnp_set_logical_device(dev); + pnp_set_enable(dev, 1); /* Enable GPIO3 */ + pnp_write_config(dev, 0xf0, 0xff); /* Set GPIO3 to input */ + recovery_enabled = !(pnp_read_config(dev, 0xf1) & 0x08); /* Read GP33 */ + pnp_exit_conf_state(dev); + + return recovery_enabled; +} + +void bootblock_mainboard_init(void) +{ + uint8_t recovery_enabled; + unsigned char addr; + unsigned char byte; + + recovery_enabled = bootblock_read_recovery_jumper(GPIO_DEV); + if (recovery_enabled) { +#if CONFIG_USE_OPTION_TABLE + /* Clear NVRAM checksum */ + for (addr = LB_CKS_RANGE_START; addr <= LB_CKS_RANGE_END; addr++) { + cmos_write(0x0, addr); + } + + /* Set fallback boot */ + byte = cmos_read(RTC_BOOT_BYTE); + byte &= 0xfc; + cmos_write(byte, RTC_BOOT_BYTE); +#else + /* FIXME + * Figure out how to recover if the option table is not available + */ +#endif + } +}
\ No newline at end of file |