From patchwork Tue Oct 9 23:28:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 981598 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42VD6Z17vLz9sB7 for ; Wed, 10 Oct 2018 10:32:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RBd6Rf5h"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42VD6Y6fvLzF2R7 for ; Wed, 10 Oct 2018 10:32:37 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RBd6Rf5h"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RBd6Rf5h"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42VD1f42WmzF31m for ; Wed, 10 Oct 2018 10:28:22 +1100 (AEDT) Received: by mail-pg1-x544.google.com with SMTP id a5-v6so1552707pgv.13 for ; Tue, 09 Oct 2018 16:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=niS8W6NfWD0oGDDhUOqNl6R0IMTxMZLdovqZRaKwNyI=; b=RBd6Rf5huvmd7yoAoPloICpMaPvwOFJn70VqY78RfDBMTwvRuiOHfkxXamkcUO9m+H uMVeCR0tUGsHV8L2N40B6F5aKNd5ANoXMvqC8Rzdw+yFm2musa4XthdBp3If2a/uYB+/ e2PhC3NAXArpLmokGWFWSV6RZiEPoUc2qepOw2ZNooJe53dOQLaQDDt8HRUl3xqY64WQ dqtOrC6QX+2E68OzO/usk8r4Gu2eLS4FDJ3OZr+WuJNgqDuR7rOs74m7v7oci/ZavDTX bxNIcP9EGGfokKoZkcS4w21BgFhC3+ahYSCXRuYoc7FiabXbicUwmtVnxHw1CXZiEOrb 7vFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=niS8W6NfWD0oGDDhUOqNl6R0IMTxMZLdovqZRaKwNyI=; b=hq9bC1JtO4Uyo9b9J0ZtS2aS84MGOxwDeIt+OJMzHlPN0DayWiEVDn/Bxrf046Dvk9 V9YDGPgRmYx5blmeLdySy/aTnt5NHqtWvB8EhMTTItEvb1PtRkRTiAt5PwZqVMDu9wxt pNKjXrWz+O4rT3LTZEw8Mhbr/AJOogoMGQV5JLvU6qbqcot10Dz3wbAliieAt4zrygpz c9IKsKYeYUdynmUqpsoS433uJuYHiXGuy/Bl8jTeQO9L1Y1FSlMIklennI1njN37Dvoy Q1l7HGs4ezIJ3Hc0RYlgxuN98qZLtfRZM8jfc2Jk/0dPb/TRFF01pf3FcdTS8JhUJWOw 1TTw== X-Gm-Message-State: ABuFfog4JM5HykuWqE43znhPAHGFsrfsBMBSvor6j+qjpRxazrVbDAoR hpOSAsXXDM42lTQr5+vnpYatLGj/ X-Google-Smtp-Source: ACcGV62xR7jJkN/fIjEXIep2ecd0dKRUpvfH5wX7biI8QFQfRHrSwOydP7pXQVtx9/IEZENSyHSqQA== X-Received: by 2002:a62:5d89:: with SMTP id n9-v6mr32857127pfj.54.1539127700137; Tue, 09 Oct 2018 16:28:20 -0700 (PDT) Received: from aurora.jms.id.au ([45.124.203.19]) by smtp.gmail.com with ESMTPSA id t64-v6sm30831293pfb.44.2018.10.09.16.28.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 16:28:19 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Wed, 10 Oct 2018 09:58:13 +1030 From: Joel Stanley To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper Date: Wed, 10 Oct 2018 09:58:02 +1030 Message-Id: <20181009232803.15072-2-joel@jms.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181009232803.15072-1-joel@jms.id.au> References: <20181009232803.15072-1-joel@jms.id.au> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oliver O'Halloran Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Currently the wrapper is built without including anything in $(src)/include/, which means there are no CONFIG_ symbols defined. This means the platform specific serial drivers were never enabled. We now copy the definitions into the boot directory, so any C file can now include autoconf.h to depend on configuration options. Fixes: 866bfc75f40e ("powerpc: conditionally compile platform-specific serial drivers") Signed-off-by: Joel Stanley --- arch/powerpc/boot/.gitignore | 1 + arch/powerpc/boot/Makefile | 7 ++++++- arch/powerpc/boot/serial.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore index f92d0530ceb1..32034a0cc554 100644 --- a/arch/powerpc/boot/.gitignore +++ b/arch/powerpc/boot/.gitignore @@ -44,4 +44,5 @@ fdt_sw.c fdt_wip.c libfdt.h libfdt_internal.h +autoconf.h diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 0fb96c26136f..eeed74e0dfca 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -197,9 +197,14 @@ $(obj)/empty.c: $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S $(Q)cp $< $@ +$(obj)/serial.c: $(obj)/autoconf.h + +$(obj)/autoconf.h: $(obj)/%: $(srctree)/include/generated/% + $(Q)cp $< $@ + clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \ $(zlib-decomp-) $(libfdt) $(libfdtheader) \ - empty.c zImage.coff.lds zImage.ps3.lds zImage.lds + autoconf.h empty.c zImage.coff.lds zImage.ps3.lds zImage.lds quiet_cmd_bootcc = BOOTCC $@ cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index 48e3743faedf..f045f8494bf9 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c @@ -18,6 +18,7 @@ #include "stdio.h" #include "io.h" #include "ops.h" +#include "autoconf.h" static int serial_open(void) { From patchwork Tue Oct 9 23:28:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 981601 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42VD9J4rL6z9sB7 for ; Wed, 10 Oct 2018 10:35:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fSfrKYqC"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42VD9J2SvwzF35T for ; Wed, 10 Oct 2018 10:35:00 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fSfrKYqC"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fSfrKYqC"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42VD1n1KlxzF326 for ; Wed, 10 Oct 2018 10:28:29 +1100 (AEDT) Received: by mail-pg1-x544.google.com with SMTP id f18-v6so1576479pgv.3 for ; Tue, 09 Oct 2018 16:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=of/5JUSwXK9l7WNRVPej6jR9w8RQ26WmmHda3ChEltQ=; b=fSfrKYqCIhk2Ajfc0aFErxm/anl0EUYPZ4XJ8IOQvED91m7NLA80oT2Vk+jNuufIKh HWlPQweCrKcxyRaahGn7IMukuxCdpVAUt803qFvW8be43nweJxb54MNEb+WXB3yIBlhN njb4eZHtxOBls4dO4ZQj1BW6OsWmHrdpBkg/jKGE50sChio8GF7uM9zyhl8yKbGwtXMV Zmn9s6dyJS7ryBFoBm7TQxXzGPF44UCPguUReNMV+ovC+8AQX3DodZ3KGAN9vJim/vje WgJWAgsUqhKC+nBpET75JLrwoXOheUaaMs6JncR0veR1Q15VqOsIGuAys07VeaelXT0q XJyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=of/5JUSwXK9l7WNRVPej6jR9w8RQ26WmmHda3ChEltQ=; b=dSyFBHJqsZeevTO/YOS1aqpe1oLixpJWqIv49ryav0vGTLy7BcORc3c1jars52171G 7Csp/ayalMAR8fbIa1z+Qb+/tRfiz3Ko7a0odQCkBqvrqGJS66BsI24fdZaETXZIxGsg mdpKQCmUqx7a5N0sT/kriA/D75EtuvhtOfVUvkBQr5eg/F81mOtUccRX4HtxdgrAkLRo dmBzxM7w25/0ERAZAoI52BaASTjEym16zdWIpS8+Wz+dMjhljmerFU/XbhytJorYQQa2 vwQaDFJnI1PiN0JzZPgF1RKwcC/icFB2NW9sfZZ8BT+ST3Q3txjEfbFil8FXsQtcPKq3 w86Q== X-Gm-Message-State: ABuFfoh4yOEaXNXv7WS/04xiI/DTxK5qSS2w+jzh3hc9fQE7I4xuuIWZ 3rCMXba7EtDhDJr8k9eY1cPXZKam X-Google-Smtp-Source: ACcGV63hd+jAHGyya/EeRSKjJfRZ5lL4FASfLMZNhZPmkIbXdKktvMbkdIUYUBB0bUwWxOLvNkhQxA== X-Received: by 2002:a62:401:: with SMTP id 1-v6mr32012301pfe.236.1539127707195; Tue, 09 Oct 2018 16:28:27 -0700 (PDT) Received: from aurora.jms.id.au ([45.124.203.19]) by smtp.gmail.com with ESMTPSA id r76-v6sm17394880pgr.11.2018.10.09.16.28.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 16:28:26 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Wed, 10 Oct 2018 09:58:20 +1030 From: Joel Stanley To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/2] powerpc/boot: Fix opal console in boot wrapper Date: Wed, 10 Oct 2018 09:58:03 +1030 Message-Id: <20181009232803.15072-3-joel@jms.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181009232803.15072-1-joel@jms.id.au> References: <20181009232803.15072-1-joel@jms.id.au> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oliver O'Halloran Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" As of commit 10c77dba40ff ("powerpc/boot: Fix build failure in 32-bit boot wrapper") the opal code is hidden behind CONFIG_PPC64_BOOT_WRAPPER, but the boot wrapper avoids include/linux, so it does not get the normal Kconfig flags. We can drop the guard entirely as in commit f8e8e69cea49 ("powerpc/boot: Only build OPAL code when necessary") the makefile only includes opal.c in the build if CONFIG_PPC64_BOOT_WRAPPER is set. Fixes: 10c77dba40ff ("powerpc/boot: Fix build failure in 32-bit boot wrapper") Signed-off-by: Joel Stanley --- I wrote this patch before the kconfig one. We could use autoconf.h, or fold this in, but I think the clean up of the redundant ifdef is cleaner. arch/powerpc/boot/opal.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/powerpc/boot/opal.c b/arch/powerpc/boot/opal.c index 0272570d02de..dfb199ef5b94 100644 --- a/arch/powerpc/boot/opal.c +++ b/arch/powerpc/boot/opal.c @@ -13,8 +13,6 @@ #include #include "../include/asm/opal-api.h" -#ifdef CONFIG_PPC64_BOOT_WRAPPER - /* Global OPAL struct used by opal-call.S */ struct opal { u64 base; @@ -101,9 +99,3 @@ int opal_console_init(void *devp, struct serial_console_data *scdp) return 0; } -#else -int opal_console_init(void *devp, struct serial_console_data *scdp) -{ - return -1; -} -#endif /* __powerpc64__ */