linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] MIPS: loongson32: Remove obsolete header files
@ 2023-07-07 11:11 Keguang Zhang
  2023-07-07 11:11 ` [PATCH 1/2] MIPS: loongson32: Remove regs-clk.h Keguang Zhang
  2023-07-07 11:11 ` [PATCH 2/2] MIPS: loongson32: Remove regs-rtc.h Keguang Zhang
  0 siblings, 2 replies; 5+ messages in thread
From: Keguang Zhang @ 2023-07-07 11:11 UTC (permalink / raw)
  To: linux-mips, linux-kernel; +Cc: Thomas Bogendoerfer, Keguang Zhang

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

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 -----
 3 files changed, 102 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: 826eeaf68b03e5b96bdbc11e3e796f8b562bc0e3
prerequisite-patch-id: 6e96bdeb437dde42fff19ffe564c1ed47e95788d
-- 
2.39.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] MIPS: loongson32: Remove regs-clk.h
  2023-07-07 11:11 [PATCH 0/2] MIPS: loongson32: Remove obsolete header files Keguang Zhang
@ 2023-07-07 11:11 ` Keguang Zhang
  2023-07-07 11:11 ` [PATCH 2/2] MIPS: loongson32: Remove regs-rtc.h Keguang Zhang
  1 sibling, 0 replies; 5+ messages in thread
From: Keguang Zhang @ 2023-07-07 11:11 UTC (permalink / raw)
  To: linux-mips, linux-kernel; +Cc: Thomas Bogendoerfer, Keguang Zhang

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 <keguang.zhang@gmail.com>
---
 .../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 <keguang.zhang@gmail.com>
- *
- * 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] MIPS: loongson32: Remove regs-rtc.h
  2023-07-07 11:11 [PATCH 0/2] MIPS: loongson32: Remove obsolete header files Keguang Zhang
  2023-07-07 11:11 ` [PATCH 1/2] MIPS: loongson32: Remove regs-clk.h Keguang Zhang
@ 2023-07-07 11:11 ` Keguang Zhang
  2023-07-25  8:47   ` Thomas Bogendoerfer
  1 sibling, 1 reply; 5+ messages in thread
From: Keguang Zhang @ 2023-07-07 11:11 UTC (permalink / raw)
  To: linux-mips, linux-kernel; +Cc: Thomas Bogendoerfer, Keguang Zhang

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 <keguang.zhang@gmail.com>
---
 .../include/asm/mach-loongson32/loongson1.h   |  1 -
 .../include/asm/mach-loongson32/regs-rtc.h    | 19 -------------------
 2 files changed, 20 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 <gnaygnil@gmail.com>
- *
- * 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 */
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] MIPS: loongson32: Remove regs-rtc.h
  2023-07-07 11:11 ` [PATCH 2/2] MIPS: loongson32: Remove regs-rtc.h Keguang Zhang
@ 2023-07-25  8:47   ` Thomas Bogendoerfer
  2023-07-25 10:15     ` Keguang Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Bogendoerfer @ 2023-07-25  8:47 UTC (permalink / raw)
  To: Keguang Zhang; +Cc: linux-mips, linux-kernel

On Fri, Jul 07, 2023 at 07:11:51PM +0800, Keguang Zhang wrote:
> 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 <keguang.zhang@gmail.com>
> ---
>  .../include/asm/mach-loongson32/loongson1.h   |  1 -
>  .../include/asm/mach-loongson32/regs-rtc.h    | 19 -------------------
>  2 files changed, 20 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 <gnaygnil@gmail.com>
> - *
> - * 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 */
> -- 
> 2.39.2

I get these build error when this patch is applied:

linux/arch/mips/loongson32/common/platform.c: In function ‘ls1x_rtc_set_extclk’:
/local/tbogendoerfer/korg/linux/arch/mips/loongson32/common/platform.c:270:24: error: ‘LS1X_RTC_CTRL’ undeclared (first use in this function)
  u32 val = __raw_readl(LS1X_RTC_CTRL);
                        ^~~~~~~~~~~~~
linux/arch/mips/loongson32/common/platform.c:270:24: note: each undeclared identifier is reported only once for each function it appears in
/local/tbogendoerfer/korg/linux/arch/mips/loongson32/common/platform.c:272:14: error: ‘RTC_EXTCLK_OK’ undeclared (first use in this function)
  if (!(val & RTC_EXTCLK_OK))
              ^~~~~~~~~~~~~
linux/arch/mips/loongson32/common/platform.c:273:22: error: ‘RTC_EXTCLK_EN’ undeclared (first use in this function)
   __raw_writel(val | RTC_EXTCLK_EN, LS1X_RTC_CTRL);

Thomas.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] MIPS: loongson32: Remove regs-rtc.h
  2023-07-25  8:47   ` Thomas Bogendoerfer
@ 2023-07-25 10:15     ` Keguang Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Keguang Zhang @ 2023-07-25 10:15 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

On Tue, Jul 25, 2023 at 4:59 PM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Fri, Jul 07, 2023 at 07:11:51PM +0800, Keguang Zhang wrote:
> > 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 <keguang.zhang@gmail.com>
> > ---
> >  .../include/asm/mach-loongson32/loongson1.h   |  1 -
> >  .../include/asm/mach-loongson32/regs-rtc.h    | 19 -------------------
> >  2 files changed, 20 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 <gnaygnil@gmail.com>
> > - *
> > - * 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 */
> > --
> > 2.39.2
>
> I get these build error when this patch is applied:
>
> linux/arch/mips/loongson32/common/platform.c: In function ‘ls1x_rtc_set_extclk’:
> /local/tbogendoerfer/korg/linux/arch/mips/loongson32/common/platform.c:270:24: error: ‘LS1X_RTC_CTRL’ undeclared (first use in this function)
>   u32 val = __raw_readl(LS1X_RTC_CTRL);
>                         ^~~~~~~~~~~~~
> linux/arch/mips/loongson32/common/platform.c:270:24: note: each undeclared identifier is reported only once for each function it appears in
> /local/tbogendoerfer/korg/linux/arch/mips/loongson32/common/platform.c:272:14: error: ‘RTC_EXTCLK_OK’ undeclared (first use in this function)
>   if (!(val & RTC_EXTCLK_OK))
>               ^~~~~~~~~~~~~
> linux/arch/mips/loongson32/common/platform.c:273:22: error: ‘RTC_EXTCLK_EN’ undeclared (first use in this function)
>    __raw_writel(val | RTC_EXTCLK_EN, LS1X_RTC_CTRL);
>
> Thomas.
>

Sorry! I will send v2 to fix this ASAP.

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



-- 
Best regards,

Keguang Zhang

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-25 10:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07 11:11 [PATCH 0/2] MIPS: loongson32: Remove obsolete header files Keguang Zhang
2023-07-07 11:11 ` [PATCH 1/2] MIPS: loongson32: Remove regs-clk.h Keguang Zhang
2023-07-07 11:11 ` [PATCH 2/2] MIPS: loongson32: Remove regs-rtc.h Keguang Zhang
2023-07-25  8:47   ` Thomas Bogendoerfer
2023-07-25 10:15     ` Keguang Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).