All of lore.kernel.org
 help / color / mirror / Atom feed
* Cannot build with SPI_SUNXI
@ 2021-06-12 19:16 Daniel Maslowski
  2021-06-16 15:18 ` Andre Przywara
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Maslowski @ 2021-06-12 19:16 UTC (permalink / raw)
  To: u-boot

Hi there,

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

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:

   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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Cannot build with SPI_SUNXI
  2021-06-12 19:16 Cannot build with SPI_SUNXI Daniel Maslowski
@ 2021-06-16 15:18 ` Andre Przywara
  0 siblings, 0 replies; 2+ messages in thread
From: Andre Przywara @ 2021-06-16 15:18 UTC (permalink / raw)
  To: Daniel Maslowski; +Cc: u-boot

On Sat, 12 Jun 2021 21:16:38 +0200
Daniel Maslowski <info@orangecms.org> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-16 15:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12 19:16 Cannot build with SPI_SUNXI Daniel Maslowski
2021-06-16 15:18 ` Andre Przywara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.