linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] some cleanup code
@ 2021-03-04 11:00 Qing Zhang
  2021-03-04 11:00 ` [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members Qing Zhang
  2021-03-04 11:00 ` [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h Qing Zhang
  0 siblings, 2 replies; 18+ messages in thread
From: Qing Zhang @ 2021-03-04 11:00 UTC (permalink / raw)
  To: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier
  Cc: linux-mips, linux-kernel

These patches clean up some code about Loongson64.

Qing Zhang (2):
  MIPS: Loongson64: Remove unused sysconf members
  MIPS: Loongson64: Move loongson_system_configuration to loongson.h

 .../include/asm/mach-loongson64/boot_param.h  | 27 ------------
 .../include/asm/mach-loongson64/loongson.h    | 18 ++++++++
 arch/mips/loongson64/Makefile                 |  2 +-
 arch/mips/loongson64/env.c                    | 20 ---------
 arch/mips/loongson64/platform.c               | 42 -------------------
 drivers/irqchip/irq-loongson-liointc.c        |  2 +-
 6 files changed, 20 insertions(+), 91 deletions(-)
 delete mode 100644 arch/mips/loongson64/platform.c

-- 
2.20.1


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

* [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members
  2021-03-04 11:00 [PATCH 0/2] some cleanup code Qing Zhang
@ 2021-03-04 11:00 ` Qing Zhang
  2021-03-05  2:32   ` Jiaxun Yang
  2021-03-12 10:28   ` Thomas Bogendoerfer
  2021-03-04 11:00 ` [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h Qing Zhang
  1 sibling, 2 replies; 18+ messages in thread
From: Qing Zhang @ 2021-03-04 11:00 UTC (permalink / raw)
  To: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier
  Cc: linux-mips, linux-kernel

We don't need them anymore, They are uniform on all Loongson64 systems
and have been fixed in DeviceTree.loongson3_platform_init is replaced
with DTS + driver.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
---
 .../include/asm/mach-loongson64/boot_param.h  |  9 ----
 arch/mips/loongson64/Makefile                 |  2 +-
 arch/mips/loongson64/env.c                    | 20 ---------
 arch/mips/loongson64/platform.c               | 42 -------------------
 4 files changed, 1 insertion(+), 72 deletions(-)
 delete mode 100644 arch/mips/loongson64/platform.c

diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
index 4592841b6b0c..1c1cdf57137e 100644
--- a/arch/mips/include/asm/mach-loongson64/boot_param.h
+++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
@@ -207,20 +207,11 @@ struct loongson_system_configuration {
 	u16 reserved_cpus_mask;
 	enum loongson_cpu_type cputype;
 	enum loongson_bridge_type bridgetype;
-	u64 ht_control_base;
-	u64 pci_mem_start_addr;
-	u64 pci_mem_end_addr;
-	u64 pci_io_base;
 	u64 restart_addr;
 	u64 poweroff_addr;
 	u64 suspend_addr;
 	u64 vgabios_addr;
 	u32 dma_mask_bits;
-	char ecname[32];
-	u32 nr_uarts;
-	struct uart_device uarts[MAX_UARTS];
-	u32 nr_sensors;
-	struct sensor_device sensors[MAX_SENSORS];
 	u64 workarounds;
 	void (*early_config)(void);
 };
diff --git a/arch/mips/loongson64/Makefile b/arch/mips/loongson64/Makefile
index cc76944b1a9d..e806280bbb85 100644
--- a/arch/mips/loongson64/Makefile
+++ b/arch/mips/loongson64/Makefile
@@ -2,7 +2,7 @@
 #
 # Makefile for Loongson-3 family machines
 #
-obj-$(CONFIG_MACH_LOONGSON64) += cop2-ex.o platform.o dma.o \
+obj-$(CONFIG_MACH_LOONGSON64) += cop2-ex.o dma.o \
 				setup.o init.o env.o time.o reset.o \
 
 obj-$(CONFIG_SMP)	+= smp.o
diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
index 51a5d050a94c..1821d461b606 100644
--- a/arch/mips/loongson64/env.c
+++ b/arch/mips/loongson64/env.c
@@ -95,7 +95,6 @@ void __init prom_init_env(void)
 		loongson_freqctrl[1] = 0x900010001fe001d0;
 		loongson_freqctrl[2] = 0x900020001fe001d0;
 		loongson_freqctrl[3] = 0x900030001fe001d0;
-		loongson_sysconf.ht_control_base = 0x90000EFDFB000000;
 		loongson_sysconf.workarounds = WORKAROUND_CPUFREQ;
 		break;
 	case Legacy_3B:
@@ -118,7 +117,6 @@ void __init prom_init_env(void)
 		loongson_freqctrl[1] = 0x900020001fe001d0;
 		loongson_freqctrl[2] = 0x900040001fe001d0;
 		loongson_freqctrl[3] = 0x900060001fe001d0;
-		loongson_sysconf.ht_control_base = 0x90001EFDFB000000;
 		loongson_sysconf.workarounds = WORKAROUND_CPUHOTPLUG;
 		break;
 	default:
@@ -136,9 +134,6 @@ void __init prom_init_env(void)
 		loongson_sysconf.cores_per_node - 1) /
 		loongson_sysconf.cores_per_node;
 
-	loongson_sysconf.pci_mem_start_addr = eirq_source->pci_mem_start_addr;
-	loongson_sysconf.pci_mem_end_addr = eirq_source->pci_mem_end_addr;
-	loongson_sysconf.pci_io_base = eirq_source->pci_io_start_addr;
 	loongson_sysconf.dma_mask_bits = eirq_source->dma_mask_bits;
 	if (loongson_sysconf.dma_mask_bits < 32 ||
 		loongson_sysconf.dma_mask_bits > 64)
@@ -153,23 +148,8 @@ void __init prom_init_env(void)
 		loongson_sysconf.poweroff_addr, loongson_sysconf.restart_addr,
 		loongson_sysconf.vgabios_addr);
 
-	memset(loongson_sysconf.ecname, 0, 32);
-	if (esys->has_ec)
-		memcpy(loongson_sysconf.ecname, esys->ec_name, 32);
 	loongson_sysconf.workarounds |= esys->workarounds;
 
-	loongson_sysconf.nr_uarts = esys->nr_uarts;
-	if (esys->nr_uarts < 1 || esys->nr_uarts > MAX_UARTS)
-		loongson_sysconf.nr_uarts = 1;
-	memcpy(loongson_sysconf.uarts, esys->uarts,
-		sizeof(struct uart_device) * loongson_sysconf.nr_uarts);
-
-	loongson_sysconf.nr_sensors = esys->nr_sensors;
-	if (loongson_sysconf.nr_sensors > MAX_SENSORS)
-		loongson_sysconf.nr_sensors = 0;
-	if (loongson_sysconf.nr_sensors)
-		memcpy(loongson_sysconf.sensors, esys->sensors,
-			sizeof(struct sensor_device) * loongson_sysconf.nr_sensors);
 	pr_info("CpuClock = %u\n", cpu_clock_freq);
 
 	/* Read the ID of PCI host bridge to detect bridge type */
diff --git a/arch/mips/loongson64/platform.c b/arch/mips/loongson64/platform.c
deleted file mode 100644
index 9674ae1361a8..000000000000
--- a/arch/mips/loongson64/platform.c
+++ /dev/null
@@ -1,42 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (C) 2009 Lemote Inc.
- * Author: Wu Zhangjin, wuzhangjin@gmail.com
- *         Xiang Yu, xiangy@lemote.com
- *         Chen Huacai, chenhc@lemote.com
- */
-
-#include <linux/err.h>
-#include <linux/slab.h>
-#include <linux/platform_device.h>
-#include <asm/bootinfo.h>
-#include <boot_param.h>
-#include <loongson_hwmon.h>
-#include <workarounds.h>
-
-static int __init loongson3_platform_init(void)
-{
-	int i;
-	struct platform_device *pdev;
-
-	if (loongson_sysconf.ecname[0] != '\0')
-		platform_device_register_simple(loongson_sysconf.ecname, -1, NULL, 0);
-
-	for (i = 0; i < loongson_sysconf.nr_sensors; i++) {
-		if (loongson_sysconf.sensors[i].type > SENSOR_FAN)
-			continue;
-
-		pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
-		if (!pdev)
-			return -ENOMEM;
-
-		pdev->name = loongson_sysconf.sensors[i].name;
-		pdev->id = loongson_sysconf.sensors[i].id;
-		pdev->dev.platform_data = &loongson_sysconf.sensors[i];
-		platform_device_register(pdev);
-	}
-
-	return 0;
-}
-
-arch_initcall(loongson3_platform_init);
-- 
2.20.1


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

* [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-04 11:00 [PATCH 0/2] some cleanup code Qing Zhang
  2021-03-04 11:00 ` [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members Qing Zhang
@ 2021-03-04 11:00 ` Qing Zhang
  2021-03-05  2:32   ` Jiaxun Yang
                     ` (3 more replies)
  1 sibling, 4 replies; 18+ messages in thread
From: Qing Zhang @ 2021-03-04 11:00 UTC (permalink / raw)
  To: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier
  Cc: linux-mips, linux-kernel

The purpose of separating loongson_system_configuration from boot_param.h
is to keep the other structure consistent with the firmware.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
---
 .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
 .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++
 drivers/irqchip/irq-loongson-liointc.c         |  2 +-
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
index 1c1cdf57137e..035b1a69e2d0 100644
--- a/arch/mips/include/asm/mach-loongson64/boot_param.h
+++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
@@ -198,24 +198,6 @@ enum loongson_bridge_type {
 	VIRTUAL = 3
 };
 
-struct loongson_system_configuration {
-	u32 nr_cpus;
-	u32 nr_nodes;
-	int cores_per_node;
-	int cores_per_package;
-	u16 boot_cpu_id;
-	u16 reserved_cpus_mask;
-	enum loongson_cpu_type cputype;
-	enum loongson_bridge_type bridgetype;
-	u64 restart_addr;
-	u64 poweroff_addr;
-	u64 suspend_addr;
-	u64 vgabios_addr;
-	u32 dma_mask_bits;
-	u64 workarounds;
-	void (*early_config)(void);
-};
-
 extern struct efi_memory_map_loongson *loongson_memmap;
 extern struct loongson_system_configuration loongson_sysconf;
 
diff --git a/arch/mips/include/asm/mach-loongson64/loongson.h b/arch/mips/include/asm/mach-loongson64/loongson.h
index ac1c20e172a2..6189deb188cf 100644
--- a/arch/mips/include/asm/mach-loongson64/loongson.h
+++ b/arch/mips/include/asm/mach-loongson64/loongson.h
@@ -12,6 +12,24 @@
 #include <linux/irq.h>
 #include <boot_param.h>
 
+/* machine-specific boot configuration */
+struct loongson_system_configuration {
+	u32 nr_cpus;
+	u32 nr_nodes;
+	int cores_per_node;
+	int cores_per_package;
+	u16 boot_cpu_id;
+	u16 reserved_cpus_mask;
+	enum loongson_cpu_type cputype;
+	enum loongson_bridge_type bridgetype;
+	u64 restart_addr;
+	u64 poweroff_addr;
+	u64 suspend_addr;
+	u64 vgabios_addr;
+	u32 dma_mask_bits;
+	u64 workarounds;
+	void (*early_config)(void);
+};
 
 /* machine-specific reboot/halt operation */
 extern void mach_prepare_reboot(void);
diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index 09b91b81851c..249566a23cc4 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -16,7 +16,7 @@
 #include <linux/smp.h>
 #include <linux/irqchip/chained_irq.h>
 
-#include <boot_param.h>
+#include <loongson.h>
 
 #define LIOINTC_CHIP_IRQ	32
 #define LIOINTC_NUM_PARENT 4
-- 
2.20.1


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

* Re: [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members
  2021-03-04 11:00 ` [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members Qing Zhang
@ 2021-03-05  2:32   ` Jiaxun Yang
  2021-03-06  3:18     ` zhangqing
  2021-03-12 10:28   ` Thomas Bogendoerfer
  1 sibling, 1 reply; 18+ messages in thread
From: Jiaxun Yang @ 2021-03-05  2:32 UTC (permalink / raw)
  To: Qing Zhang, Huacai Chen, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier
  Cc: linux-mips, linux-kernel



在 2021/3/4 下午7:00, Qing Zhang 写道:
> We don't need them anymore, They are uniform on all Loongson64 systems
> and have been fixed in DeviceTree.loongson3_platform_init is replaced
> with DTS + driver.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>

Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>

Hmm, why it comes with my sign-off?
I assue it's my patch somewhere off the tree?

Thanks.

- Jiaxun

> ---
>   .../include/asm/mach-loongson64/boot_param.h  |  9 ----
>   arch/mips/loongson64/Makefile                 |  2 +-
>   arch/mips/loongson64/env.c                    | 20 ---------
>   arch/mips/loongson64/platform.c               | 42 -------------------
>   4 files changed, 1 insertion(+), 72 deletions(-)
>   delete mode 100644 arch/mips/loongson64/platform.c
> 
> diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
> index 4592841b6b0c..1c1cdf57137e 100644
> --- a/arch/mips/include/asm/mach-loongson64/boot_param.h
> +++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
> @@ -207,20 +207,11 @@ struct loongson_system_configuration {
>   	u16 reserved_cpus_mask;
>   	enum loongson_cpu_type cputype;
>   	enum loongson_bridge_type bridgetype;
> -	u64 ht_control_base;
> -	u64 pci_mem_start_addr;
> -	u64 pci_mem_end_addr;
> -	u64 pci_io_base;
>   	u64 restart_addr;
>   	u64 poweroff_addr;
>   	u64 suspend_addr;
>   	u64 vgabios_addr;
>   	u32 dma_mask_bits;
> -	char ecname[32];
> -	u32 nr_uarts;
> -	struct uart_device uarts[MAX_UARTS];
> -	u32 nr_sensors;
> -	struct sensor_device sensors[MAX_SENSORS];
>   	u64 workarounds;
>   	void (*early_config)(void);
>   };
> diff --git a/arch/mips/loongson64/Makefile b/arch/mips/loongson64/Makefile
> index cc76944b1a9d..e806280bbb85 100644
> --- a/arch/mips/loongson64/Makefile
> +++ b/arch/mips/loongson64/Makefile
> @@ -2,7 +2,7 @@
>   #
>   # Makefile for Loongson-3 family machines
>   #
> -obj-$(CONFIG_MACH_LOONGSON64) += cop2-ex.o platform.o dma.o \
> +obj-$(CONFIG_MACH_LOONGSON64) += cop2-ex.o dma.o \
>   				setup.o init.o env.o time.o reset.o \
>   
>   obj-$(CONFIG_SMP)	+= smp.o
> diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
> index 51a5d050a94c..1821d461b606 100644
> --- a/arch/mips/loongson64/env.c
> +++ b/arch/mips/loongson64/env.c
> @@ -95,7 +95,6 @@ void __init prom_init_env(void)
>   		loongson_freqctrl[1] = 0x900010001fe001d0;
>   		loongson_freqctrl[2] = 0x900020001fe001d0;
>   		loongson_freqctrl[3] = 0x900030001fe001d0;
> -		loongson_sysconf.ht_control_base = 0x90000EFDFB000000;
>   		loongson_sysconf.workarounds = WORKAROUND_CPUFREQ;
>   		break;
>   	case Legacy_3B:
> @@ -118,7 +117,6 @@ void __init prom_init_env(void)
>   		loongson_freqctrl[1] = 0x900020001fe001d0;
>   		loongson_freqctrl[2] = 0x900040001fe001d0;
>   		loongson_freqctrl[3] = 0x900060001fe001d0;
> -		loongson_sysconf.ht_control_base = 0x90001EFDFB000000;
>   		loongson_sysconf.workarounds = WORKAROUND_CPUHOTPLUG;
>   		break;
>   	default:
> @@ -136,9 +134,6 @@ void __init prom_init_env(void)
>   		loongson_sysconf.cores_per_node - 1) /
>   		loongson_sysconf.cores_per_node;
>   
> -	loongson_sysconf.pci_mem_start_addr = eirq_source->pci_mem_start_addr;
> -	loongson_sysconf.pci_mem_end_addr = eirq_source->pci_mem_end_addr;
> -	loongson_sysconf.pci_io_base = eirq_source->pci_io_start_addr;
>   	loongson_sysconf.dma_mask_bits = eirq_source->dma_mask_bits;
>   	if (loongson_sysconf.dma_mask_bits < 32 ||
>   		loongson_sysconf.dma_mask_bits > 64)
> @@ -153,23 +148,8 @@ void __init prom_init_env(void)
>   		loongson_sysconf.poweroff_addr, loongson_sysconf.restart_addr,
>   		loongson_sysconf.vgabios_addr);
>   
> -	memset(loongson_sysconf.ecname, 0, 32);
> -	if (esys->has_ec)
> -		memcpy(loongson_sysconf.ecname, esys->ec_name, 32);
>   	loongson_sysconf.workarounds |= esys->workarounds;
>   
> -	loongson_sysconf.nr_uarts = esys->nr_uarts;
> -	if (esys->nr_uarts < 1 || esys->nr_uarts > MAX_UARTS)
> -		loongson_sysconf.nr_uarts = 1;
> -	memcpy(loongson_sysconf.uarts, esys->uarts,
> -		sizeof(struct uart_device) * loongson_sysconf.nr_uarts);
> -
> -	loongson_sysconf.nr_sensors = esys->nr_sensors;
> -	if (loongson_sysconf.nr_sensors > MAX_SENSORS)
> -		loongson_sysconf.nr_sensors = 0;
> -	if (loongson_sysconf.nr_sensors)
> -		memcpy(loongson_sysconf.sensors, esys->sensors,
> -			sizeof(struct sensor_device) * loongson_sysconf.nr_sensors);
>   	pr_info("CpuClock = %u\n", cpu_clock_freq);
>   
>   	/* Read the ID of PCI host bridge to detect bridge type */
> diff --git a/arch/mips/loongson64/platform.c b/arch/mips/loongson64/platform.c
> deleted file mode 100644
> index 9674ae1361a8..000000000000
> --- a/arch/mips/loongson64/platform.c
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * Copyright (C) 2009 Lemote Inc.
> - * Author: Wu Zhangjin, wuzhangjin@gmail.com
> - *         Xiang Yu, xiangy@lemote.com
> - *         Chen Huacai, chenhc@lemote.com
> - */
> -
> -#include <linux/err.h>
> -#include <linux/slab.h>
> -#include <linux/platform_device.h>
> -#include <asm/bootinfo.h>
> -#include <boot_param.h>
> -#include <loongson_hwmon.h>
> -#include <workarounds.h>
> -
> -static int __init loongson3_platform_init(void)
> -{
> -	int i;
> -	struct platform_device *pdev;
> -
> -	if (loongson_sysconf.ecname[0] != '\0')
> -		platform_device_register_simple(loongson_sysconf.ecname, -1, NULL, 0);
> -
> -	for (i = 0; i < loongson_sysconf.nr_sensors; i++) {
> -		if (loongson_sysconf.sensors[i].type > SENSOR_FAN)
> -			continue;
> -
> -		pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
> -		if (!pdev)
> -			return -ENOMEM;
> -
> -		pdev->name = loongson_sysconf.sensors[i].name;
> -		pdev->id = loongson_sysconf.sensors[i].id;
> -		pdev->dev.platform_data = &loongson_sysconf.sensors[i];
> -		platform_device_register(pdev);
> -	}
> -
> -	return 0;
> -}
> -
> -arch_initcall(loongson3_platform_init);
> 

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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-04 11:00 ` [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h Qing Zhang
@ 2021-03-05  2:32   ` Jiaxun Yang
  2021-03-05 10:01   ` Philippe Mathieu-Daudé
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 18+ messages in thread
From: Jiaxun Yang @ 2021-03-05  2:32 UTC (permalink / raw)
  To: Qing Zhang, Huacai Chen, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier
  Cc: linux-mips, linux-kernel



在 2021/3/4 下午7:00, Qing Zhang 写道:
> The purpose of separating loongson_system_configuration from boot_param.h
> is to keep the other structure consistent with the firmware.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>



Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>



- Jiaxun

> ---
>   .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
>   .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++
>   drivers/irqchip/irq-loongson-liointc.c         |  2 +-
>   3 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
> index 1c1cdf57137e..035b1a69e2d0 100644
> --- a/arch/mips/include/asm/mach-loongson64/boot_param.h
> +++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
> @@ -198,24 +198,6 @@ enum loongson_bridge_type {
>   	VIRTUAL = 3
>   };
>   
> -struct loongson_system_configuration {
> -	u32 nr_cpus;
> -	u32 nr_nodes;
> -	int cores_per_node;
> -	int cores_per_package;
> -	u16 boot_cpu_id;
> -	u16 reserved_cpus_mask;
> -	enum loongson_cpu_type cputype;
> -	enum loongson_bridge_type bridgetype;
> -	u64 restart_addr;
> -	u64 poweroff_addr;
> -	u64 suspend_addr;
> -	u64 vgabios_addr;
> -	u32 dma_mask_bits;
> -	u64 workarounds;
> -	void (*early_config)(void);
> -};
> -
>   extern struct efi_memory_map_loongson *loongson_memmap;
>   extern struct loongson_system_configuration loongson_sysconf;
>   
> diff --git a/arch/mips/include/asm/mach-loongson64/loongson.h b/arch/mips/include/asm/mach-loongson64/loongson.h
> index ac1c20e172a2..6189deb188cf 100644
> --- a/arch/mips/include/asm/mach-loongson64/loongson.h
> +++ b/arch/mips/include/asm/mach-loongson64/loongson.h
> @@ -12,6 +12,24 @@
>   #include <linux/irq.h>
>   #include <boot_param.h>
>   
> +/* machine-specific boot configuration */
> +struct loongson_system_configuration {
> +	u32 nr_cpus;
> +	u32 nr_nodes;
> +	int cores_per_node;
> +	int cores_per_package;
> +	u16 boot_cpu_id;
> +	u16 reserved_cpus_mask;
> +	enum loongson_cpu_type cputype;
> +	enum loongson_bridge_type bridgetype;
> +	u64 restart_addr;
> +	u64 poweroff_addr;
> +	u64 suspend_addr;
> +	u64 vgabios_addr;
> +	u32 dma_mask_bits;
> +	u64 workarounds;
> +	void (*early_config)(void);
> +};
>   
>   /* machine-specific reboot/halt operation */
>   extern void mach_prepare_reboot(void);
> diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
> index 09b91b81851c..249566a23cc4 100644
> --- a/drivers/irqchip/irq-loongson-liointc.c
> +++ b/drivers/irqchip/irq-loongson-liointc.c
> @@ -16,7 +16,7 @@
>   #include <linux/smp.h>
>   #include <linux/irqchip/chained_irq.h>
>   
> -#include <boot_param.h>
> +#include <loongson.h>
>   
>   #define LIOINTC_CHIP_IRQ	32
>   #define LIOINTC_NUM_PARENT 4
> 

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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-04 11:00 ` [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h Qing Zhang
  2021-03-05  2:32   ` Jiaxun Yang
@ 2021-03-05 10:01   ` Philippe Mathieu-Daudé
  2021-03-06  3:12     ` zhangqing
  2021-03-06  8:03   ` Thomas Bogendoerfer
  2021-03-12 10:28   ` Thomas Bogendoerfer
  3 siblings, 1 reply; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-05 10:01 UTC (permalink / raw)
  To: Qing Zhang
  Cc: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier, open list:BROADCOM NVRAM DRIVER, open list

Hi,

On Thu, Mar 4, 2021 at 5:35 PM Qing Zhang <zhangqing@loongson.cn> wrote:
>
> The purpose of separating loongson_system_configuration from boot_param.h
> is to keep the other structure consistent with the firmware.

This is supposed to be a trivial patch, but the description actually
confuses me.

Why is the move out of "boot_param.h" keeping it consistent with fw?

> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> ---
>  .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
>  .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++
>  drivers/irqchip/irq-loongson-liointc.c         |  2 +-
>  3 files changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
> index 1c1cdf57137e..035b1a69e2d0 100644
> --- a/arch/mips/include/asm/mach-loongson64/boot_param.h
> +++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
> @@ -198,24 +198,6 @@ enum loongson_bridge_type {
>         VIRTUAL = 3
>  };
>
> -struct loongson_system_configuration {
> -       u32 nr_cpus;
> -       u32 nr_nodes;
> -       int cores_per_node;
> -       int cores_per_package;
> -       u16 boot_cpu_id;
> -       u16 reserved_cpus_mask;
> -       enum loongson_cpu_type cputype;
> -       enum loongson_bridge_type bridgetype;
> -       u64 restart_addr;
> -       u64 poweroff_addr;
> -       u64 suspend_addr;
> -       u64 vgabios_addr;
> -       u32 dma_mask_bits;
> -       u64 workarounds;
> -       void (*early_config)(void);
> -};
> -
>  extern struct efi_memory_map_loongson *loongson_memmap;
>  extern struct loongson_system_configuration loongson_sysconf;
>
> diff --git a/arch/mips/include/asm/mach-loongson64/loongson.h b/arch/mips/include/asm/mach-loongson64/loongson.h
> index ac1c20e172a2..6189deb188cf 100644
> --- a/arch/mips/include/asm/mach-loongson64/loongson.h
> +++ b/arch/mips/include/asm/mach-loongson64/loongson.h
> @@ -12,6 +12,24 @@
>  #include <linux/irq.h>
>  #include <boot_param.h>
>
> +/* machine-specific boot configuration */
> +struct loongson_system_configuration {
> +       u32 nr_cpus;
> +       u32 nr_nodes;
> +       int cores_per_node;
> +       int cores_per_package;
> +       u16 boot_cpu_id;
> +       u16 reserved_cpus_mask;
> +       enum loongson_cpu_type cputype;
> +       enum loongson_bridge_type bridgetype;
> +       u64 restart_addr;
> +       u64 poweroff_addr;
> +       u64 suspend_addr;
> +       u64 vgabios_addr;
> +       u32 dma_mask_bits;
> +       u64 workarounds;
> +       void (*early_config)(void);
> +};
>
>  /* machine-specific reboot/halt operation */
>  extern void mach_prepare_reboot(void);
> diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
> index 09b91b81851c..249566a23cc4 100644
> --- a/drivers/irqchip/irq-loongson-liointc.c
> +++ b/drivers/irqchip/irq-loongson-liointc.c
> @@ -16,7 +16,7 @@
>  #include <linux/smp.h>
>  #include <linux/irqchip/chained_irq.h>
>
> -#include <boot_param.h>
> +#include <loongson.h>
>
>  #define LIOINTC_CHIP_IRQ       32
>  #define LIOINTC_NUM_PARENT 4
> --
> 2.20.1
>

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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-05 10:01   ` Philippe Mathieu-Daudé
@ 2021-03-06  3:12     ` zhangqing
  0 siblings, 0 replies; 18+ messages in thread
From: zhangqing @ 2021-03-06  3:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier, open list:BROADCOM NVRAM DRIVER, open list



On 03/05/2021 06:01 PM, Philippe Mathieu-Daudé wrote:
> Hi,
>
> On Thu, Mar 4, 2021 at 5:35 PM Qing Zhang <zhangqing@loongson.cn> wrote:
>> The purpose of separating loongson_system_configuration from boot_param.h
>> is to keep the other structure consistent with the firmware.
> This is supposed to be a trivial patch, but the description actually
> confuses me.
>
> Why is the move out of "boot_param.h" keeping it consistent with fw?
Hi, PhilippeMathieu-Daudé

Thank you for your reply.

The boot_param.h file must be consistent in the kernel and the firmware 
pmon/cmds/bootparam.h
In env.c, the loongson_system_configuration structure member gets the 
value passed to the firmware.
eg:
struct boot_params *boot_p;

          loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm;
          loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown;
          loongson_sysconf.suspend_addr = boot_p->reset_system.DoSuspend;

The boot_params structure is consistent with the firmware,
The loongson_system_configuration is filled in the kernel, and there is 
no such structure in pmon-loongson3, it is actually defined in the kernel.

So, remove its definition from boot_param.h.

Thanks,
Qing



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

* Re: [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members
  2021-03-05  2:32   ` Jiaxun Yang
@ 2021-03-06  3:18     ` zhangqing
  0 siblings, 0 replies; 18+ messages in thread
From: zhangqing @ 2021-03-06  3:18 UTC (permalink / raw)
  To: Jiaxun Yang, Huacai Chen, Thomas Bogendoerfer, Thomas Gleixner,
	Marc Zyngier
  Cc: linux-mips, linux-kernel



On 03/05/2021 10:32 AM, Jiaxun Yang wrote:
>
>
> 在 2021/3/4 下午7:00, Qing Zhang 写道:
>> We don't need them anymore, They are uniform on all Loongson64 systems
>> and have been fixed in DeviceTree.loongson3_platform_init is replaced
>> with DTS + driver.
>>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
>
> Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>
> Hmm, why it comes with my sign-off?
> I assue it's my patch somewhere off the tree?
Hi, Jiaxun

Thank you very much for your reply.

Yes, it is like this.out of tree provides good ideas, and clean up 
others by the way.

Thanks,
Qing

>
> Thanks.
>
> - Jiaxun
>


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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-04 11:00 ` [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h Qing Zhang
  2021-03-05  2:32   ` Jiaxun Yang
  2021-03-05 10:01   ` Philippe Mathieu-Daudé
@ 2021-03-06  8:03   ` Thomas Bogendoerfer
  2021-03-06  8:57     ` zhangqing
  2021-03-06  9:00     ` Jiaxun Yang
  2021-03-12 10:28   ` Thomas Bogendoerfer
  3 siblings, 2 replies; 18+ messages in thread
From: Thomas Bogendoerfer @ 2021-03-06  8:03 UTC (permalink / raw)
  To: Qing Zhang
  Cc: Huacai Chen, Jiaxun Yang, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel

On Thu, Mar 04, 2021 at 07:00:57PM +0800, Qing Zhang wrote:
> The purpose of separating loongson_system_configuration from boot_param.h
> is to keep the other structure consistent with the firmware.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> ---
>  .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
>  .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++

as you are already touching mach-loongson64 files...

Is there a chance you clean up that up even further ? My goal is to
have only files in mach-<platform> files, which have an mach-generic
counterpart. Everything else should go to its own directory. So in
case of loongson something

like

arch/mips/include/asm/loongson		for common stuff
arch/mips/include/asm/loongson/32
arch/mips/include/asm/loongson/64

Comments ?

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] 18+ messages in thread

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-06  8:03   ` Thomas Bogendoerfer
@ 2021-03-06  8:57     ` zhangqing
  2021-03-09 10:42       ` Thomas Bogendoerfer
  2021-03-06  9:00     ` Jiaxun Yang
  1 sibling, 1 reply; 18+ messages in thread
From: zhangqing @ 2021-03-06  8:57 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Huacai Chen, Jiaxun Yang, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel



On 03/06/2021 04:03 PM, Thomas Bogendoerfer wrote:
> as you are already touching mach-loongson64 files...
>
> Is there a chance you clean up that up even further ? My goal is to
> have only files in mach-<platform> files, which have an mach-generic
> counterpart. Everything else should go to its own directory. So in
> case of loongson something
>
> like
>
> arch/mips/include/asm/loongson		for common stuff
> arch/mips/include/asm/loongson/32
> arch/mips/include/asm/loongson/64
>
> Comments ?

Hi,Thomas

I am very interested in cleaning up.
Can you merge these two patches first?
Submitting the remaining patches after other clean-up work is completed,
it seems that the impact will not be significant.

Thanks
Qing

>
> Thomas.


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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-06  8:03   ` Thomas Bogendoerfer
  2021-03-06  8:57     ` zhangqing
@ 2021-03-06  9:00     ` Jiaxun Yang
  2021-03-06  9:53       ` Thomas Bogendoerfer
  1 sibling, 1 reply; 18+ messages in thread
From: Jiaxun Yang @ 2021-03-06  9:00 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Qing Zhang
  Cc: Huacai Chen, Thomas Gleixner, Marc Zyngier, linux-mips, linux-kernel



On Sat, Mar 6, 2021, at 4:03 PM, Thomas Bogendoerfer wrote:
> On Thu, Mar 04, 2021 at 07:00:57PM +0800, Qing Zhang wrote:
> > The purpose of separating loongson_system_configuration from boot_param.h
> > is to keep the other structure consistent with the firmware.
> > 
> > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> > ---
> >  .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
> >  .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++
> 
> as you are already touching mach-loongson64 files...
> 
> Is there a chance you clean up that up even further ? My goal is to
> have only files in mach-<platform> files, which have an mach-generic
> counterpart. Everything else should go to its own directory. So in
> case of loongson something
> 
> like
> 
> arch/mips/include/asm/loongson		for common stuff
> arch/mips/include/asm/loongson/32
> arch/mips/include/asm/loongson/64

Hi Thomas

I'm object to this idea as loongson32/2ef/64 have nothing in common.

They're different cores and different SoC designed by different team with different booting protocol.

Maybe it's possible to merge loongson32 into generic platform but my LS1C borad is broken...

Thanks.

- Jiaxun

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

-- 
- Jiaxun

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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-06  9:00     ` Jiaxun Yang
@ 2021-03-06  9:53       ` Thomas Bogendoerfer
  2021-03-06 10:55         ` Jiaxun Yang
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Bogendoerfer @ 2021-03-06  9:53 UTC (permalink / raw)
  To: Jiaxun Yang
  Cc: Qing Zhang, Huacai Chen, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel

On Sat, Mar 06, 2021 at 05:00:15PM +0800, Jiaxun Yang wrote:
> 
> 
> On Sat, Mar 6, 2021, at 4:03 PM, Thomas Bogendoerfer wrote:
> > On Thu, Mar 04, 2021 at 07:00:57PM +0800, Qing Zhang wrote:
> > > The purpose of separating loongson_system_configuration from boot_param.h
> > > is to keep the other structure consistent with the firmware.
> > > 
> > > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > > Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> > > ---
> > >  .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
> > >  .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++
> > 
> > as you are already touching mach-loongson64 files...
> > 
> > Is there a chance you clean up that up even further ? My goal is to
> > have only files in mach-<platform> files, which have an mach-generic
> > counterpart. Everything else should go to its own directory. So in
> > case of loongson something
> > 
> > like
> > 
> > arch/mips/include/asm/loongson		for common stuff
> > arch/mips/include/asm/loongson/32
> > arch/mips/include/asm/loongson/64
> 
> Hi Thomas
> 
> I'm object to this idea as loongson32/2ef/64 have nothing in common.

at least they share the name loongson, so having

arch/mips/include/asm/loongson

sounds like a good move.

And seeing 

diff -u mach-loongson2ef/ mach-loongson64/loongson.h  | diffstat
 loongson.h |  137 +++++++++++++------------------------------------------------
 1 file changed, 30 insertions(+), 107 deletions(-)

wc mach-loongson2ef/loongson.h 
  318   963 11278 mach-loongson2ef/loongson.h

so there is something to shared. To me it looks like 2ef could be merged
into 64, but that's nothing I'm wanting.

Just to understand you, you want

arch/mips/include/asm/loongson/2ef
arch/mips/include/asm/loongson/32
arch/mips/include/asm/loongson/64

?

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] 18+ messages in thread

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-06  9:53       ` Thomas Bogendoerfer
@ 2021-03-06 10:55         ` Jiaxun Yang
  2021-03-08  9:49           ` Thomas Bogendoerfer
  0 siblings, 1 reply; 18+ messages in thread
From: Jiaxun Yang @ 2021-03-06 10:55 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Qing Zhang, Huacai Chen, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel



On Sat, Mar 6, 2021, at 5:53 PM, Thomas Bogendoerfer wrote:
> On Sat, Mar 06, 2021 at 05:00:15PM +0800, Jiaxun Yang wrote:
> > 
> > 
> > On Sat, Mar 6, 2021, at 4:03 PM, Thomas Bogendoerfer wrote:
> > > On Thu, Mar 04, 2021 at 07:00:57PM +0800, Qing Zhang wrote:
> > > > The purpose of separating loongson_system_configuration from boot_param.h
> > > > is to keep the other structure consistent with the firmware.
> > > > 
> > > > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > > > Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> > > > ---
> > > >  .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
> > > >  .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++
> > > 
> > > as you are already touching mach-loongson64 files...
> > > 
> > > Is there a chance you clean up that up even further ? My goal is to
> > > have only files in mach-<platform> files, which have an mach-generic
> > > counterpart. Everything else should go to its own directory. So in
> > > case of loongson something
> > > 
> > > like
> > > 
> > > arch/mips/include/asm/loongson		for common stuff
> > > arch/mips/include/asm/loongson/32
> > > arch/mips/include/asm/loongson/64
> > 
> > Hi Thomas
> > 
> > I'm object to this idea as loongson32/2ef/64 have nothing in common.
> 
> at least they share the name loongson, so having
> 
> arch/mips/include/asm/loongson
> 
> sounds like a good move.
> 
> And seeing 
> 
> diff -u mach-loongson2ef/ mach-loongson64/loongson.h  | diffstat
>  loongson.h |  137 +++++++++++++------------------------------------------------
>  1 file changed, 30 insertions(+), 107 deletions(-)
> 
> wc mach-loongson2ef/loongson.h 
>   318   963 11278 mach-loongson2ef/loongson.h
> 
> so there is something to shared. To me it looks like 2ef could be merged
> into 64, but that's nothing I'm wanting.

Hmm there are duplications in loongson.h just because we didn't clean them up when splitting loongson2ef out of loongson64.

> 
> Just to understand you, you want
> 
> arch/mips/include/asm/loongson/2ef
> arch/mips/include/asm/loongson/32
> arch/mips/include/asm/loongson/64

Yeah it looks reasonable but from my point of view doing these movement brings no actual benefit :-(

Thanks.

- Jiaxun

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

-- 
- Jiaxun

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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-06 10:55         ` Jiaxun Yang
@ 2021-03-08  9:49           ` Thomas Bogendoerfer
  2021-03-09 14:48             ` Jiaxun Yang
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Bogendoerfer @ 2021-03-08  9:49 UTC (permalink / raw)
  To: Jiaxun Yang
  Cc: Qing Zhang, Huacai Chen, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel

On Sat, Mar 06, 2021 at 06:55:41PM +0800, Jiaxun Yang wrote:
> 
> 
> On Sat, Mar 6, 2021, at 5:53 PM, Thomas Bogendoerfer wrote:
> [...]
> > Just to understand you, you want
> > 
> > arch/mips/include/asm/loongson/2ef
> > arch/mips/include/asm/loongson/32
> > arch/mips/include/asm/loongson/64
> 
> Yeah it looks reasonable but from my point of view doing these movement
> brings no actual benefit :-(

oh it does for sure. There will no more build errors for non loogson
configs for things like

#include <loongson_regs.h>

because it will not work for loongson either. And it will be clear,
which of the 3 loongson.h is used. Which then gives chances for even
more cleanups.

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] 18+ messages in thread

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-06  8:57     ` zhangqing
@ 2021-03-09 10:42       ` Thomas Bogendoerfer
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Bogendoerfer @ 2021-03-09 10:42 UTC (permalink / raw)
  To: zhangqing
  Cc: Huacai Chen, Jiaxun Yang, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel

On Sat, Mar 06, 2021 at 04:57:30PM +0800, zhangqing wrote:
> 
> 
> On 03/06/2021 04:03 PM, Thomas Bogendoerfer wrote:
> > as you are already touching mach-loongson64 files...
> > 
> > Is there a chance you clean up that up even further ? My goal is to
> > have only files in mach-<platform> files, which have an mach-generic
> > counterpart. Everything else should go to its own directory. So in
> > case of loongson something
> > 
> > like
> > 
> > arch/mips/include/asm/loongson		for common stuff
> > arch/mips/include/asm/loongson/32
> > arch/mips/include/asm/loongson/64
> > 
> > Comments ?
> 
> Hi,Thomas
> 
> I am very interested in cleaning up.
> Can you merge these two patches first?

yes, I'll just want to get fixes for 5.12 done before restarting applying
mips-next stuff.

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] 18+ messages in thread

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-08  9:49           ` Thomas Bogendoerfer
@ 2021-03-09 14:48             ` Jiaxun Yang
  0 siblings, 0 replies; 18+ messages in thread
From: Jiaxun Yang @ 2021-03-09 14:48 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Qing Zhang, Huacai Chen, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel



在 2021/3/8 17:49, Thomas Bogendoerfer 写道:
> On Sat, Mar 06, 2021 at 06:55:41PM +0800, Jiaxun Yang wrote:
>>
>> On Sat, Mar 6, 2021, at 5:53 PM, Thomas Bogendoerfer wrote:
>> [...]
>>> Just to understand you, you want
>>>
>>> arch/mips/include/asm/loongson/2ef
>>> arch/mips/include/asm/loongson/32
>>> arch/mips/include/asm/loongson/64
>> Yeah it looks reasonable but from my point of view doing these movement
>> brings no actual benefit :-(
> oh it does for sure. There will no more build errors for non loogson
> configs for things like
>
> #include <loongson_regs.h>

It should be loongson64_regs.h then....

>
> because it will not work for loongson either. And it will be clear,
> which of the 3 loongson.h is used. Which then gives chances for even
> more cleanups.

Ahh, got your point. Probably we should rename all these loongson.h
as they should be indepedent.

Thanks.

- Jiaxun

>
> Thomas.
>


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

* Re: [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members
  2021-03-04 11:00 ` [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members Qing Zhang
  2021-03-05  2:32   ` Jiaxun Yang
@ 2021-03-12 10:28   ` Thomas Bogendoerfer
  1 sibling, 0 replies; 18+ messages in thread
From: Thomas Bogendoerfer @ 2021-03-12 10:28 UTC (permalink / raw)
  To: Qing Zhang
  Cc: Huacai Chen, Jiaxun Yang, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel

On Thu, Mar 04, 2021 at 07:00:56PM +0800, Qing Zhang wrote:
> We don't need them anymore, They are uniform on all Loongson64 systems
> and have been fixed in DeviceTree.loongson3_platform_init is replaced
> with DTS + driver.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> ---
>  .../include/asm/mach-loongson64/boot_param.h  |  9 ----
>  arch/mips/loongson64/Makefile                 |  2 +-
>  arch/mips/loongson64/env.c                    | 20 ---------
>  arch/mips/loongson64/platform.c               | 42 -------------------
>  4 files changed, 1 insertion(+), 72 deletions(-)
>  delete mode 100644 arch/mips/loongson64/platform.c

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 ]

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

* Re: [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h
  2021-03-04 11:00 ` [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h Qing Zhang
                     ` (2 preceding siblings ...)
  2021-03-06  8:03   ` Thomas Bogendoerfer
@ 2021-03-12 10:28   ` Thomas Bogendoerfer
  3 siblings, 0 replies; 18+ messages in thread
From: Thomas Bogendoerfer @ 2021-03-12 10:28 UTC (permalink / raw)
  To: Qing Zhang
  Cc: Huacai Chen, Jiaxun Yang, Thomas Gleixner, Marc Zyngier,
	linux-mips, linux-kernel

On Thu, Mar 04, 2021 at 07:00:57PM +0800, Qing Zhang wrote:
> The purpose of separating loongson_system_configuration from boot_param.h
> is to keep the other structure consistent with the firmware.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> ---
>  .../include/asm/mach-loongson64/boot_param.h   | 18 ------------------
>  .../include/asm/mach-loongson64/loongson.h     | 18 ++++++++++++++++++
>  drivers/irqchip/irq-loongson-liointc.c         |  2 +-
>  3 files changed, 19 insertions(+), 19 deletions(-)

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 ]

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

end of thread, other threads:[~2021-03-12 10:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 11:00 [PATCH 0/2] some cleanup code Qing Zhang
2021-03-04 11:00 ` [PATCH 1/2] MIPS: Loongson64: Remove unused sysconf members Qing Zhang
2021-03-05  2:32   ` Jiaxun Yang
2021-03-06  3:18     ` zhangqing
2021-03-12 10:28   ` Thomas Bogendoerfer
2021-03-04 11:00 ` [PATCH 2/2] MIPS: Loongson64: Move loongson_system_configuration to loongson.h Qing Zhang
2021-03-05  2:32   ` Jiaxun Yang
2021-03-05 10:01   ` Philippe Mathieu-Daudé
2021-03-06  3:12     ` zhangqing
2021-03-06  8:03   ` Thomas Bogendoerfer
2021-03-06  8:57     ` zhangqing
2021-03-09 10:42       ` Thomas Bogendoerfer
2021-03-06  9:00     ` Jiaxun Yang
2021-03-06  9:53       ` Thomas Bogendoerfer
2021-03-06 10:55         ` Jiaxun Yang
2021-03-08  9:49           ` Thomas Bogendoerfer
2021-03-09 14:48             ` Jiaxun Yang
2021-03-12 10:28   ` Thomas Bogendoerfer

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).