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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 454F8C433EF for ; Sat, 22 Jan 2022 17:17:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A813183494; Sat, 22 Jan 2022 18:17:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="iGt/ZuHQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BE4038343B; Sat, 22 Jan 2022 18:17:25 +0100 (CET) Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 16E0481FF1 for ; Sat, 22 Jan 2022 18:17:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x92e.google.com with SMTP id c36so22839001uae.13 for ; Sat, 22 Jan 2022 09:17:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b4Llc8DAHkBb9+AdDDelJWSK01Oo2/i5adyVuyVgnhA=; b=iGt/ZuHQGnYii7PgJX3UrW6LmI1ECYrBMrcmWcITJPTzkjgj3ljqqK2KvHyUDxV3fv OxkcJqXFKw++KkTe0FO50lcibzj5ycQffkc9k5Hh4GmQinP4NpzVxbhRGW40MrNJmQs5 2VuLa9l1I7vrsqbnBJRqIKCYb2cG2TvId8734= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b4Llc8DAHkBb9+AdDDelJWSK01Oo2/i5adyVuyVgnhA=; b=qTNp9qKZORLgiajUUBB5i53J2Bmmf39LQoPtW9elsGMhfHYaiFVCYQjnjjLmkfqhwb g9Dchqzt2wItDoyBk99F+ee38Mnxu980VfRg0g3AAFEQpIqTdZwfoLdibzQ1DOShmwCK AJDjm5/ELwxjA/60df5g8K5QcGxx1PHFZcQSL14XzEuS0m+oXmxl9mQBuML7tICPFijS AE82HmICmCa1pCOQFoLPQiiLRE935BPcFcNuDr7KPx+y6VJTIqPLYjCefLNxizCtL50R c7Pp7WXWQDRZb/zxQkUThlJV9rptMnDqzLOZGILlExiZ8FM5dt6iDPPg03ROV5d2VSJW v3dA== X-Gm-Message-State: AOAM532DRRGKzz+vmEF3IStNmCv58Ec7kfzZO6n58SLZDGInle/CWjUk Xqrga+gvLQBMYlTRh8AavVFL/U7zR0CDqEK29H5v8g== X-Google-Smtp-Source: ABdhPJyiMpKtn7D5nEMjSb7dsIGFx30a3s1z7+Ia30st9i4iK3gfob4QsKjnVyYyRNvnn4pH8DXBV3l0anWu2PWdqhU= X-Received: by 2002:a67:e252:: with SMTP id w18mr3414667vse.19.1642871841474; Sat, 22 Jan 2022 09:17:21 -0800 (PST) MIME-Version: 1.0 References: <20220114110438.58452-1-kettenis@openbsd.org> <20220114110438.58452-3-kettenis@openbsd.org> In-Reply-To: From: Simon Glass Date: Sat, 22 Jan 2022 10:17:07 -0700 Message-ID: Subject: Re: [PATCH 2/8] mailbox: apple: Add driver for Apple IOP mailbox To: Mark Kettenis Cc: Mark Kettenis , U-Boot Mailing List , Jaehoon Chung , Tom Rini , sven@svenpeter.dev, marcan@marcan.st, Bin Meng Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Hi Mark, On Sat, 22 Jan 2022 at 06:54, Mark Kettenis wrote: > > > From: Simon Glass > > Date: Fri, 21 Jan 2022 18:40:12 -0700 > > > > On Fri, 14 Jan 2022 at 04:05, Mark Kettenis wrote: > > > > > > This mailbox driver provides a communication channel with the > > > Apple IOP controllers found on Apple SoCs. These IOP controllers > > > are used to implement various functions such as the System > > > Manegement Controller (SMC) and NVMe storage. It allows sending > > > and receiving a 96-bit message over a single channel. > > > > > > The header file with the struct used for mailbox messages is taken > > > straight from Linux. > > > > > > Signed-off-by: Mark Kettenis > > > Signed-off-by: Sven Peter > > > --- > > > arch/arm/Kconfig | 1 + > > > drivers/mailbox/Kconfig | 11 +++++ > > > drivers/mailbox/Makefile | 1 + > > > drivers/mailbox/apple-mbox.c | 92 +++++++++++++++++++++++++++++++++++ > > > include/linux/apple-mailbox.h | 19 ++++++++ > > > 5 files changed, 124 insertions(+) > > > create mode 100644 drivers/mailbox/apple-mbox.c > > > create mode 100644 include/linux/apple-mailbox.h > > > > Reviewed-by: Simon Glass > > Tested on: Macbook Air M1 > > Tested-by: Simon Glass > > > > with nit below > > > > [..] > > > > > diff --git a/include/linux/apple-mailbox.h b/include/linux/apple-mailbox.h > > > new file mode 100644 > > > index 0000000000..720fbb7029 > > > --- /dev/null > > > +++ b/include/linux/apple-mailbox.h > > > @@ -0,0 +1,19 @@ > > > +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ > > > +/* > > > + * Apple mailbox message format > > > + * > > > + * Copyright (C) 2021 The Asahi Linux Contributors > > > + */ > > > + > > > +#ifndef _LINUX_APPLE_MAILBOX_H_ > > > +#define _LINUX_APPLE_MAILBOX_H_ > > > > Drop the _LINUX > > Hmm, this is a straight copy of the Linux header file. Isn't it > better to keep it unmodified? Most (all?) the other files in this > directory return the _LINUX bit... Oh I missed that this was supposed to be in this dir. Yes seems OK. > > > > + > > > +#include > > > + > > > +/* encodes a single 96bit message sent over the single channel */ > > > +struct apple_mbox_msg { > > > + u64 msg0; > > > + u32 msg1; > > > +}; > > > + > > > +#endif > > > -- > > > 2.34.1 > > > Regards, Simon