Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp133551pxb; Thu, 21 Jan 2021 03:21:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXQ852DgStMZOeuc3j+vy1xrhKx+VwLOfA9Qkzd4xJeNpkm0+/CmL86YZrwXgpbeTSI9C9 X-Received: by 2002:a17:907:96a2:: with SMTP id hd34mr9323233ejc.494.1611228060827; Thu, 21 Jan 2021 03:21:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611228060; cv=none; d=google.com; s=arc-20160816; b=avINq7YOGJXx97jQR8EO4ssX1IhFoC2YqL4Af/753Sw102rtLujeJBrnmWqAfrx6rq 8vhMPblb3UfAIzEybnGuhA9TQKaiQ+i8buyUhjRsFzMTvdSWEX6d7gUA5eLZyotNpX+P iusCovpXZ0APxM3m4OoGGDU7I+mFEu9GQv7SoFWhb87xh1+x0Myc1RKRZbJX6PVDH6G3 Byass+ZG79V3UDolF4//qdcNy/yZ3f9l6U0uq51525j3Rs7zs2waXH3J3+XLh64YykG5 R6PD/aNTVISZlUHaxPdIl+FQEeVgCU8gwbpBdYsLTvGJuHkgjaV+P1WCrTP3pTvEhBqP rXcQ== 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:dkim-signature; bh=5j1/s7yO7oLakS0N/2iSrqrfb2CxiymmoO2zEy/3KTs=; b=Y9DSiOHwgrbkLq+5cNPLcgNlc9zLq7b+e+Fi6Rlej/D5m/lYTUzAgz8K6NtZ+vxsI1 3bi3yDvhisTxJDPGjp/h2WjWr4AKwQ4IO7ozPNCINMb/WFW4fSf0pj3m4/OFzqqITtbH voFqNZgqJRrfVFmaXBVsuMKXZEQIAClmGbTJ7IlKL/eUfgDbsKEMM8t4dYV5kUlZm7BB 95lA/7Ge2zzpT1xAk8bHFgCllmbAeae2yMO23Vj6koQDpbUbyq7UZciimEKN0snNeiEf lk3/yjZ4XHz3fUVd83U99NoZVk00zrWkZUAB1GmIkuPpm2yaWzJ/EIfjm4elR+mHhIPm B2pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZJI75Giy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si2179343edd.161.2021.01.21.03.20.36; Thu, 21 Jan 2021 03:21:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZJI75Giy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729054AbhAULSc (ORCPT + 99 others); Thu, 21 Jan 2021 06:18:32 -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-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