From 05082737a9507a8bbb238d9d439f74a72a7606e8 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 21 Oct 2015 13:00:41 -0700 Subject: Redo testbios utility to use all of YABEL Drop buggy duplicate implementation of intXX handlers and provide enough glue to use all of YABEL. Change-Id: I2db77a56a2a991cb84876456dcbb3a843a0d9754 Signed-off-by: Stefan Reinauer Reviewed-on: https://review.coreboot.org/12117 Reviewed-by: Ronald G. Minnich Tested-by: build bot (Jenkins) --- util/vgabios/include/arch/byteorder.h | 24 ++++++++++++++ util/vgabios/include/arch/io.h | 4 --- util/vgabios/include/config.h | 35 +++++++++++++++++++++ util/vgabios/include/console/console.h | 17 +++++++++- util/vgabios/include/stdtypes.h | 15 +++++++++ util/vgabios/include/swab.h | 57 ++++++++++++++++++++++++++++++++++ 6 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 util/vgabios/include/arch/byteorder.h delete mode 100644 util/vgabios/include/arch/io.h create mode 100644 util/vgabios/include/config.h create mode 100644 util/vgabios/include/swab.h (limited to 'util/vgabios/include') diff --git a/util/vgabios/include/arch/byteorder.h b/util/vgabios/include/arch/byteorder.h new file mode 100644 index 0000000000..fd29071b9d --- /dev/null +++ b/util/vgabios/include/arch/byteorder.h @@ -0,0 +1,24 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2016 Google Inc + * + * 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; version 2 of the License. + * + * 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. + */ + +#ifndef _BYTEORDER_H +#define _BYTEORDER_H + +#define __LITTLE_ENDIAN 1234 + +#define cpu_to_le16(x) ((uint16_t)(x)) +#define cpu_to_le32(x) ((uint32_t)(x)) + +#endif /* _BYTEORDER_H */ diff --git a/util/vgabios/include/arch/io.h b/util/vgabios/include/arch/io.h deleted file mode 100644 index f28499de93..0000000000 --- a/util/vgabios/include/arch/io.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _ASM_IO_H -#define _ASM_IO_H -#include -#endif diff --git a/util/vgabios/include/config.h b/util/vgabios/include/config.h new file mode 100644 index 0000000000..f5d568fff7 --- /dev/null +++ b/util/vgabios/include/config.h @@ -0,0 +1,35 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2016 Google Inc + * + * 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; version 2 of the License. + * + * 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. + */ + +#define CONFIG_PCI_OPTION_ROM_RUN_YABEL 1 +#define CONFIG_YABEL_PCI_ACCESS_OTHER_DEVICES 0 +#define CONFIG_YABEL_DIRECTHW 1 + +#define CONFIG_X86EMU_DEBUG 1 +#define CONFIG_X86EMU_DEBUG_TIMINGS 0 +#define CONFIG_X86EMU_DEBUG_JMP 0 +#define CONFIG_X86EMU_DEBUG_TRACE 0 +#define CONFIG_X86EMU_DEBUG_PNP 0 +#define CONFIG_X86EMU_DEBUG_DISK 0 +#define CONFIG_X86EMU_DEBUG_PMM 0 +#define CONFIG_X86EMU_DEBUG_VBE 0 +#define CONFIG_X86EMU_DEBUG_INT10 0 +#define CONFIG_X86EMU_DEBUG_INTERRUPTS 0 +#define CONFIG_X86EMU_DEBUG_CHECK_VMEM_ACCESS 0 +#define CONFIG_X86EMU_DEBUG_MEM 0 +#define CONFIG_X86EMU_DEBUG_IO 0 + +#define CONFIG_ARCH_X86 1 +#define CONFIG_ARCH_ARM 0 diff --git a/util/vgabios/include/console/console.h b/util/vgabios/include/console/console.h index e52dbf7a97..443e3e8bb7 100644 --- a/util/vgabios/include/console/console.h +++ b/util/vgabios/include/console/console.h @@ -1,6 +1,21 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2016 Google Inc + * + * 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; version 2 of the License. + * + * 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. + */ + #ifndef _CONSOLE_CONSOLE_H #define _CONSOLE_CONSOLE_H -#define CONFIG_X86EMU_DEBUG 1 int printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); + #endif diff --git a/util/vgabios/include/stdtypes.h b/util/vgabios/include/stdtypes.h index 62c254d8cf..05f37a5a8a 100644 --- a/util/vgabios/include/stdtypes.h +++ b/util/vgabios/include/stdtypes.h @@ -1,3 +1,18 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2016 Google Inc + * + * 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; version 2 of the License. + * + * 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. + */ + #ifndef _STDTYPES_H #define _STDTYPES_H diff --git a/util/vgabios/include/swab.h b/util/vgabios/include/swab.h new file mode 100644 index 0000000000..28d0b8abb2 --- /dev/null +++ b/util/vgabios/include/swab.h @@ -0,0 +1,57 @@ +/* + * This file is part of the coreboot project. + * + * 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; version 2 of the License. + * + * 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. + */ + +#ifndef _SWAB_H +#define _SWAB_H + +/* + * linux/byteorder/swab.h + * Byte-swapping, independently from CPU endianness + * swabXX[ps]?(foo) + * + * Francois-Rene Rideau 19971205 + * separated swab functions from cpu_to_XX, + * to clean up support for bizarre-endian architectures. + * + * See asm-i386/byteorder.h and such for examples of how to provide + * architecture-dependent optimized versions + * + */ + +/* casts are necessary for constants, because we never know how for sure + * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. + */ +#define swab16(x) \ + ((unsigned short)( \ + (((unsigned short)(x) & (unsigned short)0x00ffU) << 8) | \ + (((unsigned short)(x) & (unsigned short)0xff00U) >> 8) )) + +#define swab32(x) \ + ((unsigned int)( \ + (((unsigned int)(x) & (unsigned int)0x000000ffUL) << 24) | \ + (((unsigned int)(x) & (unsigned int)0x0000ff00UL) << 8) | \ + (((unsigned int)(x) & (unsigned int)0x00ff0000UL) >> 8) | \ + (((unsigned int)(x) & (unsigned int)0xff000000UL) >> 24) )) + +#define swab64(x) \ + ((uint64_t)( \ + (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \ + (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \ + (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \ + (((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \ + (((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \ + (((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \ + (((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \ + (((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) )) + +#endif /* _SWAB_H */ -- cgit v1.2.3