diff --git a/libflashrom.c b/libflashrom.c
index 41abb35..1f8aa00 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -105,152 +105,7 @@
  * @{
  */
 
-/**
- * @brief Returns flashrom version
- * @return flashrom version
- */
-const char *flashrom_version_info(void)
-{
-	return flashrom_version;
-}
-
-/**
- * @brief Returns list of supported programmers
- * @return List of supported programmers, or NULL if an error occurred
- */
-const char **flashrom_supported_programmers(void)
-{
-	enum programmer p = 0;
-	const char **supported_programmers = malloc((PROGRAMMER_INVALID + 1) * sizeof(char*));
-
-	if (supported_programmers != NULL) {
-		for (; p < PROGRAMMER_INVALID; ++p) {
-			supported_programmers[p] = programmer_table[p].name;
-		}
-	} else {
-		msg_gerr("Memory allocation error!\n");
-	}
-
-	return supported_programmers;
-}
-
-/**
- * @brief Returns list of supported flash chips
- * @return List of supported flash chips, or NULL if an error occurred
- */
-struct flashrom_flashchip_info *flashrom_supported_flash_chips(void)
-{
-	unsigned int i = 0;
-	struct flashrom_flashchip_info *supported_flashchips =
-		malloc(flashchips_size * sizeof(*supported_flashchips));
-
-	if (supported_flashchips != NULL) {
-		for (; i < flashchips_size; ++i) {
-			supported_flashchips[i].vendor = flashchips[i].vendor;
-			supported_flashchips[i].name = flashchips[i].name;
-			supported_flashchips[i].tested.erase =
-				(enum flashrom_test_state)flashchips[i].tested.erase;
-			supported_flashchips[i].tested.probe =
-				(enum flashrom_test_state)flashchips[i].tested.probe;
-			supported_flashchips[i].tested.read =
-				(enum flashrom_test_state)flashchips[i].tested.read;
-			supported_flashchips[i].tested.write =
-				(enum flashrom_test_state)flashchips[i].tested.write;
-			supported_flashchips[i].total_size = flashchips[i].total_size;
-		}
-	} else {
-		msg_gerr("Memory allocation error!\n");
-	}
-
-	return supported_flashchips;
-}
-
-/**
- * @brief Returns list of supported mainboards
- * @return List of supported mainboards, or NULL if an error occurred
- */
-struct flashrom_board_info *flashrom_supported_boards(void)
-{
-#if CONFIG_INTERNAL == 1
-	int boards_known_size = 0;
-	int i = 0;
-	const struct board_info *binfo = boards_known;
-
-	while ((binfo++)->vendor)
-		++boards_known_size;
-	binfo = boards_known;
-	/* add place for {0} */
-	++boards_known_size;
-
-	struct flashrom_board_info *supported_boards =
-		malloc(boards_known_size * sizeof(*binfo));
-
-	if (supported_boards != NULL) {
-		for (; i < boards_known_size; ++i) {
-			supported_boards[i].vendor = binfo[i].vendor;
-			supported_boards[i].name = binfo[i].name;
-			supported_boards[i].working =
-				(enum flashrom_test_state) binfo[i].working;
-		}
-	} else {
-		msg_gerr("Memory allocation error!\n");
-	}
-
-	return supported_boards;
-#else
-	return NULL;
-#endif
-}
-
-/**
- * @brief Returns list of supported chipsets
- * @return List of supported chipsets, or NULL if an error occurred
- */
-struct flashrom_chipset_info *flashrom_supported_chipsets(void)
-{
-#if CONFIG_INTERNAL == 1
-	int chipset_enables_size = 0;
-	int i = 0;
-	const struct penable *chipset = chipset_enables;
-
-	while ((chipset++)->vendor_name)
-		++chipset_enables_size;
-	chipset = chipset_enables;
-	/* add place for {0}*/
-	++chipset_enables_size;
-
-	struct flashrom_chipset_info *supported_chipsets =
-		malloc(chipset_enables_size * sizeof(*supported_chipsets));
-
-	if (supported_chipsets != NULL) {
-		for (; i < chipset_enables_size; ++i) {
-			supported_chipsets[i].vendor = chipset[i].vendor_name;
-			supported_chipsets[i].chipset = chipset[i].device_name;
-			supported_chipsets[i].vendor_id = chipset[i].vendor_id;
-			supported_chipsets[i].chipset_id = chipset[i].device_id;
-			supported_chipsets[i].status =
-				(enum flashrom_test_state) chipset[i].status;
-	  }
-	} else {
-		msg_gerr("Memory allocation error!\n");
-	}
-
-	return supported_chipsets;
-#else
-	return NULL;
-#endif
-}
-
-/**
- * @brief Frees memory allocated by libflashrom API
- * @param Pointer to block of memory which should be freed
- * @return 0 on success
- */
-int flashrom_data_free(void *const p)
-{
-	free(p);
-	return 0;
-}
+/* TBD */
 
 /** @} */ /* end flashrom-query */
 
diff --git a/libflashrom.h b/libflashrom.h
index 0c007e6..972e7d1 100644
--- a/libflashrom.h
+++ b/libflashrom.h
@@ -40,50 +40,6 @@
 typedef int(flashrom_log_callback)(enum flashrom_log_level, const char *format, va_list);
 void flashrom_set_log_callback(flashrom_log_callback *);
 
-/** @ingroup flashrom-query */
-enum flashrom_test_state {
-	FLASHROM_TESTED_OK  = 0,
-	FLASHROM_TESTED_NT  = 1,
-	FLASHROM_TESTED_BAD = 2,
-	FLASHROM_TESTED_DEP = 3,
-	FLASHROM_TESTED_NA  = 4,
-};
-
-struct flashrom_flashchip_info {
-	const char *vendor;
-	const char *name;
-	unsigned int total_size;
-	struct flashrom_tested {
-		enum flashrom_test_state probe;
-		enum flashrom_test_state read;
-		enum flashrom_test_state erase;
-		enum flashrom_test_state write;
-		enum flashrom_test_state wp;
-	} tested;
-};
-
-struct flashrom_board_info {
-	const char *vendor;
-	const char *name;
-	enum flashrom_test_state working;
-};
-
-struct flashrom_chipset_info {
-	const char *vendor;
-	const char *chipset;
-	uint16_t vendor_id;
-	uint16_t chipset_id;
-	enum flashrom_test_state status;
-};
-
-const char *flashrom_version_info(void);
-void flashrom_system_info(void);
-const char **flashrom_supported_programmers(void);
-struct flashrom_flashchip_info *flashrom_supported_flash_chips(void);
-struct flashrom_board_info *flashrom_supported_boards(void);
-struct flashrom_chipset_info *flashrom_supported_chipsets(void);
-int flashrom_data_free(void *const p);
-
 /** @ingroup flashrom-prog */
 struct flashrom_programmer;
 int flashrom_programmer_init(struct flashrom_programmer **, const char *prog_name, const char *prog_params);
diff --git a/libflashrom.map b/libflashrom.map
index d6dd24d..3c287ff 100644
--- a/libflashrom.map
+++ b/libflashrom.map
@@ -1,11 +1,7 @@
 LIBFLASHROM_1.0 {
   global:
-    flashrom_board_info;
-    flashrom_chipset_info;
-    flashrom_data_free;
     flashrom_flag_get;
     flashrom_flag_set;
-    flashrom_flashchip_info;
     flashrom_flash_erase;
     flashrom_flash_getsize;
     flashrom_flash_probe;
@@ -24,8 +20,5 @@
     flashrom_programmer_shutdown;
     flashrom_set_log_callback;
     flashrom_shutdown;
-    flashrom_supported_programmers;
-    flashrom_system_info;
-    flashrom_version_info;
   local: *;
 };
