memory.c revision 03831d35f7499c87d51205817c93e9a8d42c4bae
0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License, Version 1.0 only 0N/A * (the "License"). You may not use this file except in compliance 0N/A * See the License for the specific language governing permissions 0N/A * and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 0N/A * Copyright (c) 1999-2001 by Sun Microsystems, Inc. 0N/A * All rights reserved. 392N/A#
pragma ident "%Z%%M% %I% %E% SMI" * Used for US-I and US-II systems * This function is intentionally blank * The following functions are for use by any US-III based systems. * All they need to do is to call get_us3_mem_regs() * and then display_us3_banks(). Each platform then needs to decide how * to format this data by over-riding the generic function * print_us3_memory_line(). /* Get portid of this mc from libdevinfo. */ /* read the logical_bank_ma_regs property for this mc node. */ * There are situations where a memory-controller node * will not have the logical_bank_ma_regs property and * we need to allow for these cases. They include: * support memory on one of their CPUs. * - Systems that support DR where a cpu board * can be unconfigured but still connected. * It is up to the caller of this function to ensure * that the bank_head and seg_head pointers are not * NULL after processing all memory-controllers in the * system. This would indicate a situation where no * memory-controllers in the system have a logical_bank_ma_regs * property which should never happen. * The first NUM_MBANKS_PER_MC of uint64_t's in the * logical_bank_ma_regs property are the madr values. * Get the bank_status property for this mem controller from * OBP. This contains the bank-status for each logical bank. * process each logical bank * Get the bank-status string for this bank * from the bank_status_array we just retrieved * from OBP. If the prop was not found, we * malloc a bank_status and set it to "no_status". /* Move offset to next bank_status string */ * create a bank_node for this bank * and add it to the list. * find the segment to which this bank * belongs. If it doesn't already exist * then create it. If it exists, add to it. /* Handle the first bank found */ /* find last bank in list */ /* insert this bank into the list */ * Interleave factor is determined from the * lk bits in the Mem Addr Decode register. * The Base Address of the memory segment in which this * bank belongs is determined from the um abd uk bits * of the Mem Addr Decode register. * See section 9.1.5 of Cheetah Programmer's reference /* If bank is not valid, set size to zero incase it's garbage */ * Keep track of all banks found so we can check later * that this value matches the total memory in the * system using the pagesize and number of pages. /* Find the matching segment for this bank. */ * Find the Dimm size by adding banks 0 + 2 and divide by 4 * and then adding banks 1 + 3 and divide by 4. We divide * by 2 if one of the logical banks size is zero. /* have bank0_size, need bank2_size */ /* Is next bank on the same mc ? */ /* have bank1_size, need bank3_size */ /* Is next bank on the same mc ? */ /* have bank0_size and bank2_size */ /* have bank1_size and bank3_size */ * Call platform specific code for formatting memory * Sanity check to ensure that the total amount of system * memory matches the total number of memory banks that * we find here. Scream if there is a mis-match. "\nError: total bank size [%lldMB] does not match total " * This bank is part of a new segment, so create * a struct for it and added to the list of segments * add bank into segs bank list. Note we add at the head "\n No print_us3_memory_line() function specified for" * check to see if the bank is invalid and also * check if the bank_status is unpopulated. Unpopulated * means the bank is empty. "Failed Field Replaceable Units (FRU) in " "====================\n", 0);
* Call platform specific code for formatting memory "\n No print_us3_failed_memory_line() function specified for"