aboutsummaryrefslogtreecommitdiff
path: root/hdata
AgeCommit message (Collapse)AuthorFilesLines
2015-07-17hdata/paca: Check for dt_find_property() return valueKamalesh Babulal1-0/+3
dt_find_property() might return NULL. In handle_capp_recoverable, check for return value, before dereferencing it. Fixes Coverity defect#97844. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-17hdata/paca: Check for dt_find_property() return valueKamalesh Babulal1-2/+7
dt_find_property() might return NULL. In __paca_parse(), check for return value, before dereferencing it. Also fix trailing white spaces. Fixes Coverity defect#97842. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-17hdata/memory: Introduce zalloc() return checkKamalesh Babulal1-0/+4
In add_size_to_ram_area(), Introduce check for memory allocation failure, before using it. Fixes Coverity defect#97840. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-10find_shared() - Check for return value from dt_find_propertyKamalesh Babulal1-2/+5
In find_shared(), dt_find_property might return NULL value, so check for validity of the pointer before dereferencing it. Fixes Coverity defect#97846. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-10fsp_create_node(): Fix resource leakKamalesh Babulal1-2/+4
Fix memory leak by free-ing 'links'. Also, fix trailing white spaces. Fixes Coverity defect#98816. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-08Fix potential negative loop bound in hdata/pcia.cStewart Smith1-3/+5
HDIF_get_iarray_size could return -1 on failure, so detect that and somewhat gracefully back out of an awful loop Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-07hdata test: Check the return value from lseekKamalesh Babulal1-1/+3
Check if value returned by lseek is non-negative, as we will be passing it mmap. Fix it up, by aborting on negative value. Fixes Coverity defect#98808. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: fix spira_heap_size type] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-19Fix NULL pointer dereferenceAnanth N Mavinakayanahalli1-0/+6
Fix NULL pointer dereference in paca.c Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> V2: Use CHECK_SPPTR instead of NULL Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-09hdata/memory: Add dimm frequency informationNeelesh Gupta1-2/+52
Fetch the memory bus frequency present in PCIA area and add this information to the memory node. ms-dimm@d000 { [...] description = "32GB CDIMM"; ibm,loc-code = "U78C9.001.WZS03HU-P1-C16"; ibm,memory-bus-frequency = <0x0 0x5f5e1000>; serial-number = "YH10M147C1L1"; fru-type = [4d 53]; [...] }; Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-20hdata: Remove unnecessary boolNeelesh Gupta1-4/+1
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-20hdata: Fix memory leakNeelesh Gupta1-3/+5
Fix leak and avoid repeated call to the same function Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-12Add pr_fmt to do printf/prlog prefixing automagicallyStewart Smith1-2/+7
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07Fixup hdata test for fsp LID preloadingStewart Smith2-1/+4
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07hdata/vpd: Add compatible propertyVasant Hegde1-0/+1
That way user space tools can identify the change in VPD layout etc. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07hdata/vpd: Improve error loggingVasant Hegde1-3/+16
Populate CCIN description and model-name property as "Unknown" if its not available (say new system model, etc). That way device tree will be consistent. Also improve error logging. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07FSP/hdata: Populate System Attention Indicator location codeVasant Hegde4-0/+84
On FSP based machine, FSP controls System Attention Indicator. This indicator detail (location code) is passed to OPAL via HDAT. OPAL can get/set this indicator via normal MBOX command. This patch takes care of parsing SLCA entry and populating device tree with SAI location code. Device Tree: We create '/ibm,opal/led' node which contains all location code LED information. 'led-types' property under each node tells LED type. For SAI indicator 'led-types' property will be 'attention'. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07hdata: Detect LED mode and populate device treeVasant Hegde2-0/+13
FSP based machine supports two different LED modes: - Light Path : Both identify and fault LEDs are supported - Guiding Light: Only identify LEDs are supported And this information is passed to OPAL via HDAT. Lets parse this and populate the device tree. Later LED driver uses this information to populate indivisual LED node. Device Tree property: /ibm,opal/led/led-mode : lightpath/guidinglight Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07hdata: Create LED nodeVasant Hegde1-0/+20
Unfortunately we do not have single place to get all LED related information (Some of the information is passed via HDAT and rest via MBOX command). Lets create led node before parsing HDAT and use this node to populate all LED related information. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-04-09Add Naples chip supportBenjamin Herrenschmidt2-0/+2
This adds the PVR and CFAM ID for the Naples chip. Otherwise treated as a Venice. This doesn't add the definitions for the new PHB revision yet Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-24Asynchronous LID/Resource loading for FSP systemsStewart Smith1-1/+1
This moves away from using fsp_sync_msg in fsp_fetch_data and instead using the platform hooks for start_preload_resource() to actually queue up a load and having the plumbing for checking if a resource is loaded yet. This gets rid of the "pollers called with locks held" warning we got heaps of previously. You can now boot some FSP systems without getting this warning at all. This also sets the stage for starting load of LIDs much earlier to when they're needed, improving boot time. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-17hdata: Fix location code sizeVasant Hegde1-2/+2
Location codes are no more than 80 characters (including terminating NULL char). Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-17hdata: Convert printf based log messages to prlog based logsVasant Hegde1-3/+5
This patch changes all printf based log messages in the hdata/slca code to prlog based log messages. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-11vpd: Use slca parent-child relationship to create vpd treeNeelesh Gupta2-142/+77
SLCA entries available through hdat have parent-child relationship of various FRUs of the system, the patch makes use of this data to create VPD nodes in hierarchial fashion. This is further useful for the user space tools like 'lshw'/'lsvpd' to plug-in the support easily on POWER. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-01-21Make building of hdata unit tests quietStewart Smith1-2/+2
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-15Fix makefile dependency generation, especially for HOSTCCStewart Smith1-0/+2
Instead of having individual rules to generate .d, add -MMD to HOSTCC parameters, and just include the generated .d files. This fixes a few weird dependency issues. Also, make the mambo hello_kernel test depend on skiboot.lid Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-10Fix bug/warning in hdata/memory.c I introduced in f1a3a19Stewart Smith1-2/+3
Passing the wrong parameter to snprintf (sizeof(char*)) rather than actual length of the string. GCC 4.9 told us about it (and broke make check when I enabled -Werror) hdata/test/../memory.c: In function ‘add_address_range’: hdata/test/../memory.c:144:23: error: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05Fix warning of potential unbound stack usage in hdata/memory.cStewart Smith1-1/+5
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05Silence warning for hdata/tests/stubs.c prlog missing prototypeStewart Smith1-1/+3
We get the real prototype in real code from skiboot.h Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28Remove sprintf: there's no good reason to have this in firmwareStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-18Remove useless global include memory.hBenjamin Herrenschmidt4-3/+1
It only exposed one function that is local to the hdat stuff Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-05hdat: Add Venice hub ID to HDAT conversionBenjamin Herrenschmidt1-5/+9
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-15Reduce severity of hdata/fsp.c log messages (mostly to PR_DEBUG)Stewart Smith1-7/+8
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Rework hdata/iohub.c CEC log messages to appropriate log levelsStewart Smith1-54/+69
We're mostly PR_DEBUG here, except for the basics, which are PR_INFO. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Increase verbosity of CHIPTOD to PR_DEBUGStewart Smith1-3/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Reduce severity of XSCOM detection log message to PR_INFOStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15bump last two hdata/memory.c MS VPD printouts to PR_DEBUGStewart Smith1-4/+5
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15hdata/memory.c: only prlog with PR_DEBUG most thingsStewart Smith1-8/+8
We will PR_INFO the total amount of memory, as this is just informative. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Only print SPIRA discovered serial port info at PR_INFO priorityStewart Smith1-3/+3
It's certainly not an error that we have a serial port, and not essential to display during boot. Odds are, you already know about the serial port. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15decrease verbosity of logging CPU information.Stewart Smith2-17/+18
If we have an UNAVAILABLE core (e.g. garded by FSP), we *WILL* print that out with PR_WARNING, as that's probably something that people want to pay attention to. Otherwise we stick with PR_INFO, which should be enough for these kind of log messages. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Reduce the amount of text 'parsing hdat' uses.Stewart Smith1-9/+3
We can, by default, deal with just two lines rather than 5 of ASCII art Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-08-15hdata/test: Fix broken testsJoel Stanley2-1/+5
Commit e810dcbc (ATTN: Set up attention area to handle attention) broke tests, as the familiy of CPU_TO_BEXX macros are not compile time constant. hdata/test/../spira.c:60:4: error: initializer element is not constant .addr = CPU_TO_BE64((unsigned long)&(cpu_ctl_spat_area) + SKIBOOT_BASE) There is no test coverage of this code, so for now we can comment out these areas in order to allow the tests to pass. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-15{core,hdata}/test: Add prlog to stubJoel Stanley1-1/+12
We are missing a prlog for tests. This adds a dumb version that ignores the log level and uses printf to display all messages. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01ATTN: Set up attention area to handle attentionAruna Balakrishnaiah2-0/+68
At present CPU control area ntuple in SPIRA structure is NULL. ATTN component in Service Processor side checks for this field and if its empty, it logs hardcoded SRC (0xBB821410) and generates SYSDUMP. So we have 1 SRC for all failure (assert call) from OPAL side. This makes difficult to debug the issue. Service processor provides attention area interface (FIPS PHyp Attentions spec), so that we can pass SRC and user data (error message) to service processor. This will helps us identify different failures in OPAL. This patch enables attention area and provides interface (update_sp_attn_area()) to add src and user data (error message) through assert macro. Attention SRC format: 1st byte - Opal src type 2-4 bytes - Holds the address of the assert function call Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Rename function name and variable orderVasant Hegde1-2/+2
- Better function naming - Better macro naming - Re-ordered function variables - calculate max_mdst_entry after allocating memory for mdst table. No change in functionality. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt19-0/+5657
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>