summaryrefslogtreecommitdiffstats
path: root/src/usr/console
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/console')
-rw-r--r--src/usr/console/HBconfig4
-rw-r--r--src/usr/console/console.C109
-rw-r--r--src/usr/console/daemon.C116
-rw-r--r--src/usr/console/daemon.H39
-rw-r--r--src/usr/console/makefile33
-rw-r--r--src/usr/console/uart.C220
-rw-r--r--src/usr/console/uart.H163
-rw-r--r--src/usr/console/uartconfig.C44
8 files changed, 728 insertions, 0 deletions
diff --git a/src/usr/console/HBconfig b/src/usr/console/HBconfig
new file mode 100644
index 000000000..ee8885cbf
--- /dev/null
+++ b/src/usr/console/HBconfig
@@ -0,0 +1,4 @@
+config CONSOLE
+ default n
+ help
+ Enable console support.
diff --git a/src/usr/console/console.C b/src/usr/console/console.C
new file mode 100644
index 000000000..74f496f93
--- /dev/null
+++ b/src/usr/console/console.C
@@ -0,0 +1,109 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/console/console.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] International Business Machines Corp. */
+/* [+] Google Inc. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include <console/consoleif.H>
+#include <util/sprintf.H>
+#include <sys/msg.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <vector>
+#include "daemon.H"
+
+namespace CONSOLE
+{
+ msg_q_t g_msgq = msg_q_create();
+
+ void display(const char* str)
+ {
+ timespec_t time;
+ clock_gettime(CLOCK_MONOTONIC, &time);
+
+ msg_t* msg = msg_allocate();
+ msg->type = DISPLAY;
+ msg->data[0] = time.tv_sec;
+ msg->data[1] = time.tv_nsec;
+ msg->extra_data = strdup(str);
+ msg_send(g_msgq, msg);
+ }
+
+ void displayf(const char* header, const char* format, ...)
+ {
+ va_list args;
+ va_start(args, format);
+
+ vdisplayf(header, format, args);
+
+ va_end(args);
+ }
+
+ void vdisplayf(const char* header, const char* format, va_list args)
+ {
+ using Util::vasprintf;
+
+ class OutputBuffer : public Util::ConsoleBufferInterface
+ {
+ public:
+ int putc(int c)
+ {
+ str.push_back(c);
+ return c;
+ }
+
+ size_t operator()(int c) { return putc(c); }
+
+ std::vector<char> str;
+ };
+
+ OutputBuffer b;
+
+ if (header)
+ {
+ while(*header)
+ {
+ b.putc(*header);
+ header++;
+ }
+ b.putc('|');
+ }
+
+ vasprintf(b, format, args);
+ b.putc('\n');
+ b.putc('\0');
+
+ if (b.str.size())
+ {
+ display(&b.str[0]);
+ }
+ }
+
+ void flush()
+ {
+ msg_t* msg = msg_allocate();
+ msg->type = SYNC;
+ msg_sendrecv(g_msgq, msg);
+ }
+
+}
diff --git a/src/usr/console/daemon.C b/src/usr/console/daemon.C
new file mode 100644
index 000000000..a501920ff
--- /dev/null
+++ b/src/usr/console/daemon.C
@@ -0,0 +1,116 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/console/daemon.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] International Business Machines Corp. */
+/* [+] Google Inc. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include <stdio.h>
+#include <sys/msg.h>
+#include <sys/task.h>
+#include <sys/time.h>
+#include <initservice/taskargs.H>
+#include <initservice/initserviceif.H>
+#include "uart.H"
+#include "daemon.H"
+
+namespace CONSOLE
+{
+ extern msg_q_t g_msgq;
+
+ /* Display characters one at a time from string. */
+ void _display(const char* str)
+ {
+
+ while(*str)
+ {
+ // UART uses DOS-style new lines. "\r\n"
+ if (*str == '\n')
+ {
+ Uart::g_device->putc('\r');
+ }
+
+ Uart::g_device->putc(*str);
+
+ str++;
+ }
+ }
+
+ void* consoleDaemon(void* unused)
+ {
+ // Detach and register daemon with shutdown path.
+ task_detach();
+ INITSERVICE::registerShutdownEvent(g_msgq, SYNC,
+ INITSERVICE::CONSOLE_PRIORITY);
+
+ // Create a default output UART device if there isn't already one.
+ // - Some devices are registered via the CONSOLE_UART_DEFINE_DEVICE
+ // macro and therefore don't need this.
+ if (NULL == Uart::g_device)
+ {
+ Uart::g_device = new Uart();
+ Uart::g_device->initialize();
+ }
+
+ while(1)
+ {
+ msg_t* msg = msg_wait(g_msgq);
+
+ switch (msg->type)
+ {
+ case DISPLAY:
+ {
+ if (NULL != msg->extra_data)
+ {
+ char timestamp[11];
+ sprintf(timestamp, "%3d.%05d|",
+ msg->data[0],
+ // 5 Digits worth of ns.
+ (msg->data[1]*100000)/NS_PER_SEC);
+ _display(timestamp);
+
+ _display(
+ static_cast<const char*>(msg->extra_data));
+ free(msg->extra_data);
+ }
+ msg_free(msg);
+ break;
+ }
+
+ case SYNC:
+ {
+ msg_respond(g_msgq, msg);
+ break;
+ }
+ }
+
+ }
+
+ return NULL;
+ }
+
+ void consoleEntryPoint(errlHndl_t& o_errl)
+ {
+ task_create(&consoleDaemon, NULL);
+ }
+}
+
+TASK_ENTRY_MACRO(CONSOLE::consoleEntryPoint);
diff --git a/src/usr/console/daemon.H b/src/usr/console/daemon.H
new file mode 100644
index 000000000..02453a879
--- /dev/null
+++ b/src/usr/console/daemon.H
@@ -0,0 +1,39 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/console/daemon.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] International Business Machines Corp. */
+/* [+] Google Inc. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __CONSOLE_DAEMON_H
+#define __CONSOLE_DAEMON_H
+
+namespace CONSOLE
+{
+ /** Enumeration of IPC message types to daemon. */
+ enum ConsoleDaemonMessages
+ {
+ DISPLAY, //< Display a string to console.
+ SYNC //< Synchronization point to ensure console is flushed.
+ };
+}
+
+#endif
diff --git a/src/usr/console/makefile b/src/usr/console/makefile
new file mode 100644
index 000000000..8252fb17a
--- /dev/null
+++ b/src/usr/console/makefile
@@ -0,0 +1,33 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/console/makefile $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2014
+# [+] Google Inc.
+# [+] International Business Machines Corp.
+#
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# IBM_PROLOG_END_TAG
+ROOTPATH = ../../..
+MODULE = console
+
+OBJS += daemon.o
+OBJS += uart.o
+OBJS += uartconfig.o
+
+include $(ROOTPATH)/config.mk
diff --git a/src/usr/console/uart.C b/src/usr/console/uart.C
new file mode 100644
index 000000000..385a05cd9
--- /dev/null
+++ b/src/usr/console/uart.C
@@ -0,0 +1,220 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/console/uart.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] International Business Machines Corp. */
+/* [+] Google Inc. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include "uart.H"
+#include <devicefw/userif.H>
+#include <lpc/lpcif.H>
+#include <kernel/console.H>
+#include <sys/time.h>
+#include <errl/errlmanager.H>
+#include <hwas/common/hwasCallout.H>
+#include <console/console_reasoncodes.H>
+
+namespace CONSOLE
+{
+ void Uart::initialize()
+ {
+ using namespace UARTREGS;
+
+ errlHndl_t l_errl = NULL;
+
+ do
+ {
+ // Check for failure from superclass initalize call.
+ if (iv_failed) { break; }
+
+ // Clear line control reg.
+ l_errl = writeReg(LCR, 0x00);
+ if (l_errl) { break; }
+
+ // Check for existence of scratch register (and thus UART device).
+ {
+ const uint8_t value = 'h';
+ uint8_t data = 0;
+ l_errl = writeReg(SCR, value);
+ if (l_errl) { break; }
+ l_errl = readReg(SCR, data);
+ if (l_errl) { break; }
+
+ if (data != value)
+ {
+ printk("UART: Device not found.\n");
+ break;
+ }
+ }
+
+ // Reset interrupt register.
+ l_errl = writeReg(IER, 0);
+ if (l_errl) { break; }
+
+
+ // Set baud rate.
+ uint64_t divisor = (g_uartClock / 16) / g_uartBaud;
+ l_errl = writeReg(LCR, LCR_DLAB);
+ if (l_errl) { break; }
+ l_errl = writeReg(DLL, divisor & 0xff);
+ if (l_errl) { break; }
+ l_errl = writeReg(DLM, divisor >> 8);
+ if (l_errl) { break; }
+
+ // Set 8N1 mode.
+ l_errl = writeReg(LCR, LCR_DWL8 | LCR_NOP | LCR_STP1);
+ if (l_errl) { break; }
+
+ // Enable Request-to-send/Data-terminal-ready
+ l_errl = writeReg(MCR, MCR_RTS | MCR_DTR);
+ if (l_errl) { break; }
+
+ // Clear and enable FIFOs.
+ l_errl = writeReg(FCR, FCR_ENF | FCR_CLFR | FCR_CLFT);
+ if (l_errl) { break; }
+
+ // Found device.
+ printk("UART: Device initialized.\n");
+ iv_initialized = true;
+
+ } while(0);
+
+ if (l_errl)
+ {
+ iv_failed = true;
+ errlCommit(l_errl, CONSOLE_COMP_ID);
+ }
+ }
+
+ void Uart::putc(char c)
+ {
+ using namespace UARTREGS;
+
+ errlHndl_t l_errl = NULL;
+ do
+ {
+ if (iv_failed || !iv_initialized) { break; }
+
+ // Wait for transmit FIFO to have space.
+ {
+ const uint64_t DELAY_NS = 100;
+ const uint64_t DELAY_LOOPS = 10000;
+
+ uint8_t data = 0;
+ uint64_t loops = 0;
+
+ do
+ {
+ l_errl = readReg(LSR, data);
+ if (l_errl) { break; }
+
+ // Wait for idle or error status.
+ if (data == LSR_BAD || (data & LSR_THRE))
+ {
+ break;
+ }
+ nanosleep(0, DELAY_NS);
+
+ loops++;
+ } while( loops < DELAY_LOOPS);
+
+ if (l_errl)
+ {
+ printk("UART: Error state in xmit - LPC error.\n");
+ iv_failed = true;
+ break;
+ }
+ else if (data == LSR_BAD)
+ {
+ printk("UART: Error state in xmit - bad data.\n");
+ iv_failed = true;
+ /*@
+ * @errortype
+ * @moduleid CONSOLE::MOD_CONSOLE_UART_PUTC
+ * @reasoncode CONSOLE::RC_INVALID_DATA
+ * @devdesc Unexpected data from LPC-UART interface.
+ */
+ l_errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_PREDICTIVE,
+ CONSOLE::MOD_CONSOLE_UART_PUTC,
+ CONSOLE::RC_INVALID_DATA);
+ //@TODO: RTC:116090 - Should be BMC hardware.
+ l_errl->addProcedureCallout(HWAS::EPUB_PRC_LVL_SUPP,
+ HWAS::SRCI_PRIORITY_MED);
+ break;
+ }
+ else if (loops >= DELAY_LOOPS)
+ {
+ printk("UART: FIFO timeout.\n");
+ iv_failed = true;
+ /*@
+ * @errortype
+ * @moduleid CONSOLE::MOD_CONSOLE_UART_PUTC
+ * @reasoncode CONSOLE::RC_TIMEOUT
+ * @devdesc Timeout from LPC-UART interface.
+ */
+ l_errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_PREDICTIVE,
+ CONSOLE::MOD_CONSOLE_UART_PUTC,
+ CONSOLE::RC_TIMEOUT);
+ //@TODO: RTC:116090 - Should be BMC hardware.
+ l_errl->addProcedureCallout(HWAS::EPUB_PRC_LVL_SUPP,
+ HWAS::SRCI_PRIORITY_MED);
+ break;
+ }
+ }
+
+ // Write character to FIFO.
+ l_errl = writeReg(THR, c);
+
+ } while(0);
+
+ if (l_errl)
+ {
+ iv_failed = true;
+ errlCommit(l_errl, CONSOLE_COMP_ID);
+ }
+ return;
+ }
+
+ errlHndl_t Uart::writeReg(uint64_t i_addr, uint8_t i_byte)
+ {
+ size_t len = sizeof(i_byte);
+ return deviceWrite(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
+ &i_byte,
+ len,
+ DEVICE_LPC_ADDRESS(LPC::TRANS_IO,
+ i_addr + g_uartBase));
+ }
+
+ errlHndl_t Uart::readReg(uint64_t i_addr, uint8_t& o_byte)
+ {
+ size_t len = sizeof(o_byte);
+ return deviceRead(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
+ static_cast<uint8_t*>(&o_byte),
+ len,
+ DEVICE_LPC_ADDRESS(LPC::TRANS_IO,
+ i_addr + g_uartBase));
+ }
+
+ Uart* Uart::g_device = NULL;
+
+}
diff --git a/src/usr/console/uart.H b/src/usr/console/uart.H
new file mode 100644
index 000000000..b892ec45d
--- /dev/null
+++ b/src/usr/console/uart.H
@@ -0,0 +1,163 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/console/uart.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] International Business Machines Corp. */
+/* [+] Google Inc. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __CONSOLE_UART_H
+#define __CONSOLE_UART_H
+
+#include <errl/errlentry.H>
+
+namespace CONSOLE
+{
+ namespace UARTREGS
+ {
+ /** UART Register Offsets */
+ enum
+ {
+ RBR = 0, ///< Recv Buffer
+ THR = 0, ///< Tran Holding
+ DLL = 0, ///< Divisor Latch LSB
+ IER = 1, ///< Interrupt Enable
+ DLM = 1, ///< Divisor Latch MSB
+ FCR = 2, ///< FIFO Control
+ IIR = 2, ///< Interrupt Identification
+ LCR = 3, ///< Line Control
+ MCR = 4, ///< Modem Control
+ LSR = 5, ///< Line Status
+ MSR = 6, ///< Modem Status
+ SCR = 7, ///< Scratch
+ };
+
+ /** Line Status Register (LSR) bit definitions */
+ enum
+ {
+ LSR_DR = 0x01, ///< Data ready
+ LSR_OE = 0x02, ///< Overrun
+ LSR_PE = 0x04, ///< Parity error
+ LSR_FE = 0x08, ///< Framing error
+ LSR_BI = 0x10, ///< Break
+ LSR_THRE = 0x20, ///< Xmit holding register empty
+ LSR_TEMT = 0x40, ///< Xmitter empty
+ LSR_ERR = 0x80, ///< Error
+ LSR_BAD = 0xff, ///< Invalid value for LSR
+ };
+
+ /** Line Control Register (LCR) bit definitions */
+ enum
+ {
+ LCR_DWL5 = 0x00, ///< Data word length: 5 bits
+ LCR_DWL6 = 0x01, ///< Data word length: 6 bits
+ LCR_DWL7 = 0x02, ///< Data word length: 7 bits
+ LCR_DWL8 = 0x03, ///< Data word length: 8 bits
+
+ LCR_STP1 = 0x00, ///< 1 stop bits
+ LCR_STP2 = 0x04, ///< 1.5(5) or 2(6,7,8) stop bits
+
+ LCR_NOP = 0x00, ///< No Parity
+ LCR_ODDP = 0x08, ///< Odd Parity
+ LCR_EVEP = 0x18, ///< Even Parity
+ LCR_HIP = 0x28, ///< High Parity
+ LCR_LOP = 0x38, ///< Low Parity
+
+ LCR_DLAB = 0x80, ///< DLL access
+ };
+
+ /** Modem Control Register (MCR) bit definitions */
+ enum
+ {
+ MCR_DTR = 0x01, ///< Data terminal ready
+ MCR_RTS = 0x02, ///< Request to send
+ };
+
+ /** FIFO Control Register (FCR) bit definitions */
+ enum
+ {
+ FCR_ENF = 0x01, ///< Enable FIFOs.
+ FCR_CLFR = 0x02, ///< Clear Receive FIFO.
+ FCR_CLFT = 0x04, ///< Clear Transmit FIFO
+ };
+ }
+
+ /** @class Uart
+ * @brief Abstraction class for UART-based console operations.
+ */
+ class Uart
+ {
+ public:
+ Uart() : iv_initialized(false), iv_failed(false) {};
+ virtual ~Uart() {};
+
+ /** Display character to console. */
+ virtual void putc(char c);
+
+ /** Get character from console. */
+ //virtual void getc(char& c);
+
+ /** Perform UART-specific initialization. */
+ virtual void initialize();
+
+ /** Pointer to console UART singleton.
+ *
+ * Should be initalized using the CONSOLE_UART_DEFINE_DEVICE macro.
+ */
+ static Uart* g_device;
+
+ protected:
+
+ /** Perform write operation to UART engine. */
+ virtual errlHndl_t writeReg(uint64_t i_addr, uint8_t i_byte);
+ /** Perform read operation to UART engine. */
+ virtual errlHndl_t readReg(uint64_t i_addr, uint8_t& o_byte);
+
+ void setFailed() { iv_failed = true; }
+
+ private:
+ bool iv_initialized;
+ bool iv_failed;
+
+ // Prohibit copy constructors.
+ Uart(const Uart&);
+ Uart& operator=(const Uart&);
+ };
+
+ // Static configuration constants. See uartconfig.C.
+ extern const uint64_t g_uartBase;
+ extern const uint64_t g_uartBaud;
+ extern const uint64_t g_uartClock;
+}
+
+/** Helper macro to associate inherited UART device with the singleton. */
+#define CONSOLE_UART_DEFINE_DEVICE(Type) \
+ class ConsoleInit##Type \
+ { \
+ public: \
+ ConsoleInit##Type() \
+ { \
+ Uart::g_device = new Type(); \
+ Uart::g_device->initialize(); \
+ } \
+ }; \
+ ConsoleInit##Type __console_init_##Type;
+
+#endif
diff --git a/src/usr/console/uartconfig.C b/src/usr/console/uartconfig.C
new file mode 100644
index 000000000..e0c88f40a
--- /dev/null
+++ b/src/usr/console/uartconfig.C
@@ -0,0 +1,44 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/console/uartconfig.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] Google Inc. */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include "uart.H"
+
+const uint64_t CONSOLE::g_uartBase = 0x3f8;
+const uint64_t CONSOLE::g_uartBaud = 115200;
+const uint64_t CONSOLE::g_uartClock = 1843200;
+
+/* Someone could decide to make these attributes that are accessed like:
+ * TARGETING::Target *sys;
+ * TARGETING::targetService().getTopLevelTarget(sys);
+ *
+ * g_uartBase = sys->getAttr<TARGETING::ATTR_CONSOLE_UART_BASE>();
+ * g_uartBaud = sys->getAttr<TARGETING::ATTR_CONSOLE_UART_BAUD_RATE>();
+ *
+ * ( though the variables would need to be initialized via a function call
+ * indirection )
+ *
+ * In order to do this, we'd have to remove this file from the object
+ * list and insert a new file via a config option.
+ */
OpenPOWER on IntegriCloud