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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D554C433EF for ; Sat, 25 Sep 2021 13:28:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 70C9D61151 for ; Sat, 25 Sep 2021 13:28:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 70C9D61151 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C91F6834FC; Sat, 25 Sep 2021 15:28:26 +0200 (CEST) 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="LmZHAWQr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E38838350D; Sat, 25 Sep 2021 15:28:10 +0200 (CEST) Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) (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 24277834FA for ; Sat, 25 Sep 2021 15:27:56 +0200 (CEST) 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-vs1-xe2c.google.com with SMTP id x74so12991243vsx.13 for ; Sat, 25 Sep 2021 06:27:56 -0700 (PDT) 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=fnt28//gMF+a9ltNPeAZNZKF2wytk2E9zwSMUrx6kLk=; b=LmZHAWQrrxIzyzx52tosWTfC3ph8+vIBHyjvNCDBIvm9m9UTqwhw1AoJryW2rVzPhA e63G8t42OSG5x1JzwxDuyV/M4WeljVg/Fi0S6Bz6149MmXwJNdr2MRJGSFNZ6jr+Ygl+ uBJ12K1Ift5XiIKmtHhKqGic7+5B3nru4edOo= 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=fnt28//gMF+a9ltNPeAZNZKF2wytk2E9zwSMUrx6kLk=; b=nH3q2Qt+1YhDaByQVsACZkM7/tLxaSbASXNfeno9HVLlh+RU4D7BUpIwESDNANCmf9 +EUW8v3nYDX0/8FmhoeVNnIvn6INVTvEG3Yp5nPO0F3FM4NZfB3MKKFHbqYwT4mS+K5w lx7Zn7iRoEdFzdZxL9VFLt0audXnbcadCxYLLIF9EXh/wZ4rGqf7/QcMN61A4d3gxbju 8UjS6tU31VVWkP1hPzdCHqsnbTXBDl+xUqnnVMDJDttQhXmpA+YDmORnkEONxpIIj8E9 wPPVoVe2Bb+2xHgDnd3fqI2Iy0eRZ8jspp3UpPrO8gtLIbEwwA0+6/9G91KTCaaCzUlF F3jQ== X-Gm-Message-State: AOAM533cGq+dsRhWjz0uyREl47m7BRHVGk50/JxwmRZ/z2do+cZWazi8 ta4MdL+tS0xxAWRLBIALRqhsqC3RPuO+gSKBF3/ucQ== X-Google-Smtp-Source: ABdhPJyc8Bgpx7/voeBAGT8jqMHgtq2WzmeZWvX68IMJRzoeWUUCh3NCFLoaE3PGIJFpwTjyv1Kq2ymGVKMNJlAqI9E= X-Received: by 2002:a67:67c1:: with SMTP id b184mr13969198vsc.59.1632576474706; Sat, 25 Sep 2021 06:27:54 -0700 (PDT) MIME-Version: 1.0 References: <20210918135437.36667-1-kettenis@openbsd.org> <20210918135437.36667-2-kettenis@openbsd.org> <56146c3140e207f5@bloch.sibelius.xs4all.nl> <20210921124220.GE8579@bill-the-cat> <56147354b55fb501@bloch.sibelius.xs4all.nl> In-Reply-To: <56147354b55fb501@bloch.sibelius.xs4all.nl> From: Simon Glass Date: Sat, 25 Sep 2021 07:27:43 -0600 Message-ID: Subject: Re: [PATCH 1/5] arm: apple: Add initial support for Apple's M1 SoC To: Mark Kettenis Cc: Bin Meng , Tom Rini , Mark Kettenis , U-Boot Mailing List , Bharat Gooty , Rayagonda Kokatanur , Oliver Graute , Bin Meng , Leo Liang , Tianrui Wei , Stephan Gerhold , Padmarao Begari , Kishon Vijay Abraham I , Heinrich Schuchardt , Michael Walle , Masami Hiramatsu , Asherah Connor , Wasim Khan , Michal Simek , Igor Opaniuk , Heiko Schocher , Ye Li , Stefan Roese , Vabhav Sharma , =?UTF-8?B?TWFyZWsgQmVow7pu?= , Weijie Gao , AKASHI Takahiro , Andy Shevchenko , Pratyush Yadav Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Mark, On Tue, 21 Sept 2021 at 10:09, Mark Kettenis wrote: > > > From: Bin Meng > > Date: Tue, 21 Sep 2021 23:53:10 +0800 > > > > On Tue, Sep 21, 2021 at 8:42 PM Tom Rini wrote: > > > > > > On Sun, Sep 19, 2021 at 10:33:25PM +0200, Mark Kettenis wrote: > > > > > From: Bin Meng > > > > > Date: Sun, 19 Sep 2021 09:17:07 +0800 > > > > > > > > > > Hi Mark, > > > > > > > > > > On Sun, Sep 19, 2021 at 9:04 AM Bin Meng wrote: > > > > > > > > > > > > Hi Mark, > > > > > > > > > > > > On Sat, Sep 18, 2021 at 9:55 PM Mark Kettenis wrote: > > > > > > > > > > > > > > Add support for Apple's M1 SoC that is used in "Apple Silicon" > > > > > > > Macs. This builds a basic U-Boot that can be used as a payload > > > > > > > for the m1n1 boot loader being developed by the Asahi Linux > > > > > > > project. > > > > > > > > > > > > > > Signed-off-by: Mark Kettenis > > > > > > > --- > > > > > > > arch/arm/Kconfig | 22 ++++ > > > > > > > arch/arm/Makefile | 1 + > > > > > > > arch/arm/mach-apple/Kconfig | 18 ++++ > > > > > > > arch/arm/mach-apple/Makefile | 4 + > > > > > > > arch/arm/mach-apple/board.c | 158 ++++++++++++++++++++++++++++ > > > > > > > arch/arm/mach-apple/lowlevel_init.S | 16 +++ > > > > > > > configs/apple_m1_defconfig | 14 +++ > > > > > > > include/configs/apple.h | 38 +++++++ > > > > > > > 8 files changed, 271 insertions(+) > > > > > > > create mode 100644 arch/arm/mach-apple/Kconfig > > > > > > > create mode 100644 arch/arm/mach-apple/Makefile > > > > > > > create mode 100644 arch/arm/mach-apple/board.c > > > > > > > create mode 100644 arch/arm/mach-apple/lowlevel_init.S > > > > > > > create mode 100644 configs/apple_m1_defconfig > > > > > > > create mode 100644 include/configs/apple.h > > > > > > > [..] > > > > > > > diff --git a/arch/arm/mach-apple/lowlevel_init.S b/arch/arm/mach-apple/lowlevel_init.S > > > > > > > new file mode 100644 > > > > > > > index 0000000000..0f5313163e > > > > > > > --- /dev/null > > > > > > > +++ b/arch/arm/mach-apple/lowlevel_init.S > > > > > > > @@ -0,0 +1,16 @@ > > > > > > > +/* SPDX-License-Identifier: GPL-2.0+ */ > > > > > > > +/* > > > > > > > + * (C) Copyright 2021 Mark Kettenis > > > > > > > + */ > > > > > > > + > > > > > > > +.align 8 > > > > > > > +.global fw_dtb_pointer > > > > > > > +fw_dtb_pointer: > > > > > > > + .quad 0 > > > > > > > > > > > > Is this filled in by m1n1? > > > > > > > > > > Sorry I misread, so this is passed by m1n1 and filled in by U-Boot. I > > > > > think we should stop using CONFIG_OF_BOARD, and for such case we > > > > > should use CONFIG_OF_PRIOR_STAGE. > > > > > > > > Yes, CONFIG_OF_PRIOR_STAGE would work as well. But Tom was talking > > > > about removing that option in favour of CONFIG_OF_BOARD the other day. > > > > > > Yes. I was even looking for some feedback from you, Bin, on converting > > > some boards from CONFIG_OF_PRIOR_STAGE to CONFIG_OF_BOARD. It seems > > > like CONFIG_OF_PRIOR_STAGE is a subset of CONFIG_OF_BOARD, at the cost > > > of possibly a few bytes. > > > > Ah, I thought we wanted to do the other way around, by removing > > CONFIG_OF_BOARD, and convert that to CONFIG_OF_PRIORI_STAGE? > > I must say that I see some logic in keeping both, where > CONFIG_OF_BOARD indicates that the device tree is somehow stored on > the board and U-Boot has to run some code to fetch it, and > CONFIG_OF_PRIOR_STAGE is used when the device tree is provided by > firmware that runs before U-Boot. > > In that case I obviously should use CONFIG_OF_PRIOR_STAGE here. Well see Ilias' series where he proposed going with OF_BOARD! Tested on: Macbook Air M1 Tested-by: Simon Glass Regards, Simon