Lines Matching +full:0 +full:x30000
73 #define FEPROM_READ_MEMORY 0x00
74 #define FEPROM_ERASE 0x20
75 #define FEPROM_ERASE_VERIFY 0xa0
76 #define FEPROM_PROGRAM 0x40
77 #define FEPROM_PROGRAM_VERIFY 0xc0
78 #define FEPROM_RESET 0xff
81 #define FOUND 0
83 #define PROM_SIZ 0x20010
92 #define PROM_SIZ_ROUNDED 0x22000
93 #define SAMPLE_SIZ 0x100
95 #define REG_OFFSET 0x20000
97 #define FEPROM_WWN_OFFSET 0x3fe00
99 #define FEPROM_SUN_WWN 0x50200200
136 int fd, strfound = 0, retval = 0;
140 uint_t fflag = 0;
141 uint_t vflag = 0;
165 fbuf, BUFSIZ)) > 0)) {
166 for (fbuf_idx = 0; fbuf_idx < bytes_read;
170 SOCAL_STR_LEN) == 0) {
201 for (i = 0; i < numslots; i++) {
206 slotname = &sbus_list[i][0];
207 if (fflag && (strcmp(slotname, bootpath) == 0)) {
213 (void) sprintf(socal, "%s:0", &sbussoc_list[i][0]);
215 if ((fd = open(socal, O_RDWR)) < 0) {
216 (void) sprintf(socal, "%s:1", &sbussoc_list[i][0]);
217 if ((fd = open(socal, O_RDWR)) < 0) {
220 &sbussoc_list[i][0]);
223 &sbussoc_list[i][0]);
239 if (fd < 0) {
248 addr = mmap((caddr_t)0, PROM_SIZ_ROUNDED, PROT_READ|PROT_WRITE,
249 MAP_SHARED, fd, 0);
269 &sbussoc_list[i][0]);
277 if (findversion(i, (uchar_t *)&version[0]) == FOUND) {
312 if ((dev_type = g_get_path_type(&sbussoc_list[index][0])) == 0) {
319 (void) sprintf(socal, "%s:0", &sbussoc_list[index][0]);
320 if ((fd = open(socal, O_RDWR)) < 0) {
321 (void) sprintf(socal, "%s:1", &sbussoc_list[index][0]);
322 if ((fd = open(socal, O_RDWR)) < 0) {
325 &sbussoc_list[index][0]);
346 if (ioctl(fd, FCIO_FCODE_MCODE_VERSION, buffer) < 0) {
354 version[buffer->fcode_ver_len] = '\0';
369 (void) sprintf(fp, "%s/fp@0,0:devctl",
370 &sbussoc_list[index][0]);
371 if ((fd = open(fp, O_RDWR)) < 0) {
372 (void) sprintf(fp, "%s/fp@1,0:devctl",
373 &sbussoc_list[index][0]);
374 if ((fd = open(fp, O_RDWR)) < 0) {
377 &sbussoc_list[index][0]);
390 for (ntries = 0; ntries < MAX_RETRIES; ntries++) {
391 if (ioctl(fd, FCIO_CMD, &fcio) != 0) {
405 version[MAXNAMELEN-1] = '\0';
414 for (ntries = 0; ntries < MAX_RETRIES; ntries++) {
415 if (ioctl(fd, FCIO_CMD, &fcio) != 0) {
447 if (!write_feprom((uchar_t *)0, dest_address, regs)) {
449 MSGSTR(4514, "FEprom at 0x%x: zero fill failed\n"),
451 return (0);
455 for (i = 0; i < FEPROM_MAX_ERASE; i++) {
462 MSGSTR(4516, "FEprom at 0x%x: failed to erase\n"),
464 return (0);
465 } else if (i > 0) {
478 MSGSTR(4520, "FEprom at 0x%x: write failed\n"),
480 return (0);
484 regs->socal_cr.w &= ~(0x30000);
500 for (i = 0; i < FEPROM_SIZE; i++, s++) {
502 if ((i & 0xffff) == 0) {
505 regs->socal_cr.w &= ~(0x30000);
506 regs->socal_cr.w |= i & 0x30000;
509 d = dest_address + (i & 0xffff);
511 for (pulse = 0; pulse < FEPROM_MAX_PROGRAM; pulse++) {
513 *d = source_address ? *s : 0;
517 if (*d == (source_address ? *s : 0))
523 return (0);
546 for (i = 0; i < FEPROM_SIZE; i++) {
548 if ((i & 0xffff) == 0) {
549 regs->socal_cr.w &= ~(0x30000);
550 regs->socal_cr.w |= i & 0x30000;
553 d = dest_address + (i & 0xffff);
557 if (*d != 0xff) {
559 return (0);
581 int devcnt = 0;
601 int foundroot = 0;
607 (void) memset((char *)&bootdev[0], 0,
610 while (*p1 != '\0') {
623 (void) memset((char *)&bootpath[0], 0, PATH_MAX);
627 if (bootdev[0]) {
632 char *slot = ",0:slot";
646 *p1 = '\0';
653 *p1 = '\0';
660 (void) memset((char *)&bootdev[0], 0, PATH_MAX);
662 (void) memset((char *)&bootpath[0], 0, PATH_MAX);
691 (i&0xf0000)>>16);
696 regs->socal_cr.w = i & 0xf0000;
697 s = source_address + (i & 0xffff);
700 for (; s < source_address + (i & 0xffff) + size; d++, s++) {
704 (void) fprintf(stdout, "0x%x ", *d);
709 (void) fprintf(stdout, "\n From offset: 0x%x\n",
720 int ffd = open(file, 0);
724 if (ffd < 0) {
754 "Loading 0x%x bytes from %s at offset 0x%x\n"),
755 (int)exec.a_text, file, 0);
768 wwn_hi |= wwn_d8 & 0x0f; /* only last digit is interesting */
771 " load_file: Writing WWN hi:0x%x lo:0x%x "
785 (void *)&buffer[FEPROM_WWN_OFFSET + 0xc],
788 if (feprom_program((uchar_t *)buffer, (uchar_t *)prom, regs) == 0) {
789 /* here 0 means failure */
793 return (0);
801 input[0] = '\0';
814 if ((strcmp(input, MSGSTR(4535, "y")) == 0) ||
815 (strcmp(input, MSGSTR(40, "yes")) == 0)) {
817 } else if ((strcmp(input, MSGSTR(4536, "n")) == 0) ||
818 (strcmp(input, MSGSTR(45, "no")) == 0)) {
845 if (lstat(devpath, &statbuf) < 0) {
851 if (S_ISDIR(statbuf.st_mode) == 0)
864 if ((loadsocpath(devpath, devcnt)) < 0) {
885 *ptr = 0;
888 if (strcmp(devpath, "/devices/pseudo/") == 0)
899 if (strcmp(dirp->d_name, ".") == 0 ||
900 strcmp(dirp->d_name, "..") == 0)
907 if (closedir(dp) < 0) {
917 int ret = 0;
939 buffer[len] = '\0';
941 (void) sprintf(sbus_list[*devcnt], "%ssbusmem@%c,0:slot%c",
942 buffer, sp[0], sp[0]);