From patchwork Sat Nov 6 14:52:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1551760 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kwYMI7di; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=9uIFH7RJ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 4HmlHX5NJ9z9sR4 for ; Sun, 7 Nov 2021 04:49:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KuE3Ksn9plZE8XaD6cOre4bTS6psIzc9eKiIGHElzno=; b=kwYMI7dihapcvg pnzzF22o1yFOytLeqKn5vWbdJQL56jRjjPzBEkivUpEHrL+cZ+rU9iO8TgA/tCvRdENJFtOQWht+q HhiIJYvpkkNtTmFCtumFiS4eM9QM22hWdlpsi0Mp7lXsuW3v5gBH7qhTErTqpwngIi/4RslnLmuRq rgT9B3HAff7oglkgKooY27U6aJJ8NWRp+ilJvtrD6uAxv+hRlB9Zf9fT2CewOMctPdyIl/1yPH+2Y QU8gAFE4MP7wD3AD3VbaTxWDko7+dFgSUGqU9hOd34WsDjSTo5C2icjqKW+HlTN4EdMjNnzIJGeEM FdyIFaR8D815sJpJSn7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mjPm9-00DOWv-On; Sat, 06 Nov 2021 17:46:46 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mjP0p-00DC3T-1j for openwrt-devel@lists.openwrt.org; Sat, 06 Nov 2021 16:57:53 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eafe:c901:9857:75d5:20f7:4cbb]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 4549326D560; Sat, 6 Nov 2021 15:52:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1636210378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B9nONrpc1CV71UOoHhtt7oH7SlFmGYnF1yvjHFSgayY=; b=9uIFH7RJUmMnBUZEXYJ6WIsEcx+6sUet9Um1bOkMjITCGUzenpJh4QooGYhIfeAiOcho6F ZXJ/p9PWw5a9JvuRj4ocK9llVPP7hFqtzx3Jc4SBeg9Si86Kez7tGvWeypREdqcn77qjry ZeiFkYSZKZkL9LWHRQYKQO/FxdFvrcRmmCMgSZfvQKnAvIkgQ0Wv0EvhSraaW7N7AtfawG gx9Q4ruEx6mZk5DBrXpCzkOqna/T0mZU4QUaSl9W9/UEaixuOCzbKFgaQnSuGyAK5UNrcP DEH6fJZVBIXiEfPS7OnYnLab4PvIDm2/UUbn1O70Xtq/P3kHrbiKRGDR70tYMA== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Birger Koblitz , John Crispin , Christian Lamparter , Sander Vanheule Subject: [PATCH v3 5/5] realtek: Remove _machine_restart and _machine_halt Date: Sat, 6 Nov 2021 15:52:50 +0100 Message-Id: <6fefae6443c45cbb83251673951cb0accbfad666.1636210086.git.sander@svanheule.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211106_095751_436557_04963CCB X-CRM114-Status: GOOD ( 12.58 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: By dropping _machine_restart, users can provide more reliable or device-specific restart modes. _machine_halt was already removed in commit f4b687d1f053 ("realtek: use kernel defined halt"), but quietly reintroduced in commit 8faffa00cb6b ("realtek: add support for the RTL9300 timer"). Let's rem [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org By dropping _machine_restart, users can provide more reliable or device-specific restart modes. _machine_halt was already removed in commit f4b687d1f053 ("realtek: use kernel defined halt"), but quietly reintroduced in commit 8faffa00cb6b ("realtek: add support for the RTL9300 timer"). Let's remove it again. Signed-off-by: Sander Vanheule --- .../files-5.10/arch/mips/rtl838x/setup.c | 85 ------------------- 1 file changed, 85 deletions(-) diff --git a/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c b/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c index 752a85643728..55419c7b0b7a 100644 --- a/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c +++ b/target/linux/realtek/files-5.10/arch/mips/rtl838x/setup.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -29,100 +28,20 @@ extern struct rtl83xx_soc_info soc_info; -u32 pll_reset_value; - -static void rtl838x_restart(char *command) -{ - u32 pll = sw_r32(RTL838X_PLL_CML_CTRL); - - pr_info("System restart.\n"); - pr_info("PLL control register: %x, applying reset value %x\n", - pll, pll_reset_value); - - sw_w32(3, RTL838X_INT_RW_CTRL); - sw_w32(pll_reset_value, RTL838X_PLL_CML_CTRL); - sw_w32(0, RTL838X_INT_RW_CTRL); - - /* Reset Global Control1 Register */ - sw_w32(1, RTL838X_RST_GLB_CTRL_1); -} - -static void rtl839x_restart(char *command) -{ - /* SoC reset vector (in flash memory): on RTL839x platform preferred way to reset */ - void (*f)(void) = (void *) 0xbfc00000; - - pr_info("System restart.\n"); - /* Reset SoC */ - sw_w32(0xFFFFFFFF, RTL839X_RST_GLB_CTRL); - /* and call reset vector */ - f(); - /* If this fails, halt the CPU */ - while - (1); -} - -static void rtl930x_restart(char *command) -{ - pr_info("System restart.\n"); - sw_w32(0x1, RTL930X_RST_GLB_CTRL_0); - while - (1); -} - -static void rtl931x_restart(char *command) -{ - u32 v; - - pr_info("System restart.\n"); - sw_w32(1, RTL931X_RST_GLB_CTRL); - v = sw_r32(RTL931X_RST_GLB_CTRL); - sw_w32(0x101, RTL931X_RST_GLB_CTRL); - msleep(15); - sw_w32(v, RTL931X_RST_GLB_CTRL); - msleep(15); - sw_w32(0x101, RTL931X_RST_GLB_CTRL); -} - -static void rtl838x_halt(void) -{ - pr_info("System halted.\n"); - while - (1); -} - static void __init rtl838x_setup(void) { - pr_info("Registering _machine_restart\n"); - _machine_restart = rtl838x_restart; - _machine_halt = rtl838x_halt; - - /* This PLL value needs to be restored before a reset and will then be - * preserved over a SoC reset. A wrong value prevents the SoC from - * connecting to the SPI flash controller at boot and reading the - * reset routine */ - pll_reset_value = sw_r32(RTL838X_PLL_CML_CTRL); - /* Setup System LED. Bit 15 then allows to toggle it */ sw_w32_mask(0, 3 << 16, RTL838X_LED_GLB_CTRL); } static void __init rtl839x_setup(void) { - pr_info("Registering _machine_restart\n"); - _machine_restart = rtl839x_restart; - _machine_halt = rtl838x_halt; - /* Setup System LED. Bit 14 of RTL839X_LED_GLB_CTRL then allows to toggle it */ sw_w32_mask(0, 3 << 15, RTL839X_LED_GLB_CTRL); } static void __init rtl930x_setup(void) { - pr_info("Registering _machine_restart\n"); - _machine_restart = rtl930x_restart; - _machine_halt = rtl838x_halt; - if (soc_info.id == 0x9302) sw_w32_mask(0, 3 << 13, RTL9302_LED_GLB_CTRL); else @@ -131,9 +50,6 @@ static void __init rtl930x_setup(void) static void __init rtl931x_setup(void) { - pr_info("Registering _machine_restart\n"); - _machine_restart = rtl931x_restart; - _machine_halt = rtl838x_halt; sw_w32_mask(0, 3 << 12, RTL931X_LED_GLB_CTRL); } @@ -142,7 +58,6 @@ void __init plat_mem_setup(void) void *dtb; set_io_port_base(KSEG1); - _machine_restart = rtl838x_restart; if (fw_passed_dtb) /* UHI interface */ dtb = (void *)fw_passed_dtb;