/*
* 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
* 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"
/*
* sun4u root nexus driver
*/
#include <sys/sysiosbus.h>
#include <sys/ddi_subrdefs.h>
/* Useful debugging Stuff */
#include <sys/nexusdebug.h>
/*
* Extern declarations
*/
extern uint_t root_phys_addr_lo_mask;
/*
* config information
*/
int
int
int
/*
* rootnex_add_intr_impl:
*/
/*ARGSUSED*/
int
{
"upa-interrupt-slave", 0) != 0) {
/* Give slave devices pri of 5. e.g. fb's */
}
/*
* Translate the interrupt property by stuffing in the
* portid for those devices which have a portid.
*/
}
/*
* Hack to support the UPA slave devices before the 1275
* support for imap was introduced.
*/
slave = 1;
extern uint64_t *get_intr_mapping_reg(int, int);
if ((intr_mapping_reg = get_intr_mapping_reg(
return (DDI_FAILURE);
} else
return (DDI_FAILURE);
}
return (ret);
/*
* Hack to support the UPA slave devices before the 1275
* support for imap was introduced.
*/
if (slave) {
/*
* Program the interrupt mapping register.
* Interrupts from the slave UPA devices are
* directed at the boot CPU until it is known
* that they can be safely redirected while
* running under load.
*/
/* Set the mapping register */
/* Flush write buffers */
}
return (ret);
}
/*
* rootnex_remove_intr_impl:
*/
/*ARGSUSED*/
int
{
int len;
/*
* Translate the interrupt property by stuffing in the
* portid for those devices which have a portid.
*/
}
/*
* Hack to support the UPA slave devices before the 1275
* support for imap was introduced.
*/
extern uint64_t *get_intr_mapping_reg(int, int);
if ((intr_mapping_reg = get_intr_mapping_reg(
return (DDI_SUCCESS);
/* Clear the mapping register */
*intr_mapping_reg = 0x0ull;
/* Flush write buffers */
#ifdef lint
#endif /* lint */
}
}
return (DDI_SUCCESS);
}
/*
* rootnex_get_intr_pri:
*/
/*ARGSUSED*/
int
{
"upa-portid", -1) != -1) {
"upa-interrupt-slave", 0) != 0) {
/* Give slave devices pri of 5. e.g. fb's */
pri = 5;
}
}
return (pri);
}
int
{
char *p = buf;
register int n;
int portid;
int nodeid;
p += strlen(p);
if ((n = sparc_pd_getnreg(dev)) > 0) {
(void) strcpy(p, ": ");
p += strlen(p);
/*
* This stuff needs to be fixed correctly for the FFB
* devices and the UPA add-on devices.
*/
if (portid != -1)
(void) sprintf(p, "UPA 0x%x 0x%x%s",
else {
printf("could not find portid "
"or nodeid property in %s\n",
if (portid != -1)
(void) sprintf(p, "SAFARI 0x%x 0x%x%s",
rp->regspec_addr &
(n > 1 ? "" : " ..."));
if (nodeid != -1)
}
p += strlen(p);
}
/*
* This is where we need to print out the interrupt specifications
* for the FFB device and any UPA add-on devices. Not sure how to
* do this yet?
*/
return (DDI_SUCCESS);
}
int
{
char *node_name;
extern uint_t root_phys_addr_lo_mask;
extern void make_ddi_ppd(
dev_info_t *, struct ddi_parent_private_data **);
/*
* Fill in parent-private data and this function returns to us
* an indication if it used "registers" to fill in the data.
*/
}
/*
* No reg property, return null string as address (e.g. pseudo)
*/
name[0] = '\0';
if (sparc_pd_getnreg(child) == 0) {
return (DDI_SUCCESS);
}
/*
* Create portid property for fhc node under root(/fhc).
*/
#ifdef _STARFIRE
#else
#endif
/*
* The port-id must go on the hardware property list,
* otherwise, initchild may fail.
*/
portid) != DDI_SUCCESS)
"Error in creating upa-portid property for fhc.\n");
}
/*
* Name node on behalf of child nexus.
*/
return (DDI_SUCCESS);
}
/*
* On sun4u, the 'name' of children of the root node
* is foo@<upa-mid>,<offset>, which is derived from,
* but not identical to the physical address.
*/
if (portid == -1)
/*
* Do not log message, to handle cases where OBP version
* does not have "portid" property for the root i2c node.
*
* Platforms supporting root i2c node (potentially without
* "portid" property) are :
* SunBlade 1500, SunBlade 2500, V240, V250
*/
"could not find portid or nodeid property in %s\n",
if (nodeid != -1)
else
return (DDI_SUCCESS);
}
int
{
/* Name the child */
/*
* Try to merge .conf node. If merge is successful, return
* DDI_FAILURE to allow caller to remove this node.
*/
if (ndi_dev_is_persistent_node(dip) == 0 &&
(void) rootnex_ctl_uninitchild(dip);
return (DDI_FAILURE);
}
/*
* If there are no "reg"s in the child node, return.
*/
return (DDI_SUCCESS);
/*
* If this is a slave device sitting on the UPA, we assume that
* This device can accept DMA accesses from other devices. We need
* to register this fact with the system by using the highest
* and lowest physical pfns of the devices register space. This
* will then represent a physical block of addresses that are valid
* for DMA accesses.
*/
"upa-interrupt-slave", 0)) {
int i;
/* Scan the devices highest and lowest physical pfns */
addr = (unsigned long long)((unsigned long long)
}
}
return (DDI_SUCCESS);
}
void
{
"upa-interrupt-slave", 0))) {
extern void pf_unset_dmacapable(pfn_t);
unsigned long long addr;
addr = (unsigned long long) ((unsigned long long)
}
}