sbdp_mem.c revision 8c754b1b0941ce71249cc956888b3470525b995f
d9ad96c1d1e6612641c338d86699f5700fca7217rg * CDDL HEADER START
d9ad96c1d1e6612641c338d86699f5700fca7217rg * The contents of this file are subject to the terms of the
48a344074403d73a2e38d76ad47299c16c89e0dcrmesta * Common Development and Distribution License (the "License").
48a344074403d73a2e38d76ad47299c16c89e0dcrmesta * You may not use this file except in compliance with the License.
d9ad96c1d1e6612641c338d86699f5700fca7217rg * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d9ad96c1d1e6612641c338d86699f5700fca7217rg * See the License for the specific language governing permissions
d9ad96c1d1e6612641c338d86699f5700fca7217rg * and limitations under the License.
d9ad96c1d1e6612641c338d86699f5700fca7217rg * When distributing Covered Code, include this CDDL HEADER in each
d9ad96c1d1e6612641c338d86699f5700fca7217rg * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d9ad96c1d1e6612641c338d86699f5700fca7217rg * If applicable, add the following below this CDDL HEADER, with the
d9ad96c1d1e6612641c338d86699f5700fca7217rg * fields enclosed by brackets "[]" replaced with your own identifying
d9ad96c1d1e6612641c338d86699f5700fca7217rg * information: Portions Copyright [yyyy] [name of copyright owner]
d9ad96c1d1e6612641c338d86699f5700fca7217rg * CDDL HEADER END
d9ad96c1d1e6612641c338d86699f5700fca7217rg * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
d9ad96c1d1e6612641c338d86699f5700fca7217rg * Use is subject to license terms.
d9ad96c1d1e6612641c338d86699f5700fca7217rg#pragma ident "%Z%%M% %I% %E% SMI"
d9ad96c1d1e6612641c338d86699f5700fca7217rg * memory management for serengeti dr memory
d9ad96c1d1e6612641c338d86699f5700fca7217rgstatic int sbdp_get_meminfo(pnode_t, int, uint64_t *, uint64_t *);
d9ad96c1d1e6612641c338d86699f5700fca7217rgstatic void _sbdp_copy_rename_end(void);
d9ad96c1d1e6612641c338d86699f5700fca7217rgstatic int sbdp_copy_rename__relocatable(sbdp_cr_handle_t *,
d9ad96c1d1e6612641c338d86699f5700fca7217rgstatic int sbdp_get_lowest_addr_in_node(pnode_t, uint64_t *);
d9ad96c1d1e6612641c338d86699f5700fca7217rgextern void flush_ecache_il(uint64_t physaddr, size_t size, size_t linesize);
d9ad96c1d1e6612641c338d86699f5700fca7217rgextern void sbdp_exec_script_il(sbdp_rename_script_t *rsp);
d9ad96c1d1e6612641c338d86699f5700fca7217rgint sbdp_add_nodes_banks(pnode_t node, sbdp_bank_t **banks);
d9ad96c1d1e6612641c338d86699f5700fca7217rg * Head to the system segments link list
int size;
return (SG_SLICE_16G_SIZE);
return (SG_SLICE_32G_SIZE);
return (SG_SLICE_64G_SIZE);
struct mem_arg {
int board;
int ndips;
return (DDI_FAILURE);
return (DDI_FAILURE);
if (dip) {
return (DDI_SUCCESS);
struct memlist *
int i, j, skip = 0;
size = 0;
for (j = 0; j < SBDP_MAX_MCS_PER_NODE; j++) {
skip++;
return (mlist);
struct memlist *
return (NULL);
return (hl);
int err = 0;
int *indexp;
int (*funcp)();
int linesize;
if (scriptlen <= 0) {
goto cleanup;
goto cleanup;
goto cleanup;
indexp[0] = 0;
goto cleanup;
goto cleanup;
switch (cr_err) {
case SBDP_CR_OK:
case SBDP_CR_MC_IDLE_ERR: {
if (err)
goto cleanup;
m = *index;
for (i = 0; i < SBDP_MAX_MCS_PER_NODE; i++) {
if (!inval) {
*index = m;
int len;
mc_node);
if (len < 0) {
cpu_node);
return (impl);
int portid;
for (i = 0; i < SBDP_MAX_MEM_NODES_PER_BOARD; i++) {
switch (impl) {
case CHEETAH_IMPL:
case CHEETAH_PLUS_IMPL:
case JAGUAR_IMPL:
for (j = 0; j < SBDP_MAX_MCS_PER_NODE; j++) {
(*b_idx)++;
case PANTHER_IMPL:
(*r_idx)++;
impl);
ASSERT(0);
sizeof (sbdp_mc_idle_script_t));
for (i = 0; i < nbanks; i++)
for (i = 0; i < nregs; i++)
for (i = 0; i < t_num; i++) {
for (i = 0; i < s_num; i++) {
for (i = 0; i < t_num; i++) {
for (i = 0; i < s_num; i++) {
#ifdef DEBUG
return (m * sizeof (sbdp_rename_script_t));
size = 0;
for (i = 0; i < SBDP_MCU_IDLE_RETRIES; i++) {
register uint64_t v;
register int n_idle = 0;
} while (v != MCU_ACT_STATUS &&
if (i == SBDP_MCU_IDLE_RETRIES) {
return (SBDP_CR_MC_IDLE_ERR);
isp++;
isp++;
return (err);
_sbdp_copy_rename_end(void)
#ifdef lint
#ifdef lint
#ifdef lint
int rc;
&tmp_pa) == 0) {
rc = 0;
if (rc == 0)
return (rc);
int i, valid;
int rc;
for (i = 0; i < SBDP_MAX_MCS_PER_NODE; i++) {
if (valid)
rc = 0;
if (rc == 0)
return (rc);
int bd;
int board;
int len;
return (DDI_FAILURE);
int wnode;
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_FAILURE);
int valid;
if (valid) {
int portid;
return (OBP_NONODE);
int wnode;
int bd;
int unit;
int portid;
return (SBD_COND_UNKNOWN);
for (i = 0; i < SBDP_MAX_CORES_PER_CMP; i++) {
return (cond);
int len;
int local_mc;
int portid;
local_mc = 0;
for (i = 0; i < SG_MAX_BANKS_PER_MC; i++) {
if (local_mc) {
int len;
int portid;
int local_mc;
local_mc = 0;
if (local_mc) {
return (addr);
if (size > 0) {
int rv;
if (rv != 0) {
int is_interleave = 0;
#ifdef DEBUG
return (is_interleave);
for (i = 0; i < SBDP_MAX_MCS_PER_NODE; i++) {
static int id = 0;
int i, nmem;
for (i = 0; i < nmem; i++) {
#ifdef DEBUG
sbdp_print_all_segs(void)
static int id = 0;
return (cur_seg);
#ifdef DEBUG
int c, neg = 0;
if (!isdigit(c = *p)) {
while (isspace(c))
neg++;
if (!isdigit(c)) {
*pos = p;
*pos = p;
return (neg ? n : -n);
int board, i;
char *opts;
int t_board;
if (scriptlen <= 0) {