2023-07-26 13:32:48

by Keguang Zhang

[permalink] [raw]
Subject: [PATCH v2 0/2] MIPS: loongson32: Remove obsolete header files

No one is using regs-clk.h and regs-rtc.h.
Therefore, remove these obsolete header files.

Changelog
V1 -> V2: fix the build error of "‘LS1X_RTC_CTRL’ undeclared"

Keguang Zhang (2):
MIPS: loongson32: Remove regs-clk.h
MIPS: loongson32: Remove regs-rtc.h

.../include/asm/mach-loongson32/loongson1.h | 2 -
.../include/asm/mach-loongson32/regs-clk.h | 81 -------------------
.../include/asm/mach-loongson32/regs-rtc.h | 19 -----
arch/mips/loongson32/common/platform.c | 8 --
4 files changed, 110 deletions(-)
delete mode 100644 arch/mips/include/asm/mach-loongson32/regs-clk.h
delete mode 100644 arch/mips/include/asm/mach-loongson32/regs-rtc.h


base-commit: 0859bdf1ace659e8981a82956920573c1f8203da
--
2.39.2



2023-07-26 14:08:54

by Keguang Zhang

[permalink] [raw]
Subject: [PATCH v2 2/2] MIPS: loongson32: Remove regs-rtc.h

Since commit 35508d242409 ("MIPS: loongson32: ls1c: Fix hang
during startup"), no one is calling ls1x_rtc_set_extclk().
Therefore, remove this obsolete function.

Since commit 9fb23090658a ("rtc: Remove the Loongson-1
RTC driver"), no one is using regs-rtc.h.
Therefore, remove this obsolete header file.

Signed-off-by: Keguang Zhang <[email protected]>
---
V1 -> V2: fix the build error of "‘LS1X_RTC_CTRL’ undeclared"

.../include/asm/mach-loongson32/loongson1.h | 1 -
.../include/asm/mach-loongson32/regs-rtc.h | 19 -------------------
arch/mips/loongson32/common/platform.c | 8 --------
3 files changed, 28 deletions(-)
delete mode 100644 arch/mips/include/asm/mach-loongson32/regs-rtc.h

diff --git a/arch/mips/include/asm/mach-loongson32/loongson1.h b/arch/mips/include/asm/mach-loongson32/loongson1.h
index bc27fcee3176..84f45461c832 100644
--- a/arch/mips/include/asm/mach-loongson32/loongson1.h
+++ b/arch/mips/include/asm/mach-loongson32/loongson1.h
@@ -46,6 +46,5 @@
#define LS1X_CLK_BASE 0x1fe78030

#include <regs-mux.h>
-#include <regs-rtc.h>

#endif /* __ASM_MACH_LOONGSON32_LOONGSON1_H */
diff --git a/arch/mips/include/asm/mach-loongson32/regs-rtc.h b/arch/mips/include/asm/mach-loongson32/regs-rtc.h
deleted file mode 100644
index a3d096be1607..000000000000
--- a/arch/mips/include/asm/mach-loongson32/regs-rtc.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Copyright (c) 2016 Yang Ling <[email protected]>
- *
- * Loongson 1 RTC timer Register Definitions.
- */
-
-#ifndef __ASM_MACH_LOONGSON32_REGS_RTC_H
-#define __ASM_MACH_LOONGSON32_REGS_RTC_H
-
-#define LS1X_RTC_REG(x) \
- ((void __iomem *)KSEG1ADDR(LS1X_RTC_BASE + (x)))
-
-#define LS1X_RTC_CTRL LS1X_RTC_REG(0x40)
-
-#define RTC_EXTCLK_OK (BIT(5) | BIT(8))
-#define RTC_EXTCLK_EN BIT(8)
-
-#endif /* __ASM_MACH_LOONGSON32_REGS_RTC_H */
diff --git a/arch/mips/loongson32/common/platform.c b/arch/mips/loongson32/common/platform.c
index 64d7979394e6..8075590a9f83 100644
--- a/arch/mips/loongson32/common/platform.c
+++ b/arch/mips/loongson32/common/platform.c
@@ -265,14 +265,6 @@ struct platform_device ls1x_ehci_pdev = {
};

/* Real Time Clock */
-void __init ls1x_rtc_set_extclk(struct platform_device *pdev)
-{
- u32 val = __raw_readl(LS1X_RTC_CTRL);
-
- if (!(val & RTC_EXTCLK_OK))
- __raw_writel(val | RTC_EXTCLK_EN, LS1X_RTC_CTRL);
-}
-
struct platform_device ls1x_rtc_pdev = {
.name = "ls1x-rtc",
.id = -1,
--
2.39.2


2023-07-26 14:10:05

by Keguang Zhang

[permalink] [raw]
Subject: [PATCH v2 1/2] MIPS: loongson32: Remove regs-clk.h

Since commit c46496119ed0 ("clk: loongson1: Remove
the outdated driver"), no one is using regs-clk.h.
Therefore, remove this obsolete header file.

Signed-off-by: Keguang Zhang <[email protected]>
---
V1 -> V2: None

.../include/asm/mach-loongson32/loongson1.h | 1 -
.../include/asm/mach-loongson32/regs-clk.h | 81 -------------------
2 files changed, 82 deletions(-)
delete mode 100644 arch/mips/include/asm/mach-loongson32/regs-clk.h

diff --git a/arch/mips/include/asm/mach-loongson32/loongson1.h b/arch/mips/include/asm/mach-loongson32/loongson1.h
index 7971272345d3..bc27fcee3176 100644
--- a/arch/mips/include/asm/mach-loongson32/loongson1.h
+++ b/arch/mips/include/asm/mach-loongson32/loongson1.h
@@ -45,7 +45,6 @@
#define LS1X_NAND_BASE 0x1fe78000
#define LS1X_CLK_BASE 0x1fe78030

-#include <regs-clk.h>
#include <regs-mux.h>
#include <regs-rtc.h>

diff --git a/arch/mips/include/asm/mach-loongson32/regs-clk.h b/arch/mips/include/asm/mach-loongson32/regs-clk.h
deleted file mode 100644
index 98136fa8bee1..000000000000
--- a/arch/mips/include/asm/mach-loongson32/regs-clk.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Copyright (c) 2011 Zhang, Keguang <[email protected]>
- *
- * Loongson 1 Clock Register Definitions.
- */
-
-#ifndef __ASM_MACH_LOONGSON32_REGS_CLK_H
-#define __ASM_MACH_LOONGSON32_REGS_CLK_H
-
-#define LS1X_CLK_REG(x) \
- ((void __iomem *)KSEG1ADDR(LS1X_CLK_BASE + (x)))
-
-#define LS1X_CLK_PLL_FREQ LS1X_CLK_REG(0x0)
-#define LS1X_CLK_PLL_DIV LS1X_CLK_REG(0x4)
-
-#if defined(CONFIG_LOONGSON1_LS1B)
-/* Clock PLL Divisor Register Bits */
-#define DIV_DC_EN BIT(31)
-#define DIV_DC_RST BIT(30)
-#define DIV_CPU_EN BIT(25)
-#define DIV_CPU_RST BIT(24)
-#define DIV_DDR_EN BIT(19)
-#define DIV_DDR_RST BIT(18)
-#define RST_DC_EN BIT(5)
-#define RST_DC BIT(4)
-#define RST_DDR_EN BIT(3)
-#define RST_DDR BIT(2)
-#define RST_CPU_EN BIT(1)
-#define RST_CPU BIT(0)
-
-#define DIV_DC_SHIFT 26
-#define DIV_CPU_SHIFT 20
-#define DIV_DDR_SHIFT 14
-
-#define DIV_DC_WIDTH 4
-#define DIV_CPU_WIDTH 4
-#define DIV_DDR_WIDTH 4
-
-#define BYPASS_DC_SHIFT 12
-#define BYPASS_DDR_SHIFT 10
-#define BYPASS_CPU_SHIFT 8
-
-#define BYPASS_DC_WIDTH 1
-#define BYPASS_DDR_WIDTH 1
-#define BYPASS_CPU_WIDTH 1
-
-#elif defined(CONFIG_LOONGSON1_LS1C)
-/* PLL/SDRAM Frequency configuration register Bits */
-#define PLL_VALID BIT(31)
-#define FRAC_N GENMASK(23, 16)
-#define RST_TIME GENMASK(3, 2)
-#define SDRAM_DIV GENMASK(1, 0)
-
-/* CPU/CAMERA/DC Frequency configuration register Bits */
-#define DIV_DC_EN BIT(31)
-#define DIV_DC GENMASK(30, 24)
-#define DIV_CAM_EN BIT(23)
-#define DIV_CAM GENMASK(22, 16)
-#define DIV_CPU_EN BIT(15)
-#define DIV_CPU GENMASK(14, 8)
-#define DIV_DC_SEL_EN BIT(5)
-#define DIV_DC_SEL BIT(4)
-#define DIV_CAM_SEL_EN BIT(3)
-#define DIV_CAM_SEL BIT(2)
-#define DIV_CPU_SEL_EN BIT(1)
-#define DIV_CPU_SEL BIT(0)
-
-#define DIV_DC_SHIFT 24
-#define DIV_CAM_SHIFT 16
-#define DIV_CPU_SHIFT 8
-#define DIV_DDR_SHIFT 0
-
-#define DIV_DC_WIDTH 7
-#define DIV_CAM_WIDTH 7
-#define DIV_CPU_WIDTH 7
-#define DIV_DDR_WIDTH 2
-
-#endif
-
-#endif /* __ASM_MACH_LOONGSON32_REGS_CLK_H */
--
2.39.2


2023-07-28 10:04:58

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] MIPS: loongson32: Remove obsolete header files

On Wed, Jul 26, 2023 at 08:51:29PM +0800, Keguang Zhang wrote:
> No one is using regs-clk.h and regs-rtc.h.
> Therefore, remove these obsolete header files.
>
> Changelog
> V1 -> V2: fix the build error of "‘LS1X_RTC_CTRL’ undeclared"
>
> Keguang Zhang (2):
> MIPS: loongson32: Remove regs-clk.h
> MIPS: loongson32: Remove regs-rtc.h
>
> .../include/asm/mach-loongson32/loongson1.h | 2 -
> .../include/asm/mach-loongson32/regs-clk.h | 81 -------------------
> .../include/asm/mach-loongson32/regs-rtc.h | 19 -----
> arch/mips/loongson32/common/platform.c | 8 --
> 4 files changed, 110 deletions(-)
> delete mode 100644 arch/mips/include/asm/mach-loongson32/regs-clk.h
> delete mode 100644 arch/mips/include/asm/mach-loongson32/regs-rtc.h

series applied to mips-next.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]