mirror of
https://gitlab.com/qemu-project/ipxe.git
synced 2025-11-03 07:59:06 +08:00
Compare commits
4 Commits
eficmdline
...
rtlvlan
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d1d28a4cc | |||
| aa85c2918a | |||
| 66a2ff442d | |||
| 3bcd0d3271 |
@ -1067,11 +1067,15 @@ static void realtek_detect ( struct realtek_nic *rtl ) {
|
||||
* Note that enabling DAC seems to cause bizarre behaviour
|
||||
* (lockups, garbage data on the wire) on some systems, even
|
||||
* if only 32-bit addresses are used.
|
||||
*
|
||||
* Disable VLAN offload, since some cards seem to have it
|
||||
* enabled by default.
|
||||
*/
|
||||
cpcr = readw ( rtl->regs + RTL_CPCR );
|
||||
cpcr |= ( RTL_CPCR_MULRW | RTL_CPCR_CPRX | RTL_CPCR_CPTX );
|
||||
if ( sizeof ( physaddr_t ) > sizeof ( uint32_t ) )
|
||||
cpcr |= RTL_CPCR_DAC;
|
||||
cpcr &= ~RTL_CPCR_VLAN;
|
||||
writew ( cpcr, rtl->regs + RTL_CPCR );
|
||||
check_cpcr = readw ( rtl->regs + RTL_CPCR );
|
||||
|
||||
|
||||
@ -230,6 +230,7 @@ enum realtek_legacy_status {
|
||||
#define RTL_CPCR 0xe0
|
||||
#define RTL_CPCR_DAC 0x0010 /**< PCI Dual Address Cycle Enable */
|
||||
#define RTL_CPCR_MULRW 0x0008 /**< PCI Multiple Read/Write Enable */
|
||||
#define RTL_CPCR_VLAN 0x0040 /**< VLAN tag stripping enable */
|
||||
#define RTL_CPCR_CPRX 0x0002 /**< C+ receive enable */
|
||||
#define RTL_CPCR_CPTX 0x0001 /**< C+ transmit enable */
|
||||
|
||||
|
||||
@ -274,8 +274,9 @@ struct dhcp_client_architecture {
|
||||
|
||||
/** DHCP client architecture values
|
||||
*
|
||||
* These are defined by the PXE specification and redefined by
|
||||
* RFC4578.
|
||||
* These are originally defined by the PXE specification, redefined by
|
||||
* RFC4578, redefined again by RFC5970, and now maintained in the IANA
|
||||
* DHCPv6 parameters registry.
|
||||
*/
|
||||
enum dhcp_client_architecture_values {
|
||||
/** Intel x86 PC */
|
||||
@ -302,6 +303,24 @@ enum dhcp_client_architecture_values {
|
||||
DHCP_CLIENT_ARCHITECTURE_ARM32 = 0x000a,
|
||||
/** EFI 64-bit ARM */
|
||||
DHCP_CLIENT_ARCHITECTURE_ARM64 = 0x000b,
|
||||
/** EFI 32-bit RISC-V */
|
||||
DHCP_CLIENT_ARCHITECTURE_RISCV32 = 0x0019,
|
||||
/** EFI 64-bit RISC-V */
|
||||
DHCP_CLIENT_ARCHITECTURE_RISCV64 = 0x001b,
|
||||
/** EFI 128-bit RISC-V */
|
||||
DHCP_CLIENT_ARCHITECTURE_RISCV128 = 0x001d,
|
||||
/** EFI 32-bit MIPS */
|
||||
DHCP_CLIENT_ARCHITECTURE_MIPS32 = 0x0021,
|
||||
/** EFI 64-bit MIPS */
|
||||
DHCP_CLIENT_ARCHITECTURE_MIPS64 = 0x0022,
|
||||
/** EFI 32-bit Sunway */
|
||||
DHCP_CLIENT_ARCHITECTURE_SUNWAY32 = 0x0023,
|
||||
/** EFI 64-bit Sunway */
|
||||
DHCP_CLIENT_ARCHITECTURE_SUNWAY64 = 0x0024,
|
||||
/** EFI 32-bit LoongArch */
|
||||
DHCP_CLIENT_ARCHITECTURE_LOONG32 = 0x0025,
|
||||
/** EFI 64-bit LoongArch */
|
||||
DHCP_CLIENT_ARCHITECTURE_LOONG64 = 0x0027,
|
||||
};
|
||||
|
||||
/** Client network device interface */
|
||||
|
||||
@ -30,17 +30,17 @@ FILE_LICENCE ( BSD2_PATENT );
|
||||
// Assume standard LoongArch 64-bit alignment.
|
||||
// Need to check portability of long long
|
||||
//
|
||||
typedef unsigned long UINT64;
|
||||
typedef long INT64;
|
||||
typedef unsigned int UINT32;
|
||||
typedef int INT32;
|
||||
typedef unsigned short UINT16;
|
||||
typedef unsigned short CHAR16;
|
||||
typedef short INT16;
|
||||
typedef unsigned char BOOLEAN;
|
||||
typedef unsigned char UINT8;
|
||||
typedef char CHAR8;
|
||||
typedef char INT8;
|
||||
typedef unsigned long long UINT64;
|
||||
typedef long long INT64;
|
||||
typedef unsigned int UINT32;
|
||||
typedef int INT32;
|
||||
typedef unsigned short UINT16;
|
||||
typedef unsigned short CHAR16;
|
||||
typedef short INT16;
|
||||
typedef unsigned char BOOLEAN;
|
||||
typedef unsigned char UINT8;
|
||||
typedef char CHAR8;
|
||||
typedef char INT8;
|
||||
|
||||
//
|
||||
// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
|
||||
|
||||
@ -66,7 +66,7 @@ typedef enum {
|
||||
// /// EfiGcdMemoryTypeUnaccepted is defined in PrePiDxeCis.h because it has not been
|
||||
// /// defined in PI spec.
|
||||
// EfiGcdMemoryTypeUnaccepted,
|
||||
EfiGcdMemoryTypeMaximum = 8
|
||||
EfiGcdMemoryTypeMaximum = 7
|
||||
} EFI_GCD_MEMORY_TYPE;
|
||||
|
||||
///
|
||||
|
||||
53
src/tests/nap_test.c
Normal file
53
src/tests/nap_test.c
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Michael Brown <mbrown@fensystems.co.uk>.
|
||||
*
|
||||
* 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*
|
||||
* You can also choose to distribute this program under the terms of
|
||||
* the Unmodified Binary Distribution Licence (as given in the file
|
||||
* COPYING.UBDL), provided that you have satisfied its requirements.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
/** @file
|
||||
*
|
||||
* CPU sleeping test
|
||||
*
|
||||
*/
|
||||
|
||||
/* Forcibly enable assertions */
|
||||
#undef NDEBUG
|
||||
|
||||
#include <ipxe/nap.h>
|
||||
#include <ipxe/test.h>
|
||||
|
||||
/**
|
||||
* Perform CPU sleeping self-test
|
||||
*
|
||||
*/
|
||||
static void nap_test_exec ( void ) {
|
||||
|
||||
/* Check that we can sleep without crashing or halting forever */
|
||||
cpu_nap();
|
||||
ok ( 1 );
|
||||
}
|
||||
|
||||
/** CPU sleeping self-test */
|
||||
struct self_test nap_test __self_test = {
|
||||
.name = "nap",
|
||||
.exec = nap_test_exec,
|
||||
};
|
||||
@ -80,3 +80,4 @@ REQUIRE_OBJECT ( acpi_test );
|
||||
REQUIRE_OBJECT ( hmac_test );
|
||||
REQUIRE_OBJECT ( dhe_test );
|
||||
REQUIRE_OBJECT ( gcm_test );
|
||||
REQUIRE_OBJECT ( nap_test );
|
||||
|
||||
Reference in New Issue
Block a user