hw/block/nvme: add non-mdts command size limit for verify
[qemu/ar7.git] / hw / ppc / fw_cfg.c
bloba88b5c4bde24393462204c858eaeb22237281293
1 /*
2 * fw_cfg helpers (PPC specific)
4 * Copyright (c) 2019 Red Hat, Inc.
6 * Author:
7 * Philippe Mathieu-Daudé <philmd@redhat.com>
9 * SPDX-License-Identifier: GPL-2.0-or-later
11 * This work is licensed under the terms of the GNU GPL, version 2 or later.
12 * See the COPYING file in the top-level directory.
15 #include "qemu/osdep.h"
16 #include "hw/ppc/ppc.h"
17 #include "hw/nvram/fw_cfg.h"
19 const char *fw_cfg_arch_key_name(uint16_t key)
21 static const struct {
22 uint16_t key;
23 const char *name;
24 } fw_cfg_arch_wellknown_keys[] = {
25 {FW_CFG_PPC_WIDTH, "width"},
26 {FW_CFG_PPC_HEIGHT, "height"},
27 {FW_CFG_PPC_DEPTH, "depth"},
28 {FW_CFG_PPC_TBFREQ, "tbfreq"},
29 {FW_CFG_PPC_CLOCKFREQ, "clockfreq"},
30 {FW_CFG_PPC_IS_KVM, "is_kvm"},
31 {FW_CFG_PPC_KVM_HC, "kvm_hc"},
32 {FW_CFG_PPC_KVM_PID, "pid"},
33 {FW_CFG_PPC_NVRAM_ADDR, "nvram_addr"},
34 {FW_CFG_PPC_BUSFREQ, "busfreq"},
35 {FW_CFG_PPC_NVRAM_FLAT, "nvram_flat"},
36 {FW_CFG_PPC_VIACONFIG, "viaconfig"},
39 for (size_t i = 0; i < ARRAY_SIZE(fw_cfg_arch_wellknown_keys); i++) {
40 if (fw_cfg_arch_wellknown_keys[i].key == key) {
41 return fw_cfg_arch_wellknown_keys[i].name;
44 return NULL;