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 7044BC4332F for ; Fri, 23 Dec 2022 00:30:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E455851FF; Fri, 23 Dec 2022 01:30:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UnRlRi2d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D809585375; Thu, 22 Dec 2022 21:15:56 +0100 (CET) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 6016A852E5 for ; Thu, 22 Dec 2022 21:15:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marcin.wadowice@gmail.com Received: by mail-lf1-x12a.google.com with SMTP id x11so4394061lfn.0 for ; Thu, 22 Dec 2022 12:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=gr5wPIQJWbAaJnNHXhStQRzFoHiaJrwpzQd0Par/MTg=; b=UnRlRi2dpFibchRlv/Z9fOm80zjBOi6gl/LOMjatARGGsXELGFT1AEsNb5Ze9860xa HadG575VsvlsAgwpSekXucj0xD2KjoUbtQv5qtqkCXQLqWR0axOklR3HvqubvusBY3NZ H/yV6OX+dvYCOmwkcDtcg5Bs+XPaq5V+J9df0OdizGLxKTpPSIsdlFHYKuIMG30zWfmo QLRkWQEmfc1GaSEefkMbWhrXxo2iXv/syYwf0jZVNQepMsgGbJih2g5tXNd7ObnQ0C9z kwzeA4t+mJ7TiW0V26ydX0MCdws3cZLQQPj91/Vq/Dx2lXX59IwYPj7Q3loh5eBaLWMh qykg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gr5wPIQJWbAaJnNHXhStQRzFoHiaJrwpzQd0Par/MTg=; b=A/3cP20jU16scKo2bjodmo0K15tXBKAfaRMSiNn30pPIK2mxc+A9DkgGpwMyAAABPl SZoo+bFYHXW0H7YgOFSua3LGcscIeyodY7BKpi7jKyQCetteNxqU/XmK/wcLEbfUT2b5 j2E4CCUSHl0AhWIAvVG0gxSG1Vun+x/IKZdTcihXGz0UsDOmHpZNg52KUVAnluh/gs+Z qTGP48DxnohmQtFqDZHnQPPXvi8QGk6YMCElO7RTdCg9tXzqF7r76pqRzBCcym7GEOEZ eS6U5F4BlS3SHEsUCph6RgBtthEPak9HMar3LZc1lHOB8URBN6F5QPi0B/VN0TH0vtiC rCuQ== X-Gm-Message-State: AFqh2kpNcO0ljZ+ldZQDVerP8EoVWkibuJBDsWHcwwXK7qKC66251dk+ el1B5LJDS0qUN4CHf64a/kIqsYEKIYo= X-Google-Smtp-Source: AMrXdXt7MG6i2+SkWZd6k81ShLR15pQVCyfwZ6zyniKVRJmEHwFCMHg2P0VdB0/V2xhPgxPr7vJs6w== X-Received: by 2002:a05:6512:acd:b0:4b5:a206:30ee with SMTP id n13-20020a0565120acd00b004b5a20630eemr3874806lfu.65.1671740153216; Thu, 22 Dec 2022 12:15:53 -0800 (PST) Received: from [192.168.1.10] ([176.116.200.237]) by smtp.gmail.com with ESMTPSA id e9-20020a05651236c900b004b56d00b2d1sm188809lfs.285.2022.12.22.12.15.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Dec 2022 12:15:52 -0800 (PST) Message-ID: Date: Thu, 22 Dec 2022 21:15:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US To: u-boot@lists.denx.de From: =?UTF-8?Q?Marcin_Wo=c5=baniak?= Subject: Rockchip RK3328 4-byte addressing problem in SPI X-Mailman-Approved-At: Fri, 23 Dec 2022 01:30:34 +0100 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean 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 || |||||||| ||