All of lore.kernel.org
 help / color / mirror / Atom feed
From: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
To: Simon Glass <sjg@chromium.org>, Quentin Schulz <u-boot@0leil.net>,
	 u-boot@lists.u-boot-project.org
Cc: Tom Rini <trini@konsulko.com>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	 Kever Yang <kever.yang@rock-chips.com>,
	Lukasz Majewski <lukma@denx.de>,
	 Anatolij Gustschin <ag.dev.uboot@gmail.com>,
	 Heiko Schocher <hs@nabladev.com>,
	Marek Vasut <marek.vasut+usb@mailbox.org>,
	 Svyatoslav Ryhel <clamor95@gmail.com>,
	 Peter Robinson <pbrobinson@gmail.com>,
	Levin Du <djw@t-chip.com.cn>,
	 Suniel Mahesh <sunil@amarulasolutions.com>,
	 Alexey Charkov <alchark@flipper.net>,
	Fabio Estevam <festevam@nabladev.com>,
	 Jonas Karlman <jonas@kwiboo.se>,
	Chris Morgan <macromorgan@hotmail.com>,
	 Coia Prant <coiaprant@gmail.com>,
	 Frank Wunderlich <frank-w@public-files.de>,
	Andy Yan <andyshrk@163.com>,  Liangbin Lian <jjm2473@gmail.com>,
	Joseph Chen <chenjh@rock-chips.com>,
	 Tianling Shen <cnsztl@gmail.com>,
	Klaus Goger <klaus.goger@cherry.de>,
	 Heiko Stuebner <heiko.stuebner@cherry.de>,
	 Jacobe Zang <jacobe.zang@wesion.com>,
	Jiehui He <jiehui.he@foxmail.com>,
	 John Clark <inindev@gmail.com>,
	Sebastian Kropatsch <seb-dev@mail.de>,
	 Jagan Teki <jagan@edgeble.ai>, Ilya Katsnelson <me@0upti.me>,
	 Niu Zhihong <zhihong@nzhnb.com>,
	 Nicolas Frattaroli <frattaroli.nicolas@gmail.com>,
	 Tom Fitzhenry <tom@tom-fitzhenry.me.uk>,
	 Akash Gajjar <gajjar04akash@gmail.com>,
	 Maxim Moskalets <maximmosk4@gmail.com>,
	FUKAUMI Naoki <naoki@radxa.com>,
	 Eugen Hristev <ehristev@kernel.org>,
	 Jianfeng Liu <liujianfeng1994@gmail.com>,
	 Elon Zhang <zhangzj@rock-chips.com>,
	Joshua Riek <jjriek@verizon.net>,
	 Martin Herren <sputnik@on-the-web.ch>,
	Torsten Duwe <duwe@lst.de>,
	 Massimo Pegorer <massimo.pegorer+oss@gmail.com>
Subject: [PATCH RFC 00/11] rockchip: SoC info and reset cause printouts
Date: Sun, 20 Sep 2026 16:15:44 +0200	[thread overview]
Message-ID: <20260920-reset-v1-0-42820216369f@gmail.com> (raw)

Looking to provide a way to print reset cause on a board equipped with
a PX30 SoC I ran into the following existing issues related to Rockchip
SoCs:

1. It is not possible to select DISPLAY_CPUINFO configuration option
   with ARCH_ROCKCHIP, except for RK3399 RK3288 RK3568 RK3588 SoCs, due
   to incomplete definition of type 'struct rockchip_cru' caused by
   Rockchip common implementation of print_cpuinfo() function: see
   0f9872c4db11 for the RK3588 SoC "workaround", which I feel not
   optimal. Note that DISPLAY_CPUINFO has default y if ARM; therefore,
   it is deselected in each Rockchip defconfig except for listed SoCs.

2. It is not possible to deselect DISPLAY_CPUINFO configuration option
   with TARGET_ROC_PC_RK3399 due to missing get_reset_cause() symbol
   caused by mach-rockchip/Makefile skipping cpu-info.c. I do not see
   how e230c579a3f6 commit separated the reset cause from displaying
   cpuinfo as proposed.

3. For the most recent Rockchip SoCs (RK3588 RK3576 RK3568 RK3528 RK3506
   RK3308 PX30) the checkboard() function is implemented at mach level
   to print SoC information: it overrides the weak empty implementation
   called by show_board_info() when DISPLAY_BOARDINFO(_LATE) option is
   selected.

   Most of the other machs do not provide a checkboard() implementation
   leaving symbol available for overriding at board level. I did not
   find any "regulatory" definition in the documentation, but SoC info
   sounds to me more related to CPUINFO than to BOARDINFO, and other
   machs approach in my opinion seems more consistent with the function
   and configuration option names (checkboard and DISPLAY_BOARDINFO).
   Moreover, this approach has the advantage of allowing each board to
   implement its own checkboard() if needed (other hooks exist for
   board specific printout, of course).

4. Implementation of get_reset_cause() cannot be common in Rockchip mach
   due to different CRU_GLB_RST_ST register definitions from SoC to SoC:
   RK3288 and RK3399 share the same one, but RK3568 and RK3588 ones have
   more bit flags defined (and not all of them seem mutually exclusive),
   and PX30 and RK3308 common one differs again having WDT and TSADC bit
   flags swapped.

Here is my proposal, awaiting your comments and feedback:

1. Create a Rockchip common print_cpuinfo() suitable for any SoC/board,
   making possible DISPLAY_CPUINFO selection without build issues.

2. Avoid DISPLAY_CPUINFO deselection causes build issues for any board.

3. Make print_cpuinfo() to execute code that is currently in function
   named checkboard() at SoC level (if implemented), which prints more
   info than CONFIG_SYS_SOC. Of course, keep printing CONFIG_SYS_SOC if
   function is unavailable and on returning error.

4. Make print_cpuinfo() to execute code to get the SoC reset cause and
   to print its description if the reset cause is available.

5. Avoid DISPLAY_BOARDINFO(_LATE) printing the same SoC info now printed
   by DISPLAY_CPUINFO too: it seems redundant and quite misleading. This
   makes checkboard() implementation at Rockchip mach level unnecessary:
   remove it and leave the overriding option available for board level
   implementation if needed.

6. Select DISPLAY_CPUINFO in all Rockchip board configurations related
   to PX30 RK3308 and any RK35xx (all the SoCs that were providing a
   checkboard() implementation) that already have the DISPLAY_BOARDINFO
   and/or the DISPLAY_BOARDINFO_LATE option selected, to keep SoC info
   printout. BTW they are all of PX30 RK3308 and RK35xx board configs.

The whole series has been built with buildman for all of the involved
board configurations, i.e. those related to PX30 RK3288 RK3308 RK3399
RK35xx.

---
Massimo Pegorer (11):
      arm: rockchip: include SoC-specific CRU header file
      rockchip: cru: move code from header to source file
      rockchip: cru: remove unnecessary common cru.h file
      rockchip: cru: improve and simplify reset cause handling
      arm: rockchip: support DISPLAY_CPUINFO on all Rockchip SoC
      arm: rockchip: unbind cpu-info.c from DISPLAY_CPUINFO
      arm: rockchip: print SoC detailed info with DISPLAY_CPUINFO
      arm: rockchip: print reset cause only when available
      arm: rockchip: do not print SoC info with DISPLAY_BOARDINFO
      configs: rockchip: resync Anbernic RG-DS with savedefconfig
      configs: rockchip: add DISPLAY_CPUINFO to keep SoC info print

 arch/arm/include/asm/arch-rockchip/clock.h      | 11 +++++
 arch/arm/include/asm/arch-rockchip/cru.h        | 39 ----------------
 arch/arm/include/asm/arch-rockchip/cru_rk3399.h |  1 +
 arch/arm/mach-rockchip/Makefile                 |  2 +-
 arch/arm/mach-rockchip/cpu-info.c               | 61 ++++++++++++-------------
 arch/arm/mach-rockchip/px30/px30.c              | 12 ++---
 arch/arm/mach-rockchip/rk3288/clk_rk3288.c      | 37 ++++++++++++++-
 arch/arm/mach-rockchip/rk3288/rk3288.c          |  2 +-
 arch/arm/mach-rockchip/rk3308/rk3308.c          |  2 +-
 arch/arm/mach-rockchip/rk3399/clk_rk3399.c      | 37 ++++++++++++++-
 arch/arm/mach-rockchip/rk3399/rk3399.c          |  2 +-
 arch/arm/mach-rockchip/rk3506/rk3506.c          | 10 ++--
 arch/arm/mach-rockchip/rk3528/rk3528.c          | 10 ++--
 arch/arm/mach-rockchip/rk3568/clk_rk3568.c      | 35 ++++++++++++++
 arch/arm/mach-rockchip/rk3568/rk3568.c          | 12 ++---
 arch/arm/mach-rockchip/rk3576/rk3576.c          | 10 ++--
 arch/arm/mach-rockchip/rk3588/clk_rk3588.c      | 35 ++++++++++++++
 arch/arm/mach-rockchip/rk3588/rk3588.c          | 10 ++--
 board/firefly/roc-pc-rk3399/roc-pc-rk3399.c     |  4 +-
 configs/9tripod-x3568-v4-rk3568_defconfig       |  1 -
 configs/anbernic-rg-ds-rk3568_defconfig         |  6 ---
 configs/anbernic-rgxx3-rk3566_defconfig         |  1 -
 configs/bpi-r2-pro-rk3568_defconfig             |  1 -
 configs/cm3588-nas-rk3588_defconfig             |  1 -
 configs/coolpi-4b-rk3588s_defconfig             |  1 -
 configs/coolpi-cm5-evb-rk3588_defconfig         |  1 -
 configs/coolpi-cm5-genbook-rk3588_defconfig     |  1 -
 configs/easepi-r1-rk3568_defconfig              |  1 -
 configs/evb-px30_defconfig                      |  1 -
 configs/evb-rk3308_defconfig                    |  1 -
 configs/evb-rk3568_defconfig                    |  1 -
 configs/evb-rk3588_defconfig                    |  1 -
 configs/fastrhino-r66s-rk3568_defconfig         |  1 -
 configs/firefly-px30_defconfig                  |  1 -
 configs/gameforce-ace-rk3588s_defconfig         |  1 -
 configs/generic-rk3528_defconfig                |  1 -
 configs/generic-rk3568_defconfig                |  1 -
 configs/generic-rk3576_defconfig                |  1 -
 configs/generic-rk3588_defconfig                |  1 -
 configs/jaguar-rk3588_defconfig                 |  1 -
 configs/khadas-edge2-rk3588s_defconfig          |  1 -
 configs/lckfb-tspi-rk3566_defconfig             |  1 -
 configs/lubancat-2-rk3568_defconfig             |  1 -
 configs/mnt-reform2-rk3588_defconfig            |  1 -
 configs/nanopc-t6-rk3588_defconfig              |  1 -
 configs/nanopi-m5-rk3576_defconfig              |  1 -
 configs/nanopi-r3s-rk3566_defconfig             |  1 -
 configs/nanopi-r5c-rk3568_defconfig             |  1 -
 configs/nanopi-r5s-rk3568_defconfig             |  1 -
 configs/nanopi-r6c-rk3588s_defconfig            |  1 -
 configs/nanopi-r6s-rk3588s_defconfig            |  1 -
 configs/nanopi-r76s-rk3576_defconfig            |  1 -
 configs/nanopi-zero2-rk3528_defconfig           |  1 -
 configs/neu6a-io-rk3588_defconfig               |  1 -
 configs/neu6b-io-rk3588_defconfig               |  1 -
 configs/nova-rk3588s_defconfig                  |  1 -
 configs/odroid-go2_defconfig                    |  1 -
 configs/odroid-m1-rk3568_defconfig              |  1 -
 configs/odroid-m1s-rk3566_defconfig             |  1 -
 configs/odroid-m2-rk3588s_defconfig             |  1 -
 configs/omni3576-rk3576_defconfig               |  1 -
 configs/orangepi-3b-rk3566_defconfig            |  1 -
 configs/orangepi-5-max-rk3588_defconfig         |  1 -
 configs/orangepi-5-plus-rk3588_defconfig        |  1 -
 configs/orangepi-5-rk3588s_defconfig            |  1 -
 configs/orangepi-5-ultra-rk3588_defconfig       |  1 -
 configs/pinetab2-rk3566_defconfig               |  1 -
 configs/powkiddy-x55-rk3566_defconfig           |  1 -
 configs/px30-core-ctouch2-of10-px30_defconfig   |  1 -
 configs/px30-core-ctouch2-px30_defconfig        |  1 -
 configs/px30-core-edimm2.2-px30_defconfig       |  1 -
 configs/qnap-ts433-rk3568_defconfig             |  1 -
 configs/quartz64-a-rk3566_defconfig             |  1 -
 configs/quartz64-b-rk3566_defconfig             |  1 -
 configs/quartzpro64-rk3588_defconfig            |  1 -
 configs/radxa-cm3-io-rk3566_defconfig           |  1 -
 configs/radxa-e20c-rk3528_defconfig             |  1 -
 configs/radxa-e25-rk3568_defconfig              |  1 -
 configs/radxa-zero-3-rk3566_defconfig           |  1 -
 configs/ringneck-px30_defconfig                 |  1 -
 configs/roc-cc-rk3308_defconfig                 |  1 -
 configs/roc-pc-rk3576_defconfig                 |  1 -
 configs/roc-pc-rk3588s_defconfig                |  1 -
 configs/rock-2-rk3528_defconfig                 |  1 -
 configs/rock-3a-rk3568_defconfig                |  1 -
 configs/rock-3b-rk3568_defconfig                |  1 -
 configs/rock-3c-rk3566_defconfig                |  1 -
 configs/rock-4d-rk3576_defconfig                |  1 -
 configs/rock-5-itx-rk3588_defconfig             |  1 -
 configs/rock-5c-rk3588s_defconfig               |  1 -
 configs/rock-pi-s-rk3308_defconfig              |  1 -
 configs/rock-s0-rk3308_defconfig                |  1 -
 configs/rock5a-rk3588s_defconfig                |  1 -
 configs/rock5b-rk3588_defconfig                 |  1 -
 configs/sige1-rk3528_defconfig                  |  1 -
 configs/sige5-rk3576_defconfig                  |  1 -
 configs/sige7-rk3588_defconfig                  |  1 -
 configs/soquartz-blade-rk3566_defconfig         |  1 -
 configs/soquartz-cm4-rk3566_defconfig           |  1 -
 configs/soquartz-model-a-rk3566_defconfig       |  1 -
 configs/tiger-rk3588_defconfig                  |  1 -
 configs/toybrick-rk3588_defconfig               |  1 -
 configs/turing-rk1-rk3588_defconfig             |  1 -
 drivers/clk/rockchip/clk_rk3288.c               |  2 +-
 drivers/clk/rockchip/clk_rk3399.c               |  2 +-
 drivers/ram/rockchip/sdram_rk3288.c             |  2 +-
 drivers/ram/rockchip/sdram_rk3399.c             |  2 +-
 drivers/video/rockchip/rk3288_mipi.c            |  2 +-
 drivers/video/rockchip/rk3399_mipi.c            |  2 +-
 drivers/video/rockchip/rk_mipi.c                |  2 +-
 110 files changed, 229 insertions(+), 206 deletions(-)
---
base-commit: b8e0086b585791a771416ce51b58ce0097bc0b28
change-id: 20260908-reset-e69a40d3f5c6

Best regards,
--  
Massimo Pegorer <massimo.pegorer+oss@gmail.com>


             reply	other threads:[~2026-09-20 15:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 14:15 Massimo Pegorer [this message]
2026-09-20 14:15 ` [PATCH RFC 01/11] arm: rockchip: include SoC-specific CRU header file Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 02/11] rockchip: cru: move code from header to source file Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 03/11] rockchip: cru: remove unnecessary common cru.h file Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 04/11] rockchip: cru: improve and simplify reset cause handling Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 05/11] arm: rockchip: support DISPLAY_CPUINFO on all Rockchip SoC Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 06/11] arm: rockchip: unbind cpu-info.c from DISPLAY_CPUINFO Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 07/11] arm: rockchip: print SoC detailed info with DISPLAY_CPUINFO Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 08/11] arm: rockchip: print reset cause only when available Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 09/11] arm: rockchip: do not print SoC info with DISPLAY_BOARDINFO Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 10/11] configs: rockchip: resync Anbernic RG-DS with savedefconfig Massimo Pegorer
2026-09-20 14:15 ` [PATCH RFC 11/11] configs: rockchip: add DISPLAY_CPUINFO to keep SoC info print Massimo Pegorer
2026-09-20 15:49 ` [PATCH RFC 00/11] rockchip: SoC info and reset cause printouts Jonas Karlman
2026-09-21 16:51   ` Massimo Pegorer
2026-09-21 16:58     ` Quentin Schulz

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20260920-reset-v1-0-42820216369f@gmail.com \
    --to=massimo.pegorer+oss@gmail.com \
    --cc=ag.dev.uboot@gmail.com \
    --cc=alchark@flipper.net \
    --cc=andyshrk@163.com \
    --cc=chenjh@rock-chips.com \
    --cc=clamor95@gmail.com \
    --cc=cnsztl@gmail.com \
    --cc=coiaprant@gmail.com \
    --cc=djw@t-chip.com.cn \
    --cc=duwe@lst.de \
    --cc=ehristev@kernel.org \
    --cc=festevam@nabladev.com \
    --cc=frank-w@public-files.de \
    --cc=frattaroli.nicolas@gmail.com \
    --cc=gajjar04akash@gmail.com \
    --cc=heiko.stuebner@cherry.de \
    --cc=hs@nabladev.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=inindev@gmail.com \
    --cc=jacobe.zang@wesion.com \
    --cc=jagan@edgeble.ai \
    --cc=jiehui.he@foxmail.com \
    --cc=jjm2473@gmail.com \
    --cc=jjriek@verizon.net \
    --cc=jonas@kwiboo.se \
    --cc=kever.yang@rock-chips.com \
    --cc=klaus.goger@cherry.de \
    --cc=liujianfeng1994@gmail.com \
    --cc=lukma@denx.de \
    --cc=macromorgan@hotmail.com \
    --cc=marek.vasut+usb@mailbox.org \
    --cc=maximmosk4@gmail.com \
    --cc=me@0upti.me \
    --cc=naoki@radxa.com \
    --cc=pbrobinson@gmail.com \
    --cc=seb-dev@mail.de \
    --cc=sjg@chromium.org \
    --cc=sputnik@on-the-web.ch \
    --cc=sunil@amarulasolutions.com \
    --cc=tom@tom-fitzhenry.me.uk \
    --cc=trini@konsulko.com \
    --cc=u-boot@0leil.net \
    --cc=u-boot@lists.u-boot-project.org \
    --cc=zhangzj@rock-chips.com \
    --cc=zhihong@nzhnb.com \
    /path/to/YOUR_REPLY

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

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