From patchwork Wed Nov 24 11:57:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12636857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 475D4C433F5 for ; Wed, 24 Nov 2021 13:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348954AbhKXNWI (ORCPT ); Wed, 24 Nov 2021 08:22:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:43570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347802AbhKXNT6 (ORCPT ); Wed, 24 Nov 2021 08:19:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6C1661AEF; Wed, 24 Nov 2021 12:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637758000; bh=geWwvt+WcT0Vr9beU/Rq9/kGpE1RZ0NSTymtca8vwFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v2cpPy6vvb05kdR5lylwSrd02eIY0eDHK5nq48pyyxRecEwHwCX+XI7m0QSkGVV8n WM66bhrKj5N3RZ70MlDlKZP3Ss/ggj0z9lwvrMY0khJT2D1v3g2nxBQsFC057IuhXs YunXbKedUIQCJVc8tna75huJCPONA9MCBtzD4a6I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, linux-mips@vger.kernel.org, Bart Van Assche , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.4 023/100] MIPS: sni: Fix the build Date: Wed, 24 Nov 2021 12:57:39 +0100 Message-Id: <20211124115655.609219359@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115654.849735859@linuxfoundation.org> References: <20211124115654.849735859@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Bart Van Assche [ Upstream commit c91cf42f61dc77b289784ea7b15a8531defa41c0 ] This patch fixes the following gcc 10 build error: arch/mips/sni/time.c: In function ‘a20r_set_periodic’: arch/mips/sni/time.c:15:26: error: unsigned conversion from ‘int’ to ‘u8’ {aka ‘volatile unsigned char’} changes value from ‘576’ to ‘64’ [-Werror=overflow] 15 | #define SNI_COUNTER0_DIV ((SNI_CLOCK_TICK_RATE / SNI_COUNTER2_DIV) / HZ) | ^ arch/mips/sni/time.c:21:45: note: in expansion of macro ‘SNI_COUNTER0_DIV’ 21 | *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV; | ^~~~~~~~~~~~~~~~ Cc: linux-mips@vger.kernel.org Signed-off-by: Bart Van Assche Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/sni/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c index dbace1f3e1a97..745ceb945fc50 100644 --- a/arch/mips/sni/time.c +++ b/arch/mips/sni/time.c @@ -18,14 +18,14 @@ static int a20r_set_periodic(struct clock_event_device *evt) { *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0x34; wmb(); - *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV; + *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV & 0xff; wmb(); *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV >> 8; wmb(); *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0xb4; wmb(); - *(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV; + *(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV & 0xff; wmb(); *(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV >> 8; wmb(); From patchwork Wed Nov 24 11:57:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12636863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12753C433EF for ; Wed, 24 Nov 2021 13:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346484AbhKXN0h (ORCPT ); Wed, 24 Nov 2021 08:26:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:48368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348715AbhKXNYk (ORCPT ); Wed, 24 Nov 2021 08:24:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E4C1460F5B; Wed, 24 Nov 2021 12:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637758132; bh=LnsjCsiDjV+3Z6nJ8J0l4++nkVSPwyLidA/IJqTgKxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GAxqCew/tBAOTD7HctKlmi15egJMbEtymiZrIiHFcR+H4NVLlFwvfS4AcUNsO9jiP YMF8a2/nC5UhkqG275grki5YlCbx2KvFzQi3Yk15aWyMsgxN/P9E34HG5oB0vwGCEH Jn5OhOkRhFNDaQIcCBxCUgREE77VRhq/Nt72368M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , kernel test robot , Thomas Bogendoerfer , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, Paul Burton , Maxime Bizon , Ralf Baechle , Sasha Levin Subject: [PATCH 5.4 039/100] mips: BCM63XX: ensure that CPU_SUPPORTS_32BIT_KERNEL is set Date: Wed, 24 Nov 2021 12:57:55 +0100 Message-Id: <20211124115656.149393330@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115654.849735859@linuxfoundation.org> References: <20211124115654.849735859@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Randy Dunlap [ Upstream commit 5eeaafc8d69373c095e461bdb39e5c9b62228ac5 ] Several header files need info on CONFIG_32BIT or CONFIG_64BIT, but kconfig symbol BCM63XX does not provide that info. This leads to many build errors, e.g.: arch/mips/include/asm/page.h:196:13: error: use of undeclared identifier 'CAC_BASE' return x - PAGE_OFFSET + PHYS_OFFSET; arch/mips/include/asm/mach-generic/spaces.h:91:23: note: expanded from macro 'PAGE_OFFSET' #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET) arch/mips/include/asm/io.h:134:28: error: use of undeclared identifier 'CAC_BASE' return (void *)(address + PAGE_OFFSET - PHYS_OFFSET); arch/mips/include/asm/mach-generic/spaces.h:91:23: note: expanded from macro 'PAGE_OFFSET' #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET) arch/mips/include/asm/uaccess.h:82:10: error: use of undeclared identifier '__UA_LIMIT' return (__UA_LIMIT & (addr | (addr + size) | __ua_size(size))) == 0; Selecting the SYS_HAS_CPU_BMIPS* symbols causes SYS_HAS_CPU_BMIPS to be set, which then selects CPU_SUPPORT_32BIT_KERNEL, which causes CONFIG_32BIT to be set. (a bit more indirect than v1 [RFC].) Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Thomas Bogendoerfer Cc: Florian Fainelli Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-mips@vger.kernel.org Cc: Paul Burton Cc: Maxime Bizon Cc: Ralf Baechle Suggested-by: Florian Fainelli Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 041d34975ea2c..9749818eed6d6 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -294,6 +294,9 @@ config BCM63XX select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_BIG_ENDIAN select SYS_HAS_EARLY_PRINTK + select SYS_HAS_CPU_BMIPS32_3300 + select SYS_HAS_CPU_BMIPS4350 + select SYS_HAS_CPU_BMIPS4380 select SWAP_IO_SPACE select GPIOLIB select HAVE_CLK From patchwork Wed Nov 24 11:58:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12636859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACBBDC433EF for ; Wed, 24 Nov 2021 13:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349009AbhKXNYp (ORCPT ); Wed, 24 Nov 2021 08:24:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:48376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349391AbhKXNWz (ORCPT ); Wed, 24 Nov 2021 08:22:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B9EF561B20; Wed, 24 Nov 2021 12:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637758082; bh=cbAkr7roA/XUOtkCmC8I3swOMtrHElogX+dp0d5mgIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pTFY04LHhMRLpv87PWlwvZUvYAYhxsOdEU2JVz4g/Gbb/ev/HF9TQLgN0QPMagHOJ KD5t+hdh/xNRvqiQnlaIE2TEio6/Pn5k9pSU+KX15pMasujRE18Xc5ory7n1Fv15Ps oV95M/XwYV9rHTmOzS4rVNAZEyimHTv6GRxvVaQg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , kernel test robot , "Russell King (Oracle)" , Artur Rojek , Paul Cercueil , linux-mips@vger.kernel.org, Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, Florian Fainelli , Andy Shevchenko , Russell King , bcm-kernel-feedback-list@broadcom.com, Jonas Gorski , Jonathan Cameron , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.4 055/100] mips: bcm63xx: add support for clk_get_parent() Date: Wed, 24 Nov 2021 12:58:11 +0100 Message-Id: <20211124115656.656555057@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115654.849735859@linuxfoundation.org> References: <20211124115654.849735859@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Randy Dunlap [ Upstream commit e8f67482e5a4bc8d0b65d606d08cb60ee123b468 ] BCM63XX selects HAVE_LEGACY_CLK but does not provide/support clk_get_parent(), so add a simple implementation of that function so that callers of it will build without errors. Fixes these build errors: mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4770_adc_init_clk_div': ingenic-adc.c:(.text+0xe4): undefined reference to `clk_get_parent' mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4725b_adc_init_clk_div': ingenic-adc.c:(.text+0x1b8): undefined reference to `clk_get_parent' Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs." ) Signed-off-by: Randy Dunlap Reported-by: kernel test robot Suggested-by: Russell King (Oracle) Cc: Artur Rojek Cc: Paul Cercueil Cc: linux-mips@vger.kernel.org Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: linux-iio@vger.kernel.org Cc: Florian Fainelli Cc: Andy Shevchenko Cc: Russell King Cc: bcm-kernel-feedback-list@broadcom.com Cc: Jonas Gorski Reviewed-by: Andy Shevchenko Acked-by: Jonathan Cameron Acked-by: Russell King (Oracle) Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/bcm63xx/clk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c index 164115944a7fd..aba6e2d6a736c 100644 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c @@ -381,6 +381,12 @@ void clk_disable(struct clk *clk) EXPORT_SYMBOL(clk_disable); +struct clk *clk_get_parent(struct clk *clk) +{ + return NULL; +} +EXPORT_SYMBOL(clk_get_parent); + unsigned long clk_get_rate(struct clk *clk) { if (!clk) From patchwork Wed Nov 24 11:58:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12636861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6830C433F5 for ; Wed, 24 Nov 2021 13:21:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348288AbhKXNY4 (ORCPT ); Wed, 24 Nov 2021 08:24:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:45194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349673AbhKXNW4 (ORCPT ); Wed, 24 Nov 2021 08:22:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B367B601FA; Wed, 24 Nov 2021 12:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637758085; bh=t6EpUKSDxpBunjZbMHXcFMQfN9THHgB5DkBUhoIiJTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XszT7Z4HT9yreQeKECZGigtJR99uKMyyzNba4nOf/2Lpq/60pTVYCaPy/IIXXAnhg SaAwMC2zFYWAFsGyWQePRLeTIbWWxUNC+hFjmSDt/A2RcUXbhrFvthW3MxqpWlqMls y5EnC3e+O+QhKG8YaMg6Q3VJk7QiS3c0mYN3mQLg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , "Russell King (Oracle)" , linux-mips@vger.kernel.org, John Crispin , Thomas Bogendoerfer , Jonathan Cameron , linux-iio@vger.kernel.org, Russell King , Andy Shevchenko , Jonathan Cameron , Sasha Levin Subject: [PATCH 5.4 056/100] mips: lantiq: add support for clk_get_parent() Date: Wed, 24 Nov 2021 12:58:12 +0100 Message-Id: <20211124115656.687699347@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115654.849735859@linuxfoundation.org> References: <20211124115654.849735859@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Randy Dunlap [ Upstream commit fc1aabb088860d6cf9dd03612b7a6f0de91ccac2 ] Provide a simple implementation of clk_get_parent() in the lantiq subarch so that callers of it will build without errors. Fixes this build error: ERROR: modpost: "clk_get_parent" [drivers/iio/adc/ingenic-adc.ko] undefined! Fixes: 171bb2f19ed6 ("MIPS: Lantiq: Add initial support for Lantiq SoCs") Signed-off-by: Randy Dunlap Suggested-by: Russell King (Oracle) Cc: linux-mips@vger.kernel.org Cc: John Crispin Cc: Thomas Bogendoerfer Cc: Jonathan Cameron Cc: linux-iio@vger.kernel.org Cc: Russell King Cc: Andy Shevchenko Acked-by: Jonathan Cameron Acked-by: John Crispin Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/lantiq/clk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c index dd819e31fcbbf..4916cccf378fd 100644 --- a/arch/mips/lantiq/clk.c +++ b/arch/mips/lantiq/clk.c @@ -158,6 +158,12 @@ void clk_deactivate(struct clk *clk) } EXPORT_SYMBOL(clk_deactivate); +struct clk *clk_get_parent(struct clk *clk) +{ + return NULL; +} +EXPORT_SYMBOL(clk_get_parent); + static inline u32 get_counter_resolution(void) { u32 res;