Skip to contentSkip to conversation

csky fixes

PATCH In review Guenter Roeck 2 participants 6 messages Sep 17, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover csky fixes

The following series of patches enables building csky:allmodconfig with upstream gcc.

----------------------------------------------------------------
Guenter Roeck (3):
csky: Select ARCH_WANT_FRAME_POINTERS only if compiler supports it
csky: bitops: Remove duplicate __clear_bit define
csky: Make HAVE_TCM depend on !COMPILE_TEST

 arch/csky/Kconfig              | 3 ++-
 arch/csky/include/asm/bitops.h | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/3 csky: Select ARCH_WANT_FRAME_POINTERS only if compiler supports it

Compiling csky:allmodconfig with an upstream C compiler results in the following error.

csky-linux-gcc: error:

	unrecognized command-line option '-mbacktrace';
	did you mean '-fbacktrace'?

Select ARCH_WANT_FRAME_POINTERS only if gcc supports it to avoid the error.

---
 arch/csky/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/csky/Kconfig +1 -1
index 9d4d898df76b..58ca3ef02bab 100644
@@ -8,7 +8,7 @@ config CSKY
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_QUEUED_RWLOCKS
-	select ARCH_WANT_FRAME_POINTERS if !CPU_CK610
+	select ARCH_WANT_FRAME_POINTERS if !CPU_CK610 && $(cc-option,-mbacktrace)
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
 	select COMMON_CLK
 	select CLKSRC_MMIO
Signature · 1 line
2.33.0
maintainer
#2 lore raw

Re: [PATCH 1/3] csky: Select ARCH_WANT_FRAME_POINTERS only if compiler supports it

Acked, thx. It'll in next-tree.

Quoted 32 lines · Guenter Roeck

Compiling csky:allmodconfig with an upstream C compiler results in the following error.

csky-linux-gcc: error:
unrecognized command-line option '-mbacktrace'; did you mean '-fbacktrace'?

Select ARCH_WANT_FRAME_POINTERS only if gcc supports it to avoid the error.

---
 arch/csky/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/csky/Kconfig +1 -2
index 9d4d898df76b..58ca3ef02bab 100644
@@ -8,7 +8,7 @@ config CSKY
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
        select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_QUEUED_RWLOCKS
-       select ARCH_WANT_FRAME_POINTERS if !CPU_CK610
+       select ARCH_WANT_FRAME_POINTERS if !CPU_CK610 && $(cc-option,-mbacktrace)
        select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
        select COMMON_CLK
        select CLKSRC_MMIO
--

2.33.0

Signature · 4 lines
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/
#3 lore raw

PATCH 2/3 csky: bitops: Remove duplicate __clear_bit define

In reply to Guenter Roeck

Building csky:allmodconfig results in the following build error.

In file included from ./include/linux/bitops.h:33,

                 from ./include/linux/log2.h:12,
                 from kernel/bounds.c:13:

./arch/csky/include/asm/bitops.h:77: error: "__clear_bit" redefined

Since commit 9248e52fec95 ("locking/atomic: simplify non-atomic wrappers"), __clear_bit is defined in include/asm-generic/bitops/non-atomic.h, and the define in the csky include file is no longer necessary or useful. Remove it.

Fixes 9248e52fec95 ("locking/atomic: simplify non-atomic wrappers")
---
 arch/csky/include/asm/bitops.h | 1 -
 1 file changed, 1 deletion(-)
arch/csky/include/asm/bitops.h +0 -1
index 91818787d860..02b72a000767 100644
@@ -74,7 +74,6 @@ static __always_inline unsigned long __fls(unsigned long x)
  * bug fix, why only could use atomic!!!!
  */
 #include <asm-generic/bitops/non-atomic.h>
-#define __clear_bit(nr, vaddr) clear_bit(nr, vaddr)
 
 #include <asm-generic/bitops/le.h>
 #include <asm-generic/bitops/ext2-atomic.h>
Signature · 1 line
2.33.0
#4 lore raw

PATCH 3/3 csky: Make HAVE_TCM depend on !COMPILE_TEST

In reply to Guenter Roeck

Building csky:allmodconfig results in the following build errors.

arch/csky/mm/tcm.c:9:2: error:
#error "You should define ITCM_RAM_BASE"
9 | #error "You should define ITCM_RAM_BASE"
| ^~~~~
arch/csky/mm/tcm.c:14:2: error:
#error "You should define DTCM_RAM_BASE"
14 | #error "You should define DTCM_RAM_BASE"

      |  ^~~~~

arch/csky/mm/tcm.c:18:2: error:
#error "You should define correct DTCM_RAM_BASE"
18 | #error "You should define correct DTCM_RAM_BASE"

This is seen with compile tests since those enable HAVE_TCM, but do not provide useful default values for ITCM_RAM_BASE or DTCM_RAM_BASE. Disable HAVE_TCM for commpile tests to avoid the error.

---
 arch/csky/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/csky/Kconfig +1 -0
index 58ca3ef02bab..823d3d5a9e11 100644
@@ -241,6 +241,7 @@ endchoice
 
 menuconfig HAVE_TCM
 	bool "Tightly-Coupled/Sram Memory"
+	depends on !COMPILE_TEST
 	help
 	  The implementation are not only used by TCM (Tightly-Coupled Meory)
 	  but also used by sram on SOC bus. It follow existed linux tcm
Signature · 1 line
2.33.0
maintainer
#5 lore raw

Re: [PATCH 3/3] csky: Make HAVE_TCM depend on !COMPILE_TEST

Acked, thx. It'll in next-tree.

Quoted 40 lines · Guenter Roeck

Building csky:allmodconfig results in the following build errors.

arch/csky/mm/tcm.c:9:2: error:
#error "You should define ITCM_RAM_BASE"
9 | #error "You should define ITCM_RAM_BASE"
| ^~~~~
arch/csky/mm/tcm.c:14:2: error:
#error "You should define DTCM_RAM_BASE"
14 | #error "You should define DTCM_RAM_BASE"

      |  ^~~~~

arch/csky/mm/tcm.c:18:2: error:
#error "You should define correct DTCM_RAM_BASE"
18 | #error "You should define correct DTCM_RAM_BASE"

This is seen with compile tests since those enable HAVE_TCM, but do not provide useful default values for ITCM_RAM_BASE or DTCM_RAM_BASE. Disable HAVE_TCM for commpile tests to avoid the error.

---
 arch/csky/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/csky/Kconfig +1 -1
index 58ca3ef02bab..823d3d5a9e11 100644
@@ -241,6 +241,7 @@ endchoice
 
 menuconfig HAVE_TCM
        bool "Tightly-Coupled/Sram Memory"
+       depends on !COMPILE_TEST
        help
          The implementation are not only used by TCM (Tightly-Coupled Meory)
          but also used by sram on SOC bus. It follow existed linux tcm
--

2.33.0

Signature · 4 lines
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/