diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2015-10-21 13:00:41 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2016-02-18 01:47:04 +0100 |
commit | 05082737a9507a8bbb238d9d439f74a72a7606e8 (patch) | |
tree | dd5ec603f620e9e4a7a054533d5098b2a19c97b2 /util/vgabios/include | |
parent | eb960f1af93b55cbfb0d5f86343970ded151d3c7 (diff) |
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 <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/12117
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'util/vgabios/include')
-rw-r--r-- | util/vgabios/include/arch/byteorder.h | 24 | ||||
-rw-r--r-- | util/vgabios/include/arch/io.h | 4 | ||||
-rw-r--r-- | util/vgabios/include/config.h | 35 | ||||
-rw-r--r-- | util/vgabios/include/console/console.h | 17 | ||||
-rw-r--r-- | util/vgabios/include/stdtypes.h | 15 | ||||
-rw-r--r-- | util/vgabios/include/swab.h | 57 |
6 files changed, 147 insertions, 5 deletions
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 <sys/io.h> -#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 <fare@tunes.org> 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 */ |