diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/openbios/drivers/fw_cfg.c | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/openbios/drivers/fw_cfg.c')
-rw-r--r-- | qemu/roms/openbios/drivers/fw_cfg.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/qemu/roms/openbios/drivers/fw_cfg.c b/qemu/roms/openbios/drivers/fw_cfg.c deleted file mode 100644 index 402757070..000000000 --- a/qemu/roms/openbios/drivers/fw_cfg.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "config.h" -#include "libopenbios/bindings.h" -#include "libc/byteorder.h" -#include "libopenbios/ofmem.h" -#define NO_QEMU_PROTOS -#include "arch/common/fw_cfg.h" - -#if !defined(CONFIG_SPARC64) -static volatile uint16_t *fw_cfg_cmd; -static volatile uint8_t *fw_cfg_data; - -void -fw_cfg_read(uint16_t cmd, char *buf, unsigned int nbytes) -{ - unsigned int i; - - *fw_cfg_cmd = cmd; - for (i = 0; i < nbytes; i++) - buf[i] = *fw_cfg_data; -} -#else -// XXX depends on PCI bus location, should be removed -void -fw_cfg_read(uint16_t cmd, char *buf, unsigned int nbytes) -{ - unsigned int i; - - outw(cmd, CONFIG_FW_CFG_ADDR); - for (i = 0; i < nbytes; i++) - buf[i] = inb(CONFIG_FW_CFG_ADDR + 1); -} -#endif - -uint64_t -fw_cfg_read_i64(uint16_t cmd) -{ - uint64_t buf; - - fw_cfg_read(cmd, (char *)&buf, sizeof(uint64_t)); - - return __le64_to_cpu(buf); -} - -uint32_t -fw_cfg_read_i32(uint16_t cmd) -{ - uint32_t buf; - - fw_cfg_read(cmd, (char *)&buf, sizeof(uint32_t)); - - return __le32_to_cpu(buf); -} - -uint16_t -fw_cfg_read_i16(uint16_t cmd) -{ - uint16_t buf; - - fw_cfg_read(cmd, (char *)&buf, sizeof(uint16_t)); - - return __le16_to_cpu(buf); -} - -void -fw_cfg_init(void) -{ -#if defined(CONFIG_SPARC32) - fw_cfg_cmd = (void *)ofmem_map_io(CONFIG_FW_CFG_ADDR, 2); - fw_cfg_data = (uint8_t *)fw_cfg_cmd + 2; -#elif defined(CONFIG_SPARC64) - // Nothing for the port version -#elif defined(CONFIG_PPC) - fw_cfg_cmd = (void *)CONFIG_FW_CFG_ADDR; - fw_cfg_data = (void *)(CONFIG_FW_CFG_ADDR + 2); -#endif -} |