Эх сурвалжийг харах

Merge tag 'for-4.19' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux

Pull arch/h8300 updates from Yoshinori Sato.

* tag 'for-4.19' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux:
  h8300: fix IRQ no
  arch/h8300: add a defconfig target
  arch/h8300: eliminate kgbd.c warning
  arch/h8300: eliminate ptrace.h warnings
  h8300:let the checker know that size_t is ulong
  h8300: Don't include linux/kernel.h in asm/atomic.h
  h8300: remove unnecessary of_platform_populate call
  h8300: Correct signature of test_bit()
  h8300: irqchip: fix warning
  h8300: switch to NO_BOOTMEM
  h8300: gcc-8.1 fix
  h8300: Add missing output register.
Linus Torvalds 7 жил өмнө
parent
commit
20a9e57a09

+ 1 - 0
arch/h8300/Kconfig

@@ -16,6 +16,7 @@ config H8300
 	select OF_IRQ
 	select OF_IRQ
 	select OF_EARLY_FLATTREE
 	select OF_EARLY_FLATTREE
 	select HAVE_MEMBLOCK
 	select HAVE_MEMBLOCK
+	select NO_BOOTMEM
 	select TIMER_OF
 	select TIMER_OF
 	select H8300_TMR8
 	select H8300_TMR8
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_GZIP

+ 4 - 0
arch/h8300/Makefile

@@ -8,6 +8,8 @@
 # (C) Copyright 2002-2015 Yoshinori Sato <ysato@users.sourceforge.jp>
 # (C) Copyright 2002-2015 Yoshinori Sato <ysato@users.sourceforge.jp>
 #
 #
 
 
+KBUILD_DEFCONFIG := edosk2674_defconfig
+
 cflags-$(CONFIG_CPU_H8300H)	:= -mh
 cflags-$(CONFIG_CPU_H8300H)	:= -mh
 aflags-$(CONFIG_CPU_H8300H)	:= -mh -Wa,--mach=h8300h
 aflags-$(CONFIG_CPU_H8300H)	:= -mh -Wa,--mach=h8300h
 ldflags-$(CONFIG_CPU_H8300H)	:= -mh8300helf_linux
 ldflags-$(CONFIG_CPU_H8300H)	:= -mh8300helf_linux
@@ -22,6 +24,8 @@ KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 KBUILD_AFLAGS += $(aflags-y)
 KBUILD_AFLAGS += $(aflags-y)
 LDFLAGS += $(ldflags-y)
 LDFLAGS += $(ldflags-y)
 
 
+CHECKFLAGS += -msize-long
+
 ifeq ($(CROSS_COMPILE),)
 ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := h8300-unknown-linux-
 CROSS_COMPILE := h8300-unknown-linux-
 endif
 endif

+ 1 - 1
arch/h8300/boot/dts/h8300h_sim.dts

@@ -73,7 +73,7 @@
 	timer16: timer@ffff68 {
 	timer16: timer@ffff68 {
 		compatible = "renesas,16bit-timer";
 		compatible = "renesas,16bit-timer";
 		reg = <0xffff68 8>, <0xffff60 8>;
 		reg = <0xffff68 8>, <0xffff60 8>;
-		interrupts = <24 0>;
+		interrupts = <26 0>;
 		renesas,channel = <0>;
 		renesas,channel = <0>;
 		clocks = <&fclk>;
 		clocks = <&fclk>;
 		clock-names = "fck";
 		clock-names = "fck";

+ 7 - 7
arch/h8300/include/asm/bitops.h

@@ -29,11 +29,11 @@ static inline unsigned long ffz(unsigned long word)
 
 
 	result = -1;
 	result = -1;
 	__asm__("1:\n\t"
 	__asm__("1:\n\t"
-		"shlr.l %2\n\t"
+		"shlr.l %1\n\t"
 		"adds #1,%0\n\t"
 		"adds #1,%0\n\t"
 		"bcs 1b"
 		"bcs 1b"
-		: "=r"(result)
-		: "0"(result), "r"(word));
+		: "=r"(result),"=r"(word)
+		: "0"(result), "1"(word));
 	return result;
 	return result;
 }
 }
 
 
@@ -66,7 +66,7 @@ H8300_GEN_BITOP(change_bit, "bnot")
 
 
 #undef H8300_GEN_BITOP
 #undef H8300_GEN_BITOP
 
 
-static inline int test_bit(int nr, const unsigned long *addr)
+static inline int test_bit(int nr, const volatile unsigned long *addr)
 {
 {
 	int ret = 0;
 	int ret = 0;
 	unsigned char *b_addr;
 	unsigned char *b_addr;
@@ -162,11 +162,11 @@ static inline unsigned long __ffs(unsigned long word)
 
 
 	result = -1;
 	result = -1;
 	__asm__("1:\n\t"
 	__asm__("1:\n\t"
-		"shlr.l %2\n\t"
+		"shlr.l %1\n\t"
 		"adds #1,%0\n\t"
 		"adds #1,%0\n\t"
 		"bcc 1b"
 		"bcc 1b"
-		: "=r" (result)
-		: "0"(result), "r"(word));
+		: "=r" (result),"=r"(word)
+		: "0"(result), "1"(word));
 	return result;
 	return result;
 }
 }
 
 

+ 2 - 0
arch/h8300/include/asm/ptrace.h

@@ -4,6 +4,8 @@
 
 
 #include <uapi/asm/ptrace.h>
 #include <uapi/asm/ptrace.h>
 
 
+struct task_struct;
+
 #ifndef __ASSEMBLY__
 #ifndef __ASSEMBLY__
 #ifndef PS_S
 #ifndef PS_S
 #define PS_S  (0x10)
 #define PS_S  (0x10)

+ 1 - 1
arch/h8300/kernel/kgdb.c

@@ -129,7 +129,7 @@ void kgdb_arch_exit(void)
 	/* Nothing to do */
 	/* Nothing to do */
 }
 }
 
 
-const struct kgdb_arch arch_kgdb_ops = {
+struct kgdb_arch arch_kgdb_ops = {
 	/* Breakpoint instruction: trapa #2 */
 	/* Breakpoint instruction: trapa #2 */
 	.gdb_bpt_instr = { 0x57, 0x20 },
 	.gdb_bpt_instr = { 0x57, 0x20 },
 };
 };

+ 8 - 38
arch/h8300/kernel/setup.c

@@ -23,7 +23,6 @@
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
 #include <linux/of_fdt.h>
-#include <linux/of_platform.h>
 #include <linux/of_address.h>
 #include <linux/of_address.h>
 #include <linux/clk-provider.h>
 #include <linux/clk-provider.h>
 #include <linux/memblock.h>
 #include <linux/memblock.h>
@@ -71,10 +70,6 @@ void __init h8300_fdt_init(void *fdt, char *bootargs)
 
 
 static void __init bootmem_init(void)
 static void __init bootmem_init(void)
 {
 {
-	int bootmap_size;
-	unsigned long ram_start_pfn;
-	unsigned long free_ram_start_pfn;
-	unsigned long ram_end_pfn;
 	struct memblock_region *region;
 	struct memblock_region *region;
 
 
 	memory_end = memory_start = 0;
 	memory_end = memory_start = 0;
@@ -88,33 +83,17 @@ static void __init bootmem_init(void)
 	if (!memory_end)
 	if (!memory_end)
 		panic("No memory!");
 		panic("No memory!");
 
 
-	ram_start_pfn = PFN_UP(memory_start);
-	/* free_ram_start_pfn is first page after kernel */
-	free_ram_start_pfn = PFN_UP(__pa(_end));
-	ram_end_pfn = PFN_DOWN(memblock_end_of_DRAM());
+	/* setup bootmem globals (we use no_bootmem, but mm still depends on this) */
+	min_low_pfn = PFN_UP(memory_start);
+	max_low_pfn = PFN_DOWN(memblock_end_of_DRAM());
+	max_pfn = max_low_pfn;
 
 
-	max_pfn = ram_end_pfn;
+	memblock_reserve(__pa(_stext), _end - _stext);
 
 
-	/*
-	 * give all the memory to the bootmap allocator,  tell it to put the
-	 * boot mem_map at the start of memory
-	 */
-	bootmap_size = init_bootmem_node(NODE_DATA(0),
-					 free_ram_start_pfn,
-					 0,
-					 ram_end_pfn);
-	/*
-	 * free the usable memory,  we have to make sure we do not free
-	 * the bootmem bitmap so we then reserve it after freeing it :-)
-	 */
-	free_bootmem(PFN_PHYS(free_ram_start_pfn),
-		     (ram_end_pfn - free_ram_start_pfn) << PAGE_SHIFT);
-	reserve_bootmem(PFN_PHYS(free_ram_start_pfn), bootmap_size,
-			BOOTMEM_DEFAULT);
+	early_init_fdt_reserve_self();
+	early_init_fdt_scan_reserved_mem();
 
 
-	for_each_memblock(reserved, region) {
-		reserve_bootmem(region->base, region->size, BOOTMEM_DEFAULT);
-	}
+	memblock_dump_all();
 }
 }
 
 
 void __init setup_arch(char **cmdline_p)
 void __init setup_arch(char **cmdline_p)
@@ -188,15 +167,6 @@ const struct seq_operations cpuinfo_op = {
 	.show	= show_cpuinfo,
 	.show	= show_cpuinfo,
 };
 };
 
 
-static int __init device_probe(void)
-{
-	of_platform_populate(NULL, NULL, NULL, NULL);
-
-	return 0;
-}
-
-device_initcall(device_probe);
-
 #if defined(CONFIG_CPU_H8300H)
 #if defined(CONFIG_CPU_H8300H)
 #define get_wait(base, addr) ({		\
 #define get_wait(base, addr) ({		\
 	int baddr;			\
 	int baddr;			\

+ 4 - 3
arch/h8300/kernel/sim-console.c

@@ -13,12 +13,13 @@
 
 
 static void sim_write(struct console *con, const char *s, unsigned n)
 static void sim_write(struct console *con, const char *s, unsigned n)
 {
 {
-	register const int fd __asm__("er0") = 1; /* stdout */
 	register const char *_ptr __asm__("er1") = s;
 	register const char *_ptr __asm__("er1") = s;
 	register const unsigned _len __asm__("er2") = n;
 	register const unsigned _len __asm__("er2") = n;
 
 
-	__asm__(".byte 0x5e,0x00,0x00,0xc7\n\t" /* jsr @0xc7 (sys_write) */
-		: : "g"(fd), "g"(_ptr), "g"(_len));
+	__asm__("sub.l er0,er0\n\t"		/* er0 = 1 (stdout) */
+		"inc.l #1,er0\n\t"
+		".byte 0x5e,0x00,0x00,0xc7\n\t" /* jsr @0xc7 (sys_write) */
+		: : "g"(_ptr), "g"(_len):"er0");
 }
 }
 
 
 static int __init sim_setup(struct earlycon_device *device, const char *opt)
 static int __init sim_setup(struct earlycon_device *device, const char *opt)

+ 3 - 3
drivers/irqchip/irq-renesas-h8s.c

@@ -12,7 +12,7 @@
 #include <asm/io.h>
 #include <asm/io.h>
 
 
 static void *intc_baseaddr;
 static void *intc_baseaddr;
-#define IPRA ((unsigned long)intc_baseaddr)
+#define IPRA (intc_baseaddr)
 
 
 static const unsigned char ipr_table[] = {
 static const unsigned char ipr_table[] = {
 	0x03, 0x02, 0x01, 0x00, 0x13, 0x12, 0x11, 0x10, /* 16 - 23 */
 	0x03, 0x02, 0x01, 0x00, 0x13, 0x12, 0x11, 0x10, /* 16 - 23 */
@@ -34,7 +34,7 @@ static const unsigned char ipr_table[] = {
 static void h8s_disable_irq(struct irq_data *data)
 static void h8s_disable_irq(struct irq_data *data)
 {
 {
 	int pos;
 	int pos;
-	unsigned int addr;
+	void __iomem *addr;
 	unsigned short pri;
 	unsigned short pri;
 	int irq = data->irq;
 	int irq = data->irq;
 
 
@@ -48,7 +48,7 @@ static void h8s_disable_irq(struct irq_data *data)
 static void h8s_enable_irq(struct irq_data *data)
 static void h8s_enable_irq(struct irq_data *data)
 {
 {
 	int pos;
 	int pos;
-	unsigned int addr;
+	void __iomem *addr;
 	unsigned short pri;
 	unsigned short pri;
 	int irq = data->irq;
 	int irq = data->irq;