// SPI Flash Probe
void spi_probe()
{
	int i;
//	unsigned int uiCount;
//	uiCount = sizeof(spi_flash_registed) / sizeof(struct spi_flash_known);
	KDEBUG("spi_probe: spi_regist(0, 1)\n");
	for(i=0;i<CONFIG_FLASH_NUMBER;i++)
	{
		spi_regist(i);
	}
}
// SPI flash probe
int spi_cp_probe(unsigned int uiChip)
{
	spi_regist(uiChip);
	
	spi_probe_mtd.chip_id = spi_flash_info[uiChip].chip_id;
	spi_probe_mtd.extra_id = spi_flash_info[uiChip].dev_id;
	spi_probe_mtd.sectorSize = spi_flash_info[uiChip].sector_size;
	spi_probe_mtd.deviceSize = spi_flash_info[uiChip].chip_size;
	spi_probe_mtd.uiClkMhz = 0;
	spi_probe_mtd.name = spi_flash_info[uiChip].chip_name;

	KDEBUG("spi_cp_probe:uiChip=%x\n", uiChip);
	return 0;
}
Beispiel #3
0
static void
spi_search_directory (const gchar *dirname)
{
   GList *filelist = NULL, *node;

   g_return_if_fail (dirname);
   if (!isdir (dirname)) return;

   get_dir (dirname, GETDIR_FOLLOW_SYMLINK, &filelist, NULL);
   if (!filelist) return;

   node = filelist;

   while (node) {
      gchar *filename = node->data;
      gboolean success;
      gint len;
      PE_image *pe;

      node = g_list_next (node);

      len = strlen (filename);
      if (len < 4 || strcasecmp (filename + len - 4, ".spi")) continue;

      g_print ("PluginName: %s\n", filename);

      pe = peimage_create ();
      if (!peimage_load (pe, filename)) {
         peimage_destroy (pe);
         g_print ("peimage_load() failed: %s\n", filename);
         continue;
      }

      success = spi_regist (pe);
      if (success) {
         /* hoge */
      } else {
         peimage_destroy(pe);
      }
   }

   g_list_foreach (filelist, (GFunc) g_free, NULL);
   g_list_free (filelist);
}