diff options
author | ks34972 <none@none> | 2006-05-06 16:34:17 -0700 |
---|---|---|
committer | ks34972 <none@none> | 2006-05-06 16:34:17 -0700 |
commit | fd845fc0cb4fbc8e85f974e2e4eaacca1cc26e81 (patch) | |
tree | e0bd57af3d2252378fad54469b1ffe20c4e8040a /usr/src | |
parent | da83352438a4a62b87fcb6fd1583e3a70aa31bb8 (diff) | |
download | illumos-joyent-fd845fc0cb4fbc8e85f974e2e4eaacca1cc26e81.tar.gz |
PSARC 2006/187 Montoya (SUNW,Netra-CP3060)
6372661 need Montoya platform boot support in Solaris ON
6395675 uata driver needs to support the ide in ULI 1575
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libpcp/sparc/Makefile | 9 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag_psr/sparc/Makefile | 2 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag_psr/sparc/montoya/Makefile | 93 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.c | 592 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.h | 101 | ||||
-rw-r--r-- | usr/src/pkgdefs/SUNWcart200.v/prototype_com | 6 | ||||
-rw-r--r-- | usr/src/pkgdefs/SUNWkvmt200.v/prototype_com | 10 | ||||
-rw-r--r-- | usr/src/pkgdefs/etc/exception_list_sparc | 1 | ||||
-rw-r--r-- | usr/src/psm/stand/boot/sparcv9/sun4v/Makefile | 8 | ||||
-rw-r--r-- | usr/src/uts/sparc/os/driver_aliases | 1 | ||||
-rw-r--r-- | usr/src/uts/sun4v/Makefile.sun4v.shared | 2 | ||||
-rw-r--r-- | usr/src/uts/sun4v/montoya/Makefile | 104 | ||||
-rw-r--r-- | usr/src/uts/sun4v/montoya/Makefile.files | 40 | ||||
-rw-r--r-- | usr/src/uts/sun4v/montoya/Makefile.montoya | 101 | ||||
-rw-r--r-- | usr/src/uts/sun4v/montoya/Makefile.rules | 53 | ||||
-rw-r--r-- | usr/src/uts/sun4v/montoya/Makefile.targ | 87 | ||||
-rw-r--r-- | usr/src/uts/sun4v/montoya/os/montoya.c | 74 | ||||
-rw-r--r-- | usr/src/uts/sun4v/montoya/platmod/Makefile | 117 |
18 files changed, 1389 insertions, 12 deletions
diff --git a/usr/src/lib/libpcp/sparc/Makefile b/usr/src/lib/libpcp/sparc/Makefile index 2183c752b7..9b9d7c7098 100644 --- a/usr/src/lib/libpcp/sparc/Makefile +++ b/usr/src/lib/libpcp/sparc/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,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -37,7 +36,7 @@ PLATFORM_OBJECTS= libpcp.o # platform library directory (/usr/platform/SUNW,Sun-Fire-T200/lib) # PLATFORM=SUNW,Sun-Fire-T200 -LINKED_PLATFORMS = +LINKED_PLATFORMS = SUNW,Netra-CP3060 include ../Makefile.com diff --git a/usr/src/lib/libprtdiag_psr/sparc/Makefile b/usr/src/lib/libprtdiag_psr/sparc/Makefile index 1a5121e2bc..501a8d4fa7 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/Makefile +++ b/usr/src/lib/libprtdiag_psr/sparc/Makefile @@ -28,7 +28,7 @@ PRTDIAG_PLATFORMS= desktop tazmo javelin sunfire starfire serengeti \ montecarlo littleneck starcat daktari cherrystone \ - lw8 snowbird ontario schumacher opl + lw8 snowbird ontario schumacher opl montoya all := TARGET= all lint := TARGET= lint diff --git a/usr/src/lib/libprtdiag_psr/sparc/montoya/Makefile b/usr/src/lib/libprtdiag_psr/sparc/montoya/Makefile new file mode 100644 index 0000000000..c7a1ccedae --- /dev/null +++ b/usr/src/lib/libprtdiag_psr/sparc/montoya/Makefile @@ -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 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# lib/libprtdiag_psr/sparc/montoya/Makefile + +UTSCLOSED = ../../../../uts +UTSBASE = ../../../../../src/uts + +PLATFORM_OBJECTS= montoya.o + +include ../Makefile.com + +# +# Override the PSR_MACH variable to use sun4v libraries +# +PSR_MACH=sun4v + +IFLAGS += -I ../../../libprtdiag/inc +IFLAGS += -I$(SRC)/cmd/picl/plugins/inc +LDLIBS += -lpicl + +LINTFLAGS += $(IFLAGS) + +PLATFORM=SUNW,Netra-CP3060 + +.KEEP_STATE: + +PLATLIBS= $(USR_PLAT_DIR)/$(PLATFORM)/lib + +install: all $(USR_PSM_LIBS) $(LINKED_PRTDIAG_DIRS) + +# +# install rules +# + +$(USR_PSM_LIB_DIR)/%: % $(USR_PSM_LIB_DIR) + $(INS.file) + +$(USR_PSM_LIB_DIR): + $(INS.dir.root.sys) + +$(LINKED_DIRS): $(USR_PLAT_DIR) + -$(INS.dir.root.sys) + +$(LINKED_LIB_DIRS): $(LINKED_DIRS) + -$(INS.dir.root.sys) + +$(LINKED_PRTDIAG_DIRS): $(USR_PLAT_DIR) + -$(INS.slink6) + +# +# used for message files +# +POFILE= libprtdiag_psr_monto.po +POFILES= monto.po + + +_msg: $(MSGDOMAIN) $(POFILE) + $(RM) $(MSGDOMAIN)/$(POFILE) + $(CP) $(POFILE) $(MSGDOMAIN) + +$(POFILE): $(POFILES) + $(RM) $@ + $(CAT) $(POFILES) > $@ + +$(POFILES): + $(RM) messages.po + $(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext common/montoya.c` + $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@ + $(RM) messages.po diff --git a/usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.c b/usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.c new file mode 100644 index 0000000000..c038520bca --- /dev/null +++ b/usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.c @@ -0,0 +1,592 @@ +/* + * 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 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Sun4v Platform specific functions. + * + * called when : + * machine_type == montoya + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <kstat.h> +#include <fcntl.h> +#include <string.h> +#include <assert.h> +#include <libintl.h> +#include <note.h> +#include <sys/systeminfo.h> +#include <sys/openpromio.h> +#include <sys/sysmacros.h> +#include <picl.h> +#include "picldefs.h" +#include <pdevinfo.h> +#include <display.h> +#include <display_sun4v.h> +#include <libprtdiag.h> +#include "montoya.h" + +#if !defined(TEXT_DOMAIN) +#define TEXT_DOMAIN "SYS_TEST" +#endif + +/* + * these functions will overlay the symbol table of libprtdiag + * at runtime + */ +void sun4v_display_pci(picl_nodehdl_t plafh); +void sun4v_display_diaginfo(int flag, Prom_node *root, picl_nodehdl_t plafh); + + +/* local functions */ +static void sun4v_display_hw_revisions(Prom_node *root, picl_nodehdl_t plafh); +static int montoya_pci_callback(picl_nodehdl_t pcih, void *args); +static int montoya_get_first_compatible_value(picl_nodehdl_t nodeh, + char **outbuf); +static int64_t montoya_get_int_propval(picl_nodehdl_t modh, char *prop_name, + int *ret); + +static void +get_bus_type(char *path, struct io_card *card) +{ + (void) strcpy(card->bus_type, "PCIE"); +} + +static void +get_slot_number(char *path, struct io_card *card) +{ + if (strncmp(path, SATA_DISK_PATH, strlen(SATA_DISK_PATH)) == 0) { + (void) strcpy(card->slot_str, RTM); + card->slot = 0; + } else if (strncmp(path, AMC_PATH, strlen(AMC_PATH)) == 0) { + (void) strcpy(card->slot_str, MOTHERBOARD); + card->slot = 0; + } else { + (void) strcpy(card->slot_str, MOTHERBOARD); + card->slot = -1; + } +} + +static int +montoya_get_network_instance(char *path) +{ + + if (strncmp(path, NETWORK_1_PATH, strlen(NETWORK_1_PATH)) == 0) { + return (1); + } else if (strncmp(path, NETWORK_0_PATH, strlen(NETWORK_0_PATH)) == 0) { + return (0); + } else if (strncmp(path, NETWORK_3_PATH, strlen(NETWORK_3_PATH)) == 0) { + return (3); + } else if (strncmp(path, NETWORK_2_PATH, strlen(NETWORK_2_PATH)) == 0) { + return (2); + } else { + return (-1); + } +} + +/* + * add all io devices under pci in io list + */ +/* ARGSUSED */ +static int +montoya_pci_callback(picl_nodehdl_t pcih, void *args) +{ + int err = PICL_SUCCESS; + picl_nodehdl_t nodeh; + char path[MAXSTRLEN]; + char parent_path[MAXSTRLEN]; + char piclclass[PICL_CLASSNAMELEN_MAX]; + char name[MAXSTRLEN]; + char model[MAXSTRLEN]; + char *compatible; + char binding_name[MAXSTRLEN]; + struct io_card pci_card; + int32_t instance; + + err = picl_get_propval_by_name(pcih, PICL_PROP_DEVFS_PATH, parent_path, + sizeof (parent_path)); + if (err != PICL_SUCCESS) { + return (err); + } + + /* Walk through the children */ + + err = picl_get_propval_by_name(pcih, PICL_PROP_CHILD, &nodeh, + sizeof (picl_nodehdl_t)); + + while (err == PICL_SUCCESS) { + err = picl_get_propval_by_name(nodeh, PICL_PROP_CLASSNAME, + piclclass, sizeof (piclclass)); + if (err != PICL_SUCCESS) + return (err); + + if (strcmp(piclclass, PCIEX) == 0) { + err = picl_get_propval_by_name(nodeh, PICL_PROP_PEER, + &nodeh, sizeof (picl_nodehdl_t)); + continue; + } + + if (strcmp(piclclass, PICL_CLASS_PCI) == 0) { + err = picl_get_propval_by_name(nodeh, PICL_PROP_CHILD, + &nodeh, sizeof (picl_nodehdl_t)); + continue; + } + + err = picl_get_propval_by_name(nodeh, PICL_PROP_DEVFS_PATH, + path, sizeof (path)); + if (err != PICL_SUCCESS) { + return (err); + } + + (void) strlcpy(pci_card.notes, path, sizeof (pci_card.notes)); + + get_bus_type(parent_path, &pci_card); + + get_slot_number(parent_path, &pci_card); + + err = picl_get_propval_by_name(nodeh, PICL_PROP_NAME, &name, + sizeof (name)); + if (err == PICL_PROPNOTFOUND) + (void) strcpy(name, ""); + else if (err != PICL_SUCCESS) + return (err); + + /* Figure NAC name */ + if ((strcmp(name, NETWORK) == 0 || + strcmp(name, ETHERNET) == 0) && + (strcmp(pci_card.slot_str, MOTHERBOARD) == 0)) { + instance = montoya_get_network_instance(path); + + (void) snprintf(pci_card.status, + sizeof (pci_card.status), "%s/%s%d", MOTHERBOARD, + "NET", instance); + } else { + if (pci_card.slot != -1) { + (void) snprintf(pci_card.status, + sizeof (pci_card.status), "%s/%s%d", + IOBOARD, pci_card.bus_type, pci_card.slot); + } else { + (void) snprintf(pci_card.status, + sizeof (pci_card.status), + "%s/%s", MOTHERBOARD, pci_card.bus_type); + } + } + + /* + * Get the name of this card. If binding_name is found, + * name will be <nodename>-<binding_name> + */ + + err = picl_get_propval_by_name(nodeh, PICL_PROP_BINDING_NAME, + &binding_name, sizeof (binding_name)); + if (err == PICL_PROPNOTFOUND) { + /* + * if compatible prop is found, name will be + * <nodename>-<compatible> + */ + err = montoya_get_first_compatible_value(nodeh, + &compatible); + if (err == PICL_SUCCESS) { + (void) strlcat(name, "-", MAXSTRLEN); + (void) strlcat(name, compatible, MAXSTRLEN); + free(compatible); + } else if (err != PICL_PROPNOTFOUND) { + return (err); + } + } else if (err != PICL_SUCCESS) { + return (err); + } else if (strcmp(name, binding_name) != 0) { + (void) strlcat(name, "-", MAXSTRLEN); + (void) strlcat(name, binding_name, MAXSTRLEN); + } + + (void) strlcpy(pci_card.name, name, sizeof (pci_card.name)); + + /* Get the model of this card */ + + err = picl_get_propval_by_name(nodeh, OBP_PROP_MODEL, + &model, sizeof (model)); + if (err == PICL_PROPNOTFOUND) + (void) strcpy(model, ""); + else if (err != PICL_SUCCESS) + return (err); + (void) strlcpy(pci_card.model, model, sizeof (pci_card.model)); + + /* Print NAC name */ + log_printf("%-11s", pci_card.status); + /* Print IO Type */ + log_printf("%6s", pci_card.bus_type); + /* Print Slot # */ + log_printf("%5s", pci_card.slot_str); + /* Print Parent Path */ + log_printf("%46.45s", pci_card.notes); + /* Printf Card Name */ + if (strlen(pci_card.name) > 24) + log_printf("%25.24s+", pci_card.name); + else + log_printf("%26s", pci_card.name); + /* Print Card Model */ + if (strlen(pci_card.model) > 10) + log_printf("%10.9s+", pci_card.model); + else + log_printf("%10s", pci_card.model); + log_printf("\n"); + + err = picl_get_propval_by_name(nodeh, PICL_PROP_PEER, &nodeh, + sizeof (picl_nodehdl_t)); + + } + + return (PICL_WALK_CONTINUE); +} + +/* + * display_pci + * Display all the PCI IO cards on this board. + */ +void +sun4v_display_pci(picl_nodehdl_t plafh) +{ + char platbuf[MAXSTRLEN]; + char *fmt = "%-11s %-7s %-4s %-46s %-25s %-8s"; + static int banner = FALSE; /* Have we printed the column headings? */ + + if (banner == FALSE) { + log_printf("\n", 0); + log_printf("=========================", 0); + log_printf(dgettext(TEXT_DOMAIN, " IO Configuration "), 0); + log_printf("=========================", 0); + log_printf("\n", 0); + log_printf("\n", 0); + log_printf(fmt, "", "IO", "", "", "", "", 0); + log_printf("\n", 0); + log_printf(fmt, "Location", "Type", "Slot", "Path", + "Name", "Model", 0); + log_printf("\n"); + log_printf(fmt, "-----------", "-----", "----", + "---------------------------------------------", + "-------------------------", "---------", 0); + log_printf("\n"); + banner = TRUE; + } + + /* Get platform name, if that fails, use montoya name by default */ + if (sysinfo(SI_PLATFORM, platbuf, sizeof (platbuf)) == -1) { + (void) strcpy(platbuf, MONTOYA_PLATFORM); + } + + (void) picl_walk_tree_by_class(plafh, PCIEX, PCIEX, + montoya_pci_callback); +} + +/* ARGSUSED */ +void +sun4v_display_diaginfo(int flag, Prom_node *root, picl_nodehdl_t plafh) +{ + /* NOTE(ARGUNUSED(kstats)) */ + /* + * Now display the last powerfail time and the fatal hardware + * reset information. We do this under a couple of conditions. + * First if the user asks for it. The second is if the user + * told us to do logging, and we found a system failure. + */ + if (flag) { + /* + * display time of latest powerfail. Not all systems + * have this capability. For those that do not, this + * is just a no-op. + */ + disp_powerfail(root); + + /* platform_disp_prom_version(tree); */ + sun4v_display_hw_revisions(root, plafh); + } +} + +/* + * local functions + */ +/* + * add all io devices under pci in io list + */ +/* ARGSUSED */ +static int +montoya_hw_rev_callback(picl_nodehdl_t pcih, void *args) +{ + int err = PICL_SUCCESS; + char path[MAXSTRLEN] = ""; + char device_path[MAXSTRLEN]; + char NAC[MAXSTRLEN]; + char *compatible; + int32_t revision; + int device_found; + + device_found = 0; + + err = picl_get_propval_by_name(pcih, PICL_PROP_DEVFS_PATH, path, + sizeof (path)); + if (err != PICL_SUCCESS) { + return (err); + } + + + if ((strncmp(path, NETWORK_0_PATH, strlen(NETWORK_0_PATH)) == 0) || + (strncmp(path, NETWORK_1_PATH, strlen(NETWORK_1_PATH)) == 0)) { + device_found = 1; + (void) snprintf(NAC, sizeof (NAC), "%s/%s%d", + MOTHERBOARD, OPHIR, 0); + revision = montoya_get_int_propval(pcih, OBP_PROP_REVISION_ID, + &err); + } + + if ((strncmp(path, NETWORK_2_PATH, strlen(NETWORK_2_PATH)) == 0) || + (strncmp(path, NETWORK_3_PATH, strlen(NETWORK_3_PATH)) == 0)) { + device_found = 1; + (void) snprintf(NAC, sizeof (NAC), "%s/%s%d", + MOTHERBOARD, OPHIR, 1); + revision = montoya_get_int_propval(pcih, OBP_PROP_REVISION_ID, + &err); + } + + if ((strcmp(path, FIRE_PATHB) == 0) || + (strcmp(path, FIRE_PATHA) == 0)) { + device_found = 1; + (void) snprintf(NAC, sizeof (NAC), "%s/%s", MOTHERBOARD, + PCI_BRIDGE); + revision = montoya_get_int_propval(pcih, OBP_PROP_VERSION_NUM, + &err); + } + + if (strcmp(path, SWITCH_PATH) == 0) { + device_found = 1; + (void) snprintf(NAC, sizeof (NAC), "%s/%s", + MOTHERBOARD, SWITCH_A); + revision = montoya_get_int_propval(pcih, + OBP_PROP_REVISION_ID, &err); + } + + if (strcmp(path, SATA_DISK_PATH) == 0) { + device_found = 1; + (void) snprintf(NAC, sizeof (NAC), "%s/%s", RTM, SATA_HBA); + revision = montoya_get_int_propval(pcih, OBP_PROP_REVISION_ID, + &err); + } + + if (strcmp(path, RTM_PCI_PATH) == 0) { + device_found = 1; + (void) snprintf(NAC, sizeof (NAC), "%s/%s", RTM, AMC); + revision = montoya_get_int_propval(pcih, OBP_PROP_REVISION_ID, + &err); + } + + if (device_found == 1) { + (void) strcpy(device_path, path); + err = montoya_get_first_compatible_value(pcih, &compatible); + + /* Print NAC name */ + log_printf("%-20s", NAC); + /* Print Device Path */ + if (strlen(device_path) > 38) + log_printf("%38.37s+", device_path); + else + log_printf("%39s", device_path); + + /* Print Compatible # */ + if (err == PICL_SUCCESS) { + log_printf("%31s", compatible); + free(compatible); + } else + log_printf("%31s", " "); + + /* Print Revision */ + log_printf("%6d", revision); + log_printf("\n"); + } + + return (PICL_WALK_CONTINUE); +} + +/*ARGSUSED*/ +static void +sun4v_display_hw_revisions(Prom_node *root, picl_nodehdl_t plafh) +{ + Prom_node *pnode; + char *value; + char platbuf[MAXSTRLEN]; + char *fmt = "%-20s %-40s %-30s %-9s"; + + log_printf(dgettext(TEXT_DOMAIN, "\n" + "========================= HW Revisions " + "=======================================\n\n")); + + log_printf(dgettext(TEXT_DOMAIN, + "System PROM revisions:\n" + "----------------------\n")); + + pnode = dev_find_node(root, "openprom"); + if (pnode != NULL) { + value = (char *)get_prop_val(find_prop(pnode, "version")); + log_printf(value); + } + + log_printf(dgettext(TEXT_DOMAIN, "\n\n" + "IO ASIC revisions:\n" + "------------------\n")); + log_printf(fmt, "Location", "Path", "Device", "Revision\n", 0); + log_printf(fmt, "--------------------", + "----------------------------------------", + "------------------------------", + "---------\n", 0); + + /* Get platform name, if that fails, use montoya name by default */ + if (sysinfo(SI_PLATFORM, platbuf, sizeof (platbuf)) == -1) { + (void) strcpy(platbuf, MONTOYA_PLATFORM); + } + + (void) picl_walk_tree_by_class(plafh, PCIEX, + PCIEX, montoya_hw_rev_callback); + (void) picl_walk_tree_by_class(plafh, PCI, + PCI, montoya_hw_rev_callback); + (void) picl_walk_tree_by_class(plafh, NETWORK, + NETWORK, montoya_hw_rev_callback); + (void) picl_walk_tree_by_class(plafh, SCSI2, SCSI2, + montoya_hw_rev_callback); +} + +/* + * return the first compatible value + */ +static int +montoya_get_first_compatible_value(picl_nodehdl_t nodeh, char **outbuf) +{ + int err; + picl_prophdl_t proph; + picl_propinfo_t pinfo; + picl_prophdl_t tblh; + picl_prophdl_t rowproph; + char *pval; + + err = picl_get_propinfo_by_name(nodeh, OBP_PROP_COMPATIBLE, + &pinfo, &proph); + if (err != PICL_SUCCESS) + return (err); + + if (pinfo.type == PICL_PTYPE_CHARSTRING) { + pval = malloc(pinfo.size); + if (pval == NULL) + return (PICL_FAILURE); + err = picl_get_propval(proph, pval, pinfo.size); + if (err != PICL_SUCCESS) { + free(pval); + return (err); + } + *outbuf = pval; + return (PICL_SUCCESS); + } + + if (pinfo.type != PICL_PTYPE_TABLE) + return (PICL_FAILURE); + + /* get first string from table */ + err = picl_get_propval(proph, &tblh, pinfo.size); + if (err != PICL_SUCCESS) + return (err); + + err = picl_get_next_by_row(tblh, &rowproph); + if (err != PICL_SUCCESS) + return (err); + + err = picl_get_propinfo(rowproph, &pinfo); + if (err != PICL_SUCCESS) + return (err); + + pval = malloc(pinfo.size); + if (pval == NULL) + return (PICL_FAILURE); + + err = picl_get_propval(rowproph, pval, pinfo.size); + if (err != PICL_SUCCESS) { + free(pval); + return (err); + } + + *outbuf = pval; + return (PICL_SUCCESS); +} + +static int64_t +montoya_get_int_propval(picl_nodehdl_t modh, char *prop_name, int *ret) +{ + int err; + picl_prophdl_t proph; + picl_propinfo_t pinfo; + int8_t int8v; + int16_t int16v; + int32_t int32v; + int64_t int64v; + + err = picl_get_propinfo_by_name(modh, prop_name, &pinfo, &proph); + if (err != PICL_SUCCESS) { + *ret = err; + return (0); + } + + /* + * If it is not an int, uint or byte array prop, return failure + */ + if ((pinfo.type != PICL_PTYPE_INT) && + (pinfo.type != PICL_PTYPE_UNSIGNED_INT) && + (pinfo.type != PICL_PTYPE_BYTEARRAY)) { + *ret = PICL_FAILURE; + return (0); + } + + switch (pinfo.size) { + case sizeof (int8_t): + err = picl_get_propval(proph, &int8v, sizeof (int8v)); + *ret = err; + return (int8v); + case sizeof (int16_t): + err = picl_get_propval(proph, &int16v, sizeof (int16v)); + *ret = err; + return (int16v); + case sizeof (int32_t): + err = picl_get_propval(proph, &int32v, sizeof (int32v)); + *ret = err; + return (int32v); + case sizeof (int64_t): + err = picl_get_propval(proph, &int64v, sizeof (int64v)); + *ret = err; + return (int64v); + default: /* not supported size */ + *ret = PICL_FAILURE; + return (0); + } +} diff --git a/usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.h b/usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.h new file mode 100644 index 0000000000..776d2c4ac5 --- /dev/null +++ b/usr/src/lib/libprtdiag_psr/sparc/montoya/common/montoya.h @@ -0,0 +1,101 @@ +/* + * 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 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Sun4v Platform header file. + * + * called when : + * machine_type == Montoya + * + */ + +#ifndef _MONTOYA_H +#define _MONTOYA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MONTOYA_PLATFORM "SUNW,Netra-CP3060" +#define H20_IMPL 0x5678 +#define IS_H20(impl) ((impl) == H20_IMPL) +#define PCIE_COMP_NUM 20 +#define PCIX_COMP_NUM 20 +#define MOTHERBOARD "MB" +#define IOBOARD "IO" +#define RTM "RTM" +#define SWITCH_A "PCI-SWITCH" +#define PCI_BRIDGE "PCI-BRIDGE" +#define OPHIR "GBE" +#define SATA_HBA "SATA-HBA" +#define PCIE "/PCIE" +#define AMC "AMC" + +#define NETWORK "network" +#define ETHERNET "ethernet" +#define PCIEX "pciex" +#define PCI "pci" +#define SCSI2 "scsi-2" + +#define FIRE_PATHA "/pci@7c0" +#define FIRE_PATHB "/pci@780" +#define SWITCH_PATH "/pci@780/pci@0" /* PCI express switch */ +#define NETWORK_0_PATH "/pci@780/pci@0/pci@2/network@0" /* ether 0 */ +#define NETWORK_1_PATH "/pci@780/pci@0/pci@2/network@0,1" /* ether 1 */ +#define NETWORK_2_PATH "/pci@7c0/ethernet@0" /* serdes 0 */ +#define NETWORK_3_PATH "/pci@7c0/ethernet@0,1" /* serdes 1 */ +#define COMPACT_FLASH_PATH "/pci@780/pci@0/pci@1/pci/ide@1f/disk" +#define SATA_DISK_PATH "/pci@780/pci@0/pci@1/pci@0/ide@1f,1/disk" +#define AMC_PATH "/pci@780/pci@0/pci@8" +#define RTM_PCI_PATH "/pci@780/pci@0/pci@9" + + +/* + * Property names + */ +#define OBP_PROP_REG "reg" +#define OBP_PROP_CLOCK_FREQ "clock-frequency" +#define OBP_PROP_BOARD_NUM "board#" +#define OBP_PROP_REVISION_ID "revision-id" +#define OBP_PROP_VERSION_NUM "version#" +#define OBP_PROP_BOARD_TYPE "board_type" +#define OBP_PROP_ECACHE_SIZE "ecache-size" +#define OBP_PROP_IMPLEMENTATION "implementation#" +#define OBP_PROP_MASK "mask#" +#define OBP_PROP_COMPATIBLE "compatible" +#define OBP_PROP_BANNER_NAME "banner-name" +#define OBP_PROP_MODEL "model" +#define OBP_PROP_66MHZ_CAPABLE "66mhz-capable" +#define OBP_PROP_FBC_REG_ID "fbc_reg_id" +#define OBP_PROP_VERSION "version" +#define OBP_PROP_INSTANCE "instance" + +#ifdef __cplusplus +} +#endif + +#endif /* _MONTOYA_H */ diff --git a/usr/src/pkgdefs/SUNWcart200.v/prototype_com b/usr/src/pkgdefs/SUNWcart200.v/prototype_com index a13969f7f8..1167f40a1d 100644 --- a/usr/src/pkgdefs/SUNWcart200.v/prototype_com +++ b/usr/src/pkgdefs/SUNWcart200.v/prototype_com @@ -44,10 +44,16 @@ i i.preserve # d none platform 755 root sys d none platform/SUNW,Sun-Fire-T200 755 root sys +d none platform/SUNW,Netra-CP3060 755 root sys d none platform/SUNW,Sun-Fire-T200/kernel 755 root sys +d none platform/SUNW,Netra-CP3060/kernel 755 root sys d none platform/SUNW,Sun-Fire-T200/kernel/misc 755 root sys +d none platform/SUNW,Netra-CP3060/kernel/misc 755 root sys d none platform/SUNW,Sun-Fire-T200/kernel/misc/sparcv9 755 root sys +d none platform/SUNW,Netra-CP3060/kernel/misc/sparcv9 755 root sys f none platform/SUNW,Sun-Fire-T200/kernel/misc/sparcv9/platmod 755 root sys +f none platform/SUNW,Netra-CP3060/kernel/misc/sparcv9/platmod 755 root sys s none platform/SUNW,Sun-Fire-T200/lib=../sun4v/lib s none platform/SUNW,Sun-Fire-T1000=sun4v s none platform/SUNW,Netra-T2000=SUNW,Sun-Fire-T200 +s none platform/SUNW,Netra-CP3060/lib=../sun4v/lib diff --git a/usr/src/pkgdefs/SUNWkvmt200.v/prototype_com b/usr/src/pkgdefs/SUNWkvmt200.v/prototype_com index be2ef1c61f..fa2be912a2 100644 --- a/usr/src/pkgdefs/SUNWkvmt200.v/prototype_com +++ b/usr/src/pkgdefs/SUNWkvmt200.v/prototype_com @@ -46,28 +46,36 @@ i copyright d none usr 755 root sys d none usr/platform 755 root sys d none usr/platform/SUNW,Sun-Fire-T200 755 root sys +d none usr/platform/SUNW,Netra-CP3060 755 root sys # # create links to sun4v platform # s none usr/platform/SUNW,Sun-Fire-T200/sbin=../sun4v/sbin # # -# create lib directory for Sun-Fire-T200 +# create lib directory # d none usr/platform/SUNW,Sun-Fire-T200/lib 755 root bin +d none usr/platform/SUNW,Netra-CP3060/lib 755 root bin # # add binary and libraries for prtdiag # f none usr/platform/SUNW,Sun-Fire-T200/lib/libprtdiag_psr.so.1 644 root bin +f none usr/platform/SUNW,Netra-CP3060/lib/libprtdiag_psr.so.1 644 root bin + # # create libpcp library # s none usr/platform/SUNW,Sun-Fire-T200/lib/libpcp.so=./libpcp.so.1 +s none usr/platform/SUNW,Netra-CP3060/lib/libpcp.so=../../SUNW,Sun-Fire-T200/lib/libpcp.so f none usr/platform/SUNW,Sun-Fire-T200/lib/libpcp.so.1 755 root bin +s none usr/platform/SUNW,Netra-CP3060/lib/libpcp.so.1=../../SUNW,Sun-Fire-T200/lib/libpcp.so.1 + # # platform-dependent boot object # s none usr/platform/SUNW,Sun-Fire-T200/lib/fs=../../sun4v/lib/fs +s none usr/platform/SUNW,Netra-CP3060/lib/fs=../../sun4v/lib/fs # # add erie link # diff --git a/usr/src/pkgdefs/etc/exception_list_sparc b/usr/src/pkgdefs/etc/exception_list_sparc index a86ba2c531..ddceb12929 100644 --- a/usr/src/pkgdefs/etc/exception_list_sparc +++ b/usr/src/pkgdefs/etc/exception_list_sparc @@ -816,6 +816,7 @@ lib/sparcv9/libc_i18n.a sparc # Only the shared object is shipped. # usr/platform/SUNW,Sun-Fire-T200/lib/llib-lpcp.ln sparc +usr/platform/SUNW,Netra-CP3060/lib/llib-lpcp.ln sparc # # ZFS internal tools and lint libraries # diff --git a/usr/src/psm/stand/boot/sparcv9/sun4v/Makefile b/usr/src/psm/stand/boot/sparcv9/sun4v/Makefile index b680b12fe8..9d1cee2e83 100644 --- a/usr/src/psm/stand/boot/sparcv9/sun4v/Makefile +++ b/usr/src/psm/stand/boot/sparcv9/sun4v/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,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -33,6 +32,7 @@ include $(TOPDIR)/uts/Makefile.uts MODULE = fs PLATLINKS = SUNW,Sun-Fire-T200 +PLATLINKS += SUNW,Netra-CP3060 LINKED_DIRS = $(PLATLINKS:%=$(USR_PLAT_DIR)/%) LINKED_LIB_DIRS = $(PLATLINKS:%=$(USR_PLAT_DIR)/%/lib) diff --git a/usr/src/uts/sparc/os/driver_aliases b/usr/src/uts/sparc/os/driver_aliases index e4ecdb1d45..70c71a19d8 100644 --- a/usr/src/uts/sparc/os/driver_aliases +++ b/usr/src/uts/sparc/os/driver_aliases @@ -41,6 +41,7 @@ socal SUNW,socal glm "pci1000,1" uata "pci1095,646" uata "pci10b9,5229" +uata "pci10b9,5288" uata "pci1095,649" uata "pci1095,680" dad "ide-disk" diff --git a/usr/src/uts/sun4v/Makefile.sun4v.shared b/usr/src/uts/sun4v/Makefile.sun4v.shared index b961e615f5..f5c55b3d47 100644 --- a/usr/src/uts/sun4v/Makefile.sun4v.shared +++ b/usr/src/uts/sun4v/Makefile.sun4v.shared @@ -66,7 +66,7 @@ PSMBASE = $(UTSBASE)/../psm #IMPLEMENTED_PLATFORM = #PLATFORMS = $(IMPLEMENTED_PLATFORM) -IMPLEMENTATIONS = ontario +IMPLEMENTATIONS = ontario montoya #ROOT_PLAT_DIRS = $(PLATFORMS:%=$(ROOT_PLAT_DIR)/%) #USR_PLAT_DIRS = $(PLATFORMS:%=$(USR_PLAT_DIR)/%) diff --git a/usr/src/uts/sun4v/montoya/Makefile b/usr/src/uts/sun4v/montoya/Makefile new file mode 100644 index 0000000000..84f9a1b48e --- /dev/null +++ b/usr/src/uts/sun4v/montoya/Makefile @@ -0,0 +1,104 @@ +# +# 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 +# +# +# uts/sun4v/montoya/Makefile +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# This makefile drives the production of the sun4v montoya platform +# modules. +# +# sun4v montoya implementation architecture dependent +# + +# +# Path to the base of the uts directory tree (usually /usr/src/uts). +# +UTSBASE = ../.. + +# +# Include common rules. +# +include $(UTSBASE)/sun4v/montoya/Makefile.montoya + +def := TARGET= def +all := TARGET= all +install := TARGET= install +install_h := TARGET= install_h +clean := TARGET= clean +clobber := TARGET= clobber +lint := TARGET= lint +lintlib := TARGET= lintlib +modlintlib := TARGET= modlintlib +modlist := TARGET= modlist +modlist := NO_STATE= -K $$MODSTATE$$$$ +clean.lint := TARGET= clean.lint +check := TARGET= check + +# +# Default build targets. +# +.KEEP_STATE: + +def all clean clobber clean.lint modlist: $(MONTOYA_KMODS) + +lintlib: unix + +modlintlib: $(MONTOYA_KMODS) + +IMPLEMENTED_PLATFORM = SUNW,Netra-CP3060 + +install: $(ROOT_MONTOYA_DIR) $(USR_MONTOYA_DIR) \ + $(USR_MONTOYA_LIB_DIR) \ + $(ROOT_MONTOYA_LIB_DIR) \ + .WAIT $(MONTOYA_KMODS) + +$(MONTOYA_KMODS): FRC + @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) + +install_h check: FRC + +lint: modlintlib .WAIT $(LINT_DEPS) + +LINT_LIBS = $(LINT_LIB) \ + -L$(MONTOYA_LINT_LIB_DIR) \ + -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ + $(CLOSED_LINT_KMODS:%=-l%) \ + -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) + +lint.platmod: modlintlib + @-$(ECHO) "\n$(IMPLEMENTED_PLATFORM) platform-dependent module: global crosschecks:" + @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) + +EXPORT_SRC: + $(RM) Makefile+ + sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ + < Makefile > Makefile+ + $(MV) Makefile+ Makefile + $(CHMOD) 444 Makefile +# EXPORT DELETE END + +# +# Include common targets. +# +include $(UTSBASE)/$(PLATFORM)/montoya/Makefile.targ diff --git a/usr/src/uts/sun4v/montoya/Makefile.files b/usr/src/uts/sun4v/montoya/Makefile.files new file mode 100644 index 0000000000..742f15dd4e --- /dev/null +++ b/usr/src/uts/sun4v/montoya/Makefile.files @@ -0,0 +1,40 @@ +# +# 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 +# +# uts/sun4v/montoya/Makefile.files +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# + +# +# Global definitions for sun4v implementation specific modules. +# + +# +# Define objects. +# +MONTOYA_PLATMOD_OBJS = montoya.o + +# +# include montoya header files +# +INC_PATH += -I$(UTSBASE)/sun4v diff --git a/usr/src/uts/sun4v/montoya/Makefile.montoya b/usr/src/uts/sun4v/montoya/Makefile.montoya new file mode 100644 index 0000000000..7648b7d31a --- /dev/null +++ b/usr/src/uts/sun4v/montoya/Makefile.montoya @@ -0,0 +1,101 @@ +# +# 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 +# +# +# uts/sun4v/montoya/Makefile +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# Global definitions for sun4v montoya implementation specific modules. +# + +# +# Define directories. +# +ROOT_MONTOYA_DIR = $(ROOT_PLAT_DIR)/SUNW,Netra-CP3060 +ROOT_MONTOYA_MOD_DIR = $(ROOT_MONTOYA_DIR)/kernel +ROOT_MONTOYA_MISC_DIR_32 = $(ROOT_MONTOYA_DIR)/kernel/misc +ROOT_MONTOYA_MISC_DIR_64 = $(ROOT_MONTOYA_MISC_DIR_32)/$(SUBDIR64) +ROOT_MONTOYA_KERN_DIR_32 = $(ROOT_MONTOYA_MOD_DIR) +ROOT_MONTOYA_KERN_DIR_64 = $(ROOT_MONTOYA_MOD_DIR)/$(SUBDIR64) +ROOT_MONTOYA_DRV_DIR_32 = $(ROOT_MONTOYA_MOD_DIR)/drv +ROOT_MONTOYA_DRV_DIR_64 = $(ROOT_MONTOYA_MOD_DIR)/drv/$(SUBDIR64) + +ROOT_MONTOYA_KERN_DIR = $(ROOT_MONTOYA_KERN_DIR_$(CLASS)) +ROOT_MONTOYA_DRV_DIR = $(ROOT_MONTOYA_DRV_DIR_$(CLASS)) +ROOT_MONTOYA_MISC_DIR = $(ROOT_MONTOYA_MISC_DIR_$(CLASS)) + +ROOT_PLAT_MOD_DIRS += $(ROOT_MONTOYA_MOD_DIR) +ROOT_PLAT_MISC_DIRS += $(ROOT_MONTOYA_MISC_DIR) + +ROOT_MONTOYA_LIB_DIR = $(ROOT_MONTOYA_DIR)/lib + +USR_SUN4V_PLAT_DIR = $(USR_PLAT_DIR)/$(e0LATFORM) +USR_MONTOYA_DIR = $(USR_PLAT_DIR)/SUNW,Netra-CP3060 +USR_MONTOYA_SBIN_DIR = $(USR_MONTOYA_DIR)/sbin +USR_MONTOYA_INC_DIR = $(USR_MONTOYA_DIR)/include +USR_MONTOYA_LIB_DIR = $(USR_MONTOYA_DIR)/lib +USR_MONTOYA_ISYS_DIR = $(USR_MONTOYA_INC_DIR)/sys + + +MONTOYA_LINT_LIB_DIR= $(UTSBASE)/$(PLATFORM)/montoya/lint-libs/$(OBJS_DIR) + +# +# Define modules. +# +MONTOYA_KMODS = platmod + +# +# Include the makefiles which define build rule templates, the +# collection of files per module, and a few specific flags. Note +# that order is significant, just as with an include path. The +# first build rule template which matches the files name will be +# used. By including these in order from most machine dependent +# to most machine independent, we allow a machine dependent file +# to be used in preference over a machine independent version +# (Such as a machine specific optimization, which preserves the +# interfaces.) +# + +include $(UTSBASE)/sun4v/montoya/Makefile.files +# +# Include common rules. +# +include $(UTSBASE)/sun4v/Makefile.sun4v + +MODSTUBS_DIR = $(UNIX_DIR) +LINTS_DIR = $(OBJS_DIR) +LINT_LIB_DIR = $(UTSBASE)/$(PLATFORM)/montoya/lint-libs/$(OBJS_DIR) + + +# +# Define the actual specific platforms +MACHINE_DEFS += -D$(PLATFORM) -D_MACHDEP +MACHINE_DEFS += -D_MONTOYA + +# Define for inline pre-processing since +# cpp not smart about v9 yet. +# + +CPP_DEFS_32 = +CPP_DEFS_64 = -D__sparcv9 +CPP_DEFS = $(CPP_DEFS_$(CLASS)) diff --git a/usr/src/uts/sun4v/montoya/Makefile.rules b/usr/src/uts/sun4v/montoya/Makefile.rules new file mode 100644 index 0000000000..f89017ff7c --- /dev/null +++ b/usr/src/uts/sun4v/montoya/Makefile.rules @@ -0,0 +1,53 @@ +# +# 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 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# + +# +# This Makefile defines the build rules for the directory +# uts/sun4v/montoya. +# +# The following two-level ordering must be maintained in this file. +# Lines are sorted first in order of decreasing specificity based on +# the first directory component. That is, sun4v rules come before +# sparc rules come before common rules. +# +# Lines whose initial directory components are equal are sorted +# alphabetically by the remaining components. + +# +# Section 1a: C object build rules +# + +$(OBJS_DIR)/%.o: $(UTSBASE)/sun4v/montoya/os/%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + +# +# Section 1b: Lint `object' build rules +# + +$(LINTS_DIR)/%.ln: $(UTSBASE)/sun4v/montoya/os/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + diff --git a/usr/src/uts/sun4v/montoya/Makefile.targ b/usr/src/uts/sun4v/montoya/Makefile.targ new file mode 100644 index 0000000000..7faf09af81 --- /dev/null +++ b/usr/src/uts/sun4v/montoya/Makefile.targ @@ -0,0 +1,87 @@ +# +# 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 +# +# +#pragma ident "%Z%%M% %I% %E% SMI" +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# Common targets for sun4v platform-implementation specific modules. +# + +.KEEP_STATE: + +# +# Rules for implementation subdirectories. +# +$(ROOT_MONTOYA_DIR): $(ROOT_PLAT_DIR) + -$(INS.dir.root.sys) + +$(ROOT_MONTOYA_MOD_DIR): $(ROOT_MONTOYA_DIR) + -$(INS.dir.root.sys) + +$(ROOT_MONTOYA_DRV_DIR_32): $(ROOT_MONTOYA_MOD_DIR) + -$(INS.dir.root.sys) + +$(ROOT_MONTOYA_DRV_DIR_64): $(ROOT_MONTOYA_DRV_DIR_32) + -$(INS.dir.root.sys) + +$(ROOT_MONTOYA_LIB_DIR): $(ROOT_MONTOYA_DIR) + -$(INS.slink2) + +$(ROOT_MONTOYA_MISC_DIR_32): $(ROOT_MONTOYA_MOD_DIR) + -$(INS.dir.root.sys) + +$(ROOT_MONTOYA_MISC_DIR_64): $(ROOT_MONTOYA_MISC_DIR_32) + -$(INS.dir.root.sys) + +$(ROOT_MONTOYA_MOD_DIR)/%: $(OBJS_DIR)/% $(ROOT_MONTOYA_MOD_DIR) FRC + $(INS.file) + +$(ROOT_MONTOYA_MISC_DIR)/%: $(OBJS_DIR)/% $(ROOT_MONTOYA_MISC_DIR) FRC + $(INS.file) + +$(ROOT_MONTOYA_DRV_DIR)/%: $(OBJS_DIR)/% $(ROOT_MONTOYA_DRV_DIR) FRC + $(INS.file) + +$(USR_MONTOYA_DIR): $(USR_SUN4V_PLAT_DIR) + -$(INS.dir.root.sys) + +$(USR_MONTOYA_INC_DIR): $(USR_MONTOYA_DIR) + -$(INS.slink4) + +$(USR_MONTOYA_ISYS_DIR): $(USR_MONTOYA_INC_DIR) + -$(INS.dir.root.sys) + +$(USR_MONTOYA_SBIN_DIR): $(USR_MONTOYA_DIR) + -$(INS.dir.root.bin) + +$(USR_MONTOYA_LIB_DIR): $(USR_MONTOYA_DIR) + -$(INS.dir.root.bin) + +$(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%): $(USR_PLAT_DIR) + $(INS.slink3) + +# +# Include common targets. +# +include $(UTSBASE)/$(PLATFORM)/montoya/Makefile.rules +include $(UTSBASE)/$(PLATFORM)/Makefile.targ diff --git a/usr/src/uts/sun4v/montoya/os/montoya.c b/usr/src/uts/sun4v/montoya/os/montoya.c new file mode 100644 index 0000000000..43dd057406 --- /dev/null +++ b/usr/src/uts/sun4v/montoya/os/montoya.c @@ -0,0 +1,74 @@ +/* + * 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 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/sysmacros.h> +#include <sys/sunddi.h> +#include <sys/esunddi.h> +#include <sys/sunndi.h> +#include <sys/platform_module.h> +#include <sys/errno.h> +#include <sys/utsname.h> +#include <sys/modctl.h> +#include <sys/systeminfo.h> +#include <sys/promif.h> +#include <sys/bootconf.h> + + + +/* + * Platform power management drivers list - empty by default + */ +char *platform_module_list[] = { + (char *)0 +}; + + +/*ARGSUSED*/ +void +plat_tod_fault(enum tod_fault_type tod_bad) +{ +} + +void +load_platform_drivers(void) +{ +} + +/* + * This routine provides a workaround for a bug in the SB chip which + * can cause data corruption. Will be invoked from the IDE HBA driver for + * Acer SouthBridge at the time of IDE bus reset. + */ +/*ARGSUSED*/ +int +plat_ide_chipreset(dev_info_t *dip, int chno) +{ + return (DDI_SUCCESS); +} diff --git a/usr/src/uts/sun4v/montoya/platmod/Makefile b/usr/src/uts/sun4v/montoya/platmod/Makefile new file mode 100644 index 0000000000..71a36dae5b --- /dev/null +++ b/usr/src/uts/sun4v/montoya/platmod/Makefile @@ -0,0 +1,117 @@ +# +# 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 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# This makefile drives the production of the sun4v montoya default +# platform module. +# +# sun4v implementation architecture dependent +# + +# +# Path to the base of the uts directory tree (usually /usr/src/uts). +# +UTSBASE = ../../.. + +# +# Define the module and object file sets. +# +MODULE = platmod +OBJECTS = $(MONTOYA_PLATMOD_OBJS:%=$(OBJS_DIR)/%) +LINTS = $(MONTOYA_PLATMOD_OBJS:%.o=$(LINTS_DIR)/%.ln) +ROOTMODULE = $(ROOT_MONTOYA_MISC_DIR)/$(MODULE) + +PLAT_DIR = . +HERE = ../platmod + +# +# Include common rules. +# +include $(UTSBASE)/sun4v/montoya/Makefile.montoya + +# +# Override defaults +# +CLEANFILES += $(PLATLIB) $(SYM_MOD) + +# +# Define targets +# +ALL_TARGET = $(SYM_MOD) +LINT_TARGET = $(MODULE).lint +INSTALL_TARGET = $(BINARY) $(ROOTMODULE) + +# +# Overrides +# +ALL_BUILDS = $(ALL_BUILDSONLY64) +DEF_BUILDS = $(DEF_BUILDSONLY64) +CLEANLINTFILES += $(LINT32_FILES) + +# +# lint pass one enforcement +# +CFLAGS += $(CCVERBOSE) + +# +# Default build targets. +# +.KEEP_STATE: + +def: $(DEF_DEPS) + +all: $(ALL_DEPS) + +clean: $(CLEAN_DEPS) + +clobber: $(CLOBBER_DEPS) + +lint: $(LINT_DEPS) + +modlintlib: $(MODLINTLIB_DEPS) + +clean.lint: $(CLEAN_LINT_DEPS) + +install: $(INSTALL_DEPS) + +check: + +LINT_LIB_DIR =$(MONTOYA_LINT_LIB_DIR) + +$(PLATLIB): $(BINARY) + $(BUILD.SO) $(BINARY) + +$(SYM_MOD): $(UNIX_O) $(PLATLIB) + @echo "resolving symbols against unix.o" + @(cd $(UNIX_DIR); pwd; \ + PLAT_DIR=$(HERE) SYM_MOD=$(HERE)/$(SYM_MOD) $(MAKE) symcheck) + +# +# Include common targets. +# +include $(UTSBASE)/sun4v/montoya/Makefile.targ |