Hi,
Changes since V1:
- the get_system_type() now will simply return the "system_type"
variable if non-NULL, and the various boards can set this pointer
should they want to set a custom value. The .get_system_type
callback that v1 added to the struct mips_machine is gone.
- the board-ingenic.c has been modified accordingly.
- patch [06/13] is new, it makes sure that the kernel's command line is
initialized properly and includes the parameters passed by the
bootloader.
- the cu1830-neo board defconfig has now been regenerated in patch
[12/13].
Cheers,
-Paul
Paul Cercueil (13):
MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA
MIPS: cpu-probe: Mark XBurst CPU as having vtagged caches
MIPS: cpu-probe: ingenic: Fix broken BUG_ON
MIPS: Kconfig: add MIPS_GENERIC_KERNEL symbol
MIPS: generic: Allow boards to set system type
MIPS: generic: Init command line with fw_init_cmdline()
MIPS: generic: Support booting with built-in or appended DTB
MIPS: generic: Add support for zboot
MIPS: generic: Increase NR_IRQS to 256
MIPS: generic: Add support for Ingenic SoCs
MIPS: jz4740: Drop folder
MIPS: configs: Regenerate configs of Ingenic boards
MAINTAINERS: Update paths to Ingenic platform code
MAINTAINERS | 4 +-
arch/mips/Kbuild.platforms | 1 -
arch/mips/Kconfig | 43 ++++--
arch/mips/configs/ci20_defconfig | 4 +-
arch/mips/configs/cu1000-neo_defconfig | 16 +-
arch/mips/configs/cu1830-neo_defconfig | 15 +-
arch/mips/configs/gcw0_defconfig | 2 +-
arch/mips/configs/qi_lb60_defconfig | 5 +-
arch/mips/configs/rs90_defconfig | 4 +-
arch/mips/generic/Kconfig | 8 +-
arch/mips/generic/Makefile | 1 +
arch/mips/generic/Platform | 1 +
arch/mips/generic/board-ingenic.c | 108 +++++++++++++
arch/mips/generic/init.c | 11 +-
arch/mips/generic/proc.c | 5 +
arch/mips/include/asm/mach-generic/irq.h | 2 +-
.../asm/mach-jz4740/cpu-feature-overrides.h | 50 ------
arch/mips/include/asm/mach-jz4740/irq.h | 13 --
arch/mips/include/asm/pgtable-bits.h | 5 -
arch/mips/{jz4740 => ingenic}/Kconfig | 16 +-
arch/mips/jz4740/Makefile | 9 --
arch/mips/jz4740/Platform | 3 -
arch/mips/jz4740/setup.c | 145 ------------------
arch/mips/kernel/cpu-probe.c | 8 +-
24 files changed, 186 insertions(+), 293 deletions(-)
create mode 100644 arch/mips/generic/board-ingenic.c
delete mode 100644 arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
delete mode 100644 arch/mips/include/asm/mach-jz4740/irq.h
rename arch/mips/{jz4740 => ingenic}/Kconfig (91%)
delete mode 100644 arch/mips/jz4740/Makefile
delete mode 100644 arch/mips/jz4740/Platform
delete mode 100644 arch/mips/jz4740/setup.c
--
2.28.0
XBurst CPUs present in Ingenic SoCs have virtually tagged caches,
according to the <cpu-features-override.h> header.
Add that information to cpu_probe_ingenic().
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/kernel/cpu-probe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index a18f3611fa5e..a07e66a6e063 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -2125,6 +2125,9 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
c->options &= ~MIPS_CPU_COUNTER;
BUG_ON(!__builtin_constant_p(cpu_has_counter) || cpu_has_counter);
+ /* XBurst has virtually tagged icache */
+ c->icache.flags |= MIPS_CACHE_VTAG;
+
switch (c->processor_id & PRID_IMP_MASK) {
/* XBurst®1 with MXU1.0/MXU1.1 SIMD ISA */
--
2.28.0
The previous code was doing:
BUG_ON(!__builtin_constant_p(cpu_has_counter) || cpu_has_counter);
This only worked as the "cpu_has_counter" macro was overridden in
<cpu-feature-overrides.h>. The default "cpu_has_counter" macro is
non-constant, which triggered the BUG_ON() independently of the value
returned by the macro.
What we want to check here, is that *if* the macro was overridden to a
compile-time constant, then must be defined to zero, otherwise it's a
bug.
So the correct check is:
BUG_ON(__builtin_constant_p(cpu_has_counter) && cpu_has_counter);
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/kernel/cpu-probe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index a07e66a6e063..6be23f205e74 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -2123,7 +2123,7 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
/* XBurst does not implement the CP0 counter. */
c->options &= ~MIPS_CPU_COUNTER;
- BUG_ON(!__builtin_constant_p(cpu_has_counter) || cpu_has_counter);
+ BUG_ON(__builtin_constant_p(cpu_has_counter) && cpu_has_counter);
/* XBurst has virtually tagged icache */
c->icache.flags |= MIPS_CACHE_VTAG;
--
2.28.0
The MIPS_GENERIC symbol now won't select any other configuration option.
The MIPS_GENERIC_KERNEL will select all the options that the previous
MIPS_GENERIC option did select, and will select MIPS_GENERIC as well.
The whole point of this, is that it now becomes possible to compile a
kernel for a SoC supported by the arch/mips/generic/ code, without
making that kernel generic itself.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/Kconfig | 8 ++++++--
arch/mips/generic/Kconfig | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 880680c0df31..8d146794de1e 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -94,14 +94,18 @@ config MIPS
config MIPS_FIXUP_BIGPHYS_ADDR
bool
+config MIPS_GENERIC
+ bool
+
menu "Machine selection"
choice
prompt "System type"
- default MIPS_GENERIC
+ default MIPS_GENERIC_KERNEL
-config MIPS_GENERIC
+config MIPS_GENERIC_KERNEL
bool "Generic board-agnostic MIPS kernel"
+ select MIPS_GENERIC
select BOOT_RAW
select BUILTIN_DTB
select CEVT_R4K
diff --git a/arch/mips/generic/Kconfig b/arch/mips/generic/Kconfig
index fd6019802657..5216c850b7e2 100644
--- a/arch/mips/generic/Kconfig
+++ b/arch/mips/generic/Kconfig
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
-if MIPS_GENERIC
+if MIPS_GENERIC_KERNEL
config LEGACY_BOARDS
bool
--
2.28.0
Previously, in cpu_probe_ingenic(), c->writecombine was set to
_CACHE_UNCACHED_ACCELERATED, but this macro was defined differently when
CONFIG_MACH_INGENIC was set. This made it impossible to support multiple
CPUs.
Address this issue by setting c->writecombine to _CACHE_CACHABLE_WA
directly and removing the dependency on CONFIG_MACH_INGENIC.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/include/asm/pgtable-bits.h | 5 -----
arch/mips/kernel/cpu-probe.c | 3 ++-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index e26dc41a8a68..2362842ee2b5 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -249,11 +249,6 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT)
-#elif defined(CONFIG_MACH_INGENIC)
-
-/* Ingenic uses the WA bit to achieve write-combine memory writes */
-#define _CACHE_UNCACHED_ACCELERATED (1<<_CACHE_SHIFT)
-
#endif
#ifndef _CACHE_CACHABLE_NO_WA
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index e2955f1f6316..a18f3611fa5e 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -2169,8 +2169,9 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
/* XBurst®1 with MXU2.0 SIMD ISA */
case PRID_IMP_XBURST_REV2:
+ /* Ingenic uses the WA bit to achieve write-combine memory writes */
+ c->writecombine = _CACHE_CACHABLE_WA;
c->cputype = CPU_XBURST;
- c->writecombine = _CACHE_UNCACHED_ACCELERATED;
__cpu_name[cpu] = "Ingenic XBurst";
break;
--
2.28.0
Check for the (already existing) "system_type" variable in the
get_system_type() function. If non-NULL, return it as the system type.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: Instead of adding a .get_system_type callback to the mips_machine
struct, the boards now simply override the "system_type" variable
when they want to set a custom one.
arch/mips/generic/proc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/mips/generic/proc.c b/arch/mips/generic/proc.c
index 4c992809cc3f..cce2fde219a3 100644
--- a/arch/mips/generic/proc.c
+++ b/arch/mips/generic/proc.c
@@ -8,11 +8,16 @@
#include <asm/bootinfo.h>
+char *system_type;
+
const char *get_system_type(void)
{
const char *str;
int err;
+ if (system_type)
+ return system_type;
+
err = of_property_read_string(of_root, "model", &str);
if (!err)
return str;
--
2.28.0
The function bootcmdline_init() in arch/mips/kernel/setup.c will
populate the boot_command_line string using the parameters hardcoded in
the kernel, and those provided in the devicetree file. Then, it would
append the content of the arcs_cmdline variable, which is filled by the
board's plat_mem_setup() function.
The plat_mem_setup() function for the generic MIPS board would just copy
the current boot_command_line to arcs_cmdline, which is nonsense for two
reasons:
- the result will be appended to the boot_command_line anyway, so all it
does is duplicate every single parameter on the command line;
- the code did not perform at all what it's supposed to, which is to
retrieve the parameters passed by the bootloader.
Fix this by calling fw_init_cmdline() in plat_mem_setup(), which will
properly initialize arcs_cmdline to the parameters passed by the
bootloader.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: New patch
arch/mips/generic/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
index 805d0135a9f4..029f47ea390c 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -106,7 +106,7 @@ void __init plat_mem_setup(void)
if (mach && mach->fixup_fdt)
fdt = mach->fixup_fdt(fdt, mach_match_data);
- strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
+ fw_init_cmdline();
__dt_setup_arch((void *)fdt);
}
--
2.28.0
The plat_get_fdt() checked that the kernel was booted using UHI before
reading the 'fw_passed_dtb' variable. However, this variable is also set
when the kernel has been appended, or when it has been built into the
kernel.
Support these usecases by removing the UHI check.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/generic/init.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
index 029f47ea390c..66a19337d2ab 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -39,12 +39,11 @@ void __init *plat_get_fdt(void)
/* Already set up */
return (void *)fdt;
- if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_passed_dtb)) {
+ if (fw_passed_dtb && !fdt_check_header((void *)fw_passed_dtb)) {
/*
- * We booted using the UHI boot protocol, so we have been
- * provided with the appropriate device tree for the board.
- * Make use of it & search for any machine struct based upon
- * the root compatible string.
+ * We have been provided with the appropriate device tree for
+ * the board. Make use of it & search for any machine struct
+ * based upon the root compatible string.
*/
fdt = (void *)fw_passed_dtb;
--
2.28.0
There is no reason we can't create compressed kernels here, so select
the option SYS_SUPPORTS_ZBOOT.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/Kconfig | 1 +
arch/mips/generic/Platform | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8d146794de1e..4d57f46cd936 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -142,6 +142,7 @@ config MIPS_GENERIC_KERNEL
select SYS_SUPPORTS_MULTITHREADING
select SYS_SUPPORTS_RELOCATABLE
select SYS_SUPPORTS_SMARTMIPS
+ select SYS_SUPPORTS_ZBOOT
select UHI_BOOT
select USB_EHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN
select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
diff --git a/arch/mips/generic/Platform b/arch/mips/generic/Platform
index 53c33cb72974..4cefecf7d14b 100644
--- a/arch/mips/generic/Platform
+++ b/arch/mips/generic/Platform
@@ -10,6 +10,7 @@
cflags-$(CONFIG_MIPS_GENERIC) += -I$(srctree)/arch/mips/include/asm/mach-generic
load-$(CONFIG_MIPS_GENERIC) += 0xffffffff80100000
+zload-$(CONFIG_MIPS_GENERIC) += 0xffffffff81000000
all-$(CONFIG_MIPS_GENERIC) := vmlinux.gz.itb
its-y := vmlinux.its.S
--
2.28.0
128 IRQs is not enough to support Ingenic SoCs.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/include/asm/mach-generic/irq.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/mach-generic/irq.h b/arch/mips/include/asm/mach-generic/irq.h
index 72ac2c202c55..079889ced4f3 100644
--- a/arch/mips/include/asm/mach-generic/irq.h
+++ b/arch/mips/include/asm/mach-generic/irq.h
@@ -9,7 +9,7 @@
#define __ASM_MACH_GENERIC_IRQ_H
#ifndef NR_IRQS
-#define NR_IRQS 128
+#define NR_IRQS 256
#endif
#ifdef CONFIG_I8259
--
2.28.0
Support for Ingenic SoCs is now provided by the arch/mips/generic/ code,
so the arch/mips/jz4740/ folder can be completely dropped. The exception
is the Kconfig, which has been moved to arch/mips/ingenic/Kconfig in the
process.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
arch/mips/Kconfig | 2 +-
.../asm/mach-jz4740/cpu-feature-overrides.h | 50 ------
arch/mips/include/asm/mach-jz4740/irq.h | 13 --
arch/mips/{jz4740 => ingenic}/Kconfig | 0
arch/mips/jz4740/Makefile | 9 --
arch/mips/jz4740/Platform | 3 -
arch/mips/jz4740/setup.c | 145 ------------------
7 files changed, 1 insertion(+), 221 deletions(-)
delete mode 100644 arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
delete mode 100644 arch/mips/include/asm/mach-jz4740/irq.h
rename arch/mips/{jz4740 => ingenic}/Kconfig (100%)
delete mode 100644 arch/mips/jz4740/Makefile
delete mode 100644 arch/mips/jz4740/Platform
delete mode 100644 arch/mips/jz4740/setup.c
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 5b7c7c87f9b2..a4bfb95cc2a2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1037,8 +1037,8 @@ source "arch/mips/bcm47xx/Kconfig"
source "arch/mips/bcm63xx/Kconfig"
source "arch/mips/bmips/Kconfig"
source "arch/mips/generic/Kconfig"
+source "arch/mips/ingenic/Kconfig"
source "arch/mips/jazz/Kconfig"
-source "arch/mips/jz4740/Kconfig"
source "arch/mips/lantiq/Kconfig"
source "arch/mips/pic32/Kconfig"
source "arch/mips/pistachio/Kconfig"
diff --git a/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h b/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
deleted file mode 100644
index 7c5e576f9d96..000000000000
--- a/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-#ifndef __ASM_MACH_JZ4740_CPU_FEATURE_OVERRIDES_H
-#define __ASM_MACH_JZ4740_CPU_FEATURE_OVERRIDES_H
-
-#define cpu_has_tlb 1
-#define cpu_has_4kex 1
-#define cpu_has_3k_cache 0
-#define cpu_has_4k_cache 1
-#define cpu_has_tx39_cache 0
-#define cpu_has_counter 0
-#define cpu_has_watch 1
-#define cpu_has_divec 1
-#define cpu_has_vce 0
-#define cpu_has_cache_cdex_p 0
-#define cpu_has_cache_cdex_s 0
-#define cpu_has_prefetch 1
-#define cpu_has_mcheck 1
-#define cpu_has_ejtag 1
-#define cpu_has_llsc 1
-#define cpu_has_mips16 0
-#define cpu_has_mips16e2 0
-#define cpu_has_mdmx 0
-#define cpu_has_mips3d 0
-#define cpu_has_smartmips 0
-#define kernel_uses_llsc 1
-#define cpu_has_vtag_icache 1
-#define cpu_has_dc_aliases 0
-#define cpu_has_ic_fills_f_dc 0
-#define cpu_has_pindexed_dcache 0
-#define cpu_has_mips32r1 1
-#define cpu_has_mips64r1 0
-#define cpu_has_mips64r2 0
-#define cpu_has_dsp 0
-#define cpu_has_dsp2 0
-#define cpu_has_mipsmt 0
-#define cpu_has_userlocal 0
-#define cpu_has_nofpuex 0
-#define cpu_has_64bits 0
-#define cpu_has_64bit_zero_reg 0
-#define cpu_has_inclusive_pcaches 0
-
-#define cpu_dcache_line_size() 32
-#define cpu_icache_line_size() 32
-
-#endif
diff --git a/arch/mips/include/asm/mach-jz4740/irq.h b/arch/mips/include/asm/mach-jz4740/irq.h
deleted file mode 100644
index 27c543bd340f..000000000000
--- a/arch/mips/include/asm/mach-jz4740/irq.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Copyright (C) 2009-2010, Lars-Peter Clausen <[email protected]>
- * JZ4740 IRQ definitions
- */
-
-#ifndef __ASM_MACH_JZ4740_IRQ_H__
-#define __ASM_MACH_JZ4740_IRQ_H__
-
-#define MIPS_CPU_IRQ_BASE 0
-#define NR_IRQS 256
-
-#endif
diff --git a/arch/mips/jz4740/Kconfig b/arch/mips/ingenic/Kconfig
similarity index 100%
rename from arch/mips/jz4740/Kconfig
rename to arch/mips/ingenic/Kconfig
diff --git a/arch/mips/jz4740/Makefile b/arch/mips/jz4740/Makefile
deleted file mode 100644
index f96c0f5eca44..000000000000
--- a/arch/mips/jz4740/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the Ingenic JZ4740.
-#
-
-# Object file lists.
-obj-y += setup.o
-
-CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt
diff --git a/arch/mips/jz4740/Platform b/arch/mips/jz4740/Platform
deleted file mode 100644
index bd35d0621b13..000000000000
--- a/arch/mips/jz4740/Platform
+++ /dev/null
@@ -1,3 +0,0 @@
-cflags-$(CONFIG_MACH_INGENIC) += -I$(srctree)/arch/mips/include/asm/mach-jz4740
-load-$(CONFIG_MACH_INGENIC) += 0xffffffff80010000
-zload-$(CONFIG_MACH_INGENIC) += 0xffffffff81000000
diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c
deleted file mode 100644
index 51d906325ce6..000000000000
--- a/arch/mips/jz4740/setup.c
+++ /dev/null
@@ -1,145 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (C) 2009-2010, Lars-Peter Clausen <[email protected]>
- * Copyright (C) 2011, Maarten ter Huurne <[email protected]>
- * JZ4740 setup code
- */
-
-#include <linux/clocksource.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/irqchip.h>
-#include <linux/kernel.h>
-#include <linux/libfdt.h>
-#include <linux/of_clk.h>
-#include <linux/of_fdt.h>
-#include <linux/pm.h>
-#include <linux/sizes.h>
-#include <linux/suspend.h>
-
-#include <asm/bootinfo.h>
-#include <asm/fw/fw.h>
-#include <asm/prom.h>
-#include <asm/reboot.h>
-#include <asm/time.h>
-
-static unsigned long __init get_board_mach_type(const void *fdt)
-{
- if (!fdt_node_check_compatible(fdt, 0, "ingenic,x2000"))
- return MACH_INGENIC_X2000;
- if (!fdt_node_check_compatible(fdt, 0, "ingenic,x1830"))
- return MACH_INGENIC_X1830;
- if (!fdt_node_check_compatible(fdt, 0, "ingenic,x1000"))
- return MACH_INGENIC_X1000;
- if (!fdt_node_check_compatible(fdt, 0, "ingenic,jz4780"))
- return MACH_INGENIC_JZ4780;
- if (!fdt_node_check_compatible(fdt, 0, "ingenic,jz4770"))
- return MACH_INGENIC_JZ4770;
- if (!fdt_node_check_compatible(fdt, 0, "ingenic,jz4725b"))
- return MACH_INGENIC_JZ4725B;
-
- return MACH_INGENIC_JZ4740;
-}
-
-void __init plat_mem_setup(void)
-{
- void *dtb = (void *)fw_passed_dtb;
-
- __dt_setup_arch(dtb);
-
- /*
- * Old devicetree files for the qi,lb60 board did not have a /memory
- * node. Hardcode the memory info here.
- */
- if (!fdt_node_check_compatible(dtb, 0, "qi,lb60") &&
- fdt_path_offset(dtb, "/memory") < 0)
- early_init_dt_add_memory_arch(0, SZ_32M);
-
- mips_machtype = get_board_mach_type(dtb);
-}
-
-void __init device_tree_init(void)
-{
- if (!initial_boot_params)
- return;
-
- unflatten_and_copy_device_tree();
-}
-
-const char *get_system_type(void)
-{
- switch (mips_machtype) {
- case MACH_INGENIC_X2000:
- return "X2000";
- case MACH_INGENIC_X1830:
- return "X1830";
- case MACH_INGENIC_X1000:
- return "X1000";
- case MACH_INGENIC_JZ4780:
- return "JZ4780";
- case MACH_INGENIC_JZ4770:
- return "JZ4770";
- case MACH_INGENIC_JZ4725B:
- return "JZ4725B";
- default:
- return "JZ4740";
- }
-}
-
-void __init arch_init_irq(void)
-{
- irqchip_init();
-}
-
-void __init plat_time_init(void)
-{
- of_clk_init(NULL);
- timer_probe();
-}
-
-void __init prom_init(void)
-{
- fw_init_cmdline();
-}
-
-void __init prom_free_prom_memory(void)
-{
-}
-
-static void jz4740_wait_instr(void)
-{
- __asm__(".set push;\n"
- ".set mips3;\n"
- "wait;\n"
- ".set pop;\n"
- );
-}
-
-static void jz4740_halt(void)
-{
- for (;;)
- jz4740_wait_instr();
-}
-
-static int __maybe_unused jz4740_pm_enter(suspend_state_t state)
-{
- jz4740_wait_instr();
-
- return 0;
-}
-
-static const struct platform_suspend_ops jz4740_pm_ops __maybe_unused = {
- .valid = suspend_valid_only_mem,
- .enter = jz4740_pm_enter,
-};
-
-static int __init jz4740_pm_init(void)
-{
- if (IS_ENABLED(CONFIG_PM_SLEEP))
- suspend_set_ops(&jz4740_pm_ops);
- _machine_halt = jz4740_halt;
-
- return 0;
-
-}
-late_initcall(jz4740_pm_init);
--
2.28.0
Add support for Ingenic SoCs in arch/mips/generic/.
The Kconfig changes are here to ensure that it is possible to compile
either a generic kernel that supports Ingenic SoCs, or a Ingenic-only
kernel, both using the same code base, to avoid duplicated code.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: Rework the code around "system_type" to match the changes
done in the previous patches.
arch/mips/Kbuild.platforms | 1 -
arch/mips/Kconfig | 32 +++++----
arch/mips/generic/Kconfig | 6 ++
arch/mips/generic/Makefile | 1 +
arch/mips/generic/board-ingenic.c | 108 ++++++++++++++++++++++++++++++
arch/mips/jz4740/Kconfig | 16 +++--
6 files changed, 146 insertions(+), 18 deletions(-)
create mode 100644 arch/mips/generic/board-ingenic.c
diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
index a13c4cf6e608..949222c09927 100644
--- a/arch/mips/Kbuild.platforms
+++ b/arch/mips/Kbuild.platforms
@@ -13,7 +13,6 @@ platform-$(CONFIG_MIPS_COBALT) += cobalt/
platform-$(CONFIG_MACH_DECSTATION) += dec/
platform-$(CONFIG_MIPS_GENERIC) += generic/
platform-$(CONFIG_MACH_JAZZ) += jazz/
-platform-$(CONFIG_MACH_INGENIC) += jz4740/
platform-$(CONFIG_LANTIQ) += lantiq/
platform-$(CONFIG_MACH_LOONGSON2EF) += loongson2ef/
platform-$(CONFIG_MACH_LOONGSON32) += loongson32/
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 4d57f46cd936..5b7c7c87f9b2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -97,6 +97,23 @@ config MIPS_FIXUP_BIGPHYS_ADDR
config MIPS_GENERIC
bool
+config MACH_INGENIC
+ bool
+ select SYS_SUPPORTS_32BIT_KERNEL
+ select SYS_SUPPORTS_LITTLE_ENDIAN
+ select SYS_SUPPORTS_ZBOOT
+ select CPU_SUPPORTS_HUGEPAGES
+ select DMA_NONCOHERENT
+ select IRQ_MIPS_CPU
+ select PINCTRL
+ select GPIOLIB
+ select COMMON_CLK
+ select GENERIC_IRQ_CHIP
+ select BUILTIN_DTB if MIPS_NO_APPENDED_DTB
+ select USE_OF
+ select CPU_SUPPORTS_CPUFREQ
+ select MIPS_EXTERNAL_TIMER
+
menu "Machine selection"
choice
@@ -394,20 +411,11 @@ config MACH_JAZZ
Members include the Acer PICA, MIPS Magnum 4000, MIPS Millennium and
Olivetti M700-10 workstations.
-config MACH_INGENIC
+config MACH_INGENIC_SOC
bool "Ingenic SoC based machines"
- select SYS_SUPPORTS_32BIT_KERNEL
- select SYS_SUPPORTS_LITTLE_ENDIAN
+ select MIPS_GENERIC
+ select MACH_INGENIC
select SYS_SUPPORTS_ZBOOT_UART16550
- select CPU_SUPPORTS_HUGEPAGES
- select DMA_NONCOHERENT
- select IRQ_MIPS_CPU
- select PINCTRL
- select GPIOLIB
- select COMMON_CLK
- select GENERIC_IRQ_CHIP
- select BUILTIN_DTB if MIPS_NO_APPENDED_DTB
- select USE_OF
config LANTIQ
bool "Lantiq based platforms"
diff --git a/arch/mips/generic/Kconfig b/arch/mips/generic/Kconfig
index 5216c850b7e2..55d9aed7ced9 100644
--- a/arch/mips/generic/Kconfig
+++ b/arch/mips/generic/Kconfig
@@ -73,6 +73,12 @@ config FIT_IMAGE_FDT_OCELOT
from Microsemi in the FIT kernel image.
This requires u-boot on the platform.
+config BOARD_INGENIC
+ bool "Support boards based on Ingenic SoCs"
+ select MACH_INGENIC_GENERIC
+ help
+ Enable support for boards based on Ingenic SoCs.
+
config VIRT_BOARD_RANCHU
bool "Support Ranchu platform for Android emulator"
help
diff --git a/arch/mips/generic/Makefile b/arch/mips/generic/Makefile
index 2384a6b09e4c..e37a59bae0a6 100644
--- a/arch/mips/generic/Makefile
+++ b/arch/mips/generic/Makefile
@@ -11,4 +11,5 @@ obj-y += proc.o
obj-$(CONFIG_YAMON_DT_SHIM) += yamon-dt.o
obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o
obj-$(CONFIG_LEGACY_BOARD_OCELOT) += board-ocelot.o
+obj-$(CONFIG_MACH_INGENIC) += board-ingenic.o
obj-$(CONFIG_VIRT_BOARD_RANCHU) += board-ranchu.o
diff --git a/arch/mips/generic/board-ingenic.c b/arch/mips/generic/board-ingenic.c
new file mode 100644
index 000000000000..0d7de8f9713d
--- /dev/null
+++ b/arch/mips/generic/board-ingenic.c
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Support for Ingenic SoCs
+ *
+ * Copyright (C) 2009-2010, Lars-Peter Clausen <[email protected]>
+ * Copyright (C) 2011, Maarten ter Huurne <[email protected]>
+ * Copyright (C) 2020 Paul Cercueil <[email protected]>
+ */
+
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/pm.h>
+#include <linux/sizes.h>
+#include <linux/suspend.h>
+#include <linux/types.h>
+
+#include <asm/bootinfo.h>
+#include <asm/machine.h>
+#include <asm/reboot.h>
+
+static __init char *ingenic_get_system_type(unsigned long machtype)
+{
+ switch (machtype) {
+ case MACH_INGENIC_X1830:
+ return "X1830";
+ case MACH_INGENIC_X1000:
+ return "X1000";
+ case MACH_INGENIC_JZ4780:
+ return "JZ4780";
+ case MACH_INGENIC_JZ4770:
+ return "JZ4770";
+ case MACH_INGENIC_JZ4725B:
+ return "JZ4725B";
+ default:
+ return "JZ4740";
+ }
+}
+
+static __init const void *ingenic_fixup_fdt(const void *fdt, const void *match_data)
+{
+ /*
+ * Old devicetree files for the qi,lb60 board did not have a /memory
+ * node. Hardcode the memory info here.
+ */
+ if (!fdt_node_check_compatible(fdt, 0, "qi,lb60") &&
+ fdt_path_offset(fdt, "/memory") < 0)
+ early_init_dt_add_memory_arch(0, SZ_32M);
+
+ mips_machtype = (unsigned long)match_data;
+ system_type = ingenic_get_system_type(mips_machtype);
+
+ return fdt;
+}
+
+static const struct of_device_id ingenic_of_match[] __initconst = {
+ { .compatible = "ingenic,jz4740", .data = (void *)MACH_INGENIC_JZ4740 },
+ { .compatible = "ingenic,jz4725b", .data = (void *)MACH_INGENIC_JZ4725B },
+ { .compatible = "ingenic,jz4770", .data = (void *)MACH_INGENIC_JZ4770 },
+ { .compatible = "ingenic,jz4780", .data = (void *)MACH_INGENIC_JZ4780 },
+ { .compatible = "ingenic,x1000", .data = (void *)MACH_INGENIC_X1000 },
+ { .compatible = "ingenic,x1830", .data = (void *)MACH_INGENIC_X1830 },
+ {}
+};
+
+MIPS_MACHINE(ingenic) = {
+ .matches = ingenic_of_match,
+ .fixup_fdt = ingenic_fixup_fdt,
+};
+
+static void ingenic_wait_instr(void)
+{
+ __asm__(".set push;\n"
+ ".set mips3;\n"
+ "wait;\n"
+ ".set pop;\n"
+ );
+}
+
+static void ingenic_halt(void)
+{
+ for (;;)
+ ingenic_wait_instr();
+}
+
+static int __maybe_unused ingenic_pm_enter(suspend_state_t state)
+{
+ ingenic_wait_instr();
+
+ return 0;
+}
+
+static const struct platform_suspend_ops ingenic_pm_ops __maybe_unused = {
+ .valid = suspend_valid_only_mem,
+ .enter = ingenic_pm_enter,
+};
+
+static int __init ingenic_pm_init(void)
+{
+ if (boot_cpu_type() == CPU_XBURST) {
+ if (IS_ENABLED(CONFIG_PM_SLEEP))
+ suspend_set_ops(&ingenic_pm_ops);
+ _machine_halt = ingenic_halt;
+ }
+
+ return 0;
+
+}
+late_initcall(ingenic_pm_init);
diff --git a/arch/mips/jz4740/Kconfig b/arch/mips/jz4740/Kconfig
index c2a6fbf8e411..3238e16febd5 100644
--- a/arch/mips/jz4740/Kconfig
+++ b/arch/mips/jz4740/Kconfig
@@ -1,15 +1,21 @@
# SPDX-License-Identifier: GPL-2.0
+
+config MACH_INGENIC_GENERIC
+ bool
+ select MACH_INGENIC
+ select MACH_JZ4740
+ select MACH_JZ4770
+ select MACH_JZ4780
+ select MACH_X1000
+
choice
prompt "Machine type"
- depends on MACH_INGENIC
+ depends on MACH_INGENIC_SOC
default INGENIC_GENERIC_BOARD
config INGENIC_GENERIC_BOARD
bool "Generic board"
- select MACH_JZ4740
- select MACH_JZ4770
- select MACH_JZ4780
- select MACH_X1000
+ select MACH_INGENIC_GENERIC
config JZ4740_QI_LB60
bool "Qi Hardware Ben NanoNote"
--
2.28.0
For each board the MACH_INGENIC_SOC option was selected instead of
MACH_INGENIC. Nothing else was changed in the menuconfig.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: Update cu1830-neo board config as well.
arch/mips/configs/ci20_defconfig | 4 ++--
arch/mips/configs/cu1000-neo_defconfig | 16 ++--------------
arch/mips/configs/cu1830-neo_defconfig | 15 ++-------------
arch/mips/configs/gcw0_defconfig | 2 +-
arch/mips/configs/qi_lb60_defconfig | 5 ++---
arch/mips/configs/rs90_defconfig | 4 ++--
6 files changed, 11 insertions(+), 35 deletions(-)
diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
index 0a46199fdc3f..052c5ad0f2b1 100644
--- a/arch/mips/configs/ci20_defconfig
+++ b/arch/mips/configs/ci20_defconfig
@@ -22,7 +22,7 @@ CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
-CONFIG_MACH_INGENIC=y
+CONFIG_MACH_INGENIC_SOC=y
CONFIG_JZ4780_CI20=y
CONFIG_HIGHMEM=y
CONFIG_HZ_100=y
@@ -42,7 +42,7 @@ CONFIG_IP_PNP_DHCP=y
# CONFIG_IPV6 is not set
# CONFIG_WIRELESS is not set
CONFIG_DEVTMPFS=y
-# CONFIG_FW_LOADER is not set
+CONFIG_FW_LOADER=m
# CONFIG_ALLOW_DEV_COREDUMP is not set
CONFIG_MTD=y
CONFIG_MTD_RAW_NAND=y
diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig
index 6b471cdb16cf..55d0690a3ffe 100644
--- a/arch/mips/configs/cu1000-neo_defconfig
+++ b/arch/mips/configs/cu1000-neo_defconfig
@@ -1,5 +1,3 @@
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_KERNEL_GZIP=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
@@ -9,7 +7,6 @@ CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_CGROUPS=y
CONFIG_MEMCG=y
-CONFIG_MEMCG_KMEM=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
@@ -17,13 +14,12 @@ CONFIG_CGROUP_CPUACCT=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS_ALL=y
CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
-CONFIG_MACH_INGENIC=y
+CONFIG_MACH_INGENIC_SOC=y
CONFIG_X1000_CU1000_NEO=y
CONFIG_HIGHMEM=y
CONFIG_HZ_100=y
@@ -32,7 +28,6 @@ CONFIG_HZ_100=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPACTION is not set
CONFIG_CMA=y
-CONFIG_CMA_AREAS=7
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
@@ -41,19 +36,16 @@ CONFIG_CFG80211=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
-# CONFIG_FW_LOADER is not set
# CONFIG_ALLOW_DEV_COREDUMP is not set
CONFIG_NETDEVICES=y
CONFIG_STMMAC_ETH=y
CONFIG_SMSC_PHY=y
CONFIG_BRCMFMAC=y
-# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_LEGACY_PTY_COUNT=2
-CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=3
@@ -67,8 +59,6 @@ CONFIG_GPIO_SYSFS=y
CONFIG_SENSORS_ADS7828=y
CONFIG_WATCHDOG=y
CONFIG_JZ4740_WDT=y
-# CONFIG_LCD_CLASS_DEVICE is not set
-# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
# CONFIG_VGA_CONSOLE is not set
# CONFIG_HID is not set
# CONFIG_USB_SUPPORT is not set
@@ -83,8 +73,6 @@ CONFIG_RTC_DRV_JZ4740=y
CONFIG_DMADEVICES=y
CONFIG_DMA_JZ4780=y
# CONFIG_IOMMU_SUPPORT is not set
-CONFIG_NVMEM=y
-CONFIG_NVMEM_SYSFS=y
CONFIG_EXT4_FS=y
# CONFIG_DNOTIFY is not set
CONFIG_AUTOFS_FS=y
@@ -109,8 +97,8 @@ CONFIG_CONSOLE_LOGLEVEL_QUIET=15
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7
CONFIG_DEBUG_INFO=y
CONFIG_STRIP_ASM_SYMS=y
-CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=10
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/mips/configs/cu1830-neo_defconfig b/arch/mips/configs/cu1830-neo_defconfig
index cbfb62900273..e7064851a47a 100644
--- a/arch/mips/configs/cu1830-neo_defconfig
+++ b/arch/mips/configs/cu1830-neo_defconfig
@@ -1,5 +1,3 @@
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_KERNEL_GZIP=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
@@ -9,7 +7,6 @@ CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_CGROUPS=y
CONFIG_MEMCG=y
-CONFIG_MEMCG_KMEM=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
@@ -22,7 +19,7 @@ CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
-CONFIG_MACH_INGENIC=y
+CONFIG_MACH_INGENIC_SOC=y
CONFIG_X1830_CU1830_NEO=y
CONFIG_HIGHMEM=y
CONFIG_HZ_100=y
@@ -31,7 +28,6 @@ CONFIG_HZ_100=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPACTION is not set
CONFIG_CMA=y
-CONFIG_CMA_AREAS=7
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
@@ -40,7 +36,6 @@ CONFIG_CFG80211=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
-# CONFIG_FW_LOADER is not set
# CONFIG_ALLOW_DEV_COREDUMP is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
@@ -49,13 +44,11 @@ CONFIG_NETDEVICES=y
CONFIG_STMMAC_ETH=y
CONFIG_ICPLUS_PHY=y
CONFIG_BRCMFMAC=y
-# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_LEGACY_PTY_COUNT=2
-CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=2
@@ -69,8 +62,6 @@ CONFIG_GPIO_SYSFS=y
CONFIG_SENSORS_ADS7828=y
CONFIG_WATCHDOG=y
CONFIG_JZ4740_WDT=y
-# CONFIG_LCD_CLASS_DEVICE is not set
-# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
# CONFIG_VGA_CONSOLE is not set
# CONFIG_HID is not set
# CONFIG_USB_SUPPORT is not set
@@ -85,8 +76,6 @@ CONFIG_RTC_DRV_JZ4740=y
CONFIG_DMADEVICES=y
CONFIG_DMA_JZ4780=y
# CONFIG_IOMMU_SUPPORT is not set
-CONFIG_NVMEM=y
-CONFIG_NVMEM_SYSFS=y
CONFIG_EXT4_FS=y
# CONFIG_DNOTIFY is not set
CONFIG_AUTOFS_FS=y
@@ -111,8 +100,8 @@ CONFIG_CONSOLE_LOGLEVEL_QUIET=15
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7
CONFIG_DEBUG_INFO=y
CONFIG_STRIP_ASM_SYMS=y
-CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=10
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/mips/configs/gcw0_defconfig b/arch/mips/configs/gcw0_defconfig
index 48131cb47e66..e0ee6c37f410 100644
--- a/arch/mips/configs/gcw0_defconfig
+++ b/arch/mips/configs/gcw0_defconfig
@@ -4,7 +4,7 @@ CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_EMBEDDED=y
CONFIG_PROFILING=y
-CONFIG_MACH_INGENIC=y
+CONFIG_MACH_INGENIC_SOC=y
CONFIG_JZ4770_GCW0=y
CONFIG_HIGHMEM=y
# CONFIG_SECCOMP is not set
diff --git a/arch/mips/configs/qi_lb60_defconfig b/arch/mips/configs/qi_lb60_defconfig
index 81bfbee72b0c..60428262ae9f 100644
--- a/arch/mips/configs/qi_lb60_defconfig
+++ b/arch/mips/configs/qi_lb60_defconfig
@@ -7,7 +7,7 @@ CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
-CONFIG_MACH_INGENIC=y
+CONFIG_MACH_INGENIC_SOC=y
CONFIG_HZ_100=y
# CONFIG_SECCOMP is not set
CONFIG_MODULES=y
@@ -72,7 +72,6 @@ CONFIG_DRM=y
CONFIG_DRM_FBDEV_OVERALLOC=200
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_INGENIC=y
-# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
# CONFIG_VGA_CONSOLE is not set
@@ -170,9 +169,9 @@ CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_INFO=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_READABLE_ASM=y
+CONFIG_KGDB=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_PANIC_ON_OOPS=y
# CONFIG_FTRACE is not set
-CONFIG_KGDB=y
diff --git a/arch/mips/configs/rs90_defconfig b/arch/mips/configs/rs90_defconfig
index de6752051ecc..dfbb9fed9a42 100644
--- a/arch/mips/configs/rs90_defconfig
+++ b/arch/mips/configs/rs90_defconfig
@@ -19,7 +19,7 @@ CONFIG_EMBEDDED=y
# CONFIG_PERF_EVENTS is not set
CONFIG_SLAB=y
CONFIG_PROFILING=y
-CONFIG_MACH_INGENIC=y
+CONFIG_MACH_INGENIC_SOC=y
CONFIG_JZ4740_RS90=y
CONFIG_PAGE_SIZE_16KB=y
CONFIG_HZ_100=y
@@ -80,8 +80,8 @@ CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO is not set
CONFIG_LEGACY_PTY_COUNT=2
-# CONFIG_DEVMEM is not set
# CONFIG_HW_RANDOM is not set
+# CONFIG_DEVMEM is not set
# CONFIG_I2C_COMPAT is not set
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_POWER_SUPPLY=y
--
2.28.0
Support for Ingenic chips has been moved to the generic MIPS platform.
Update the paths accordingly.
Signed-off-by: Paul Cercueil <[email protected]>
---
Notes:
v2: No change
MAINTAINERS | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 87d26c167c99..2b4eba7e9916 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8508,8 +8508,8 @@ INGENIC JZ47xx SoCs
M: Paul Cercueil <[email protected]>
S: Maintained
F: arch/mips/boot/dts/ingenic/
-F: arch/mips/include/asm/mach-jz4740/
-F: arch/mips/jz4740/
+F: arch/mips/generic/board-ingenic.c
+F: arch/mips/ingenic/Kconfig
F: drivers/clk/ingenic/
F: drivers/dma/dma-jz4780.c
F: drivers/gpu/drm/ingenic/
--
2.28.0
Hello!
On 12.08.2020 3:15, Paul Cercueil wrote:
> The plat_get_fdt() checked that the kernel was booted using UHI before
> reading the 'fw_passed_dtb' variable. However, this variable is also set
> when the kernel has been appended, or when it has been built into the
s/kernel/DT/?
> kernel.
>
> Support these usecases by removing the UHI check.
>
> Signed-off-by: Paul Cercueil <[email protected]>
[...]
MBR, Sergei
Le mer. 12 ao?t 2020 ? 12:15, Sergei Shtylyov
<[email protected]> a ?crit :
> Hello!
>
> On 12.08.2020 3:15, Paul Cercueil wrote:
>
>> The plat_get_fdt() checked that the kernel was booted using UHI
>> before
>> reading the 'fw_passed_dtb' variable. However, this variable is also
>> set
>> when the kernel has been appended, or when it has been built into the
>
> s/kernel/DT/?
Ooops :)
>
>> kernel.
>>
>> Support these usecases by removing the UHI check.
>>
>> Signed-off-by: Paul Cercueil <[email protected]>
> [...]
>
> MBR, Sergei
Hi Paul,
I have some good news and some bad news.
Good news is:
I tested this series of patches on CU1000-Neo & CU1830-Neo, and it can
boot normally and log in to debian normally.
Bad news is:
1. Because we dropped arch/mips/jz4740/setup.c, so it did not return
MACH_INGENIC_XXXX correctly, which caused the correction of the L2 cache
probe in arch/mips/mm/sc-mips.c to fail, causing JZ4770/X1000 to detect
the L2 cache capacity incorrect.
2. When I did some heavy work (compiled docker source code after logging
in with ssh), the following message appeared:
message1:
[ 4694.290776] warn_alloc: 25 callbacks suppressed
[ 4694.290791] containerd-shim: page allocation failure: order:4,
mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null)
[ 4694.315266] CPU: 0 PID: 19817 Comm: containerd-shim Not tainted
5.8.0-00013-g192f2fd7b678 #15
[ 4694.317993] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
850dfcb4 00000000 ffffffff
[ 4694.320818] 80a50000 80a576c7 809c4374 00004d69 80ad348c
00000001 850dfc58 7750292a
[ 4694.322695] 00000000 00000000 809c4374 ffff00fe 850dffe0
00001400 00000199 00000000
[ 4694.325083] ffffffff 866f7600 80a50000 878bd778 80a50000
80000000 809c2b50 00000000
[ 4694.326957] 00040cc0 00000000 000001d2 00000000 80a53220
7750292a 0000a098 80ad0000
[ 4694.327750] ...
[ 4694.340943] Call Trace:
[ 4694.341181] [<8001ae08>] show_stack+0x6c/0x12c
[ 4694.355233] [<800f64b0>] warn_alloc+0xa8/0x130
[ 4694.361283] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
[ 4694.362839] [<80103110>] ____cache_alloc+0x324/0x8fc
[ 4694.367439] [<801038e4>] __kmalloc+0x78/0xd8
[ 4694.376798] [<80195b28>] proc_sys_call_handler+0xf4/0x1d8
[ 4694.377229] [<80195c44>] proc_sys_read+0x14/0x20
[ 4694.384090] [<80116274>] vfs_read+0xac/0x108
[ 4694.385654] [<801165d4>] ksys_read+0x80/0xe0
[ 4694.395277] [<8001ec8c>] syscall_common+0x34/0x58
[ 4694.394544] Mem-Info:
[ 4694.396828] active_anon:661 inactive_anon:942 isolated_anon:0
[ 4694.396828] active_file:10515 inactive_file:9667 isolated_file:0
[ 4694.396828] unevictable:0 dirty:2003 writeback:0
[ 4694.396828] slab_reclaimable:1609 slab_unreclaimable:3103
[ 4694.396828] mapped:2182 shmem:156 pagetables:207 bounce:0
[ 4694.396828] free:1635 free_pcp:7 free_cma:0
[ 4694.405770] Node 0 active_anon:2644kB inactive_anon:3768kB
active_file:42060kB inactive_file:38668kB unevictable:0kB
isolated(anon):0kB isolated(file):0kB mapped:8728kB dirty:8048kB
writeback:0kB shmem:624kB writeback_tmp:0kB all_unreclaimable? no
[ 4694.408349] Normal free:6484kB min:1376kB low:1720kB high:2064kB
reserved_highatomic:0KB active_anon:2644kB inactive_anon:3768kB
active_file:42064kB inactive_file:38724kB unevictable:0kB
writepending:8060kB present:131072kB managed:118804kB mlocked:0kB
kernel_stack:584kB pagetables:828kB bounce:0kB free_pcp:32kB
local_pcp:32kB free_cma:0kB
[ 4694.409607] lowmem_reserve[]: 0 0 0
[ 4694.410382] Normal: 117*4kB (UM) 406*8kB (UM) 149*16kB (UME) 12*32kB
(UME) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 6484kB
[ 4694.418673] 20618 total pagecache pages
[ 4694.423125] 226 pages in swap cache
[ 4694.423912] Swap cache stats: add 535090, delete 534864, find
234586/366812
[ 4694.431304] Free swap = 774396kB
[ 4694.431900] Total swap = 786428kB
[ 4694.432480] 32768 pages RAM
[ 4694.432537] 0 pages HighMem/MovableOnly
[ 4694.441338] 3067 pages reserved
[ 4694.441770] 0 pages cma reserved
---------------------------------------------------------
message2:
[ 4426.473667] warn_alloc: 27 callbacks suppressed
[ 4426.473681] kswapd0: page allocation failure: order:0,
mode:0xa20(GFP_ATOMIC), nodemask=(null)
[ 4426.475946] CPU: 0 PID: 439 Comm: kswapd0 Not tainted
5.8.0-00013-g192f2fd7b678 #15
[ 4426.478136] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
87c0dccc 00000000 ffffffff
[ 4426.478301] 80a50000 80a576c7 809c4374 000001b7 80ad348c
00000001 87c0dc70 b7c290ba
[ 4426.478464] 00000000 00000000 809c4374 00000000 0000000f
00000000 0000019f 00000000
[ 4426.478626] bff4ffd7 1c5e5f3c 80ae0000 31672d33 80a50000
00000000 809c2b50 00000000
[ 4426.478787] 00000a20 00000000 00000000 00000000 00000002
804d392c 00000000 80ad0000
[ 4426.478940] ...
[ 4426.481390] Call Trace:
[ 4426.483842] [<8001ae08>] show_stack+0x6c/0x12c
[ 4426.485555] [<800f64b0>] warn_alloc+0xa8/0x130
[ 4426.487275] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
[ 4426.487382] [<800f6f80>] page_frag_alloc+0x74/0x144
[ 4426.489534] [<805fc1a4>] __napi_alloc_skb+0x88/0x118
[ 4426.491769] [<8052ed8c>] stmmac_napi_poll_rx+0x434/0xa94
[ 4426.494354] [<80613eb0>] net_rx_action+0x11c/0x310
[ 4426.496414] [<807ecd0c>] __do_softirq+0x10c/0x258
[ 4426.498395] [<800320c0>] __irq_exit_rcu+0x68/0xbc
[ 4426.500365] [<80032324>] irq_exit+0x10/0x1c
[ 4426.501844] [<804876b4>] plat_irq_dispatch+0x8c/0xb8
[ 4426.504076] [<800154f8>] handle_int+0x138/0x144
[ 4426.505883] [<8005280c>] arch_local_irq_enable+0x4/0xc
[ 4426.508289] Mem-Info:
[ 4426.510576] active_anon:770 inactive_anon:1763 isolated_anon:0
[ 4426.510576] active_file:5581 inactive_file:15166 isolated_file:0
[ 4426.510576] unevictable:0 dirty:1262 writeback:880
[ 4426.510576] slab_reclaimable:1187 slab_unreclaimable:3016
[ 4426.510576] mapped:3478 shmem:315 pagetables:186 bounce:0
[ 4426.510576] free:453 free_pcp:16 free_cma:0
[ 4426.512469] Node 0 active_anon:3080kB inactive_anon:7052kB
active_file:22324kB inactive_file:60664kB unevictable:0kB
isolated(anon):0kB isolated(file):0kB mapped:13912kB dirty:5048kB
writeback:3520kB shmem:1260kB writeback_tmp:0kB all_unreclaimable? no
[ 4426.512938] Normal free:1812kB min:5472kB low:5816kB high:6160kB
reserved_highatomic:0KB active_anon:3080kB inactive_anon:7052kB
active_file:22324kB inactive_file:60664kB unevictable:0kB
writepending:8568kB present:131072kB managed:118804kB mlocked:0kB
kernel_stack:544kB pagetables:744kB bounce:0kB free_pcp:64kB
local_pcp:64kB free_cma:0kB
[ 4426.515643] lowmem_reserve[]: 0 0 0
[ 4426.516400] Normal: 11*4kB (U) 59*8kB (UE) 75*16kB (U) 3*32kB (U)
0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1812kB
[ 4426.517399] 21378 total pagecache pages
[ 4426.518507] 306 pages in swap cache
[ 4426.519259] Swap cache stats: add 533859, delete 533553, find
134676/266712
[ 4426.520752] Free swap = 777212kB
[ 4426.521331] Total swap = 786428kB
[ 4426.521911] 32768 pages RAM
[ 4426.521973] 0 pages HighMem/MovableOnly
[ 4426.523072] 3067 pages reserved
[ 4426.523474] 0 pages cma reserved
---------------------------------------------------------
message3:
[ 292.077309] CPU 0 Unable to handle kernel paging request at virtual
address 00000104, epc == 801e7f30, ra == 801e7f24
[ 292.087904] Oops[#1]:
[ 292.090169] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted
5.9.0-rc1-00016-g8d1e63c37d0d-dirty #1
[ 292.098768] Workqueue: events cache_reap
[ 292.102675] $ 0 : 00000000 00000001 808f3bf4 00000122
[ 292.107887] $ 4 : 808f3bf8 00000100 0000003c 87c02080
[ 292.113099] $ 8 : 87c01000 8581e301 00000001 00000000
[ 292.118311] $12 : 87c3dc7c 0000000a 810021c4 00000100
[ 292.123523] $16 : 85855600 8100218c 86284600 80790000
[ 292.128735] $20 : 0000003c 00000000 8100219c fffffffe
[ 292.133946] $24 : 00000122 87c02090
[ 292.139158] $28 : 87c3c000 87c3dc48 807b0000 801e7f24
[ 292.144371] Hi : 00000000
[ 292.147237] Lo : 000c6bf4
[ 292.150109] epc : 801e7f30 free_block+0x68/0x198
[ 292.154887] ra : 801e7f24 free_block+0x5c/0x198
[ 292.159660] Status: 10001402 KERNEL EXL
[ 292.163569] Cause : 4080800c (ExcCode 03)
[ 292.167563] BadVA : 00000104
[ 292.170430] PrId : 00d00100 (Ingenic XBurst)
[ 292.174776] Process kworker/0:0 (pid: 5, threadinfo=50ecb211,
task=a81ea849, tls=00000000)
[ 292.183016] Stack : 87c2e020 87c50cd0 8079e358 00000000 87c01000
801e8b14 87c50cd0 87c2e050
[ 292.191353] 87c50cd0 8014930c 87c3dc7c 87c50ca0 807a0000
87c3dc7c 87c3dc7c 018070a3
[ 292.199689] 80790000 86284600 801e8618 00000000 00000100
00000122 00000000 8100219c
[ 292.208025] fffffffe 801e8544 00000003 00000000 00000000
87c3dce0 808f3bf4 00000000
[ 292.216361] 87c01000 801e8618 87c06300 00000000 00000000
87c3dce0 87c01000 85855a80
[ 292.224697] ...
[ 292.227132] Call Trace:
[ 292.229569] [<801e7f30>] free_block+0x68/0x198
[ 292.234003] [<801e8b14>] ___cache_free+0x1f8/0x2e8
[ 292.238781] [<801e8544>] kfree+0x48/0x6c
[ 292.242693] [<801e8618>] kmem_freepages+0xb0/0x124
[ 292.247471] [<801e86e0>] slab_destroy+0x48/0x7c
[ 292.251989] [<801e8778>] slabs_destroy+0x64/0x94
[ 292.256593] [<801e8b4c>] ___cache_free+0x230/0x2e8
[ 292.261372] [<801e8544>] kfree+0x48/0x6c
[ 292.265283] [<801e8618>] kmem_freepages+0xb0/0x124
[ 292.270062] [<801e86e0>] slab_destroy+0x48/0x7c
[ 292.274580] [<801e8778>] slabs_destroy+0x64/0x94
[ 292.279185] [<801e8d90>] drain_array.isra.59.constprop.61+0xb4/0xdc
[ 292.285437] [<801e8f84>] cache_reap+0x64/0x120
[ 292.289869] [<80137204>] process_one_work+0x1b8/0x25c
[ 292.294907] [<80137588>] worker_thread+0x294/0x3c4
[ 292.299684] [<8013cfe0>] kthread+0x148/0x150
[ 292.303941] [<8010506c>] ret_from_kernel_thread+0x14/0x1c
[ 292.309324] Code: 8c430008 8c450004 24440004 <aca30004> ac650000
8c430014 ac4f0004 ac580008 8d0a0014
[ 292.319053]
[ 292.320591] ---[ end trace 2a1f2afba7a08ca1 ]---
[ 292.325197] Kernel panic - not syncing: Fatal exception
[ 292.330409] Rebooting in 10 seconds..
these three kinds of message appear at random. Sometimes they will
appear at the beginning of the compilation, and sometimes they will
appear after tens of minutes of compilation.
Thanks and best regards!
在 2020/8/12 上午8:14, Paul Cercueil 写道:
> Hi,
>
> Changes since V1:
>
> - the get_system_type() now will simply return the "system_type"
> variable if non-NULL, and the various boards can set this pointer
> should they want to set a custom value. The .get_system_type
> callback that v1 added to the struct mips_machine is gone.
>
> - the board-ingenic.c has been modified accordingly.
>
> - patch [06/13] is new, it makes sure that the kernel's command line is
> initialized properly and includes the parameters passed by the
> bootloader.
>
> - the cu1830-neo board defconfig has now been regenerated in patch
> [12/13].
>
> Cheers,
> -Paul
>
> Paul Cercueil (13):
> MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA
> MIPS: cpu-probe: Mark XBurst CPU as having vtagged caches
> MIPS: cpu-probe: ingenic: Fix broken BUG_ON
> MIPS: Kconfig: add MIPS_GENERIC_KERNEL symbol
> MIPS: generic: Allow boards to set system type
> MIPS: generic: Init command line with fw_init_cmdline()
> MIPS: generic: Support booting with built-in or appended DTB
> MIPS: generic: Add support for zboot
> MIPS: generic: Increase NR_IRQS to 256
> MIPS: generic: Add support for Ingenic SoCs
> MIPS: jz4740: Drop folder
> MIPS: configs: Regenerate configs of Ingenic boards
> MAINTAINERS: Update paths to Ingenic platform code
>
> MAINTAINERS | 4 +-
> arch/mips/Kbuild.platforms | 1 -
> arch/mips/Kconfig | 43 ++++--
> arch/mips/configs/ci20_defconfig | 4 +-
> arch/mips/configs/cu1000-neo_defconfig | 16 +-
> arch/mips/configs/cu1830-neo_defconfig | 15 +-
> arch/mips/configs/gcw0_defconfig | 2 +-
> arch/mips/configs/qi_lb60_defconfig | 5 +-
> arch/mips/configs/rs90_defconfig | 4 +-
> arch/mips/generic/Kconfig | 8 +-
> arch/mips/generic/Makefile | 1 +
> arch/mips/generic/Platform | 1 +
> arch/mips/generic/board-ingenic.c | 108 +++++++++++++
> arch/mips/generic/init.c | 11 +-
> arch/mips/generic/proc.c | 5 +
> arch/mips/include/asm/mach-generic/irq.h | 2 +-
> .../asm/mach-jz4740/cpu-feature-overrides.h | 50 ------
> arch/mips/include/asm/mach-jz4740/irq.h | 13 --
> arch/mips/include/asm/pgtable-bits.h | 5 -
> arch/mips/{jz4740 => ingenic}/Kconfig | 16 +-
> arch/mips/jz4740/Makefile | 9 --
> arch/mips/jz4740/Platform | 3 -
> arch/mips/jz4740/setup.c | 145 ------------------
> arch/mips/kernel/cpu-probe.c | 8 +-
> 24 files changed, 186 insertions(+), 293 deletions(-)
> create mode 100644 arch/mips/generic/board-ingenic.c
> delete mode 100644 arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
> delete mode 100644 arch/mips/include/asm/mach-jz4740/irq.h
> rename arch/mips/{jz4740 => ingenic}/Kconfig (91%)
> delete mode 100644 arch/mips/jz4740/Makefile
> delete mode 100644 arch/mips/jz4740/Platform
> delete mode 100644 arch/mips/jz4740/setup.c
>
?? 2020/8/12 ????8:15, Paul Cercueil д??:
> For each board the MACH_INGENIC_SOC option was selected instead of
> MACH_INGENIC. Nothing else was changed in the menuconfig.
>
> Signed-off-by: Paul Cercueil <[email protected]>
> ---
>
> Notes:
> v2: Update cu1830-neo board config as well.
>
> arch/mips/configs/ci20_defconfig | 4 ++--
> arch/mips/configs/cu1000-neo_defconfig | 16 ++--------------
> arch/mips/configs/cu1830-neo_defconfig | 15 ++-------------
> arch/mips/configs/gcw0_defconfig | 2 +-
> arch/mips/configs/qi_lb60_defconfig | 5 ++---
> arch/mips/configs/rs90_defconfig | 4 ++--
> 6 files changed, 11 insertions(+), 35 deletions(-)
>
> diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
> index 0a46199fdc3f..052c5ad0f2b1 100644
> --- a/arch/mips/configs/ci20_defconfig
> +++ b/arch/mips/configs/ci20_defconfig
> @@ -22,7 +22,7 @@ CONFIG_EMBEDDED=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> # CONFIG_COMPAT_BRK is not set
> CONFIG_SLAB=y
> -CONFIG_MACH_INGENIC=y
> +CONFIG_MACH_INGENIC_SOC=y
> CONFIG_JZ4780_CI20=y
> CONFIG_HIGHMEM=y
> CONFIG_HZ_100=y
> @@ -42,7 +42,7 @@ CONFIG_IP_PNP_DHCP=y
> # CONFIG_IPV6 is not set
> # CONFIG_WIRELESS is not set
> CONFIG_DEVTMPFS=y
> -# CONFIG_FW_LOADER is not set
> +CONFIG_FW_LOADER=m
> # CONFIG_ALLOW_DEV_COREDUMP is not set
> CONFIG_MTD=y
> CONFIG_MTD_RAW_NAND=y
> diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig
> index 6b471cdb16cf..55d0690a3ffe 100644
> --- a/arch/mips/configs/cu1000-neo_defconfig
> +++ b/arch/mips/configs/cu1000-neo_defconfig
> @@ -1,5 +1,3 @@
> -CONFIG_LOCALVERSION_AUTO=y
> -CONFIG_KERNEL_GZIP=y
> CONFIG_SYSVIPC=y
> CONFIG_NO_HZ_IDLE=y
> CONFIG_HIGH_RES_TIMERS=y
> @@ -9,7 +7,6 @@ CONFIG_IKCONFIG_PROC=y
> CONFIG_LOG_BUF_SHIFT=14
> CONFIG_CGROUPS=y
> CONFIG_MEMCG=y
> -CONFIG_MEMCG_KMEM=y
> CONFIG_CGROUP_SCHED=y
> CONFIG_CGROUP_FREEZER=y
> CONFIG_CGROUP_DEVICE=y
> @@ -17,13 +14,12 @@ CONFIG_CGROUP_CPUACCT=y
> CONFIG_NAMESPACES=y
> CONFIG_USER_NS=y
> CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> -CONFIG_SYSCTL_SYSCALL=y
This has already been dropped in the current mips-next tree.
> CONFIG_KALLSYMS_ALL=y
> CONFIG_EMBEDDED=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> # CONFIG_COMPAT_BRK is not set
> CONFIG_SLAB=y
> -CONFIG_MACH_INGENIC=y
> +CONFIG_MACH_INGENIC_SOC=y
> CONFIG_X1000_CU1000_NEO=y
> CONFIG_HIGHMEM=y
> CONFIG_HZ_100=y
> @@ -32,7 +28,6 @@ CONFIG_HZ_100=y
> # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
> # CONFIG_COMPACTION is not set
> CONFIG_CMA=y
> -CONFIG_CMA_AREAS=7
> CONFIG_NET=y
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> @@ -41,19 +36,16 @@ CONFIG_CFG80211=y
> CONFIG_UEVENT_HELPER=y
> CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
> CONFIG_DEVTMPFS=y
> -# CONFIG_FW_LOADER is not set
> # CONFIG_ALLOW_DEV_COREDUMP is not set
> CONFIG_NETDEVICES=y
> CONFIG_STMMAC_ETH=y
> CONFIG_SMSC_PHY=y
> CONFIG_BRCMFMAC=y
> -# CONFIG_INPUT_MOUSEDEV is not set
> # CONFIG_INPUT_KEYBOARD is not set
> # CONFIG_INPUT_MOUSE is not set
> # CONFIG_SERIO is not set
> CONFIG_VT_HW_CONSOLE_BINDING=y
> CONFIG_LEGACY_PTY_COUNT=2
> -CONFIG_SERIAL_EARLYCON=y
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_SERIAL_8250_NR_UARTS=3
> @@ -67,8 +59,6 @@ CONFIG_GPIO_SYSFS=y
> CONFIG_SENSORS_ADS7828=y
> CONFIG_WATCHDOG=y
> CONFIG_JZ4740_WDT=y
> -# CONFIG_LCD_CLASS_DEVICE is not set
> -# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
> # CONFIG_VGA_CONSOLE is not set
> # CONFIG_HID is not set
> # CONFIG_USB_SUPPORT is not set
> @@ -83,8 +73,6 @@ CONFIG_RTC_DRV_JZ4740=y
> CONFIG_DMADEVICES=y
> CONFIG_DMA_JZ4780=y
> # CONFIG_IOMMU_SUPPORT is not set
> -CONFIG_NVMEM=y
> -CONFIG_NVMEM_SYSFS=y
> CONFIG_EXT4_FS=y
> # CONFIG_DNOTIFY is not set
> CONFIG_AUTOFS_FS=y
> @@ -109,8 +97,8 @@ CONFIG_CONSOLE_LOGLEVEL_QUIET=15
> CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7
> CONFIG_DEBUG_INFO=y
> CONFIG_STRIP_ASM_SYMS=y
> -CONFIG_DEBUG_FS=y
> CONFIG_MAGIC_SYSRQ=y
> +CONFIG_DEBUG_FS=y
> CONFIG_PANIC_ON_OOPS=y
> CONFIG_PANIC_TIMEOUT=10
> # CONFIG_SCHED_DEBUG is not set
> diff --git a/arch/mips/configs/cu1830-neo_defconfig b/arch/mips/configs/cu1830-neo_defconfig
> index cbfb62900273..e7064851a47a 100644
> --- a/arch/mips/configs/cu1830-neo_defconfig
> +++ b/arch/mips/configs/cu1830-neo_defconfig
> @@ -1,5 +1,3 @@
> -CONFIG_LOCALVERSION_AUTO=y
> -CONFIG_KERNEL_GZIP=y
> CONFIG_SYSVIPC=y
> CONFIG_NO_HZ_IDLE=y
> CONFIG_HIGH_RES_TIMERS=y
> @@ -9,7 +7,6 @@ CONFIG_IKCONFIG_PROC=y
> CONFIG_LOG_BUF_SHIFT=14
> CONFIG_CGROUPS=y
> CONFIG_MEMCG=y
> -CONFIG_MEMCG_KMEM=y
> CONFIG_CGROUP_SCHED=y
> CONFIG_CGROUP_FREEZER=y
> CONFIG_CGROUP_DEVICE=y
> @@ -22,7 +19,7 @@ CONFIG_EMBEDDED=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> # CONFIG_COMPAT_BRK is not set
> CONFIG_SLAB=y
> -CONFIG_MACH_INGENIC=y
> +CONFIG_MACH_INGENIC_SOC=y
> CONFIG_X1830_CU1830_NEO=y
> CONFIG_HIGHMEM=y
> CONFIG_HZ_100=y
> @@ -31,7 +28,6 @@ CONFIG_HZ_100=y
> # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
> # CONFIG_COMPACTION is not set
> CONFIG_CMA=y
> -CONFIG_CMA_AREAS=7
> CONFIG_NET=y
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> @@ -40,7 +36,6 @@ CONFIG_CFG80211=y
> CONFIG_UEVENT_HELPER=y
> CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
> CONFIG_DEVTMPFS=y
> -# CONFIG_FW_LOADER is not set
> # CONFIG_ALLOW_DEV_COREDUMP is not set
> CONFIG_MD=y
> CONFIG_BLK_DEV_MD=y
> @@ -49,13 +44,11 @@ CONFIG_NETDEVICES=y
> CONFIG_STMMAC_ETH=y
> CONFIG_ICPLUS_PHY=y
> CONFIG_BRCMFMAC=y
> -# CONFIG_INPUT_MOUSEDEV is not set
> # CONFIG_INPUT_KEYBOARD is not set
> # CONFIG_INPUT_MOUSE is not set
> # CONFIG_SERIO is not set
> CONFIG_VT_HW_CONSOLE_BINDING=y
> CONFIG_LEGACY_PTY_COUNT=2
> -CONFIG_SERIAL_EARLYCON=y
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_SERIAL_8250_NR_UARTS=2
> @@ -69,8 +62,6 @@ CONFIG_GPIO_SYSFS=y
> CONFIG_SENSORS_ADS7828=y
> CONFIG_WATCHDOG=y
> CONFIG_JZ4740_WDT=y
> -# CONFIG_LCD_CLASS_DEVICE is not set
> -# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
> # CONFIG_VGA_CONSOLE is not set
> # CONFIG_HID is not set
> # CONFIG_USB_SUPPORT is not set
> @@ -85,8 +76,6 @@ CONFIG_RTC_DRV_JZ4740=y
> CONFIG_DMADEVICES=y
> CONFIG_DMA_JZ4780=y
> # CONFIG_IOMMU_SUPPORT is not set
> -CONFIG_NVMEM=y
> -CONFIG_NVMEM_SYSFS=y
> CONFIG_EXT4_FS=y
> # CONFIG_DNOTIFY is not set
> CONFIG_AUTOFS_FS=y
> @@ -111,8 +100,8 @@ CONFIG_CONSOLE_LOGLEVEL_QUIET=15
> CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7
> CONFIG_DEBUG_INFO=y
> CONFIG_STRIP_ASM_SYMS=y
> -CONFIG_DEBUG_FS=y
> CONFIG_MAGIC_SYSRQ=y
> +CONFIG_DEBUG_FS=y
> CONFIG_PANIC_ON_OOPS=y
> CONFIG_PANIC_TIMEOUT=10
> # CONFIG_SCHED_DEBUG is not set
> diff --git a/arch/mips/configs/gcw0_defconfig b/arch/mips/configs/gcw0_defconfig
> index 48131cb47e66..e0ee6c37f410 100644
> --- a/arch/mips/configs/gcw0_defconfig
> +++ b/arch/mips/configs/gcw0_defconfig
> @@ -4,7 +4,7 @@ CONFIG_HIGH_RES_TIMERS=y
> CONFIG_PREEMPT_VOLUNTARY=y
> CONFIG_EMBEDDED=y
> CONFIG_PROFILING=y
> -CONFIG_MACH_INGENIC=y
> +CONFIG_MACH_INGENIC_SOC=y
> CONFIG_JZ4770_GCW0=y
> CONFIG_HIGHMEM=y
> # CONFIG_SECCOMP is not set
> diff --git a/arch/mips/configs/qi_lb60_defconfig b/arch/mips/configs/qi_lb60_defconfig
> index 81bfbee72b0c..60428262ae9f 100644
> --- a/arch/mips/configs/qi_lb60_defconfig
> +++ b/arch/mips/configs/qi_lb60_defconfig
> @@ -7,7 +7,7 @@ CONFIG_EMBEDDED=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> # CONFIG_COMPAT_BRK is not set
> CONFIG_SLAB=y
> -CONFIG_MACH_INGENIC=y
> +CONFIG_MACH_INGENIC_SOC=y
> CONFIG_HZ_100=y
> # CONFIG_SECCOMP is not set
> CONFIG_MODULES=y
> @@ -72,7 +72,6 @@ CONFIG_DRM=y
> CONFIG_DRM_FBDEV_OVERALLOC=200
> CONFIG_DRM_PANEL_SIMPLE=y
> CONFIG_DRM_INGENIC=y
> -# CONFIG_LCD_CLASS_DEVICE is not set
> CONFIG_BACKLIGHT_CLASS_DEVICE=y
> # CONFIG_BACKLIGHT_GENERIC is not set
> # CONFIG_VGA_CONSOLE is not set
> @@ -170,9 +169,9 @@ CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> CONFIG_STRIP_ASM_SYMS=y
> CONFIG_READABLE_ASM=y
> +CONFIG_KGDB=y
> CONFIG_DEBUG_KMEMLEAK=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_DEBUG_STACKOVERFLOW=y
> CONFIG_PANIC_ON_OOPS=y
> # CONFIG_FTRACE is not set
> -CONFIG_KGDB=y
> diff --git a/arch/mips/configs/rs90_defconfig b/arch/mips/configs/rs90_defconfig
> index de6752051ecc..dfbb9fed9a42 100644
> --- a/arch/mips/configs/rs90_defconfig
> +++ b/arch/mips/configs/rs90_defconfig
> @@ -19,7 +19,7 @@ CONFIG_EMBEDDED=y
> # CONFIG_PERF_EVENTS is not set
> CONFIG_SLAB=y
> CONFIG_PROFILING=y
> -CONFIG_MACH_INGENIC=y
> +CONFIG_MACH_INGENIC_SOC=y
> CONFIG_JZ4740_RS90=y
> CONFIG_PAGE_SIZE_16KB=y
> CONFIG_HZ_100=y
> @@ -80,8 +80,8 @@ CONFIG_KEYBOARD_GPIO=y
> # CONFIG_INPUT_MOUSE is not set
> # CONFIG_SERIO is not set
> CONFIG_LEGACY_PTY_COUNT=2
> -# CONFIG_DEVMEM is not set
> # CONFIG_HW_RANDOM is not set
> +# CONFIG_DEVMEM is not set
> # CONFIG_I2C_COMPAT is not set
> # CONFIG_I2C_HELPER_AUTO is not set
> CONFIG_POWER_SUPPLY=y
Hi Zhou,
Le mer. 19 août 2020 à 22:12, Zhou Yanjie <[email protected]>
a écrit :
> Hi Paul,
>
> I have some good news and some bad news.
>
> Good news is:
>
> I tested this series of patches on CU1000-Neo & CU1830-Neo, and it
> can boot normally and log in to debian normally.
>
> Bad news is:
>
> 1. Because we dropped arch/mips/jz4740/setup.c, so it did not return
> MACH_INGENIC_XXXX correctly, which caused the correction of the L2
> cache probe in arch/mips/mm/sc-mips.c to fail, causing JZ4770/X1000
> to detect the L2 cache capacity incorrect.
It's properly detected here on JZ4770. The detection code was just
moved to arch/mips/generic/board-ingenic.c.
> 2. When I did some heavy work (compiled docker source code after
> logging in with ssh), the following message appeared:
Chances are that these messages are related. Stuff like that tends to
appear in -rc1 and get fixed afterwards.
Cheers,
-Paul
> message1:
>
> [ 4694.290776] warn_alloc: 25 callbacks suppressed
> [ 4694.290791] containerd-shim: page allocation failure: order:4,
> mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null)
> [ 4694.315266] CPU: 0 PID: 19817 Comm: containerd-shim Not tainted
> 5.8.0-00013-g192f2fd7b678 #15
> [ 4694.317993] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
> 850dfcb4 00000000 ffffffff
> [ 4694.320818] 80a50000 80a576c7 809c4374 00004d69 80ad348c
> 00000001 850dfc58 7750292a
> [ 4694.322695] 00000000 00000000 809c4374 ffff00fe 850dffe0
> 00001400 00000199 00000000
> [ 4694.325083] ffffffff 866f7600 80a50000 878bd778 80a50000
> 80000000 809c2b50 00000000
> [ 4694.326957] 00040cc0 00000000 000001d2 00000000 80a53220
> 7750292a 0000a098 80ad0000
> [ 4694.327750] ...
> [ 4694.340943] Call Trace:
> [ 4694.341181] [<8001ae08>] show_stack+0x6c/0x12c
> [ 4694.355233] [<800f64b0>] warn_alloc+0xa8/0x130
> [ 4694.361283] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
> [ 4694.362839] [<80103110>] ____cache_alloc+0x324/0x8fc
> [ 4694.367439] [<801038e4>] __kmalloc+0x78/0xd8
> [ 4694.376798] [<80195b28>] proc_sys_call_handler+0xf4/0x1d8
> [ 4694.377229] [<80195c44>] proc_sys_read+0x14/0x20
> [ 4694.384090] [<80116274>] vfs_read+0xac/0x108
> [ 4694.385654] [<801165d4>] ksys_read+0x80/0xe0
> [ 4694.395277] [<8001ec8c>] syscall_common+0x34/0x58
> [ 4694.394544] Mem-Info:
> [ 4694.396828] active_anon:661 inactive_anon:942 isolated_anon:0
> [ 4694.396828] active_file:10515 inactive_file:9667 isolated_file:0
> [ 4694.396828] unevictable:0 dirty:2003 writeback:0
> [ 4694.396828] slab_reclaimable:1609 slab_unreclaimable:3103
> [ 4694.396828] mapped:2182 shmem:156 pagetables:207 bounce:0
> [ 4694.396828] free:1635 free_pcp:7 free_cma:0
> [ 4694.405770] Node 0 active_anon:2644kB inactive_anon:3768kB
> active_file:42060kB inactive_file:38668kB unevictable:0kB
> isolated(anon):0kB isolated(file):0kB mapped:8728kB dirty:8048kB
> writeback:0kB shmem:624kB writeback_tmp:0kB all_unreclaimable? no
> [ 4694.408349] Normal free:6484kB min:1376kB low:1720kB high:2064kB
> reserved_highatomic:0KB active_anon:2644kB inactive_anon:3768kB
> active_file:42064kB inactive_file:38724kB unevictable:0kB
> writepending:8060kB present:131072kB managed:118804kB mlocked:0kB
> kernel_stack:584kB pagetables:828kB bounce:0kB free_pcp:32kB
> local_pcp:32kB free_cma:0kB
> [ 4694.409607] lowmem_reserve[]: 0 0 0
> [ 4694.410382] Normal: 117*4kB (UM) 406*8kB (UM) 149*16kB (UME)
> 12*32kB (UME) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB
> 0*4096kB = 6484kB
> [ 4694.418673] 20618 total pagecache pages
> [ 4694.423125] 226 pages in swap cache
> [ 4694.423912] Swap cache stats: add 535090, delete 534864, find
> 234586/366812
> [ 4694.431304] Free swap = 774396kB
> [ 4694.431900] Total swap = 786428kB
> [ 4694.432480] 32768 pages RAM
> [ 4694.432537] 0 pages HighMem/MovableOnly
> [ 4694.441338] 3067 pages reserved
> [ 4694.441770] 0 pages cma reserved
>
> ---------------------------------------------------------
>
> message2:
>
> [ 4426.473667] warn_alloc: 27 callbacks suppressed
> [ 4426.473681] kswapd0: page allocation failure: order:0,
> mode:0xa20(GFP_ATOMIC), nodemask=(null)
> [ 4426.475946] CPU: 0 PID: 439 Comm: kswapd0 Not tainted
> 5.8.0-00013-g192f2fd7b678 #15
> [ 4426.478136] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
> 87c0dccc 00000000 ffffffff
> [ 4426.478301] 80a50000 80a576c7 809c4374 000001b7 80ad348c
> 00000001 87c0dc70 b7c290ba
> [ 4426.478464] 00000000 00000000 809c4374 00000000 0000000f
> 00000000 0000019f 00000000
> [ 4426.478626] bff4ffd7 1c5e5f3c 80ae0000 31672d33 80a50000
> 00000000 809c2b50 00000000
> [ 4426.478787] 00000a20 00000000 00000000 00000000 00000002
> 804d392c 00000000 80ad0000
> [ 4426.478940] ...
> [ 4426.481390] Call Trace:
> [ 4426.483842] [<8001ae08>] show_stack+0x6c/0x12c
> [ 4426.485555] [<800f64b0>] warn_alloc+0xa8/0x130
> [ 4426.487275] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
> [ 4426.487382] [<800f6f80>] page_frag_alloc+0x74/0x144
> [ 4426.489534] [<805fc1a4>] __napi_alloc_skb+0x88/0x118
> [ 4426.491769] [<8052ed8c>] stmmac_napi_poll_rx+0x434/0xa94
> [ 4426.494354] [<80613eb0>] net_rx_action+0x11c/0x310
> [ 4426.496414] [<807ecd0c>] __do_softirq+0x10c/0x258
> [ 4426.498395] [<800320c0>] __irq_exit_rcu+0x68/0xbc
> [ 4426.500365] [<80032324>] irq_exit+0x10/0x1c
> [ 4426.501844] [<804876b4>] plat_irq_dispatch+0x8c/0xb8
> [ 4426.504076] [<800154f8>] handle_int+0x138/0x144
> [ 4426.505883] [<8005280c>] arch_local_irq_enable+0x4/0xc
> [ 4426.508289] Mem-Info:
> [ 4426.510576] active_anon:770 inactive_anon:1763 isolated_anon:0
> [ 4426.510576] active_file:5581 inactive_file:15166 isolated_file:0
> [ 4426.510576] unevictable:0 dirty:1262 writeback:880
> [ 4426.510576] slab_reclaimable:1187 slab_unreclaimable:3016
> [ 4426.510576] mapped:3478 shmem:315 pagetables:186 bounce:0
> [ 4426.510576] free:453 free_pcp:16 free_cma:0
> [ 4426.512469] Node 0 active_anon:3080kB inactive_anon:7052kB
> active_file:22324kB inactive_file:60664kB unevictable:0kB
> isolated(anon):0kB isolated(file):0kB mapped:13912kB dirty:5048kB
> writeback:3520kB shmem:1260kB writeback_tmp:0kB all_unreclaimable? no
> [ 4426.512938] Normal free:1812kB min:5472kB low:5816kB high:6160kB
> reserved_highatomic:0KB active_anon:3080kB inactive_anon:7052kB
> active_file:22324kB inactive_file:60664kB unevictable:0kB
> writepending:8568kB present:131072kB managed:118804kB mlocked:0kB
> kernel_stack:544kB pagetables:744kB bounce:0kB free_pcp:64kB
> local_pcp:64kB free_cma:0kB
> [ 4426.515643] lowmem_reserve[]: 0 0 0
> [ 4426.516400] Normal: 11*4kB (U) 59*8kB (UE) 75*16kB (U) 3*32kB (U)
> 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1812kB
> [ 4426.517399] 21378 total pagecache pages
> [ 4426.518507] 306 pages in swap cache
> [ 4426.519259] Swap cache stats: add 533859, delete 533553, find
> 134676/266712
> [ 4426.520752] Free swap = 777212kB
> [ 4426.521331] Total swap = 786428kB
> [ 4426.521911] 32768 pages RAM
> [ 4426.521973] 0 pages HighMem/MovableOnly
> [ 4426.523072] 3067 pages reserved
> [ 4426.523474] 0 pages cma reserved
>
> ---------------------------------------------------------
>
> message3:
>
> [ 292.077309] CPU 0 Unable to handle kernel paging request at
> virtual address 00000104, epc == 801e7f30, ra == 801e7f24
> [ 292.087904] Oops[#1]:
> [ 292.090169] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted
> 5.9.0-rc1-00016-g8d1e63c37d0d-dirty #1
> [ 292.098768] Workqueue: events cache_reap
> [ 292.102675] $ 0 : 00000000 00000001 808f3bf4 00000122
> [ 292.107887] $ 4 : 808f3bf8 00000100 0000003c 87c02080
> [ 292.113099] $ 8 : 87c01000 8581e301 00000001 00000000
> [ 292.118311] $12 : 87c3dc7c 0000000a 810021c4 00000100
> [ 292.123523] $16 : 85855600 8100218c 86284600 80790000
> [ 292.128735] $20 : 0000003c 00000000 8100219c fffffffe
> [ 292.133946] $24 : 00000122 87c02090
> [ 292.139158] $28 : 87c3c000 87c3dc48 807b0000 801e7f24
> [ 292.144371] Hi : 00000000
> [ 292.147237] Lo : 000c6bf4
> [ 292.150109] epc : 801e7f30 free_block+0x68/0x198
> [ 292.154887] ra : 801e7f24 free_block+0x5c/0x198
> [ 292.159660] Status: 10001402 KERNEL EXL
> [ 292.163569] Cause : 4080800c (ExcCode 03)
> [ 292.167563] BadVA : 00000104
> [ 292.170430] PrId : 00d00100 (Ingenic XBurst)
> [ 292.174776] Process kworker/0:0 (pid: 5, threadinfo=50ecb211,
> task=a81ea849, tls=00000000)
> [ 292.183016] Stack : 87c2e020 87c50cd0 8079e358 00000000 87c01000
> 801e8b14 87c50cd0 87c2e050
> [ 292.191353] 87c50cd0 8014930c 87c3dc7c 87c50ca0 807a0000
> 87c3dc7c 87c3dc7c 018070a3
> [ 292.199689] 80790000 86284600 801e8618 00000000 00000100
> 00000122 00000000 8100219c
> [ 292.208025] fffffffe 801e8544 00000003 00000000 00000000
> 87c3dce0 808f3bf4 00000000
> [ 292.216361] 87c01000 801e8618 87c06300 00000000 00000000
> 87c3dce0 87c01000 85855a80
> [ 292.224697] ...
> [ 292.227132] Call Trace:
> [ 292.229569] [<801e7f30>] free_block+0x68/0x198
> [ 292.234003] [<801e8b14>] ___cache_free+0x1f8/0x2e8
> [ 292.238781] [<801e8544>] kfree+0x48/0x6c
> [ 292.242693] [<801e8618>] kmem_freepages+0xb0/0x124
> [ 292.247471] [<801e86e0>] slab_destroy+0x48/0x7c
> [ 292.251989] [<801e8778>] slabs_destroy+0x64/0x94
> [ 292.256593] [<801e8b4c>] ___cache_free+0x230/0x2e8
> [ 292.261372] [<801e8544>] kfree+0x48/0x6c
> [ 292.265283] [<801e8618>] kmem_freepages+0xb0/0x124
> [ 292.270062] [<801e86e0>] slab_destroy+0x48/0x7c
> [ 292.274580] [<801e8778>] slabs_destroy+0x64/0x94
> [ 292.279185] [<801e8d90>] drain_array.isra.59.constprop.61+0xb4/0xdc
> [ 292.285437] [<801e8f84>] cache_reap+0x64/0x120
> [ 292.289869] [<80137204>] process_one_work+0x1b8/0x25c
> [ 292.294907] [<80137588>] worker_thread+0x294/0x3c4
> [ 292.299684] [<8013cfe0>] kthread+0x148/0x150
> [ 292.303941] [<8010506c>] ret_from_kernel_thread+0x14/0x1c
> [ 292.309324] Code: 8c430008 8c450004 24440004 <aca30004> ac650000
> 8c430014 ac4f0004 ac580008 8d0a0014
> [ 292.319053]
> [ 292.320591] ---[ end trace 2a1f2afba7a08ca1 ]---
> [ 292.325197] Kernel panic - not syncing: Fatal exception
> [ 292.330409] Rebooting in 10 seconds..
>
> these three kinds of message appear at random. Sometimes they will
> appear at the beginning of the compilation, and sometimes they will
> appear after tens of minutes of compilation.
>
> Thanks and best regards!
>
> 在 2020/8/12 上午8:14, Paul Cercueil 写道:
>> Hi,
>>
>> Changes since V1:
>>
>> - the get_system_type() now will simply return the "system_type"
>> variable if non-NULL, and the various boards can set this pointer
>> should they want to set a custom value. The .get_system_type
>> callback that v1 added to the struct mips_machine is gone.
>>
>> - the board-ingenic.c has been modified accordingly.
>>
>> - patch [06/13] is new, it makes sure that the kernel's command line
>> is
>> initialized properly and includes the parameters passed by the
>> bootloader.
>>
>> - the cu1830-neo board defconfig has now been regenerated in patch
>> [12/13].
>>
>> Cheers,
>> -Paul
>>
>> Paul Cercueil (13):
>> MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA
>> MIPS: cpu-probe: Mark XBurst CPU as having vtagged caches
>> MIPS: cpu-probe: ingenic: Fix broken BUG_ON
>> MIPS: Kconfig: add MIPS_GENERIC_KERNEL symbol
>> MIPS: generic: Allow boards to set system type
>> MIPS: generic: Init command line with fw_init_cmdline()
>> MIPS: generic: Support booting with built-in or appended DTB
>> MIPS: generic: Add support for zboot
>> MIPS: generic: Increase NR_IRQS to 256
>> MIPS: generic: Add support for Ingenic SoCs
>> MIPS: jz4740: Drop folder
>> MIPS: configs: Regenerate configs of Ingenic boards
>> MAINTAINERS: Update paths to Ingenic platform code
>>
>> MAINTAINERS | 4 +-
>> arch/mips/Kbuild.platforms | 1 -
>> arch/mips/Kconfig | 43 ++++--
>> arch/mips/configs/ci20_defconfig | 4 +-
>> arch/mips/configs/cu1000-neo_defconfig | 16 +-
>> arch/mips/configs/cu1830-neo_defconfig | 15 +-
>> arch/mips/configs/gcw0_defconfig | 2 +-
>> arch/mips/configs/qi_lb60_defconfig | 5 +-
>> arch/mips/configs/rs90_defconfig | 4 +-
>> arch/mips/generic/Kconfig | 8 +-
>> arch/mips/generic/Makefile | 1 +
>> arch/mips/generic/Platform | 1 +
>> arch/mips/generic/board-ingenic.c | 108 +++++++++++++
>> arch/mips/generic/init.c | 11 +-
>> arch/mips/generic/proc.c | 5 +
>> arch/mips/include/asm/mach-generic/irq.h | 2 +-
>> .../asm/mach-jz4740/cpu-feature-overrides.h | 50 ------
>> arch/mips/include/asm/mach-jz4740/irq.h | 13 --
>> arch/mips/include/asm/pgtable-bits.h | 5 -
>> arch/mips/{jz4740 => ingenic}/Kconfig | 16 +-
>> arch/mips/jz4740/Makefile | 9 --
>> arch/mips/jz4740/Platform | 3 -
>> arch/mips/jz4740/setup.c | 145
>> ------------------
>> arch/mips/kernel/cpu-probe.c | 8 +-
>> 24 files changed, 186 insertions(+), 293 deletions(-)
>> create mode 100644 arch/mips/generic/board-ingenic.c
>> delete mode 100644
>> arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
>> delete mode 100644 arch/mips/include/asm/mach-jz4740/irq.h
>> rename arch/mips/{jz4740 => ingenic}/Kconfig (91%)
>> delete mode 100644 arch/mips/jz4740/Makefile
>> delete mode 100644 arch/mips/jz4740/Platform
>> delete mode 100644 arch/mips/jz4740/setup.c
>>
Le mer. 19 août 2020 à 17:35, Paul Cercueil <[email protected]> a
écrit :
> Hi Zhou,
>
> Le mer. 19 août 2020 à 22:12, Zhou Yanjie
> <[email protected]> a écrit :
>> Hi Paul,
>>
>> I have some good news and some bad news.
>>
>> Good news is:
>>
>> I tested this series of patches on CU1000-Neo & CU1830-Neo, and it
>> can boot normally and log in to debian normally.
>>
>> Bad news is:
>>
>> 1. Because we dropped arch/mips/jz4740/setup.c, so it did not return
>> MACH_INGENIC_XXXX correctly, which caused the correction of the L2
>> cache probe in arch/mips/mm/sc-mips.c to fail, causing JZ4770/X1000
>> to detect the L2 cache capacity incorrect.
>
> It's properly detected here on JZ4770. The detection code was just
> moved to arch/mips/generic/board-ingenic.c.
>
>> 2. When I did some heavy work (compiled docker source code after
>> logging in with ssh), the following message appeared:
>
> Chances are that these messages are related. Stuff like that tends to
> appear in -rc1 and get fixed afterwards.
I meant are *NOT* related :)
-Paul
>
> Cheers,
> -Paul
>
>> message1:
>>
>> [ 4694.290776] warn_alloc: 25 callbacks suppressed
>> [ 4694.290791] containerd-shim: page allocation failure: order:4,
>> mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null)
>> [ 4694.315266] CPU: 0 PID: 19817 Comm: containerd-shim Not tainted
>> 5.8.0-00013-g192f2fd7b678 #15
>> [ 4694.317993] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
>> 850dfcb4 00000000 ffffffff
>> [ 4694.320818] 80a50000 80a576c7 809c4374 00004d69 80ad348c
>> 00000001 850dfc58 7750292a
>> [ 4694.322695] 00000000 00000000 809c4374 ffff00fe 850dffe0
>> 00001400 00000199 00000000
>> [ 4694.325083] ffffffff 866f7600 80a50000 878bd778 80a50000
>> 80000000 809c2b50 00000000
>> [ 4694.326957] 00040cc0 00000000 000001d2 00000000 80a53220
>> 7750292a 0000a098 80ad0000
>> [ 4694.327750] ...
>> [ 4694.340943] Call Trace:
>> [ 4694.341181] [<8001ae08>] show_stack+0x6c/0x12c
>> [ 4694.355233] [<800f64b0>] warn_alloc+0xa8/0x130
>> [ 4694.361283] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
>> [ 4694.362839] [<80103110>] ____cache_alloc+0x324/0x8fc
>> [ 4694.367439] [<801038e4>] __kmalloc+0x78/0xd8
>> [ 4694.376798] [<80195b28>] proc_sys_call_handler+0xf4/0x1d8
>> [ 4694.377229] [<80195c44>] proc_sys_read+0x14/0x20
>> [ 4694.384090] [<80116274>] vfs_read+0xac/0x108
>> [ 4694.385654] [<801165d4>] ksys_read+0x80/0xe0
>> [ 4694.395277] [<8001ec8c>] syscall_common+0x34/0x58
>> [ 4694.394544] Mem-Info:
>> [ 4694.396828] active_anon:661 inactive_anon:942 isolated_anon:0
>> [ 4694.396828] active_file:10515 inactive_file:9667 isolated_file:0
>> [ 4694.396828] unevictable:0 dirty:2003 writeback:0
>> [ 4694.396828] slab_reclaimable:1609 slab_unreclaimable:3103
>> [ 4694.396828] mapped:2182 shmem:156 pagetables:207 bounce:0
>> [ 4694.396828] free:1635 free_pcp:7 free_cma:0
>> [ 4694.405770] Node 0 active_anon:2644kB inactive_anon:3768kB
>> active_file:42060kB inactive_file:38668kB unevictable:0kB
>> isolated(anon):0kB isolated(file):0kB mapped:8728kB dirty:8048kB
>> writeback:0kB shmem:624kB writeback_tmp:0kB all_unreclaimable? no
>> [ 4694.408349] Normal free:6484kB min:1376kB low:1720kB high:2064kB
>> reserved_highatomic:0KB active_anon:2644kB inactive_anon:3768kB
>> active_file:42064kB inactive_file:38724kB unevictable:0kB
>> writepending:8060kB present:131072kB managed:118804kB mlocked:0kB
>> kernel_stack:584kB pagetables:828kB bounce:0kB free_pcp:32kB
>> local_pcp:32kB free_cma:0kB
>> [ 4694.409607] lowmem_reserve[]: 0 0 0
>> [ 4694.410382] Normal: 117*4kB (UM) 406*8kB (UM) 149*16kB (UME)
>> 12*32kB (UME) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB
>> 0*4096kB = 6484kB
>> [ 4694.418673] 20618 total pagecache pages
>> [ 4694.423125] 226 pages in swap cache
>> [ 4694.423912] Swap cache stats: add 535090, delete 534864, find
>> 234586/366812
>> [ 4694.431304] Free swap = 774396kB
>> [ 4694.431900] Total swap = 786428kB
>> [ 4694.432480] 32768 pages RAM
>> [ 4694.432537] 0 pages HighMem/MovableOnly
>> [ 4694.441338] 3067 pages reserved
>> [ 4694.441770] 0 pages cma reserved
>>
>> ---------------------------------------------------------
>>
>> message2:
>>
>> [ 4426.473667] warn_alloc: 27 callbacks suppressed
>> [ 4426.473681] kswapd0: page allocation failure: order:0,
>> mode:0xa20(GFP_ATOMIC), nodemask=(null)
>> [ 4426.475946] CPU: 0 PID: 439 Comm: kswapd0 Not tainted
>> 5.8.0-00013-g192f2fd7b678 #15
>> [ 4426.478136] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
>> 87c0dccc 00000000 ffffffff
>> [ 4426.478301] 80a50000 80a576c7 809c4374 000001b7 80ad348c
>> 00000001 87c0dc70 b7c290ba
>> [ 4426.478464] 00000000 00000000 809c4374 00000000 0000000f
>> 00000000 0000019f 00000000
>> [ 4426.478626] bff4ffd7 1c5e5f3c 80ae0000 31672d33 80a50000
>> 00000000 809c2b50 00000000
>> [ 4426.478787] 00000a20 00000000 00000000 00000000 00000002
>> 804d392c 00000000 80ad0000
>> [ 4426.478940] ...
>> [ 4426.481390] Call Trace:
>> [ 4426.483842] [<8001ae08>] show_stack+0x6c/0x12c
>> [ 4426.485555] [<800f64b0>] warn_alloc+0xa8/0x130
>> [ 4426.487275] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
>> [ 4426.487382] [<800f6f80>] page_frag_alloc+0x74/0x144
>> [ 4426.489534] [<805fc1a4>] __napi_alloc_skb+0x88/0x118
>> [ 4426.491769] [<8052ed8c>] stmmac_napi_poll_rx+0x434/0xa94
>> [ 4426.494354] [<80613eb0>] net_rx_action+0x11c/0x310
>> [ 4426.496414] [<807ecd0c>] __do_softirq+0x10c/0x258
>> [ 4426.498395] [<800320c0>] __irq_exit_rcu+0x68/0xbc
>> [ 4426.500365] [<80032324>] irq_exit+0x10/0x1c
>> [ 4426.501844] [<804876b4>] plat_irq_dispatch+0x8c/0xb8
>> [ 4426.504076] [<800154f8>] handle_int+0x138/0x144
>> [ 4426.505883] [<8005280c>] arch_local_irq_enable+0x4/0xc
>> [ 4426.508289] Mem-Info:
>> [ 4426.510576] active_anon:770 inactive_anon:1763 isolated_anon:0
>> [ 4426.510576] active_file:5581 inactive_file:15166 isolated_file:0
>> [ 4426.510576] unevictable:0 dirty:1262 writeback:880
>> [ 4426.510576] slab_reclaimable:1187 slab_unreclaimable:3016
>> [ 4426.510576] mapped:3478 shmem:315 pagetables:186 bounce:0
>> [ 4426.510576] free:453 free_pcp:16 free_cma:0
>> [ 4426.512469] Node 0 active_anon:3080kB inactive_anon:7052kB
>> active_file:22324kB inactive_file:60664kB unevictable:0kB
>> isolated(anon):0kB isolated(file):0kB mapped:13912kB dirty:5048kB
>> writeback:3520kB shmem:1260kB writeback_tmp:0kB all_unreclaimable?
>> no
>> [ 4426.512938] Normal free:1812kB min:5472kB low:5816kB high:6160kB
>> reserved_highatomic:0KB active_anon:3080kB inactive_anon:7052kB
>> active_file:22324kB inactive_file:60664kB unevictable:0kB
>> writepending:8568kB present:131072kB managed:118804kB mlocked:0kB
>> kernel_stack:544kB pagetables:744kB bounce:0kB free_pcp:64kB
>> local_pcp:64kB free_cma:0kB
>> [ 4426.515643] lowmem_reserve[]: 0 0 0
>> [ 4426.516400] Normal: 11*4kB (U) 59*8kB (UE) 75*16kB (U) 3*32kB (U)
>> 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1812kB
>> [ 4426.517399] 21378 total pagecache pages
>> [ 4426.518507] 306 pages in swap cache
>> [ 4426.519259] Swap cache stats: add 533859, delete 533553, find
>> 134676/266712
>> [ 4426.520752] Free swap = 777212kB
>> [ 4426.521331] Total swap = 786428kB
>> [ 4426.521911] 32768 pages RAM
>> [ 4426.521973] 0 pages HighMem/MovableOnly
>> [ 4426.523072] 3067 pages reserved
>> [ 4426.523474] 0 pages cma reserved
>>
>> ---------------------------------------------------------
>>
>> message3:
>>
>> [ 292.077309] CPU 0 Unable to handle kernel paging request at
>> virtual address 00000104, epc == 801e7f30, ra == 801e7f24
>> [ 292.087904] Oops[#1]:
>> [ 292.090169] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted
>> 5.9.0-rc1-00016-g8d1e63c37d0d-dirty #1
>> [ 292.098768] Workqueue: events cache_reap
>> [ 292.102675] $ 0 : 00000000 00000001 808f3bf4 00000122
>> [ 292.107887] $ 4 : 808f3bf8 00000100 0000003c 87c02080
>> [ 292.113099] $ 8 : 87c01000 8581e301 00000001 00000000
>> [ 292.118311] $12 : 87c3dc7c 0000000a 810021c4 00000100
>> [ 292.123523] $16 : 85855600 8100218c 86284600 80790000
>> [ 292.128735] $20 : 0000003c 00000000 8100219c fffffffe
>> [ 292.133946] $24 : 00000122 87c02090
>> [ 292.139158] $28 : 87c3c000 87c3dc48 807b0000 801e7f24
>> [ 292.144371] Hi : 00000000
>> [ 292.147237] Lo : 000c6bf4
>> [ 292.150109] epc : 801e7f30 free_block+0x68/0x198
>> [ 292.154887] ra : 801e7f24 free_block+0x5c/0x198
>> [ 292.159660] Status: 10001402 KERNEL EXL
>> [ 292.163569] Cause : 4080800c (ExcCode 03)
>> [ 292.167563] BadVA : 00000104
>> [ 292.170430] PrId : 00d00100 (Ingenic XBurst)
>> [ 292.174776] Process kworker/0:0 (pid: 5, threadinfo=50ecb211,
>> task=a81ea849, tls=00000000)
>> [ 292.183016] Stack : 87c2e020 87c50cd0 8079e358 00000000 87c01000
>> 801e8b14 87c50cd0 87c2e050
>> [ 292.191353] 87c50cd0 8014930c 87c3dc7c 87c50ca0 807a0000
>> 87c3dc7c 87c3dc7c 018070a3
>> [ 292.199689] 80790000 86284600 801e8618 00000000 00000100
>> 00000122 00000000 8100219c
>> [ 292.208025] fffffffe 801e8544 00000003 00000000 00000000
>> 87c3dce0 808f3bf4 00000000
>> [ 292.216361] 87c01000 801e8618 87c06300 00000000 00000000
>> 87c3dce0 87c01000 85855a80
>> [ 292.224697] ...
>> [ 292.227132] Call Trace:
>> [ 292.229569] [<801e7f30>] free_block+0x68/0x198
>> [ 292.234003] [<801e8b14>] ___cache_free+0x1f8/0x2e8
>> [ 292.238781] [<801e8544>] kfree+0x48/0x6c
>> [ 292.242693] [<801e8618>] kmem_freepages+0xb0/0x124
>> [ 292.247471] [<801e86e0>] slab_destroy+0x48/0x7c
>> [ 292.251989] [<801e8778>] slabs_destroy+0x64/0x94
>> [ 292.256593] [<801e8b4c>] ___cache_free+0x230/0x2e8
>> [ 292.261372] [<801e8544>] kfree+0x48/0x6c
>> [ 292.265283] [<801e8618>] kmem_freepages+0xb0/0x124
>> [ 292.270062] [<801e86e0>] slab_destroy+0x48/0x7c
>> [ 292.274580] [<801e8778>] slabs_destroy+0x64/0x94
>> [ 292.279185] [<801e8d90>]
>> drain_array.isra.59.constprop.61+0xb4/0xdc
>> [ 292.285437] [<801e8f84>] cache_reap+0x64/0x120
>> [ 292.289869] [<80137204>] process_one_work+0x1b8/0x25c
>> [ 292.294907] [<80137588>] worker_thread+0x294/0x3c4
>> [ 292.299684] [<8013cfe0>] kthread+0x148/0x150
>> [ 292.303941] [<8010506c>] ret_from_kernel_thread+0x14/0x1c
>> [ 292.309324] Code: 8c430008 8c450004 24440004 <aca30004>
>> ac650000 8c430014 ac4f0004 ac580008 8d0a0014
>> [ 292.319053]
>> [ 292.320591] ---[ end trace 2a1f2afba7a08ca1 ]---
>> [ 292.325197] Kernel panic - not syncing: Fatal exception
>> [ 292.330409] Rebooting in 10 seconds..
>>
>> these three kinds of message appear at random. Sometimes they will
>> appear at the beginning of the compilation, and sometimes they will
>> appear after tens of minutes of compilation.
>>
>> Thanks and best regards!
>>
>> 在 2020/8/12 上午8:14, Paul Cercueil 写道:
>>> Hi,
>>>
>>> Changes since V1:
>>>
>>> - the get_system_type() now will simply return the "system_type"
>>> variable if non-NULL, and the various boards can set this pointer
>>> should they want to set a custom value. The .get_system_type
>>> callback that v1 added to the struct mips_machine is gone.
>>>
>>> - the board-ingenic.c has been modified accordingly.
>>>
>>> - patch [06/13] is new, it makes sure that the kernel's command
>>> line is
>>> initialized properly and includes the parameters passed by the
>>> bootloader.
>>>
>>> - the cu1830-neo board defconfig has now been regenerated in patch
>>> [12/13].
>>>
>>> Cheers,
>>> -Paul
>>>
>>> Paul Cercueil (13):
>>> MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA
>>> MIPS: cpu-probe: Mark XBurst CPU as having vtagged caches
>>> MIPS: cpu-probe: ingenic: Fix broken BUG_ON
>>> MIPS: Kconfig: add MIPS_GENERIC_KERNEL symbol
>>> MIPS: generic: Allow boards to set system type
>>> MIPS: generic: Init command line with fw_init_cmdline()
>>> MIPS: generic: Support booting with built-in or appended DTB
>>> MIPS: generic: Add support for zboot
>>> MIPS: generic: Increase NR_IRQS to 256
>>> MIPS: generic: Add support for Ingenic SoCs
>>> MIPS: jz4740: Drop folder
>>> MIPS: configs: Regenerate configs of Ingenic boards
>>> MAINTAINERS: Update paths to Ingenic platform code
>>>
>>> MAINTAINERS | 4 +-
>>> arch/mips/Kbuild.platforms | 1 -
>>> arch/mips/Kconfig | 43 ++++--
>>> arch/mips/configs/ci20_defconfig | 4 +-
>>> arch/mips/configs/cu1000-neo_defconfig | 16 +-
>>> arch/mips/configs/cu1830-neo_defconfig | 15 +-
>>> arch/mips/configs/gcw0_defconfig | 2 +-
>>> arch/mips/configs/qi_lb60_defconfig | 5 +-
>>> arch/mips/configs/rs90_defconfig | 4 +-
>>> arch/mips/generic/Kconfig | 8 +-
>>> arch/mips/generic/Makefile | 1 +
>>> arch/mips/generic/Platform | 1 +
>>> arch/mips/generic/board-ingenic.c | 108 +++++++++++++
>>> arch/mips/generic/init.c | 11 +-
>>> arch/mips/generic/proc.c | 5 +
>>> arch/mips/include/asm/mach-generic/irq.h | 2 +-
>>> .../asm/mach-jz4740/cpu-feature-overrides.h | 50 ------
>>> arch/mips/include/asm/mach-jz4740/irq.h | 13 --
>>> arch/mips/include/asm/pgtable-bits.h | 5 -
>>> arch/mips/{jz4740 => ingenic}/Kconfig | 16 +-
>>> arch/mips/jz4740/Makefile | 9 --
>>> arch/mips/jz4740/Platform | 3 -
>>> arch/mips/jz4740/setup.c | 145
>>> ------------------
>>> arch/mips/kernel/cpu-probe.c | 8 +-
>>> 24 files changed, 186 insertions(+), 293 deletions(-)
>>> create mode 100644 arch/mips/generic/board-ingenic.c
>>> delete mode 100644
>>> arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
>>> delete mode 100644 arch/mips/include/asm/mach-jz4740/irq.h
>>> rename arch/mips/{jz4740 => ingenic}/Kconfig (91%)
>>> delete mode 100644 arch/mips/jz4740/Makefile
>>> delete mode 100644 arch/mips/jz4740/Platform
>>> delete mode 100644 arch/mips/jz4740/setup.c
>>>
>
在 2020/8/19 下午11:35, Paul Cercueil 写道:
> Hi Zhou,
>
> Le mer. 19 août 2020 à 22:12, Zhou Yanjie <[email protected]>
> a écrit :
>> Hi Paul,
>>
>> I have some good news and some bad news.
>>
>> Good news is:
>>
>> I tested this series of patches on CU1000-Neo & CU1830-Neo, and it
>> can boot normally and log in to debian normally.
>>
>> Bad news is:
>>
>> 1. Because we dropped arch/mips/jz4740/setup.c, so it did not return
>> MACH_INGENIC_XXXX correctly, which caused the correction of the L2
>> cache probe in arch/mips/mm/sc-mips.c to fail, causing JZ4770/X1000
>> to detect the L2 cache capacity incorrect.
>
> It's properly detected here on JZ4770. The detection code was just
> moved to arch/mips/generic/board-ingenic.c.
>
>> 2. When I did some heavy work (compiled docker source code after
>> logging in with ssh), the following message appeared:
>
> Chances are that these messages are related. Stuff like that tends to
> appear in -rc1 and get fixed afterwards.
OK, I will wait for -rc2 and try again.
Thanks and best regards!
>
> Cheers,
> -Paul
>
>> message1:
>>
>> [ 4694.290776] warn_alloc: 25 callbacks suppressed
>> [ 4694.290791] containerd-shim: page allocation failure: order:4,
>> mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null)
>> [ 4694.315266] CPU: 0 PID: 19817 Comm: containerd-shim Not tainted
>> 5.8.0-00013-g192f2fd7b678 #15
>> [ 4694.317993] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
>> 850dfcb4 00000000 ffffffff
>> [ 4694.320818] 80a50000 80a576c7 809c4374 00004d69 80ad348c
>> 00000001 850dfc58 7750292a
>> [ 4694.322695] 00000000 00000000 809c4374 ffff00fe 850dffe0
>> 00001400 00000199 00000000
>> [ 4694.325083] ffffffff 866f7600 80a50000 878bd778 80a50000
>> 80000000 809c2b50 00000000
>> [ 4694.326957] 00040cc0 00000000 000001d2 00000000 80a53220
>> 7750292a 0000a098 80ad0000
>> [ 4694.327750] ...
>> [ 4694.340943] Call Trace:
>> [ 4694.341181] [<8001ae08>] show_stack+0x6c/0x12c
>> [ 4694.355233] [<800f64b0>] warn_alloc+0xa8/0x130
>> [ 4694.361283] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
>> [ 4694.362839] [<80103110>] ____cache_alloc+0x324/0x8fc
>> [ 4694.367439] [<801038e4>] __kmalloc+0x78/0xd8
>> [ 4694.376798] [<80195b28>] proc_sys_call_handler+0xf4/0x1d8
>> [ 4694.377229] [<80195c44>] proc_sys_read+0x14/0x20
>> [ 4694.384090] [<80116274>] vfs_read+0xac/0x108
>> [ 4694.385654] [<801165d4>] ksys_read+0x80/0xe0
>> [ 4694.395277] [<8001ec8c>] syscall_common+0x34/0x58
>> [ 4694.394544] Mem-Info:
>> [ 4694.396828] active_anon:661 inactive_anon:942 isolated_anon:0
>> [ 4694.396828] active_file:10515 inactive_file:9667 isolated_file:0
>> [ 4694.396828] unevictable:0 dirty:2003 writeback:0
>> [ 4694.396828] slab_reclaimable:1609 slab_unreclaimable:3103
>> [ 4694.396828] mapped:2182 shmem:156 pagetables:207 bounce:0
>> [ 4694.396828] free:1635 free_pcp:7 free_cma:0
>> [ 4694.405770] Node 0 active_anon:2644kB inactive_anon:3768kB
>> active_file:42060kB inactive_file:38668kB unevictable:0kB
>> isolated(anon):0kB isolated(file):0kB mapped:8728kB dirty:8048kB
>> writeback:0kB shmem:624kB writeback_tmp:0kB all_unreclaimable? no
>> [ 4694.408349] Normal free:6484kB min:1376kB low:1720kB high:2064kB
>> reserved_highatomic:0KB active_anon:2644kB inactive_anon:3768kB
>> active_file:42064kB inactive_file:38724kB unevictable:0kB
>> writepending:8060kB present:131072kB managed:118804kB mlocked:0kB
>> kernel_stack:584kB pagetables:828kB bounce:0kB free_pcp:32kB
>> local_pcp:32kB free_cma:0kB
>> [ 4694.409607] lowmem_reserve[]: 0 0 0
>> [ 4694.410382] Normal: 117*4kB (UM) 406*8kB (UM) 149*16kB (UME)
>> 12*32kB (UME) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB
>> 0*4096kB = 6484kB
>> [ 4694.418673] 20618 total pagecache pages
>> [ 4694.423125] 226 pages in swap cache
>> [ 4694.423912] Swap cache stats: add 535090, delete 534864, find
>> 234586/366812
>> [ 4694.431304] Free swap = 774396kB
>> [ 4694.431900] Total swap = 786428kB
>> [ 4694.432480] 32768 pages RAM
>> [ 4694.432537] 0 pages HighMem/MovableOnly
>> [ 4694.441338] 3067 pages reserved
>> [ 4694.441770] 0 pages cma reserved
>>
>> ---------------------------------------------------------
>>
>> message2:
>>
>> [ 4426.473667] warn_alloc: 27 callbacks suppressed
>> [ 4426.473681] kswapd0: page allocation failure: order:0,
>> mode:0xa20(GFP_ATOMIC), nodemask=(null)
>> [ 4426.475946] CPU: 0 PID: 439 Comm: kswapd0 Not tainted
>> 5.8.0-00013-g192f2fd7b678 #15
>> [ 4426.478136] Stack : 80ae0000 80a50000 80860000 809b8fb0 809e4a30
>> 87c0dccc 00000000 ffffffff
>> [ 4426.478301] 80a50000 80a576c7 809c4374 000001b7 80ad348c
>> 00000001 87c0dc70 b7c290ba
>> [ 4426.478464] 00000000 00000000 809c4374 00000000 0000000f
>> 00000000 0000019f 00000000
>> [ 4426.478626] bff4ffd7 1c5e5f3c 80ae0000 31672d33 80a50000
>> 00000000 809c2b50 00000000
>> [ 4426.478787] 00000a20 00000000 00000000 00000000 00000002
>> 804d392c 00000000 80ad0000
>> [ 4426.478940] ...
>> [ 4426.481390] Call Trace:
>> [ 4426.483842] [<8001ae08>] show_stack+0x6c/0x12c
>> [ 4426.485555] [<800f64b0>] warn_alloc+0xa8/0x130
>> [ 4426.487275] [<800f6dfc>] __alloc_pages_nodemask+0x8a4/0x8d8
>> [ 4426.487382] [<800f6f80>] page_frag_alloc+0x74/0x144
>> [ 4426.489534] [<805fc1a4>] __napi_alloc_skb+0x88/0x118
>> [ 4426.491769] [<8052ed8c>] stmmac_napi_poll_rx+0x434/0xa94
>> [ 4426.494354] [<80613eb0>] net_rx_action+0x11c/0x310
>> [ 4426.496414] [<807ecd0c>] __do_softirq+0x10c/0x258
>> [ 4426.498395] [<800320c0>] __irq_exit_rcu+0x68/0xbc
>> [ 4426.500365] [<80032324>] irq_exit+0x10/0x1c
>> [ 4426.501844] [<804876b4>] plat_irq_dispatch+0x8c/0xb8
>> [ 4426.504076] [<800154f8>] handle_int+0x138/0x144
>> [ 4426.505883] [<8005280c>] arch_local_irq_enable+0x4/0xc
>> [ 4426.508289] Mem-Info:
>> [ 4426.510576] active_anon:770 inactive_anon:1763 isolated_anon:0
>> [ 4426.510576] active_file:5581 inactive_file:15166 isolated_file:0
>> [ 4426.510576] unevictable:0 dirty:1262 writeback:880
>> [ 4426.510576] slab_reclaimable:1187 slab_unreclaimable:3016
>> [ 4426.510576] mapped:3478 shmem:315 pagetables:186 bounce:0
>> [ 4426.510576] free:453 free_pcp:16 free_cma:0
>> [ 4426.512469] Node 0 active_anon:3080kB inactive_anon:7052kB
>> active_file:22324kB inactive_file:60664kB unevictable:0kB
>> isolated(anon):0kB isolated(file):0kB mapped:13912kB dirty:5048kB
>> writeback:3520kB shmem:1260kB writeback_tmp:0kB all_unreclaimable? no
>> [ 4426.512938] Normal free:1812kB min:5472kB low:5816kB high:6160kB
>> reserved_highatomic:0KB active_anon:3080kB inactive_anon:7052kB
>> active_file:22324kB inactive_file:60664kB unevictable:0kB
>> writepending:8568kB present:131072kB managed:118804kB mlocked:0kB
>> kernel_stack:544kB pagetables:744kB bounce:0kB free_pcp:64kB
>> local_pcp:64kB free_cma:0kB
>> [ 4426.515643] lowmem_reserve[]: 0 0 0
>> [ 4426.516400] Normal: 11*4kB (U) 59*8kB (UE) 75*16kB (U) 3*32kB (U)
>> 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1812kB
>> [ 4426.517399] 21378 total pagecache pages
>> [ 4426.518507] 306 pages in swap cache
>> [ 4426.519259] Swap cache stats: add 533859, delete 533553, find
>> 134676/266712
>> [ 4426.520752] Free swap = 777212kB
>> [ 4426.521331] Total swap = 786428kB
>> [ 4426.521911] 32768 pages RAM
>> [ 4426.521973] 0 pages HighMem/MovableOnly
>> [ 4426.523072] 3067 pages reserved
>> [ 4426.523474] 0 pages cma reserved
>>
>> ---------------------------------------------------------
>>
>> message3:
>>
>> [ 292.077309] CPU 0 Unable to handle kernel paging request at
>> virtual address 00000104, epc == 801e7f30, ra == 801e7f24
>> [ 292.087904] Oops[#1]:
>> [ 292.090169] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted
>> 5.9.0-rc1-00016-g8d1e63c37d0d-dirty #1
>> [ 292.098768] Workqueue: events cache_reap
>> [ 292.102675] $ 0 : 00000000 00000001 808f3bf4 00000122
>> [ 292.107887] $ 4 : 808f3bf8 00000100 0000003c 87c02080
>> [ 292.113099] $ 8 : 87c01000 8581e301 00000001 00000000
>> [ 292.118311] $12 : 87c3dc7c 0000000a 810021c4 00000100
>> [ 292.123523] $16 : 85855600 8100218c 86284600 80790000
>> [ 292.128735] $20 : 0000003c 00000000 8100219c fffffffe
>> [ 292.133946] $24 : 00000122 87c02090
>> [ 292.139158] $28 : 87c3c000 87c3dc48 807b0000 801e7f24
>> [ 292.144371] Hi : 00000000
>> [ 292.147237] Lo : 000c6bf4
>> [ 292.150109] epc : 801e7f30 free_block+0x68/0x198
>> [ 292.154887] ra : 801e7f24 free_block+0x5c/0x198
>> [ 292.159660] Status: 10001402 KERNEL EXL
>> [ 292.163569] Cause : 4080800c (ExcCode 03)
>> [ 292.167563] BadVA : 00000104
>> [ 292.170430] PrId : 00d00100 (Ingenic XBurst)
>> [ 292.174776] Process kworker/0:0 (pid: 5, threadinfo=50ecb211,
>> task=a81ea849, tls=00000000)
>> [ 292.183016] Stack : 87c2e020 87c50cd0 8079e358 00000000 87c01000
>> 801e8b14 87c50cd0 87c2e050
>> [ 292.191353] 87c50cd0 8014930c 87c3dc7c 87c50ca0 807a0000
>> 87c3dc7c 87c3dc7c 018070a3
>> [ 292.199689] 80790000 86284600 801e8618 00000000 00000100
>> 00000122 00000000 8100219c
>> [ 292.208025] fffffffe 801e8544 00000003 00000000 00000000
>> 87c3dce0 808f3bf4 00000000
>> [ 292.216361] 87c01000 801e8618 87c06300 00000000 00000000
>> 87c3dce0 87c01000 85855a80
>> [ 292.224697] ...
>> [ 292.227132] Call Trace:
>> [ 292.229569] [<801e7f30>] free_block+0x68/0x198
>> [ 292.234003] [<801e8b14>] ___cache_free+0x1f8/0x2e8
>> [ 292.238781] [<801e8544>] kfree+0x48/0x6c
>> [ 292.242693] [<801e8618>] kmem_freepages+0xb0/0x124
>> [ 292.247471] [<801e86e0>] slab_destroy+0x48/0x7c
>> [ 292.251989] [<801e8778>] slabs_destroy+0x64/0x94
>> [ 292.256593] [<801e8b4c>] ___cache_free+0x230/0x2e8
>> [ 292.261372] [<801e8544>] kfree+0x48/0x6c
>> [ 292.265283] [<801e8618>] kmem_freepages+0xb0/0x124
>> [ 292.270062] [<801e86e0>] slab_destroy+0x48/0x7c
>> [ 292.274580] [<801e8778>] slabs_destroy+0x64/0x94
>> [ 292.279185] [<801e8d90>] drain_array.isra.59.constprop.61+0xb4/0xdc
>> [ 292.285437] [<801e8f84>] cache_reap+0x64/0x120
>> [ 292.289869] [<80137204>] process_one_work+0x1b8/0x25c
>> [ 292.294907] [<80137588>] worker_thread+0x294/0x3c4
>> [ 292.299684] [<8013cfe0>] kthread+0x148/0x150
>> [ 292.303941] [<8010506c>] ret_from_kernel_thread+0x14/0x1c
>> [ 292.309324] Code: 8c430008 8c450004 24440004 <aca30004> ac650000
>> 8c430014 ac4f0004 ac580008 8d0a0014
>> [ 292.319053]
>> [ 292.320591] ---[ end trace 2a1f2afba7a08ca1 ]---
>> [ 292.325197] Kernel panic - not syncing: Fatal exception
>> [ 292.330409] Rebooting in 10 seconds..
>>
>> these three kinds of message appear at random. Sometimes they will
>> appear at the beginning of the compilation, and sometimes they will
>> appear after tens of minutes of compilation.
>>
>> Thanks and best regards!
>>
>> 在 2020/8/12 上午8:14, Paul Cercueil 写道:
>>> Hi,
>>>
>>> Changes since V1:
>>>
>>> - the get_system_type() now will simply return the "system_type"
>>> variable if non-NULL, and the various boards can set this pointer
>>> should they want to set a custom value. The .get_system_type
>>> callback that v1 added to the struct mips_machine is gone.
>>>
>>> - the board-ingenic.c has been modified accordingly.
>>>
>>> - patch [06/13] is new, it makes sure that the kernel's command line is
>>> initialized properly and includes the parameters passed by the
>>> bootloader.
>>>
>>> - the cu1830-neo board defconfig has now been regenerated in patch
>>> [12/13].
>>>
>>> Cheers,
>>> -Paul
>>>
>>> Paul Cercueil (13):
>>> MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA
>>> MIPS: cpu-probe: Mark XBurst CPU as having vtagged caches
>>> MIPS: cpu-probe: ingenic: Fix broken BUG_ON
>>> MIPS: Kconfig: add MIPS_GENERIC_KERNEL symbol
>>> MIPS: generic: Allow boards to set system type
>>> MIPS: generic: Init command line with fw_init_cmdline()
>>> MIPS: generic: Support booting with built-in or appended DTB
>>> MIPS: generic: Add support for zboot
>>> MIPS: generic: Increase NR_IRQS to 256
>>> MIPS: generic: Add support for Ingenic SoCs
>>> MIPS: jz4740: Drop folder
>>> MIPS: configs: Regenerate configs of Ingenic boards
>>> MAINTAINERS: Update paths to Ingenic platform code
>>>
>>> MAINTAINERS | 4 +-
>>> arch/mips/Kbuild.platforms | 1 -
>>> arch/mips/Kconfig | 43 ++++--
>>> arch/mips/configs/ci20_defconfig | 4 +-
>>> arch/mips/configs/cu1000-neo_defconfig | 16 +-
>>> arch/mips/configs/cu1830-neo_defconfig | 15 +-
>>> arch/mips/configs/gcw0_defconfig | 2 +-
>>> arch/mips/configs/qi_lb60_defconfig | 5 +-
>>> arch/mips/configs/rs90_defconfig | 4 +-
>>> arch/mips/generic/Kconfig | 8 +-
>>> arch/mips/generic/Makefile | 1 +
>>> arch/mips/generic/Platform | 1 +
>>> arch/mips/generic/board-ingenic.c | 108 +++++++++++++
>>> arch/mips/generic/init.c | 11 +-
>>> arch/mips/generic/proc.c | 5 +
>>> arch/mips/include/asm/mach-generic/irq.h | 2 +-
>>> .../asm/mach-jz4740/cpu-feature-overrides.h | 50 ------
>>> arch/mips/include/asm/mach-jz4740/irq.h | 13 --
>>> arch/mips/include/asm/pgtable-bits.h | 5 -
>>> arch/mips/{jz4740 => ingenic}/Kconfig | 16 +-
>>> arch/mips/jz4740/Makefile | 9 --
>>> arch/mips/jz4740/Platform | 3 -
>>> arch/mips/jz4740/setup.c | 145
>>> ------------------
>>> arch/mips/kernel/cpu-probe.c | 8 +-
>>> 24 files changed, 186 insertions(+), 293 deletions(-)
>>> create mode 100644 arch/mips/generic/board-ingenic.c
>>> delete mode 100644
>>> arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
>>> delete mode 100644 arch/mips/include/asm/mach-jz4740/irq.h
>>> rename arch/mips/{jz4740 => ingenic}/Kconfig (91%)
>>> delete mode 100644 arch/mips/jz4740/Makefile
>>> delete mode 100644 arch/mips/jz4740/Platform
>>> delete mode 100644 arch/mips/jz4740/setup.c
>>>
>