diff options
Diffstat (limited to 'usr/src')
34 files changed, 1009 insertions, 737 deletions
diff --git a/usr/src/Makefile.psm.targ b/usr/src/Makefile.psm.targ index aa593dee90..6de7e1ddbc 100644 --- a/usr/src/Makefile.psm.targ +++ b/usr/src/Makefile.psm.targ @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # Makefile.psm.targ, global targets for platform specific modules @@ -79,7 +79,7 @@ $(ROOT_PSM_SCHED_DIR)/%: $(OBJS_DIR)/% $(ROOT_PSM_SCHED_DIR) FRC $(ROOT_PSM_STRMOD_DIR)/%: $(OBJS_DIR)/% $(ROOT_PSM_STRMOD_DIR) FRC $(INS.file) -$(ROOT_PSM_SYS_DIR)/%: $(OBJS_DIR)% $(ROOT_PSM_SYS_DIR) FRC +$(ROOT_PSM_SYS_DIR)/%: $(OBJS_DIR)/% $(ROOT_PSM_SYS_DIR) FRC $(INS.file) $(ROOT_PSM_MISC_DIR)/%: $(OBJS_DIR)/% $(ROOT_PSM_MISC_DIR) FRC diff --git a/usr/src/psm/promif/ieee1275/README.promif b/usr/src/psm/promif/ieee1275/README.promif index 568236674b..dab9180cfb 100644 --- a/usr/src/psm/promif/ieee1275/README.promif +++ b/usr/src/psm/promif/ieee1275/README.promif @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -20,11 +19,9 @@ # CDDL HEADER END # -# Copyright 1991-1994, 2003 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -#pragma ident "%Z%%M% %I% %E% SMI" - This directory contains the IEEE 1275-1994 implementation of the promif interfaces. @@ -33,8 +30,7 @@ independent implementation of common promif interfaces. ISA and platform dependent implementations of promif interfaces (including platform and/or ISA defined interfaces) -should be placed in appropriately named subdirectories: -(e.g.: sparc/v9, sun4u, ... ). +should be placed in appropriately named subdirectories. The "sun4" directory contains common implementations of promif -interfaces which are used by sun4u and sun4r. +interfaces which are used by sun4u and sun4v. diff --git a/usr/src/psm/promif/ieee1275/sun4u/prom_heartbeat.c b/usr/src/psm/promif/ieee1275/sun4/prom_heartbeat.c index 2a7e6b7da9..b7f4a0603e 100644 --- a/usr/src/psm/promif/ieee1275/sun4u/prom_heartbeat.c +++ b/usr/src/psm/promif/ieee1275/sun4/prom_heartbeat.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright (c) 1994, by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/promif.h> #include <sys/promimpl.h> diff --git a/usr/src/psm/promif/ieee1275/sun4u/prom_mmu.c b/usr/src/psm/promif/ieee1275/sun4/prom_mmu.c index a9cfe6662e..25be7fc15d 100644 --- a/usr/src/psm/promif/ieee1275/sun4u/prom_mmu.c +++ b/usr/src/psm/promif/ieee1275/sun4/prom_mmu.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * This file contains platform-dependent MMU support routines, * suitable for mmu methods with 2-cell physical addresses. @@ -291,71 +289,3 @@ prom_translate_virt(caddr_t virt, int *valid, *valid = -1; /* Indicate valid result */ return (0); } - -/* - * prom_itlb_load, prom_dtlb_load: - * - * Manage the Spitfire TLB. Returns 0 if successful, -1 otherwise. - * Flush the address in context zero mapped by tte_data and virt, - * and load the {i,d} tlb entry index with tte_data and virt. - */ - -int -prom_itlb_load(int index, unsigned long long tte_data, caddr_t virt) -{ - cell_t ci[9]; - int rv; - ihandle_t immu = prom_mmu_ihandle(); - - if ((immu == (ihandle_t)-1)) - return (-1); - - ci[0] = p1275_ptr2cell("call-method"); /* Service name */ - ci[1] = (cell_t)5; /* #argument cells */ - ci[2] = (cell_t)1; /* #result cells */ - ci[3] = p1275_ptr2cell("SUNW,itlb-load"); /* Arg1: method name */ - ci[4] = p1275_ihandle2cell(immu); /* Arg2: mmu ihandle */ - ci[5] = p1275_ptr2cell(virt); /* Arg3: SA1: virt */ - ci[6] = (cell_t)tte_data; /* Arg4: SA2: tte_data */ - ci[7] = p1275_int2cell(index); /* Arg5: SA3: index */ - - promif_preprom(); - rv = p1275_cif_handler(&ci); - promif_postprom(); - - if (rv != 0) - return (-1); - if (ci[8] != 0) /* Res1: Catch result */ - return (-1); - return (0); -} - -int -prom_dtlb_load(int index, unsigned long long tte_data, caddr_t virt) -{ - cell_t ci[9]; - int rv; - ihandle_t immu = prom_mmu_ihandle(); - - if ((immu == (ihandle_t)-1)) - return (-1); - - ci[0] = p1275_ptr2cell("call-method"); /* Service name */ - ci[1] = (cell_t)5; /* #argument cells */ - ci[2] = (cell_t)1; /* #result cells */ - ci[3] = p1275_ptr2cell("SUNW,dtlb-load"); /* Arg1: method name */ - ci[4] = p1275_ihandle2cell(immu); /* Arg2: mmu ihandle */ - ci[5] = p1275_ptr2cell(virt); /* Arg3: SA1: virt */ - ci[6] = (cell_t)tte_data; /* Arg4: SA2: tte_data */ - ci[7] = p1275_int2cell(index); /* Arg5: SA3: index */ - - promif_preprom(); - rv = p1275_cif_handler(&ci); - promif_postprom(); - - if (rv != 0) - return (-1); - if (ci[8] != 0) /* Res1: Catch result */ - return (-1); - return (0); -} diff --git a/usr/src/psm/promif/ieee1275/sun4u/prom_vercheck.c b/usr/src/psm/promif/ieee1275/sun4/prom_vercheck.c index 608b9156c7..852f2a6e60 100644 --- a/usr/src/psm/promif/ieee1275/sun4u/prom_vercheck.c +++ b/usr/src/psm/promif/ieee1275/sun4/prom_vercheck.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/promif.h> #include <sys/promimpl.h> diff --git a/usr/src/psm/promif/ieee1275/sun4u/Makefile.files b/usr/src/psm/promif/ieee1275/sun4u/Makefile.files index 40f83a581e..381c6300ec 100644 --- a/usr/src/psm/promif/ieee1275/sun4u/Makefile.files +++ b/usr/src/psm/promif/ieee1275/sun4u/Makefile.files @@ -19,11 +19,9 @@ # CDDL HEADER END # # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# # psm/promif/ieee1275/sun4u/Makefile.files # # This Makefile defines all the promif file modules for the @@ -57,6 +55,7 @@ CORE_OBJS += \ prom_starcat.o \ prom_starfire.o \ prom_sunfire.o \ + prom_tlb.o \ prom_vercheck.o \ prom_vername.o \ prom_opl.o diff --git a/usr/src/psm/promif/ieee1275/sun4u/prom_tlb.c b/usr/src/psm/promif/ieee1275/sun4u/prom_tlb.c new file mode 100644 index 0000000000..8b73488e7b --- /dev/null +++ b/usr/src/psm/promif/ieee1275/sun4u/prom_tlb.c @@ -0,0 +1,95 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include <sys/promif.h> +#include <sys/promimpl.h> + +/* + * prom_itlb_load, prom_dtlb_load: + * + * Manage the Spitfire TLB. Returns 0 if successful, -1 otherwise. + * Flush the address in context zero mapped by tte_data and virt, + * and load the {i,d} tlb entry index with tte_data and virt. + */ + +int +prom_itlb_load(int index, unsigned long long tte_data, caddr_t virt) +{ + cell_t ci[9]; + int rv; + ihandle_t immu = prom_mmu_ihandle(); + + if ((immu == (ihandle_t)-1)) + return (-1); + + ci[0] = p1275_ptr2cell("call-method"); /* Service name */ + ci[1] = (cell_t)5; /* #argument cells */ + ci[2] = (cell_t)1; /* #result cells */ + ci[3] = p1275_ptr2cell("SUNW,itlb-load"); /* Arg1: method name */ + ci[4] = p1275_ihandle2cell(immu); /* Arg2: mmu ihandle */ + ci[5] = p1275_ptr2cell(virt); /* Arg3: SA1: virt */ + ci[6] = (cell_t)tte_data; /* Arg4: SA2: tte_data */ + ci[7] = p1275_int2cell(index); /* Arg5: SA3: index */ + + promif_preprom(); + rv = p1275_cif_handler(&ci); + promif_postprom(); + + if (rv != 0) + return (-1); + if (ci[8] != 0) /* Res1: Catch result */ + return (-1); + return (0); +} + +int +prom_dtlb_load(int index, unsigned long long tte_data, caddr_t virt) +{ + cell_t ci[9]; + int rv; + ihandle_t immu = prom_mmu_ihandle(); + + if ((immu == (ihandle_t)-1)) + return (-1); + + ci[0] = p1275_ptr2cell("call-method"); /* Service name */ + ci[1] = (cell_t)5; /* #argument cells */ + ci[2] = (cell_t)1; /* #result cells */ + ci[3] = p1275_ptr2cell("SUNW,dtlb-load"); /* Arg1: method name */ + ci[4] = p1275_ihandle2cell(immu); /* Arg2: mmu ihandle */ + ci[5] = p1275_ptr2cell(virt); /* Arg3: SA1: virt */ + ci[6] = (cell_t)tte_data; /* Arg4: SA2: tte_data */ + ci[7] = p1275_int2cell(index); /* Arg5: SA3: index */ + + promif_preprom(); + rv = p1275_cif_handler(&ci); + promif_postprom(); + + if (rv != 0) + return (-1); + if (ci[8] != 0) /* Res1: Catch result */ + return (-1); + return (0); +} diff --git a/usr/src/psm/stand/boot/Makefile b/usr/src/psm/stand/boot/Makefile index 0964794481..5b940f8946 100644 --- a/usr/src/psm/stand/boot/Makefile +++ b/usr/src/psm/stand/boot/Makefile @@ -19,11 +19,9 @@ # CDDL HEADER END # # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../../../Makefile.master @@ -93,9 +91,9 @@ EXPORT_SRC: $(CHMOD) 444 sparc/common/ramdisk.c $(RM) sparcv9/Makefile.com+ sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ - < sparcv9/Makefile.com > sparcv9/Makefile.com+ - $(MV) sparcv9/Makefile.com+ sparcv9/Makefile.com - $(CHMOD) 444 sparcv9/Makefile.com + < sparcv9/sun4/Makefile > sparcv9/sun4/Makefile+ + $(MV) sparcv9/sun4/Makefile+ sparcv9/sun4/Makefile + $(CHMOD) 444 sparcv9/sun4/Makefile $(RM) Makefile+ sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ < Makefile > Makefile+ diff --git a/usr/src/psm/stand/boot/Makefile.boot b/usr/src/psm/stand/boot/Makefile.boot index bf478a2444..1003bc32b9 100644 --- a/usr/src/psm/stand/boot/Makefile.boot +++ b/usr/src/psm/stand/boot/Makefile.boot @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/boot/Makefile.boot @@ -45,27 +45,12 @@ PSMPROMLIBDIR = $(PSMSTANDDIR)/lib/promif/$(MACH) PSMPROMLIBDIR64 = $(PSMSTANDDIR)/lib/promif/$(MACH64) # -# XXX one day we should just be able to set PROG to 'cfsboot'.. -# and everything will become a lot easier. -# -UNIBOOT = multiboot -WANBOOT = wanboot -NFSBOOT = inetboot - -# # Common install modes and owners # FILEMODE = 644 DIRMODE = 755 # -# Install locations -# -ROOT_PSM_UNIBOOT= $(ROOT_PSM_DIR)/$(UNIBOOT) -ROOT_PSM_WANBOOT= $(ROOT_PSM_DIR)/$(WANBOOT) -USR_PSM_NFSBOOT = $(USR_PSM_LIB_NFS_DIR)/$(NFSBOOT) - -# # While things are pretty much 32-bit lint-clean, there are a ton of # suspect pointer casts. Since these may be serious problems (especially # on SPARC), this really needs to be investigated thoroughly one day. diff --git a/usr/src/psm/stand/boot/Makefile.rules b/usr/src/psm/stand/boot/Makefile.rules index 5999c83c6a..e89165c19b 100644 --- a/usr/src/psm/stand/boot/Makefile.rules +++ b/usr/src/psm/stand/boot/Makefile.rules @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -19,12 +18,9 @@ # # CDDL HEADER END # -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# # psm/stand/boot/Makefile.rules #CPPFLAGS += -DDEBUG=1 diff --git a/usr/src/psm/stand/boot/Makefile.targ b/usr/src/psm/stand/boot/Makefile.targ index fe366511e0..1462751a12 100644 --- a/usr/src/psm/stand/boot/Makefile.targ +++ b/usr/src/psm/stand/boot/Makefile.targ @@ -18,10 +18,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/boot/Makefile.files @@ -29,7 +26,7 @@ # # Targets common to all versions # -install: all $(USR_PSM_NFSBOOT) +install: all # # Install rules diff --git a/usr/src/psm/stand/boot/sparc/common/boot_plat.c b/usr/src/psm/stand/boot/sparc/common/boot_plat.c index 2abc69b687..8129b029c2 100644 --- a/usr/src/psm/stand/boot/sparc/common/boot_plat.c +++ b/usr/src/psm/stand/boot/sparc/common/boot_plat.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -72,7 +72,15 @@ extern void exitto64(int (*entrypoint)(), void *bootvec); int openfile(char *filename); -int client_isLP64 = 1; /* SPARC clients are always LP64 */ +char *default_name; +char *default_path; + +int vac; /* virtual address cache type (none == 0) */ +int is_sun4v; /* sun4u vs. sun4v */ +int client_isLP64 = 1; /* SPARC clients are always LP64 */ + +extern bootplat_defaults_t sun4u_plat_defaults; +extern bootplat_defaults_t sun4v_plat_defaults; /* * filename is the name of the standalone we're going to execute. @@ -451,13 +459,50 @@ void system_check(void) { char buf[PROM_VERS_MAX_LEN]; + pnode_t n; + char arch[128]; + size_t len; + bootplat_defaults_t *plat_defaults; + + /* + * This is a sun4v machine iff the device_type property + * exists on the root node and has the value "sun4v". + * Some older sunfire proms do not have such a property. + */ + is_sun4v = 0; + n = prom_rootnode(); + len = prom_getproplen(n, "device_type"); + if (len > 0 && len < sizeof (arch)) { + (void) prom_getprop(n, "device_type", arch); + arch[len] = '\0'; + dprintf("device_type=%s\n", arch); + if (strcmp(arch, "sun4v") == 0) { + is_sun4v = 1; + } + } else { + dprintf("device_type: no such property, len=%d\n", (int)len); + } - if (cpu_is_ultrasparc_1()) { + if (!is_sun4v && cpu_is_ultrasparc_1()) { printf("UltraSPARC I processors are not supported by this " "release of Solaris.\n"); prom_exit_to_mon(); } + /* + * Set up defaults per platform + */ + plat_defaults = (is_sun4v) ? + &sun4v_plat_defaults : &sun4u_plat_defaults; + + default_name = plat_defaults->plat_defaults_name; + default_path = plat_defaults->plat_defaults_path; + vac = plat_defaults->plat_defaults_vac; + + dprintf("default_name: %s\n", default_name); + dprintf("default_path: %s\n", default_path); + dprintf("vac: %d\n", vac); + if (prom_version_check(buf, PROM_VERS_MAX_LEN, NULL) != PROM_VER64_OK) { printf("The firmware on this system does not support the 64-bit" " OS.\n\tPlease upgrade to at least the following version:" @@ -557,6 +602,7 @@ main(void *cookie, char **argv, int argc) (void) strncpy(bpath, prom_bootpath(), sizeof (bpath) - 1); bpath[sizeof (bpath) - 1] = '\0'; + dprintf("arch: %s\n", is_sun4v ? "sun4v" : "sun4u"); dprintf("bootpath: 0x%p %s\n", (void *)bpath, bpath); dprintf("bootargs: 0x%p %s\n", (void *)bargs, bargs); dprintf("filename: 0x%p %s\n", (void *)filename, filename); @@ -580,9 +626,13 @@ main(void *cookie, char **argv, int argc) */ mangle_os_bootpath(bpath); -#ifdef sun4u - retain_nvram_page(); -#endif + /* + * Not necessary on sun4v as nvram is virtual + * and kept by the guest manager on the SP. + */ + if (!is_sun4v) { + retain_nvram_page(); + } if (bootprog(bpath, bargs, user_specified_filename) == 0) { post_mountroot(filename, NULL); diff --git a/usr/src/psm/stand/boot/sparc/common/boot_plat.h b/usr/src/psm/stand/boot/sparc/common/boot_plat.h index 393b3188b5..7241cec417 100644 --- a/usr/src/psm/stand/boot/sparc/common/boot_plat.h +++ b/usr/src/psm/stand/boot/sparc/common/boot_plat.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -31,6 +31,14 @@ extern "C" { #endif +/* + * boot platform defaults per architecture + */ +typedef struct bootplat_defaults { + char *plat_defaults_name; + char *plat_defaults_path; + int plat_defaults_vac; +} bootplat_defaults_t; /* boot_plat.c */ extern int verbosemode; diff --git a/usr/src/psm/stand/boot/sparcv9/sun4u/machdep.c b/usr/src/psm/stand/boot/sparc/common/machdep.c index 59de73936b..5f4c71bc81 100644 --- a/usr/src/psm/stand/boot/sparcv9/sun4u/machdep.c +++ b/usr/src/psm/stand/boot/sparc/common/machdep.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/param.h> #include <sys/fcntl.h> @@ -33,7 +30,7 @@ #include <sys/prom_plat.h> #include <sys/salib.h> -int vac = 1; +extern int is_sun4v; /* * Check if the CPU should default to 64-bit or not. @@ -115,9 +112,10 @@ cpu_is_ultrasparc_1(void) static int cpu_default; /* - * If we already checked, we already know the answer. + * If we already checked or the machine is + * a sun4v, we already know the answer. */ - if (cpu_checked == 0) { + if (!is_sun4v || cpu_checked == 0) { if (walk(prom_rootnode())) cpu_default = 1; cpu_checked = 1; @@ -155,11 +153,14 @@ retain_nvram_page(void) if (dont_retain_memory) return; - len = prom_getproplen(prom_rootnode(), "name"); - if ((len != -1) && (len <= sizeof (name))) { - (void) prom_getprop(prom_rootnode(), "name", name); - if ((strcmp(name, ue) == 0) || (strcmp(name, ue10000) == 0)) - return; + if (!is_sun4v) { + len = prom_getproplen(prom_rootnode(), "name"); + if ((len != -1) && (len <= sizeof (name))) { + (void) prom_getprop(prom_rootnode(), "name", name); + if ((strcmp(name, ue) == 0) || + (strcmp(name, ue10000) == 0)) + return; + } } if (prom_retain("OBPnvram", PAGESIZE, PAGESIZE, &phys) != 0) { diff --git a/usr/src/psm/stand/lib/names/sparcv9/sun4v/modpath.c b/usr/src/psm/stand/boot/sparc/common/sun4u_machdep.c index 21f7689804..5baa1214c9 100644 --- a/usr/src/psm/stand/lib/names/sparcv9/sun4v/modpath.c +++ b/usr/src/psm/stand/boot/sparc/common/sun4u_machdep.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,15 +19,24 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include <sys/types.h> +#include <sys/param.h> +#include <sys/fcntl.h> +#include <sys/promif.h> +#include <sys/prom_plat.h> +#include <sys/salib.h> +#include "boot_plat.h" /* - * Platform specific vars used by uname-i.c + * boot plat defaults for sun4v */ - -char *default_name = "sun4v"; -char *default_path = " /platform/sun4v/kernel"; +bootplat_defaults_t sun4u_plat_defaults = { + "sun4u", /* platform name */ + " /platform/sun4u/kernel", /* default module path */ + 1 /* virtual address cache type */ + /* (none == 0) */ +}; diff --git a/usr/src/psm/stand/lib/names/sparcv9/sun4u/modpath.c b/usr/src/psm/stand/boot/sparc/common/sun4v_machdep.c index 5637eba938..d62dce8228 100644 --- a/usr/src/psm/stand/lib/names/sparcv9/sun4u/modpath.c +++ b/usr/src/psm/stand/boot/sparc/common/sun4v_machdep.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,15 +19,24 @@ * CDDL HEADER END */ /* - * Copyright (c) 1997, by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include <sys/types.h> +#include <sys/param.h> +#include <sys/fcntl.h> +#include <sys/promif.h> +#include <sys/prom_plat.h> +#include <sys/salib.h> +#include "boot_plat.h" /* - * Platform specific vars used by uname-i.c + * boot plat defaults for sun4v */ - -char *default_name = "sun4u"; -char *default_path = " /platform/sun4u/kernel"; +bootplat_defaults_t sun4v_plat_defaults = { + "sun4v", /* platform name */ + " /platform/sun4v/kernel", /* default module path */ + 0 /* virtual address cache type */ + /* (none == 0) */ +}; diff --git a/usr/src/psm/stand/boot/sparc/sun4/sys/machparam.h b/usr/src/psm/stand/boot/sparc/sun4/sys/machparam.h new file mode 100644 index 0000000000..5f1391f59d --- /dev/null +++ b/usr/src/psm/stand/boot/sparc/sun4/sys/machparam.h @@ -0,0 +1,93 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_MACHPARAM_H +#define _SYS_MACHPARAM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ASM +#define ADDRESS_C(c) c ## ul +#else /* _ASM */ +#define ADDRESS_C(c) (c) +#endif /* _ASM */ + +/* + * Common subset of sun4 machine dependent parameters and limits + */ + +/* + * MMU_PAGES* describes the physical page size used by the mapping hardware. + * PAGES* describes the logical page size used by the system. + */ +#define MMU_PAGE_SIZES 6 /* max mmu-supported page sizes */ +#define DEFAULT_MMU_PAGE_SIZES 4 /* default supported page sizes */ + +/* + * XXX make sure the MMU_PAGESHIFT definition here is + * consistent with the one in param.h + */ +#define MMU_PAGESHIFT 13 +#define MMU_PAGESIZE (1<<MMU_PAGESHIFT) +#define MMU_PAGEOFFSET (MMU_PAGESIZE - 1) +#define MMU_PAGEMASK (~MMU_PAGEOFFSET) + +#define MMU_PAGESHIFT64K 16 +#define MMU_PAGESIZE64K (1 << MMU_PAGESHIFT64K) +#define MMU_PAGEOFFSET64K (MMU_PAGESIZE64K - 1) +#define MMU_PAGEMASK64K (~MMU_PAGEOFFSET64K) + +#define MMU_PAGESHIFT512K 19 +#define MMU_PAGESIZE512K (1 << MMU_PAGESHIFT512K) +#define MMU_PAGEOFFSET512K (MMU_PAGESIZE512K - 1) +#define MMU_PAGEMASK512K (~MMU_PAGEOFFSET512K) + +#define MMU_PAGESHIFT4M 22 +#define MMU_PAGESIZE4M (1 << MMU_PAGESHIFT4M) +#define MMU_PAGEOFFSET4M (MMU_PAGESIZE4M - 1) +#define MMU_PAGEMASK4M (~MMU_PAGEOFFSET4M) + +#define MMU_PAGESHIFT32M 25 +#define MMU_PAGESIZE32M (1 << MMU_PAGESHIFT32M) +#define MMU_PAGEOFFSET32M (MMU_PAGESIZE32M - 1) +#define MMU_PAGEMASK32M (~MMU_PAGEOFFSET32M) + +#define MMU_PAGESHIFT256M 28 +#define MMU_PAGESIZE256M (1 << MMU_PAGESHIFT256M) +#define MMU_PAGEOFFSET256M (MMU_PAGESIZE256M - 1) +#define MMU_PAGEMASK256M (~MMU_PAGEOFFSET256M) + +#define PAGESHIFT 13 +#define PAGESIZE (1<<PAGESHIFT) +#define PAGEOFFSET (PAGESIZE - 1) +#define PAGEMASK (~PAGEOFFSET) + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_MACHPARAM_H */ diff --git a/usr/src/psm/stand/boot/sparc/sun4/sys/prom_plat.h b/usr/src/psm/stand/boot/sparc/sun4/sys/prom_plat.h new file mode 100644 index 0000000000..8a96e80a33 --- /dev/null +++ b/usr/src/psm/stand/boot/sparc/sun4/sys/prom_plat.h @@ -0,0 +1,219 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_PROM_PLAT_H +#define _SYS_PROM_PLAT_H + +#include <sys/feature_tests.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_LONGLONG_TYPE) +#error "This header won't work without long long support" +#endif + +/* + * This file contains external platform-specific promif interface definitions. + * There may be none. This file is included by reference in <sys/promif.h> + * + * Common sun4 subset for the IEEE 1275-1994 compliant prom. + */ + +/* + * Memory allocation plus memory/mmu interfaces: + * + * Routines with fine-grained memory and MMU control are platform-dependent. + * + * MMU node virtualized "mode" arguments and results for Spitfire MMU: + * + * The default virtualized "mode" for client program mappings created + * by the firmware is as follows: + * + * G (global) Clear + * L (locked) Clear + * W (write) Set + * R (read - soft) Set (Prom is not required to implement soft bits) + * X (exec - soft) Set (Prom is not required to implement soft bits) + * CV,CP (Cacheable) Set if memory page, Clear if IO page + * E (side effects) Clear if memory page; Set if IO page + * IE (Invert endian.) Clear + * + * The following fields are initialized as follows in the TTE-data for any + * mappings created by the firmware on behalf of the client program: + * + * P (Priviledged) Set + * V (Valid) Set + * NFO (No Fault Only) Clear + * Context 0 + * Soft bits < private to the firmware implementation > + * + * Page size of Prom mappings are typically 8k, "modify" cannot change + * page sizes. Mappings created by "map" are 8k pages. + * + * If the virtualized "mode" is -1, the defaults as shown above are used, + * otherwise the virtualized "mode" is set (and returned) based on the + * following virtualized "mode" abstractions. The mmu node "translations" + * property contains the actual tte-data, not the virtualized "mode". + * + * Note that client programs may not create locked mappings by setting + * the LOCKED bit. There are Spitfire specific client interfaces to create + * and remove locked mappings. (SUNW,{i,d}tlb-load). + * The LOCKED bit is defined here since it may be returned by the + * "translate" method. + * + * The PROM is not required to implement the Read and eXecute soft bits, + * and is not required to track them for the client program. They may be + * set on calls to "map" and "modfify" and may be ignored by the firmware, + * and are not necessarily returned from "translate". + * + * The TTE soft bits are private to the firmware. No assumptions may + * be made regarding the contents of the TTE soft bits. + * + * Changing a mapping from cacheable to non-cacheable implies a flush + * or invalidate operation, if necessary. + * + * NB: The "map" MMU node method should NOT be used to create IO device + * mappings. The correct way to do this is to call the device's parent + * "map-in" method using the CALL-METHOD client interface service. + */ + +#define PROM_MMU_MODE_DEFAULT ((int)-1) /* Default "mode", see above */ + +/* + * NB: These are not implemented in PROM version P1.0 ... + */ +#define PROM_MMU_MODE_WRITE 0x0001 /* Translation is Writable */ +#define PROM_MMU_MODE_READ 0x0002 /* Soft: Readable, See above */ +#define PROM_MMU_MODE_EXEC 0x0004 /* Soft: eXecutable, See above */ +#define PROM_MMU_MODE_RWX_MASK 0x0007 /* Mask for R-W-X bits */ + +#define PROM_MMU_MODE_LOCKED 0x0010 /* Read-only: Locked; see above */ +#define PROM_MMU_MODE_CACHED 0x0020 /* Set means both CV,CP bits */ +#define PROM_MMU_MODE_EFFECTS 0x0040 /* side Effects bit in MMU */ +#define PROM_MMU_MODE_GLOBAL 0x0080 /* Global bit */ +#define PROM_MMU_MODE_INVERT 0x0100 /* Invert Endianness */ + +/* + * resource allocation group: OBP only. (mapping functions are platform + * dependent because they use physical address arguments.) + */ +extern caddr_t prom_map(caddr_t virthint, + unsigned long long physaddr, uint_t size); + +/* + * prom_alloc is platform dependent and has historical semantics + * associated with the align argument and the return value. + * prom_malloc is the generic memory allocator. + */ +extern caddr_t prom_malloc(caddr_t virt, size_t size, uint_t align); + +extern caddr_t prom_allocate_virt(uint_t align, size_t size); +extern caddr_t prom_claim_virt(size_t size, caddr_t virt); +extern void prom_free_virt(size_t size, caddr_t virt); + +extern int prom_allocate_phys(size_t size, uint_t align, + unsigned long long *physaddr); +extern int prom_claim_phys(size_t size, + unsigned long long physaddr); +extern void prom_free_phys(size_t size, + unsigned long long physaddr); + +extern int prom_map_phys(int mode, size_t size, caddr_t virt, + unsigned long long physaddr); +extern void prom_unmap_phys(size_t size, caddr_t virt); +extern void prom_unmap_virt(size_t size, caddr_t virt); + +extern int prom_phys_installed_len(void); +extern int prom_phys_avail_len(void); +extern int prom_virt_avail_len(void); + +extern int prom_phys_installed(caddr_t); +extern int prom_phys_avail(caddr_t); +extern int prom_virt_avail(caddr_t); + +/* + * prom_retain allocates or returns retained physical memory + * identified by the arguments of name string "id", "size" and "align". + */ +extern int prom_retain(char *id, size_t size, uint_t align, + unsigned long long *physaddr); + +/* + * prom_translate_virt returns the physical address and virtualized "mode" + * for the given virtual address. After the call, if *valid is non-zero, + * a mapping to 'virt' exists and the physical address and virtualized + * "mode" were returned to the caller. + */ +extern int prom_translate_virt(caddr_t virt, int *valid, + unsigned long long *physaddr, int *mode); + +/* + * prom_modify_mapping changes the "mode" of an existing mapping or + * repeated mappings. virt is the virtual address whose "mode" is to + * be changed; size is some multiple of the fundamental pagesize. + * This method cannot be used to change the pagesize of an MMU mapping, + * nor can it be used to Lock a translation into the i or d tlb. + */ +extern int prom_modify_mapping(caddr_t virt, size_t size, int mode); + +/* + * Client interfaces for managing the {i,d}tlb handoff to client programs. + */ +extern int prom_itlb_load(int index, + unsigned long long tte_data, caddr_t virt); + +extern int prom_dtlb_load(int index, + unsigned long long tte_data, caddr_t virt); + + +/* + * The client program implementation is required to provide a wrapper + * to the client handler, for the 32 bit client program to 64 bit cell-sized + * client interface handler (switch stack, etc.). This function is not + * to be used externally! + */ + +extern int client_handler(void *cif_handler, void *arg_array); + +/* + * The 'format' of the "translations" property in the 'mmu' node ... + */ + +struct translation { + uint32_t virt_hi; /* upper 32 bits of vaddr */ + uint32_t virt_lo; /* lower 32 bits of vaddr */ + uint32_t size_hi; /* upper 32 bits of size in bytes */ + uint32_t size_lo; /* lower 32 bits of size in bytes */ + uint32_t tte_hi; /* higher 32 bites of tte */ + uint32_t tte_lo; /* lower 32 bits of tte */ +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_PROM_PLAT_H */ diff --git a/usr/src/psm/stand/boot/sparcv9/Makefile b/usr/src/psm/stand/boot/sparcv9/Makefile index 256669ff16..d980d888af 100644 --- a/usr/src/psm/stand/boot/sparcv9/Makefile +++ b/usr/src/psm/stand/boot/sparcv9/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -20,18 +19,16 @@ # CDDL HEADER END # # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../../../../Makefile.master # firmware libraries, platform-group, and platform-specific # subdirectories to visit. -SUBDIRS = sun4u sun4v +SUBDIRS = sun4u sun4v sun4 all := TARGET = all install := TARGET = install @@ -39,22 +36,14 @@ clean := TARGET = clean clobber := TARGET = clobber lint := TARGET = lint +.KEEP_STATE: + all install clean clobber lint: $(SUBDIRS) +FRC: + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(MFLAGS) $(TARGET) -# -# Cross-reference customization: include all boot-related source files. -# -STANDLIBDIR= ../../../../stand/lib -STANDSYSDIR= ../../../../stand/sys -PROMDIRS= ../../../promif/ieee1275 -NAMESDIRS= ../../lib/names/sparcv9 ../../lib/names/sparc/common -XRDIRS += ../common ../sparc/common $(NAMESDIRS) $(PROMDIRS) \ - $(STANDSYSDIR) $(STANDLIBDIR) - cscope.out tags: FRC $(XREF) -x $@ - -FRC: diff --git a/usr/src/psm/stand/boot/sparcv9/Makefile.com b/usr/src/psm/stand/boot/sparcv9/Makefile.com index 2417ee62ed..0ce0b30093 100644 --- a/usr/src/psm/stand/boot/sparcv9/Makefile.com +++ b/usr/src/psm/stand/boot/sparcv9/Makefile.com @@ -18,10 +18,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/boot/sparcv9/Makefile.com @@ -36,10 +33,14 @@ BOOTSRCDIR = ../.. TOP_CMN_DIR = $(SRC)/common CMN_DIR = $(BOOTSRCDIR)/common MACH_DIR = ../../sparc/common -PLAT_DIR = . +PLAT_DIR = sun4 BOOT_DIR = $(SRC)/psm/stand/boot -BOOT_SRC = inetboot.c wanboot.c +WANBOOT = wanboot +NFSBOOT = inetboot + +WANBOOT_SRC = $(WANBOOT).c +NFSBOOT_SRC = $(NFSBOOT).c CONF_SRC = nfsconf.c wbfsconf.c wbcli.c @@ -50,10 +51,14 @@ MISC_SRC = ramdisk.c CMN_C_SRC = heap_kmem.c readfile.c MACH_C_SRC = boot_plat.c bootops.c bootprop.c bootflags.c +MACH_C_SRC += machdep.c sun4u_machdep.c sun4v_machdep.c MACH_C_SRC += get.c -BOOT_OBJS = $(BOOT_SRC:%.c=%.o) -BOOT_L_OBJS = $(BOOT_OBJS:%.o=%.ln) +WANBOOT_OBJS = $(WANBOOT_SRC:%.c=%.o) +WANBOOT_L_OBJS = $(WANBOOT_OBJS:%.o=%.ln) + +NFSBOOT_OBJS = $(NFSBOOT_SRC:%.c=%.o) +NFSBOOT_L_OBJS = $(NFSBOOT_OBJS:%.o=%.ln) CONF_OBJS = $(CONF_SRC:%.c=%.o) CONF_L_OBJS = $(CONF_OBJS:%.o=%.ln) @@ -97,13 +102,28 @@ ASFLAGS += $(CPPDEFS) -P -D_ASM $(CPPINCS) CFLAGS64 += ../../sparc/common/sparc.il # -# Until we are building on a MACH=sparcv9 machine, we have to override -# where to look for libraries. +# Where to look for libraries. # PSMNAMELIBDIR = $(PSMSTANDDIR)/lib/names/$(TARG_MACH) PSMPROMLIBDIR = $(PSMSTANDDIR)/lib/promif/$(TARG_MACH) # +# Install targets +# +ROOT_PLAT_SUN4U_WANBOOT= $(ROOT_PLAT_DIR)/sun4u/$(WANBOOT) +ROOT_PLAT_SUN4V_WANBOOT= $(ROOT_PLAT_DIR)/sun4v/$(WANBOOT) + +USR_PLAT_SUN4U_LIB=$(USR_PLAT_DIR)/sun4u/lib +USR_PLAT_SUN4U_LIB_FS=$(USR_PLAT_SUN4U_LIB)/fs +USR_PLAT_SUN4U_LIB_FS_NFS=$(USR_PLAT_SUN4U_LIB_FS)/nfs +USR_PLAT_SUN4U_LIB_FS_NFS_NFSBOOT=$(USR_PLAT_SUN4U_LIB_FS_NFS)/$(NFSBOOT) + +USR_PLAT_SUN4V_LIB=$(USR_PLAT_DIR)/sun4v/lib +USR_PLAT_SUN4V_LIB_FS=$(USR_PLAT_SUN4V_LIB)/fs +USR_PLAT_SUN4V_LIB_FS_NFS=$(USR_PLAT_SUN4V_LIB_FS)/nfs +USR_PLAT_SUN4V_LIB_FS_NFS_NFSBOOT=$(USR_PLAT_SUN4V_LIB_FS_NFS)/$(NFSBOOT) + +# # The following libraries are built in LIBNAME_DIR # LIBNAME_DIR += $(PSMNAMELIBDIR)/$(PLATFORM) @@ -120,28 +140,15 @@ LIBPROM_LIBS += libprom.a # LIBSYS_DIR += $(SYSLIBDIR) +#.KEEP_STATE: # -# Used to convert ELF to an a.out and ensure alignment -# -STRIPALIGN = stripalign - -# -# Program used to post-process the ELF executables -# -ELFCONV = ./$(STRIPALIGN) # Default value - -.KEEP_STATE: -.PARALLEL: $(OBJS) $(CONF_OBJS) $(MISC_OBJS) $(SRT0_OBJ) $(BOOT_OBJS) +.PARALLEL: $(OBJS) $(CONF_OBJS) $(MISC_OBJS) $(SRT0_OBJ) \ + $(WANBOOT_OBJS) $(NFSBOOT_OBJS) .PARALLEL: $(L_OBJS) $(CONF_L_OBJS) $(MISC_L_OBJS) $(SRT0_L_OBJ) \ - $(BOOT_L_OBJS) + $(WANBOOT_L_OBJS) $(NFSBOOT_L_OBJS) .PARALLEL: $(NFSBOOT) $(WANBOOT) -all: $(ELFCONV) $(NFSBOOT) $(WANBOOT) - -$(STRIPALIGN): $(CMN_DIR)/$$(@).c - $(NATIVECC) -o $@ $(CMN_DIR)/$@.c - # # Note that the presumption is that someone has already done a `make # install' from usr/src/stand/lib, such that all of the standalone @@ -153,126 +160,5 @@ LIBDEPS= $(LIBPROM_DIR)/libprom.a $(LIBPLAT_DEP) \ L_LIBDEPS= $(LIBPROM_DIR)/llib-lprom.ln $(LIBPLAT_DEP_L) \ $(LIBNAME_DIR)/llib-lnames.ln -# -# WANboot booter -# -# Libraries used to build wanboot -# -# EXPORT DELETE START -LIBWANBOOT = libwanboot.a -LIBSCRYPT = libscrypt.a -LIBSSL = libssl.a -LIBCRYPTO = libcrypto.a -# EXPORT DELETE END - -LIBWAN_LIBS = \ - $(LIBWANBOOT) \ - libnvpair.a libufs.a libhsfs.a libnfs.a \ - libxdr.a libnames.a libsock.a libinet.a libtcp.a \ - $(LIBSCRYPT) $(LIBSSL) $(LIBCRYPTO) \ - libmd5.a libsa.a libprom.a \ - $(LIBSSL) \ - $(LIBPLAT_LIBS) -WAN_LIBS = $(LIBWAN_LIBS:lib%.a=-l%) -WAN_DIRS = $(LIBNAME_DIR:%=-L%) $(LIBSYS_DIR:%=-L%) -WAN_DIRS += $(LIBPLAT_DIR:%=-L%) $(LIBPROM_DIR:%=-L%) - -# -# Loader flags used to build wanboot -# -WAN_MAPFILE = $(MACH_DIR)/mapfile -WAN_LDFLAGS = -dn -M $(WAN_MAPFILE) -e _start $(WAN_DIRS) -WAN_L_LDFLAGS = $(WAN_DIRS) - -# -# Object files used to build wanboot -# -WAN_SRT0 = $(SRT0_OBJ) -WAN_OBJS = $(OBJS) wbfsconf.o wbcli.o wanboot.o ramdisk.o -WAN_L_OBJS = $(WAN_SRT0:%.o=%.ln) $(WAN_OBJS:%.o=%.ln) - -# -# Build rules to build wanboot -# - -$(WANBOOT).elf: $(WAN_MAPFILE) $(WAN_SRT0) $(WAN_OBJS) $(LIBDEPS) - $(LD) $(WAN_LDFLAGS) -o $@ $(WAN_SRT0) $(WAN_OBJS) $(WAN_LIBS) - $(MCS) -d $@ - $(POST_PROCESS) - $(POST_PROCESS) - $(MCS) -c $@ - -$(WANBOOT): $(WANBOOT).elf - $(RM) $@; cp $@.elf $@ - $(STRIP) $@ - -$(WANBOOT)_lint: $(L_LIBDEPS) $(WAN_L_OBJS) - @echo "" - @echo wanboot lint: global crosschecks: - $(LINT.c) $(WAN_L_LDFLAGS) $(WAN_L_OBJS) $(WAN_LIBS) - -# High-sierra filesystem booter. Probably doesn't work. - -# NFS booter - -# -# Libraries used to build nfsboot -# -LIBNFS_LIBS = libnfs.a libxdr.a libnames.a \ - libsock.a libinet.a libtcp.a libsa.a libprom.a \ - $(LIBPLAT_LIBS) -NFS_LIBS = $(LIBNFS_LIBS:lib%.a=-l%) -NFS_DIRS = $(LIBNAME_DIR:%=-L%) $(LIBSYS_DIR:%=-L%) -NFS_DIRS += $(LIBPLAT_DIR:%=-L%) $(LIBPROM_DIR:%=-L%) - -# -# Loader flags used to build inetboot -# -NFS_MAPFILE = $(MACH_DIR)/mapfile -NFS_LDFLAGS = -dn -M $(NFS_MAPFILE) -e _start $(NFS_DIRS) -NFS_L_LDFLAGS = $(NFS_DIRS) - -# -# Object files used to build inetboot -# -NFS_SRT0 = $(SRT0_OBJ) -NFS_OBJS = $(OBJS) nfsconf.o inetboot.o ramdisk.o -NFS_L_OBJS = $(NFS_SRT0:%.o=%.ln) $(NFS_OBJS:%.o=%.ln) - -$(NFSBOOT).elf: $(ELFCONV) $(NFS_MAPFILE) $(NFS_SRT0) $(NFS_OBJS) $(LIBDEPS) - $(LD) $(NFS_LDFLAGS) -o $@ $(NFS_SRT0) $(NFS_OBJS) $(NFS_LIBS) - $(MCS) -d $@ - $(POST_PROCESS) - $(POST_PROCESS) - $(MCS) -c $@ - -# -# This is a bit strange because some platforms boot elf and some don't. -# So this rule strips the file no matter which ELFCONV is used. -# -$(NFSBOOT): $(NFSBOOT).elf - $(RM) $@.tmp; cp $@.elf $@.tmp; $(STRIP) $@.tmp - $(RM) $@; $(ELFCONV) $@.tmp $@; $(RM) $@.tmp - -$(NFSBOOT)_lint: $(NFS_L_OBJS) $(L_LIBDEPS) - @echo "" - @echo inetboot lint: global crosschecks: - $(LINT.c) $(NFS_L_LDFLAGS) $(NFS_L_OBJS) $(NFS_LIBS) - include $(BOOTSRCDIR)/Makefile.rules - -install: $(ROOT_PSM_WANBOOT) - -clean: - $(RM) make.out lint.out - $(RM) $(OBJS) $(CONF_OBJS) $(MISC_OBJS) $(BOOT_OBJS) $(SRT0_OBJ) - $(RM) $(NFSBOOT).elf $(WANBOOT).elf - $(RM) $(L_OBJS) $(CONF_L_OBJS) $(MISC_L_OBJS) $(BOOT_L_OBJS) \ - $(SRT0_L_OBJ) - -clobber: clean - $(RM) $(NFSBOOT) $(WANBOOT) $(STRIPALIGN) - -lint: $(NFSBOOT)_lint $(WANBOOT)_lint - include $(BOOTSRCDIR)/Makefile.targ diff --git a/usr/src/psm/stand/boot/sparcv9/sun4/Makefile b/usr/src/psm/stand/boot/sparcv9/sun4/Makefile new file mode 100644 index 0000000000..bcba0149e0 --- /dev/null +++ b/usr/src/psm/stand/boot/sparcv9/sun4/Makefile @@ -0,0 +1,230 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +TOPDIR = ../../../../.. + +include $(TOPDIR)/uts/Makefile.uts + +all := TARGET = all +install := TARGET = install +clean := TARGET = clean + +TARG_MACH = sparcv9 +TARG_MACH_DIR = sparcv9 +ARCHVERS = v9 +PLATFORM = sun4 +#ARCHMMU = sfmmu +PROMVERS = ieee1275 +ASFLAGS += $(sparcv9_XARCH) + +ARCH_C_SRC = sun4u_memlist.c sun4x_standalloc.c sun4dep.c +ARCH_S_SRC = sparcv9_subr.s +SRT0_S = sun4u_srt0.s +INLINES = + +LDFLAGS += -L$(TOPDIR)/psm/stand/lib/promif/$(TARG_MACH)/$(PROMVERS)/common + +# +# The following libraries are build in LIBPLAT_DIR +# +LIBPLAT_DIR = $(TOPDIR)/psm/stand/lib/promif/$(TARG_MACH)/$(PROMVERS)/$(PLATFORM) +LIBPLAT_LIBS = libplat.a +LIBPLAT_L_LIBS= $(LIBPLAT_LIBS:lib%.a=llib-l%.ln) +LIBPLAT_DEP = $(LIBPLAT_DIR)/$(LIBPLAT_LIBS) +LIBPLAT_DEP_L = $(LIBPLAT_DIR)/$(LIBPLAT_L_LIBS) + +# +# Platform specific libraries +# +PSMLIBS += $(LIBPLAT_LIBS:lib%.a=-l%) +PSMLIB_DIRS += $(LIBPLAT_DIR) + +include ../Makefile.com + +CPPINCS += -I$(TOPDIR)/psm/stand/boot/sparc/sun4 + +# +# Set the choice of compiler. + +include $(TOPDIR)/psm/Makefile.psm.64 + +CFLAGS64 += -xchip=ultra $(CCABS32) + +# +# XXX this totally sucks since it effectively turns off -errchk=longptr64, +# which we really should be using. +# +LINTFLAGS64 = $(LINTFLAGS) -m64 + +# +# Cross-reference customization: include all boot-related source files. +# +STANDLIBDIR= ../../../../../stand/lib +STANDSYSDIR= ../../../../../stand/sys +PROMDIRS= ../../../../promif +NAMESDIRS= ../../../lib/names/sparcv9 ../../../lib/names/sparc/common +XRDIRS += ../../sparc/common ../../common $(STANDLIBDIR) \ + $(STANDSYSDIR) $(PROMDIRS) $(NAMESDIRS) +XRPRUNE = i86pc i386 + + +############################# +# +# WANboot booter +# +# Libraries used to build wanboot +# +# EXPORT DELETE START +LIBWANBOOT = libwanboot.a +LIBSCRYPT = libscrypt.a +LIBSSL = libssl.a +LIBCRYPTO = libcrypto.a +# EXPORT DELETE END + +LIBWAN_LIBS = \ + $(LIBWANBOOT) \ + libnvpair.a libufs.a libhsfs.a libnfs.a \ + libxdr.a libnames.a libsock.a libinet.a libtcp.a \ + $(LIBSCRYPT) $(LIBSSL) $(LIBCRYPTO) \ + libmd5.a libsa.a libprom.a \ + $(LIBSSL) \ + $(LIBPLAT_LIBS) +WAN_LIBS = $(LIBWAN_LIBS:lib%.a=-l%) +WAN_DIRS = $(LIBNAME_DIR:%=-L%) $(LIBSYS_DIR:%=-L%) +WAN_DIRS += $(LIBPLAT_DIR:%=-L%) $(LIBPROM_DIR:%=-L%) + +# +# Loader flags used to build wanboot +# +WAN_MAPFILE = $(MACH_DIR)/mapfile +WAN_LDFLAGS = -dn -M $(WAN_MAPFILE) -e _start $(WAN_DIRS) +WAN_L_LDFLAGS = $(WAN_DIRS) + +# +# Object files used to build wanboot +# +WAN_SRT0 = $(SRT0_OBJ) +WAN_OBJS = $(OBJS) wbfsconf.o wbcli.o wanboot.o ramdisk.o +WAN_L_OBJS = $(WAN_SRT0:%.o=%.ln) $(WAN_OBJS:%.o=%.ln) + + +############################# +# +# NFS booter +# +# Libraries used to build nfsboot +# +LIBNFS_LIBS = libnfs.a libxdr.a libnames.a \ + libsock.a libinet.a libtcp.a libsa.a libprom.a \ + $(LIBPLAT_LIBS) +NFS_LIBS = $(LIBNFS_LIBS:lib%.a=-l%) +NFS_DIRS = $(LIBNAME_DIR:%=-L%) $(LIBSYS_DIR:%=-L%) +NFS_DIRS += $(LIBPLAT_DIR:%=-L%) $(LIBPROM_DIR:%=-L%) + +# +# Loader flags used to build inetboot +# +NFS_MAPFILE = $(MACH_DIR)/mapfile +NFS_LDFLAGS = -dn -M $(NFS_MAPFILE) -e _start $(NFS_DIRS) +NFS_L_LDFLAGS = $(NFS_DIRS) + +# +# Object files used to build inetboot +# +NFS_SRT0 = $(SRT0_OBJ) +NFS_OBJS = $(OBJS) nfsconf.o inetboot.o ramdisk.o +NFS_L_OBJS = $(NFS_SRT0:%.o=%.ln) $(NFS_OBJS:%.o=%.ln) + + +#include $(BOOTSRCDIR)/Makefile.rules + +FRC: + +.KEEP_STATE: + +all: $(WANBOOT) $(NFSBOOT) + +install: all \ + $(ROOT_PLAT_SUN4U_WANBOOT) \ + $(ROOT_PLAT_SUN4V_WANBOOT) \ + $(USR_PLAT_SUN4U_LIB_FS_NFS_NFSBOOT) \ + $(USR_PLAT_SUN4V_LIB_FS_NFS_NFSBOOT) + +$(WANBOOT): $(WAN_MAPFILE) $(WAN_SRT0) $(WAN_OBJS) $(LIBDEPS) + $(LD) $(WAN_LDFLAGS) -o $@ $(WAN_SRT0) $(WAN_OBJS) $(WAN_LIBS) + $(MCS) -d $@ + $(POST_PROCESS) + $(MCS) -c $@ + $(STRIP) $@ + +$(NFSBOOT): $(NFS_MAPFILE) $(NFS_SRT0) $(NFS_OBJS) $(LIBDEPS) + $(LD) $(NFS_LDFLAGS) -o $@ $(NFS_SRT0) $(NFS_OBJS) $(NFS_LIBS) + $(MCS) -d $@ + $(POST_PROCESS) + $(MCS) -c $@ + $(STRIP) $@ + +$(WANBOOT)_lint: $(WAN_L_OBJS) $(L_LIBDEPS) + @echo "" + @echo wanboot lint: global crosschecks: + $(LINT.c) $(WAN_L_LDFLAGS) $(WAN_L_OBJS) $(WAN_LIBS) + +$(NFSBOOT)_lint: $(NFS_L_OBJS) $(L_LIBDEPS) + @echo "" + @echo inetboot lint: global crosschecks: + $(LINT.c) $(NFS_L_LDFLAGS) $(NFS_L_OBJS) $(NFS_LIBS) + +$(ROOT_PLAT_SUN4U_WANBOOT): $(WANBOOT) + $(INS) -s -m $(FILEMODE) -f $(ROOT_PLAT_DIR)/sun4u $(WANBOOT) + +$(ROOT_PLAT_SUN4V_WANBOOT): $(WANBOOT) + $(INS) -s -m $(FILEMODE) -f $(ROOT_PLAT_DIR)/sun4v $(WANBOOT) + +$(USR_PLAT_SUN4U_LIB_FS_NFS): + $(INS.dir) + +$(USR_PLAT_SUN4V_LIB_FS_NFS): + $(INS.dir) + +$(USR_PLAT_SUN4U_LIB_FS_NFS_NFSBOOT): $(USR_PLAT_SUN4U_LIB_FS_NFS) $(NFSBOOT) + $(INS) -s -m $(FILEMODE) -f $(USR_PLAT_SUN4U_LIB_FS_NFS) $(NFSBOOT) + +$(USR_PLAT_SUN4V_LIB_FS_NFS_NFSBOOT): $(USR_PLAT_SUN4V_LIB_FS_NFS) $(NFSBOOT) + $(INS) -s -m $(FILEMODE) -f $(USR_PLAT_SUN4V_LIB_FS_NFS) $(NFSBOOT) + +$(STRIPALIGN): $(CMN_DIR)/$$(@).c + $(NATIVECC) -o $@ $(CMN_DIR)/$@.c + +clean: + $(RM) make.out lint.out + $(RM) $(OBJS) $(CONF_OBJS) $(MISC_OBJS) $(SRT0_OBJ) + $(RM) $(WANBOOT_OBJS) $(NFSBOOT_OBJS) + $(RM) $(L_OBJS) $(CONF_L_OBJS) $(MISC_L_OBJS) $(SRT0_L_OBJ) + $(RM) $(WANBOOT_L_OBJS) $(NFSBOOT_L_OBJS) + +clobber: clean + $(RM) $(WANBOOT) $(NFSBOOT) $(STRIPALIGN) + +lint: $(WANBOOT)_lint $(NFSBOOT)_lint diff --git a/usr/src/psm/stand/boot/sparcv9/sun4u/Makefile b/usr/src/psm/stand/boot/sparcv9/sun4u/Makefile index 6f68499e0a..d83ad955c1 100644 --- a/usr/src/psm/stand/boot/sparcv9/sun4u/Makefile +++ b/usr/src/psm/stand/boot/sparcv9/sun4u/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -77,62 +77,23 @@ ARCHMMU = sfmmu PROMVERS = ieee1275 ASFLAGS += $(sparcv9_XARCH) -PLAT_C_SRC = machdep.c -ARCH_C_SRC = sun4u_memlist.c sun4x_standalloc.c sun4dep.c -ARCH_S_SRC = sparcv9_subr.s -SRT0_S = sun4u_srt0.s -INLINES = - -LDFLAGS += -L$(TOPDIR)/psm/stand/lib/promif/$(TARG_MACH)/$(PROMVERS)/common - -# -# The following libraries are build in LIBPLAT_DIR -# -LIBPLAT_DIR = $(TOPDIR)/psm/stand/lib/promif/$(TARG_MACH)/$(PROMVERS)/$(PLATFORM) -LIBPLAT_LIBS = libplat.a -LIBPLAT_L_LIBS= $(LIBPLAT_LIBS:lib%.a=llib-l%.ln) -LIBPLAT_DEP = $(LIBPLAT_DIR)/$(LIBPLAT_LIBS) -LIBPLAT_DEP_L = $(LIBPLAT_DIR)/$(LIBPLAT_L_LIBS) - -# -# Platform specific libraries -# -PSMLIBS += $(LIBPLAT_LIBS:lib%.a=-l%) -PSMLIB_DIRS += $(LIBPLAT_DIR) - include ../Makefile.com -# re-define ELFCONV for 4u--- sun4u can boot ELF directly -ELFCONV = /usr/bin/cp +include $(TOPDIR)/psm/Makefile.psm.64 +include $(BOOTSRCDIR)/Makefile.rules -# Don't need mapfile.inet for 4u inetboot -NFS_MAPFILE = $(MACH_DIR)/mapfile +FRC: -# -# Set the choice of compiler. +.KEEP_STATE: -include $(TOPDIR)/psm/Makefile.psm.64 +all: -CFLAGS64 += -xchip=ultra $(CCABS32) +install: all $(LINKED_DIRS) $(LINKED_LIB_DIRS) $(LINKED_LIB_FS_DIRS) -# -# XXX this totally sucks since it effectively turns off -errchk=longptr64, -# which we really should be using. -# -LINTFLAGS64 = $(LINTFLAGS) -m64 +clean: -# -# Cross-reference customization: include all boot-related source files. -# -STANDLIBDIR= ../../../../../stand/lib -STANDSYSDIR= ../../../../../stand/sys -PROMDIRS= ../../../../promif -NAMESDIRS= ../../../lib/names/sparcv9 ../../../lib/names/sparc/common -XRDIRS += ../../sparc/common ../../common $(STANDLIBDIR) \ - $(STANDSYSDIR) $(PROMDIRS) $(NAMESDIRS) -XRPRUNE = i86pc i386 - -cscope.out tags: FRC - $(XREF) -x $@ +clobber: clean + +lint: FRC: diff --git a/usr/src/psm/stand/boot/sparcv9/sun4v/Makefile b/usr/src/psm/stand/boot/sparcv9/sun4v/Makefile index fc204fbeab..75d066ab2f 100644 --- a/usr/src/psm/stand/boot/sparcv9/sun4v/Makefile +++ b/usr/src/psm/stand/boot/sparcv9/sun4v/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -56,65 +56,22 @@ ARCHMMU = sfmmu PROMVERS = ieee1275 ASFLAGS += $(sparcv9_XARCH) -PLAT_C_SRC = machdep.c -ARCH_C_SRC = sun4u_memlist.c sun4x_standalloc.c sun4dep.c -ARCH_S_SRC = sparcv9_subr.s -SRT0_S = sun4u_srt0.s -INLINES = - -LDFLAGS += -L$(TOPDIR)/psm/stand/lib/promif/$(TARG_MACH)/$(PROMVERS)/common - -# -# The following libraries are build in LIBPLAT_DIR -# -LIBPLAT_DIR = $(TOPDIR)/psm/stand/lib/promif/$(TARG_MACH)/$(PROMVERS)/$(PLATFORM) -LIBPLAT_LIBS = libplat.a -LIBPLAT_L_LIBS= $(LIBPLAT_LIBS:lib%.a=llib-l%.ln) -LIBPLAT_DEP = $(LIBPLAT_DIR)/$(LIBPLAT_LIBS) -LIBPLAT_DEP_L = $(LIBPLAT_DIR)/$(LIBPLAT_L_LIBS) - -# -# Platform specific libraries -# -PSMLIBS += $(LIBPLAT_LIBS:lib%.a=-l%) -PSMLIB_DIRS += $(LIBPLAT_DIR) - include ../Makefile.com +include $(TOPDIR)/psm/Makefile.psm.64 +include $(BOOTSRCDIR)/Makefile.rules -CPPINCS += -I$(SRC)/uts/sun4u -CPPINCS += -I$(ROOT)/usr/platform/sun4u/include - -# re-define ELFCONV for 4v--- sun4v can boot ELF directly -ELFCONV = /usr/bin/cp +FRC: -# Don't need mapfile.inet for 4v inetboot -NFS_MAPFILE = $(MACH_DIR)/mapfile +.KEEP_STATE: -# -# Set the choice of compiler. +all: -include $(TOPDIR)/psm/Makefile.psm.64 +install: all $(LINKED_DIRS) $(LINKED_LIB_DIRS) $(LINKED_LIB_FS_DIRS) -CFLAGS64 += -xchip=ultra $(CCABS32) +clean: -# -# XXX this totally sucks since it effectively turns off -errchk=longptr64, -# which we really should be using. -# -LINTFLAGS64 = $(LINTFLAGS) -m64 +clobber: clean -# -# Cross-reference customization: include all boot-related source files. -# -STANDLIBDIR= ../../../../../stand/lib -STANDSYSDIR= ../../../../../stand/sys -PROMDIRS= ../../../../promif -NAMESDIRS= ../../../lib/names/sparcv9 ../../../lib/names/sparc/common -XRDIRS += ../../sparc/common ../../common $(STANDLIBDIR) \ - $(STANDSYSDIR) $(PROMDIRS) $(NAMESDIRS) -XRPRUNE = i86pc i386 - -cscope.out tags: FRC - $(XREF) -x $@ +lint: FRC: diff --git a/usr/src/psm/stand/boot/sparcv9/sun4v/machdep.c b/usr/src/psm/stand/boot/sparcv9/sun4v/machdep.c deleted file mode 100644 index cada0384e2..0000000000 --- a/usr/src/psm/stand/boot/sparcv9/sun4v/machdep.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/fcntl.h> -#include <sys/promif.h> -#include <sys/prom_plat.h> -#include <sys/salib.h> - -int vac = 0; - -/* - * Check if the CPU is an UltraSPARC-1 or not. - */ -int -cpu_is_ultrasparc_1(void) -{ - return (0); -} - -/* - * Retain a page or reclaim a previously retained page of physical - * memory for use by the prom upgrade. If successful, leave - * an indication that a page was retained by creating a boolean - * property in the root node. - * - * XXX: SUNW,retain doesn't work as expected on server systems, - * so we don't try to retain any memory on those systems. - * - * XXX: do a '0 to my-self' as a workaround for 4160914 - */ - -int dont_retain_memory; - -void -retain_nvram_page(void) -{ - unsigned long long phys = 0; - static char create_prop[] = - "0 to my-self dev / 0 0 \" boot-retained-page\" property"; - extern int verbosemode; - - if (dont_retain_memory) - return; - - if (prom_retain("OBPnvram", PAGESIZE, PAGESIZE, &phys) != 0) { - printf("prom_retain failed\n"); - return; - } - if (verbosemode) - printf("retained OBPnvram page at 0x%llx\n", phys); - - prom_interpret(create_prop, 0, 0, 0, 0, 0); -} diff --git a/usr/src/psm/stand/bootblks/Makefile.com b/usr/src/psm/stand/bootblks/Makefile.com index 1dea029f87..205a946fb2 100644 --- a/usr/src/psm/stand/bootblks/Makefile.com +++ b/usr/src/psm/stand/bootblks/Makefile.com @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/bootblks/Makefile.com @@ -34,16 +34,6 @@ CLASS = 32 include $(TOPDIR)/Makefile.master include $(TOPDIR)/Makefile.psm -STANDDIR = $(TOPDIR)/stand -PSMSTANDDIR = $(TOPDIR)/psm/stand - -SYSHDRDIR = $(STANDDIR) -SYSLIBDIR = $(ROOT)/stand/lib - -PSMSYSHDRDIR = $(PSMSTANDDIR) -PSMNAMELIBDIR = $(PSMSTANDDIR)/lib/names/$(MACH) -PSMPROMLIBDIR = $(PSMSTANDDIR)/lib/promif/$(MACH) - # # 'bootblk' is the basic target we build - in many flavours # @@ -65,22 +55,3 @@ TOKENIZE = tokenize FILEMODE = 444 DIRMODE = 755 -# -# For building lint objects -# -LINTFLAGS.c = -nsxum -LINT.c = $(LINT) $(LINTFLAGS.c) $(LINT_DEFS) $(CPPFLAGS) -c -LINT.s = $(LINT) $(LINTFLAGS.s) $(LINT_DEFS) $(CPPFLAGS) -c - -# -# For building lint libraries -# -LINTFLAGS.lib = -nsxum -LINT.lib = $(LINT) $(LINTFLAGS.lib) $(LINT_DEFS) $(CPPFLAGS) - -# -# For complete pass 2 cross-checks -# XXX: lint flags should exclude -u, but the standalone libs confuse lint. -# -LINTFLAGS.2 = -nsxum -LINT.2 = $(LINT) $(LINTFLAGS.2) $(LINT_DEFS) $(CPPFLAGS) diff --git a/usr/src/psm/stand/lib/names/sparcv9/Makefile b/usr/src/psm/stand/lib/names/sparcv9/Makefile index e5f119a296..a0436cb69c 100644 --- a/usr/src/psm/stand/lib/names/sparcv9/Makefile +++ b/usr/src/psm/stand/lib/names/sparcv9/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -20,16 +19,14 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/lib/names/sparcv9/Makefile include ../../../../../Makefile.master -SUBDIRS = sun4u sun4v +SUBDIRS = sun4 all install clean clobber lint: $(SUBDIRS) diff --git a/usr/src/psm/stand/lib/names/sparcv9/sun4v/Makefile b/usr/src/psm/stand/lib/names/sparcv9/sun4/Makefile index 0b776f972b..97615f86bc 100644 --- a/usr/src/psm/stand/lib/names/sparcv9/sun4v/Makefile +++ b/usr/src/psm/stand/lib/names/sparcv9/sun4/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -19,23 +18,18 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# psm/stand/lib/names/sparcv9/sun4v/Makefile +# psm/stand/lib/names/sparcv9/sun4/Makefile # # Platform-specific # -PLATFORM = sun4v +PLATFORM = sun4 ARCHVERS = v9 TOPDIR = ../../../../../.. -PLATSRCS = modpath.c +PLATSRCS = include ../Makefile.com include $(TOPDIR)/psm/Makefile.psm.64 - -CFLAGS64 += -xchip=ultra $(CCABS32) diff --git a/usr/src/psm/stand/lib/names/sparcv9/sun4u/Makefile b/usr/src/psm/stand/lib/names/sparcv9/sun4u/Makefile deleted file mode 100644 index 288b990d54..0000000000 --- a/usr/src/psm/stand/lib/names/sparcv9/sun4u/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1997, by Sun Microsystems, Inc. -# All rights reserved. -# -# psm/stand/lib/names/sparcv9/sun4u/Makefile -# -# Platform-specific -# - -PLATFORM = sun4u -ARCHVERS = v9 -TOPDIR = ../../../../../.. -PLATSRCS = modpath.c - -include ../Makefile.com -include $(TOPDIR)/psm/Makefile.psm.64 - -CFLAGS64 += -xchip=ultra $(CCABS32) diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/Makefile index 7817f55bf9..f45c1a1d21 100644 --- a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/Makefile +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -19,10 +18,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/boot/sparcv9/ieee1275/Makefile @@ -30,7 +26,7 @@ # shared and platform-specific firmware libraries -SUBDIRS = common sun4u sun4v +SUBDIRS = common sun4 sun4u sun4v all := TARGET = all install := TARGET = install diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4/Makefile new file mode 100644 index 0000000000..08a9660262 --- /dev/null +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4/Makefile @@ -0,0 +1,141 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# psm/stand/boot/sparcv9/ieee1275/sun4u/Makefile +# +# +TOPDIR = ../../../../../../.. + +include $(TOPDIR)/Makefile.master +include $(TOPDIR)/lib/Makefile.lib +include $(TOPDIR)/psm/stand/lib/Makefile.lib +include $(TOPDIR)/psm/Makefile.psm.64 + +CFLAGS64 += -xchip=ultra $(CCABS32) + +PLATSUN4DIR = $(TOPDIR)/psm/promif/ieee1275/sun4 +SYSDIR = $(TOPDIR)/uts + +LIBPLAT = libplat.a +LINTLIBPLAT = llib-lplat.ln + +PLAT_PFILES = + +PLAT_PSUN4FILES = \ + prom_alloc.c \ + prom_cpuctl.c \ + prom_fio.c \ + prom_getunum.c \ + prom_heartbeat.c \ + prom_idprom.c \ + prom_init.c \ + prom_macaddr.c \ + prom_map.c \ + prom_mem.c \ + prom_mmu.c \ + prom_retain.c \ + prom_sparc.c \ + prom_vercheck.c \ + prom_vername.c + +KARCH = sun4u +MMU = sfmmu + +OBJSDIR = objs + +PLAT_POBJ = $(PLAT_PFILES:%.c=$(OBJSDIR)/%.o) +PLAT_PSUN4OBJ = $(PLAT_PSUN4FILES:%.c=$(OBJSDIR)/%.o) +OBJS = $(PLAT_POBJ) $(PLAT_PSUN4OBJ) +L_OBJS = $(OBJS:%.o=%.ln) +L_SRCS = $(PLAT_PFILES:%=$(PLATDIR)/%) +L_SRCS += $(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%) + +ARCHOPTS= -Dsun4u +ASFLAGS = -P -D__STDC__ -D_BOOT -D_ASM +CPPDEFS = $(ARCHOPTS) -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP +CPPINCS = -I. -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) -I$(SYSDIR)/$(MMU) \ + -I$(SYSDIR)/sparc/v9 -I$(SYSDIR)/sparc \ + -I$(SYSDIR)/sun -I$(SYSDIR)/common +CPPFLAGS= $(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master) +CFLAGS += $(CCVERBOSE) + +.KEEP_STATE: + +.PARALLEL: $(OBJS) $(L_OBJS) + +all install: $(LIBPLAT) + +lint: $(LINTLIBPLAT) + +clean: + $(RM) $(OBJS) $(L_OBJS) + +clobber: clean + $(RM) $(LIBPLAT) $(LINTLIBPLAT) a.out core + +$(LIBPLAT): $(OBJSDIR) .WAIT $(OBJS) + $(BUILD.AR) $(OBJS) + +$(LINTLIBPLAT): $(OBJSDIR) .WAIT $(L_OBJS) + @$(ECHO) "\nlint library construction:" $@ + @$(LINT.lib) -o plat $(L_SRCS) + +$(OBJSDIR): + -@[ -d $@ ] || mkdir $@ + +# +# build rules using standard library object subdirectory +# + +$(OBJSDIR)/%.o: $(PLATDIR)/%.c + $(COMPILE.c) -o $@ $< + $(POST_PROCESS_O) + +$(OBJSDIR)/%.o: $(PLATDIR)/%.s + $(COMPILE.s) -o $@ $< + $(POST_PROCESS_O) + +$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.c + $(COMPILE.c) -o $@ $< + $(POST_PROCESS_O) + +$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.s + $(COMPILE.s) -o $@ $< + $(POST_PROCESS_O) + +$(OBJSDIR)/%.ln: $(PLATDIR)/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + @$(MV) $(@F) $@ + +$(OBJSDIR)/%.ln: $(PLATDIR)/%.s + @($(LHEAD) $(LINT.s) $< $(LTAIL)) + @$(MV) $(@F) $@ + +$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + @$(MV) $(@F) $@ + +$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.s + @($(LHEAD) $(LINT.s) $< $(LTAIL)) + @$(MV) $(@F) $@ diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile index 2a4cb99393..9948ded75d 100644 --- a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile @@ -19,14 +19,12 @@ # CDDL HEADER END # # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/boot/sparcv9/ieee1275/sun4u/Makefile # # -#ident "%Z%%M% %I% %E% SMI" -# TOPDIR = ../../../../../../.. include $(TOPDIR)/Makefile.master @@ -44,24 +42,25 @@ LIBPLAT = libplat.a LINTLIBPLAT = llib-lplat.ln PLAT_PFILES = \ - prom_heartbeat.c \ - prom_mmu.c \ prom_serengeti.c \ prom_sunfire.c \ - prom_vercheck.c + prom_tlb.c PLAT_PSUN4FILES = \ prom_alloc.c \ prom_cpuctl.c \ prom_fio.c \ prom_getunum.c \ + prom_heartbeat.c \ prom_idprom.c \ prom_init.c \ prom_macaddr.c \ prom_map.c \ prom_mem.c \ + prom_mmu.c \ prom_retain.c \ prom_sparc.c \ + prom_vercheck.c \ prom_vername.c KARCH = sun4u diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile index 620da38783..f40f1651da 100644 --- a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile @@ -19,14 +19,12 @@ # CDDL HEADER END # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/boot/sparcv9/ieee1275/sun4v/Makefile # # -#ident "%Z%%M% %I% %E% SMI" -# TOPDIR = ../../../../../../.. include $(TOPDIR)/Makefile.master @@ -43,24 +41,24 @@ SYSDIR = $(TOPDIR)/uts LIBPLAT = libplat.a LINTLIBPLAT = llib-lplat.ln -PLAT_PFILES = \ - prom_heartbeat.c \ - prom_mmu.c \ - prom_vercheck.c +PLAT_PFILES = PLAT_PSUN4FILES = \ prom_alloc.c \ prom_cpuctl.c \ prom_fio.c \ prom_getunum.c \ + prom_heartbeat.c \ prom_idprom.c \ prom_init.c \ prom_macaddr.c \ prom_map.c \ prom_mem.c \ + prom_mmu.c \ prom_retain.c \ prom_sparc.c \ - prom_vername.c + prom_vername.c \ + prom_vercheck.c KARCH = sun4v MMU = sfmmu diff --git a/usr/src/psm/stand/old/bootblks/common/goforth.s b/usr/src/psm/stand/old/bootblks/common/goforth.s deleted file mode 100644 index 5d424a7ebe..0000000000 --- a/usr/src/psm/stand/old/bootblks/common/goforth.s +++ /dev/null @@ -1,60 +0,0 @@ -! -! CDDL HEADER START -! -! The contents of this file are subject to the terms of the -! Common Development and Distribution License, Version 1.0 only -! (the "License"). You may not use this file except in compliance -! with the License. -! -! You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -! or http://www.opensolaris.org/os/licensing. -! See the License for the specific language governing permissions -! and limitations under the License. -! -! When distributing Covered Code, include this CDDL HEADER in each -! file and include the License file at usr/src/OPENSOLARIS.LICENSE. -! If applicable, add the following below this CDDL HEADER, with the -! fields enclosed by brackets "[]" replaced with your own identifying -! information: Portions Copyright [yyyy] [name of copyright owner] -! -! CDDL HEADER END -! -! Copyright 2000 Sun Microsystems, Inc. All rights reserved. -! Use is subject to license terms. -! -! #ident "%Z%%M% %I% %E% SMI" -! - -#include <sys/asm_linkage.h> - -#if defined(lint) -void -goforth(struct sunromvec *romp, caddr_t start, caddr_t end) -{ return; } -#endif - - .text -! -! goforth(struct sunromvec *romp, -! char *start, char *end) -! - ENTRY(goforth) - save %sp, -SA(MINFRAME), %sp - ld [%i0 + 0x7c], %l2 ! Address of romp->v_interpret - set byteload, %i1 - sethi %hi(forthblock), %i2 - or %i2, %lo(forthblock), %i2 -v2: - ! - ! op_interpret(cmd, 1, forthblock); - ! - mov %i1, %o0 - mov %i2, %o2 - - call %l2 - mov 1, %o1 -/*NOTREACHED*/ - -byteload: - .asciz "byte-load" - .align 4 diff --git a/usr/src/psm/stand/old/bootblks/common/process.c b/usr/src/psm/stand/old/bootblks/common/process.c deleted file mode 100644 index d8e96bc778..0000000000 --- a/usr/src/psm/stand/old/bootblks/common/process.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -#ident "%Z%%M% %I% %E% SMI" - -/* - * Copyright (c) 1991 Sun Microsystems, Inc. - * - * Produce a big hunk o' data from an Fcode input file. - * Usage: process <infile.fcode >outfile - */ - -#include <stdio.h> - -main() -{ - int c, count = 0; - - (void) printf("const unsigned char forthblock[] = {\n"); - while ((c = getchar()) != EOF) - (void) printf("0x%02x,%c", c & 0xff, - (count = ++count % 8) ? ' ' : '\n'); - (void) printf("\n};\n"); - return (0); -} |