Sun Microsystems Netra CP2500 Programming Manual page 66

For the solaris operating system
Table of Contents

Advertisement

Block Erase Action on User Flash Device (Continued)
CODE EXAMPLE 3-5
printf("manfacturer id = 0x%p\n", ufif0.info.mfr_id);
printf("device id = 0x%p\n", ufif0.info.dev_id);
printf("number of blocks = 0x%p", ufif0.info.blk_num);
printf("block size = 0x%p"
}
}
static int
uflash_uninit() {
if (ufd0)
close(ufd0);
}
static int
uflash_blockerase() {
/* erase 2 blocks starting from block 1 of user flash */
uf0.blk_num = 1;
uf0.num_of_blks = 2;
if (ufd0 && ioctl(ufd0, UIOCEBLK, &ufif0) == -1 ) {
perror("ioctl(ufd0, UIOCEBLK): ");
return(-1);
}
printf("\nblockerase successful on %s\n", uflash0);
return(0);
}
main() {
int ret;
module = argv[0];
ret = uflash_init();
if (!ret)
uflash_blockerase();
uflash_uninit();
}
52
Netra CP2500 Board Programming Guide • March 2007
ufif0.info.blk_size);

Advertisement

Table of Contents
loading

Table of Contents