Esempio n. 1
0
int di_init(void)
{
	debug_string("Opening /dev/di: ");
	di_fd = ios_open("/dev/di",0);
	debug_uint(di_fd);
	debug_string("\n");
	//memset(inbuf, 0, 0x20 );
	return di_fd;
}
Esempio n. 2
0
void create_object_file()
{
    IOStream ios;
    if (!ios_open(&ios, output_path, IOM_WRONLY, IOC_COPY))
        fatal("Unable to open output file \"%s\".", output_path);
    if (!write_alio(&ios))
        fatal("Unable to write output file \"%s\".", output_path);
    ios_close(&ios);
}
Esempio n. 3
0
static void releasse_old_stm_callback(void)
{
	*((u32 *)0x80000018) = 0x00000014;
	sync_after_write((void*)0x80000014, 8);

	int fd = ios_open("/dev/stm/immediate",0);
	if (fd < 0) {
		return;
	}

	//int err = ios_ioctl(fd, 0x3002, 0, 0, 0, 0);

	ios_close(fd);
}
Esempio n. 4
0
int sd_init(void)
{
	int err;

	fd = ios_open("/dev/sdio/slot0", 0);
	if (fd < 0)
		return fd;

	err = sd_reset_card();
	if (err) {
		goto out;
	}

	// now in standby state

	err = sd_select();
	if (err)
		goto out;

	// now in transfer state

	// Some broken cards require this:
	err = sd_set_blocklength(0x200);
	if (err)
		goto out;

	err = sd_set_bus_width(4);	// XXX: Should check in SCR first.
	if (err)
		goto out;

	err = sd_set_clock();	// XXX: Should check.
	if (err)
		goto out;

	return 0;

 out:
	sd_close();

	return err;
}
Esempio n. 5
0
static int
es_init(void)
{
	es_fd = ios_open("/dev/es", 0);
	return es_fd;
}