From patchwork Mon Aug 26 18:20:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 826 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 05DA93F0E1 for ; Mon, 26 Aug 2019 20:21:22 +0200 (CEST) Received: by mail-ot1-f70.google.com with SMTP id y18sf10602888oto.21 for ; Mon, 26 Aug 2019 11:21:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566843680; cv=pass; d=google.com; s=arc-20160816; b=Fj78NMWb6zJ11h8DDVil0OapTPdCvlvpcRQEBUj9jL9HD0YR/tK9ZF3KAlkdbJ0vO3 +gBoDr57Ml8KkrB0/040LaiJ9WuE/iXPlZsoOYddZefkHGJQyzxtSuiU5rev30bU1Sj/ gTJ+Nfm45rxf98bXvLPErKzCkZI7H0dtC4L2HBRxWhP42Vp/qUidkeajJzidwiQ8MVey neOxbM1upzveI4oAAMA29xePAhyHn8G/MtooOc5VJiQOUekm4MmkAvZZTp+ta06TYePK rhTw5J80m5wXuGwoe8h5vaNFacmAYUFuF1KLUupSEnD3WHJY14FVNxwqqd5vNX6xbs1t Wx3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=D76zQ/mPcYGDbDh1sDfdv0aeA/Irj2Gtkv/hgR5Z8es=; b=LooR4xcMZQoLf6a16bQwfeJK6CIAZgfPmxZVWQjdKVMmlS10i5UojOxOnqMRHV+5MA XjGmXHDiKGl8X6ps5HpBlsZMg1cKTqIE/kPpz3tfHsRuPhbmHDOsio+QxRL+mNXkzHbw 2p2q55uGr/+qlrdxW/tkUiizgTpuIiuhlDTvZSNkAY1nKxlikz0XR2WY3ufLNO7yo2+f HR90C2PCj59t3GCW4qamrli4YwRPoqtMe/N/y5GW9ybM7ul7jWjunJjQ0B/h/1zgpAHy 7L1Kric+9GlLSU8rP4tn1aZqHPojPUmck9/gTZrlRjrWScI2Ccb7pqhH7U4h6/Hl+mm0 mWxQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iXVF3gsI; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=D76zQ/mPcYGDbDh1sDfdv0aeA/Irj2Gtkv/hgR5Z8es=; b=HiUJADeRo8t60bDB5vMZKXT0rtfVQ/LB6hi3SqVQddMd4BHDQNlQiT2XEWTZXlRf2O amGfozymaZYXRC17nKi8rdMz6cvfPa1FdSItEPkt6Ey9oO1eFeojgb5WivjNqn6kU/lS iMup+bvjMebCxMHe4QxPaLhc2KEluNqvy6om0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=D76zQ/mPcYGDbDh1sDfdv0aeA/Irj2Gtkv/hgR5Z8es=; b=mDThu4CtGOxUDkg7h9hmX9pxkbYPzj2CidaaVcmS9LOFZ0URkCKHWp4n6yEKSSBcAV oj64YdUep+TK9WfJ1o1NdYFr3oAC5MdN/Umt2QIFzOmlCAj1FD1XxSptriJ9OzzTdqQD BqN0+69Ah1pxG/oi1iSvupZ+xUfpwv/DJ3gVBXkV5vc9ya7hRIho625/DOOPZYC6/o3J tUhWmgZ96BzP6LYW+WGTMlXD91KqI75yn/+DiRq+JbcPcgXwoodLGj2K7U9yO9BRZW1B E/LnU0dL2FgDDQke/4Vld7Ixgd9dhQinncBRMKRxoAxLdC9k5cpTVZy39dJoY6xXKMrY 6RcA== X-Gm-Message-State: APjAAAXVeEGttB4Wq1PCRN+NIH6Wp7ArkT9TyJ9XpLA2/OW+gcCANKBv sdvLCInWUcUDwDw2kFsMODA58ROJ X-Google-Smtp-Source: APXvYqzTzYChYuidg8WIzFIXSGaWm4R4iZQNrBQeUoHPEqXAt7cVIEJbsRoW3cPpvWc6ZLVGDksD+w== X-Received: by 2002:a9d:7516:: with SMTP id r22mr17439660otk.151.1566843680058; Mon, 26 Aug 2019 11:21:20 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a9d:36c:: with SMTP id 99ls507022otv.3.gmail; Mon, 26 Aug 2019 11:21:19 -0700 (PDT) X-Received: by 2002:a9d:6356:: with SMTP id y22mr6091773otk.20.1566843679642; Mon, 26 Aug 2019 11:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566843679; cv=none; d=google.com; s=arc-20160816; b=StyqSkRuuRXd0wvJg72mNQRMZi3YjKbmDPsdv+R0Norsgyojlao0BUsVQhFtSGpVNk wjo41CKJ+6/cjFiqpMHyRN6MnMvERAtU26/4fI4lriryAObtKaqxJNO8NQ7uT48XDdZH 70pM3EtKcef62qIL8MQT6H+3QbRvynRDZeyBTkdIi6JnLTzFj9IimxgXIijXxIwbEgED GnxonnW6eTEUULwqrzBp9/r3WHnhAeurQVvio+EACXimpSa0YozMubg0h9VZ0yQw8ivX dEAK1MAQWyh/tPMcY+AbQCVtOP7mgfkAWLRR3hoybhxQ7qsrm3ve+kcpzKmaPqtxGilZ bQzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=/7SgKrjWzUviuhlLMkeSP3k1gsudg9fnF1buswRrfG8=; b=nUXnX8LXWex5BYIF0Q/QpX6yQBPLPcpGETjoJUlzDw879dTA7YzV5xkBKQ+zqZt2J8 5ol33/yIWf1BCK3yhDdE8X5gngP6GceoTBjfI5xqSauwDJJu5ZRQDEdx+kY7Both+UvY /Wqcg/+BCWw6HbI+ZGIuTB+s0rbByRrZHjHiI8QwSekbYR1/h8kb9zx2OuvTiHzi7xDF mtwfoT6+QH96YyYESVouq+gy1eBt8SQTsO7lHktfmR8goqc3nagl22VlqOPaIiUc091L d4eSO7cEzicqlpINFy9YLXXBF09iiOSd8XU/gdWDftNdJ6VozWu1LSXvcTWIFY2o6Wf5 EhSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iXVF3gsI; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 16sor5349494oin.143.2019.08.26.11.21.18 for (Google Transport Security); Mon, 26 Aug 2019 11:21:18 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aca:1104:: with SMTP id 4mr8966621oir.65.1566843678496; Mon, 26 Aug 2019 11:21:18 -0700 (PDT) Received: from jagan-XPS-13-9350.attlocal.net ([2600:1700:7430:38e0:d5b0:4823:33c8:5e46]) by smtp.gmail.com with ESMTPSA id c11sm4401461otr.54.2019.08.26.11.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 11:21:17 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Akash Gajjar , u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 00/16] rk3399: Add redundant boot support Date: Mon, 26 Aug 2019 23:50:55 +0530 Message-Id: <20190826182111.30999-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iXVF3gsI; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Boot redundancy is one of the key criteria for switch recovery or golden partition based on the bootcount value, which indeed very much needed in production systems on the fields. This patchset support redundant boot on Rockchip rk3399. To make full functional redundancy below features would require from U-Boot level. - bootcount, for counting number reboots - altboot - watchdog support, if SPL or U-Boot reset because of WDT - add CPUINFO for more understanding about how SoC and reset reason. Changes for v2: - Handle TPL build for watchdog, if TPL won't enable - Fix comments for dw_wdt driver-model comments from Andy - Add Kconfig items for WDT_TPL - Support WDT on TPL as well - Use SYS_SOC for cpu-info I would like, not to merge watchdog and bootcount on Mainline devboards since these features will mostly required on production devices but any comments, please share. Any inputs? Jagan. Jagan Teki (16): rockchip: Add cpu-info rockchip: rk3288/rk3399: Enable DISPLAY_CPUINFO arm: rockchip: Add common cru.h rockchip: Add rk3399 reset cause wdt: designware: Simplify is_enabled function wdt: designware: Simplify enable function wdt: dw: Add driver-model support wdt: dw: Rename to dw_wdt.c rockchip: dts: rk3399: Add u-boot, dm-pre-reloc for watchdog wdt: Kconfig: Add WDT_DW entry wdt: Kconfig: Add TPL_WDT entry spl: Add watchdog support fot TPL watchdog: Handle TPL build with watchdog disabled [DO NOT MERGE] rk3399: rockpro64: Enable watchdog rockchip: rk3399: Add bootcount support [DO NOT MERGE] rk3399: rockpro64: Enable bootcount arch/arm/dts/rk3399-u-boot.dtsi | 6 + arch/arm/include/asm/arch-rockchip/cru.h | 26 +++ .../include/asm/arch-rockchip/cru_rk3399.h | 10 +- arch/arm/mach-rockchip/Kconfig | 2 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/cpu-info.c | 59 ++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 10 + arch/arm/mach-rockchip/rk3399/clk_rk3399.c | 2 +- arch/arm/mach-rockchip/rk3399/rk3399.c | 2 +- common/board_f.c | 2 +- common/spl/Kconfig | 9 + configs/evb-rk3288_defconfig | 1 - configs/evb-rk3399_defconfig | 1 - configs/ficus-rk3399_defconfig | 1 - configs/firefly-rk3288_defconfig | 1 - configs/firefly-rk3399_defconfig | 1 - configs/khadas-edge-captain-rk3399_defconfig | 1 - configs/khadas-edge-rk3399_defconfig | 1 - configs/khadas-edge-v-rk3399_defconfig | 1 - configs/miqi-rk3288_defconfig | 1 - configs/nanopc-t4-rk3399_defconfig | 1 - configs/nanopi-m4-rk3399_defconfig | 1 - configs/nanopi-neo4-rk3399_defconfig | 1 - configs/orangepi-rk3399_defconfig | 1 - configs/phycore-rk3288_defconfig | 1 - configs/popmetal-rk3288_defconfig | 1 - configs/puma-rk3399_defconfig | 1 - configs/rock-pi-4-rk3399_defconfig | 1 - configs/rock960-rk3399_defconfig | 1 - configs/rockpro64-rk3399_defconfig | 4 +- configs/tinker-rk3288_defconfig | 1 - configs/vyasa-rk3288_defconfig | 1 - drivers/Makefile | 2 +- drivers/clk/rockchip/clk_rk3399.c | 36 ++-- drivers/ram/rockchip/sdram_rk3399.c | 10 +- drivers/video/rockchip/rk3399_mipi.c | 2 +- drivers/video/rockchip/rk_mipi.c | 2 +- drivers/watchdog/Kconfig | 15 ++ drivers/watchdog/Makefile | 2 +- drivers/watchdog/designware_wdt.c | 73 ------- drivers/watchdog/dw_wdt.c | 188 ++++++++++++++++++ include/configs/rk3399_common.h | 5 +- include/configs/socfpga_common.h | 2 +- include/configs/socfpga_stratix10_socdk.h | 2 +- include/watchdog.h | 7 +- scripts/config_whitelist.txt | 1 - 46 files changed, 364 insertions(+), 136 deletions(-) create mode 100644 arch/arm/include/asm/arch-rockchip/cru.h create mode 100644 arch/arm/mach-rockchip/cpu-info.c delete mode 100644 drivers/watchdog/designware_wdt.c create mode 100644 drivers/watchdog/dw_wdt.c