From patchwork Wed Apr 6 16:30:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 607092 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qgB6Z2SCjz9sBc for ; Thu, 7 Apr 2016 02:30:46 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qgB6Z1lcPzDq97 for ; Thu, 7 Apr 2016 02:30:46 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e06smtp17.uk.ibm.com (e06smtp17.uk.ibm.com [195.75.94.113]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qgB6M66HNzDq65 for ; Thu, 7 Apr 2016 02:30:35 +1000 (AEST) Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Apr 2016 17:30:32 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 6 Apr 2016 17:30:29 +0100 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: clg@fr.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id B897B219005C for ; Wed, 6 Apr 2016 17:30:08 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u36GUTp57733686 for ; Wed, 6 Apr 2016 16:30:29 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u36GUSNo005425 for ; Wed, 6 Apr 2016 10:30:28 -0600 Received: from hermes.ibm.com (icon-9-164-133-253.megacenter.de.ibm.com [9.164.133.253]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u36GUOYZ005259; Wed, 6 Apr 2016 10:30:27 -0600 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: skiboot@lists.ozlabs.org Date: Wed, 6 Apr 2016 18:30:09 +0200 Message-Id: <1459960212-23890-4-git-send-email-clg@fr.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459960212-23890-1-git-send-email-clg@fr.ibm.com> References: <1459960212-23890-1-git-send-email-clg@fr.ibm.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16040616-0005-0000-0000-000010242A6C Subject: [Skiboot] [PATCH 3/6] plat/qemu: use astbmc_fixup_dt_uart() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This is the exact same code. Signed-off-by: Cédric Le Goater --- platforms/astbmc/astbmc.h | 1 + platforms/astbmc/common.c | 2 +- platforms/astbmc/qemu.c | 43 +------------------------------------------ 3 files changed, 3 insertions(+), 43 deletions(-) diff --git a/platforms/astbmc/astbmc.h b/platforms/astbmc/astbmc.h index cc85d477c92e..1c00a3dee697 100644 --- a/platforms/astbmc/astbmc.h +++ b/platforms/astbmc/astbmc.h @@ -37,6 +37,7 @@ extern void astbmc_early_init(void); extern int64_t astbmc_ipmi_reboot(void); extern int64_t astbmc_ipmi_power_down(uint64_t request); extern struct dt_node *astbmc_get_primary_lpc(void); +extern void astbmc_fixup_dt_uart(struct dt_node *lpc); extern void astbmc_init(void); extern void astbmc_ext_irq_serirq_cpld(unsigned int chip_id); extern int pnor_init(void); diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c index 99acde9e88c1..d0bcf7dba08f 100644 --- a/platforms/astbmc/common.c +++ b/platforms/astbmc/common.c @@ -187,7 +187,7 @@ static void astbmc_fixup_dt_bt(struct dt_node *lpc) dt_add_property_cells(bt, "interrupt-parent", lpc->phandle); } -static void astbmc_fixup_dt_uart(struct dt_node *lpc) +void astbmc_fixup_dt_uart(struct dt_node *lpc) { /* * The official OF ISA/LPC binding is a bit odd, it prefixes diff --git a/platforms/astbmc/qemu.c b/platforms/astbmc/qemu.c index 07903eb03b89..2f316df80a5a 100644 --- a/platforms/astbmc/qemu.c +++ b/platforms/astbmc/qemu.c @@ -36,47 +36,6 @@ static void qemu_init(void) lpc_rtc_init(); } -static void qemu_dt_fixup_uart(struct dt_node *lpc) -{ - /* - * The official OF ISA/LPC binding is a bit odd, it prefixes - * the unit address for IO with "i". It uses 2 cells, the first - * one indicating IO vs. Memory space (along with bits to - * represent aliasing). - * - * We pickup that binding and add to it "2" as a indication - * of FW space. - * - * TODO: Probe the UART instead if the LPC bus allows for it - */ - struct dt_node *uart; - char namebuf[32]; -#define UART_IO_BASE 0x3f8 -#define UART_IO_COUNT 8 -#define UART_LPC_IRQ 4 - - snprintf(namebuf, sizeof(namebuf), "serial@i%x", UART_IO_BASE); - uart = dt_new(lpc, namebuf); - - dt_add_property_cells(uart, "reg", - 1, /* IO space */ - UART_IO_BASE, UART_IO_COUNT); - dt_add_property_strings(uart, "compatible", - "ns16550", - "pnpPNP,501"); - dt_add_property_cells(uart, "clock-frequency", 1843200); - dt_add_property_cells(uart, "current-speed", 115200); - dt_add_property_cells(uart, "interrupts", UART_LPC_IRQ); - dt_add_property_cells(uart, "interrupt-parent", lpc->phandle); - - /* - * This is needed by Linux for some obscure reasons, - * we'll eventually need to sanitize it but in the meantime - * let's make sure it's there - */ - dt_add_property_strings(uart, "device_type", "serial"); -} - /* * This adds the legacy RTC device to the device-tree * for Linux to use @@ -106,7 +65,7 @@ static void qemu_dt_fixup(void) return; qemu_dt_fixup_rtc(primary_lpc); - qemu_dt_fixup_uart(primary_lpc); + astbmc_fixup_dt_uart(primary_lpc); } static void qemu_ext_irq_serirq_cpld(unsigned int chip_id)