From patchwork Fri Jan 22 17:02:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 8091411 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A465CBEEE5 for ; Fri, 22 Jan 2016 17:03:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFDFB2046F for ; Fri, 22 Jan 2016 17:03:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5E8020460 for ; Fri, 22 Jan 2016 17:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754402AbcAVRDL (ORCPT ); Fri, 22 Jan 2016 12:03:11 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:33540 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753682AbcAVRDJ (ORCPT ); Fri, 22 Jan 2016 12:03:09 -0500 Received: by mail-lb0-f179.google.com with SMTP id x4so45046483lbm.0 for ; Fri, 22 Jan 2016 09:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=Al2iNMgXQ4Vw6hXhNxeVeAFGmuJKy2Lxf9sQu+O6izk=; b=vbAdr0FjDNIp89uqW9dVfEfrEjCasajF4Y3NzerClBLWxTxtj0hDLjgMUTcAZizOdR KoKbmkIbsvx0vHD8CwBzsk72u0o5kQN3K9pgi64FlryVt5SeqUHXqB1ku97yvzgbLEU8 B29Ork9XIMdEVVh5GCFSaxGj299ulhen+P1ysFRevMr5OY8nsjFr1tvrIFJDqlETFgCk RUV0voAZrP94waQUAhzvV6VvAIs4J1JNAr1+3yEEZrFC9yjYIRTgM/x3kGvE2b8yIBwM CxlfwVQ8Pq6WExiwWgBQ0rGamqC44tXDgjBZvE3mYOFnxa9x84h7DqAQGeMa89+7mQDN zvhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=Al2iNMgXQ4Vw6hXhNxeVeAFGmuJKy2Lxf9sQu+O6izk=; b=iPEZZyfXjNpNEwiu+8i0fdbd05JKe1iMy4KfaWXET/7NEnl8sILytpr1CUqiwaMNr2 pf/ic95ZXw+56aUwuOi3/7WFrv+pyTf56G12gtS0qQ/oXxt6lRSPEofnpd6oS0tiXNHc AMtuX6LQypVgfIKTLfL/0Y87qnzrb8Hn4sgpvTunX138utjebGPXqaDUzBmos22Mj8jy CT8llLgyQ+9w60FQA+8q/NIXhpx3K0qR/nkfHcrZ05a1BP3VwUixGJremxfwlSV4wBuP nU5/UFIz82QIqfMHrlQJeTMhaelew9DmfInwCw6r0MNijhUNFwf1tsOBnncgvNb994bs /sUw== X-Gm-Message-State: AG10YOTJUrqPrn2wE4hBOZzNDrqnPM8Y+8+790aQeBYdASJK4lIgg5H1TG72LSWYzRRNFg== X-Received: by 10.112.161.33 with SMTP id xp1mr1651526lbb.141.1453482187836; Fri, 22 Jan 2016 09:03:07 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id wj2sm973724lbb.5.2016.01.22.09.03.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2016 09:03:07 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo , linux-wireless@vger.kernel.org Cc: Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH] bcma: init serial console directly from ChipCommon code Date: Fri, 22 Jan 2016 18:02:54 +0100 Message-Id: <1453482174-11021-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP UART is connected to and controlled over ChipCommon core. It doesn't have much to do with MIPS core (where we initialize it currently) except just existing on embedded systemms. There isn't point of such cross-core initialization (and we needed #ifdef anyway) so just handle it in ChipCommon. Signed-off-by: Rafa? Mi?ecki Reviewed-by: Hauke Mehrtens --- drivers/bcma/bcma_private.h | 1 - drivers/bcma/driver_chipcommon.c | 13 ++++++++++--- drivers/bcma/driver_mips.c | 3 --- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h index 38f1567..7e4ddfb 100644 --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h @@ -48,7 +48,6 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc); void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); #ifdef CONFIG_BCMA_DRIVER_MIPS -void bcma_chipco_serial_init(struct bcma_drv_cc *cc); extern struct platform_device bcma_pflash_dev; #endif /* CONFIG_BCMA_DRIVER_MIPS */ diff --git a/drivers/bcma/driver_chipcommon.c b/drivers/bcma/driver_chipcommon.c index 36ee221..bdb73d9 100644 --- a/drivers/bcma/driver_chipcommon.c +++ b/drivers/bcma/driver_chipcommon.c @@ -15,6 +15,8 @@ #include #include +static void bcma_chipco_serial_init(struct bcma_drv_cc *cc); + static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset, u32 mask, u32 value) { @@ -115,6 +117,8 @@ int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc) void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc) { + struct bcma_bus *bus = cc->core->bus; + if (cc->early_setup_done) return; @@ -129,6 +133,9 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc) if (cc->capabilities & BCMA_CC_CAP_PMU) bcma_pmu_early_init(cc); + if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC) + bcma_chipco_serial_init(cc); + cc->early_setup_done = true; } @@ -314,9 +321,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value) return res; } -#ifdef CONFIG_BCMA_DRIVER_MIPS -void bcma_chipco_serial_init(struct bcma_drv_cc *cc) +static void bcma_chipco_serial_init(struct bcma_drv_cc *cc) { +#if IS_BUILTIN(CONFIG_BCM47XX) unsigned int irq; u32 baud_base; u32 i; @@ -358,5 +365,5 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc) ports[i].baud_base = baud_base; ports[i].reg_shift = 0; } +#endif /* CONFIG_BCM47XX */ } -#endif /* CONFIG_BCMA_DRIVER_MIPS */ diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c index 24424f3..a40a203 100644 --- a/drivers/bcma/driver_mips.c +++ b/drivers/bcma/driver_mips.c @@ -337,12 +337,9 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { - struct bcma_bus *bus = mcore->core->bus; - if (mcore->early_setup_done) return; - bcma_chipco_serial_init(&bus->drv_cc); bcma_core_mips_flash_detect(mcore); mcore->early_setup_done = true;