From 9dc8c9ae3c672f9d57b120e8bfaddb56aa0f0838 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Feb 29 2024 19:53:30 +0000 Subject: Update to 2024.04 RC3 Enable a number of new upstream devices Upstream now builds Rockchip SPI artifacts Various cleanups Fix ESP partition detection to enable EFI vars --- diff --git a/0001-Revert-rockchip-rockpro64-Build-u-boot-rockchip-spi..patch b/0001-Revert-rockchip-rockpro64-Build-u-boot-rockchip-spi..patch deleted file mode 100644 index 30e4ad8..0000000 --- a/0001-Revert-rockchip-rockpro64-Build-u-boot-rockchip-spi..patch +++ /dev/null @@ -1,41 +0,0 @@ -From ed5ffb3b53690a47333b931301a3765b9588b5dc Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 11 Jun 2023 21:22:41 +0100 -Subject: [PATCH] Revert "rockchip: rockpro64: Build u-boot-rockchip-spi.bin" - -This reverts commit 5713135ecc75660684ff3eb6cfba7bc11eb6433c. ---- - configs/rockpro64-rk3399_defconfig | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig -index f41c0306790..0ca2cecade2 100644 ---- a/configs/rockpro64-rk3399_defconfig -+++ b/configs/rockpro64-rk3399_defconfig -@@ -11,7 +11,6 @@ - CONFIG_DEFAULT_DEVICE_TREE="rk3399-rockpro64" - CONFIG_DM_RESET=y - CONFIG_ROCKCHIP_RK3399=y --CONFIG_ROCKCHIP_SPI_IMAGE=y - CONFIG_TARGET_ROCKPRO64_RK3399=y - CONFIG_SPL_STACK=0x400000 - CONFIG_DEBUG_UART_BASE=0xFF1A0000 -@@ -21,7 +20,6 @@ - CONFIG_SYS_LOAD_ADDR=0x800800 - CONFIG_PCI=y - CONFIG_DEBUG_UART=y --CONFIG_LTO=y - CONFIG_SPL_FIT_SIGNATURE=y - CONFIG_LEGACY_IMAGE_FORMAT=y - CONFIG_BOOTSTAGE=y -@@ -40,7 +38,6 @@ - CONFIG_SPL_STACK_R=y - CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 - CONFIG_SPL_SPI_LOAD=y --CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000 - CONFIG_TPL=y - CONFIG_CMD_BOOTZ=y - CONFIG_CMD_GPT=y --- -2.41.0 - diff --git a/aarch64-boards b/aarch64-boards index 39a556a..07154e5 100644 --- a/aarch64-boards +++ b/aarch64-boards @@ -1,4 +1,5 @@ a64-olinuxino +a64-olinuxino-emmc amarula_a64_relic apple_m1 bananapi_m2_plus_h5 @@ -8,6 +9,8 @@ dragonboard410c dragonboard820c dragonboard845c eaidk-610-rk3399 +emlid_neutis_n5_devboard +evb-px5 evb-rk3328 evb-rk3399 ficus-rk3399 @@ -39,17 +42,23 @@ nanopi_neo2 nanopi-neo4-rk3399 nanopi_neo_plus2 nanopi_r1s_h5 +nanopi-r2c-plus-rk3328 +nanopi-r2c-rk3328 nanopi-r2s-rk3328 nanopi-r4s-rk3399 +oceanic_5205_5inmfd odroid-c2 orangepi_3 orangepi_lite2 orangepi_one_plus orangepi_pc2 orangepi_prime +orangepi-r1-plus-lts-rk3328 +orangepi-r1-plus-rk3328 orangepi-rk3399 orangepi_win orangepi_zero2 +orangepi_zero3 orangepi_zero_plus orangepi_zero_plus2 p212 @@ -68,6 +77,8 @@ poplar puma-rk3399 qemu_arm64 roc-cc-rk3328 +rock-4c-plus-rk3399 +rock-4se-rk3399 rock64-rk3328 rock960-rk3399 rock-pi-4c-rk3399 @@ -82,6 +93,8 @@ sopine_baseboard starqltechn tanix_tx6 teres_i +transpeed-8k618-t turris_mox vexpress_aemv8a_juno +x96_mate xilinx_zynqmp_virt diff --git a/rockchip-PinePhone-Pro-fixes.patch b/rockchip-PinePhone-Pro-fixes.patch deleted file mode 100644 index 5e07490..0000000 --- a/rockchip-PinePhone-Pro-fixes.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 1af5e42f170d2c4b944beeb875b80ec7f061038a Mon Sep 17 00:00:00 2001 -From: Ondrej Jirman -Date: Thu, 25 May 2023 15:27:08 +0200 -Subject: [PATCH] pinephone-pro: Fix I/O port voltage (GPIO3D4A is 1.8V) - -This fixes access to camera sensor over I2C during probe time in -the kernel. (Kernel will fix I/0 port voltage by itself, but the -timing depends on probe order of the drivers, so the fix can -come after the camera sensor driver already failed to probe.) - -Signed-off-by: Ondrej Jirman -Cc: Kever Yang -Reviewed-by: Kever Yang ---- - board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -index eb639cd0d07..b6ccbb9c1c4 100644 ---- a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -+++ b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -@@ -15,7 +15,8 @@ - #include - #include - --#define GRF_IO_VSEL_BT565_SHIFT 0 -+#define GRF_IO_VSEL_BT565_GPIO2AB 1 -+#define GRF_IO_VSEL_AUDIO_GPIO3D4A 2 - #define PMUGRF_CON0_VSEL_SHIFT 8 - - #ifndef CONFIG_SPL_BUILD -@@ -48,7 +49,8 @@ static void setup_iodomain(void) - syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); - - /* BT565 is in 1.8v domain */ -- rk_setreg(&grf->io_vsel, 1 << GRF_IO_VSEL_BT565_SHIFT); -+ rk_setreg(&grf->io_vsel, -+ GRF_IO_VSEL_BT565_GPIO2AB | GRF_IO_VSEL_AUDIO_GPIO3D4A); - - /* Set GPIO1 1.8v/3.0v source select to PMU1830_VOL */ - rk_setreg(&pmugrf->soc_con0, 1 << PMUGRF_CON0_VSEL_SHIFT); --- -2.41.0 diff --git a/rockchip-general-fixes.patch b/rockchip-general-fixes.patch deleted file mode 100644 index 00e78f5..0000000 --- a/rockchip-general-fixes.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 2d9350c50a9659cc2a247cdea07f0eacffa3cb32 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 12 Jun 2022 14:44:44 +0100 -Subject: [PATCH] rockchip: pinebook-pro: minor SPI flash fixes - -Set a default offset for environment so it doesn't write it to -unexpected locations, drop unneeded mtd config option. - -Signed-off-by: Peter Robinson ---- - configs/pinebook-pro-rk3399_defconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig -index 8ca1d0708f9..aaa52c6ea70 100644 ---- a/configs/pinebook-pro-rk3399_defconfig -+++ b/configs/pinebook-pro-rk3399_defconfig -@@ -5,6 +5,7 @@ CONFIG_ARCH_ROCKCHIP=y - CONFIG_SYS_TEXT_BASE=0x00200000 - CONFIG_NR_DRAM_BANKS=1 - CONFIG_ENV_SIZE=0x8000 -+CONFIG_ENV_OFFSET=0x3F8000 - CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" - CONFIG_ROCKCHIP_RK3399=y - CONFIG_TARGET_PINEBOOK_PRO_RK3399=y -@@ -22,7 +23,6 @@ CONFIG_MISC_INIT_R=y - # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set - CONFIG_SPL_STACK_R=y - CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 --CONFIG_SPL_MTD_SUPPORT=y - CONFIG_SPL_SPI_LOAD=y - CONFIG_TPL=y - CONFIG_CMD_BOOTZ=y --- -2.36.1 - -From 27ba8e2f904063aec5196f86dd0332bf58a60259 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 12 Jun 2022 14:50:42 +0100 -Subject: [PATCH] rockchip: rockpro64: enable leds - -The Rockpro64 has some GPIO leds so let's enable them so the -user gets some output in early boot. - -Signed-off-by: Peter Robinson ---- - configs/rockpro64-rk3399_defconfig | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig -index e6f7a8469a3..b0c3527fab0 100644 ---- a/configs/rockpro64-rk3399_defconfig -+++ b/configs/rockpro64-rk3399_defconfig -@@ -42,6 +42,8 @@ CONFIG_AHCI_PCI=y - CONFIG_SATA_SIL=y - CONFIG_ROCKCHIP_GPIO=y - CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_LED=y -+CONFIG_LED_GPIO=y - CONFIG_MISC=y - CONFIG_ROCKCHIP_EFUSE=y - CONFIG_MMC_DW=y --- -2.36.1 - -From 8bca90472e0d71e5344711b6f5fe8dc95e19af5a Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 12 Jun 2022 15:12:47 +0100 -Subject: [PATCH] rockchip: pinebook-pro: sync PBP dtb to 5.18 - -Sync the pinebook pro to upstream 5.18, in particular this brings -brings in a fix so the DP is disabled so Linux will actually boot. - -Signed-off-by: Peter Robinson ---- - arch/arm/dts/rk3399-pinebook-pro.dts | 11 +++-------- - 1 file changed, 3 insertions(+), 8 deletions(-) - -diff --git a/arch/arm/dts/rk3399-pinebook-pro.dts b/arch/arm/dts/rk3399-pinebook-pro.dts -index 2b5f001ff4a..d6b68d77d63 100644 ---- a/arch/arm/dts/rk3399-pinebook-pro.dts -+++ b/arch/arm/dts/rk3399-pinebook-pro.dts -@@ -17,6 +17,7 @@ - / { - model = "Pine64 Pinebook Pro"; - compatible = "pine64,pinebook-pro", "rockchip,rk3399"; -+ chassis-type = "laptop"; - - aliases { - mmc0 = &sdio0; -@@ -242,12 +243,12 @@ - vdd_log: vdd-log { - compatible = "pwm-regulator"; - pwms = <&pwm2 0 25000 1>; -+ pwm-supply = <&vcc_sysin>; - regulator-name = "vdd_log"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1400000>; -- vin-supply = <&vcc_sysin>; - - regulator-state-mem { - regulator-on-in-suspend; -@@ -385,10 +386,6 @@ - }; - }; - --&cdn_dp { -- status = "okay"; --}; -- - &cpu_b0 { - cpu-supply = <&vdd_cpu_b>; - }; -@@ -475,8 +472,6 @@ - vcc10-supply = <&vcc_sysin>; - vcc11-supply = <&vcc_sysin>; - vcc12-supply = <&vcc3v3_sys>; -- vcc13-supply = <&vcc_sysin>; -- vcc14-supply = <&vcc_sysin>; - - regulators { - /* rk3399 center logic supply */ -@@ -711,7 +706,7 @@ - - connector { - compatible = "usb-c-connector"; -- data-role = "host"; -+ data-role = "dual"; - label = "USB-C"; - op-sink-microwatt = <1000000>; - power-role = "dual"; --- -2.36.1 - diff --git a/rpi5-initial-support.patch b/rpi5-initial-support.patch deleted file mode 100644 index 4a79f31..0000000 --- a/rpi5-initial-support.patch +++ /dev/null @@ -1,1910 +0,0 @@ -From patchwork Mon Dec 18 21:03:35 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: "Ivan T. Ivanov" -X-Patchwork-Id: 1877649 -X-Patchwork-Delegate: pbrobinson@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (1024-bit key; - unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 - header.s=susede2_rsa header.b=frMNX+46; - dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=IseK5QVE; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.a=rsa-sha256 header.s=susede2_rsa header.b=1pz5pvm/; - dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=fIckdee4; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SvC455lk9z1ydc - for ; Tue, 19 Dec 2023 08:04:05 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 92DDD8753C; - Mon, 18 Dec 2023 22:03:54 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -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=suse.de header.i=@suse.de header.b="frMNX+46"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="IseK5QVE"; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.b="1pz5pvm/"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="fIckdee4"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id 95A7F87525; Mon, 18 Dec 2023 22:03:53 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no - version=3.4.2 -Received: from smtp-out1.suse.de (smtp-out1.suse.de - [IPv6:2a07:de40:b251:101:10:150:64:1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id 0B37B87530 - for ; Mon, 18 Dec 2023 22:03:51 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de -Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org - [10.150.64.97]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by smtp-out1.suse.de (Postfix) with ESMTPS id 6EE4F2228D; - Mon, 18 Dec 2023 21:03:49 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=KH3AWH4E2OZnkKkgKspHqUQ687KHDd+TcmlhsjT4WMY=; - b=frMNX+46FgFSdyN24UT7Y4WdFDJKcOxcjH0HyyTrZsMcayuXoLtERkmRllSmLu8aRAoWOI - dzM9aX7eK9EHwuozUVijinsJ6wKpvqwxEx0Kdnj3wKPjAS3KTXGwfYiuZeO5wmbGRytEXd - p252vWhSG5L4UgaWil84yA4iM0KqiPs= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=KH3AWH4E2OZnkKkgKspHqUQ687KHDd+TcmlhsjT4WMY=; - b=IseK5QVEh+KCaimaGVOvt6lv9A9n/uQ/xO6kky5hugt4tubeSnhwGXuCjHTIEZhYi9auSr - Q6h6Mb/o4bd7u1CQ== -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933429; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=KH3AWH4E2OZnkKkgKspHqUQ687KHDd+TcmlhsjT4WMY=; - b=1pz5pvm/SI3fxjKAlUcM+pRnK+NKLVbl/0Kj+UUQ/R29Irq4CDjfgTyaU0/DIXgn3x7Ttl - 2U7+per0J38TYiYHjQSDlrdPq4CwSFX2IEFS6sA5jx41ySG3RgO51Hh5GXKFh/WDUjcsn6 - ZPLcQCP31JjxHhULkzjaYLVYE2rQuXE= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933429; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=KH3AWH4E2OZnkKkgKspHqUQ687KHDd+TcmlhsjT4WMY=; - b=fIckdee4Yc6Iut7CdcyZnDHxDW58F+dY46W7JLg6y7iXnfDkSc0DETyb97S3ngS7GdF3OQ - HPy/QFdHWA8p8cBw== -Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D359F13C92; - Mon, 18 Dec 2023 21:03:48 +0000 (UTC) -Received: from dovecot-director2.suse.de ([10.150.64.162]) - by imap1.dmz-prg2.suse.org with ESMTPSA id 4CUUMbSzgGUtZAAAD6G6ig - (envelope-from ); Mon, 18 Dec 2023 21:03:48 +0000 -From: "Ivan T. Ivanov" -To: Matthias Brugger , - Peter Robinson -Cc: Dmitry Malkin , - Thomas Fitzsimmons , Peng Fan , - Jaehoon Chung , Anatolij Gustschin , - wahrenst@gmx.net, florian.fainelli@broadcom.com, u-boot@lists.denx.de, - "Ivan T . Ivanov" -Subject: [PATCH v3 1/7] rpi5: add initial memory map for bcm2712 -Date: Mon, 18 Dec 2023 23:03:35 +0200 -Message-ID: <20231218210341.30073-2-iivanov@suse.de> -X-Mailer: git-send-email 2.43.0 -In-Reply-To: <20231218210341.30073-1-iivanov@suse.de> -References: <20231218210341.30073-1-iivanov@suse.de> -MIME-Version: 1.0 -Authentication-Results: smtp-out1.suse.de; - none -X-Spamd-Result: default: False [0.70 / 50.00]; ARC_NA(0.00)[]; - RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; - TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.net]; - R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; - TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; - NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; - DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[11]; - MID_CONTAINS_FROM(1.00)[]; - DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,bedrocksystems.com:email]; - FREEMAIL_TO(0.00)[suse.com,gmail.com]; - FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; - MIME_TRACE(0.00)[0:+]; - FREEMAIL_CC(0.00)[bedrocksystems.com,fitzsim.org,nxp.com,samsung.com,denx.de,gmx.net,broadcom.com,lists.denx.de,suse.de]; - RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] -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.8 at phobos.denx.de -X-Virus-Status: Clean - -From: Dmitry Malkin - -includes: -* 1GB of RAM (from 4GB or 8GB total) -* VPU memory interface -* AXI ranges (main peripherals) - -Signed-off-by: Dmitry Malkin -Signed-off-by: Ivan T. Ivanov ---- - arch/arm/mach-bcm283x/init.c | 38 +++++++++++++++++++++++++++++++++++- - 1 file changed, 37 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/mach-bcm283x/init.c b/arch/arm/mach-bcm283x/init.c -index 7265faf6ce..af23b9711a 100644 ---- a/arch/arm/mach-bcm283x/init.c -+++ b/arch/arm/mach-bcm283x/init.c -@@ -19,7 +19,7 @@ - #ifdef CONFIG_ARM64 - #include - --#define MEM_MAP_MAX_ENTRIES (4) -+#define MEM_MAP_MAX_ENTRIES (5) - - static struct mm_region bcm283x_mem_map[MEM_MAP_MAX_ENTRIES] = { - { -@@ -68,6 +68,41 @@ static struct mm_region bcm2711_mem_map[MEM_MAP_MAX_ENTRIES] = { - } - }; - -+static struct mm_region bcm2712_mem_map[MEM_MAP_MAX_ENTRIES] = { -+ { -+ .virt = 0x00000000UL, -+ .phys = 0x00000000UL, -+ .size = 0x3f800000UL, -+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | -+ PTE_BLOCK_INNER_SHARE -+ }, { -+ .virt = 0x3f800000UL, -+ .phys = 0x3f800000UL, -+ .size = 0x00800000UL, -+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | -+ PTE_BLOCK_NON_SHARE | -+ PTE_BLOCK_PXN | PTE_BLOCK_UXN -+ }, { -+ /* Beginning of AXI bus where uSD controller lives */ -+ .virt = 0x1000000000UL, -+ .phys = 0x1000000000UL, -+ .size = 0x0002000000UL, -+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | -+ PTE_BLOCK_NON_SHARE | -+ PTE_BLOCK_PXN | PTE_BLOCK_UXN -+ }, { -+ .virt = 0x107c000000UL, -+ .phys = 0x107c000000UL, -+ .size = 0x0004000000UL, -+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | -+ PTE_BLOCK_NON_SHARE | -+ PTE_BLOCK_PXN | PTE_BLOCK_UXN -+ }, { -+ /* List terminator */ -+ 0, -+ } -+}; -+ - struct mm_region *mem_map = bcm283x_mem_map; - - /* -@@ -78,6 +113,7 @@ static const struct udevice_id board_ids[] = { - { .compatible = "brcm,bcm2837", .data = (ulong)&bcm283x_mem_map}, - { .compatible = "brcm,bcm2838", .data = (ulong)&bcm2711_mem_map}, - { .compatible = "brcm,bcm2711", .data = (ulong)&bcm2711_mem_map}, -+ { .compatible = "brcm,bcm2712", .data = (ulong)&bcm2712_mem_map}, - { }, - }; - - -From patchwork Mon Dec 18 21:03:36 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: "Ivan T. Ivanov" -X-Patchwork-Id: 1877650 -X-Patchwork-Delegate: pbrobinson@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (1024-bit key; - unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 - header.s=susede2_rsa header.b=v1KGWKJg; - dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=fFiq02vw; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.a=rsa-sha256 header.s=susede2_rsa header.b=v1KGWKJg; - dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=fFiq02vw; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SvC4H2hzjz1ydc - for ; Tue, 19 Dec 2023 08:04:15 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id C85A08758C; - Mon, 18 Dec 2023 22:03:57 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -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=suse.de header.i=@suse.de header.b="v1KGWKJg"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="fFiq02vw"; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.b="v1KGWKJg"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="fFiq02vw"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id 6F50F87530; Mon, 18 Dec 2023 22:03:54 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no - version=3.4.2 -Received: from smtp-out2.suse.de (smtp-out2.suse.de - [IPv6:2a07:de40:b251:101:10:150:64:2]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id 199488753C - for ; Mon, 18 Dec 2023 22:03:51 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de -Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org - [10.150.64.97]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by smtp-out2.suse.de (Postfix) with ESMTPS id 1AC1A1F46E; - Mon, 18 Dec 2023 21:03:50 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=sHJ8RNAoNPDg1bwvhFF8CpHTHHBRfcz53X69wMjqM8s=; - b=v1KGWKJgJttai7C79qIEMd/XpNIgzFqndAnylh2LCSBCYnAQmHcbTcoqWFl1mbR0bCIJ2B - nnbHB6CW+/Ja2oUD0wavAmzqzhQ+ANsN8FLZ+RC4p4W0fnMs6Yz9lMDf8ozKecEdna61Q6 - 2SnPjyXAogWLFBBDalRvdzUIOIWe3Tc= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=sHJ8RNAoNPDg1bwvhFF8CpHTHHBRfcz53X69wMjqM8s=; - b=fFiq02vw2EIwrIbp2ltl5amzeQZi9NS1k/nH07K65OVAZc8eRyKu/vHbdjX58887t//OZ/ - 6LuVBS0afgkEbWCg== -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=sHJ8RNAoNPDg1bwvhFF8CpHTHHBRfcz53X69wMjqM8s=; - b=v1KGWKJgJttai7C79qIEMd/XpNIgzFqndAnylh2LCSBCYnAQmHcbTcoqWFl1mbR0bCIJ2B - nnbHB6CW+/Ja2oUD0wavAmzqzhQ+ANsN8FLZ+RC4p4W0fnMs6Yz9lMDf8ozKecEdna61Q6 - 2SnPjyXAogWLFBBDalRvdzUIOIWe3Tc= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=sHJ8RNAoNPDg1bwvhFF8CpHTHHBRfcz53X69wMjqM8s=; - b=fFiq02vw2EIwrIbp2ltl5amzeQZi9NS1k/nH07K65OVAZc8eRyKu/vHbdjX58887t//OZ/ - 6LuVBS0afgkEbWCg== -Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7FCBC133E5; - Mon, 18 Dec 2023 21:03:49 +0000 (UTC) -Received: from dovecot-director2.suse.de ([10.150.64.162]) - by imap1.dmz-prg2.suse.org with ESMTPSA id AH+lHLWzgGUtZAAAD6G6ig - (envelope-from ); Mon, 18 Dec 2023 21:03:49 +0000 -From: "Ivan T. Ivanov" -To: Matthias Brugger , - Peter Robinson -Cc: Dmitry Malkin , - Thomas Fitzsimmons , Peng Fan , - Jaehoon Chung , Anatolij Gustschin , - wahrenst@gmx.net, florian.fainelli@broadcom.com, u-boot@lists.denx.de, - "Ivan T . Ivanov" -Subject: [PATCH v3 2/7] rpi5: Use devicetree as alternative way to read IO - base addresses -Date: Mon, 18 Dec 2023 23:03:36 +0200 -Message-ID: <20231218210341.30073-3-iivanov@suse.de> -X-Mailer: git-send-email 2.43.0 -In-Reply-To: <20231218210341.30073-1-iivanov@suse.de> -References: <20231218210341.30073-1-iivanov@suse.de> -MIME-Version: 1.0 -X-Spamd-Result: default: False [10.00 / 50.00]; ARC_NA(0.00)[]; - RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_SPAM(5.10)[100.00%]; - FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; - FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.net]; - R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; - TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; - RCVD_COUNT_THREE(0.00)[3]; - DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - RCPT_COUNT_SEVEN(0.00)[11]; MID_CONTAINS_FROM(1.00)[]; - DBL_BLOCKED_OPENRESOLVER(0.00)[bedrocksystems.com:email,suse.de:email]; - FREEMAIL_TO(0.00)[suse.com,gmail.com]; - FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; - MIME_TRACE(0.00)[0:+]; - FREEMAIL_CC(0.00)[bedrocksystems.com,fitzsim.org,nxp.com,samsung.com,denx.de,gmx.net,broadcom.com,lists.denx.de,suse.de]; - RCVD_TLS_ALL(0.00)[] -Authentication-Results: smtp-out2.suse.de; - none -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.8 at phobos.denx.de -X-Virus-Status: Clean - -From: Dmitry Malkin - -MBOX and Watchdog on RPi5/bcm2712 has a different base IO offsets. -Find them via devicetree blob passed by bootloader. - -Signed-off-by: Dmitry Malkin -Signed-off-by: Ivan T. Ivanov ---- - arch/arm/mach-bcm283x/include/mach/base.h | 5 ++- - arch/arm/mach-bcm283x/include/mach/mbox.h | 3 +- - arch/arm/mach-bcm283x/include/mach/sdhci.h | 3 +- - arch/arm/mach-bcm283x/include/mach/timer.h | 3 +- - arch/arm/mach-bcm283x/include/mach/wdog.h | 3 +- - arch/arm/mach-bcm283x/init.c | 43 ++++++++++++++++++---- - 6 files changed, 43 insertions(+), 17 deletions(-) - -diff --git a/arch/arm/mach-bcm283x/include/mach/base.h b/arch/arm/mach-bcm283x/include/mach/base.h -index 4ccaf69693..6de99e7ea1 100644 ---- a/arch/arm/mach-bcm283x/include/mach/base.h -+++ b/arch/arm/mach-bcm283x/include/mach/base.h -@@ -6,7 +6,10 @@ - #ifndef _BCM283x_BASE_H_ - #define _BCM283x_BASE_H_ - --extern unsigned long rpi_bcm283x_base; -+extern unsigned long rpi_mbox_base; -+extern unsigned long rpi_timer_base; -+extern unsigned long rpi_sdhci_base; -+extern unsigned long rpi_wdog_base; - - #ifdef CONFIG_ARMV7_LPAE - #ifdef CONFIG_TARGET_RPI_4_32B -diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h -index 490664f878..35d4e2f075 100644 ---- a/arch/arm/mach-bcm283x/include/mach/mbox.h -+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h -@@ -38,8 +38,7 @@ - - /* Raw mailbox HW */ - --#define BCM2835_MBOX_PHYSADDR ({ BUG_ON(!rpi_bcm283x_base); \ -- rpi_bcm283x_base + 0x0000b880; }) -+#define BCM2835_MBOX_PHYSADDR rpi_mbox_base - - struct bcm2835_mbox_regs { - u32 read; -diff --git a/arch/arm/mach-bcm283x/include/mach/sdhci.h b/arch/arm/mach-bcm283x/include/mach/sdhci.h -index 7323690687..e837c679c4 100644 ---- a/arch/arm/mach-bcm283x/include/mach/sdhci.h -+++ b/arch/arm/mach-bcm283x/include/mach/sdhci.h -@@ -8,8 +8,7 @@ - - #include - --#define BCM2835_SDHCI_PHYSADDR ({ BUG_ON(!rpi_bcm283x_base); \ -- rpi_bcm283x_base + 0x00300000; }) -+#define BCM2835_SDHCI_PHYSADDR rpi_sdhci_base - - int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq); - -diff --git a/arch/arm/mach-bcm283x/include/mach/timer.h b/arch/arm/mach-bcm283x/include/mach/timer.h -index 5567dbd7f3..60500a256d 100644 ---- a/arch/arm/mach-bcm283x/include/mach/timer.h -+++ b/arch/arm/mach-bcm283x/include/mach/timer.h -@@ -11,8 +11,7 @@ - #include - #endif - --#define BCM2835_TIMER_PHYSADDR ({ BUG_ON(!rpi_bcm283x_base); \ -- rpi_bcm283x_base + 0x00003000; }) -+#define BCM2835_TIMER_PHYSADDR rpi_timer_base - - #define BCM2835_TIMER_CS_M3 (1 << 3) - #define BCM2835_TIMER_CS_M2 (1 << 2) -diff --git a/arch/arm/mach-bcm283x/include/mach/wdog.h b/arch/arm/mach-bcm283x/include/mach/wdog.h -index 9942666720..b950560674 100644 ---- a/arch/arm/mach-bcm283x/include/mach/wdog.h -+++ b/arch/arm/mach-bcm283x/include/mach/wdog.h -@@ -8,8 +8,7 @@ - - #include - --#define BCM2835_WDOG_PHYSADDR ({ BUG_ON(!rpi_bcm283x_base); \ -- rpi_bcm283x_base + 0x00100000; }) -+#define BCM2835_WDOG_PHYSADDR rpi_wdog_base - - struct bcm2835_wdog_regs { - u32 unknown0[7]; -diff --git a/arch/arm/mach-bcm283x/init.c b/arch/arm/mach-bcm283x/init.c -index af23b9711a..1c5c748484 100644 ---- a/arch/arm/mach-bcm283x/init.c -+++ b/arch/arm/mach-bcm283x/init.c -@@ -151,7 +151,11 @@ static void rpi_update_mem_map(void) - static void rpi_update_mem_map(void) {} - #endif - --unsigned long rpi_bcm283x_base = 0x3f000000; -+/* Default bcm283x devices addresses */ -+unsigned long rpi_mbox_base = 0x3f00b880; -+unsigned long rpi_sdhci_base = 0x3f300000; -+unsigned long rpi_wdog_base = 0x3f100000; -+unsigned long rpi_timer_base = 0x3f003000; - - int arch_cpu_init(void) - { -@@ -162,22 +166,45 @@ int arch_cpu_init(void) - - int mach_cpu_init(void) - { -- int ret, soc_offset; -+ int ret, soc, offset; - u64 io_base, size; - - rpi_update_mem_map(); - - /* Get IO base from device tree */ -- soc_offset = fdt_path_offset(gd->fdt_blob, "/soc"); -- if (soc_offset < 0) -- return soc_offset; -+ soc = fdt_path_offset(gd->fdt_blob, "/soc"); -+ if (soc < 0) -+ return soc; - -- ret = fdt_read_range((void *)gd->fdt_blob, soc_offset, 0, NULL, -- &io_base, &size); -+ ret = fdt_read_range((void *)gd->fdt_blob, soc, 0, NULL, -+ &io_base, &size); - if (ret) - return ret; - -- rpi_bcm283x_base = io_base; -+ rpi_mbox_base = io_base + 0x00b880; -+ rpi_sdhci_base = io_base + 0x300000; -+ rpi_wdog_base = io_base + 0x100000; -+ rpi_timer_base = io_base + 0x003000; -+ -+ offset = fdt_node_offset_by_compatible(gd->fdt_blob, soc, -+ "brcm,bcm2835-mbox"); -+ if (offset > soc) -+ rpi_mbox_base = fdt_get_base_address(gd->fdt_blob, offset); -+ -+ offset = fdt_node_offset_by_compatible(gd->fdt_blob, soc, -+ "brcm,bcm2835-sdhci"); -+ if (offset > soc) -+ rpi_sdhci_base = fdt_get_base_address(gd->fdt_blob, offset); -+ -+ offset = fdt_node_offset_by_compatible(gd->fdt_blob, soc, -+ "brcm,bcm2835-system-timer"); -+ if (offset > soc) -+ rpi_timer_base = fdt_get_base_address(gd->fdt_blob, offset); -+ -+ offset = fdt_node_offset_by_compatible(gd->fdt_blob, soc, -+ "brcm,bcm2712-pm"); -+ if (offset > soc) -+ rpi_wdog_base = fdt_get_base_address(gd->fdt_blob, offset); - - return 0; - } - -From patchwork Mon Dec 18 21:03:37 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: "Ivan T. Ivanov" -X-Patchwork-Id: 1877652 -X-Patchwork-Delegate: pbrobinson@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (1024-bit key; - unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 - header.s=susede2_rsa header.b=MuifTv9w; - dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=J2WonmZQ; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.a=rsa-sha256 header.s=susede2_rsa header.b=driIaEaW; - dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=ENBj4l6/; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=85.214.62.61; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SvC4h1PpHz1ydc - for ; Tue, 19 Dec 2023 08:04:36 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id BC5CE87656; - Mon, 18 Dec 2023 22:03:58 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -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=suse.de header.i=@suse.de header.b="MuifTv9w"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="J2WonmZQ"; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.b="driIaEaW"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="ENBj4l6/"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id 24B3087578; Mon, 18 Dec 2023 22:03:57 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 -Received: from smtp-out1.suse.de (smtp-out1.suse.de - [IPv6:2a07:de40:b251:101:10:150:64:1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id 34BC9875A0 - for ; Mon, 18 Dec 2023 22:03:52 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de -Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org - [10.150.64.97]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by smtp-out1.suse.de (Postfix) with ESMTPS id B98772226F; - Mon, 18 Dec 2023 21:03:50 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933431; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=fHScQy8dlQ4zBcmmXyg7xTO2N+HoZRyPs/mSsXUaidA=; - b=MuifTv9wBEOLgWscWoGcXg+RGB8+btC5sRFciLLURyCkDcUQuguKCF0MB5CUHbvIFDKQTs - 3cu6hcIxZ1sJPOhJYAQlW90dBLsORX0sI25Eq4VgPGCsldwfrQ6KFwJmGJHKAf1t3bAtsp - bXmOjkuzkGiYTERqgRtFHlM+jbjtULk= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933431; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=fHScQy8dlQ4zBcmmXyg7xTO2N+HoZRyPs/mSsXUaidA=; - b=J2WonmZQu47jTWrv+1hYLdw1tZ+mNBDcST4N3FHxlTW7EY6hSg3i0FkVDYqumfQMZdddMp - jagUtFA6k1hguwCQ== -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=fHScQy8dlQ4zBcmmXyg7xTO2N+HoZRyPs/mSsXUaidA=; - b=driIaEaWsaR+g9AcK8SGiaVWp2t8QtO7GFM918C1n2Mg0Ag01KOyoFkVXAvjXENou/caP6 - mszp+EvY1mp+ZR5gwQMkbkHBxQ10VWiFHcSdpA6ZicAD8PbXnb4DO5mEFRyVbxDu6b9fHp - mNp6oBcymc5k4gJFdfomnV1ubqgcp38= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933430; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=fHScQy8dlQ4zBcmmXyg7xTO2N+HoZRyPs/mSsXUaidA=; - b=ENBj4l6/3jkDUxi4yY5WR8ECQN9jENKPjLTTKM7yT4ET1rZJ3jbU297szl97aZN4oQ41A9 - z8StT2qNvcfjYQCA== -Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2AC2D13C93; - Mon, 18 Dec 2023 21:03:50 +0000 (UTC) -Received: from dovecot-director2.suse.de ([10.150.64.162]) - by imap1.dmz-prg2.suse.org with ESMTPSA id EE/zB7azgGUtZAAAD6G6ig - (envelope-from ); Mon, 18 Dec 2023 21:03:50 +0000 -From: "Ivan T. Ivanov" -To: Matthias Brugger , - Peter Robinson -Cc: Dmitry Malkin , - Thomas Fitzsimmons , Peng Fan , - Jaehoon Chung , Anatolij Gustschin , - wahrenst@gmx.net, florian.fainelli@broadcom.com, u-boot@lists.denx.de, - "Ivan T. Ivanov" -Subject: [PATCH v3 3/7] rpi5: Use devicetree to retrieve board revision -Date: Mon, 18 Dec 2023 23:03:37 +0200 -Message-ID: <20231218210341.30073-4-iivanov@suse.de> -X-Mailer: git-send-email 2.43.0 -In-Reply-To: <20231218210341.30073-1-iivanov@suse.de> -References: <20231218210341.30073-1-iivanov@suse.de> -MIME-Version: 1.0 -Authentication-Results: smtp-out1.suse.de; - none -X-Spamd-Result: default: False [1.14 / 50.00]; ARC_NA(0.00)[]; - RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; - TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.net]; - R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; - TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; - NEURAL_HAM_LONG(-1.00)[-1.000]; - R_RATELIMIT(0.00)[to_ip_from(RL9dd9h8xg9qpm5f14t9e5w4zz)]; - RCVD_COUNT_THREE(0.00)[3]; - DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[11]; - MID_CONTAINS_FROM(1.00)[]; - DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; - FREEMAIL_TO(0.00)[suse.com,gmail.com]; - FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; - MIME_TRACE(0.00)[0:+]; - FREEMAIL_CC(0.00)[bedrocksystems.com,fitzsim.org,nxp.com,samsung.com,denx.de,gmx.net,broadcom.com,lists.denx.de,suse.de]; - RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.56)[98.03%] -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.8 at phobos.denx.de -X-Virus-Status: Clean - -Firmware on RPi5 return error on board revision query -through firmware interface, but on the other hand it fills -"linux,revision" in "system" node, so use it to detect board -revision. - - system { - linux,revision = <0xc04170>; - linux,serial = <0x6cf44e80 0x3c533ede>; - }; - -Signed-off-by: Ivan T. Ivanov ---- - board/raspberrypi/rpi/rpi.c | 22 +++++++++++++++++++--- - 1 file changed, 19 insertions(+), 3 deletions(-) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index cd823ad746..2851ebc985 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -171,6 +171,11 @@ static const struct rpi_model rpi_models_new_scheme[] = { - DTB_DIR "bcm2711-rpi-cm4.dtb", - true, - }, -+ [0x17] = { -+ "5 Model B", -+ DTB_DIR "bcm2712-rpi-5-b.dtb", -+ true, -+ }, - }; - - static const struct rpi_model rpi_models_old_scheme[] = { -@@ -429,15 +434,27 @@ static void get_board_revision(void) - int ret; - const struct rpi_model *models; - uint32_t models_count; -+ ofnode node; - - BCM2835_MBOX_INIT_HDR(msg); - BCM2835_MBOX_INIT_TAG(&msg->get_board_rev, GET_BOARD_REV); - - ret = bcm2835_mbox_call_prop(BCM2835_MBOX_PROP_CHAN, &msg->hdr); - if (ret) { -- printf("bcm2835: Could not query board revision\n"); - /* Ignore error; not critical */ -- return; -+ node = ofnode_path("/system"); -+ if (!ofnode_valid(node)) { -+ printf("bcm2835: Could not find /system node\n"); -+ return; -+ } -+ -+ ret = ofnode_read_u32(node, "linux,revision", &revision); -+ if (ret) { -+ printf("bcm2835: Could not find linux,revision\n"); -+ return; -+ } -+ } else { -+ revision = msg->get_board_rev.body.resp.rev; - } - - /* -@@ -451,7 +468,6 @@ static void get_board_revision(void) - * http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=98367&start=250 - * http://www.raspberrypi.org/forums/viewtopic.php?f=31&t=20594 - */ -- revision = msg->get_board_rev.body.resp.rev; - if (revision & 0x800000) { - rev_scheme = 1; - rev_type = (revision >> 4) & 0xff; - -From patchwork Mon Dec 18 21:03:38 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: "Ivan T. Ivanov" -X-Patchwork-Id: 1877651 -X-Patchwork-Delegate: pbrobinson@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (1024-bit key; - unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 - header.s=susede2_rsa header.b=v2vbP3rz; - dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=DCEhbGvW; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.a=rsa-sha256 header.s=susede2_rsa header.b=v2vbP3rz; - dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=DCEhbGvW; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=85.214.62.61; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SvC4X1dxWz1ydc - for ; Tue, 19 Dec 2023 08:04:28 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 516EE875B6; - Mon, 18 Dec 2023 22:03:58 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -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=suse.de header.i=@suse.de header.b="v2vbP3rz"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="DCEhbGvW"; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.b="v2vbP3rz"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="DCEhbGvW"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id B3A6E87578; Mon, 18 Dec 2023 22:03:55 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no - version=3.4.2 -Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id AF6918758C - for ; Mon, 18 Dec 2023 22:03:51 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de -Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org - [10.150.64.97]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by smtp-out1.suse.de (Postfix) with ESMTPS id 601C222298; - Mon, 18 Dec 2023 21:03:51 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933431; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=g18N3OoUCORUbBwvzPY0/IHAtBrY9++PtXkkmDrbHl4=; - b=v2vbP3rzM/o63ofFdDaxhtUv68QFa8UxlaWLBU0PN+7PKXtZUGyrKBSmhVzxTM42FyEF7w - 9fus9/ORTaMw41AMi4qeWNQkin7gz4BF2qAFQuYSksnSgsT4Jul8n1YBBmIDx1keXZtfAW - uJZcfMM7pykF11NRMTvI38ZkyYm3ueQ= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933431; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=g18N3OoUCORUbBwvzPY0/IHAtBrY9++PtXkkmDrbHl4=; - b=DCEhbGvWPmgWKvfaoSUDgZ/cuuHGUnp9FvtlFeMSL2WTlsc5F+jQrl+8kVn2Yr5wDXUi8w - yyGhdRc4ihbp3tAg== -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933431; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=g18N3OoUCORUbBwvzPY0/IHAtBrY9++PtXkkmDrbHl4=; - b=v2vbP3rzM/o63ofFdDaxhtUv68QFa8UxlaWLBU0PN+7PKXtZUGyrKBSmhVzxTM42FyEF7w - 9fus9/ORTaMw41AMi4qeWNQkin7gz4BF2qAFQuYSksnSgsT4Jul8n1YBBmIDx1keXZtfAW - uJZcfMM7pykF11NRMTvI38ZkyYm3ueQ= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933431; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=g18N3OoUCORUbBwvzPY0/IHAtBrY9++PtXkkmDrbHl4=; - b=DCEhbGvWPmgWKvfaoSUDgZ/cuuHGUnp9FvtlFeMSL2WTlsc5F+jQrl+8kVn2Yr5wDXUi8w - yyGhdRc4ihbp3tAg== -Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C77BF133E5; - Mon, 18 Dec 2023 21:03:50 +0000 (UTC) -Received: from dovecot-director2.suse.de ([10.150.64.162]) - by imap1.dmz-prg2.suse.org with ESMTPSA id cKI3LrazgGUtZAAAD6G6ig - (envelope-from ); Mon, 18 Dec 2023 21:03:50 +0000 -From: "Ivan T. Ivanov" -To: Matthias Brugger , - Peter Robinson -Cc: Dmitry Malkin , - Thomas Fitzsimmons , Peng Fan , - Jaehoon Chung , Anatolij Gustschin , - wahrenst@gmx.net, florian.fainelli@broadcom.com, u-boot@lists.denx.de, - "Ivan T. Ivanov" -Subject: [PATCH v3 4/7] bcm2835: brcm, - bcm2708-fb device is using r5g6b5 format -Date: Mon, 18 Dec 2023 23:03:38 +0200 -Message-ID: <20231218210341.30073-5-iivanov@suse.de> -X-Mailer: git-send-email 2.43.0 -In-Reply-To: <20231218210341.30073-1-iivanov@suse.de> -References: <20231218210341.30073-1-iivanov@suse.de> -MIME-Version: 1.0 -X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; - RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; - TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.net]; - R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; - TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; - R_RATELIMIT(0.00)[to_ip_from(RL9dd9h8xg9qpm5f14t9e5w4zz)]; - RCVD_COUNT_THREE(0.00)[3]; - DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - RCPT_COUNT_SEVEN(0.00)[11]; MID_CONTAINS_FROM(1.00)[]; - DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; - FREEMAIL_TO(0.00)[suse.com,gmail.com]; - FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; - MIME_TRACE(0.00)[0:+]; - FREEMAIL_CC(0.00)[bedrocksystems.com,fitzsim.org,nxp.com,samsung.com,denx.de,gmx.net,broadcom.com,lists.denx.de,suse.de]; - RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[34.66%] -Authentication-Results: smtp-out1.suse.de; - none -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.8 at phobos.denx.de -X-Virus-Status: Clean - -brcm,bcm2708-fb device provided by firmware on RPi5 uses -16 bits per pixel. Update driver to properly handle this. - -Signed-off-by: Ivan T. Ivanov ---- - drivers/video/bcm2835.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c -index 14942526f1..245c958b6e 100644 ---- a/drivers/video/bcm2835.c -+++ b/drivers/video/bcm2835.c -@@ -43,7 +43,7 @@ static int bcm2835_video_probe(struct udevice *dev) - - uc_priv->xsize = w; - uc_priv->ysize = h; -- uc_priv->bpix = VIDEO_BPP32; -+ uc_priv->bpix = dev_get_driver_data(dev); - plat->base = fb_base; - plat->size = fb_size; - -@@ -51,11 +51,11 @@ static int bcm2835_video_probe(struct udevice *dev) - } - - static const struct udevice_id bcm2835_video_ids[] = { -- { .compatible = "brcm,bcm2835-hdmi" }, -- { .compatible = "brcm,bcm2711-hdmi0" }, -- { .compatible = "brcm,bcm2708-fb" }, -+ { .compatible = "brcm,bcm2835-hdmi", .data = VIDEO_BPP32}, -+ { .compatible = "brcm,bcm2711-hdmi0", .data = VIDEO_BPP32}, -+ { .compatible = "brcm,bcm2708-fb", .data = VIDEO_BPP16 }, - #if !IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB) -- { .compatible = "simple-framebuffer" }, -+ { .compatible = "simple-framebuffer", .data = VIDEO_BPP32}, - #endif - { } - }; - -From patchwork Mon Dec 18 21:03:39 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: "Ivan T. Ivanov" -X-Patchwork-Id: 1877653 -X-Patchwork-Delegate: pbrobinson@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (1024-bit key; - unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 - header.s=susede2_rsa header.b=NbGv/QjH; - dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=mv0vjv7/; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.a=rsa-sha256 header.s=susede2_rsa header.b=NbGv/QjH; - dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=mv0vjv7/; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=85.214.62.61; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SvC4s5T6Bz1ydc - for ; Tue, 19 Dec 2023 08:04:45 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 3B87487227; - Mon, 18 Dec 2023 22:04:02 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -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=suse.de header.i=@suse.de header.b="NbGv/QjH"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="mv0vjv7/"; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.b="NbGv/QjH"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="mv0vjv7/"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id AC0FC874F3; Mon, 18 Dec 2023 22:03:57 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 -Received: from smtp-out1.suse.de (smtp-out1.suse.de - [IPv6:2a07:de40:b251:101:10:150:64:1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id 8349D875DB - for ; Mon, 18 Dec 2023 22:03:52 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de -Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org - [10.150.64.97]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by smtp-out1.suse.de (Postfix) with ESMTPS id 07C81222A0; - Mon, 18 Dec 2023 21:03:52 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=uP1ZnUgZbbfrrj9GCsaBsy/nQj7H8r6do86LEnTV99Y=; - b=NbGv/QjHBl2RkJvR6nKp9uvf3bewa/Jp5ykWs/ULuKNb1e1kp0q0TCiM3d88QGrhaOkktM - ARQoLZXxNSqS1EXqsPA7VQyuJpg3iM74I+GTJfNdlIDDYeA4JLrY6MexUOxdVl1EgxjaPf - 8qkaGm9uEwoD2sactKTn0rgBg5C7Ej0= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=uP1ZnUgZbbfrrj9GCsaBsy/nQj7H8r6do86LEnTV99Y=; - b=mv0vjv7/43Gm9IJuOWZT6NQDNDmZdNrBoTyjx7Yu5AAnyTgKtyFYldUlt18PDNHm701rhG - AxUSg7hqv1qJTiDg== -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=uP1ZnUgZbbfrrj9GCsaBsy/nQj7H8r6do86LEnTV99Y=; - b=NbGv/QjHBl2RkJvR6nKp9uvf3bewa/Jp5ykWs/ULuKNb1e1kp0q0TCiM3d88QGrhaOkktM - ARQoLZXxNSqS1EXqsPA7VQyuJpg3iM74I+GTJfNdlIDDYeA4JLrY6MexUOxdVl1EgxjaPf - 8qkaGm9uEwoD2sactKTn0rgBg5C7Ej0= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=uP1ZnUgZbbfrrj9GCsaBsy/nQj7H8r6do86LEnTV99Y=; - b=mv0vjv7/43Gm9IJuOWZT6NQDNDmZdNrBoTyjx7Yu5AAnyTgKtyFYldUlt18PDNHm701rhG - AxUSg7hqv1qJTiDg== -Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6FAB513C92; - Mon, 18 Dec 2023 21:03:51 +0000 (UTC) -Received: from dovecot-director2.suse.de ([10.150.64.162]) - by imap1.dmz-prg2.suse.org with ESMTPSA id YHTRGLezgGUtZAAAD6G6ig - (envelope-from ); Mon, 18 Dec 2023 21:03:51 +0000 -From: "Ivan T. Ivanov" -To: Matthias Brugger , - Peter Robinson -Cc: Dmitry Malkin , - Thomas Fitzsimmons , Peng Fan , - Jaehoon Chung , Anatolij Gustschin , - wahrenst@gmx.net, florian.fainelli@broadcom.com, u-boot@lists.denx.de, - "Ivan T. Ivanov" -Subject: [PATCH v3 5/7] mmc: bcmstb: Add support for bcm2712 SD controller -Date: Mon, 18 Dec 2023 23:03:39 +0200 -Message-ID: <20231218210341.30073-6-iivanov@suse.de> -X-Mailer: git-send-email 2.43.0 -In-Reply-To: <20231218210341.30073-1-iivanov@suse.de> -References: <20231218210341.30073-1-iivanov@suse.de> -MIME-Version: 1.0 -X-Spamd-Result: default: False [1.90 / 50.00]; ARC_NA(0.00)[]; - RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; - TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.net]; - R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; - TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; - R_RATELIMIT(0.00)[to_ip_from(RL9dd9h8xg9qpm5f14t9e5w4zz)]; - RCVD_COUNT_THREE(0.00)[3]; - DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - RCPT_COUNT_SEVEN(0.00)[11]; MID_CONTAINS_FROM(1.00)[]; - DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; - FREEMAIL_TO(0.00)[suse.com,gmail.com]; - FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; - MIME_TRACE(0.00)[0:+]; - FREEMAIL_CC(0.00)[bedrocksystems.com,fitzsim.org,nxp.com,samsung.com,denx.de,gmx.net,broadcom.com,lists.denx.de,suse.de]; - RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] -Authentication-Results: smtp-out1.suse.de; - none -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.8 at phobos.denx.de -X-Virus-Status: Clean - -Borrow SD quirks from vendor Linux driver. - -"BCM2712 unfortunately carries with it a perennial bug with the SD -controller register interface present on previous chips (2711/2709/2708). -Accesses must be dword-sized and a read-modify-write cycle to the 32-bit -registers containing the COMMAND, TRANSFER_MODE, BLOCK_SIZE and -BLOCK_COUNT registers tramples the upper/lower 16 bits of data written. -BCM2712 does not seem to need the extreme delay between each write as on -previous chips, just the serialisation of writes to these registers in a -single 32-bit operation." - -Signed-off-by: Ivan T. Ivanov ---- - drivers/mmc/bcmstb_sdhci.c | 173 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 172 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/bcmstb_sdhci.c b/drivers/mmc/bcmstb_sdhci.c -index dc96818cff..21489e66c0 100644 ---- a/drivers/mmc/bcmstb_sdhci.c -+++ b/drivers/mmc/bcmstb_sdhci.c -@@ -38,6 +38,16 @@ - */ - #define BCMSTB_SDHCI_MINIMUM_CLOCK_FREQUENCY 400000 - -+#define SDIO_CFG_CTRL 0x0 -+#define SDIO_CFG_CTRL_SDCD_N_TEST_EN BIT(31) -+#define SDIO_CFG_CTRL_SDCD_N_TEST_LEV BIT(30) -+ -+#define SDIO_CFG_SD_PIN_SEL 0x44 -+#define SDIO_CFG_SD_PIN_SEL_MASK 0x3 -+#define SDIO_CFG_SD_PIN_SEL_CARD BIT(1) -+ -+#define REG_OFFSET_IN_BITS(reg) ((reg) << 3 & 0x18) -+ - /* - * This driver has only been tested with eMMC devices; SD devices may - * not work. -@@ -47,6 +57,53 @@ struct sdhci_bcmstb_plat { - struct mmc mmc; - }; - -+struct sdhci_bcmstb_host { -+ struct sdhci_host host; -+ u32 shadow_cmd; -+ u32 shadow_blk; -+ bool is_cmd_shadowed; -+ bool is_blk_shadowed; -+}; -+ -+struct sdhci_brcmstb_dev_priv { -+ int (*init)(struct udevice *dev); -+ struct sdhci_ops *ops; -+}; -+ -+static inline struct sdhci_bcmstb_host *to_bcmstb_host(struct sdhci_host *host) -+{ -+ return container_of(host, struct sdhci_bcmstb_host, host); -+} -+ -+static int sdhci_brcmstb_init_2712(struct udevice *dev) -+{ -+ struct sdhci_host *host = dev_get_priv(dev); -+ void *cfg_regs; -+ u32 reg; -+ -+ /* Map in the non-standard CFG registers */ -+ cfg_regs = dev_remap_addr_name(dev, "cfg"); -+ if (!cfg_regs) -+ return -ENOENT; -+ -+ if ((host->mmc->host_caps & MMC_CAP_NONREMOVABLE) || -+ (host->mmc->host_caps & MMC_CAP_NEEDS_POLL)) { -+ /* Force presence */ -+ reg = readl(cfg_regs + SDIO_CFG_CTRL); -+ reg &= ~SDIO_CFG_CTRL_SDCD_N_TEST_LEV; -+ reg |= SDIO_CFG_CTRL_SDCD_N_TEST_EN; -+ writel(reg, cfg_regs + SDIO_CFG_CTRL); -+ } else { -+ /* Enable card detection line */ -+ reg = readl(cfg_regs + SDIO_CFG_SD_PIN_SEL); -+ reg &= ~SDIO_CFG_SD_PIN_SEL_MASK; -+ reg |= SDIO_CFG_SD_PIN_SEL_CARD; -+ writel(reg, cfg_regs + SDIO_CFG_SD_PIN_SEL); -+ } -+ -+ return 0; -+} -+ - static int sdhci_bcmstb_bind(struct udevice *dev) - { - struct sdhci_bcmstb_plat *plat = dev_get_plat(dev); -@@ -58,10 +115,14 @@ static int sdhci_bcmstb_probe(struct udevice *dev) - { - struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); - struct sdhci_bcmstb_plat *plat = dev_get_plat(dev); -- struct sdhci_host *host = dev_get_priv(dev); -+ struct sdhci_bcmstb_host *bcmstb = dev_get_priv(dev); -+ struct sdhci_host *host = &bcmstb->host; -+ struct sdhci_brcmstb_dev_priv *dev_priv; - fdt_addr_t base; - int ret; - -+ dev_priv = (struct sdhci_brcmstb_dev_priv *)dev_get_driver_data(dev); -+ - base = dev_read_addr(dev); - if (base == FDT_ADDR_T_NONE) - return -EINVAL; -@@ -75,6 +136,10 @@ static int sdhci_bcmstb_probe(struct udevice *dev) - - host->mmc = &plat->mmc; - host->mmc->dev = dev; -+ -+ if (dev_priv && dev_priv->ops) -+ host->ops = dev_priv->ops; -+ - ret = sdhci_setup_cfg(&plat->cfg, host, - BCMSTB_SDHCI_MAXIMUM_CLOCK_FREQUENCY, - BCMSTB_SDHCI_MINIMUM_CLOCK_FREQUENCY); -@@ -84,10 +149,116 @@ static int sdhci_bcmstb_probe(struct udevice *dev) - upriv->mmc = &plat->mmc; - host->mmc->priv = host; - -+ if (dev_priv && dev_priv->init) { -+ ret = dev_priv->init(dev); -+ if (ret) -+ return ret; -+ } -+ - return sdhci_probe(dev); - } - -+static u16 sdhci_brcmstb_32bits_readw(struct sdhci_host *host, int reg) -+{ -+ struct sdhci_bcmstb_host *bcmstb = to_bcmstb_host(host); -+ u16 word; -+ u32 val; -+ -+ if (reg == SDHCI_TRANSFER_MODE && bcmstb->is_cmd_shadowed) { -+ /* Get the saved transfer mode */ -+ val = bcmstb->shadow_cmd; -+ } else if ((reg == SDHCI_BLOCK_SIZE || reg == SDHCI_BLOCK_COUNT) && -+ bcmstb->is_blk_shadowed) { -+ /* Get the saved block info */ -+ val = bcmstb->shadow_blk; -+ } else { -+ val = readl(host->ioaddr + (reg & ~3)); -+ } -+ -+ word = val >> REG_OFFSET_IN_BITS(reg) & 0xffff; -+ return word; -+} -+ -+static u8 sdhci_brcmstb_32bits_readb(struct sdhci_host *host, int reg) -+{ -+ u32 val = readl(host->ioaddr + (reg & ~3)); -+ u8 byte = val >> REG_OFFSET_IN_BITS(reg) & 0xff; -+ return byte; -+} -+ -+/* -+ * BCM2712 unfortunately carries with it a perennial bug with the SD -+ * controller register interface present on previous chips (2711/2709/2708). -+ * Accesses must be dword-sized and a read-modify-write cycle to the -+ * 32-bit registers containing the COMMAND, TRANSFER_MODE, BLOCK_SIZE and -+ * BLOCK_COUNT registers tramples the upper/lower 16 bits of data written. -+ * BCM2712 does not seem to need the extreme delay between each write as -+ * on previous chips, just the serialisation of writes to these registers -+ * in a single 32-bit operation. -+ */ -+static void sdhci_brcmstb_32bits_writew(struct sdhci_host *host, u16 val, int reg) -+{ -+ struct sdhci_bcmstb_host *bcmstb = to_bcmstb_host(host); -+ u32 word_shift = REG_OFFSET_IN_BITS(reg); -+ u32 mask = 0xffff << word_shift; -+ u32 oldval, newval; -+ -+ if (reg == SDHCI_COMMAND) { -+ /* Write the block now as we are issuing a command */ -+ if (bcmstb->is_blk_shadowed) { -+ writel(bcmstb->shadow_blk, host->ioaddr + SDHCI_BLOCK_SIZE); -+ bcmstb->is_blk_shadowed = false; -+ } -+ oldval = bcmstb->shadow_cmd; -+ bcmstb->is_cmd_shadowed = false; -+ } else if ((reg == SDHCI_BLOCK_SIZE || reg == SDHCI_BLOCK_COUNT) && -+ bcmstb->is_blk_shadowed) { -+ /* Block size and count are stored in shadow reg */ -+ oldval = bcmstb->shadow_blk; -+ } else { -+ /* Read reg, all other registers are not shadowed */ -+ oldval = readl(host->ioaddr + (reg & ~3)); -+ } -+ newval = (oldval & ~mask) | (val << word_shift); -+ -+ if (reg == SDHCI_TRANSFER_MODE) { -+ /* Save the transfer mode until the command is issued */ -+ bcmstb->shadow_cmd = newval; -+ bcmstb->is_cmd_shadowed = true; -+ } else if (reg == SDHCI_BLOCK_SIZE || reg == SDHCI_BLOCK_COUNT) { -+ /* Save the block info until the command is issued */ -+ bcmstb->shadow_blk = newval; -+ bcmstb->is_blk_shadowed = true; -+ } else { -+ /* Command or other regular 32-bit write */ -+ writel(newval, host->ioaddr + (reg & ~3)); -+ } -+} -+ -+static void sdhci_brcmstb_32bits_writeb(struct sdhci_host *host, u8 val, int reg) -+{ -+ u32 oldval = readl(host->ioaddr + (reg & ~3)); -+ u32 byte_shift = REG_OFFSET_IN_BITS(reg); -+ u32 mask = 0xff << byte_shift; -+ u32 newval = (oldval & ~mask) | (val << byte_shift); -+ -+ writel(newval, host->ioaddr + (reg & ~3)); -+} -+ -+static struct sdhci_ops sdhci_brcmstb_ops_2712 = { -+ .read_b = sdhci_brcmstb_32bits_readb, -+ .read_w = sdhci_brcmstb_32bits_readw, -+ .write_w = sdhci_brcmstb_32bits_writew, -+ .write_b = sdhci_brcmstb_32bits_writeb, -+}; -+ -+static const struct sdhci_brcmstb_dev_priv match_priv_2712 = { -+ .init = sdhci_brcmstb_init_2712, -+ .ops = &sdhci_brcmstb_ops_2712, -+}; -+ - static const struct udevice_id sdhci_bcmstb_match[] = { -+ { .compatible = "brcm,bcm2712-sdhci", .data = (ulong)&match_priv_2712 }, - { .compatible = "brcm,bcm7425-sdhci" }, - { .compatible = "brcm,sdhci-brcmstb" }, - { } - -From patchwork Mon Dec 18 21:03:40 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: "Ivan T. Ivanov" -X-Patchwork-Id: 1877654 -X-Patchwork-Delegate: pbrobinson@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (1024-bit key; - unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 - header.s=susede2_rsa header.b=f/19Tx1x; - dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=e0CvACbS; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.a=rsa-sha256 header.s=susede2_rsa header.b=f/19Tx1x; - dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=e0CvACbS; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=85.214.62.61; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SvC5339Phz1ydc - for ; Tue, 19 Dec 2023 08:04:55 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id AEFAE87561; - Mon, 18 Dec 2023 22:04:02 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -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=suse.de header.i=@suse.de header.b="f/19Tx1x"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="e0CvACbS"; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.b="f/19Tx1x"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="e0CvACbS"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id E31C887661; Mon, 18 Dec 2023 22:03:58 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no - version=3.4.2 -Received: from smtp-out1.suse.de (smtp-out1.suse.de - [IPv6:2a07:de40:b251:101:10:150:64:1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id 23C28875FE - for ; Mon, 18 Dec 2023 22:03:53 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de -Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org - [IPv6:2a07:de40:b281:104:10:150:64:97]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by smtp-out1.suse.de (Postfix) with ESMTPS id AA225222AF; - Mon, 18 Dec 2023 21:03:52 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=cxWdlBZFlaQd53WSplsOaVVsDevGF2K3qZjhk+1T33g=; - b=f/19Tx1x7UFtAUz8rSw0xZAG55X0OP1hiHqEuhAMQ+G/qEfSEkg6v1FGZhP70gpNWDQQgk - sr6WvGWKDP0t+jOsv0jDi9ZDrTiDB2ge+exjUPFNEvQP3H5zrjgKVOaqBaoOeLHXs/ay0l - qSAackxgs89eelJL1qSI3XwtAjq2zlQ= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=cxWdlBZFlaQd53WSplsOaVVsDevGF2K3qZjhk+1T33g=; - b=e0CvACbSltQnSYuEyv3yxtn0hfVqkwt0KNf0fBLAfLwxlC3hb9ebDGcHvra3iPCHYB22X9 - ButpL853ceVzwdDA== -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=cxWdlBZFlaQd53WSplsOaVVsDevGF2K3qZjhk+1T33g=; - b=f/19Tx1x7UFtAUz8rSw0xZAG55X0OP1hiHqEuhAMQ+G/qEfSEkg6v1FGZhP70gpNWDQQgk - sr6WvGWKDP0t+jOsv0jDi9ZDrTiDB2ge+exjUPFNEvQP3H5zrjgKVOaqBaoOeLHXs/ay0l - qSAackxgs89eelJL1qSI3XwtAjq2zlQ= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933432; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=cxWdlBZFlaQd53WSplsOaVVsDevGF2K3qZjhk+1T33g=; - b=e0CvACbSltQnSYuEyv3yxtn0hfVqkwt0KNf0fBLAfLwxlC3hb9ebDGcHvra3iPCHYB22X9 - ButpL853ceVzwdDA== -Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 15B1C133E5; - Mon, 18 Dec 2023 21:03:52 +0000 (UTC) -Received: from dovecot-director2.suse.de ([10.150.64.162]) - by imap1.dmz-prg2.suse.org with ESMTPSA id 8OvVArizgGUtZAAAD6G6ig - (envelope-from ); Mon, 18 Dec 2023 21:03:52 +0000 -From: "Ivan T. Ivanov" -To: Matthias Brugger , - Peter Robinson -Cc: Dmitry Malkin , - Thomas Fitzsimmons , Peng Fan , - Jaehoon Chung , Anatolij Gustschin , - wahrenst@gmx.net, florian.fainelli@broadcom.com, u-boot@lists.denx.de, - "Ivan T. Ivanov" -Subject: [PATCH v3 6/7] configs: rpi_arm64: enable SDHCI BCMSTB driver -Date: Mon, 18 Dec 2023 23:03:40 +0200 -Message-ID: <20231218210341.30073-7-iivanov@suse.de> -X-Mailer: git-send-email 2.43.0 -In-Reply-To: <20231218210341.30073-1-iivanov@suse.de> -References: <20231218210341.30073-1-iivanov@suse.de> -MIME-Version: 1.0 -Authentication-Results: smtp-out1.suse.de; - dkim=pass header.d=suse.de header.s=susede2_rsa header.b="f/19Tx1x"; - dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=e0CvACbS -X-Rspamd-Server: rspamd2.dmz-prg2.suse.org -X-Spamd-Result: default: False [-1.62 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; - RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; - SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; - TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; - BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; - DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; - RCPT_COUNT_SEVEN(0.00)[11]; NEURAL_HAM_SHORT(-0.20)[-1.000]; - FREEMAIL_TO(0.00)[suse.com,gmail.com]; FROM_EQ_ENVFROM(0.00)[]; - MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.11)[66.45%]; - ARC_NA(0.00)[]; - R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - RCVD_DKIM_ARC_DNSWL_HI(-1.00)[]; FROM_HAS_DN(0.00)[]; - FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.net]; - TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; - DWL_DNSWL_HI(-3.50)[suse.de:dkim]; - NEURAL_HAM_LONG(-1.00)[-1.000]; - DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - MID_CONTAINS_FROM(1.00)[]; - DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; - FUZZY_BLOCKED(0.00)[rspamd.com]; - FREEMAIL_CC(0.00)[bedrocksystems.com,fitzsim.org,nxp.com,samsung.com,denx.de,gmx.net,broadcom.com,lists.denx.de,suse.de]; - RCVD_TLS_ALL(0.00)[]; - RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:97:from] -X-Rspamd-Queue-Id: AA225222AF -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.8 at phobos.denx.de -X-Virus-Status: Clean - -RPi5 have "brcm,bcm2712-sdhci" controller which is -handled by "sdhci-bcmstb" driver, so enable it. - -Signed-off-by: Ivan T. Ivanov ---- - configs/rpi_arm64_defconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/configs/rpi_arm64_defconfig b/configs/rpi_arm64_defconfig -index f9dade18f6..1107fd11de 100644 ---- a/configs/rpi_arm64_defconfig -+++ b/configs/rpi_arm64_defconfig -@@ -33,6 +33,7 @@ CONFIG_BCM2835_GPIO=y - CONFIG_MMC_SDHCI=y - CONFIG_MMC_SDHCI_SDMA=y - CONFIG_MMC_SDHCI_BCM2835=y -+CONFIG_MMC_SDHCI_BCMSTB=y - CONFIG_BCMGENET=y - CONFIG_PCI_BRCMSTB=y - CONFIG_PINCTRL=y - -From patchwork Mon Dec 18 21:03:41 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: "Ivan T. Ivanov" -X-Patchwork-Id: 1877655 -X-Patchwork-Delegate: pbrobinson@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (1024-bit key; - unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 - header.s=susede2_rsa header.b=1by1WnE8; - dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=e64lBvSE; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.a=rsa-sha256 header.s=susede2_rsa header.b=1by1WnE8; - dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 - header.s=susede2_ed25519 header.b=e64lBvSE; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SvC5H05zfz1ydc - for ; Tue, 19 Dec 2023 08:05:07 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 2FBDE87650; - Mon, 18 Dec 2023 22:04:03 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -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=suse.de header.i=@suse.de header.b="1by1WnE8"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="e64lBvSE"; - dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de - header.b="1by1WnE8"; - dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de - header.b="e64lBvSE"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id 5D01C876A4; Mon, 18 Dec 2023 22:03:59 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no - version=3.4.2 -Received: from smtp-out2.suse.de (smtp-out2.suse.de - [IPv6:2a07:de40:b251:101:10:150:64:2]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id C279687509 - for ; Mon, 18 Dec 2023 22:03:53 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=suse.de -Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de -Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org - [IPv6:2a07:de40:b281:104:10:150:64:97]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by smtp-out2.suse.de (Postfix) with ESMTPS id 5507C1F6E6; - Mon, 18 Dec 2023 21:03:53 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933433; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=HvUCimMaJ6xrQSSzUxalPI2wxDMnSXJwzMxo+y9/IFo=; - b=1by1WnE818KeyiiUhS0PLD7P0c+SSwVEcIdSwLVDSj6t8vZK9vpPNROZRCB9WlZtgGyGUU - JlRP9h5PowjYnh5OWRH6KbjZ19MG+Fu3rWcMQ+gET5ljKGaRAtFv2t0gDAtmZGheOkf5pW - KEDUZYxYceI7JKlWcX6QlIjexymId9w= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933433; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=HvUCimMaJ6xrQSSzUxalPI2wxDMnSXJwzMxo+y9/IFo=; - b=e64lBvSEDRhrUCpOd2eVMasuXC6PFNm5B1yOGeNNS+E2HREmMMam1YM4RObadB2tdux/T3 - Galw853x9Gm0wpDA== -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_rsa; - t=1702933433; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=HvUCimMaJ6xrQSSzUxalPI2wxDMnSXJwzMxo+y9/IFo=; - b=1by1WnE818KeyiiUhS0PLD7P0c+SSwVEcIdSwLVDSj6t8vZK9vpPNROZRCB9WlZtgGyGUU - JlRP9h5PowjYnh5OWRH6KbjZ19MG+Fu3rWcMQ+gET5ljKGaRAtFv2t0gDAtmZGheOkf5pW - KEDUZYxYceI7JKlWcX6QlIjexymId9w= -DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; - s=susede2_ed25519; t=1702933433; - h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: - mime-version:mime-version: - content-transfer-encoding:content-transfer-encoding: - in-reply-to:in-reply-to:references:references; - bh=HvUCimMaJ6xrQSSzUxalPI2wxDMnSXJwzMxo+y9/IFo=; - b=e64lBvSEDRhrUCpOd2eVMasuXC6PFNm5B1yOGeNNS+E2HREmMMam1YM4RObadB2tdux/T3 - Galw853x9Gm0wpDA== -Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest - SHA256) - (No client certificate requested) - by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BB17413C92; - Mon, 18 Dec 2023 21:03:52 +0000 (UTC) -Received: from dovecot-director2.suse.de ([10.150.64.162]) - by imap1.dmz-prg2.suse.org with ESMTPSA id 0JQfK7izgGUtZAAAD6G6ig - (envelope-from ); Mon, 18 Dec 2023 21:03:52 +0000 -From: "Ivan T. Ivanov" -To: Matthias Brugger , - Peter Robinson -Cc: Dmitry Malkin , - Thomas Fitzsimmons , Peng Fan , - Jaehoon Chung , Anatolij Gustschin , - wahrenst@gmx.net, florian.fainelli@broadcom.com, u-boot@lists.denx.de, - "Ivan T. Ivanov" -Subject: [PATCH v3 7/7] pci: pcie-brcmstb: Add bcm2712 PCIe controller support -Date: Mon, 18 Dec 2023 23:03:41 +0200 -Message-ID: <20231218210341.30073-8-iivanov@suse.de> -X-Mailer: git-send-email 2.43.0 -In-Reply-To: <20231218210341.30073-1-iivanov@suse.de> -References: <20231218210341.30073-1-iivanov@suse.de> -MIME-Version: 1.0 -X-Rspamd-Server: rspamd1.dmz-prg2.suse.org -X-Spamd-Bar: / -X-Spamd-Result: default: False [-0.31 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; - RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; - TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; - BROKEN_CONTENT_TYPE(1.50)[]; - R_RATELIMIT(0.00)[to_ip_from(RLccgikja4sxqnupiwsfdm9q1r)]; - RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; - MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[11]; - FREEMAIL_TO(0.00)[suse.com,gmail.com]; FROM_EQ_ENVFROM(0.00)[]; - MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[27.73%]; - ARC_NA(0.00)[]; - R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - RCVD_DKIM_ARC_DNSWL_HI(-1.00)[]; FROM_HAS_DN(0.00)[]; - FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.net]; - TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; - DWL_DNSWL_HI(-3.50)[suse.de:dkim]; - DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; - MID_CONTAINS_FROM(1.00)[]; - DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; - FUZZY_BLOCKED(0.00)[rspamd.com]; - FREEMAIL_CC(0.00)[bedrocksystems.com,fitzsim.org,nxp.com,samsung.com,denx.de,gmx.net,broadcom.com,lists.denx.de,suse.de]; - RCVD_TLS_ALL(0.00)[]; - RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:97:from] -Authentication-Results: smtp-out2.suse.de; - dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1by1WnE8; - dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=e64lBvSE -X-Rspamd-Queue-Id: 5507C1F6E6 -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.8 at phobos.denx.de -X-Virus-Status: Clean - -PCIe controller have minor register map difference compared -to bcm2711 variant. Handle this using device specific register -offset. - -Signed-off-by: Ivan T. Ivanov ---- - drivers/pci/pcie_brcmstb.c | 23 +++++++++++++++++++---- - 1 file changed, 19 insertions(+), 4 deletions(-) - -diff --git a/drivers/pci/pcie_brcmstb.c b/drivers/pci/pcie_brcmstb.c -index cd45f0bee9..d63e715b2e 100644 ---- a/drivers/pci/pcie_brcmstb.c -+++ b/drivers/pci/pcie_brcmstb.c -@@ -90,7 +90,6 @@ - #define PCIE_MEM_WIN0_LIMIT_HI(win) \ - PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LIMIT_HI + ((win) * 8) - --#define PCIE_MISC_HARD_PCIE_HARD_DEBUG 0x4204 - #define PCIE_HARD_DEBUG_SERDES_IDDQ_MASK 0x08000000 - - #define PCIE_MSI_INTR2_CLR 0x4508 -@@ -131,6 +130,10 @@ - #define SSC_STATUS_PLL_LOCK_MASK 0x800 - #define SSC_STATUS_PLL_LOCK_SHIFT 11 - -+struct pcie_cfg_data { -+ unsigned long hard_debug_offs; -+}; -+ - /** - * struct brcm_pcie - the PCIe controller state - * @base: Base address of memory mapped IO registers of the controller -@@ -141,6 +144,7 @@ - struct brcm_pcie { - void __iomem *base; - -+ struct pcie_cfg_data *cfg; - int gen; - bool ssc; - }; -@@ -458,7 +462,7 @@ static int brcm_pcie_probe(struct udevice *dev) - /* Take the bridge out of reset */ - clrbits_le32(base + PCIE_RGR1_SW_INIT_1, RGR1_SW_INIT_1_INIT_MASK); - -- clrbits_le32(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG, -+ clrbits_le32(base + pcie->cfg->hard_debug_offs, - PCIE_HARD_DEBUG_SERDES_IDDQ_MASK); - - /* Wait for SerDes to be stable */ -@@ -599,7 +603,7 @@ static int brcm_pcie_remove(struct udevice *dev) - setbits_le32(base + PCIE_RGR1_SW_INIT_1, RGR1_SW_INIT_1_PERST_MASK); - - /* Turn off SerDes */ -- setbits_le32(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG, -+ setbits_le32(base + pcie->cfg->hard_debug_offs, - PCIE_HARD_DEBUG_SERDES_IDDQ_MASK); - - /* Shutdown bridge */ -@@ -620,6 +624,8 @@ static int brcm_pcie_of_to_plat(struct udevice *dev) - if (!pcie->base) - return -EINVAL; - -+ pcie->cfg = (struct pcie_cfg_data *)dev_get_driver_data(dev); -+ - pcie->ssc = ofnode_read_bool(dn, "brcm,enable-ssc"); - - ret = ofnode_read_u32(dn, "max-link-speed", &max_link_speed); -@@ -636,8 +642,17 @@ static const struct dm_pci_ops brcm_pcie_ops = { - .write_config = brcm_pcie_write_config, - }; - -+static const struct pcie_cfg_data bcm2711_cfg = { -+ .hard_debug_offs = 0x4204 -+}; -+ -+static const struct pcie_cfg_data bcm2712_cfg = { -+ .hard_debug_offs = 0x4304 -+}; -+ - static const struct udevice_id brcm_pcie_ids[] = { -- { .compatible = "brcm,bcm2711-pcie" }, -+ { .compatible = "brcm,bcm2711-pcie", .data = (ulong)&bcm2711_cfg }, -+ { .compatible = "brcm,bcm2712-pcie", .data = (ulong)&bcm2712_cfg }, - { } - }; - diff --git a/sources b/sources index 8f50a6d..be81335 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (u-boot-2024.04-rc2.tar.bz2) = f5c6d6a37ce6b34bd1ab2cddd5d0cacddfd19b5345934731df3a7ed454a3895ad2d14acbdb2e1b922b9571778e50b54cb7612b1798a04dfb991365d3344cd865 +SHA512 (u-boot-2024.04-rc3.tar.bz2) = 75f36d57330e771dd3757c49d576b3a7f1c933dad9a102f22d2438286a763f0ec7deae863a97559cac48be8fc736b68a5292b4383d45178b111bd08134352e38 diff --git a/uboot-tools.spec b/uboot-tools.spec index eb2f4a3..4d006c4 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -1,4 +1,4 @@ -%global candidate rc2 +%global candidate rc3 %if 0%{?rhel} %bcond_with toolsonly %else @@ -7,7 +7,7 @@ Name: uboot-tools Version: 2024.04 -Release: 0.2%{?candidate:.%{candidate}}%{?dist} +Release: 0.3%{?candidate:.%{candidate}}%{?dist} Epoch: 1 Summary: U-Boot utilities License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ @@ -17,17 +17,23 @@ ExcludeArch: s390x Source0: https://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candidate}}.tar.bz2 Source1: aarch64-boards +# This is now legacy, most devices use bootflow, we keep this for the laggards Patch1: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch -Patch2: disable-VBE-by-default.patch +# Identify VFAT partitions as ESP, allows EFI setvar on our images +Patch2: uefi-Add-all-options-for-EFI-System-Partitions.patch +# New function to find fdt for loading from disk +#Patch3: +# Fedora patches to enable/disable features +Patch4: disable-VBE-by-default.patch Patch5: enable-bootmenu-by-default.patch -Patch7: Add-video-damage-tracking.patch +# Should be upstream but it's taking time +Patch6: Add-video-damage-tracking.patch # Board fixes and enablement # RPi - uses RPI firmware device tree for HAT support Patch10: rpi-Switch-to-OF_HAS_PRIOR_STAGE-by-default.patch # Rockchips improvements Patch11: rockchip-Add-initial-support-for-the-PinePhone-Pro.patch -#Patch12: 0001-Revert-rockchip-rockpro64-Build-u-boot-rockchip-spi..patch BuildRequires: bc BuildRequires: bison @@ -87,22 +93,27 @@ do mkdir builds/$(echo $board)/ # ATF selection, needs improving, suggestions of ATF SoC to Board matrix welcome - sun50i=(a64-olinuxino amarula_a64_relic bananapi_m2_plus_h5 bananapi_m64 libretech_all_h3_cc_h5 nanopi_a64 nanopi_neo2 nanopi_neo_plus2 orangepi_pc2 orangepi_prime orangepi_win orangepi_zero_plus orangepi_zero_plus2 pine64-lts pine64_plus pinebook pinephone pinetab sopine_baseboard teres_i) + sun50i=(a64-olinuxino a64-olinuxino-emmc amarula_a64_relic bananapi_m2_plus_h5 bananapi_m64 libretech_all_h3_cc_h5 nanopi_a64 nanopi_neo2 nanopi_neo_plus2 oceanic_5205_5inmfd orangepi_pc2 orangepi_prime orangepi_win orangepi_zero_plus orangepi_zero_plus2 pine64-lts pine64_plus pinebook pinephone pinetab sopine_baseboard teres_i) if [[ " ${sun50i[*]} " == *" $board "* ]]; then echo "Board: $board using sun50i_a64" - cp /usr/share/arm-trusted-firmware/sun50i_a64/* builds/$(echo $board)/ + cp /usr/share/arm-trusted-firmware/sun50i_a64/bl31.bin builds/$(echo $board)/atf-bl31 fi - sun50h6=(beelink_gs1 orangepi_3 orangepi_lite2 orangepi_one_plus orangepi_zero2 pine_h64 tanix_tx6) + sun50h6=(beelink_gs1 emlid_neutis_n5_devboard orangepi_3 orangepi_lite2 orangepi_one_plus pine_h64 tanix_tx6) if [[ " ${sun50h6[*]} " == *" $board "* ]]; then echo "Board: $board using sun50i_h6" - cp /usr/share/arm-trusted-firmware/sun50i_h6/* builds/$(echo $board)/ + cp /usr/share/arm-trusted-firmware/sun50i_h6/bl31.bin builds/$(echo $board)/atf-bl31 fi - rk3328=(evb-rk3328 nanopi-r2s-rk3328 rock64-rk3328 rock-pi-e-rk3328 roc-cc-rk3328) + sun50i_h616=(orangepi_zero2 orangepi_zero3 transpeed-8k618-t x96_mate) + if [[ " ${sun50i_h616[*]} " == *" $board "* ]]; then + echo "Board: $board using sun50i_h616" + cp /usr/share/arm-trusted-firmware/sun50i_h616/bl31.bin builds/$(echo $board)/atf-bl31 + fi + rk3328=(evb-rk3328 nanopi-r2c-plus-rk3328 nanopi-r2c-rk3328 nanopi-r2s-rk3328 orangepi-r1-plus-lts-rk3328 orangepi-r1-plus-rk3328 roc-cc-rk3328 rock64-rk3328 rock-pi-e-rk3328) if [[ " ${rk3328[*]} " == *" $board "* ]]; then echo "Board: $board using rk3328" cp /usr/share/arm-trusted-firmware/rk3328/bl31.elf builds/$(echo $board)/atf-bl31 fi - rk3399=(evb-rk3399 ficus-rk3399 firefly-rk3399 khadas-edge-captain-rk3399 khadas-edge-rk3399 khadas-edge-v-rk3399 leez-rk3399 nanopc-t4-rk3399 nanopi-m4-2gb-rk3399 nanopi-m4b-rk3399 nanopi-m4-rk3399 nanopi-neo4-rk3399 nanopi-r4s-rk3399 orangepi-rk3399 pinebook-pro-rk3399 pinephone-pro-rk3399 puma-rk3399 rock960-rk3399 rock-pi-4c-rk3399 rock-pi-4-rk3399 rock-pi-n10-rk3399pro rockpro64-rk3399 roc-pc-mezzanine-rk3399 roc-pc-rk3399 eaidk-610-rk3399) + rk3399=(eaidk-610-rk3399 evb-rk3399 ficus-rk3399 firefly-rk3399 khadas-edge-captain-rk3399 khadas-edge-rk3399 khadas-edge-v-rk3399 leez-rk3399 nanopc-t4-rk3399 nanopi-m4-2gb-rk3399 nanopi-m4b-rk3399 nanopi-m4-rk3399 nanopi-neo4-rk3399 nanopi-r4s-rk3399 orangepi-rk3399 pinebook-pro-rk3399 pinephone-pro-rk3399 puma-rk3399 rock960-rk3399 rock-pi-4c-rk3399 rock-pi-4-rk3399 rock-pi-n10-rk3399pro rockpro64-rk3399 roc-pc-mezzanine-rk3399 roc-pc-rk3399) if [[ " ${rk3399[*]} " == *" $board "* ]]; then echo "Board: $board using rk3399" cp /usr/share/arm-trusted-firmware/rk3399/* builds/$(echo $board)/ @@ -113,17 +124,6 @@ do BINMAN_ALLOW_MISSING=1 make $(echo $board)_defconfig O=builds/$(echo $board)/ BINMAN_ALLOW_MISSING=1 %make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" O=builds/$(echo $board)/ - # build spi images for rockchip boards with SPI flash - rkspi=(rock64-rk3328) - if [[ " ${rkspi[*]} " == *" $board "* ]]; then - echo "Board: $board with SPI flash" - builds/$(echo $board)/tools/mkimage -n rk3328 -T rkspi -d builds/$(echo $board)/tpl/u-boot-tpl.bin:builds/$(echo $board)/spl/u-boot-spl.bin builds/$(echo $board)/idbloader.spi - fi - rkspi=(evb-rk3399 khadas-edge-captain-rk3399 khadas-edge-rk3399 khadas-edge-v-rk3399 nanopc-t4-rk3399 pinebook-pro-rk3399 pinephone-pro-rk3399 rockpro64-rk3399 roc-pc-mezzanine-rk3399 roc-pc-rk3399) - if [[ " ${rkspi[*]} " == *" $board "* ]]; then - echo "Board: $board with SPI flash" - builds/$(echo $board)/tools/mkimage -n rk3399 -T rkspi -d builds/$(echo $board)/tpl/u-boot-tpl.bin:builds/$(echo $board)/spl/u-boot-spl.bin builds/$(echo $board)/idbloader.spi - fi done %endif @@ -138,39 +138,24 @@ mkdir -p %{buildroot}%{_datadir}/uboot/ %ifarch aarch64 for board in $(ls builds) do - mkdir -p %{buildroot}%{_datadir}/uboot/$(echo $board)/ - for file in u-boot.bin u-boot.dtb u-boot.img u-boot-dtb.img u-boot.itb u-boot-sunxi-with-spl.bin u-boot-rockchip.bin idbloader.img idbloader.spi spl/boot.bin spl/sunxi-spl.bin + for file in u-boot.bin u-boot.img u-boot-dtb.img u-boot.itb u-boot-sunxi-with-spl.bin u-boot-rockchip.bin idbloader.img idbloader-spi.img spl/boot.bin do if [ -f builds/$(echo $board)/$(echo $file) ]; then - install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/$(echo $board)/ + install -pD -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/$(echo $board)/$(echo $file) fi done done -# For Apple M1 we also need the nodtb variant -install -p -m 0644 builds/apple_m1/u-boot-nodtb.bin %{buildroot}%{_datadir}/uboot/apple_m1/u-boot-nodtb.bin -%endif +# For Apple M-series we also need the nodtb variant +install -pD -m 0644 builds/apple_m1/u-boot-nodtb.bin %{buildroot}%{_datadir}/uboot/apple_m1/u-boot-nodtb.bin # Bit of a hack to remove binaries we don't use as they're large -%ifarch aarch64 for board in $(ls builds) do rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.dtb if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot-sunxi-with-spl.bin ]; then rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot{,-dtb}.* - fi - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/MLO ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin - fi - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/SPL ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin - fi - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.imx ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin - fi - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot-spl.kwb ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.* - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot-spl.bin + rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/sunxi-spl.bin fi if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/idbloader.img ]; then rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin @@ -194,16 +179,23 @@ install -p -m 0755 builds/tools/env/fw_printenv %{buildroot}%{_bindir} %doc doc/develop/uefi doc/usage doc/arch/arm64.rst %{_bindir}/* %{_mandir}/man1/mkimage.1* -%dir %{_datadir}/uboot/ %if %{with toolsonly} %ifarch aarch64 %files -n uboot-images-armv8 +%dir %{_datadir}/uboot/ %{_datadir}/uboot/* %endif %endif %changelog +* Thu Feb 29 2024 Peter Robinson - 1:2024.04-0.3.rc3 +- Update to 2024.04 RC3 +- Enable a number of new upstream devices +- Upstream now builds Rockchip SPI artifacts +- Various cleanups +- Fix ESP partition detection to enable EFI vars + * Wed Feb 14 2024 Peter Robinson - 1:2024.04-0.2.rc2 - Update to 2024.04 RC2 diff --git a/uefi-Add-all-options-for-EFI-System-Partitions.patch b/uefi-Add-all-options-for-EFI-System-Partitions.patch new file mode 100644 index 0000000..22c5bcc --- /dev/null +++ b/uefi-Add-all-options-for-EFI-System-Partitions.patch @@ -0,0 +1,36 @@ +From 7ce45304053f31afaea6b80305aaee164c2e260a Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 21 Feb 2024 14:43:16 +0000 +Subject: [PATCH] disk: dos: Add all options for EFI System Partitions + +The EFI spec states that the ESP can be any of FAT12/16/32 but for +compatibility doesn't necssarily require the partition to be the +EFI partition table ID of 0xef. A number of arm devices will not +find their firmware on a FAT partition with an ID of 0xef so also +allow the original FAT12/16/32 partition IDs as they are also +permissable for an ESP. + +Signed-off-by: Peter Robinson +--- + disk/part_dos.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/disk/part_dos.c b/disk/part_dos.c +index 567ead7511d..303eb1d13ee 100644 +--- a/disk/part_dos.c ++++ b/disk/part_dos.c +@@ -40,6 +40,12 @@ static int get_bootable(dos_partition_t *p) + { + int ret = 0; + ++ if (p->sys_ind == 0x1) ++ ret |= PART_EFI_SYSTEM_PARTITION; ++ if (p->sys_ind == 0x6) ++ ret |= PART_EFI_SYSTEM_PARTITION; ++ if (p->sys_ind == 0x0b) ++ ret |= PART_EFI_SYSTEM_PARTITION; + if (p->sys_ind == 0xef) + ret |= PART_EFI_SYSTEM_PARTITION; + if (p->boot_ind == 0x80) +-- +2.43.1