From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B71CC433E6 for ; Thu, 21 Jan 2021 11:18:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDAED2395B for ; Thu, 21 Jan 2021 11:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729780AbhAULSk (ORCPT ); Thu, 21 Jan 2021 06:18:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:41902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730198AbhAULPW (ORCPT ); Thu, 21 Jan 2021 06:15:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B5F442389F for ; Thu, 21 Jan 2021 11:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611227681; bh=ddk3X8hCyMMRHCqndajwhV3XuynJusmedPsa5EFnhHM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZJI75GiydmUOAxuq1KkZi3ZMASu8oAaloUJuz05/n0oDj1uAmyfn1njSKoHClXXGW N0Yc36+jNRpViPF9f2+aJth3Tpgc+i5bBrjyiqIbkIiod++rpPPRWi6OfmpwzuM00f CwpjJCjII1UTZmMErdeHF1PXG5dv2JjSnLzSgGrNo3/9b3we7LSkhA2txSPoUONOoI pe3ELWv5rp5RDUjmh37VX6wBowOv/wmQ/d8zulax6iYEj4Zb0RIdVq0/OR8Uwody5X Q3wgtajJfu9RgXK4lYXT8jv5gY954srTr0F5nPYqlvIQ04zaPONE/LDrIHyrYGmOXN YXZ9oMFydNloA== Received: by mail-oo1-f46.google.com with SMTP id o5so385430oop.12 for ; Thu, 21 Jan 2021 03:14:41 -0800 (PST) X-Gm-Message-State: AOAM533s0ZiszxoRhry5IurQB3KbpxnIEbWpeMi9G4pMfJITw4TX1sQc uUkU8PJSgpbABB9XwL7FBrfR6Et2e98PjC+4oFI= X-Google-Smtp-Source: ABdhPJxTmL9XdMSlKdLOo8+neSbqdS7ux2pEcd//HgymdPtaZUakSzssVtcQkqsPe+WtTk3humMNJdS4E5u0wGjnj7I= X-Received: by 2002:a4a:9c01:: with SMTP id y1mr9077143ooj.15.1611227680918; Thu, 21 Jan 2021 03:14:40 -0800 (PST) MIME-Version: 1.0 References: <20210120132717.395873-1-mohamed.mediouni@caramail.com> <20210120132717.395873-7-mohamed.mediouni@caramail.com> In-Reply-To: <20210120132717.395873-7-mohamed.mediouni@caramail.com> From: Arnd Bergmann Date: Thu, 21 Jan 2021 12:14:24 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 6/7] arm64: kernel: Apple CPU start driver To: Mohamed Mediouni Cc: Linux ARM , Mark Rutland , Catalin Marinas , Hector Martin , "linux-kernel@vger.kernel.org" , Marc Zyngier , Will Deacon , Stan Skowronek Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni wrote: > diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml > index 14cd727d3c4b..a6ff8cb3db1e 100644 > --- a/Documentation/devicetree/bindings/arm/cpus.yaml > +++ b/Documentation/devicetree/bindings/arm/cpus.yaml > @@ -176,6 +176,7 @@ properties: > oneOf: > # On ARM v8 64-bit this property is required > - enum: > + - apple > - psci > - spin-table > # On ARM 32-bit systems this property is optional This uses a very generic identifier for doing something that may be very specific to a particular SoC generation. It's going to be hard to decide what the right abstraction will be for long-term maintenance, so I'd recommend starting with a boot loader that implements spin-table for secondary startup, and getting back to this after more of the basic stuff works. > +static int cpu_apple_start_prepare(unsigned int cpu) > +{ > + struct device_node *node; > + struct cpu_apple_start_info *info; > + > + info = per_cpu_ptr(&cpu_apple_start_info, cpu); > + > + if (info->pmgr_start && info->cputrc_rvbar && info->dbg_unlock) > + return 0; > + > + node = of_find_compatible_node(NULL, NULL, "apple,startcpu"); > + if (!node) { > + pr_err("%s: missing startcpu node in device tree.\n", __func__); > + return -EINVAL; > + } Where is the binding documentation for this? The way you do a separate of_iomap() for each CPU suggests that this is not a great binding to start with. Are these perhaps just individual registers within a larger IP block in the end? Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D42DFC433E0 for ; Thu, 21 Jan 2021 11:16:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 717D123877 for ; Thu, 21 Jan 2021 11:16:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 717D123877 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Mz3SjKKBJwySXqRcDyq0bvu3MZ/JX74tfRm/uqReOr0=; b=Dh0pUfl7R+BiJNfUOGiSWra4z XG8KlmQ8QXn9A0B/LZr/vdo2IbIEQsNWGGZ4cbtpfmVjc42DbDDO3N5ksQDxZ6a1v1cBdfQJ0fB5M CYkFP8CaE6guD+hmSj8xk41GuN8OiZDmgNc12HUDKCz1QoTRpx4sPgtM/aG9fcqn/OU7V4gDBKJ07 0SxR4UtekPOPGKfBSwD+KvVm1I1t5Bwfv5f1s9Fc3EklOkw8pGnOkZ63Bf9smXwArFYiFTAqRctS8 b3NMVV+Ukm0Pvr+hNcAMtLb34Im7yJlf7SVRwR0NNSK64S9FiiYys8yLu1wIhk/Y/lL6gGzFSx2eZ o/nxiEQdg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2XvI-0004Gj-Hz; Thu, 21 Jan 2021 11:14:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2XvH-0004GL-Bm for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 11:14:44 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28E3F238A0 for ; Thu, 21 Jan 2021 11:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611227682; bh=ddk3X8hCyMMRHCqndajwhV3XuynJusmedPsa5EFnhHM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=o9IJ2QYu320PdxCChbS8uW8CLYP4A1XAwhdxgMc0DEVP+3h9bo40HVIS7F27+zpVl GOZJk8JXAN822Kuw4+RutRN8GamTf1dv2jeOfsdxYmgqO77ptyCKkMBn5Xx+j8hPQK lz2AuLJ3rqf26vK4Ma23zQDowMUf8hGr4+PlNz7UJjJjAruJwQz1z9445K5xkHMSyS PZMY9TjPqPlKJzeac1oEPKRv1FO9h+wny2/IL6EDIuiU2LQZDLZWj7/uTlJ0RXfpgF tJbUzKjRrcyJo43ic3ZV3ftbsl2wmsnoNNHrGaU8pw9B0luccTkQExsNsxaxlyPc4L EeSfy0dORPWEw== Received: by mail-oo1-f47.google.com with SMTP id q3so397873oog.4 for ; Thu, 21 Jan 2021 03:14:42 -0800 (PST) X-Gm-Message-State: AOAM5337cVxW4+Hl7aHzvymxc5Doh6bFOS7OvsZ0JG+TG5fNpxQV9KoZ rwYPyozgCMAJg9v0wKkFPCjsl8Jl0HEtoo7CJZQ= X-Google-Smtp-Source: ABdhPJxTmL9XdMSlKdLOo8+neSbqdS7ux2pEcd//HgymdPtaZUakSzssVtcQkqsPe+WtTk3humMNJdS4E5u0wGjnj7I= X-Received: by 2002:a4a:9c01:: with SMTP id y1mr9077143ooj.15.1611227680918; Thu, 21 Jan 2021 03:14:40 -0800 (PST) MIME-Version: 1.0 References: <20210120132717.395873-1-mohamed.mediouni@caramail.com> <20210120132717.395873-7-mohamed.mediouni@caramail.com> In-Reply-To: <20210120132717.395873-7-mohamed.mediouni@caramail.com> From: Arnd Bergmann Date: Thu, 21 Jan 2021 12:14:24 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 6/7] arm64: kernel: Apple CPU start driver To: Mohamed Mediouni X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_061443_477794_AAF11C3E X-CRM114-Status: GOOD ( 15.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , Hector Martin , "linux-kernel@vger.kernel.org" , Marc Zyngier , Will Deacon , Linux ARM , Stan Skowronek Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni wrote: > diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml > index 14cd727d3c4b..a6ff8cb3db1e 100644 > --- a/Documentation/devicetree/bindings/arm/cpus.yaml > +++ b/Documentation/devicetree/bindings/arm/cpus.yaml > @@ -176,6 +176,7 @@ properties: > oneOf: > # On ARM v8 64-bit this property is required > - enum: > + - apple > - psci > - spin-table > # On ARM 32-bit systems this property is optional This uses a very generic identifier for doing something that may be very specific to a particular SoC generation. It's going to be hard to decide what the right abstraction will be for long-term maintenance, so I'd recommend starting with a boot loader that implements spin-table for secondary startup, and getting back to this after more of the basic stuff works. > +static int cpu_apple_start_prepare(unsigned int cpu) > +{ > + struct device_node *node; > + struct cpu_apple_start_info *info; > + > + info = per_cpu_ptr(&cpu_apple_start_info, cpu); > + > + if (info->pmgr_start && info->cputrc_rvbar && info->dbg_unlock) > + return 0; > + > + node = of_find_compatible_node(NULL, NULL, "apple,startcpu"); > + if (!node) { > + pr_err("%s: missing startcpu node in device tree.\n", __func__); > + return -EINVAL; > + } Where is the binding documentation for this? The way you do a separate of_iomap() for each CPU suggests that this is not a great binding to start with. Are these perhaps just individual registers within a larger IP block in the end? Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel