public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Marcin Woźniak" <marcin.wadowice@gmail.com>
To: u-boot@lists.denx.de
Subject: Rockchip RK3328 4-byte addressing problem in SPI
Date: Thu, 22 Dec 2022 21:15:53 +0100	[thread overview]
Message-ID: <f3451d5f-7b3b-e393-4ea7-370a86d45458@gmail.com> (raw)

Hello,

I would like to let you know how i've lost about 2 weeks because of lack 
of Rockchip BOOTROM documentation.

I tried to use Mainline Uboot to Boot NanoPI R2S using soldered SPI 
Winbond 25Q256 chip.

I had to make some patches in Uboot core files to make it work.

First one adds SPI boot device. File 
|arch/arm/mach-rockchip/rk3328/rk3328.c with adding: |

|[BROM_BOOTSOURCE_SPINOR] "/spi@ff190000", |const char * const 
boot_devices ||

Second was |arch/arm/mach-rockchip/spl-boot-order.c and last if statement:|

|if (!uclass_get_device_by_of_offset(UCLASS_SPI, node, &parent)) return 
BOOT_DEVICE_SPI;|

||

This patch is added because RockChip SPI driver is using UCLASS_SPI 
instead of SPI_FLASH so boot device wasn't connecting with right DM 
Driver rk_spi.c

Third one fixed SPL and it was added at the end: |drivers/spi/rk_spi.c
|

|DM_DRIVER_ALIAS(rockchip_rk3288_spi, rockchip_rk3328_spi);|

After that board booted successfully. Second bigger problem was a 
mistake and lack of RockChip Bootrom documentation.

I've soldered 32Mbyte Flash and didn't know that U-Boot in SPL was 
switching it's 3-byte address mode to 4-byte one to gain access to full 
32 Mbytes.

The problem was that board booted in cold-start but after issuing 
"reset" - it was going to MASKROM mode like no SPI was soldered or empty.

After loosing two weeks i figured that RockChip bootrom talks to SPI 
using only 3-byte addressing.

So leaving 4-byte switched by UBoot SPI chip made it unusable to 
RockChip Bootrom. I found this by dumping Bootrom and decompiling it.

I don't know if it's enough information to make a patch to MainLine  (at 
least for SPI boot in RK3328).

Problem with 3-byte addressing is a complete different story.

Sorry for my "unproffesional" mail. I am writing this type of message 
for a first time.

Marcin



||

||||||||

||

             reply	other threads:[~2022-12-23  0:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 20:15 Marcin Woźniak [this message]
2022-12-29 22:39 ` Rockchip RK3328 4-byte addressing problem in SPI Simon Glass
2022-12-30  9:35   ` Kever Yang
2023-01-03 14:14     ` Peter Robinson
2023-01-03 15:15       ` Michael Walle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3451d5f-7b3b-e393-4ea7-370a86d45458@gmail.com \
    --to=marcin.wadowice@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox