From patchwork Mon Jul 29 07:46:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 809 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 01E3B3F0E1 for ; Mon, 29 Jul 2019 09:47:25 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id u21sf37962283pfn.15 for ; Mon, 29 Jul 2019 00:47:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1564386443; cv=pass; d=google.com; s=arc-20160816; b=M9EZcgqaJI4kQeKA+Iq3b5fpwBCsfRiPBoZucxrUswfSUprJ9qeRrdmsYSiiu6kMre tnikUbCajFtdAuJnBXcE8yH+vvIlbYUeFgMDdQ+0/FFkNfKpP71GyWill1R61B4qxzMG t11tIacoF6FxB+u3gvD4t10rLXlwwQasbbTNw6Ya1IYCMuBDZkidux7PDVld8QGlLUa/ 62AfTsd750bYKXCvP/cjfX5C/0cBwPzr1CKLsq3c3sHJYAnC9CuAfV1nVrCxO6/40JYd VRKLOtQS2UiQ+IXgl2F1s9bVLHlQ0miAiq08XzqLnV7vZS1rwznB7L6kAzR6sdw5lHNY gBlw== 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=NzBe2oETSlNsXbykHZ58ep2mBPowIl8zvJNV2wgmeZI=; b=sBkAoFNHp3PMnUoOoDkYTDm784Ukcv5PlmyFqpSKt+W5/HMqFgsXiDvX0NdGk9dX/4 XFr8W3O3AhrDM2OV41kiVSAos8STFqHOL++k+XIk9eb6w+vPzSCInnRFHjll6vknXxLd 49V90k2xcrKoCtHJigs4k+bVIjsUSG0mKItWhmDwvtj+q+a5PmN6naYMmy94CEgRWRdU ZIgVkFV5BDMTSFyr9SM3C25q/pQ0qbwkxe98U50Se6nnXKaVUK+CHc6UoGbhRvmtsA5t qGWpIzGUz6TnnWjeSj0fYAgrbXGwOv7g8iFuhG4b6Quzg7qFCxmV6eeQ8TYl9CQa7mwo kyHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y3m5OHTU; 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=NzBe2oETSlNsXbykHZ58ep2mBPowIl8zvJNV2wgmeZI=; b=kgSusxh0t6qPetEXreTosIpxC7zG6ePJVZlG1yepkDVEQAYzucfr8H//0ahXbS0dei RtV9rZiehBh5DR0yc5O1UcVzM59V17ME8FoosmUe2I4WKXNHiDdiDmg3ncN+zPgtICqF ufhPwZ6kEYaSZVkkqQg3lBhtopMn9wF0gksoE= 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=NzBe2oETSlNsXbykHZ58ep2mBPowIl8zvJNV2wgmeZI=; b=L9nxPZ45CU/x4Np0HXClOEqJIFYcrI0UpFseSjImr7jh9tvRL3NOTR30qwAwITdm46 VXHxHoh4P3Q13LFxN+eF0oDlen4YfWa1D/AAQgor60PVVorWa8WcxIk0JTgBG4Fm9Be+ Ictt8wsxLbSngOsXSb9lX9J0qmeH2pJIfpOSdJuL9RNlg4cIeLKHpSNDnv8jLRoPu96b fmkX/r9MOy73hoh7MB/GPFnxOBy1zoyZuqnDM11qGKEm0SdKVkm1p2J34kRI4QkwkiDh 8dOVrFOxb7sHZSVZxg11BoNIbJbuSpEwSmFolnUtZW9UAdCpL1cC8N/sFg3pF2LI21ZI 3ZzA== X-Gm-Message-State: APjAAAWsYQlKQ9XX09gL+BF/JZGBxK3b3untIUKS+ayX4b3boYVwTMq1 EcgyWtfymZiBXXpQC3iyFo5gsWCi X-Google-Smtp-Source: APXvYqzGz4qQWk9sWTwmvTKkUyR9Yh0qYB5zpcpcwJS3vwTPU99413g6RYV9d7EWAlNpVWbTZuAwYw== X-Received: by 2002:a17:902:59c3:: with SMTP id d3mr105507314plj.22.1564386443588; Mon, 29 Jul 2019 00:47:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3227:: with SMTP id k36ls20997559pjb.0.gmail; Mon, 29 Jul 2019 00:47:23 -0700 (PDT) X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr108126172plt.152.1564386443190; Mon, 29 Jul 2019 00:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564386443; cv=none; d=google.com; s=arc-20160816; b=ihBz/1nU6Iff/AEyM4uAamq3G9a0zcUvs+FqqNr2/9M+gJH+fnQwaW98U8cCA+1lQ+ t3Jd1OT8mvlYJYxZJaqjuhMvKzRM/BQRbCvIBMOL9lxfjB62lPtu01QRj4WdQlX1Du4k sItxOADU5i8cfEsW22eQ/kxvLeBReW7TxHhEENOZ4HI8++r0TVzrCdJoFFmfDXcUvWtp oeZ9547Af4z3xPNni3YqazvKBcN07WmgvyKl/fc2jZ28tQDbObk13Ff+FUTa50bPx6Ik CRMXfUUw5gJ+JvR0Jypi1wP7CyUmhevea+6TIZglhFvVrhG82EVG7Af1Fle2z2Qa7ehp 8RAw== 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=KV637IdarZaxHAMhyyMC1da4VvXdY/IcpMGk7VTXTRo=; b=kz6BnnLoXE181HbKyP6t1u5AsUdsYLajI5b3Twhsf/+LK/5K3uZbr1bxLRaGL1Wk2c Q4AakTRlAcrd5FQesvKg/rNQGOpqmKpmdvjpoXMb+U4SCiQlOKQy3bDYWuVWmKdgx0pM npp9fYo8kIREtNw7w5Hv6kyfP4EDqcsLWcZeubsntuJuZMAJYWLD7I/09KD+Cv3Dzhxc BCTr/wYH5O15KqkNvwcwk78lgEb4HeZG9IfT5eNVmJlZtJoUO9VJ0Teu4uT8UY5bZedA zFdmDjFbZxymnTKC9jvPqqq1jLC93S0y/PIjgMePSu+5Buqrw3rgrry80I/kDrpg47su xq6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y3m5OHTU; 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 j8sor42075991pfa.53.2019.07.29.00.47.23 for (Google Transport Security); Mon, 29 Jul 2019 00:47:23 -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:a62:ce8e:: with SMTP id y136mr35682242pfg.29.1564386442620; Mon, 29 Jul 2019 00:47:22 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.41]) by smtp.gmail.com with ESMTPSA id h14sm75723348pfq.22.2019.07.29.00.47.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 00:47:22 -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 00/15] rk3399: Add redundant boot support Date: Mon, 29 Jul 2019 13:16:56 +0530 Message-Id: <20190729074711.16988-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=Y3m5OHTU; 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. patch 0001 - 0005: cpu info, reset reason patch 0006 - 0009: designware watchdog driver, dm-conversion patch 0010: Add watchdog property available to SPL patch 0011: Add Kconfig option for dw_wdt.c patch 0012: Disable watchdog for TPL patch 0013: enable watchdog on rockpro64, overlay patch 0014: bootcount support patch 0015: enable bootcount on rockpro64, overlay 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 (15): arm: rockchip: Add common cru.h rockchip: Add cpu-info rockchip: rk3288: Print reset reason rockchip: Add common reset reason rockchip: rk3288/rk3399: Enable DISPLAY_CPUINFO 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 include: rk3399: Disable watchdog in TPL [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 | 28 +++ .../include/asm/arch-rockchip/cru_rk3288.h | 14 +- arch/arm/mach-rockchip/Kconfig | 2 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/cpu-info.c | 65 +++++++ arch/arm/mach-rockchip/rk3288-board.c | 39 ---- arch/arm/mach-rockchip/rk3288/clk_rk3288.c | 2 +- arch/arm/mach-rockchip/rk3399-board-spl.c | 2 +- arch/arm/mach-rockchip/rk3399/Kconfig | 10 + arch/arm/mach-rockchip/rk3399/clk_rk3399.c | 2 +- common/board_f.c | 2 +- configs/evb-rk3288_defconfig | 1 - configs/evb-rk3399_defconfig | 1 - configs/fennec-rk3288_defconfig | 1 - configs/ficus-rk3399_defconfig | 1 - configs/firefly-rk3288_defconfig | 1 - configs/firefly-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/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 +- drivers/watchdog/Kconfig | 9 + drivers/watchdog/Makefile | 2 +- drivers/watchdog/designware_wdt.c | 73 ------- drivers/watchdog/dw_wdt.c | 184 ++++++++++++++++++ include/configs/rk3399_common.h | 10 +- include/configs/socfpga_common.h | 2 +- include/configs/socfpga_stratix10_socdk.h | 2 +- scripts/config_whitelist.txt | 1 - 46 files changed, 332 insertions(+), 160 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