Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp761556pxp; Fri, 11 Mar 2022 14:26:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyg+QrXV5YmmCKd9OBNIOdRisGJ1hCcvzwWNLahkT+IwXGbLjlC2eYunr+NSj68J4qhZ65X X-Received: by 2002:a63:1c58:0:b0:380:bfd8:9e10 with SMTP id c24-20020a631c58000000b00380bfd89e10mr10339495pgm.422.1647037568914; Fri, 11 Mar 2022 14:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647037568; cv=none; d=google.com; s=arc-20160816; b=CKVbykwPzbW0ATaKxYpfAbA8ppOpUnxA9Gl+RhDdbpxXrd2TttSkhjGKn5RHZwfQAi VKAnMycsp2eRUvsmfgnEQsdNRltcliY42ro8aSbMk9lMsZTSdO7JWqtb0Z5U01OyW3Ec qONqHM4Ev6SmR4Q3b8RIkWMw0e5fVV11g+zxYZnLnNoNBxZ8UIfFawzahO0etl4yQU5C yfyYIYjobPeIqkCC5jvsR0OMp863xDcAFbfr7plc5OOqdh2fxTTEj2y8G3NnOZdZReI5 1cL5PG4re/nrorSIs5Reos6YkMa7N1Ve9CP6Ywgk7HG3hDjKFGnvvzbdP5DDx2faUkFh op8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=nk1xQ3pjYrPtfxWbdudDNfKDrot8jxBQa/Xg44+x52A=; b=EfVTGbcDQIES10r86OM0v+4IWLb7x/0WavGqhNZvKiUpzfr8jgnbFTOQmThwRAXS9I KIsHPwqq2fnAYlEBChe1e3A/x+kGag8x3Q05pgJgbxYmfk4Em9x9J3Y27vGmAPrx/bI3 dBHO9YJJx6aahqZBc+zZRFrDgUpXK5/8K4ent6H9PyzfLzELUXLROjSTf3T5ggASq48u 5FnZtgBL+S/btXn04hxE4OG9jiAGlrQQsCKmM1r/BuPA43OwjvqJTe5oaCAczD6ZJVX1 E0yR4drHb48w3r9vebXUfMGheKh/CblbzziMuHC/ghj8rxCcfv2fcWgbyMVSub8L6FJ0 pG3A== ARC-Authentication-Results: i=1; mx.google.com; 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 x12-20020a17090a970c00b001bfacde16d8si6109500pjo.99.2022.03.11.14.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:26:08 -0800 (PST) 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; 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 300EF2359F4; Fri, 11 Mar 2022 13:33:34 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346992AbiCKIH2 (ORCPT + 99 others); Fri, 11 Mar 2022 03:07:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbiCKIH1 (ORCPT ); Fri, 11 Mar 2022 03:07:27 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7111B6E05 for ; Fri, 11 Mar 2022 00:06:24 -0800 (PST) Received: from mail-wm1-f53.google.com ([209.85.128.53]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.113]) with ESMTPSA (Nemesis) id 1My3Mv-1oM5eD3qLH-00zYJR for ; Fri, 11 Mar 2022 09:06:22 +0100 Received: by mail-wm1-f53.google.com with SMTP id n33-20020a05600c3ba100b003832caf7f3aso5509857wms.0 for ; Fri, 11 Mar 2022 00:06:22 -0800 (PST) X-Gm-Message-State: AOAM5310TF+G4M7OM00PY2EJ32ECAOoPAbLio8j13ThtW+Skz0S17Gv7 9hFvkMz1RX7Bqu5WnQinYbuztXlVkyBli77FF7g= X-Received: by 2002:a1c:4e15:0:b0:387:3661:e857 with SMTP id g21-20020a1c4e15000000b003873661e857mr14436323wmh.94.1646985982435; Fri, 11 Mar 2022 00:06:22 -0800 (PST) MIME-Version: 1.0 References: <20220310195229.109477-1-nick.hawkins@hpe.com> In-Reply-To: <20220310195229.109477-1-nick.hawkins@hpe.com> From: Arnd Bergmann Date: Fri, 11 Mar 2022 09:06:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 01/10] arch: arm: mach-hpe: Introduce the HPE GXP architecture To: "Hawkins, Nick" Cc: "Verdun, Jean-Marie" , Russell King , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:qdcpI9WEjLKeIGB6mDZLdCRyYo8yHJzcY1bK1yrfmH3TCGfaTF4 PMwjOWsaaNcT+FiqNcHh67ZKAywzD6s8Tf7fuU9ZW/VE0QozurEObBbLX3gkcEYPQTZUbin PD4sSFR/wVsKbGJb7Hsfbqa0EXcoIKhmWkmxh7SSW5LIya43o7e7qP8lYdpbwN4K7G++bCk eXRPw+mdGZ0TaVHISG0yw== X-UI-Out-Filterresults: notjunk:1;V03:K0:+63tD2KNLus=:Q9y9m4bKvLdW2uXoCRos0i zZlde72WDOMM3Di7SY9mQ+U5lnx7FAaiCkq0qx2r3Zy5YAeVAwfowBSin4C7SYruSAnKrgPsg Zr9T3IPHkk+M3dJdh1+uEvXzZuZEoQX4w96X8kGXR7YLWEMkymhzM7HCO7sNToE4l+caF8QyH eFbnrNk/KdGDuF1Q9LMlJiAIaH35fiJGPsZvA5yntKZ01A3YHJZ6cGiZtUhuP/UgXEynpHJ1O NMQso3owEHgFAUv/Ab0rtuM6MvHRn9bZwccwIRbv1TXpKsM3C6mpYIL7y5O57LGYPJ5kSK2PU dmQ9h7j2rJAnbD208WehY+rRgt2fuBL9h2LHTULFfLe2Oh5Tt1NktNQ8BHkwHv4VRq0nejasB hPvN88WTyQFRbMD7hPlQz2kCeo9U1MWARy5umWcssmXSsQBi0V5SM4siOHKrPmcbe7B3KsEFq kdTzXbITKK75Sm5F9Jh/pHAgntdkoAIsGa5GLqOTV/WDqRfzxPZfcPPwC8OwhL8URBMYq5PEb U3WJBY0Y6JwWOl99Qr2saWWlHapf+DWrQ5yHP8lVaEoWURQlvKAH9lf8fj5n5frdxAReZ4yOh 0os/3KOq2lHka2zUd5j9f945yn99Tb+I4Qv027VoVrTqEUEZ7aFwJY7aX6hRLhLahKvtRDF11 +vFGkDPA0RsX06n3bkkMqXYpoaUhJikZnuQajdszadB1dg3IFD4JhtAyJd53OVsKZMNA= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 On Thu, Mar 10, 2022 at 8:52 PM wrote: > > From: Nick Hawkins > > The GXP is the HPE BMC SoC that is used in the majority > of HPE Generation 10 servers. Traditionally the asic will > last multiple generations of server before being replaced. > In gxp.c we reset the EHCI controller early to boot the asic. > > Info about SoC: > > HPE GXP is the name of the HPE Soc. This SoC is used to implement > many BMC features at HPE. It supports ARMv7 architecture based on > the Cortex A9 core. It is capable of using an AXI bus to which > a memory controller is attached. It has multiple SPI interfaces > to connect boot flash and BIOS flash. It uses a 10/100/1000 MAC > for network connectivity. It has multiple i2c engines to drive > connectivity with a host infrastructure. The initial patches > enable the watchdog and timer enabling the host to be able to > boot. > > Signed-off-by: Nick Hawkins Please add me to Cc for the entire series when resending. > +config ARCH_HPE_GXP > + bool "HPE GXP SoC" > + select ARM_VIC > + select PINCTRL > + select IRQ_DOMAIN > + select GENERIC_IRQ_CHIP > + select MULTI_IRQ_HANDLER > + select SPARSE_IRQ > + select CLKSRC_MMIO > + depends on ARCH_MULTI_V7 By convention, the 'depends on' usually comes first here. Please drop the 'select' statements for things that are already selected by ARCH_MULTIPLATFORM or ARCH_MULTI_V7. > + > +#define IOP_REGS_PHYS_BASE 0xc0000000 > +#define IOP_REGS_VIRT_BASE 0xf0000000 > +#define IOP_REGS_SIZE (240*SZ_1M) > +#define RESET_CMD 0x00080002 > + > +static struct map_desc gxp_io_desc[] __initdata = { > + { > + .virtual = (unsigned long)IOP_REGS_VIRT_BASE, > + .pfn = __phys_to_pfn(IOP_REGS_PHYS_BASE), > + .length = IOP_REGS_SIZE, > + .type = MT_DEVICE, > + }, > +}; It looks like this is only used for the pxf_restart() function below. In this case, you should get rid of the static mapping entirely and use an ioremap() in the gxp_dt_init() function instead, ideally getting the address from an appropriate device node rather than hardcoding it here. If there are other drivers using the static mapping, either explain here why this is required, or try to change them to dynamic mappings as well. > +static void __init gxp_dt_init(void) > +{ > + void __iomem *gxp_init_regs; > + struct device_node *np; > + > + np = of_find_compatible_node(NULL, NULL, "hpe,gxp-cpu-init"); > + gxp_init_regs = of_iomap(np, 0); > + > + /*it is necessary for our SOC to reset ECHI through this*/ > + /* register due to a hardware limitation*/ > + __raw_writel(RESET_CMD, > + (gxp_init_regs)); My feeling is still that this should be done in the platform specific EHCI driver front-end. I think I commented on this before but don't remember getting an explanation why you can't have it there. > +static void gxp_restart(enum reboot_mode mode, const char *cmd) > +{ > + __raw_writel(1, (void __iomem *) IOP_REGS_VIRT_BASE); > +} With both of these, you should use writel() instead of __raw_write(). Using the __raw accessors breaks big-endian kernels (which you probably don't need, but shouldn't break for no reason anyway), and lacks serialization and atomicity of the access. A better place for the restart logic may be a separate driver in drivers/power/reset/, at least if this otherwise ends up being the only platform specific code you need. Arnd