aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-10-05 09:16:36 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-10-05 09:16:36 +1100
commitb33fd8dc893e2ea65ceef5dad2fa8173932443e5 (patch)
tree8fbf5bfd56914848ea0369f67fb4438916576ceb /platforms
parent5876e124399cc2e4961020f22b28bfc9abdae3bb (diff)
downloadskiboot-b33fd8dc893e2ea65ceef5dad2fa8173932443e5.zip
skiboot-b33fd8dc893e2ea65ceef5dad2fa8173932443e5.tar.gz
skiboot-b33fd8dc893e2ea65ceef5dad2fa8173932443e5.tar.bz2
plat/palmetto: Fix SIO UART vs UART setup and iBT setup
The AMI images use the virtual UART, not the SIO UART, so configuring the SIO the way we do is incorrect. Additionally, they don't configure the interrupts properly (bad polarity for VUART and bad number for iBT). This reworks the inits to fix that up: - All SIO interrupts are set to level low - Check if VUART is enabled. If yes, configure and use it (and disable SIO UART which hostboot might have left enabled). - Else, reconfigure VUART LPC address and IRQ properly - Configure iBT LPC address and IRQ properly Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/bmc/palmetto.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/platforms/bmc/palmetto.c b/platforms/bmc/palmetto.c
index 28af306..5d28b86 100644
--- a/platforms/bmc/palmetto.c
+++ b/platforms/bmc/palmetto.c
@@ -198,8 +198,23 @@ static bool palmetto_probe(void)
/* Send external interrupts to me */
psi_set_external_irq_policy(EXTERNAL_IRQ_POLICY_SKIBOOT);
- /* Configure UART1 on SuperIO */
- ast_setup_uart1(UART_IO_BASE, UART_LPC_IRQ);
+ /*
+ * Depending on which image we are running, it may be configuring
+ * the virtual UART or not. Check if VUART is enabled and use
+ * SIO if not. We also correct the configuration of VUART as some
+ * BMC images don't setup the interrupt properly
+ */
+ if (ast_is_vuart1_enabled()) {
+ printf("PLAT: Using virtual UART\n");
+ ast_disable_sio_uart1();
+ ast_setup_vuart1(UART_IO_BASE, UART_LPC_IRQ);
+ } else {
+ printf("PLAT: Using SuperIO UART\n");
+ ast_setup_sio_uart1(UART_IO_BASE, UART_LPC_IRQ);
+ }
+
+ /* Similarily, some BMCs don't configure the BT interrupt properly */
+ ast_setup_ibt(BT_IO_BASE, BT_LPC_IRQ);
/* Setup UART and use it as console with interrupts */
uart_init(true);