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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 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 46DECC48BE5 for ; Wed, 16 Jun 2021 15:18:40 +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 420A961185 for ; Wed, 16 Jun 2021 15:18:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 420A961185 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C02580412; Wed, 16 Jun 2021 17:18:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 1BA848295B; Wed, 16 Jun 2021 17:18:35 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id BF7258031D for ; Wed, 16 Jun 2021 17:18:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DA3FD31B; Wed, 16 Jun 2021 08:18:30 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 52C113F694; Wed, 16 Jun 2021 08:18:30 -0700 (PDT) Date: Wed, 16 Jun 2021 16:18:14 +0100 From: Andre Przywara To: Daniel Maslowski Cc: u-boot@lists.denx.de Subject: Re: Cannot build with SPI_SUNXI Message-ID: <20210616161814.3834c9aa@slackpad.fritz.box> In-Reply-To: <4cc336ac-08bf-88ac-522b-e8cf82ca8e32@orangecms.org> References: <4cc336ac-08bf-88ac-522b-e8cf82ca8e32@orangecms.org> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Sat, 12 Jun 2021 21:16:38 +0200 Daniel Maslowski wrote: Hi, > I am trying to get an OLinuXino-A64 board with a SPI flash to work: > > - U-Boot in the SPI flash, with TF-A, SPL and DTB > - Linux in the SPI flash, loaded and run by U-Boot Please keep in mind that the latter is not really the idea of SPI flash usage on those boards: for holding proper kernels it's quite small, and updating is not easy. Also finding the kernel on there is non-standard. At the end of the day you probably need some rootfs anyway, so why not put the kernel on there, where it can be easily found and updated? But to your question: > I can build U-Boot with SPI_SUNXI_SPL just fine. It boots from the > flash, and jumping to regular U-Boot works, too. However, the second > U-Boot no longer recognizes the SPI bus. I figured out that there is a > dedicated option `CONFIG_SPI_SUNXI`. Now when I activate that and try to > build again, the linker is having trouble finding core device driver > functions: You don't need to activate that, it's already done by default in the A64 Kconfig. The only thing that's missing is some SPI *flash* chip support, so CONFIG_SPI_FLASH_WINBOND=y. Not really sure how you get to this error, do you manipulate the .config manually? Please note that keeping your private .config doesn't really work as nicely as in the kernel, so I'd always advise to do the required changes on top of what the current defconfig creates. Adding the Winbond support builds fine for me, but didn't work in a quick test (on a Pine64-LTS): jedec_spi_nor flash@0: unrecognized JEDEC id bytes: 00, 00, 00 Need to have a look later, I am pretty sure this worked like this some time ago. Cheers, Andre > > MKIMAGE u-boot-dtb.img > COPY u-boot.bin > CC spl/common/spl/spl.o > CC spl/lib/display_options.o > CC spl/drivers/spi/spi-sunxi.o > AR spl/lib/built-in.o > AR spl/common/spl/built-in.o > AR spl/drivers/spi/built-in.o > AR spl/drivers/built-in.o > LD spl/u-boot-spl > drivers/spi/spi-sunxi.o: In function `sun4i_spi_set_mode': > /home/bob/build/racklet/olinuxino-a64/u-boot/drivers/spi/spi-sunxi.c:459: undefined > reference to `dev_get_priv' > drivers/spi/spi-sunxi.o: In function `sun4i_spi_set_cs': > /home/bob/build/racklet/olinuxino-a64/u-boot/drivers/spi/spi-sunxi.c:167: undefined > reference to `dev_get_priv' > drivers/spi/spi-sunxi.o: In function `sun4i_spi_release_bus': > /home/bob/build/racklet/olinuxino-a64/u-boot/drivers/spi/spi-sunxi.c:329: undefined > reference to `dev_get_priv' > > and so on. > > I am using the U-Boot config and patch for SPI flash in DTS and > defconfig in here: > https://github.com/orangecms/arm-cpu/tree/main/olinuxino-a64 > > I'd be glad to get this to work; any hint is welcome. :) > > Thanks and stay safe! > Dan > > -- > > Daniel Maslowski > > # IT'S TINY, QUICK & ORANGE # > # https://www.orangecms.org # > > Twentmannstr. 56 > D-45141 Essen > Germany