From patchwork Sat Apr 9 16:55:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615285 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=QsyDVoul; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLq12Gwhz9sBy for ; Sun, 10 Apr 2022 02:55:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 566EA83894; Sat, 9 Apr 2022 18:55:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QsyDVoul"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 29BCC83BF6; Sat, 9 Apr 2022 18:55:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C39358343B for ; Sat, 9 Apr 2022 18:55:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x635.google.com with SMTP id bg10so23008019ejb.4 for ; Sat, 09 Apr 2022 09:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CjtjbhLuqylRpnxbZ/NPDFPcI6M72AnUQQQeukEXjUE=; b=QsyDVoulH5flO6YN/V9kklg43a4qQHFA8+fnZVLh4ThD0B8tIxlqSNPTutX7FuB0rD lChpTGegWl7as99QtuIO05P3dYGP4iRHFSLLnzX8GMe5dV+O5V+Lu89FYizYJFKfuqB7 16Br5oqBaSeYYZ6Sa6cwmmpFb7NsBfIca1eaHzWCsi2k45aNNYiU9W/Yoq3Tjx1zOHQ+ E2U4liR9JbIU1vJ7vL9eSUp+U2oyeqtN4ue5ElM/VGxYjXhsvYgZvpQmCA8p4kcmJkcq zHZHO6y9pD2XoH7wqAURwrYjN87ui8eUTGebqHEqauA2OUupEv7kPl4W3s77OTP0d0xv y6NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CjtjbhLuqylRpnxbZ/NPDFPcI6M72AnUQQQeukEXjUE=; b=oHiD6nfB+pMfgOKxPX68fWUHAeSgXi/emx2JXS6wSUbWbcTlrDV3t6rj/1uw6xEXxi 0KRWDNfDn9RCGnz9WvO6jLtmxE9ZjnN4+YYnUIJ1ajNdDThw/M+ej6dErMzGpQrQSKse nPAFkg1a582zs1yFFTWWH9cJ/1NSvIvGnq4msr4MOy9DobM0dUq0bNE8STlWty1iRbOM 6hPtxANrHQQ7EIX4059L9+T6QLmf6KItqgHC/6zlhIymzeVpROSmA8Ar8w8kWe+gpq2R 50nZ0w0Ckhm5BP3/QvuAryqd9ajeaUiiEWGCDkZikNv1UdNgim22f4Y73GG8V51ky7Mj TefQ== X-Gm-Message-State: AOAM532Pi+zExeJonPtKiKRdyj2ghtd6hJ7toypyM04QCQTXck+gD2I1 0WylsM+Oa6WBU5fyQHXcQVM= X-Google-Smtp-Source: ABdhPJzSJ5lsA7SXcb0YT0uI8gCsFEoH+U3ocOPLRZb0bmf0Ja1MSvZTArgwlb+u6EmXk+YGyE38Aw== X-Received: by 2002:a17:907:7b92:b0:6db:71f1:fc20 with SMTP id ne18-20020a1709077b9200b006db71f1fc20mr22335211ejc.343.1649523326384; Sat, 09 Apr 2022 09:55:26 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:26 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 01/13] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Date: Sat, 9 Apr 2022 18:55:02 +0200 Message-Id: <20220409165514.19220-2-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean Move ROCKCHIP_STIMER_BASE to Kconfig. Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- Changed V4: rebase remove depends on rk3188/rk3066 must now disable ROCKCHIP_STIMER in defconfig with defconfig there is more flexibility for other SoC types Changed V3: add ROCKCHIP_STIMER --- arch/arm/mach-rockchip/Kconfig | 10 ++++++++++ arch/arm/mach-rockchip/px30/Kconfig | 3 +++ arch/arm/mach-rockchip/rk3036/Kconfig | 3 +++ arch/arm/mach-rockchip/rk3128/Kconfig | 3 +++ arch/arm/mach-rockchip/rk322x/Kconfig | 3 +++ arch/arm/mach-rockchip/rk3288/Kconfig | 3 +++ arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++---- arch/arm/mach-rockchip/rk3328/Kconfig | 3 +++ arch/arm/mach-rockchip/rk3368/Kconfig | 3 +++ arch/arm/mach-rockchip/rk3399/Kconfig | 3 +++ arch/arm/mach-rockchip/rk3568/Kconfig | 3 +++ configs/rock_defconfig | 3 ++- include/configs/px30_common.h | 1 - include/configs/rk3036_common.h | 1 - include/configs/rk3128_common.h | 1 - include/configs/rk322x_common.h | 1 - include/configs/rk3288_common.h | 1 - include/configs/rk3308_common.h | 1 - include/configs/rk3328_common.h | 1 - include/configs/rk3368_common.h | 1 - include/configs/rk3399_common.h | 1 - include/configs/rk3568_common.h | 1 - 22 files changed, 45 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 308dc09b03..811964973a 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -339,6 +339,16 @@ config ROCKCHIP_BOOT_MODE_REG The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h) according to the value from this register. +config ROCKCHIP_STIMER + bool "Rockchip STIMER support" + default y + help + Enable Rockchip STIMER support. + +config ROCKCHIP_STIMER_BASE + hex + depends on ROCKCHIP_STIMER + config ROCKCHIP_SPL_RESERVE_IRAM hex "Size of IRAM reserved in SPL" default 0 diff --git a/arch/arm/mach-rockchip/px30/Kconfig b/arch/arm/mach-rockchip/px30/Kconfig index 145bf3591f..4886fe946e 100644 --- a/arch/arm/mach-rockchip/px30/Kconfig +++ b/arch/arm/mach-rockchip/px30/Kconfig @@ -38,6 +38,9 @@ config TARGET_PX30_CORE config ROCKCHIP_BOOT_MODE_REG default 0xff010200 +config ROCKCHIP_STIMER_BASE + default 0xff220020 + config SYS_SOC default "px30" diff --git a/arch/arm/mach-rockchip/rk3036/Kconfig b/arch/arm/mach-rockchip/rk3036/Kconfig index b746795d81..111531be1e 100644 --- a/arch/arm/mach-rockchip/rk3036/Kconfig +++ b/arch/arm/mach-rockchip/rk3036/Kconfig @@ -16,6 +16,9 @@ endchoice config ROCKCHIP_BOOT_MODE_REG default 0x200081c8 +config ROCKCHIP_STIMER_BASE + default 0x200440a0 + config SYS_SOC default "rk3036" diff --git a/arch/arm/mach-rockchip/rk3128/Kconfig b/arch/arm/mach-rockchip/rk3128/Kconfig index b867401c7f..9cc494eb40 100644 --- a/arch/arm/mach-rockchip/rk3128/Kconfig +++ b/arch/arm/mach-rockchip/rk3128/Kconfig @@ -16,6 +16,9 @@ endchoice config ROCKCHIP_BOOT_MODE_REG default 0x100a0038 +config ROCKCHIP_STIMER_BASE + default 0x200440a0 + config SYS_SOC default "rk3128" diff --git a/arch/arm/mach-rockchip/rk322x/Kconfig b/arch/arm/mach-rockchip/rk322x/Kconfig index 6458cd5581..058f848ddc 100644 --- a/arch/arm/mach-rockchip/rk322x/Kconfig +++ b/arch/arm/mach-rockchip/rk322x/Kconfig @@ -8,6 +8,9 @@ config TARGET_EVB_RK3229 config ROCKCHIP_BOOT_MODE_REG default 0x110005c8 +config ROCKCHIP_STIMER_BASE + default 0x110d0020 + config SYS_SOC default "rk322x" diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index f37b1bdfd5..dd8c7826fc 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -148,6 +148,9 @@ config ROCKCHIP_FAST_SPL config ROCKCHIP_BOOT_MODE_REG default 0xff730094 +config ROCKCHIP_STIMER_BASE + default 0xff810020 + config SYS_SOC default "rk3288" diff --git a/arch/arm/mach-rockchip/rk3308/Kconfig b/arch/arm/mach-rockchip/rk3308/Kconfig index 8fa536e15d..194353e4cd 100644 --- a/arch/arm/mach-rockchip/rk3308/Kconfig +++ b/arch/arm/mach-rockchip/rk3308/Kconfig @@ -8,6 +8,12 @@ config TARGET_ROC_RK3308_CC bool "Firefly roc-rk3308-cc" select BOARD_LATE_INIT +config ROCKCHIP_BOOT_MODE_REG + default 0xff000500 + +config ROCKCHIP_STIMER_BASE + default 0xff1b00a0 + config SYS_SOC default "rk3308" @@ -17,10 +23,6 @@ config SYS_MALLOC_F_LEN config SPL_SERIAL default y -config ROCKCHIP_BOOT_MODE_REG - default 0xff000500 - - source "board/rockchip/evb_rk3308/Kconfig" source "board/firefly/firefly-rk3308/Kconfig" diff --git a/arch/arm/mach-rockchip/rk3328/Kconfig b/arch/arm/mach-rockchip/rk3328/Kconfig index d13a169022..f6f1e06a83 100644 --- a/arch/arm/mach-rockchip/rk3328/Kconfig +++ b/arch/arm/mach-rockchip/rk3328/Kconfig @@ -15,6 +15,9 @@ endchoice config ROCKCHIP_BOOT_MODE_REG default 0xff1005c8 +config ROCKCHIP_STIMER_BASE + default 0xff1d0020 + config SYS_SOC default "rk3328" diff --git a/arch/arm/mach-rockchip/rk3368/Kconfig b/arch/arm/mach-rockchip/rk3368/Kconfig index 78eb96df3d..104db36737 100644 --- a/arch/arm/mach-rockchip/rk3368/Kconfig +++ b/arch/arm/mach-rockchip/rk3368/Kconfig @@ -45,6 +45,9 @@ endchoice config ROCKCHIP_BOOT_MODE_REG default 0xff738200 +config ROCKCHIP_STIMER_BASE + default 0xff830020 + config SYS_SOC default "rk3368" diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig index 0833e083d9..c1f251316c 100644 --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm/mach-rockchip/rk3399/Kconfig @@ -125,6 +125,9 @@ endchoice config ROCKCHIP_BOOT_MODE_REG default 0xff320300 +config ROCKCHIP_STIMER_BASE + default 0xff8680a0 + config SYS_SOC default "rk3399" diff --git a/arch/arm/mach-rockchip/rk3568/Kconfig b/arch/arm/mach-rockchip/rk3568/Kconfig index 201c63c2a9..4e7c02cce0 100644 --- a/arch/arm/mach-rockchip/rk3568/Kconfig +++ b/arch/arm/mach-rockchip/rk3568/Kconfig @@ -9,6 +9,9 @@ config TARGET_EVB_RK3568 config ROCKCHIP_BOOT_MODE_REG default 0xfdc20200 +config ROCKCHIP_STIMER_BASE + default 0xfdd1c020 + config SYS_SOC default "rk3568" diff --git a/configs/rock_defconfig b/configs/rock_defconfig index 46df66994b..4aa4608f90 100644 --- a/configs/rock_defconfig +++ b/configs/rock_defconfig @@ -11,12 +11,13 @@ CONFIG_ENV_OFFSET=0x3F8000 CONFIG_DEFAULT_DEVICE_TREE="rk3188-radxarock" CONFIG_SPL_TEXT_BASE=0x10080800 CONFIG_ROCKCHIP_RK3188=y +# CONFIG_ROCKCHIP_STIMER is not set CONFIG_TARGET_ROCK=y CONFIG_SPL_STACK_R_ADDR=0x60080000 CONFIG_DEBUG_UART_BASE=0x20064000 CONFIG_DEBUG_UART_CLOCK=24000000 -CONFIG_DEBUG_UART=y CONFIG_SYS_LOAD_ADDR=0x60800800 +CONFIG_DEBUG_UART=y CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rk3188-radxarock.dtb" # CONFIG_DISPLAY_CPUINFO is not set diff --git a/include/configs/px30_common.h b/include/configs/px30_common.h index 0992387157..dc609013f3 100644 --- a/include/configs/px30_common.h +++ b/include/configs/px30_common.h @@ -12,7 +12,6 @@ #define CONFIG_SYS_NS16550_MEM32 -#define CONFIG_ROCKCHIP_STIMER_BASE 0xff220020 #define COUNTER_FREQUENCY 24000000 /* FIXME: ff020000 is pmu_mem (10k), while ff0e0000 is regular int_mem */ diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h index 00c453d739..5905518edf 100644 --- a/include/configs/rk3036_common.h +++ b/include/configs/rk3036_common.h @@ -10,7 +10,6 @@ #define CONFIG_SYS_CBSIZE 1024 -#define CONFIG_ROCKCHIP_STIMER_BASE 0x200440a0 #define COUNTER_FREQUENCY 24000000 #define CONFIG_SYS_HZ_CLOCK 24000000 diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h index 97caceacfe..d77a7d7b09 100644 --- a/include/configs/rk3128_common.h +++ b/include/configs/rk3128_common.h @@ -11,7 +11,6 @@ #define CONFIG_SYS_MAXARGS 16 #define CONFIG_SYS_CBSIZE 1024 -#define CONFIG_ROCKCHIP_STIMER_BASE 0x200440a0 #define COUNTER_FREQUENCY 24000000 #define CONFIG_SYS_HZ_CLOCK 24000000 diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h index ef55ef0a83..3258820fcd 100644 --- a/include/configs/rk322x_common.h +++ b/include/configs/rk322x_common.h @@ -11,7 +11,6 @@ #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64M */ -#define CONFIG_ROCKCHIP_STIMER_BASE 0x110d0020 #define COUNTER_FREQUENCY 24000000 #define CONFIG_SYS_HZ_CLOCK 24000000 diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 490da7cb23..e2e0f70a70 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -13,7 +13,6 @@ #define CONFIG_SYS_CBSIZE 1024 -#define CONFIG_ROCKCHIP_STIMER_BASE 0xff810020 #define COUNTER_FREQUENCY 24000000 #define CONFIG_SYS_HZ_CLOCK 24000000 diff --git a/include/configs/rk3308_common.h b/include/configs/rk3308_common.h index 1664707ca6..9cda8d9c48 100644 --- a/include/configs/rk3308_common.h +++ b/include/configs/rk3308_common.h @@ -15,7 +15,6 @@ #define CONFIG_SYS_NS16550_MEM32 -#define CONFIG_ROCKCHIP_STIMER_BASE 0xff1b00a0 #define CONFIG_IRAM_BASE 0xfff80000 #define CONFIG_SYS_INIT_SP_ADDR 0x00800000 #define CONFIG_SPL_STACK 0x00400000 diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index c1e26a019b..8a5f0c8999 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -10,7 +10,6 @@ #define CONFIG_IRAM_BASE 0xff090000 -#define CONFIG_ROCKCHIP_STIMER_BASE 0xff1d0020 #define COUNTER_FREQUENCY 24000000 #define CONFIG_SYS_CBSIZE 1024 diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h index 8b239ca07d..239296c1d2 100644 --- a/include/configs/rk3368_common.h +++ b/include/configs/rk3368_common.h @@ -15,7 +15,6 @@ #define SDRAM_MAX_SIZE 0xff000000 #define CONFIG_SYS_CBSIZE 1024 -#define CONFIG_ROCKCHIP_STIMER_BASE 0xff830020 #define COUNTER_FREQUENCY 24000000 #define CONFIG_IRAM_BASE 0xff8c0000 diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index ed72c8bb6b..4037dba58c 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -11,7 +11,6 @@ #define CONFIG_SYS_CBSIZE 1024 #define COUNTER_FREQUENCY 24000000 -#define CONFIG_ROCKCHIP_STIMER_BASE 0xff8680a0 #define CONFIG_IRAM_BASE 0xff8c0000 diff --git a/include/configs/rk3568_common.h b/include/configs/rk3568_common.h index 25d7c5cc8f..5649cd64e0 100644 --- a/include/configs/rk3568_common.h +++ b/include/configs/rk3568_common.h @@ -11,7 +11,6 @@ #define CONFIG_SYS_CBSIZE 1024 #define COUNTER_FREQUENCY 24000000 -#define CONFIG_ROCKCHIP_STIMER_BASE 0xfdd1c020 #define CONFIG_IRAM_BASE 0xfdcc0000 From patchwork Sat Apr 9 16:55:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615286 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=nwPGzG0q; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLq80sprz9sBy for ; Sun, 10 Apr 2022 02:56:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A236383931; Sat, 9 Apr 2022 18:55:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nwPGzG0q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7082983C70; Sat, 9 Apr 2022 18:55:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B489B837DE for ; Sat, 9 Apr 2022 18:55:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x633.google.com with SMTP id l26so23014629ejx.1 for ; Sat, 09 Apr 2022 09:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6lAmeKMc7ZvUAO5obnIzSHC2eR3CCop741b0m+nty2s=; b=nwPGzG0qzqnVycteCiM5A0QtrNVgA0Nx83Wlm3NGfZVM8WKBrUAOKPkt1r2JS+0cig XGA600SkkYXh2boQj635fXcdJRpia1lcyzT1Js/R+uKQvGi4Hpk4QaY1BCG6cpQDAm8z v16YP+SwX/w0KqQBUhehnLdt3P4omaOJa+C/l4AcLDN78LJK20t3aX2bZlCScCVdvpkq /yDvGO5zswmBODNGAGfqVQfzQ8DGvWGxjP2ZR1wjN5+S4psrn1OnAyrBWzXMy251+R1Z GPX2h1CGFeysHVH3YEGjIyXNDdQ2ut1ifg/xjtFIHoZBqNBQah2rr2VPQDhD7H5k7ZQR Yo5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6lAmeKMc7ZvUAO5obnIzSHC2eR3CCop741b0m+nty2s=; b=nu+YHvk1cKS023jngPISJuRf649TueaP35VmIiq86So3XDCsrjSBDwOoa+Jtu/c+3H fCuZfnUty4J0m/El7wT9EnIV3QXp6mRHdDnu3QjmbFo+y5StOv8JZYRlog2wrNcuiaNm HrOpc9ZAfRDDcXuh3rLrq3reJJUGzwvTl8Ffdh+0er1yMJpXS1JUENGc2Jkb8YsXKYwu A4MQWy8kcDJYe/eKo/jTgKaRLPeVmzsZSqaL8BFizLP170sJ6HM9U5jRL+4ExY0LqUed yJ8nwrBS5B5vrqgGytZNejDgcWfcYdL1pO0ANbXNDuhdW0zHu66eG2L0dQzYNv0JXqCx db8g== X-Gm-Message-State: AOAM5322E50S9iK7J5fGW3DL/E1MuehuEDCT1LlCZyt7HXlMQEoLHmzP u5pRrZFJ87Q8vH7UPeGiDE4= X-Google-Smtp-Source: ABdhPJxENl26JDbtukHJD6xr8pFZtn5iTfhLRqfzDHPCj38dKnIX2tX/gxdtIsKXeVbcK3lruwERUQ== X-Received: by 2002:a17:906:6990:b0:6e8:7765:a709 with SMTP id i16-20020a170906699000b006e87765a709mr1892090ejr.72.1649523327120; Sat, 09 Apr 2022 09:55:27 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:26 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 02/13] rockchip: spl: change call condition rockchip_stimer_init() Date: Sat, 9 Apr 2022 18:55:03 +0200 Message-Id: <20220409165514.19220-3-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE defined. Currently only rk3188 has an exception in SPL. Make this more generic and compile code inside the function rockchip_stimer_init() only when CONFIG_ROCKCHIP_STIMER_BASE is available. Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- Changed V5: reword remove IS_ENABLED remove include kconfig.h Changed V3: use CONFIG_ROCKCHIP_STIMER Changed V2: use IS_ENABLED add include kconfig.h move define location so that rockchip_stimer_init() is always visible to the compiler --- arch/arm/mach-rockchip/spl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c index 7a8db632b8..9bdc47bf7c 100644 --- a/arch/arm/mach-rockchip/spl.c +++ b/arch/arm/mach-rockchip/spl.c @@ -71,7 +71,6 @@ u32 spl_mmc_boot_mode(const u32 boot_device) return MMCSD_MODE_RAW; } -#if !defined(CONFIG_ROCKCHIP_RK3188) #define TIMER_LOAD_COUNT_L 0x00 #define TIMER_LOAD_COUNT_H 0x04 #define TIMER_CONTROL_REG 0x10 @@ -81,6 +80,7 @@ u32 spl_mmc_boot_mode(const u32 boot_device) __weak void rockchip_stimer_init(void) { +#if defined(CONFIG_ROCKCHIP_STIMER_BASE) /* If Timer already enabled, don't re-init it */ u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); @@ -95,8 +95,8 @@ __weak void rockchip_stimer_init(void) writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); -} #endif +} __weak int board_early_init_f(void) { @@ -133,9 +133,9 @@ void board_init_f(ulong dummy) hang(); } arch_cpu_init(); -#if !defined(CONFIG_ROCKCHIP_RK3188) + rockchip_stimer_init(); -#endif + #ifdef CONFIG_SYS_ARCH_TIMER /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */ timer_init(); From patchwork Sat Apr 9 16:55:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615288 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=c8cI4C08; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLqb5Lk1z9sBy for ; Sun, 10 Apr 2022 02:56:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2494E83D30; Sat, 9 Apr 2022 18:55:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c8cI4C08"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8095683BF6; Sat, 9 Apr 2022 18:55:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 41F3783931 for ; Sat, 9 Apr 2022 18:55:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x62a.google.com with SMTP id lc2so2406489ejb.12 for ; Sat, 09 Apr 2022 09:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SFvleJhVUrRHdY8uo6seBG3SYro0hSFFv+uPWOi3EHY=; b=c8cI4C08Ivim2SibSYXGb+TtJ3ZyxmElBk3XmIZNWrY6Nx3YU0rYnn90LODrtYtsnq DSs0BinEAK6hMlkj8i95kDcvR+J/tzybM/EDUkeK1TslRb3pIlogAP89pbZy9O6tOJax 7QBVD8PJwQ4T69mDmiKFh6aQhWC8ijUVDJknMNjilWqKhngpir9pETNK0usLmcDnSwtu ng42GgVI1CfJZE8HVHNCtvOs/xSJtdhsDekb0xM5DR7FAcWawKBWqP0mZJYwD5vfEVsX 5tOhPMh6WfF+muTxetFMLPxxiGNGtzi6ksiPAuZTm+Y8yo3zJiFl98AgeY8dPJ7eTKA6 1Glw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SFvleJhVUrRHdY8uo6seBG3SYro0hSFFv+uPWOi3EHY=; b=SByD5e1qJiGgOXX06P51IzFC1oDwcVC4oz4KNia6v6a4Ju4vRHBzlDxxuoramgEjKi xmZq4fuxvpYnHdXHxcSGoUbVo2KKfRmxEqRAzkbHJHRyzt8Yb6KHmg8lCK1MlltBcvRu jblhTvneLZAhXC6/mp6GO1ZId1Yr5avmsLFbrCcFqie6QwoqDIzpr/zoOtOVCiR1mA/L rLCOQC8PTx3mLoL8dL4tSvXpwTZFDEH2vl4pgGWOaxKpAue7Vp+dIytta30TbQxogwlI OLA0b6p8lRWKpdNnLOZuRxQXiz+jPcfbmKb0nBgdYJ5W6b/+sBq78HoxFBzf0w6TYxOv UkYg== X-Gm-Message-State: AOAM5325PrlgFGShm4jWYhsQeF0F78FtnYGbCFZCY7eDcFmnusZKIEVB mGHoLgtK2K9ZDid3IDmY/04= X-Google-Smtp-Source: ABdhPJxtIDPt9/BNGy5k9Exbc8mh+hRspJBYPFs33NOB7L7idrQz+BxyTAbj+0toGgXkN6ngHcpdpA== X-Received: by 2002:a17:907:980b:b0:6e0:71d9:c87e with SMTP id ji11-20020a170907980b00b006e071d9c87emr22538372ejc.510.1649523327879; Sat, 09 Apr 2022 09:55:27 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:27 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 03/13] rockchip: tpl: change call condition rockchip_stimer_init() Date: Sat, 9 Apr 2022 18:55:04 +0200 Message-Id: <20220409165514.19220-4-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE defined. Currently there's no exception in TPL. Make this more generic and compile the code inside the function rockchip_stimer_init() only when CONFIG_ROCKCHIP_STIMER_BASE is available. Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- Changed V5: reword remove IS_ENABLED remove include kconfig.h Changed V3: use CONFIG_ROCKCHIP_STIMER Changed V2: use IS_ENABLED add include kconfig.h move define location so that rockchip_stimer_init() is always visible to the compiler --- arch/arm/mach-rockchip/tpl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index 3c007bb450..7f43f58406 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -29,6 +29,7 @@ __weak void rockchip_stimer_init(void) { +#if defined(CONFIG_ROCKCHIP_STIMER_BASE) /* If Timer already enabled, don't re-init it */ u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); @@ -45,6 +46,7 @@ __weak void rockchip_stimer_init(void) writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); +#endif } void board_init_f(ulong dummy) From patchwork Sat Apr 9 16:55:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615287 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=D/tQNIxL; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLqM0Xr8z9sBy for ; Sun, 10 Apr 2022 02:56:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1985B83DA2; Sat, 9 Apr 2022 18:55:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D/tQNIxL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D60BC83CF3; Sat, 9 Apr 2022 18:55:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CED40811D8 for ; Sat, 9 Apr 2022 18:55:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x629.google.com with SMTP id l7so17550316ejn.2 for ; Sat, 09 Apr 2022 09:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5r4pdQEIr6zF/C9nm2o2wyLJF6RmJN4Pbm4PfrYT0jI=; b=D/tQNIxLhgPlhhn3BSucje5+DolDH04I6wCNqNFbX18LoA755YWaX6T4pnDf8ukZG+ ON22cG/KySdPacenK7n0TiQ9JjnV1llvFbcNvBJoe8kUtRpzfed4q3SG9DahGY393pFi UqV4QRehIxFgBVZMbs83jNfzbHyRfL2TujEjwizMkc0BolnvOJhsIFpMsKEgTmlgF6c2 8pirSrctT3AwVoTzfLKOO1xIgLJfB7OiJhsIV9Yj56pN37ap34LnJvVTwB5DU8kqwtZC SYtphJrQrLlBOE8lyOVeVtP/qVjxm6dAFSBzclXEPzJxuN+24YhpwkEbnMhb69xVcfY2 MlKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5r4pdQEIr6zF/C9nm2o2wyLJF6RmJN4Pbm4PfrYT0jI=; b=E/0FE4Qa50v/TTieek/yU4Kf+EDAccJWWk1vX4ob+37ggVyeA4eagNkk7xUDjCH7+Y mIHXwW/o5r6s+90bXtilELqWLoWgBRK+RCWt2Dm/bCOqWRMsHmNz59NpEv8I9Wm56ED8 R72zzFRtDx0P0j4Qm+0GC25c7/JTIB8e/J7a26RRjA5hiz4y5EnsAlUfOQ9hfVv5Ujqd oLw1MbRQ4uQfjgXlKjkMM9lvl7cwToKNC5tba4BWDfWcw/JhFsWUyWUp4+8MLDl9qC8g 4OQUYdQ9QM026eqohbMaCloaKG7IBQM1KLhS2U1ci1GVjTkrevSdQ7BSW6ytesCmfoF+ j/iQ== X-Gm-Message-State: AOAM530D/yzv7l1Gw0k3Bsi4JoTcNPx8c5/3YJtzjCvhib8nNQiOSt8G 5CFiNVfPCKxmlS6l4lB58hg= X-Google-Smtp-Source: ABdhPJwtc96SyM0sBxfydgCYEK7gRUE0qXIBhETF6d00z/ZOV0qhQX8Eb5xPF696SzYW9AEKf9XOFg== X-Received: by 2002:a17:906:d1c8:b0:6e4:8244:4c5a with SMTP id bs8-20020a170906d1c800b006e482444c5amr1856912ejb.315.1649523328516; Sat, 09 Apr 2022 09:55:28 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:28 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 04/13] rockchip: tpl: use IS_ENABLED for timer_init() call condition Date: Sat, 9 Apr 2022 18:55:05 +0200 Message-Id: <20220409165514.19220-5-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean Not all Rockchip SoC models use the ARM arch timer. Call the function timer_init() only when CONFIG_SYS_ARCH_TIMER is available. Use the call condition IS_ENABLED to increase build coverage and make the code easier to read. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- Changed V5: rebase add include kconfig.h --- arch/arm/mach-rockchip/tpl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index 7f43f58406..8126587060 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -15,6 +15,7 @@ #include #include #include +#include #if CONFIG_IS_ENABLED(BANNER_PRINT) #include @@ -77,8 +78,10 @@ void board_init_f(ulong dummy) /* Init secure timer */ rockchip_stimer_init(); - /* Init ARM arch timer in arch/arm/cpu/ */ - timer_init(); + + /* Init ARM arch timer */ + if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER)) + timer_init(); ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { From patchwork Sat Apr 9 16:55:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615290 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=djo5uAAJ; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLr16Z8Lz9sBy for ; Sun, 10 Apr 2022 02:56:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EA95183DB7; Sat, 9 Apr 2022 18:55:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="djo5uAAJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 228AC83DA3; Sat, 9 Apr 2022 18:55:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9900C83A97 for ; Sat, 9 Apr 2022 18:55:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x635.google.com with SMTP id bh17so22946732ejb.8 for ; Sat, 09 Apr 2022 09:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ct5CXwtg7VpoGCafqP7uJh1v+ZfOF43c8bZObIGtNzM=; b=djo5uAAJUzga3/0+IweKnaQaKV5frb5a5XxEmcIZdHMSDvWD9I9ZY9Yy5p2gmB+x5I 3VuL7wcgC5TmpCdGPQjs758EM9aBJpRXh/ZGTsyKUQiLTeaa6w1/eRVh9lDpL4/5DLxH 3VIUrRrx2sHVkTr13nwBKbe+VBZQrtVhQfGJZcqVbi8TXUnZxw6241VhSjUry9Sr8adD c9LnuOuB2WUByBh9WEWoJWwfJyzsVIwBVSWV2eakPkpB2GaJBay6rtGOWn9H/54plTFS BLbqf/6badylAPtQG1Tj03vE7SRRbGWdbXmgkIBCcteGCXYa1ZPqk0tNwq2eltJVvqCE w80A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ct5CXwtg7VpoGCafqP7uJh1v+ZfOF43c8bZObIGtNzM=; b=lh07ZOMJrMIwOBtJt/qAz9T4tuS1fZ5CJ8kkTic/lMbNUaq5eIxdS61dIrIwFZtMDm 0DZ2SXVVB6L6/0rC1+1UKGkcFRsSrv7UktwaY1RF6OfJQ0QTmBFf+qPAU9qcifbq+pZO EuIhuQui0EmOi97QMR0CLzKHCH8UDIsnQVkhQ3wXpRIpDdL9IYuY+Jt6a8I76gad5jos wz0Hf6CekHQZM8VtF2ynqe8lWR5uJFHdRgXjDBW2VSBueWLIUDARsXS1Iu8lqcPsZays Ge7l6eqvPddV9tjlREgtqwyKow9wgTKle1nclmVXjrB4ryV9USY5COU5loJis/oJXWsO zCAA== X-Gm-Message-State: AOAM530Lep+n0r5itW9xHjkdDK8sGpqhv1rXCwg6rrXRYOKgJ9GFcIH0 WEYbCtXzSIH+4owCLSon+RU8z4orH+EeTA== X-Google-Smtp-Source: ABdhPJydeiXHVTMl2FXWYAY9SV9wH6PRUO4v55RYKDvON3C8qBMR5KfB7m/bwe1gxVM3hICyUhcEsQ== X-Received: by 2002:a17:907:9720:b0:6e8:3613:6224 with SMTP id jg32-20020a170907972000b006e836136224mr12824430ejc.421.1649523329213; Sat, 09 Apr 2022 09:55:29 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:28 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 05/13] rockchip: timer: add OF_PLATDATA support for dw-apb-timer Date: Sat, 9 Apr 2022 18:55:06 +0200 Message-Id: <20220409165514.19220-6-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The Rockchip rk3066 SoC has 3 dw-apb-timer nodes. U-boot is compiled with OF_PLATDATA TPL/SPL options, so add OF_PLATDATA support for the dw-apb-timer. Also change driver name to be able to compile with U-boot scripts. No reset OF_PLATDATA support was added, because the rk3066 nodes don't need/have them. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- Changed V3: use if (CONFIG_IS_ENABLED(OF_REAL)) remove white space fix Changed V2: use #if CONFIG_IS_ENABLED(OF_REAL) --- drivers/timer/dw-apb-timer.c | 50 ++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c index 9aed5dd217..f722697934 100644 --- a/drivers/timer/dw-apb-timer.c +++ b/drivers/timer/dw-apb-timer.c @@ -8,10 +8,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include @@ -25,6 +27,12 @@ struct dw_apb_timer_priv { struct reset_ctl_bulk resets; }; +struct dw_apb_timer_plat { +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_snps_dw_apb_timer dtplat; +#endif +}; + static u64 dw_apb_timer_get_count(struct udevice *dev) { struct dw_apb_timer_priv *priv = dev_get_priv(dev); @@ -43,20 +51,33 @@ static int dw_apb_timer_probe(struct udevice *dev) struct dw_apb_timer_priv *priv = dev_get_priv(dev); struct clk clk; int ret; +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dw_apb_timer_plat *plat = dev_get_plat(dev); + struct dtd_snps_dw_apb_timer *dtplat = &plat->dtplat; - ret = reset_get_bulk(dev, &priv->resets); - if (ret) - dev_warn(dev, "Can't get reset: %d\n", ret); - else - reset_deassert_bulk(&priv->resets); + priv->regs = dtplat->reg[0]; - ret = clk_get_by_index(dev, 0, &clk); - if (ret) + ret = clk_get_by_phandle(dev, &dtplat->clocks[0], &clk); + if (ret < 0) return ret; - uc_priv->clock_rate = clk_get_rate(&clk); + uc_priv->clock_rate = dtplat->clock_frequency; +#endif + if (CONFIG_IS_ENABLED(OF_REAL)) { + ret = reset_get_bulk(dev, &priv->resets); + if (ret) + dev_warn(dev, "Can't get reset: %d\n", ret); + else + reset_deassert_bulk(&priv->resets); + + ret = clk_get_by_index(dev, 0, &clk); + if (ret) + return ret; - clk_free(&clk); + uc_priv->clock_rate = clk_get_rate(&clk); + + clk_free(&clk); + } /* init timer */ writel(0xffffffff, priv->regs + DW_APB_LOAD_VAL); @@ -68,9 +89,11 @@ static int dw_apb_timer_probe(struct udevice *dev) static int dw_apb_timer_of_to_plat(struct udevice *dev) { - struct dw_apb_timer_priv *priv = dev_get_priv(dev); + if (CONFIG_IS_ENABLED(OF_REAL)) { + struct dw_apb_timer_priv *priv = dev_get_priv(dev); - priv->regs = dev_read_addr(dev); + priv->regs = dev_read_addr(dev); + } return 0; } @@ -91,8 +114,8 @@ static const struct udevice_id dw_apb_timer_ids[] = { {} }; -U_BOOT_DRIVER(dw_apb_timer) = { - .name = "dw_apb_timer", +U_BOOT_DRIVER(snps_dw_apb_timer) = { + .name = "snps_dw_apb_timer", .id = UCLASS_TIMER, .ops = &dw_apb_timer_ops, .probe = dw_apb_timer_probe, @@ -100,4 +123,5 @@ U_BOOT_DRIVER(dw_apb_timer) = { .of_to_plat = dw_apb_timer_of_to_plat, .remove = dw_apb_timer_remove, .priv_auto = sizeof(struct dw_apb_timer_priv), + .plat_auto = sizeof(struct dw_apb_timer_plat), }; From patchwork Sat Apr 9 16:55:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615289 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=bTIJI89R; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLqq1mb2z9sBy for ; Sun, 10 Apr 2022 02:56:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC25183DCA; Sat, 9 Apr 2022 18:55:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bTIJI89R"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EDABF83BF6; Sat, 9 Apr 2022 18:55:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 492AC8343B for ; Sat, 9 Apr 2022 18:55:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x62e.google.com with SMTP id l7so17550424ejn.2 for ; Sat, 09 Apr 2022 09:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XrfS5swXNb8CZE/ZpO5RU9pbel8vWDHWpvyPZ01T5IQ=; b=bTIJI89RSDogxpgoxxeAsL/dTox5eFk56xl6g/V+8t2yw4CM95r69/kgBA0aIXjtFZ YPRE7jwPH112loWpNBhawmB4GqrCzUj5iaJQSfdTCZL97VZvVZZW6gXnxzFDc7NKWkTj V2hoQFnSlD8w7J5yNRtRNP7dzCh4C9os4ZM0sIuFW0xPtnY71JqFKMwZbrKjxbm96wo5 fncTR54DIre3VaCSYZiEsY3SC21GKXGzLs8AZlaq2DRfKzlHH67xOVvf6/I+FNmZ0mEY oTbTKMhf/5hWwea8mSs+Tx3R6cCmVsxbNoOIOVDFbhkmq9nJ0mRGUi1W21b4NxEnjC0w sESQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XrfS5swXNb8CZE/ZpO5RU9pbel8vWDHWpvyPZ01T5IQ=; b=6DXPI8n3rbq2QfHFIOgDCi/oehxUhRb354zKVnl7wC02Om8tEtAgTBEjiDohROrNw3 8WmhrcRuA8NuTV+7elIa7s/rlzH+srlrsctRyjCZsup7Iqo7xqA/z5WH5JgVx7uwGs09 nugfkks+igFm782aCwyMGouEye/jHG4KLgHVltqApTkdsC7yPt1rHiYQK+UHNDdMAs/v fbCEyT6lWTC0/3NUFFnXWBdCdeGjnD4dH5gaFjQcyJyTn8xsoAHaTAU1QIK/pvEJlj7z TIn53Gl6I3zkcjr2G9gN4LdgMRDw1sZG4a1dzq4lMEH+RpnWc1WTKlJ5zcjd0284Lb80 LO8g== X-Gm-Message-State: AOAM532bEQW4oeZhyoM9hxLtXW+EGUY9aL8LIeHjTVxlgF62sr/sLG3k U7t9s4EAUxsTORtRYHzP0Z8= X-Google-Smtp-Source: ABdhPJzFQR36oL83LPqGxeudZQ5ytgB5EzHyhDAATDm50r/mYG4QNdqoicle8lNkzORUfv485ntwLg== X-Received: by 2002:a17:907:7f93:b0:6db:7634:f214 with SMTP id qk19-20020a1709077f9300b006db7634f214mr23186399ejc.3.1649523329916; Sat, 09 Apr 2022 09:55:29 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:29 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 06/13] rockchip: timer: dw-apb-timer: fix whitespace in U_BOOT_DRIVER structure Date: Sat, 9 Apr 2022 18:55:07 +0200 Message-Id: <20220409165514.19220-7-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The line with .of_to_plat in the U_BOOT_DRIVER structure of dw-apb-timer.c is not aligned with the rest. Add an extra TAB to fix the whitespace. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- drivers/timer/dw-apb-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c index f722697934..10f0a9f646 100644 --- a/drivers/timer/dw-apb-timer.c +++ b/drivers/timer/dw-apb-timer.c @@ -120,7 +120,7 @@ U_BOOT_DRIVER(snps_dw_apb_timer) = { .ops = &dw_apb_timer_ops, .probe = dw_apb_timer_probe, .of_match = dw_apb_timer_ids, - .of_to_plat = dw_apb_timer_of_to_plat, + .of_to_plat = dw_apb_timer_of_to_plat, .remove = dw_apb_timer_remove, .priv_auto = sizeof(struct dw_apb_timer_priv), .plat_auto = sizeof(struct dw_apb_timer_plat), From patchwork Sat Apr 9 16:55:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615293 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ApUu7MMq; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLrd088Vz9sBy for ; Sun, 10 Apr 2022 02:57:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 65DD883DF3; Sat, 9 Apr 2022 18:56:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ApUu7MMq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BBA2F83D55; Sat, 9 Apr 2022 18:55:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1733683C58 for ; Sat, 9 Apr 2022 18:55:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x62c.google.com with SMTP id r13so22995019ejd.5 for ; Sat, 09 Apr 2022 09:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SRPjE1DsJGd3eyDfsESwwLn0hi5fyMg7vL9iu0icCgg=; b=ApUu7MMqz5keNv9kjZrZ9krCb/3ZTDrlPItxtrxslVfV++eYiI3GaiVZJm3k6elyXN tJKy7SJUrIEJDgdYm9DhLH5bNGYOZwONpZ/L3h2DFQrOIW6IHDz3R4S/ve0R2+j3cSWb JX3/nn1f66TCQVssm3LrjKiayQjbCxVMGr0lzAKgMW5c8PiYOCdK7g+5KblMWcOevOiU FqMdZEw6BSPjT1+ZNBVptxejvh5CVwx7hV3OyWplEetiSeKKR7PIrgbtak/9BjmFWOQL 4q61DX6/Ofsj25IURwGwoaBV/6vHxShCLgWZ7Mrahk8S4plJT2LBd669vQYG3m1HS4HJ pfKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SRPjE1DsJGd3eyDfsESwwLn0hi5fyMg7vL9iu0icCgg=; b=kE3HXYbxT/BxAihGOBl2H388PGklVnihhy9bOgPJNoo8arkIV82Db5zvpB3U1WvemR xDq/+GrfrSKKoCAa9i9FLcZUHrkLzaSdQ8hvx88OS+Io6M9yPfgGcKzXoSGosrUxQke0 1xnL3lmoPpbFulQEor79gUtBZZb48Z4vEvIkfMdutJp4JlSZdl3mpTeSoDPmQBvhfp+u w9TiW/uDkSxiXBzrkv+ZEQJ/N/paOZD8LTN8eo9ZeCVUAd2Y7E9n49+pYKeUO6nYtt/7 YRrvOejVrl3y8xDaiDeVjh0X/cXSZWVgEMffbm/xfbethOQ2s1VRB6lnRrcc8BF+p8sX nHww== X-Gm-Message-State: AOAM53027dSXHg4YVz8rOeoPdXNggvPtiJKE+KBy8DFxVIPBU3WPAIPf Yi/QiZRhL5RHd0buicB0j2Q= X-Google-Smtp-Source: ABdhPJyPAG8Pj2rbiv8ZUrjm6S4qvQIdhNTdhqInk8kVMDK1/vQzBgQCFzuIAq/vE3uF0pl0stb1tQ== X-Received: by 2002:a17:907:628e:b0:6d9:c6fa:6168 with SMTP id nd14-20020a170907628e00b006d9c6fa6168mr23322964ejc.132.1649523330558; Sat, 09 Apr 2022 09:55:30 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:30 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 07/13] rockchip: mmc: rockchip_dw_mmc: fix ciu clock index Date: Sat, 9 Apr 2022 18:55:08 +0200 Message-Id: <20220409165514.19220-8-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The document rockchip-dw-mshc.yaml decribes a maximum of 4 clocks. In the rockchip_dw_mmc driver the clock name in use was "fixed" to "ciu" with index 1, but later reverted back to index 0. The clock drivers can handle both, but the calling driver should submit correct data as a standard practice. Fix the "ciu" clock index by setting it back to 1. clock-names: minItems: 2 items: - const: biu - const: ciu - const: ciu-drive - const: ciu-sample Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- drivers/mmc/rockchip_dw_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 7f8dea1e34..be065ec0c3 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -123,11 +123,11 @@ static int rockchip_dwmmc_probe(struct udevice *dev) priv->minmax[0] = 400000; /* 400 kHz */ priv->minmax[1] = dtplat->max_frequency; - ret = clk_get_by_phandle(dev, dtplat->clocks, &priv->clk); + ret = clk_get_by_phandle(dev, &dtplat->clocks[1], &priv->clk); if (ret < 0) return ret; #else - ret = clk_get_by_index(dev, 0, &priv->clk); + ret = clk_get_by_index(dev, 1, &priv->clk); if (ret < 0) return ret; #endif From patchwork Sat Apr 9 16:55:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615292 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Nnnhp2PH; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLrQ5Zwkz9sBy for ; Sun, 10 Apr 2022 02:57:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6173483DD8; Sat, 9 Apr 2022 18:56:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Nnnhp2PH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1BF0D83AF9; Sat, 9 Apr 2022 18:55:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9B722837DE for ; Sat, 9 Apr 2022 18:55:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x631.google.com with SMTP id l7so17550521ejn.2 for ; Sat, 09 Apr 2022 09:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7fzFSTWTOlhFwyrmFlNh6JBSFxv9xbF0ktybgp4CxYM=; b=Nnnhp2PHgvHMCKIb1DC+6ibKFUTme/2C7Nogb/lRdtQa1SuwU4KHDWgExBgxdHFgEw nZgc/xLhBoxXNt8KezIteZJ5eta/ellJ2UU4pCYGmZGNTXTmI8d43pIWVH26obb1IOmB GmXG56F3IgY7bE/RlQYsvvia29WGEDQ5wb5gUvDzbmlhnfN5Y3Gmz15jrSfGcfVkqltq j+uXb3QlEpmo0lR4VifuexL6usUf73uREI0ZuzhHj7JMcprpUYWvnAkVWduAHvUvtvx/ q0cDvNtRRE+9whyY+QqeGTNa+RGnAi4Q5cPDb+TzBeO6D7M5rCLUyws2SCoJQQ0e2sQ+ 1jwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7fzFSTWTOlhFwyrmFlNh6JBSFxv9xbF0ktybgp4CxYM=; b=t0Q8r4dQni2m83xZAAS5ETC8lQKWb0kSxist4rbQWiT2Bk/AFaxhgv+xA7A0QOIJpm xKLCCFz971VPUMB9wA6CsFFuMi9zSCqkhgrZTCdn3YRaBYpz8A524YAMceCme56X55gv lkxFF1XzYsgk+QSConcUvX+rfwTiFi67jjtTTgHHqE36E3XUroVu20Y4LU76BdJDbOP6 4JEA8x9dWmdntqjkdDdF4Htz02LdpDxJ7A6waYUcNCNsqS9qXgtqtkBsy2evL+3g/iJJ tQP3voOaXMuS9cGCM3Ba+dv5Wwm0RGTIkpxsj1Yqdlobz+nCyZHldStSlGRqf/L/Kj3j MijQ== X-Gm-Message-State: AOAM530bPqDRczp874rOMDOPRyL2ZV01SJqK8g/DUYzHQH1b9W1XNl4j 2pAcFbQdJj7VrnDzNhKXxpI= X-Google-Smtp-Source: ABdhPJzxYSY0zxu0XF5JQbjoEVhuozNkINze/r04SrO/tLLb4YwhvefTY3CE9R+uxXnFP52tvZOJpA== X-Received: by 2002:a17:906:3547:b0:6e8:6cc7:3df5 with SMTP id s7-20020a170906354700b006e86cc73df5mr3839476eja.719.1649523331252; Sat, 09 Apr 2022 09:55:31 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:30 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 08/13] rockchip: mmc: rockchip_dw_mmc: add rk3066/rk3188 support Date: Sat, 9 Apr 2022 18:55:09 +0200 Message-Id: <20220409165514.19220-9-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The Rockchip SoCs rk3066/rk3188 have MMC DT nodes with as compatible string "rockchip,rk2928-dw-mshc". Add OF_PLATDATA support to the existing driver with help of a DM_DRIVER_ALIAS. This type needs a permanent enabled fifo. The other Rockchip SoCs always have the property "u-boot,spl-fifo-mode" in the MMC DT nodes, because MMC to SRAM can't do DMA. Make this property a requirement for MMC OF_PLATDATA structures. The property "fifo-mode" must be added for all other compile modes. Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- Changed V5: reword remove driver_data add OF_PLATDATA u_boot_spl_fifo_mode requirement Changed V4: use boolean --- drivers/mmc/rockchip_dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index be065ec0c3..573bf16c87 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -119,7 +119,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev) host->priv = dev; host->dev_index = 0; priv->fifo_depth = dtplat->fifo_depth; - priv->fifo_mode = 0; + priv->fifo_mode = dtplat->u_boot_spl_fifo_mode; priv->minmax[0] = 400000; /* 400 kHz */ priv->minmax[1] = dtplat->max_frequency; @@ -180,5 +180,6 @@ U_BOOT_DRIVER(rockchip_rk3288_dw_mshc) = { .plat_auto = sizeof(struct rockchip_mmc_plat), }; +DM_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk2928_dw_mshc) DM_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3328_dw_mshc) DM_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3368_dw_mshc) From patchwork Sat Apr 9 16:55:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615291 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=knGlgMbr; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLrD2N2Pz9sBy for ; Sun, 10 Apr 2022 02:57:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 329F783DE1; Sat, 9 Apr 2022 18:56:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="knGlgMbr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9EF4C83A97; Sat, 9 Apr 2022 18:55:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 464F882DD7 for ; Sat, 9 Apr 2022 18:55:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x62f.google.com with SMTP id r13so22995106ejd.5 for ; Sat, 09 Apr 2022 09:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WsHH7zf96hBgor/eF+bI2hzxduRS1mijNS54GFJ6Uao=; b=knGlgMbrezTeBaaW/6kbB9KAWLVemby4/P20qU+seGYJzZEtU7D8OmcRzU+byoj9kD tZFsNK21cqrpL7W3XdN2KBbV2+KSqeRuwolC75HhBAcyBGABQgTPCsxYAClT5wqoI2g/ t5rKt0WjbrrLkSQ+mStKNbmFtJsdZh0mB5ojeLcQr6PkyqugN0Sue3ypEEpBIPK3UyuU G68ODW8hnlDeFuAZqQHKcewOvWh1sLY/PIXKuz+8rM0reCiQuSDQmgMxfY73LDMXwwLI AJIyAyeQA/oG2dlNvKo/V1cpvuI1dDYd9SIE2zNo5lVK/UZjvogHSGmQSqDCwYdqVTpP PhHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WsHH7zf96hBgor/eF+bI2hzxduRS1mijNS54GFJ6Uao=; b=RV9RlkFA4Itj4Jl+1QyJHFOVfejLEhcbv6uqztPLWv3lWq7k9He/4+tZjQVNikj4TS db9oy+hu4SYMwAmT+LSOKH8zg2lZNgho+zvLyGio4UU4lU9P6GhcYuGhzUaa0gJ3IiUv bzmIOrgOGawWJSGx8L7vxXubvfGWb2OXBURpuSHj2obttYzcy/T5wie0136VI5PIK/St /BXAHTK7QDynkU8GEwTPGbs0sdEXJBWl9QHNbL9/iblvGhUtMna3l+Uh0mtFet+tNi0p m/Rtx3zUVeBxBpzEyDAx5ZgoLuccbFCLsU1Zc3wqy6F5seARxFZSN6WF0699RgsbL4Au I0iw== X-Gm-Message-State: AOAM533u053zE9lBYcKzZANbV4TcoYD96t1fwwpvkNklJsmYi6yTc9Ru w2GTdHMjQ1TOQ+Sm5pdmCho= X-Google-Smtp-Source: ABdhPJxjJHe/z/yXsiP88NPVzfvITuNH27UQX24O/aMy068ok47eBPTBdgmXGiccnQtI/9ZPbTk32g== X-Received: by 2002:a17:907:2cc5:b0:6e8:344b:98d1 with SMTP id hg5-20020a1709072cc500b006e8344b98d1mr13581620ejc.174.1649523331918; Sat, 09 Apr 2022 09:55:31 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:31 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 09/13] rockchip: serial: restyle the serial_rockchip.c driver Date: Sat, 9 Apr 2022 18:55:10 +0200 Message-Id: <20220409165514.19220-10-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The ns16550.c driver has the following conditions for .of_match: CONFIG_IS_ENABLED(OF_REAL) For Rockchip SoCs with TPL/SPL and platform data that need serial support the serial_rockchip.c driver was made. It copies this data and then calls ns16550_serial_probe(). With the addition of yet an other SoC type this driver is in need for a little restyle. Simplify struct rockchip_uart_plat and add extra SoCs with DM_DRIVER_ALIAS(). Return -ENODEV when the ns16550.c driver probe function is available. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- Changed V4: add empty line --- drivers/serial/serial_rockchip.c | 37 +++++++++++++------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/serial/serial_rockchip.c b/drivers/serial/serial_rockchip.c index 97d40869a2..f5ac705f4d 100644 --- a/drivers/serial/serial_rockchip.c +++ b/drivers/serial/serial_rockchip.c @@ -12,22 +12,20 @@ #include #include -#if defined(CONFIG_ROCKCHIP_RK3188) -struct rockchip_uart_plat { - struct dtd_rockchip_rk3188_uart dtplat; - struct ns16550_plat plat; -}; -struct dtd_rockchip_rk3188_uart *dtplat, s_dtplat; -#elif defined(CONFIG_ROCKCHIP_RK3288) struct rockchip_uart_plat { +#if CONFIG_IS_ENABLED(OF_PLATDATA) struct dtd_rockchip_rk3288_uart dtplat; +#endif struct ns16550_plat plat; }; + +#if CONFIG_IS_ENABLED(OF_PLATDATA) struct dtd_rockchip_rk3288_uart *dtplat, s_dtplat; #endif static int rockchip_serial_probe(struct udevice *dev) { +#if CONFIG_IS_ENABLED(OF_PLATDATA) struct rockchip_uart_plat *plat = dev_get_plat(dev); /* Create some new platform data for the standard driver */ @@ -38,24 +36,19 @@ static int rockchip_serial_probe(struct udevice *dev) dev_set_plat(dev, &plat->plat); return ns16550_serial_probe(dev); +#else + return -ENODEV; +#endif } -U_BOOT_DRIVER(rockchip_rk3188_uart) = { - .name = "rockchip_rk3188_uart", - .id = UCLASS_SERIAL, - .priv_auto = sizeof(struct ns16550), - .plat_auto = sizeof(struct rockchip_uart_plat), - .probe = rockchip_serial_probe, - .ops = &ns16550_serial_ops, - .flags = DM_FLAG_PRE_RELOC, -}; - U_BOOT_DRIVER(rockchip_rk3288_uart) = { - .name = "rockchip_rk3288_uart", - .id = UCLASS_SERIAL, + .name = "rockchip_rk3288_uart", + .id = UCLASS_SERIAL, .priv_auto = sizeof(struct ns16550), .plat_auto = sizeof(struct rockchip_uart_plat), - .probe = rockchip_serial_probe, - .ops = &ns16550_serial_ops, - .flags = DM_FLAG_PRE_RELOC, + .probe = rockchip_serial_probe, + .ops = &ns16550_serial_ops, + .flags = DM_FLAG_PRE_RELOC, }; +DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3066_uart) +DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3188_uart) From patchwork Sat Apr 9 16:55:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615297 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pCSm/WhE; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLsS3HqZz9sBy for ; Sun, 10 Apr 2022 02:58:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E64F83E18; Sat, 9 Apr 2022 18:56:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pCSm/WhE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2C5083D90; Sat, 9 Apr 2022 18:55:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 036C283987 for ; Sat, 9 Apr 2022 18:55:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x62e.google.com with SMTP id bq8so22934801ejb.10 for ; Sat, 09 Apr 2022 09:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DzZNUSzZ2e+Y73DxFIQgwNuOf2/5DNwe5yoYMFE1SiQ=; b=pCSm/WhEh/ZdU3SMfICmtsuJ3Gl5d7SmaTjOMKVX+dpT3ZSi5Pjrzd8NS/C5z5aev5 YpgkuSiVfnR7rXQJeRMSEN+HthHrlbIHimoR8tqGib+WkvXsr4Nupq35MZCnNnY4FQoU s8wSHQ4/qAILfDP3RSR9utM9wLw7TGSztn1RvBcNEMVvBLjon/+PGxcG+0oxzc2aBcgP zJsBGbeci55CiE0yNBWydeVV2LQz5CTMXSEC3uN/q3acIc+DA+7uTQMU3OGjg1O0OCaO pbQpMZtogiJDO8WkZWcMMs3zJhIIsTw+cKwXHxew5+IDmwl5sN/E5SxJmgw4DJkNQ/Vw 4dxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DzZNUSzZ2e+Y73DxFIQgwNuOf2/5DNwe5yoYMFE1SiQ=; b=RiJb63I0481fSIDIrp6KwQ4QAMel7wCCj+EflbnbyHCIbhmqyAtmgfnLdc+3jr1Z+y UboDgNSiW+kw7m4YVqRvE/5Vv+/75CZXbJPUBaN3DIIV0pI5yKRlnY7xzgKmCflg+Ug1 C5Uf3ktc4qU1sMSKZ+N6DTiaOkFqezP+2hp0rRrcnuxTKN+82gHkldbE6mLGLxK1oIjJ sq+CH2Z1T8I+9XxSgzBMTgHvE3lhxS/bR6B7yFa0pQDWfSXJbFt4NNNHK1s8KcEImeyK fnRY/WU8Vqv0CN43xrC6MpFY1VbU4ftb3hnyDUX5lyV5Z9pUY/Zy2JoxbYSyO0H4utV7 C4pg== X-Gm-Message-State: AOAM532i6PQ8qS22cbZdrcXNDKPSQcjjeMhCmbUGKcv1zjq4XahMtSOj i0GVM0CzfBh78qhIG0EGNdHhGYO0WD9JEQ== X-Google-Smtp-Source: ABdhPJzce0zJ1enQnoa2qPb5SSA7jeRgPZi/yI+kMLQPPqJpPl3h5/BvrxsTntVx5vr12qAdFDkQwQ== X-Received: by 2002:a17:906:6a21:b0:6e8:6cad:23f9 with SMTP id qw33-20020a1709066a2100b006e86cad23f9mr3852859ejc.75.1649523332567; Sat, 09 Apr 2022 09:55:32 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:32 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 10/13] rockchip: serial: move driver alias to serial_rockchip.c Date: Sat, 9 Apr 2022 18:55:11 +0200 Message-Id: <20220409165514.19220-11-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The Rockchip uart DT nodes have "snps,dw-apb-uart" as fall back string. The driver ns16550.c has CONFIG_IS_ENABLED(OF_REAL) as condition to of_match and does not copy dtplat data. For TPL/SPL the driver serial_rockchip.c is used. Move driver alias to correct driver. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- drivers/serial/ns16550.c | 2 -- drivers/serial/serial_rockchip.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 796ff1658c..a4220fd0ae 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -624,8 +624,6 @@ U_BOOT_DRIVER(ns16550_serial) = { #endif }; -DM_DRIVER_ALIAS(ns16550_serial, rockchip_rk3328_uart) -DM_DRIVER_ALIAS(ns16550_serial, rockchip_rk3368_uart) DM_DRIVER_ALIAS(ns16550_serial, ti_da830_uart) #endif #endif /* SERIAL_PRESENT */ diff --git a/drivers/serial/serial_rockchip.c b/drivers/serial/serial_rockchip.c index f5ac705f4d..10e731caa1 100644 --- a/drivers/serial/serial_rockchip.c +++ b/drivers/serial/serial_rockchip.c @@ -52,3 +52,5 @@ U_BOOT_DRIVER(rockchip_rk3288_uart) = { }; DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3066_uart) DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3188_uart) +DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3328_uart) +DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3368_uart) From patchwork Sat Apr 9 16:55:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615296 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lNE+BYJT; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLsF74YMz9sBy for ; Sun, 10 Apr 2022 02:57:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 49C2083E0E; Sat, 9 Apr 2022 18:56:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lNE+BYJT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C495D83BF6; Sat, 9 Apr 2022 18:55:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1FC5C83C07 for ; Sat, 9 Apr 2022 18:55:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ed1-x534.google.com with SMTP id d10so13445612edj.0 for ; Sat, 09 Apr 2022 09:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yCfr5Dr+lZaPZO7vaBViPBnc9Gfa73591AX2fcleGKA=; b=lNE+BYJTbheigGINp7lxLUbAHK2NJy1gO0kVvLQlBr42ASSvpAgmypmtOhpvAHBXUc kTlRC/ZCdkgbwfNmemFp8QcAszdQfabiaU6Rv0bDk5J3xSLTP3KCQc+TeFCtFD0eCgPo /l7zS3twxyCLfbG262AljTi6lo0Yw7G8LkoLxBn+IJzookbi1wlpqW9PYED6lwCKKYDe l2YUG8rI8Vo0x24S9a7aSdBuM0KvXY27hASfkZPBVShk8isKX9tE2v7VjdPBfdn1gPFF 6REhrAADdc5MjWtG/Q/9cEVRbq8l+wEu+nVbJhlhYxrOvTWUYQMu8gNj2kK6vLNApHdc HG/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yCfr5Dr+lZaPZO7vaBViPBnc9Gfa73591AX2fcleGKA=; b=UWLCHdIDonPXmREJmMN+mZzEBmbGvOXIvgu9xNYvb6Tu/wSQ2dcDzZSdTB1C9pDxO7 sUHyq1gir6lXUDTXZA8wXxS4gR6DyT0UClEz8YCgR7JYbqtObdQ/jPMr9E4mSQ8SPqVP MOcoH/AxEEk1+qCuW5dMNB7ZGW1sBtmCAzdCAv4bMdMWlYE1bjzBXDgwixHTe7P60LvT AgflAldJ64DOHd0I6oId2Lv1/lfriZK3paG57sH3Ri3POFS9fxkS817/TIK9ZizcpaBL 2n7jim9vtzBK/5BlL0fCzMFNoYIDZWlynbwn24yW8MPaPYJ4HjMZB9TsYyWtKc6ZLJkl 3BgA== X-Gm-Message-State: AOAM5311+skrPnwM5QEiq+4d8V/BNEYJPPZioA71Z0TufAySyK3OGJnE Le2PF6FkrJonsXxrofQCycs= X-Google-Smtp-Source: ABdhPJx0LNWw7y3l4hvrX4f6jT3exL+vd+kozsQOPmTebUpnutQrzlHVWKU1nlsK3NSuJ/iGrK8kxg== X-Received: by 2002:aa7:cac5:0:b0:41c:c1fb:f5cc with SMTP id l5-20020aa7cac5000000b0041cc1fbf5ccmr24537403edt.219.1649523333262; Sat, 09 Apr 2022 09:55:33 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:32 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 11/13] rockchip: serial: rename U_BOOT_DRIVER name to rockchip_uart Date: Sat, 9 Apr 2022 18:55:12 +0200 Message-Id: <20220409165514.19220-12-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean When a defconfig for rk3288 is compiled it gives the warning: rockchip_rk3288_uart: Missing .compatible in ./drivers/serial/serial_rockchip.c : WARNING: the driver rockchip_rk3288_uart was not found in the driver list Fix by renaming U_BOOT_DRIVER name of serial_rockchip.c to rockchip_uart. Add rk3288 serial support with a DM_DRIVER_ALIAS define. Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- drivers/serial/serial_rockchip.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/serial/serial_rockchip.c b/drivers/serial/serial_rockchip.c index 10e731caa1..f4e9422ed9 100644 --- a/drivers/serial/serial_rockchip.c +++ b/drivers/serial/serial_rockchip.c @@ -14,13 +14,13 @@ struct rockchip_uart_plat { #if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_rockchip_rk3288_uart dtplat; + struct dtd_rockchip_uart dtplat; #endif struct ns16550_plat plat; }; #if CONFIG_IS_ENABLED(OF_PLATDATA) -struct dtd_rockchip_rk3288_uart *dtplat, s_dtplat; +struct dtd_rockchip_uart *dtplat, s_dtplat; #endif static int rockchip_serial_probe(struct udevice *dev) @@ -41,8 +41,8 @@ static int rockchip_serial_probe(struct udevice *dev) #endif } -U_BOOT_DRIVER(rockchip_rk3288_uart) = { - .name = "rockchip_rk3288_uart", +U_BOOT_DRIVER(rockchip_uart) = { + .name = "rockchip_uart", .id = UCLASS_SERIAL, .priv_auto = sizeof(struct ns16550), .plat_auto = sizeof(struct rockchip_uart_plat), @@ -50,7 +50,8 @@ U_BOOT_DRIVER(rockchip_rk3288_uart) = { .ops = &ns16550_serial_ops, .flags = DM_FLAG_PRE_RELOC, }; -DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3066_uart) -DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3188_uart) -DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3328_uart) -DM_DRIVER_ALIAS(rockchip_rk3288_uart, rockchip_rk3368_uart) +DM_DRIVER_ALIAS(rockchip_uart, rockchip_rk3066_uart) +DM_DRIVER_ALIAS(rockchip_uart, rockchip_rk3188_uart) +DM_DRIVER_ALIAS(rockchip_uart, rockchip_rk3288_uart) +DM_DRIVER_ALIAS(rockchip_uart, rockchip_rk3328_uart) +DM_DRIVER_ALIAS(rockchip_uart, rockchip_rk3368_uart) From patchwork Sat Apr 9 16:55:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615294 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=IFHevL/Y; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLrq1Hq9z9sBy for ; Sun, 10 Apr 2022 02:57:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 81C7E83987; Sat, 9 Apr 2022 18:56:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IFHevL/Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B7B9783C58; Sat, 9 Apr 2022 18:55:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D323583CF3 for ; Sat, 9 Apr 2022 18:55:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x633.google.com with SMTP id i27so22961503ejd.9 for ; Sat, 09 Apr 2022 09:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+AP9bEY1tXpIMMo5dXu05g7DrM8ALNzAk8pTmthbNJw=; b=IFHevL/YJ+wvCoSF1htBLKj+4CMFrZWwqSypV4eNiZZV+fSLkAfyibL+j790tAUoG1 +eMO1AMMaTSQknGez/rY8zEpsMJtgRdbZVFd2b9o5/DtNjUYHmQHRreqVeOjdFl71VRC 226oYCjtAfgIYRafz/FeNGmiVGo7YN3FNo08qfj9U69/TH9py4XREOWMl2xfaWY/Lx6K rAWpy8g8Pd504T7qMAQ7/VABiWgahe2RzrmLzu6MY8Ktb61VQthmuacvpVUAKDwK4Gc7 w8am8L6zzB7rbnanzWoup1Wp7QwGpR1HeJ7oOmGHwuIzhQ35Ep1tEFYBqoUVHbnVP1Yk YYCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+AP9bEY1tXpIMMo5dXu05g7DrM8ALNzAk8pTmthbNJw=; b=zN84SFJBn4B4RNYIR7Dzxx4sXDAVPL6+B9u5nV+Od3wHna6mizAigaRllyamfYWeNU XNVlg/jwqzqn+oMrh3opxjpu3kyNBBlgLS3V8GDi+69wwJmlAtzMiBOcYH7jkctdS8aI l00zDFxwK4KZAVVr659OlNccrucLB/pAsna0A4tVQtXWOMNdEGvM7sCsNmvWP+rFgsO4 dpQkaE6agkdhRezegwrgL+56nDhTO/KGgTiWbSs2NXdPjCFDllqQsT4XG1uEfgqrCoYH eNvnOFmL4yK21TweqcSa8nf1j7kNW+Ja0kORa0C6CWWYAidKQ3u3eulGs4tfYnjvoBul vUgw== X-Gm-Message-State: AOAM531by0XnAcqiFPvCR8fyBXERrpdim53unOlUjVKv4w3SpQI/wFq6 ILkpSLEVkivOSw9D3wdSKgs= X-Google-Smtp-Source: ABdhPJxCKyNwPIut/sTU1IycVAdpQ40gZ/whnLacSCU9J4OVODQdNUR31Yl5otqfPVxyt6VWWIl0VQ== X-Received: by 2002:a17:906:d108:b0:6e8:7765:a70b with SMTP id b8-20020a170906d10800b006e87765a70bmr1891126ejz.436.1649523333898; Sat, 09 Apr 2022 09:55:33 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:33 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 12/13] rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL Date: Sat, 9 Apr 2022 18:55:13 +0200 Message-Id: <20220409165514.19220-13-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The Rockchip serial driver depends on an enabled NS16550 driver, so add select SYS_NS16550 to config ROCKCHIP_SERIAL. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- drivers/serial/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 76171e7146..06a69e78de 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -763,6 +763,7 @@ config PL01X_SERIAL config ROCKCHIP_SERIAL bool "Rockchip on-chip UART support" depends on DM_SERIAL && SPL_OF_PLATDATA + select SYS_NS16550 help Select this to enable a debug UART for Rockchip devices when using CONFIG_SPL_OF_PLATDATA (i.e. a compiled-in device tree replacemenmt). From patchwork Sat Apr 9 16:55:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1615295 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=hHBCoQ9Z; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KbLs21rRzz9sBy for ; Sun, 10 Apr 2022 02:57:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8BD0783DF7; Sat, 9 Apr 2022 18:56:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hHBCoQ9Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB7178343B; Sat, 9 Apr 2022 18:55:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C103183BF6 for ; Sat, 9 Apr 2022 18:55:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ed1-x52b.google.com with SMTP id z99so4776124ede.5 for ; Sat, 09 Apr 2022 09:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xLffyhAYd/E168pMO3NkA4W4bilNANSKi/zXAD8KlDU=; b=hHBCoQ9ZLcGo2xFKWaS6E+r4oK4sQQQuP6sX/Whk6F6yrDJvJPVODti+SrySjmwvqB Vvx8w06Q5oHTfJA+ngI8M0ybJ55FzchaqOE7mtduDeb5xNV2KXielvqet/+Z8eUqadQI Ck765Qevdcp6bfBJJGBRQk/ZeRg3eSUQP4o4ScUsYv8SnsCzSKBhWZYLBYPP5IZQveRz MAM8i2FwdeCfCm8kBZMLslTdhnRsXNbafdu5WKVL1AxxqOuwskAx7DrvBeoR1pk2CgZJ jEYA5tINhpciMoxlnvQ1ikOdGPzk95irzwOl/1HR12W4a77pFGjaPbZ2Lo8FR35KjtTl MaWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xLffyhAYd/E168pMO3NkA4W4bilNANSKi/zXAD8KlDU=; b=LyKLj68jaDK4wQnmf4yIP9AzPR6cHZY0WhNm1skDbFNahYihNYWcDnhl3AAX4xHX4f IdcHA9UKFMy6BBSbxNtSWjLNO6zP/5LKhl5V2tnDSbsj1/MQ6CtjkIXH9Py5zf9sON0w DqKdugM0piOPDxPhmu3+TJASTnWkrbezxgArOOYRX+fsGdmGSiU94EWvdNDs0XF2ucMw X1wSi1hFJqMlC5HEkce5OqzC9cLH6pYcozDFu3qOUde4Aw74+69qyPrJZY3nZV+FuX7J R6ZGqP87O7O/oNu64UUT7cmWvbFgf/1PQ2obZpCL/7guabpkVrgKPlq0t5PYZzKtkb57 woEg== X-Gm-Message-State: AOAM530i1SKIe/2aadD8qXGiYxq2K2JJ3Kk4oI0Dd8HMdlPQsZQojAPT 0sORXPkROYs3GIEg+Q5V8s0= X-Google-Smtp-Source: ABdhPJwGcRE1WrNVqPnqcOq+sR6HH71djkrJ1LZo390dfXqHW7dD0zkSOzUZZN2ty5fGXyrZnhmNNg== X-Received: by 2002:a50:baa1:0:b0:418:849a:c66a with SMTP id x30-20020a50baa1000000b00418849ac66amr25394348ede.234.1649523334526; Sat, 09 Apr 2022 09:55:34 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:34 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 13/13] rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL Date: Sat, 9 Apr 2022 18:55:14 +0200 Message-Id: <20220409165514.19220-14-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The serial_rockchip.c driver converts platdata to the data structure used in the ns16550.c file and then calls the function ns16550_serial_probe(). When compiled with OF_REAL the serial_rockchip.c driver returns now -ENODEV when probed and does no harm. The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA. Allow serial port use for both SPL and TPL by removing this dependency and SPL_BUILD restriction. Signed-off-by: Johan Jonker Reviewed-by: Kever Yang --- drivers/serial/Kconfig | 4 ++-- drivers/serial/Makefile | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 06a69e78de..9bf83b29ca 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -762,11 +762,11 @@ config PL01X_SERIAL config ROCKCHIP_SERIAL bool "Rockchip on-chip UART support" - depends on DM_SERIAL && SPL_OF_PLATDATA + depends on DM_SERIAL select SYS_NS16550 help Select this to enable a debug UART for Rockchip devices when using - CONFIG_SPL_OF_PLATDATA (i.e. a compiled-in device tree replacemenmt). + OF_PLATDATA (i.e. a compiled-in device tree replacemenmt). This uses the ns16550 driver, converting the platdata from of-platdata to the ns16550 format. diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index b68b5e7b2b..d8e26d72ea 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -46,9 +46,7 @@ obj-$(CONFIG_MXC_UART) += serial_mxc.o obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o obj-$(CONFIG_MESON_SERIAL) += serial_meson.o obj-$(CONFIG_INTEL_MID_SERIAL) += serial_intel_mid.o -ifdef CONFIG_SPL_BUILD obj-$(CONFIG_ROCKCHIP_SERIAL) += serial_rockchip.o -endif obj-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o obj-$(CONFIG_SANDBOX_SERIAL) += sandbox.o obj-$(CONFIG_SCIF_CONSOLE) += serial_sh.o