13cce6243Sblueswir1 #ifndef FW_CFG_H 23cce6243Sblueswir1 #define FW_CFG_H 33cce6243Sblueswir1 41dfe5057SHu Tao #include "exec/hwaddr.h" 55be5df72SMarc-André Lureau #include "standard-headers/linux/qemu_fw_cfg.h" 639736e18SMark Cave-Ayland #include "hw/sysbus.h" 739736e18SMark Cave-Ayland #include "sysemu/dma.h" 839736e18SMark Cave-Ayland 939736e18SMark Cave-Ayland #define TYPE_FW_CFG "fw_cfg" 1039736e18SMark Cave-Ayland #define TYPE_FW_CFG_IO "fw_cfg_io" 1139736e18SMark Cave-Ayland #define TYPE_FW_CFG_MEM "fw_cfg_mem" 1232031489SPhilippe Mathieu-Daudé #define TYPE_FW_CFG_DATA_GENERATOR_INTERFACE "fw_cfg-data-generator" 1339736e18SMark Cave-Ayland 1439736e18SMark Cave-Ayland #define FW_CFG(obj) OBJECT_CHECK(FWCfgState, (obj), TYPE_FW_CFG) 1539736e18SMark Cave-Ayland #define FW_CFG_IO(obj) OBJECT_CHECK(FWCfgIoState, (obj), TYPE_FW_CFG_IO) 1639736e18SMark Cave-Ayland #define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM) 171dfe5057SHu Tao 1832031489SPhilippe Mathieu-Daudé #define FW_CFG_DATA_GENERATOR_CLASS(class) \ 1932031489SPhilippe Mathieu-Daudé OBJECT_CLASS_CHECK(FWCfgDataGeneratorClass, (class), \ 2032031489SPhilippe Mathieu-Daudé TYPE_FW_CFG_DATA_GENERATOR_INTERFACE) 2132031489SPhilippe Mathieu-Daudé #define FW_CFG_DATA_GENERATOR_GET_CLASS(obj) \ 2232031489SPhilippe Mathieu-Daudé OBJECT_GET_CLASS(FWCfgDataGeneratorClass, (obj), \ 2332031489SPhilippe Mathieu-Daudé TYPE_FW_CFG_DATA_GENERATOR_INTERFACE) 2432031489SPhilippe Mathieu-Daudé 2532031489SPhilippe Mathieu-Daudé typedef struct FWCfgDataGeneratorClass { 2632031489SPhilippe Mathieu-Daudé /*< private >*/ 2732031489SPhilippe Mathieu-Daudé InterfaceClass parent_class; 2832031489SPhilippe Mathieu-Daudé /*< public >*/ 2932031489SPhilippe Mathieu-Daudé 3032031489SPhilippe Mathieu-Daudé /** 3132031489SPhilippe Mathieu-Daudé * get_data: 3232031489SPhilippe Mathieu-Daudé * @obj: the object implementing this interface 3332031489SPhilippe Mathieu-Daudé * @errp: pointer to a NULL-initialized error object 3432031489SPhilippe Mathieu-Daudé * 35*a3ad5834SPhilippe Mathieu-Daudé * Returns: reference to a byte array containing the data on success, 36*a3ad5834SPhilippe Mathieu-Daudé * or NULL on error. 37*a3ad5834SPhilippe Mathieu-Daudé * 3832031489SPhilippe Mathieu-Daudé * The caller should release the reference when no longer 3932031489SPhilippe Mathieu-Daudé * required. 4032031489SPhilippe Mathieu-Daudé */ 4132031489SPhilippe Mathieu-Daudé GByteArray *(*get_data)(Object *obj, Error **errp); 4232031489SPhilippe Mathieu-Daudé } FWCfgDataGeneratorClass; 4332031489SPhilippe Mathieu-Daudé 445be5df72SMarc-André Lureau typedef struct fw_cfg_file FWCfgFile; 45abe147e0SGerd Hoffmann 46bab47d9aSGerd Hoffmann #define FW_CFG_ORDER_OVERRIDE_VGA 70 47bab47d9aSGerd Hoffmann #define FW_CFG_ORDER_OVERRIDE_NIC 80 48bab47d9aSGerd Hoffmann #define FW_CFG_ORDER_OVERRIDE_USER 100 49bab47d9aSGerd Hoffmann #define FW_CFG_ORDER_OVERRIDE_DEVICE 110 50bab47d9aSGerd Hoffmann 51bab47d9aSGerd Hoffmann void fw_cfg_set_order_override(FWCfgState *fw_cfg, int order); 52bab47d9aSGerd Hoffmann void fw_cfg_reset_order_override(FWCfgState *fw_cfg); 53bab47d9aSGerd Hoffmann 54abe147e0SGerd Hoffmann typedef struct FWCfgFiles { 55abe147e0SGerd Hoffmann uint32_t count; 56abe147e0SGerd Hoffmann FWCfgFile f[]; 57abe147e0SGerd Hoffmann } FWCfgFiles; 58abe147e0SGerd Hoffmann 595be5df72SMarc-André Lureau typedef struct fw_cfg_dma_access FWCfgDmaAccess; 60a4c0d1deSMarc Marí 616f6f4aecSMarc-André Lureau typedef void (*FWCfgCallback)(void *opaque); 625f9252f7SMarc-André Lureau typedef void (*FWCfgWriteCallback)(void *opaque, off_t start, size_t len); 633cce6243Sblueswir1 6439736e18SMark Cave-Ayland struct FWCfgState { 6539736e18SMark Cave-Ayland /*< private >*/ 6639736e18SMark Cave-Ayland SysBusDevice parent_obj; 6739736e18SMark Cave-Ayland /*< public >*/ 6839736e18SMark Cave-Ayland 6939736e18SMark Cave-Ayland uint16_t file_slots; 7039736e18SMark Cave-Ayland FWCfgEntry *entries[2]; 7139736e18SMark Cave-Ayland int *entry_order; 7239736e18SMark Cave-Ayland FWCfgFiles *files; 7339736e18SMark Cave-Ayland uint16_t cur_entry; 7439736e18SMark Cave-Ayland uint32_t cur_offset; 7539736e18SMark Cave-Ayland Notifier machine_ready; 7639736e18SMark Cave-Ayland 7739736e18SMark Cave-Ayland int fw_cfg_order_override; 7839736e18SMark Cave-Ayland 7939736e18SMark Cave-Ayland bool dma_enabled; 8039736e18SMark Cave-Ayland dma_addr_t dma_addr; 8139736e18SMark Cave-Ayland AddressSpace *dma_as; 8239736e18SMark Cave-Ayland MemoryRegion dma_iomem; 83394f0f72SShameer Kolothum 84394f0f72SShameer Kolothum /* restore during migration */ 85394f0f72SShameer Kolothum bool acpi_mr_restore; 86394f0f72SShameer Kolothum uint64_t table_mr_size; 87394f0f72SShameer Kolothum uint64_t linker_mr_size; 88394f0f72SShameer Kolothum uint64_t rsdp_mr_size; 8939736e18SMark Cave-Ayland }; 9039736e18SMark Cave-Ayland 9139736e18SMark Cave-Ayland struct FWCfgIoState { 9239736e18SMark Cave-Ayland /*< private >*/ 9339736e18SMark Cave-Ayland FWCfgState parent_obj; 9439736e18SMark Cave-Ayland /*< public >*/ 9539736e18SMark Cave-Ayland 9639736e18SMark Cave-Ayland MemoryRegion comb_iomem; 9739736e18SMark Cave-Ayland }; 9839736e18SMark Cave-Ayland 9939736e18SMark Cave-Ayland struct FWCfgMemState { 10039736e18SMark Cave-Ayland /*< private >*/ 10139736e18SMark Cave-Ayland FWCfgState parent_obj; 10239736e18SMark Cave-Ayland /*< public >*/ 10339736e18SMark Cave-Ayland 10439736e18SMark Cave-Ayland MemoryRegion ctl_iomem, data_iomem; 10539736e18SMark Cave-Ayland uint32_t data_width; 10639736e18SMark Cave-Ayland MemoryRegionOps wide_data_ops; 10739736e18SMark Cave-Ayland }; 10839736e18SMark Cave-Ayland 1099c4a5c55SGabriel L. Somlo /** 1109c4a5c55SGabriel L. Somlo * fw_cfg_add_bytes: 1119c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 1129c4a5c55SGabriel L. Somlo * @key: selector key value for new fw_cfg item 1139c4a5c55SGabriel L. Somlo * @data: pointer to start of item data 1149c4a5c55SGabriel L. Somlo * @len: size of item data 1159c4a5c55SGabriel L. Somlo * 1169c4a5c55SGabriel L. Somlo * Add a new fw_cfg item, available by selecting the given key, as a raw 1179c4a5c55SGabriel L. Somlo * "blob" of the given size. The data referenced by the starting pointer 1189c4a5c55SGabriel L. Somlo * is only linked, NOT copied, into the data structure of the fw_cfg device. 1199c4a5c55SGabriel L. Somlo */ 120089da572SMarkus Armbruster void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, void *data, size_t len); 1219c4a5c55SGabriel L. Somlo 1229c4a5c55SGabriel L. Somlo /** 1239c4a5c55SGabriel L. Somlo * fw_cfg_add_string: 1249c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 1259c4a5c55SGabriel L. Somlo * @key: selector key value for new fw_cfg item 1269c4a5c55SGabriel L. Somlo * @value: NUL-terminated ascii string 1279c4a5c55SGabriel L. Somlo * 1289c4a5c55SGabriel L. Somlo * Add a new fw_cfg item, available by selecting the given key. The item 1299c4a5c55SGabriel L. Somlo * data will consist of a dynamically allocated copy of the provided string, 1309c4a5c55SGabriel L. Somlo * including its NUL terminator. 1319c4a5c55SGabriel L. Somlo */ 13244687f75SMarkus Armbruster void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value); 1339c4a5c55SGabriel L. Somlo 1349c4a5c55SGabriel L. Somlo /** 135e5f6aa31SSergio Lopez * fw_cfg_modify_string: 136e5f6aa31SSergio Lopez * @s: fw_cfg device being modified 137e5f6aa31SSergio Lopez * @key: selector key value for new fw_cfg item 138e5f6aa31SSergio Lopez * @value: NUL-terminated ascii string 139e5f6aa31SSergio Lopez * 140e5f6aa31SSergio Lopez * Replace the fw_cfg item available by selecting the given key. The new 141e5f6aa31SSergio Lopez * data will consist of a dynamically allocated copy of the provided string, 142e5f6aa31SSergio Lopez * including its NUL terminator. The data being replaced, assumed to have 143e5f6aa31SSergio Lopez * been dynamically allocated during an earlier call to either 144e5f6aa31SSergio Lopez * fw_cfg_add_string() or fw_cfg_modify_string(), is freed before returning. 145e5f6aa31SSergio Lopez */ 146e5f6aa31SSergio Lopez void fw_cfg_modify_string(FWCfgState *s, uint16_t key, const char *value); 147e5f6aa31SSergio Lopez 148e5f6aa31SSergio Lopez /** 1499c4a5c55SGabriel L. Somlo * fw_cfg_add_i16: 1509c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 1519c4a5c55SGabriel L. Somlo * @key: selector key value for new fw_cfg item 1529c4a5c55SGabriel L. Somlo * @value: 16-bit integer 1539c4a5c55SGabriel L. Somlo * 1549c4a5c55SGabriel L. Somlo * Add a new fw_cfg item, available by selecting the given key. The item 1559c4a5c55SGabriel L. Somlo * data will consist of a dynamically allocated copy of the given 16-bit 1569c4a5c55SGabriel L. Somlo * value, converted to little-endian representation. 1579c4a5c55SGabriel L. Somlo */ 1584cad3867SMarkus Armbruster void fw_cfg_add_i16(FWCfgState *s, uint16_t key, uint16_t value); 1599c4a5c55SGabriel L. Somlo 1609c4a5c55SGabriel L. Somlo /** 1619c4a5c55SGabriel L. Somlo * fw_cfg_modify_i16: 1629c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 1639c4a5c55SGabriel L. Somlo * @key: selector key value for new fw_cfg item 1649c4a5c55SGabriel L. Somlo * @value: 16-bit integer 1659c4a5c55SGabriel L. Somlo * 1669c4a5c55SGabriel L. Somlo * Replace the fw_cfg item available by selecting the given key. The new 1679c4a5c55SGabriel L. Somlo * data will consist of a dynamically allocated copy of the given 16-bit 1689c4a5c55SGabriel L. Somlo * value, converted to little-endian representation. The data being replaced, 1699c4a5c55SGabriel L. Somlo * assumed to have been dynamically allocated during an earlier call to 1709c4a5c55SGabriel L. Somlo * either fw_cfg_add_i16() or fw_cfg_modify_i16(), is freed before returning. 1719c4a5c55SGabriel L. Somlo */ 1721edd34b6SGabriel L. Somlo void fw_cfg_modify_i16(FWCfgState *s, uint16_t key, uint16_t value); 1739c4a5c55SGabriel L. Somlo 1749c4a5c55SGabriel L. Somlo /** 1759c4a5c55SGabriel L. Somlo * fw_cfg_add_i32: 1769c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 1779c4a5c55SGabriel L. Somlo * @key: selector key value for new fw_cfg item 1789c4a5c55SGabriel L. Somlo * @value: 32-bit integer 1799c4a5c55SGabriel L. Somlo * 1809c4a5c55SGabriel L. Somlo * Add a new fw_cfg item, available by selecting the given key. The item 1819c4a5c55SGabriel L. Somlo * data will consist of a dynamically allocated copy of the given 32-bit 1829c4a5c55SGabriel L. Somlo * value, converted to little-endian representation. 1839c4a5c55SGabriel L. Somlo */ 1844cad3867SMarkus Armbruster void fw_cfg_add_i32(FWCfgState *s, uint16_t key, uint32_t value); 1859c4a5c55SGabriel L. Somlo 1869c4a5c55SGabriel L. Somlo /** 187e5f6aa31SSergio Lopez * fw_cfg_modify_i32: 188e5f6aa31SSergio Lopez * @s: fw_cfg device being modified 189e5f6aa31SSergio Lopez * @key: selector key value for new fw_cfg item 190e5f6aa31SSergio Lopez * @value: 32-bit integer 191e5f6aa31SSergio Lopez * 192e5f6aa31SSergio Lopez * Replace the fw_cfg item available by selecting the given key. The new 193e5f6aa31SSergio Lopez * data will consist of a dynamically allocated copy of the given 32-bit 194e5f6aa31SSergio Lopez * value, converted to little-endian representation. The data being replaced, 195e5f6aa31SSergio Lopez * assumed to have been dynamically allocated during an earlier call to 196e5f6aa31SSergio Lopez * either fw_cfg_add_i32() or fw_cfg_modify_i32(), is freed before returning. 197e5f6aa31SSergio Lopez */ 198e5f6aa31SSergio Lopez void fw_cfg_modify_i32(FWCfgState *s, uint16_t key, uint32_t value); 199e5f6aa31SSergio Lopez 200e5f6aa31SSergio Lopez /** 2019c4a5c55SGabriel L. Somlo * fw_cfg_add_i64: 2029c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 2039c4a5c55SGabriel L. Somlo * @key: selector key value for new fw_cfg item 2049c4a5c55SGabriel L. Somlo * @value: 64-bit integer 2059c4a5c55SGabriel L. Somlo * 2069c4a5c55SGabriel L. Somlo * Add a new fw_cfg item, available by selecting the given key. The item 2079c4a5c55SGabriel L. Somlo * data will consist of a dynamically allocated copy of the given 64-bit 2089c4a5c55SGabriel L. Somlo * value, converted to little-endian representation. 2099c4a5c55SGabriel L. Somlo */ 2104cad3867SMarkus Armbruster void fw_cfg_add_i64(FWCfgState *s, uint16_t key, uint64_t value); 2119c4a5c55SGabriel L. Somlo 2129c4a5c55SGabriel L. Somlo /** 213e5f6aa31SSergio Lopez * fw_cfg_modify_i64: 214e5f6aa31SSergio Lopez * @s: fw_cfg device being modified 215e5f6aa31SSergio Lopez * @key: selector key value for new fw_cfg item 216e5f6aa31SSergio Lopez * @value: 64-bit integer 217e5f6aa31SSergio Lopez * 218e5f6aa31SSergio Lopez * Replace the fw_cfg item available by selecting the given key. The new 219e5f6aa31SSergio Lopez * data will consist of a dynamically allocated copy of the given 64-bit 220e5f6aa31SSergio Lopez * value, converted to little-endian representation. The data being replaced, 221e5f6aa31SSergio Lopez * assumed to have been dynamically allocated during an earlier call to 222e5f6aa31SSergio Lopez * either fw_cfg_add_i64() or fw_cfg_modify_i64(), is freed before returning. 223e5f6aa31SSergio Lopez */ 224e5f6aa31SSergio Lopez void fw_cfg_modify_i64(FWCfgState *s, uint16_t key, uint64_t value); 225e5f6aa31SSergio Lopez 226e5f6aa31SSergio Lopez /** 2279c4a5c55SGabriel L. Somlo * fw_cfg_add_file: 2289c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 2299c4a5c55SGabriel L. Somlo * @filename: name of new fw_cfg file item 2309c4a5c55SGabriel L. Somlo * @data: pointer to start of item data 2319c4a5c55SGabriel L. Somlo * @len: size of item data 2329c4a5c55SGabriel L. Somlo * 2339c4a5c55SGabriel L. Somlo * Add a new NAMED fw_cfg item as a raw "blob" of the given size. The data 2349c4a5c55SGabriel L. Somlo * referenced by the starting pointer is only linked, NOT copied, into the 2359c4a5c55SGabriel L. Somlo * data structure of the fw_cfg device. 2369c4a5c55SGabriel L. Somlo * The next available (unused) selector key starting at FW_CFG_FILE_FIRST 2379c4a5c55SGabriel L. Somlo * will be used; also, a new entry will be added to the file directory 2389c4a5c55SGabriel L. Somlo * structure residing at key value FW_CFG_FILE_DIR, containing the item name, 2399c4a5c55SGabriel L. Somlo * data size, and assigned selector key value. 2409c4a5c55SGabriel L. Somlo */ 241089da572SMarkus Armbruster void fw_cfg_add_file(FWCfgState *s, const char *filename, void *data, 242089da572SMarkus Armbruster size_t len); 2439c4a5c55SGabriel L. Somlo 2449c4a5c55SGabriel L. Somlo /** 2459c4a5c55SGabriel L. Somlo * fw_cfg_add_file_callback: 2469c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 2479c4a5c55SGabriel L. Somlo * @filename: name of new fw_cfg file item 2486f6f4aecSMarc-André Lureau * @select_cb: callback function when selecting 2495f9252f7SMarc-André Lureau * @write_cb: callback function after a write 2509c4a5c55SGabriel L. Somlo * @callback_opaque: argument to be passed into callback function 2519c4a5c55SGabriel L. Somlo * @data: pointer to start of item data 2529c4a5c55SGabriel L. Somlo * @len: size of item data 253baf2d5bfSMichael S. Tsirkin * @read_only: is file read only 2549c4a5c55SGabriel L. Somlo * 2559c4a5c55SGabriel L. Somlo * Add a new NAMED fw_cfg item as a raw "blob" of the given size. The data 2569c4a5c55SGabriel L. Somlo * referenced by the starting pointer is only linked, NOT copied, into the 2579c4a5c55SGabriel L. Somlo * data structure of the fw_cfg device. 2589c4a5c55SGabriel L. Somlo * The next available (unused) selector key starting at FW_CFG_FILE_FIRST 2599c4a5c55SGabriel L. Somlo * will be used; also, a new entry will be added to the file directory 2609c4a5c55SGabriel L. Somlo * structure residing at key value FW_CFG_FILE_DIR, containing the item name, 2619c4a5c55SGabriel L. Somlo * data size, and assigned selector key value. 2629c4a5c55SGabriel L. Somlo * Additionally, set a callback function (and argument) to be called each 2633bef7e8aSGabriel L. Somlo * time this item is selected (by having its selector key either written to 2643bef7e8aSGabriel L. Somlo * the fw_cfg control register, or passed to QEMU in FWCfgDmaAccess.control 2653bef7e8aSGabriel L. Somlo * with FW_CFG_DMA_CTL_SELECT). 2669c4a5c55SGabriel L. Somlo */ 267d87072ceSMichael S. Tsirkin void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, 2686f6f4aecSMarc-André Lureau FWCfgCallback select_cb, 2695f9252f7SMarc-André Lureau FWCfgWriteCallback write_cb, 2706f6f4aecSMarc-André Lureau void *callback_opaque, 271baf2d5bfSMichael S. Tsirkin void *data, size_t len, bool read_only); 2729c4a5c55SGabriel L. Somlo 2739c4a5c55SGabriel L. Somlo /** 2749c4a5c55SGabriel L. Somlo * fw_cfg_modify_file: 2759c4a5c55SGabriel L. Somlo * @s: fw_cfg device being modified 2769c4a5c55SGabriel L. Somlo * @filename: name of new fw_cfg file item 2779c4a5c55SGabriel L. Somlo * @data: pointer to start of item data 2789c4a5c55SGabriel L. Somlo * @len: size of item data 2799c4a5c55SGabriel L. Somlo * 2809c4a5c55SGabriel L. Somlo * Replace a NAMED fw_cfg item. If an existing item is found, its callback 2819c4a5c55SGabriel L. Somlo * information will be cleared, and a pointer to its data will be returned 2829c4a5c55SGabriel L. Somlo * to the caller, so that it may be freed if necessary. If an existing item 2839c4a5c55SGabriel L. Somlo * is not found, this call defaults to fw_cfg_add_file(), and NULL is 2849c4a5c55SGabriel L. Somlo * returned to the caller. 2859c4a5c55SGabriel L. Somlo * In either case, the new item data is only linked, NOT copied, into the 2869c4a5c55SGabriel L. Somlo * data structure of the fw_cfg device. 2879c4a5c55SGabriel L. Somlo * 2889c4a5c55SGabriel L. Somlo * Returns: pointer to old item's data, or NULL if old item does not exist. 2899c4a5c55SGabriel L. Somlo */ 290bdbb5b17SGonglei void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data, 291bdbb5b17SGonglei size_t len); 2929c4a5c55SGabriel L. Somlo 29332031489SPhilippe Mathieu-Daudé /** 29432031489SPhilippe Mathieu-Daudé * fw_cfg_add_from_generator: 29532031489SPhilippe Mathieu-Daudé * @s: fw_cfg device being modified 29632031489SPhilippe Mathieu-Daudé * @filename: name of new fw_cfg file item 29732031489SPhilippe Mathieu-Daudé * @gen_id: name of object implementing FW_CFG_DATA_GENERATOR interface 29832031489SPhilippe Mathieu-Daudé * @errp: pointer to a NULL initialized error object 29932031489SPhilippe Mathieu-Daudé * 30032031489SPhilippe Mathieu-Daudé * Add a new NAMED fw_cfg item with the content generated from the 30132031489SPhilippe Mathieu-Daudé * @gen_id object. The data generated by the @gen_id object is copied 30232031489SPhilippe Mathieu-Daudé * into the data structure of the fw_cfg device. 30332031489SPhilippe Mathieu-Daudé * The next available (unused) selector key starting at FW_CFG_FILE_FIRST 30432031489SPhilippe Mathieu-Daudé * will be used; also, a new entry will be added to the file directory 30532031489SPhilippe Mathieu-Daudé * structure residing at key value FW_CFG_FILE_DIR, containing the item name, 30632031489SPhilippe Mathieu-Daudé * data size, and assigned selector key value. 30732031489SPhilippe Mathieu-Daudé */ 30832031489SPhilippe Mathieu-Daudé void fw_cfg_add_from_generator(FWCfgState *s, const char *filename, 30932031489SPhilippe Mathieu-Daudé const char *gen_id, Error **errp); 31032031489SPhilippe Mathieu-Daudé 311a4c0d1deSMarc Marí FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, 312a4c0d1deSMarc Marí AddressSpace *dma_as); 3135712db6aSLaszlo Ersek FWCfgState *fw_cfg_init_io(uint32_t iobase); 3145712db6aSLaszlo Ersek FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr); 315a4c0d1deSMarc Marí FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, 316a4c0d1deSMarc Marí hwaddr data_addr, uint32_t data_width, 317a4c0d1deSMarc Marí hwaddr dma_addr, AddressSpace *dma_as); 3183cce6243Sblueswir1 319600c60b7SMichael S. Tsirkin FWCfgState *fw_cfg_find(void); 320b2a575a1SMarc Marí bool fw_cfg_dma_enabled(void *opaque); 321600c60b7SMichael S. Tsirkin 322b15c0f7dSPhilippe Mathieu-Daudé /** 323b15c0f7dSPhilippe Mathieu-Daudé * fw_cfg_arch_key_name: 324b15c0f7dSPhilippe Mathieu-Daudé * 325b15c0f7dSPhilippe Mathieu-Daudé * @key: The uint16 selector key. 326b15c0f7dSPhilippe Mathieu-Daudé * 327b15c0f7dSPhilippe Mathieu-Daudé * The key is architecture-specific (the FW_CFG_ARCH_LOCAL mask is expected 328b15c0f7dSPhilippe Mathieu-Daudé * to be set in the key). 329b15c0f7dSPhilippe Mathieu-Daudé * 330b15c0f7dSPhilippe Mathieu-Daudé * Returns: The stringified architecture-specific name if the selector 331b15c0f7dSPhilippe Mathieu-Daudé * refers to a well-known numerically defined item, or NULL on 332b15c0f7dSPhilippe Mathieu-Daudé * key lookup failure. 333b15c0f7dSPhilippe Mathieu-Daudé */ 334b15c0f7dSPhilippe Mathieu-Daudé const char *fw_cfg_arch_key_name(uint16_t key); 335b15c0f7dSPhilippe Mathieu-Daudé 3363cce6243Sblueswir1 #endif 337