aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-08-13fsp/rtc: Change properties used to advertize TPOBenjamin Herrenschmidt1-2/+1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13fsp/tpo: Enable Timed power on (TPO) supportMamatha Inamdar3-4/+149
This patch enabled TPO sequence handling in Sapphire. Timed power on notification comes from the user through set_poweron_time tool. After receiving a valid TPO from user, Sapphire sends a request to FSP through maibox command to set TPO. FSP will set TPO and power on the system as per the TPO set by the user. [ Removed global read_data, removed writing to NULL pointers, fixed a couple of memory leaks ... --BenH ] Signed-off-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13Add cpu_relax to stop cores spinning hardJoel Stanley3-4/+22
Ensure a thread is not stopping its siblings from making forward progress when we are busy-waiting on older DD1.x CPU revisions where SMT priorities are somewhat broken. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13elog: Do not compare elog size in read pathVasant Hegde1-4/+9
Linux can request for lesser bytes than actual elog size. Also make sure Linux is not requesting more than elog size. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13Fix gitid generation when not in a git repositoryJoel Stanley1-1/+3
If skiboot doesn't live in a git repository, the makefile will go searching up the directory tree for one. To save confusion, only look in the source tree for the git repository. The gitid can be overridden by passing GIT_SHA=foo as an argument to make. This is useful for doing builds outside of a git tree, as buildroot does. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13plat/palmetto: Add shutdown and rebootJoel Stanley3-0/+54
Rebooting and power down for the Palmetto is done by the BMC, which we speak to over the BT interface using IPMI. Implement the IPMI chassis commands which are used for power control, and hook them up to the palmetto platform callbacks for shutdown and reboot. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13plat/palmetto: Initialise BT/IPMI interface on PalmettoAlistair Popple1-1/+33
This patch adds a device tree entry for the BT interface on Palmetto and a call to initialise the BT/IPMI driver to allow interaction with the BMC via IPMI commands. [ Minor changes to device-tree representation -- BenH ] Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13ipmi: Add a base IPMI stack with a BT driverAlistair Popple6-2/+544
This patch adds a basic IPMI layer to the sapphire core and support for a BT IPMI interface as found on the Aspeed BMC of the Palmetto platform [ Changed the compatible property -- BenH ] Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-11occ: Increase wait time to 60s for OCC to initVaidyanathan Srinivasan1-1/+1
OCC F/w team recommends 60s timeout waiting for OCC to init. OCC has to wait for memory throttle calibration from hardware procedure and that takes 10s of seconds on large memory configurations. In one of the failing case, it took 24s for OCC to init. Typically OCC takes 2-5 secs to boot and we do that in parallel with skiboot inits. But on certain corner cases with large memory, we have to wait for 60s before we give up. Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08surv: Cleanup log outputBenjamin Herrenschmidt1-4/+6
Don't add timestamps, the core printf does it now Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08lock: Fix races when setting in_con_lockBenjamin Herrenschmidt4-1/+23
When setting the flag in a lock that indicates that it's on the console path, we need to take and release that lock to ensure that any other processor that might have taken it before the flag was set has released it, otherwise the lock might still be held without the console count properly incremented, which can cause it to go negative or cause the deadlock that we mean to avoid by that to still occur. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08pci: Improve logging format and log levelsBenjamin Herrenschmidt2-61/+80
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Add fake RTC to generic platformmillerjo@us.ibm.com4-1/+74
Adds a fake RTC that can be initialized via a named reserve in the device tree that may, at some point, be on NVRAM. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08PCI: Restore bus numbers after complete resetGavin Shan6-10/+72
The complete reset could be issued by kdump kernel to remove pending PCI traffic in order to avoid EEH errors in kdump scenario. However, the bus numbers configured into PCI bridges would be lost after the reset and it would cause that some of PCI devices (e.g. IPR) can't be probed by kdump kernel successfully. The patch fixes above issue by restoring bus numbers after complete reset. It's responsing to bug#113210 Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08PCI: Support parallel scanningGavin Shan1-18/+50
Currently, the tasks of scanning PHBs are done on master CPU one by one. The patch intends to do same tasks on multiple CPUs in order to save booting time with help of additional flags to PHB. With the patch applied, we saves 22 seconds the tasks to reset and scan 8 PHBs on one P8 box from 37 seconds to 15 seconds. NOTE: the printed logs during PCI enumeration should include PHB index to be self-explaining enough. I'll fix it later. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08PCI: Split slot reset and scanGavin Shan1-20/+38
As Rolf reported, 2 downstream ports from different PHBs are connected to same physical bridge, which supports virtual "partitioned" functionalities. Fundamental reset issued on one PHB affects the functionality used by another PHB during PCI enumeration. Eventually, we can't detect the functionality and all devices behind it on one of two PHBs. The patch splits PCI enumeration to reset all PHBs and then scan them one by one to avoid above issue. Also, the patch replaces PCI_MAX_PHBs with ARRAY_SIZE, which is used heavily. Reported-by: Rolf Brudeseth <rolfb@us.ibm.com> Suggested-by: Benjamin Herrenschmidt <benh@au1.ibm.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Pretty print objcopy in build outputJoel Stanley1-1/+1
The objcopy call was the odd one out in our build output. Before: [LD] hw/built-in.o [LD] skiboot.elf powerpc-linux-gnu-objcopy -O binary -S skiboot.elf skiboot.lid [NM] skiboot.map After: [LD] hw/built-in.o [LD] skiboot.elf [OBJCOPY] skiboot.lid [NM] skiboot.map Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08FSP: Make mbx error messages more verboseAnanth N Mavinakayanahalli1-5/+6
... helps figure out what the cause of the failure was. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Preliminary in-tree documentation for console-log.Stewart Smith1-0/+60
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Make log level thresholds dynamic in debug_descriptor rather than staticStewart Smith3-2/+25
This enables (advanced) users to vary what level of output they want at runtime in the memory console and through console drivers (fsp/uart) You can vary two things by poking in the debug descriptor: a) what log level is printed at all e.g. only turn on PR_TRACE at specific points during runtime b) what log level goes out the fsp/uart console defaults to PR_PRINTF We use two 4bit numbers (1 byte) for this in debug descriptor (saving some space, not needlessly wasting space that we may want in future). The default is 0x75 (7=PR_DEBUG to in memory console, 5=PR_PRINTF to drivers) If you write 0x77 you will get debug info on uart/fsp console as well as in memory. If you write 0x95 you get PR_INSANE in memory but still only PR_NOTICE through drivers. People who write something like 0x1f will get a very quiet boot indeed. A future patch would be to (when possible) peek at device tree entries for if we should change the default. A future patch would add an OPAL API to get/set this. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Write log messages with log_level > PR_NOTICE only to in memory logStewart Smith4-15/+36
We modify write() (adding console_write()) which calls down to a modified __flush_console() which can now decide if it's flushing the added console contents to the console drivers or not. A future patch may add support for changing PR_NOTICE to some other level Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Trivial typo fix: case -> causeStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Use PR_EMERG priority in assert() codepathStewart Smith3-24/+7
Moving assert_fail() out of libc and into core/utils.c so that we can sanely call prlog(PR_EMERG). We shorten it from three fputs calls down to one prlog() call. This may increase the number of cycles and stack usage for when we hit an assert, which may not be desirable. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Use PR_EMERG priority in (part of) assert()Stewart Smith1-1/+1
When handling assert and we're going to fail, get the message out with a high priority. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Use PR_EMERG log priority when printing backtraceStewart Smith1-1/+1
If we're printing a backtrace, things have probably gone horribly, horribly wrong - highest log priority. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Use single printf call per FSP LED rather than multipleStewart Smith1-10/+22
Means that we print things correctly in console log with timestamps. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Use small macros for PHB debug/log messagesStewart Smith3-59/+14
Save stack space, remove code and improve logging all in one handy patch. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Build with -ffreestanding so we can override printfStewart Smith1-3/+3
It turns out that GCC will use a builtin printf implementation that directly wraps vfprintf (or something), so when I tried to do my neat trick of overriding printf() with a call to vprlog() adding the timebase and default log level to the log message, it wouldn't work as GCC was being helpful. This change to compiler options will mean that other places where GCC is being helpful and using builtins rather than our implementations will go away, potentially helping/hurting us. We probably want to build with -ffreestanding anyway though. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08add full suite of log priorities: EMERG through DEBUGStewart Smith1-3/+13
The idea is to use prlog(PR_EMERG|PR_ALERT|...|PR_WARNING|..|PR_TRACE) instead of random printf() calls, so that they can be properly filtered for different console implementations (may only want trace level calls in memory console rather than over serial port). We remap PR_PRINTF to PR_NOTICE (5) rather than the absolute value 5. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08replace printf() with console log, level 5 aka INFO messagesStewart Smith4-28/+14
Replace the libc printf implementation with a wrapper that does fancy log things such as display timestamp and the log level. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08Initial code for timestamps in logStewart Smith3-1/+57
This is the initial patch for having timestamps in the log. It currently only wraps prerror to our prlog() function and thus only (very slightly) modifies bootup log. we use the timebase as an indication of the progression of time. It is not perfect, and is indeed reset back to zero during boot, but it should serve adequately for our needs of "approximately this much time elapsed between log entries". Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-08ELOG: Make sure we do not cross read buffer sizeVasant Hegde1-0/+7
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01ATTN: Set up attention area to handle attentionAruna Balakrishnaiah10-2/+342
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-08-01slw: Extend opal_slw_set_reg to all supported sprsShreyas B. Prabhu1-17/+26
Commit 95932150: "slw: patch hsprg0 for wakeup from winkle" added OPAL call for HSPRG0 to be patched via slw. Extend it to all the sprs supported in libpore. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01epow: Change how the old and the new system epow status are maintainedAnshuman Khandual1-2/+7
This patch changes the way how the old and the new system epow status are maintained. After receiving FSP EPOW async message, only reset those parts of system EPOW status which will be updated with the new FSP async message. This patch also fixes a problem with comparing the contents of the new and the old system EPOW status. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01epow: Fix mbox command encoding to remove FSP orphan responsesAnshuman Khandual2-3/+13
This patch changes the EPOW related mbox commands encoding to make sure FSP message response structure is allocated. So that when the command returns from FSP, it can be handled appropriately and orphan response will not be logged. This also adds some more in-code documentation explaining why panel status request based handshaking is required with the FSP. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01epow: Change the logging of the FSP async messagesAnshuman Khandual1-9/+29
Right now, all the FSP initiated EPOW messages get logged. SPCN configuration change message comes as part of the extended 1 panel status type of FSP message all the time and fills up the log buffer like the following. ------------Sapphire log--------------- EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP EPOW: Received extended 1 EPOW from FSP --------------------------------------- Even without being acted upon, SPCN configuration change does not take down the system. With this patch only the messages, which need to be acted upon will get logged. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01idle: Make idle flags endian safePreeti U Murthy1-3/+4
The idle flag IDLE_LOSE_HYP_CONTEXT can be wrongly interpreted for IDLE_USE_INST_SLEEP if the kernel has endian bug, which would incorrectly enable fastsleep even though the device tree does not advertise it. Unfortunately, some kernels currently do have such a bug. Additionally, current fastsleep wakeup path makes opal calls to sync timebase which is not endian safe. This can lead to checkstops. Hence for now change the bits used in IDLE_LOSE_HYP_CONTEXT to avoid misinterpretation with IDLE_USE_INST_SLEEP in LE kernels. Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Improve error loggingVasant Hegde2-12/+27
Add informational event in add dump region path. Also change the severity of the existing elog event. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Add OPAL interface to unregister dump regionVasant Hegde2-1/+34
Add OPAL interface to remove host memory region from SYSDUMP. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Add OPAL interface to register host memory regionVasant Hegde3-2/+59
Add OPAL interface to add host memory region to SYSDUMP. [ Added exported IDs in opal.h --BenH ] Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Check for duplicate dump region entryVasant Hegde1-0/+41
Presently we assume that we don't try to add new entry with same ID again. But when we add OPAL interface we may get new entry with same ID again (like when host does kexec). This patch checks and removes old entry before adding new entry with same ID. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Validate TCE alignmentVasant Hegde2-18/+82
We assumed that we always get TCE aligned address and size. But its possible that we may non-aligned address (specially when we add OPAL interface. This patch adds TCE validation. Also defer TCE mapping until we make MBOX command. This is required when we add OPAL interface. Ended up introducing new variable to hold real address and size. 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 Hegde3-16/+16
- 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-31epow: Move fsp-epow.h to hw/fsp/Benjamin Herrenschmidt2-1/+2
This is not used globally Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31slw: Don't enable fast sleep on Venice DD1.x even if HB says it's thereBenjamin Herrenschmidt1-3/+4
It's broken on all DD1.x chips. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30core: Fix licence header in hmi.cBenjamin Herrenschmidt1-6/+15
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30libflash: Fix licence header in ffs.hBenjamin Herrenschmidt1-22/+0
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30epow: Fix licence header in fsp-epow.hBenjamin Herrenschmidt1-7/+14
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-30epow: Fix licence header in fsp-epow.cBenjamin Herrenschmidt1-6/+15
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>