Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp876859pxb; Wed, 6 Apr 2022 02:57:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+lGfUWpM0dGsG2bsr+DJWTtJKDqCH5HWlTX/7rvBi6SHP7LrKZel2n6cTQYR+5OSUIXvi X-Received: by 2002:a17:90a:c253:b0:1c9:ada2:f28d with SMTP id d19-20020a17090ac25300b001c9ada2f28dmr8921495pjx.17.1649239037518; Wed, 06 Apr 2022 02:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649239037; cv=none; d=google.com; s=arc-20160816; b=guhunNxFBuETkqw0v0T4rVuXTB1yu1De0BLGLw4QjvKXiXcoMJj2cLt9OxMuzOm6Y5 kgaDzk71P6Lq8rJ0MldfmMNFmiA4+DzXImx+vwM9/oR+2fZdSI9qlamvrcUFcQS2Fobq Zi0fLoLwU/LBbp9cMTJitKwItqcknL7h7ZCGZYLOWaUhg8edhiB7Qf4cg5kvzCXI0OOc XcgsfWzK+E5ZtQntVSH4OVXOBLVRRNBg/Q95geECSuT8cXs8BW3eFG3B64oMVVODw0BY c3mL1+3t2sBh5ULcl4bBosAPgUBDzns4FSlQRRf9oF+C1e7FLF3Q4NjX1uYl6hiK0Cx7 i/dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:organization:references:in-reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=EydZFX7D5i7EpG+t9VUqJWBTelMQAoO0tt7R0Ab/+xg=; b=BxoUcKDmTC4AifG1KYLJcnx3MWX4nFPFR+LkD0zSMtBkhjipzH7CmCnJ2cmkfygHP7 hZUoU3O+IvQ/mttkjJNqwRn4cHICeOiD0iRtm0jciKZVQANOyREHLpskPvzMXwl9+vhP 5S1z2RzCaqh5rzkD917cY4g9ojsce7Vt45AXpdkwbtue7Z2k59DbfSZWOQDBGC0mN1Re D/uLmyMpvaCQ69SdGhCMValM1sOn1GjrCIMVCIeNtZ6smMlfTVRw8OcLrZ1y47dAw0FP d6VtREho5Y4eRcIR1n2VIQBKPwlbVsv7r+GCTQYc0CJsJ+FpCCK8eGrIUKNAmctPmd3x oE8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=QEscKE+U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d37-20020a631d65000000b003816043ee58si15494385pgm.77.2022.04.06.02.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 02:57:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=QEscKE+U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A68672A4F83; Wed, 6 Apr 2022 01:10:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233637AbiDEUR1 (ORCPT + 99 others); Tue, 5 Apr 2022 16:17:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349349AbiDEJtl (ORCPT ); Tue, 5 Apr 2022 05:49:41 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 255F96456; Tue, 5 Apr 2022 02:44:20 -0700 (PDT) Received: from ktm (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 114C283AF6; Tue, 5 Apr 2022 11:44:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1649151858; bh=EydZFX7D5i7EpG+t9VUqJWBTelMQAoO0tt7R0Ab/+xg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QEscKE+UeMVqYIsMwoCY3XeIWzBn/wAr51uUHuDXRE8u9qS7cvSEe5/HzHj5LZ3rd cXdexFyNNNqU4y+zEQUkV66GKUovf6DWnUcAVS2/+D1HZ6RJw0mHYS8vusjRMwfL0B KqWXcFAUYO//0qqqZXW7t6bdfZhLZXFEjrjh7c5K/wUCw0P0TwKWMkaRxalMJzXYn+ /HiJn1SlqLvho0uRkk877Uk4QJhhI+Ge8oQZN3n1pqAmmSfkp1zi/pIWyWiL7Yd7uy xUNPYD3SpY244ToYUMhTvpTSCgMqUV6/+EbHDAmkRWx+TENdoeVygMZtbRjPjsIRix RmHcp+AyNYakA== Date: Tue, 5 Apr 2022 11:44:07 +0200 From: Lukasz Majewski To: Arnd Bergmann Cc: Arnd Bergmann , Russell King , Hartley Sweeten , Alexander Sverdlin , Hubert Feurstein , Krzysztof Kozlowski , Alim Akhtar , Linus Walleij , Imre Kaloz , Krzysztof Halasa , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Simtec Linux Team , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Ard Biesheuvel , Stephen Boyd , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH 05/12] ARM: ep93xx: multiplatform support Message-ID: <20220405114407.6720647b@ktm> In-Reply-To: <20220405091750.3076973-6-arnd@kernel.org> References: <20220405091750.3076973-1-arnd@kernel.org> <20220405091750.3076973-6-arnd@kernel.org> Organization: denx.de X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/4mn6drsee5/zQvIpZkMIvmi"; protocol="application/pgp-signature" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/4mn6drsee5/zQvIpZkMIvmi Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Arnd, Thank you very much for converting this architecture to use the multiplatform config. > From: Arnd Bergmann >=20 > With the clock support and the interrupts out of the way, ep93xx can > be compiled into the same kernel image as the other ARMv4/v5 > platforms. The last obstacle are the two workarounds for broken boot > loaders that require us to re-initialize the ethernet controller > and/or the watchdog on certain machines. >=20 > Move this code into the decompressor sources directly, checking for > each possibly affected machine individually. >=20 > Signed-off-by: Arnd Bergmann > --- > arch/arm/Kconfig | 16 ----- > .../compressed/misc-ep93xx.h} | 69 > +++++++++---------- arch/arm/boot/compressed/misc.c | > 4 ++ arch/arm/configs/ep93xx_defconfig | 2 + > arch/arm/mach-ep93xx/Kconfig | 12 ++++ > 5 files changed, 51 insertions(+), 52 deletions(-) > rename arch/arm/{mach-ep93xx/include/mach/uncompress.h =3D> > boot/compressed/misc-ep93xx.h} (51%) >=20 > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 5177e54cc14c..2bd611beefe1 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -347,22 +347,6 @@ config ARCH_MULTIPLATFORM > select SPARSE_IRQ > select USE_OF > =20 > -config ARCH_EP93XX > - bool "EP93xx-based" > - select ARCH_SPARSEMEM_ENABLE > - select ARM_AMBA > - imply ARM_PATCH_PHYS_VIRT > - select ARM_VIC > - select AUTO_ZRELADDR > - select CLKSRC_MMIO > - select CPU_ARM920T > - select GPIOLIB > - select COMMON_CLK > - select IRQ_DOMAIN > - select SPARSE_IRQ > - help > - This enables support for the Cirrus EP93xx series of CPUs. > - > config ARCH_FOOTBRIDGE > bool "FootBridge" > select CPU_SA110 > diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h > b/arch/arm/boot/compressed/misc-ep93xx.h similarity index 51% > rename from arch/arm/mach-ep93xx/include/mach/uncompress.h > rename to arch/arm/boot/compressed/misc-ep93xx.h > index e20bcab702b2..3dc942589cba 100644 > --- a/arch/arm/mach-ep93xx/include/mach/uncompress.h > +++ b/arch/arm/boot/compressed/misc-ep93xx.h > @@ -1,54 +1,25 @@ > /* SPDX-License-Identifier: GPL-2.0-or-later */ > /* > - * arch/arm/mach-ep93xx/include/mach/uncompress.h > - * > * Copyright (C) 2006 Lennert Buytenhek > */ > =20 > #include > =20 > -static unsigned char __raw_readb(unsigned int ptr) > -{ > - return *((volatile unsigned char *)ptr); > -} > - > -static unsigned int __raw_readl(unsigned int ptr) > +static inline unsigned int __raw_readl(unsigned int ptr) > { > return *((volatile unsigned int *)ptr); > } > =20 > -static void __raw_writeb(unsigned char value, unsigned int ptr) > +static inline void __raw_writeb(unsigned char value, unsigned int > ptr) { > *((volatile unsigned char *)ptr) =3D value; > } > =20 > -static void __raw_writel(unsigned int value, unsigned int ptr) > +static inline void __raw_writel(unsigned int value, unsigned int ptr) > { > *((volatile unsigned int *)ptr) =3D value; > } > =20 > -#define PHYS_UART_DATA (CONFIG_DEBUG_UART_PHYS + 0x00) > -#define PHYS_UART_FLAG (CONFIG_DEBUG_UART_PHYS + 0x18) > -#define UART_FLAG_TXFF 0x20 > - > -static inline void putc(int c) > -{ > - int i; > - > - for (i =3D 0; i < 10000; i++) { > - /* Transmit fifo not full? */ > - if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)) > - break; > - } > - > - __raw_writeb(c, PHYS_UART_DATA); > -} > - > -static inline void flush(void) > -{ > -} > - > - > /* > * Some bootloaders don't turn off DMA from the ethernet MAC before > * jumping to linux, which means that we might end up with bits of RX > @@ -58,7 +29,7 @@ static inline void flush(void) > #define PHYS_ETH_SELF_CTL 0x80010020 > #define ETH_SELF_CTL_RESET 0x00000001 > =20 > -static void ethernet_reset(void) > +static inline void ep93xx_ethernet_reset(void) > { > unsigned int v; > =20 > @@ -75,15 +46,41 @@ static void ethernet_reset(void) > #define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000 > #define TS72XX_WDT_FEED_VAL 0x05 > =20 > -static void __maybe_unused ts72xx_watchdog_disable(void) > +static inline void __maybe_unused ts72xx_watchdog_disable(void) > { > __raw_writeb(TS72XX_WDT_FEED_VAL, TS72XX_WDT_FEED_PHYS_BASE); > __raw_writeb(0, TS72XX_WDT_CONTROL_PHYS_BASE); > } > =20 > -static void arch_decomp_setup(void) > +static inline void ep93xx_decomp_setup(void) > { > if (machine_is_ts72xx()) > ts72xx_watchdog_disable(); > - ethernet_reset(); > + > + if (machine_is_adssphere() || > + machine_is_edb9301() || > + machine_is_edb9302() || > + machine_is_edb9302a() || > + machine_is_edb9302a() || > + machine_is_edb9307() || > + machine_is_edb9307a() || > + machine_is_edb9307a() || > + machine_is_edb9312() || > + machine_is_edb9315() || > + machine_is_edb9315a() || > + machine_is_edb9315a() || > + machine_is_gesbc9312() || > + machine_is_micro9() || > + machine_is_micro9l() || > + machine_is_micro9m() || > + machine_is_micro9s() || > + machine_is_micro9m() || > + machine_is_micro9l() || > + machine_is_micro9s() || > + machine_is_sim_one() || > + machine_is_snapper_cl15() || > + machine_is_ts72xx() || > + machine_is_bk3() || > + machine_is_vision_ep9307()) > + ep93xx_ethernet_reset(); > } > diff --git a/arch/arm/boot/compressed/misc.c > b/arch/arm/boot/compressed/misc.c index c3c66ff2d696..cb2e069dc73f > 100644 --- a/arch/arm/boot/compressed/misc.c > +++ b/arch/arm/boot/compressed/misc.c > @@ -23,6 +23,7 @@ unsigned int __machine_arch_type; > #include > #include > #include "misc.h" > +#include "misc-ep93xx.h" > =20 > static void putstr(const char *ptr); > =20 > @@ -143,6 +144,9 @@ decompress_kernel(unsigned long output_start, > unsigned long free_mem_ptr_p, free_mem_end_ptr =3D > free_mem_ptr_end_p; __machine_arch_type =3D arch_id; > =20 > +#ifdef CONFIG_ARCH_EP93XX > + ep93xx_decomp_setup(); > +#endif > arch_decomp_setup(); > =20 > putstr("Uncompressing Linux..."); > diff --git a/arch/arm/configs/ep93xx_defconfig > b/arch/arm/configs/ep93xx_defconfig index 88d5ecc2121e..fef802b7af8c > 100644 --- a/arch/arm/configs/ep93xx_defconfig > +++ b/arch/arm/configs/ep93xx_defconfig > @@ -11,6 +11,8 @@ CONFIG_MODULE_UNLOAD=3Dy > CONFIG_MODULE_FORCE_UNLOAD=3Dy > # CONFIG_BLK_DEV_BSG is not set > CONFIG_PARTITION_ADVANCED=3Dy > +CONFIG_ARCH_MULTI_V4T=3Dy > +# CONFIG_ARCH_MULTI_V7 is not set > CONFIG_ARCH_EP93XX=3Dy > CONFIG_MACH_ADSSPHERE=3Dy > CONFIG_MACH_EDB9301=3Dy > diff --git a/arch/arm/mach-ep93xx/Kconfig > b/arch/arm/mach-ep93xx/Kconfig index 15c68a646d51..aa502ab57404 100644 > --- a/arch/arm/mach-ep93xx/Kconfig > +++ b/arch/arm/mach-ep93xx/Kconfig > @@ -1,4 +1,16 @@ > # SPDX-License-Identifier: GPL-2.0-only > +menuconfig ARCH_EP93XX > + bool "EP93xx-based" > + depends on ARCH_MULTI_V4T > + select ARCH_SPARSEMEM_ENABLE > + select ARM_AMBA > + select ARM_VIC > + select CLKSRC_MMIO > + select CPU_ARM920T > + select GPIOLIB > + help > + This enables support for the Cirrus EP93xx series of CPUs. > + > if ARCH_EP93XX > =20 > menu "Cirrus EP93xx Implementation Options" Reviewed-by: Lukasz Majewski Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/4mn6drsee5/zQvIpZkMIvmi Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmJMD2cACgkQAR8vZIA0 zr3pZAgA0MvrFEPy3g/Eg/lgUneG9EhgXZyWYbM33yTRo7Xgb78wjq7vQFl0YB6V 9SMwmtpN54pNC4QFI3wLbyyo0h7tGaYZqfNt5Bm2oBBiUn42eEg++nttPFYy4HLA PM8sPdiXrSbTS/+S5W39L9rdeb3UVymxiHAwOyF+8kV5Dsw096+hDVTISSXOHnYp Q/gb+Nt7NIDhEmf1FXUZ9wkYuUHLoft4FCWgNVrPgI3Gy16fXZnzaKoLOc8ZNF+U DZWzoM8HRDvVZ/rHV1hbuFiS0WU/frL4MIISFtmfec5crvZK7EGP1sTKUchxkbrw CoPfnny+3N6ON86taoGTTw8SfF6XDA== =hCCs -----END PGP SIGNATURE----- --Sig_/4mn6drsee5/zQvIpZkMIvmi--