Skip to contentSkip to conversation

Re-introduce h8300 architecture

PATCH Superseded Yoshinori Sato 4 participants 29 messages May 4, 2015 – May 7, 2015

Subsystems (14)

v10 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH v10 1/19 MAINTENRS: Add h8300

In reply to Yoshinori Sato
---
 CREDITS     |  5 -----
 MAINTAINERS | 11 +++++++++++
 2 files changed, 11 insertions(+), 5 deletions(-)
CREDITS +0 -5
index 40cc4bf..e88b597 100644
@@ -3219,11 +3219,6 @@ N: Dipankar Sarma
 E: [email protected]
 D: RCU
 
-N: Yoshinori Sato
-E: [email protected]
-D: uClinux for Renesas H8/300 (H8300)
-D: http://uclinux-h8.sourceforge.jp/
-
 N: Hannu Savolainen
 E: [email protected]
 D: Maintainer of the sound drivers until 2.1.x days.
MAINTAINERS +10 -0
index 781e099..8ea1fb8 100644
@@ -4480,6 +4480,17 @@ T:	git git://linuxtv.org/media_tree.git
 S:	Maintained
 F:	drivers/media/usb/stk1160/
 
+H8/300 ARCHITECTURE
+M:	Yoshinori Sato <[email protected]>
+L:	[email protected]
+W:	http://uclinux-h8.sourceforge.jp
+T:	git git://git.sourceforge.jp/gitroot/uclinux-h8/linux.git
+S:	Maintained
+F:	arch/h8300/
+F:	drivers/clocksource/h8300/
+F:	drivers/clk/h8300
+
 HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER
 M:	Frank Seidel <[email protected]>
 L:	[email protected]
Signature · 1 line
2.1.4
author maintainer
#4 lore raw

PATCH v10 4/19 sh-sci: Add H8/300 SCI.

In reply to Yoshinori Sato

H8/300 internal serial controller of same as sh-sci. So h8300 use SH_SCI.
And add sci bindings.

---
 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt | 1 +
 drivers/tty/serial/Kconfig                                      | 2 +-
 drivers/tty/serial/sh-sci.c                                     | 6 ++++++
 3 files changed, 8 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/renesas,sci-serial.txt +1 -0
index ae73bb0..7534d46 100644
@@ -29,6 +29,7 @@ Required properties:
     - "renesas,scifa" for generic SCIFA compatible UART.
     - "renesas,scifb" for generic SCIFB compatible UART.
     - "renesas,hscif" for generic HSCIF compatible UART.
+    - "renesas,sci" for generic SCI compatible UART.
 
     When compatible with the generic version, nodes must list the
     SoC-specific version corresponding to the platform first followed by the
drivers/tty/serial/Kconfig +1 -1
index f8120c1..dea1eff 100644
@@ -728,7 +728,7 @@ config SERIAL_IP22_ZILOG_CONSOLE
 
 config SERIAL_SH_SCI
 	tristate "SuperH SCI(F) serial port support"
-	depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
+	depends on SUPERH || ARCH_SHMOBILE || H8300 || COMPILE_TEST
 	select SERIAL_CORE
 
 config SERIAL_SH_SCI_NR_UARTS
drivers/tty/serial/sh-sci.c +6 -0
index e7d6566..1468ec5 100644
@@ -2536,6 +2536,12 @@ static const struct of_device_id of_sci_match[] = {
 			.regtype = SCIx_HSCIF_REGTYPE,
 		},
 	}, {
+		.compatible = "renesas,sci",
+		.data = &(const struct sci_port_info) {
+			.type = PORT_SCI,
+			.regtype = SCIx_SCI_REGTYPE,
+		},
+	}, {
 		/* Terminator */
 	},
 };
Signature · 1 line
2.1.4
author maintainer
#6 lore raw

PATCH v10 5/19 Add common asm-offsets.h

In reply to Yoshinori Sato
---
 include/asm-generic/asm-offsets.h | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 include/asm-generic/asm-offsets.h
include/asm-generic/asm-offsets.h new file +1 -0
new file mode 100644
index 0000000..d370ee3
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>
Signature · 1 line
2.1.4
author maintainer
#12 lore raw

PATCH v10 9/19 h8300: kernel booting

In reply to Yoshinori Sato

zImage startup / kernel entry point / arch depend startup

---
 arch/h8300/boot/Makefile               |  26 ++++
 arch/h8300/boot/compressed/Makefile    |  37 ++++++
 arch/h8300/boot/compressed/head.S      |  48 +++++++
 arch/h8300/boot/compressed/misc.c      |  74 +++++++++++
 arch/h8300/boot/compressed/vmlinux.lds |  32 +++++
 arch/h8300/boot/compressed/vmlinux.scr |   9 ++
 arch/h8300/kernel/head_ram.S           |  60 +++++++++
 arch/h8300/kernel/head_rom.S           | 110 ++++++++++++++++
 arch/h8300/kernel/setup.c              | 227 +++++++++++++++++++++++++++++++++
 9 files changed, 623 insertions(+)
 create mode 100644 arch/h8300/boot/Makefile
 create mode 100644 arch/h8300/boot/compressed/Makefile
 create mode 100644 arch/h8300/boot/compressed/head.S
 create mode 100644 arch/h8300/boot/compressed/misc.c
 create mode 100644 arch/h8300/boot/compressed/vmlinux.lds
 create mode 100644 arch/h8300/boot/compressed/vmlinux.scr
 create mode 100644 arch/h8300/kernel/head_ram.S
 create mode 100644 arch/h8300/kernel/head_rom.S
 create mode 100644 arch/h8300/kernel/setup.c
arch/h8300/boot/Makefile new file +26 -0
new file mode 100644
index 0000000..2f6393a
@@ -0,0 +1,26 @@
+# arch/h8300/boot/Makefile
+
+targets := vmlinux.srec vmlinux.bin zImage
+subdir- := compressed
+
+OBJCOPYFLAGS_vmlinux.srec := -Osrec
+OBJCOPYFLAGS_vmlinux.bin  := -Obinary
+OBJCOPYFLAGS_zImage := -O binary -R .note -R .comment -R .stab -R .stabstr -S
+
+UIMAGE_LOADADDR = $(CONFIG_RAMBASE)
+UIMAGE_ENTRYADDR = $(shell /bin/bash -c 'printf "0x%08x" \
+	$$[$(CONFIG_RAMBASE) + $(CONFIG_OFFSET)]')
+
+$(obj)/vmlinux.srec $(obj)/vmlinux.bin:  vmlinux FORCE
+	$(call if_changed,objcopy)
+
+$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
+	$(call if_changed,objcopy)
+
+$(obj)/compressed/vmlinux: FORCE
+	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
+
+$(obj)/uImage.bin: $(obj)/vmlinux.bin
+	$(call if_changed,uimage,none)
+
+CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec arch/$(ARCH)/uImage.bin
arch/h8300/boot/compressed/Makefile new file +37 -0
new file mode 100644
index 0000000..87d03b7
@@ -0,0 +1,37 @@
+#
+# linux/arch/sh/boot/compressed/Makefile
+#
+# create a compressed vmlinux image from the original vmlinux
+#
+
+targets		:= vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
+
+OBJECTS = $(obj)/head.o $(obj)/misc.o
+
+#
+# IMAGE_OFFSET is the load offset of the compression loader
+# Assign dummy values if these 2 variables are not defined,
+# in order to suppress error message.
+#
+CONFIG_MEMORY_START     ?= 0x00400000
+CONFIG_BOOT_LINK_OFFSET ?= 0x00140000
+IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET))))
+
+LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
+LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup $(obj)/vmlinux.lds
+
+$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
+	$(call if_changed,ld)
+	@:
+
+$(obj)/vmlinux.bin: vmlinux FORCE
+	$(call if_changed,objcopy)
+
+$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
+	$(call if_changed,gzip)
+
+LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T
+OBJCOPYFLAGS := -O binary
+
+$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
+	$(call if_changed,ld)
arch/h8300/boot/compressed/head.S new file +48 -0

48 lines not on this page · raw message

arch/h8300/boot/compressed/misc.c new file +74 -0

74 lines not on this page · raw message

arch/h8300/boot/compressed/vmlinux.lds new file +32 -0
new file mode 100644
index 0000000..a0a3a0e
@@ -0,0 +1,32 @@
+SECTIONS
+{
+        .text :
+        {
+        __stext = . ;
+	__text = .;
+	       *(.text..startup)
+	       *(.text)
+        __etext = . ;
+        }
+
+	.rodata :
+	{
+		*(.rodata)
+	}
+        .data :
+
+        {
+        __sdata = . ;
+        ___data_start = . ;
+                *(.data.*)
+	}
+        .bss :
+        {
+        . = ALIGN(0x4) ;
+        __sbss = . ;
+                *(.bss*)
+        . = ALIGN(0x4) ;
+        __ebss = . ;
+        __end = . ;
+        }
+}
arch/h8300/boot/compressed/vmlinux.scr new file +9 -0
new file mode 100644
index 0000000..a0849036
@@ -0,0 +1,9 @@
+SECTIONS
+{
+  .data : {
+	input_len = .;
+	LONG(input_data_end - input_data) input_data = .;
+	*(.data)
+	input_data_end = .;
+	}
+}
arch/h8300/kernel/head_ram.S new file +60 -0

60 lines not on this page · raw message

arch/h8300/kernel/head_rom.S new file +110 -0

110 lines not on this page · raw message

arch/h8300/kernel/setup.c new file +227 -0

227 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#16 lore raw

PATCH v10 13/19 h8300: Memory management

In reply to Yoshinori Sato
---
 arch/h8300/mm/Makefile |   5 ++
 arch/h8300/mm/fault.c  |  57 ++++++++++++++++++++++
 arch/h8300/mm/init.c   | 128 +++++++++++++++++++++++++++++++++++++++++++++++++
 arch/h8300/mm/memory.c |  53 ++++++++++++++++++++
 4 files changed, 243 insertions(+)
 create mode 100644 arch/h8300/mm/Makefile
 create mode 100644 arch/h8300/mm/fault.c
 create mode 100644 arch/h8300/mm/init.c
 create mode 100644 arch/h8300/mm/memory.c
arch/h8300/mm/Makefile new file +5 -0
new file mode 100644
index 0000000..508697f
@@ -0,0 +1,5 @@
+#
+# Makefile for the linux h8300-specific parts of the memory manager.
+#
+
+obj-y	 := init.o fault.o memory.o
arch/h8300/mm/fault.c new file +57 -0

57 lines not on this page · raw message

arch/h8300/mm/init.c new file +128 -0

128 lines not on this page · raw message

arch/h8300/mm/memory.c new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#20 lore raw

PATCH v10 17/19 h8300: clocksource

In reply to Yoshinori Sato

H8/300 internal timer driver.
h8300_timer8 - 8bit Timer driver. h8300_timer16 - 16bit Timer driver (only H8/3069).
h8300_tpu - Timer Pulse Unit driver (only H8S2678).

---
 .../bindings/timer/renesas,16bit-timer.txt         |  25 ++
 .../bindings/timer/renesas,8bit-timer.txt          |  31 ++
 .../devicetree/bindings/timer/renesas,tpu.txt      |  21 ++
 drivers/clocksource/Kconfig                        |   6 +
 drivers/clocksource/Makefile                       |   3 +
 drivers/clocksource/h8300_timer16.c                | 335 +++++++++++++++++
 drivers/clocksource/h8300_timer8.c                 | 405 +++++++++++++++++++++
 drivers/clocksource/h8300_tpu.c                    | 207 +++++++++++
 include/dt-bindings/clock/renesas,8bit-timer.h     |  11 +
 9 files changed, 1044 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/renesas,16bit-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/renesas,8bit-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/renesas,tpu.txt
 create mode 100644 drivers/clocksource/h8300_timer16.c
 create mode 100644 drivers/clocksource/h8300_timer8.c
 create mode 100644 drivers/clocksource/h8300_tpu.c
 create mode 100644 include/dt-bindings/clock/renesas,8bit-timer.h
Documentation/devicetree/bindings/timer/renesas,16bit-timer.txt new file +25 -0
new file mode 100644
index 0000000..e879244
@@ -0,0 +1,25 @@
+* Renesas H8/300 16bit timer
+
+The 16bit timer is a 16bit timer/counter with configurable clock inputs and
+programmable compare match.
+
+Required Properties:
+
+  - compatible: must contain "renesas,16bit-timer"
+  - reg: base address and length of the registers block for the timer module.
+  - interrupts: interrupt-specifier for the timer, IMIA
+  - clocks: a list of phandle, one for each entry in clock-names.
+  - clock-names: must contain "peripheral_clk" for the functional clock.
+  - renesas,channel: timer channel number.
+
+Example:
+
+	timer16: timer@ffff68 {
+		compatible = "reneas,16bit-timer";
+		reg = <0xffff68 8>, <0xffff60 8>;
+		interrupts = <24>;
+		renesas,channel = <0>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+
Documentation/devicetree/bindings/timer/renesas,8bit-timer.txt new file +31 -0
new file mode 100644
index 0000000..50a42a9
@@ -0,0 +1,31 @@
+* Renesas H8/300 8bit timer
+
+The 8bit timer is a 8bit timer/counter with configurable clock inputs and
+programmable compare match.
+
+This implement only supported cascade mode.
+
+Required Properties:
+
+  - compatible: must contain "renesas,8bit-timer"
+  - reg: base address and length of the registers block for the timer module.
+  - interrupts: interrupt-specifier for the timer, CMIA and TOVI
+  - clocks: a list of phandle, one for each entry in clock-names.
+  - clock-names: must contain "fck" for the functional clock.
+
+  - renesas,mode: clocksource or clockevents
+  - renesas,div: prescaler divide rate
+
+
+Example:
+
+	timer8_0: timer@ffff80 {
+		compatible = "renesas,8bit-timer";
+		reg = <0xffff80 10>;
+		interrupts = <36 39>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+		renesas,mode = "clocksource";
+		renesas,div = <0>;
+	};
+
Documentation/devicetree/bindings/timer/renesas,tpu.txt new file +21 -0
new file mode 100644
index 0000000..f8b2589
@@ -0,0 +1,21 @@
+* Renesas H8/300 Timer Pluse Unit
+
+The TPU is a 16bit timer/counter with configurable clock inputs and
+programmable compare match.
+This implementation support only cascade mode.
+
+Required Properties:
+
+  - compatible: must contain "renesas,tpu"
+  - reg: base address and length of the registers block in 2 channel.
+  - clocks: a list of phandle, one for each entry in clock-names.
+  - clock-names: must contain "peripheral_clk" for the functional clock.
+
+
+Example:
+	tpu: tpu@ffffe0 {
+		compatible = "renesas,tpu";
+		reg = <0xffffe0 16>, <0xfffff0 12>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
drivers/clocksource/Kconfig +6 -0
index 51d7865f..96e2513 100644
@@ -258,4 +258,10 @@ config CLKSRC_PXA
 	help
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
+config H8300_TMR16
+        bool
+
+config H8300_TPU
+        bool
+
 endmenu
drivers/clocksource/Makefile +3 -0
index 5b85f6a..8288c4e 100644
@@ -52,3 +52,6 @@ obj-$(CONFIG_ARCH_INTEGRATOR_AP)	+= timer-integrator-ap.o
 obj-$(CONFIG_CLKSRC_VERSATILE)		+= versatile.o
 obj-$(CONFIG_CLKSRC_MIPS_GIC)		+= mips-gic-timer.o
 obj-$(CONFIG_ASM9260_TIMER)		+= asm9260_timer.o
+obj-$(CONFIG_H8300)			+= h8300_timer8.o
+obj-$(CONFIG_H8300_TMR16)		+= h8300_timer16.o
+obj-$(CONFIG_H8300_TPU)			+= h8300_tpu.o
drivers/clocksource/h8300_timer16.c new file +335 -0

335 lines not on this page · raw message

drivers/clocksource/h8300_timer8.c new file +405 -0

405 lines not on this page · raw message

drivers/clocksource/h8300_tpu.c new file +207 -0

207 lines not on this page · raw message

include/dt-bindings/clock/renesas,8bit-timer.h new file +11 -0
new file mode 100644
index 0000000..2aefaa8
@@ -0,0 +1,11 @@
+#ifndef __DT_BINDINGS_CLOCK_RENESAS_8BIT_TIMER_H__
+#define __DT_BINDINGS_CLOCK_RENESAS_8BIT_TIMER_H__
+
+#define CLOCKSOURCE 0
+#define CLOCKEVENTDEVICE 1
+
+#define DIV_8 0
+#define DIV_64 1
+#define DIV_8192 2
+
+#endif
Signature · 1 line
2.1.4

Yoshinori Sato

author maintainer
#0 lore raw

v10 cover Re-introduce h8300 architecture

Hello.
I will re-introducing h8300.

Changes for v10
- devicetree support
- header cleanup (use generic)
- optimized delay
- dma cleanup
- rebase to v4.1-rc2

Changes for v9
- remove exec domain
- timer update
- rebase to v4.1-rc1

Changes for v8
- rebase to v4.0

Changes for v7
- Add MAINTAINERS

Changes for v6
- rebase to v4.0-rc3
- remove unused headers
- optimized atomic operation
- System.map cleanup

Changes for v5
- Signal handling fix
- LD script cleanup

Changes for v4
- Remove signal mapping
- Organize Kconfig
- Coding style fix

Changes for v3
- Fix clone
- Add dma functions
- Add missing library
- Fix various errors

Changes for v2
- Use Common Clock Framework
- Use common unistd.h
- Use common ptrace function
- clocksource driver move to drivers/clocksource
- some cleanup

Changes for latest relase (v3.12)
- standard ELF toolchain (h8300-linux)
- use common driver support
- exception handling fix
- too many cleanup

git repository
git://git.sourceforge.jp/gitroot/uclinux-h8/linux.git h8300

Yoshinori Sato (19):
h8300: Add MAINTENERS
Add H8/300 ELF Machine.
mksysmap: Avoid h8300's local symbol
Add H8/300 SCI.
Add common asm-offsets.h
h8300: Assembly headers.
h8300: UAPI assembly headers.
h8300: Exception and Interrupt handling
h8300: kernel booting
h8300: process and signals
h8300: CPU depend helpers
h8300: miscellaneous functions
h8300: Memory management
h8300: Library functions
h8300: Build scripts
h8300: clock driver
h8300: clocksource
h8300: configs
h8300: devicetree source

 CREDITS                                            |   5 -
 .../bindings/clock/renesas,h8300-div-clock.txt     |  24 ++
 .../bindings/clock/renesas,h8s2678-pll-clock.txt   |  23 ++
 Documentation/devicetree/bindings/h8300/cpu.txt    |  17 +
 .../interrupt-controller/renesas,h8300h-intc.txt   |  20 +
 .../interrupt-controller/renesas,h8s-intc.txt      |  20 +
 .../bindings/serial/renesas,sci-serial.txt         |   1 +
 .../bindings/timer/renesas,16bit-timer.txt         |  25 ++
 .../bindings/timer/renesas,8bit-timer.txt          |  31 ++
 .../devicetree/bindings/timer/renesas,tpu.txt      |  21 ++
 MAINTAINERS                                        |  11 +
 arch/h8300/Kconfig                                 |  75 ++++
 arch/h8300/Kconfig.cpu                             |  97 +++++
 arch/h8300/Makefile                                |  55 +++
 arch/h8300/boot/Makefile                           |  26 ++
 arch/h8300/boot/compressed/Makefile                |  37 ++
 arch/h8300/boot/compressed/head.S                  |  48 +++
 arch/h8300/boot/compressed/misc.c                  |  74 ++++
 arch/h8300/boot/compressed/vmlinux.lds             |  32 ++
 arch/h8300/boot/compressed/vmlinux.scr             |   9 +
 arch/h8300/boot/dts/Makefile                       |  11 +
 arch/h8300/boot/dts/dt-bindings                    |   1 +
 arch/h8300/boot/dts/edosk2674.dts                  | 111 ++++++
 arch/h8300/boot/dts/h8300h_sim.dts                 |  97 +++++
 arch/h8300/boot/dts/h8s_sim.dts                    | 103 +++++
 arch/h8300/configs/edosk2674_defconfig             |  49 +++
 arch/h8300/configs/h8300h-sim_defconfig            |  53 +++
 arch/h8300/configs/h8s-sim_defconfig               |  53 +++
 arch/h8300/include/asm/Kbuild                      |  72 ++++
 arch/h8300/include/asm/atomic.h                    | 159 ++++++++
 arch/h8300/include/asm/bitops.h                    | 185 +++++++++
 arch/h8300/include/asm/bitsperlong.h               |  14 +
 arch/h8300/include/asm/bootparams.h                |  17 +
 arch/h8300/include/asm/bug.h                       |  12 +
 arch/h8300/include/asm/cache.h                     |  11 +
 arch/h8300/include/asm/checksum.h                  | 102 +++++
 arch/h8300/include/asm/cmpxchg.h                   |  65 ++++
 arch/h8300/include/asm/dma-mapping.h               |  57 +++
 arch/h8300/include/asm/elf.h                       | 101 +++++
 arch/h8300/include/asm/flat.h                      |  28 ++
 arch/h8300/include/asm/io.h                        |  57 +++
 arch/h8300/include/asm/irq.h                       |  26 ++
 arch/h8300/include/asm/irqflags.h                  |  96 +++++
 arch/h8300/include/asm/mc146818rtc.h               |   9 +
 arch/h8300/include/asm/mutex.h                     |   9 +
 arch/h8300/include/asm/page.h                      |  11 +
 arch/h8300/include/asm/page_offset.h               |   2 +
 arch/h8300/include/asm/pci.h                       |  19 +
 arch/h8300/include/asm/pgtable.h                   |  49 +++
 arch/h8300/include/asm/processor.h                 | 144 +++++++
 arch/h8300/include/asm/ptrace.h                    |  36 ++
 arch/h8300/include/asm/segment.h                   |  49 +++
 arch/h8300/include/asm/signal.h                    |  22 ++
 arch/h8300/include/asm/smp.h                       |   1 +
 arch/h8300/include/asm/string.h                    |  17 +
 arch/h8300/include/asm/switch_to.h                 |  51 +++
 arch/h8300/include/asm/syscall.h                   |  56 +++
 arch/h8300/include/asm/thread_info.h               | 108 ++++++
 arch/h8300/include/asm/tlb.h                       |   8 +
 arch/h8300/include/asm/traps.h                     |  41 ++
 arch/h8300/include/asm/uaccess.h                   | 131 +++++++
 arch/h8300/include/asm/unaligned.h                 |  11 +
 arch/h8300/include/asm/user.h                      |  74 ++++
 arch/h8300/include/uapi/asm/Kbuild                 |  30 ++
 arch/h8300/include/uapi/asm/byteorder.h            |   6 +
 arch/h8300/include/uapi/asm/ptrace.h               |  42 +++
 arch/h8300/include/uapi/asm/sigcontext.h           |  18 +
 arch/h8300/include/uapi/asm/signal.h               | 115 ++++++
 arch/h8300/include/uapi/asm/unistd.h               |   3 +
 arch/h8300/kernel/Makefile                         |  16 +
 arch/h8300/kernel/asm-offsets.c                    |  67 ++++
 arch/h8300/kernel/cpu/Makefile                     |   2 +
 arch/h8300/kernel/cpu/irq_h.c                      |  62 +++
 arch/h8300/kernel/cpu/irq_s.c                      |  70 ++++
 arch/h8300/kernel/cpu/ptrace_h.c                   | 256 +++++++++++++
 arch/h8300/kernel/cpu/ptrace_s.c                   |  44 +++
 arch/h8300/kernel/dma.c                            |  69 ++++
 arch/h8300/kernel/entry.S                          | 414 +++++++++++++++++++++
 arch/h8300/kernel/h8300_ksyms.c                    |  34 ++
 arch/h8300/kernel/head_ram.S                       |  60 +++
 arch/h8300/kernel/head_rom.S                       | 110 ++++++
 arch/h8300/kernel/irq.c                            | 121 ++++++
 arch/h8300/kernel/module.c                         |  70 ++++
 arch/h8300/kernel/process.c                        | 171 +++++++++
 arch/h8300/kernel/ptrace.c                         | 203 ++++++++++
 arch/h8300/kernel/setup.c                          | 227 +++++++++++
 arch/h8300/kernel/signal.c                         | 289 ++++++++++++++
 arch/h8300/kernel/sim-console.c                    |  79 ++++
 arch/h8300/kernel/syscalls.c                       |  14 +
 arch/h8300/kernel/traps.c                          | 161 ++++++++
 arch/h8300/kernel/vmlinux.lds.S                    |  67 ++++
 arch/h8300/lib/Makefile                            |   8 +
 arch/h8300/lib/abs.S                               |  20 +
 arch/h8300/lib/ashldi3.c                           |  24 ++
 arch/h8300/lib/ashrdi3.c                           |  24 ++
 arch/h8300/lib/checksum.c                          | 167 +++++++++
 arch/h8300/lib/delay.c                             |  40 ++
 arch/h8300/lib/libgcc.h                            |  77 ++++
 arch/h8300/lib/lshrdi3.c                           |  23 ++
 arch/h8300/lib/memcpy.S                            |  85 +++++
 arch/h8300/lib/memset.S                            |  69 ++++
 arch/h8300/lib/moddivsi3.S                         |  72 ++++
 arch/h8300/lib/modsi3.S                            |  72 ++++
 arch/h8300/lib/muldi3.c                            |  44 +++
 arch/h8300/lib/mulsi3.S                            |  38 ++
 arch/h8300/lib/strncpy.S                           |  34 ++
 arch/h8300/lib/ucmpdi2.c                           |  17 +
 arch/h8300/lib/udivsi3.S                           |  76 ++++
 arch/h8300/mm/Makefile                             |   5 +
 arch/h8300/mm/fault.c                              |  57 +++
 arch/h8300/mm/init.c                               | 128 +++++++
 arch/h8300/mm/memory.c                             |  53 +++
 drivers/clk/Makefile                               |   1 +
 drivers/clk/h8300/Makefile                         |   2 +
 drivers/clk/h8300/clk-div.c                        |  53 +++
 drivers/clk/h8300/clk-h8s2678.c                    | 147 ++++++++
 drivers/clocksource/Kconfig                        |   6 +
 drivers/clocksource/Makefile                       |   3 +
 drivers/clocksource/h8300_timer16.c                | 335 +++++++++++++++++
 drivers/clocksource/h8300_timer8.c                 | 405 ++++++++++++++++++++
 drivers/clocksource/h8300_tpu.c                    | 207 +++++++++++
 drivers/tty/serial/Kconfig                         |   2 +-
 drivers/tty/serial/sh-sci.c                        |   6 +
 include/asm-generic/asm-offsets.h                  |   1 +
 include/dt-bindings/clock/renesas,8bit-timer.h     |  11 +
 include/uapi/linux/elf-em.h                        |   1 +
 scripts/mksysmap                                   |   2 +-
 127 files changed, 8107 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,h8s2678-pll-clock.txt
 create mode 100644 Documentation/devicetree/bindings/h8300/cpu.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,h8300h-intc.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt
 create mode 100644 Documentation/devicetree/bindings/timer/renesas,16bit-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/renesas,8bit-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/renesas,tpu.txt
 create mode 100644 arch/h8300/Kconfig
 create mode 100644 arch/h8300/Kconfig.cpu
 create mode 100644 arch/h8300/Makefile
 create mode 100644 arch/h8300/boot/Makefile
 create mode 100644 arch/h8300/boot/compressed/Makefile
 create mode 100644 arch/h8300/boot/compressed/head.S
 create mode 100644 arch/h8300/boot/compressed/misc.c
 create mode 100644 arch/h8300/boot/compressed/vmlinux.lds
 create mode 100644 arch/h8300/boot/compressed/vmlinux.scr
 create mode 100644 arch/h8300/boot/dts/Makefile
 create mode 120000 arch/h8300/boot/dts/dt-bindings
 create mode 100644 arch/h8300/boot/dts/edosk2674.dts
 create mode 100644 arch/h8300/boot/dts/h8300h_sim.dts
 create mode 100644 arch/h8300/boot/dts/h8s_sim.dts
 create mode 100644 arch/h8300/configs/edosk2674_defconfig
 create mode 100644 arch/h8300/configs/h8300h-sim_defconfig
 create mode 100644 arch/h8300/configs/h8s-sim_defconfig
 create mode 100644 arch/h8300/include/asm/Kbuild
 create mode 100644 arch/h8300/include/asm/atomic.h
 create mode 100644 arch/h8300/include/asm/bitops.h
 create mode 100644 arch/h8300/include/asm/bitsperlong.h
 create mode 100644 arch/h8300/include/asm/bootparams.h
 create mode 100644 arch/h8300/include/asm/bug.h
 create mode 100644 arch/h8300/include/asm/cache.h
 create mode 100644 arch/h8300/include/asm/checksum.h
 create mode 100644 arch/h8300/include/asm/cmpxchg.h
 create mode 100644 arch/h8300/include/asm/dma-mapping.h
 create mode 100644 arch/h8300/include/asm/elf.h
 create mode 100644 arch/h8300/include/asm/flat.h
 create mode 100644 arch/h8300/include/asm/io.h
 create mode 100644 arch/h8300/include/asm/irq.h
 create mode 100644 arch/h8300/include/asm/irqflags.h
 create mode 100644 arch/h8300/include/asm/mc146818rtc.h
 create mode 100644 arch/h8300/include/asm/mutex.h
 create mode 100644 arch/h8300/include/asm/page.h
 create mode 100644 arch/h8300/include/asm/page_offset.h
 create mode 100644 arch/h8300/include/asm/pci.h
 create mode 100644 arch/h8300/include/asm/pgtable.h
 create mode 100644 arch/h8300/include/asm/processor.h
 create mode 100644 arch/h8300/include/asm/ptrace.h
 create mode 100644 arch/h8300/include/asm/segment.h
 create mode 100644 arch/h8300/include/asm/signal.h
 create mode 100644 arch/h8300/include/asm/smp.h
 create mode 100644 arch/h8300/include/asm/string.h
 create mode 100644 arch/h8300/include/asm/switch_to.h
 create mode 100644 arch/h8300/include/asm/syscall.h
 create mode 100644 arch/h8300/include/asm/thread_info.h
 create mode 100644 arch/h8300/include/asm/tlb.h
 create mode 100644 arch/h8300/include/asm/traps.h
 create mode 100644 arch/h8300/include/asm/uaccess.h
 create mode 100644 arch/h8300/include/asm/unaligned.h
 create mode 100644 arch/h8300/include/asm/user.h
 create mode 100644 arch/h8300/include/uapi/asm/Kbuild
 create mode 100644 arch/h8300/include/uapi/asm/byteorder.h
 create mode 100644 arch/h8300/include/uapi/asm/ptrace.h
 create mode 100644 arch/h8300/include/uapi/asm/sigcontext.h
 create mode 100644 arch/h8300/include/uapi/asm/signal.h
 create mode 100644 arch/h8300/include/uapi/asm/unistd.h
 create mode 100644 arch/h8300/kernel/Makefile
 create mode 100644 arch/h8300/kernel/asm-offsets.c
 create mode 100644 arch/h8300/kernel/cpu/Makefile
 create mode 100644 arch/h8300/kernel/cpu/irq_h.c
 create mode 100644 arch/h8300/kernel/cpu/irq_s.c
 create mode 100644 arch/h8300/kernel/cpu/ptrace_h.c
 create mode 100644 arch/h8300/kernel/cpu/ptrace_s.c
 create mode 100644 arch/h8300/kernel/dma.c
 create mode 100644 arch/h8300/kernel/entry.S
 create mode 100644 arch/h8300/kernel/h8300_ksyms.c
 create mode 100644 arch/h8300/kernel/head_ram.S
 create mode 100644 arch/h8300/kernel/head_rom.S
 create mode 100644 arch/h8300/kernel/irq.c
 create mode 100644 arch/h8300/kernel/module.c
 create mode 100644 arch/h8300/kernel/process.c
 create mode 100644 arch/h8300/kernel/ptrace.c
 create mode 100644 arch/h8300/kernel/setup.c
 create mode 100644 arch/h8300/kernel/signal.c
 create mode 100644 arch/h8300/kernel/sim-console.c
 create mode 100644 arch/h8300/kernel/syscalls.c
 create mode 100644 arch/h8300/kernel/traps.c
 create mode 100644 arch/h8300/kernel/vmlinux.lds.S
 create mode 100644 arch/h8300/lib/Makefile
 create mode 100644 arch/h8300/lib/abs.S
 create mode 100644 arch/h8300/lib/ashldi3.c
 create mode 100644 arch/h8300/lib/ashrdi3.c
 create mode 100644 arch/h8300/lib/checksum.c
 create mode 100644 arch/h8300/lib/delay.c
 create mode 100644 arch/h8300/lib/libgcc.h
 create mode 100644 arch/h8300/lib/lshrdi3.c
 create mode 100644 arch/h8300/lib/memcpy.S
 create mode 100644 arch/h8300/lib/memset.S
 create mode 100644 arch/h8300/lib/moddivsi3.S
 create mode 100644 arch/h8300/lib/modsi3.S
 create mode 100644 arch/h8300/lib/muldi3.c
 create mode 100644 arch/h8300/lib/mulsi3.S
 create mode 100644 arch/h8300/lib/strncpy.S
 create mode 100644 arch/h8300/lib/ucmpdi2.c
 create mode 100644 arch/h8300/lib/udivsi3.S
 create mode 100644 arch/h8300/mm/Makefile
 create mode 100644 arch/h8300/mm/fault.c
 create mode 100644 arch/h8300/mm/init.c
 create mode 100644 arch/h8300/mm/memory.c
 create mode 100644 drivers/clk/h8300/Makefile
 create mode 100644 drivers/clk/h8300/clk-div.c
 create mode 100644 drivers/clk/h8300/clk-h8s2678.c
 create mode 100644 drivers/clocksource/h8300_timer16.c
 create mode 100644 drivers/clocksource/h8300_timer8.c
 create mode 100644 drivers/clocksource/h8300_tpu.c
 create mode 100644 include/asm-generic/asm-offsets.h
 create mode 100644 include/dt-bindings/clock/renesas,8bit-timer.h
Signature · 1 line
2.1.4
author maintainer
#2 lore raw

PATCH v10 2/19 Add H8/300 ELF Machine.

---
 include/uapi/linux/elf-em.h | 1 +
 1 file changed, 1 insertion(+)
include/uapi/linux/elf-em.h +1 -0
index ae99f77..b088296 100644
@@ -25,6 +25,7 @@
 #define EM_ARM		40	/* ARM 32 bit */
 #define EM_SH		42	/* SuperH */
 #define EM_SPARCV9	43	/* SPARC v9 64-bit */
+#define EM_H8_300	46	/* Renesas H8/300 */
 #define EM_IA_64	50	/* HP/Intel IA-64 */
 #define EM_X86_64	62	/* AMD x86-64 */
 #define EM_S390		22	/* IBM S/390 */
Signature · 1 line
2.1.4
author maintainer
#3 lore raw

PATCH v10 3/19 mksysmap: Avoid h8300's local symbol

In reply to Yoshinori Sato

h8300's nm output have a lot of local symbols.
ex)
00000000 N .Lframe0
00000013 N .LLST1
00000026 N .LLST2
00000039 N .LLST3
0000004c N .LLST4
Added new pattern " .L" to filter rule.

---
 scripts/mksysmap | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mksysmap +1 -1
index 7ada35a..a35acc0 100755
@@ -41,4 +41,4 @@
 # so we just ignore them to let readprofile continue to work.
 # (At least sparc64 has __crc_ in the middle).
 
-$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $2
+$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( .L\)' > $2
Signature · 1 line
2.1.4
author maintainer
#9 lore raw

PATCH v10 6/19 h8300: Assembly headers.

In reply to Yoshinori Sato
---
 arch/h8300/include/asm/Kbuild        |  72 ++++++++++++++
 arch/h8300/include/asm/atomic.h      | 159 ++++++++++++++++++++++++++++++
 arch/h8300/include/asm/bitops.h      | 185 +++++++++++++++++++++++++++++++++++
 arch/h8300/include/asm/bitsperlong.h |  14 +++
 arch/h8300/include/asm/bootparams.h  |  17 ++++
 arch/h8300/include/asm/bug.h         |  12 +++
 arch/h8300/include/asm/cache.h       |  11 +++
 arch/h8300/include/asm/checksum.h    | 102 +++++++++++++++++++
 arch/h8300/include/asm/cmpxchg.h     |  65 ++++++++++++
 arch/h8300/include/asm/dma-mapping.h |  57 +++++++++++
 arch/h8300/include/asm/elf.h         | 101 +++++++++++++++++++
 arch/h8300/include/asm/flat.h        |  28 ++++++
 arch/h8300/include/asm/io.h          |  57 +++++++++++
 arch/h8300/include/asm/irq.h         |  26 +++++
 arch/h8300/include/asm/irqflags.h    |  96 ++++++++++++++++++
 arch/h8300/include/asm/mc146818rtc.h |   9 ++
 arch/h8300/include/asm/mutex.h       |   9 ++
 arch/h8300/include/asm/page.h        |  11 +++
 arch/h8300/include/asm/page_offset.h |   2 +
 arch/h8300/include/asm/pci.h         |  19 ++++
 arch/h8300/include/asm/pgtable.h     |  49 ++++++++++
 arch/h8300/include/asm/processor.h   | 144 +++++++++++++++++++++++++++
 arch/h8300/include/asm/ptrace.h      |  36 +++++++
 arch/h8300/include/asm/segment.h     |  49 ++++++++++
 arch/h8300/include/asm/signal.h      |  22 +++++
 arch/h8300/include/asm/smp.h         |   1 +
 arch/h8300/include/asm/string.h      |  17 ++++
 arch/h8300/include/asm/switch_to.h   |  51 ++++++++++
 arch/h8300/include/asm/syscall.h     |  56 +++++++++++
 arch/h8300/include/asm/thread_info.h | 108 ++++++++++++++++++++
 arch/h8300/include/asm/tlb.h         |   8 ++
 arch/h8300/include/asm/traps.h       |  41 ++++++++
 arch/h8300/include/asm/uaccess.h     | 131 +++++++++++++++++++++++++
 arch/h8300/include/asm/unaligned.h   |  11 +++
 arch/h8300/include/asm/user.h        |  74 ++++++++++++++
 35 files changed, 1850 insertions(+)
 create mode 100644 arch/h8300/include/asm/Kbuild
 create mode 100644 arch/h8300/include/asm/atomic.h
 create mode 100644 arch/h8300/include/asm/bitops.h
 create mode 100644 arch/h8300/include/asm/bitsperlong.h
 create mode 100644 arch/h8300/include/asm/bootparams.h
 create mode 100644 arch/h8300/include/asm/bug.h
 create mode 100644 arch/h8300/include/asm/cache.h
 create mode 100644 arch/h8300/include/asm/checksum.h
 create mode 100644 arch/h8300/include/asm/cmpxchg.h
 create mode 100644 arch/h8300/include/asm/dma-mapping.h
 create mode 100644 arch/h8300/include/asm/elf.h
 create mode 100644 arch/h8300/include/asm/flat.h
 create mode 100644 arch/h8300/include/asm/io.h
 create mode 100644 arch/h8300/include/asm/irq.h
 create mode 100644 arch/h8300/include/asm/irqflags.h
 create mode 100644 arch/h8300/include/asm/mc146818rtc.h
 create mode 100644 arch/h8300/include/asm/mutex.h
 create mode 100644 arch/h8300/include/asm/page.h
 create mode 100644 arch/h8300/include/asm/page_offset.h
 create mode 100644 arch/h8300/include/asm/pci.h
 create mode 100644 arch/h8300/include/asm/pgtable.h
 create mode 100644 arch/h8300/include/asm/processor.h
 create mode 100644 arch/h8300/include/asm/ptrace.h
 create mode 100644 arch/h8300/include/asm/segment.h
 create mode 100644 arch/h8300/include/asm/signal.h
 create mode 100644 arch/h8300/include/asm/smp.h
 create mode 100644 arch/h8300/include/asm/string.h
 create mode 100644 arch/h8300/include/asm/switch_to.h
 create mode 100644 arch/h8300/include/asm/syscall.h
 create mode 100644 arch/h8300/include/asm/thread_info.h
 create mode 100644 arch/h8300/include/asm/tlb.h
 create mode 100644 arch/h8300/include/asm/traps.h
 create mode 100644 arch/h8300/include/asm/uaccess.h
 create mode 100644 arch/h8300/include/asm/unaligned.h
 create mode 100644 arch/h8300/include/asm/user.h
arch/h8300/include/asm/Kbuild new file +72 -0
new file mode 100644
index 0000000..3a0df64
@@ -0,0 +1,72 @@
+generic-y += asm-offsets.h
+generic-y += auxvec.h
+generic-y += barrier.h
+generic-y += bugs.h
+generic-y += cacheflush.h
+generic-y += clkdev.h
+generic-y += cputime.h
+generic-y += current.h
+generic-y += delay.h
+generic-y += device.h
+generic-y += div64.h
+generic-y += dma.h
+generic-y += emergency-restart.h
+generic-y += errno.h
+generic-y += exec.h
+generic-y += fb.h
+generic-y += fcntl.h
+generic-y += ftrace.h
+generic-y += futex.h
+generic-y += hardirq.h
+generic-y += hash.h
+generic-y += hw_irq.h
+generic-y += ioctl.h
+generic-y += ioctls.h
+generic-y += ipcbuf.h
+generic-y += irq_regs.h
+generic-y += irq_work.h
+generic-y += kdebug.h
+generic-y += kmap_types.h
+generic-y += kvm_para.h
+generic-y += linkage.h
+generic-y += local.h
+generic-y += local64.h
+generic-y += mcs_spinlock.h
+generic-y += mman.h
+generic-y += mmu.h
+generic-y += mmu_context.h
+generic-y += module.h
+generic-y += msgbuf.h
+generic-y += param.h
+generic-y += parport.h
+generic-y += percpu.h
+generic-y += pgalloc.h
+generic-y += poll.h
+generic-y += posix_types.h
+generic-y += preempt.h
+generic-y += resource.h
+generic-y += scatterlist.h
+generic-y += sections.h
+generic-y += sembuf.h
+generic-y += serial.h
+generic-y += setup.h
+generic-y += shmbuf.h
+generic-y += shmparam.h
+generic-y += siginfo.h
+generic-y += sizes.h
+generic-y += socket.h
+generic-y += sockios.h
+generic-y += spinlock.h
+generic-y += stat.h
+generic-y += statfs.h
+generic-y += swab.h
+generic-y += termbits.h
+generic-y += termios.h
+generic-y += timex.h
+generic-y += tlbflush.h
+generic-y += trace_clock.h
+generic-y += topology.h
+generic-y += types.h
+generic-y += ucontext.h
+generic-y += vga.h
+generic-y += xor.h
arch/h8300/include/asm/atomic.h new file +159 -0

159 lines not on this page · raw message

arch/h8300/include/asm/bitops.h new file +185 -0

185 lines not on this page · raw message

arch/h8300/include/asm/bitsperlong.h new file +14 -0
new file mode 100644
index 0000000..e140e46
@@ -0,0 +1,14 @@
+#ifndef __ASM_H8300_BITS_PER_LONG
+#define __ASM_H8300_BITS_PER_LONG
+
+#include <asm-generic/bitsperlong.h>
+
+#if !defined(__ASSEMBLY__)
+/* h8300-unknown-linux required long */
+#define __kernel_size_t __kernel_size_t
+typedef unsigned long	__kernel_size_t;
+typedef long		__kernel_ssize_t;
+typedef long		__kernel_ptrdiff_t;
+#endif
+
+#endif /* __ASM_H8300_BITS_PER_LONG */
arch/h8300/include/asm/bootparams.h new file +17 -0
new file mode 100644
index 0000000..6c0b145
@@ -0,0 +1,17 @@
+/*
+H8/300 kernel boot parameters
+*/
+
+#ifndef __ASM_H8300_BOOTPARAMS__
+#define __ASM_H8300_BOOTPARAMS__
+
+struct bootparams {
+	short size;
+	unsigned char gpio_ddr[24];
+	unsigned char gpio_use[24];
+	unsigned int clock_freq;
+	unsigned int ram_end;
+	unsigned char *command_line;
+} __packed __aligned(2);
+
+#endif
arch/h8300/include/asm/bug.h new file +12 -0
new file mode 100644
index 0000000..1e1be81
@@ -0,0 +1,12 @@
+#ifndef _H8300_BUG_H
+#define _H8300_BUG_H
+
+/* always true */
+#define is_valid_bugaddr(addr) (1)
+
+#include <asm-generic/bug.h>
+
+struct pt_regs;
+extern void die(const char *str, struct pt_regs *fp, unsigned long err);
+
+#endif
arch/h8300/include/asm/cache.h new file +11 -0
new file mode 100644
index 0000000..0ef1edc
@@ -0,0 +1,11 @@
+#ifndef __ARCH_H8300_CACHE_H
+#define __ARCH_H8300_CACHE_H
+
+/* bytes per L1 cache line */
+#define        L1_CACHE_SHIFT  2
+#define        L1_CACHE_BYTES  (1 << L1_CACHE_SHIFT)
+
+#define __cacheline_aligned
+#define ____cacheline_aligned
+
+#endif
arch/h8300/include/asm/checksum.h new file +102 -0

102 lines not on this page · raw message

arch/h8300/include/asm/cmpxchg.h new file +65 -0

65 lines not on this page · raw message

arch/h8300/include/asm/dma-mapping.h new file +57 -0

57 lines not on this page · raw message

arch/h8300/include/asm/elf.h new file +101 -0

101 lines not on this page · raw message

arch/h8300/include/asm/flat.h new file +28 -0
new file mode 100644
index 0000000..a4898ec
@@ -0,0 +1,28 @@
+/*
+ * arch/h8300/asm/include/flat.h -- uClinux flat-format executables
+ */
+
+#ifndef __H8300_FLAT_H__
+#define __H8300_FLAT_H__
+
+#define	flat_argvp_envp_on_stack()		1
+#define	flat_old_ram_flag(flags)		1
+#define	flat_reloc_valid(reloc, size)		((reloc) <= (size))
+#define	flat_set_persistent(relval, p)		0
+
+/*
+ * on the H8 a couple of the relocations have an instruction in the
+ * top byte.  As there can only be 24bits of address space,  we just
+ * always preserve that 8bits at the top,  when it isn't an instruction
+ * is is 0 ([email protected])
+ */
+
+#define	flat_get_relocate_addr(rel)		(rel & ~0x00000001)
+#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
+	({(void)persistent; \
+		get_unaligned(rp) & (((flags) & FLAT_FLAG_GOTPIC) ?	\
+				     0xffffffff : 0x00ffffff); })
+#define flat_put_addr_at_rp(rp, addr, rel) \
+	put_unaligned(((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), (rp))
+
+#endif /* __H8300_FLAT_H__ */
arch/h8300/include/asm/io.h new file +57 -0

57 lines not on this page · raw message

arch/h8300/include/asm/irq.h new file +26 -0
new file mode 100644
index 0000000..69f23f0
@@ -0,0 +1,26 @@
+#ifndef _H8300_IRQ_H_
+#define _H8300_IRQ_H_
+
+#include <linux/irqchip.h>
+
+#if defined(CONFIG_CPU_H8300H)
+#define NR_IRQS 64
+#define IRQ_CHIP h8300h_irq_chip
+#define EXT_IRQ0 12
+#define EXT_IRQS 6
+#elif defined(CONFIG_CPU_H8S)
+#define NR_IRQS 128
+#define IRQ_CHIP h8s_irq_chip
+#define EXT_IRQ0 16
+#define EXT_IRQS 16
+#endif
+
+static inline int irq_canonicalize(int irq)
+{
+	return irq;
+}
+
+void h8300_init_ipr(void);
+extern struct irq_chip h8300h_irq_chip;
+extern struct irq_chip h8s_irq_chip;
+#endif /* _H8300_IRQ_H_ */
arch/h8300/include/asm/irqflags.h new file +96 -0

96 lines not on this page · raw message

arch/h8300/include/asm/mc146818rtc.h new file +9 -0
new file mode 100644
index 0000000..ab9d964
@@ -0,0 +1,9 @@
+/*
+ * Machine dependent access functions for RTC registers.
+ */
+#ifndef _H8300_MC146818RTC_H
+#define _H8300_MC146818RTC_H
+
+/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */
+
+#endif /* _H8300_MC146818RTC_H */
arch/h8300/include/asm/mutex.h new file +9 -0
new file mode 100644
index 0000000..458c1f7
@@ -0,0 +1,9 @@
+/*
+ * Pull in the generic implementation for the mutex fastpath.
+ *
+ * TODO: implement optimized primitives instead, or leave the generic
+ * implementation in place, or pick the atomic_xchg() based generic
+ * implementation. (see asm-generic/mutex-xchg.h for details)
+ */
+
+#include <asm-generic/mutex-dec.h>
arch/h8300/include/asm/page.h new file +11 -0
new file mode 100644
index 0000000..ee2f07c
@@ -0,0 +1,11 @@
+#ifndef _H8300_PAGE_H
+#define _H8300_PAGE_H
+
+#include <asm-generic/page.h>
+#include <linux/types.h>
+
+#define MAP_NR(addr) (((uintptr_t)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
+#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
+				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+
+#endif
arch/h8300/include/asm/page_offset.h new file +2 -0
new file mode 100644
index 0000000..888576d
@@ -0,0 +1,2 @@
+
+#define PAGE_OFFSET_RAW		0x00000000
arch/h8300/include/asm/pci.h new file +19 -0
new file mode 100644
index 0000000..0b2acaa
@@ -0,0 +1,19 @@
+#ifndef _ASM_H8300_PCI_H
+#define _ASM_H8300_PCI_H
+
+/*
+ * asm-h8300/pci.h - H8/300 specific PCI declarations.
+ *
+ * Yoshinori Sato <[email protected]>
+ */
+
+#define pcibios_assign_all_busses()	0
+
+static inline void pcibios_penalize_isa_irq(int irq, int active)
+{
+	/* We don't do dynamic PCI IRQ allocation */
+}
+
+#define PCI_DMA_BUS_IS_PHYS	(1)
+
+#endif /* _ASM_H8300_PCI_H */
arch/h8300/include/asm/pgtable.h new file +49 -0

49 lines not on this page · raw message

arch/h8300/include/asm/processor.h new file +144 -0

144 lines not on this page · raw message

arch/h8300/include/asm/ptrace.h new file +36 -0
new file mode 100644
index 0000000..e693fb4
@@ -0,0 +1,36 @@
+#ifndef _H8300_PTRACE_H
+#define _H8300_PTRACE_H
+
+#include <uapi/asm/ptrace.h>
+
+#ifndef __ASSEMBLY__
+#ifndef PS_S
+#define PS_S  (0x10)
+#endif
+
+#if defined(CONFIG_CPU_H8300H)
+#define H8300_REGS_NO 11
+#endif
+#if defined(CONFIG_CPU_H8S)
+#define H8300_REGS_NO 12
+#endif
+
+#define arch_has_single_step()	(1)
+
+#define user_mode(regs) (!((regs)->ccr & PS_S))
+#define instruction_pointer(regs) ((regs)->pc)
+#define profile_pc(regs) instruction_pointer(regs)
+#define user_stack_pointer(regs) ((regs)->sp)
+#define current_pt_regs() ((struct pt_regs *) \
+	(THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
+#define signal_pt_regs() ((struct pt_regs *)current->thread.esp0)
+#define current_user_stack_pointer() rdusp()
+#define task_pt_regs(task) \
+	((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1)
+
+extern long h8300_get_reg(struct task_struct *task, int regno);
+extern int h8300_put_reg(struct task_struct *task, int regno,
+			 unsigned long data);
+
+#endif /* __ASSEMBLY__ */
+#endif /* _H8300_PTRACE_H */
arch/h8300/include/asm/segment.h new file +49 -0

49 lines not on this page · raw message

arch/h8300/include/asm/signal.h new file +22 -0
new file mode 100644
index 0000000..5870835
@@ -0,0 +1,22 @@
+#ifndef _H8300_SIGNAL_H
+#define _H8300_SIGNAL_H
+
+#include <uapi/asm/signal.h>
+
+/* Most things should be clean enough to redefine this at will, if care
+   is taken to make libc match.  */
+
+#define _NSIG		64
+#define _NSIG_BPW	32
+#define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
+
+typedef unsigned long old_sigset_t;		/* at least 32 bits */
+
+typedef struct {
+	unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+#define __ARCH_HAS_SA_RESTORER
+#include <asm/sigcontext.h>
+
+#endif /* _H8300_SIGNAL_H */
arch/h8300/include/asm/smp.h new file +1 -0
new file mode 100644
index 0000000..9e9bd7e
@@ -0,0 +1 @@
+/* nothing required here yet */
arch/h8300/include/asm/string.h new file +17 -0
new file mode 100644
index 0000000..5dc5a8a
@@ -0,0 +1,17 @@
+#ifndef _H8300_STRING_H_
+#define _H8300_STRING_H_
+
+#ifdef __KERNEL__ /* only set these up for kernel code */
+
+#include <asm/setup.h>
+#include <asm/page.h>
+
+#define __HAVE_ARCH_MEMSET
+extern void *memset(void *s, int c, size_t count);
+
+#define __HAVE_ARCH_MEMCPY
+extern void *memcpy(void *d, const void *s, size_t count);
+
+#endif /* KERNEL */
+
+#endif
arch/h8300/include/asm/switch_to.h new file +51 -0

51 lines not on this page · raw message

arch/h8300/include/asm/syscall.h new file +56 -0

56 lines not on this page · raw message

arch/h8300/include/asm/thread_info.h new file +108 -0

108 lines not on this page · raw message

arch/h8300/include/asm/tlb.h new file +8 -0
new file mode 100644
index 0000000..2c6fa4ee
@@ -0,0 +1,8 @@
+#ifndef __H8300_TLB_H__
+#define __H8300_TLB_H__
+
+#define tlb_flush(tlb)	do { } while (0)
+
+#include <asm-generic/tlb.h>
+
+#endif
arch/h8300/include/asm/traps.h new file +41 -0

41 lines not on this page · raw message

arch/h8300/include/asm/uaccess.h new file +131 -0

131 lines not on this page · raw message

arch/h8300/include/asm/unaligned.h new file +11 -0
new file mode 100644
index 0000000..b8d06c7
@@ -0,0 +1,11 @@
+#ifndef _ASM_H8300_UNALIGNED_H
+#define _ASM_H8300_UNALIGNED_H
+
+#include <linux/unaligned/be_memmove.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#define get_unaligned	__get_unaligned_be
+#define put_unaligned	__put_unaligned_be
+
+#endif /* _ASM_H8300_UNALIGNED_H */
arch/h8300/include/asm/user.h new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#10 lore raw

PATCH v10 7/19 h8300: UAPI assembly headers.

In reply to Yoshinori Sato
---
 arch/h8300/include/uapi/asm/Kbuild       |  30 ++++++++
 arch/h8300/include/uapi/asm/byteorder.h  |   6 ++
 arch/h8300/include/uapi/asm/ptrace.h     |  42 +++++++++++
 arch/h8300/include/uapi/asm/sigcontext.h |  18 +++++
 arch/h8300/include/uapi/asm/signal.h     | 115 +++++++++++++++++++++++++++++++
 arch/h8300/include/uapi/asm/unistd.h     |   3 +
 6 files changed, 214 insertions(+)
 create mode 100644 arch/h8300/include/uapi/asm/Kbuild
 create mode 100644 arch/h8300/include/uapi/asm/byteorder.h
 create mode 100644 arch/h8300/include/uapi/asm/ptrace.h
 create mode 100644 arch/h8300/include/uapi/asm/sigcontext.h
 create mode 100644 arch/h8300/include/uapi/asm/signal.h
 create mode 100644 arch/h8300/include/uapi/asm/unistd.h
arch/h8300/include/uapi/asm/Kbuild new file +30 -0
new file mode 100644
index 0000000..fb6101a
@@ -0,0 +1,30 @@
+# UAPI Header export list
+include include/uapi/asm-generic/Kbuild.asm
+
+header-y += auxvec.h
+header-y += bitsperlong.h
+header-y += errno.h
+header-y += fcntl.h
+header-y += ioctl.h
+header-y += ioctls.h
+header-y += ipcbuf.h
+header-y += kvm_para.h
+header-y += mman.h
+header-y += msgbuf.h
+header-y += param.h
+header-y += poll.h
+header-y += posix_types.h
+header-y += resource.h
+header-y += sembuf.h
+header-y += setup.h
+header-y += shmbuf.h
+header-y += siginfo.h
+header-y += socket.h
+header-y += sockios.h
+header-y += stat.h
+header-y += statfs.h
+header-y += swab.h
+header-y += termbits.h
+header-y += termios.h
+header-y += types.h
+header-y += unistd.h
arch/h8300/include/uapi/asm/byteorder.h new file +6 -0
new file mode 100644
index 0000000..13539da
@@ -0,0 +1,6 @@
+#ifndef _H8300_BYTEORDER_H
+#define _H8300_BYTEORDER_H
+
+#include <linux/byteorder/big_endian.h>
+
+#endif /* _H8300_BYTEORDER_H */
arch/h8300/include/uapi/asm/ptrace.h new file +42 -0

42 lines not on this page · raw message

arch/h8300/include/uapi/asm/sigcontext.h new file +18 -0
new file mode 100644
index 0000000..c41fdaa
@@ -0,0 +1,18 @@
+#ifndef _ASM_H8300_SIGCONTEXT_H
+#define _ASM_H8300_SIGCONTEXT_H
+
+struct sigcontext {
+	unsigned long  sc_mask;		/* old sigmask */
+	unsigned long  sc_usp;		/* old user stack pointer */
+	unsigned long  sc_er0;
+	unsigned long  sc_er1;
+	unsigned long  sc_er2;
+	unsigned long  sc_er3;
+	unsigned long  sc_er4;
+	unsigned long  sc_er5;
+	unsigned long  sc_er6;
+	unsigned short sc_ccr;
+	unsigned long  sc_pc;
+};
+
+#endif
arch/h8300/include/uapi/asm/signal.h new file +115 -0

115 lines not on this page · raw message

arch/h8300/include/uapi/asm/unistd.h new file +3 -0
new file mode 100644
index 0000000..7a2eb69
@@ -0,0 +1,3 @@
+#define __ARCH_NOMMU
+
+#include <asm-generic/unistd.h>
Signature · 1 line
2.1.4
author maintainer
#11 lore raw

PATCH v10 8/19 h8300: Exception and Interrupt handling

In reply to Yoshinori Sato

h8300 exception entry and exception / interrupt handling

---
 arch/h8300/kernel/entry.S | 414 ++++++++++++++++++++++++++++++++++++++++++++++
 arch/h8300/kernel/irq.c   | 121 ++++++++++++++
 arch/h8300/kernel/traps.c | 161 ++++++++++++++++++
 3 files changed, 696 insertions(+)
 create mode 100644 arch/h8300/kernel/entry.S
 create mode 100644 arch/h8300/kernel/irq.c
 create mode 100644 arch/h8300/kernel/traps.c
arch/h8300/kernel/entry.S new file +414 -0
new file mode 100644
index 0000000..797dfa8
@@ -0,0 +1,414 @@
+/*
+ *
+ *  linux/arch/h8300/kernel/entry.S
+ *
+ *  Yoshinori Sato <[email protected]>
+ *  David McCullough <[email protected]>
+ *
+ */
+
+/*
+ *  entry.S
+ *  include exception/interrupt gateway
+ *          system call entry
+ */
+
+#include <linux/sys.h>
+#include <asm/unistd.h>
+#include <asm/setup.h>
+#include <asm/segment.h>
+#include <asm/linkage.h>
+#include <asm/asm-offsets.h>
+#include <asm/thread_info.h>
+#include <asm/errno.h>
+
+#if defined(CONFIG_CPU_H8300H)
+#define USERRET 8
+INTERRUPTS = 64
+	.h8300h
+	.macro	SHLL2 reg
+	shll.l	\reg
+	shll.l	\reg
+	.endm
+	.macro	SHLR2 reg
+	shlr.l	\reg
+	shlr.l	\reg
+	.endm
+	.macro	SAVEREGS
+	mov.l	er0,@-sp
+	mov.l	er1,@-sp
+	mov.l	er2,@-sp
+	mov.l	er3,@-sp
+	.endm
+	.macro	RESTOREREGS
+	mov.l	@sp+,er3
+	mov.l	@sp+,er2
+	.endm
+	.macro	SAVEEXR
+	.endm
+	.macro	RESTOREEXR
+	.endm
+#endif
+#if defined(CONFIG_CPU_H8S)
+#define USERRET 10
+#define USEREXR 8
+INTERRUPTS = 128
+	.h8300s
+	.macro	SHLL2 reg
+	shll.l	#2,\reg
+	.endm
+	.macro	SHLR2 reg
+	shlr.l	#2,\reg
+	.endm
+	.macro	SAVEREGS
+	stm.l	er0-er3,@-sp
+	.endm
+	.macro	RESTOREREGS
+	ldm.l	@sp+,er2-er3
+	.endm
+	.macro	SAVEEXR
+	mov.w	@(USEREXR:16,er0),r1
+	mov.w	r1,@(LEXR-LER3:16,sp)		/* copy EXR */
+	.endm
+	.macro	RESTOREEXR
+	mov.w	@(LEXR-LER1:16,sp),r1		/* restore EXR */
+	mov.b	r1l,r1h
+	mov.w	r1,@(USEREXR:16,er0)
+	.endm
+#endif
+
+
+/* CPU context save/restore macros. */
+
+	.macro	SAVE_ALL
+	mov.l	er0,@-sp
+	stc	ccr,r0l				/* check kernel mode */
+	btst	#4,r0l
+	bne	5f
+
+	/* user mode */
+	mov.l	sp,@_sw_usp
+	mov.l	@sp,er0				/* restore saved er0 */
+	orc	#0x10,ccr			/* switch kernel stack */
+	mov.l	@_sw_ksp,sp
+	sub.l	#(LRET-LORIG),sp		/* allocate LORIG - LRET */
+	SAVEREGS
+	mov.l   @_sw_usp,er0
+	mov.l   @(USERRET:16,er0),er1           /* copy the RET addr */
+	mov.l   er1,@(LRET-LER3:16,sp)
+	SAVEEXR
+
+	mov.l	@(LORIG-LER3:16,sp),er0
+	mov.l	er0,@(LER0-LER3:16,sp)		/* copy ER0 */
+	mov.w	e1,r1				/* e1 highbyte = ccr */
+	and	#0xef,r1h			/* mask mode? flag */
+	bra	6f
+5:
+	/* kernel mode */
+	mov.l	@sp,er0				/* restore saved er0 */
+	subs	#2,sp				/* set dummy ccr */
+	subs	#4,sp				/* set dummp sp */
+	SAVEREGS
+	mov.w	@(LRET-LER3:16,sp),r1		/* copy old ccr */
+6:
+	mov.b	r1h,r1l
+	mov.b	#0,r1h
+	mov.w	r1,@(LCCR-LER3:16,sp)		/* set ccr */
+	mov.l	@_sw_usp,er2
+	mov.l	er2,@(LSP-LER3:16,sp)		/* set usp */
+	mov.l	er6,@-sp			/* syscall arg #6 */
+	mov.l	er5,@-sp			/* syscall arg #5 */
+	mov.l	er4,@-sp			/* syscall arg #4 */
+	.endm					/* r1 = ccr */
+
+	.macro	RESTORE_ALL
+	mov.l	@sp+,er4
+	mov.l	@sp+,er5
+	mov.l	@sp+,er6
+	RESTOREREGS
+	mov.w	@(LCCR-LER1:16,sp),r0		/* check kernel mode */
+	btst	#4,r0l
+	bne	7f
+
+	orc	#0xc0,ccr
+	mov.l	@(LSP-LER1:16,sp),er0
+	mov.l	@(LER0-LER1:16,sp),er1		/* restore ER0 */
+	mov.l	er1,@er0
+	RESTOREEXR
+	mov.w	@(LCCR-LER1:16,sp),r1		/* restore the RET addr */
+	mov.b	r1l,r1h
+	mov.b	@(LRET+1-LER1:16,sp),r1l
+	mov.w	r1,e1
+	mov.w	@(LRET+2-LER1:16,sp),r1
+	mov.l	er1,@(USERRET:16,er0)
+
+	mov.l	@sp+,er1
+	add.l	#(LRET-LER1),sp			/* remove LORIG - LRET */
+	mov.l	sp,@_sw_ksp
+	andc	#0xef,ccr			/* switch to user mode */
+	mov.l	er0,sp
+	bra	8f
+7:
+	mov.l	@sp+,er1
+	add.l	#10,sp
+8:
+	mov.l	@sp+,er0
+	adds	#4,sp				/* remove the sw created LVEC */
+	rte
+	.endm
+
+.globl _system_call
+.globl ret_from_exception
+.globl ret_from_fork
+.globl ret_from_kernel_thread
+.globl ret_from_interrupt
+.globl _interrupt_redirect_table
+.globl _sw_ksp,_sw_usp
+.globl _resume
+.globl _interrupt_entry
+.globl _trace_break
+.globl _nmi
+
+#if defined(CONFIG_ROMKERNEL)
+	.section .int_redirect,"ax"
+_interrupt_redirect_table:
+#if defined(CONFIG_CPU_H8300H)
+	.rept	7
+	.long	0
+	.endr
+#endif
+#if defined(CONFIG_CPU_H8S)
+	.rept	5
+	.long	0
+	.endr
+	jmp	@_trace_break
+	.long	0
+#endif
+
+	jsr	@_interrupt_entry		/* NMI */
+	jmp	@_system_call			/* TRAPA #0 (System call) */
+	.long	0
+	.long	0
+	jmp	@_trace_break			/* TRAPA #3 (breakpoint) */
+	.rept	INTERRUPTS-12
+	jsr	@_interrupt_entry
+	.endr
+#endif
+#if defined(CONFIG_RAMKERNEL)
+.globl _interrupt_redirect_table
+	.section .bss
+_interrupt_redirect_table:
+	.space	4
+#endif
+
+	.section .text
+	.align	2
+_interrupt_entry:
+	SAVE_ALL
+/* r1l is saved ccr */
+	mov.l	sp,er0
+	add.l	#LVEC,er0
+	btst	#4,r1l
+	bne	1f
+	/* user LVEC */
+	mov.l	@_sw_usp,er0
+	adds	#4,er0
+1:
+	mov.l	@er0,er0			/* LVEC address */
+#if defined(CONFIG_ROMKERNEL)
+	sub.l	#_interrupt_redirect_table,er0
+#endif
+#if defined(CONFIG_RAMKERNEL)
+	mov.l	@_interrupt_redirect_table,er1
+	sub.l	er1,er0
+#endif
+	SHLR2	er0
+	dec.l	#1,er0
+	mov.l	sp,er1
+	subs	#4,er1				/* adjust ret_pc */
+#if defined(CONFIG_CPU_H8S)
+	orc	#7,exr
+#endif
+	jsr	@do_IRQ
+	jmp	@ret_from_interrupt
+
+_system_call:
+	subs	#4,sp				/* dummy LVEC */
+	SAVE_ALL
+	/* er0: syscall nr */
+	andc	#0xbf,ccr
+	mov.l	er0,er4
+
+	/* save top of frame */
+	mov.l	sp,er0
+	jsr	@set_esp0
+	mov.l	sp,er2
+	and.w	#0xe000,r2
+	mov.l	@(TI_FLAGS:16,er2),er2
+	and.w	#_TIF_WORK_SYSCALL_MASK,r2
+	beq	1f
+	mov.l	sp,er0
+	jsr	@do_syscall_trace_enter
+1:
+	cmp.l	#__NR_syscalls,er4
+	bcc	badsys
+	SHLL2	er4
+	mov.l	#_sys_call_table,er0
+	add.l	er4,er0
+	mov.l	@er0,er4
+	beq	ret_from_exception:16
+	mov.l	@(LER1:16,sp),er0
+	mov.l	@(LER2:16,sp),er1
+	mov.l	@(LER3:16,sp),er2
+	jsr	@er4
+	mov.l	er0,@(LER0:16,sp)		/* save the return value */
+	mov.l	sp,er2
+	and.w	#0xe000,r2
+	mov.l	@(TI_FLAGS:16,er2),er2
+	and.w	#_TIF_WORK_SYSCALL_MASK,r2
+	beq	2f
+	mov.l	sp,er0
+	jsr	@do_syscall_trace_leave
+2:
+	orc	#0xc0,ccr
+	bra	resume_userspace
+
+badsys:
+	mov.l	#-ENOSYS,er0
+	mov.l	er0,@(LER0:16,sp)
+	bra	resume_userspace
+
+#if !defined(CONFIG_PREEMPT)
+#define resume_kernel restore_all
+#endif
+
+ret_from_exception:
+#if defined(CONFIG_PREEMPT)
+	orc	#0xc0,ccr
+#endif
+ret_from_interrupt:
+	mov.b	@(LCCR+1:16,sp),r0l
+	btst	#4,r0l
+	bne	resume_kernel:16	/* return from kernel */
+resume_userspace:
+	andc	#0xbf,ccr
+	mov.l	sp,er4
+	and.w	#0xe000,r4		/* er4 <- current thread info */
+	mov.l	@(TI_FLAGS:16,er4),er1
+	and.l	#_TIF_WORK_MASK,er1
+	beq	restore_all:8
+work_pending:
+	btst	#TIF_NEED_RESCHED,r1l
+	bne	work_resched:8
+	/* work notifysig */
+	mov.l	sp,er0
+	subs	#4,er0			/* er0: pt_regs */
+	jsr	@do_notify_resume
+	bra	resume_userspace:8
+work_resched:
+	mov.l	sp,er0
+	jsr	@set_esp0
+	jsr	@schedule
+	bra	resume_userspace:8
+restore_all:
+	RESTORE_ALL			/* Does RTE */
+
+#if defined(CONFIG_PREEMPT)
+resume_kernel:
+	mov.l	@(TI_PRE_COUNT:16,er4),er0
+	bne	restore_all:8
+need_resched:
+	mov.l	@(TI_FLAGS:16,er4),er0
+	btst	#TIF_NEED_RESCHED,r0l
+	beq	restore_all:8
+	mov.b	@(LCCR+1:16,sp),r0l	/* Interrupt Enabled? */
+	bmi	restore_all:8
+	mov.l	sp,er0
+	jsr	@set_esp0
+	jsr	@preempt_schedule_irq
+	bra	need_resched:8
+#endif
+
+ret_from_fork:
+	mov.l	er2,er0
+	jsr	@schedule_tail
+	jmp	@ret_from_exception
+
+ret_from_kernel_thread:
+	mov.l	er2,er0
+	jsr	@schedule_tail
+	mov.l	@(LER4:16,sp),er0
+	mov.l	@(LER5:16,sp),er1
+	jsr	@er1
+	jmp	@ret_from_exception
+
+_resume:
+	/*
+	 * Beware - when entering resume, offset of tss is in d1,
+	 * prev (the current task) is in a0, next (the new task)
+	 * is in a1 and d2.b is non-zero if the mm structure is
+	 * shared between the tasks, so don't change these
+	 * registers until their contents are no longer needed.
+	 */
+
+	/* save sr */
+	sub.w	r3,r3
+	stc	ccr,r3l
+	mov.w	r3,@(THREAD_CCR+2:16,er0)
+
+	/* disable interrupts */
+	orc	#0xc0,ccr
+	mov.l	@_sw_usp,er3
+	mov.l	er3,@(THREAD_USP:16,er0)
+	mov.l	sp,@(THREAD_KSP:16,er0)
+
+	/* Skip address space switching if they are the same. */
+	/* FIXME: what did we hack out of here, this does nothing! */
+
+	mov.l	@(THREAD_USP:16,er1),er0
+	mov.l	er0,@_sw_usp
+	mov.l	@(THREAD_KSP:16,er1),sp
+
+	/* restore status register */
+	mov.w	@(THREAD_CCR+2:16,er1),r3
+
+	ldc	r3l,ccr
+	rts
+
+_trace_break:
+	subs	#4,sp
+	SAVE_ALL
+	sub.l	er1,er1
+	dec.l	#1,er1
+	mov.l	er1,@(LORIG,sp)
+	mov.l	sp,er0
+	jsr	@set_esp0
+	mov.l	@_sw_usp,er0
+	mov.l	@er0,er1
+	mov.w	@(-2:16,er1),r2
+	cmp.w	#0x5730,r2
+	beq	1f
+	subs	#2,er1
+	mov.l	er1,@er0
+1:
+	and.w	#0xff,e1
+	mov.l	er1,er0
+	jsr	@trace_trap
+	jmp	@ret_from_exception
+
+_nmi:
+	subs	#4, sp
+	mov.l	er0, @-sp
+	mov.l	@_interrupt_redirect_table, er0
+	add.l	#8*4, er0
+	mov.l	er0, @(4,sp)
+	mov.l	@sp+, er0
+	jmp	@_interrupt_entry
+
+	.section	.bss
+_sw_ksp:
+	.space	4
+_sw_usp:
+	.space	4
+
+	.end
arch/h8300/kernel/irq.c new file +121 -0

121 lines not on this page · raw message

arch/h8300/kernel/traps.c new file +161 -0

161 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#13 lore raw

PATCH v10 10/19 h8300: process and signals

In reply to Yoshinori Sato

process management helper and signal handling

---
 arch/h8300/kernel/process.c | 171 ++++++++++++++++++++++++++
 arch/h8300/kernel/ptrace.c  | 203 +++++++++++++++++++++++++++++++
 arch/h8300/kernel/signal.c  | 289 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 663 insertions(+)
 create mode 100644 arch/h8300/kernel/process.c
 create mode 100644 arch/h8300/kernel/ptrace.c
 create mode 100644 arch/h8300/kernel/signal.c
arch/h8300/kernel/process.c new file +171 -0
new file mode 100644
index 0000000..dee4125
@@ -0,0 +1,171 @@
+/*
+ *  linux/arch/h8300/kernel/process.c
+ *
+ * Yoshinori Sato <[email protected]>
+ *
+ *  Based on:
+ *
+ *  linux/arch/m68knommu/kernel/process.c
+ *
+ *  Copyright (C) 1998  D. Jeff Dionne <[email protected]>,
+ *                      Kenneth Albanowski <[email protected]>,
+ *                      The Silver Hammer Group, Ltd.
+ *
+ *  linux/arch/m68k/kernel/process.c
+ *
+ *  Copyright (C) 1995  Hamish Macdonald
+ *
+ *  68060 fixes by Jesper Skov
+ */
+
+/*
+ * This file handles the architecture-dependent parts of process handling..
+ */
+
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/smp.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
+#include <linux/ptrace.h>
+#include <linux/user.h>
+#include <linux/interrupt.h>
+#include <linux/reboot.h>
+#include <linux/fs.h>
+#include <linux/slab.h>
+#include <linux/rcupdate.h>
+
+#include <asm/uaccess.h>
+#include <asm/traps.h>
+#include <asm/setup.h>
+#include <asm/pgtable.h>
+
+void (*pm_power_off)(void) = NULL;
+EXPORT_SYMBOL(pm_power_off);
+
+asmlinkage void ret_from_fork(void);
+asmlinkage void ret_from_kernel_thread(void);
+
+/*
+ * The idle loop on an H8/300..
+ */
+void arch_cpu_idle(void)
+{
+	local_irq_enable();
+	__asm__("sleep");
+}
+
+void machine_restart(char *__unused)
+{
+	local_irq_disable();
+	__asm__("jmp @@0");
+}
+
+void machine_halt(void)
+{
+	local_irq_disable();
+	__asm__("sleep");
+	for (;;)
+		;
+}
+
+void machine_power_off(void)
+{
+	local_irq_disable();
+	__asm__("sleep");
+	for (;;)
+		;
+}
+
+void show_regs(struct pt_regs *regs)
+{
+	show_regs_print_info(KERN_DEFAULT);
+
+	pr_notice("\n");
+	pr_notice("PC: %08lx  Status: %02x\n",
+	       regs->pc, regs->ccr);
+	pr_notice("ORIG_ER0: %08lx ER0: %08lx ER1: %08lx\n",
+	       regs->orig_er0, regs->er0, regs->er1);
+	pr_notice("ER2: %08lx ER3: %08lx ER4: %08lx ER5: %08lx\n",
+	       regs->er2, regs->er3, regs->er4, regs->er5);
+	pr_notice("ER6' %08lx ", regs->er6);
+	if (user_mode(regs))
+		printk("USP: %08lx\n", rdusp());
+	else
+		printk("\n");
+}
+
+void flush_thread(void)
+{
+}
+
+int copy_thread(unsigned long clone_flags,
+		unsigned long usp, unsigned long topstk,
+		struct task_struct *p)
+{
+	struct pt_regs *childregs;
+
+	childregs = (struct pt_regs *) (THREAD_SIZE + task_stack_page(p)) - 1;
+
+	if (unlikely(p->flags & PF_KTHREAD)) {
+		memset(childregs, 0, sizeof(struct pt_regs));
+		childregs->retpc = (unsigned long) ret_from_kernel_thread;
+		childregs->er4 = topstk; /* arg */
+		childregs->er5 = usp; /* fn */
+	}  else {
+		*childregs = *current_pt_regs();
+		childregs->er0 = 0;
+		childregs->retpc = (unsigned long) ret_from_fork;
+		p->thread.usp = usp ?: rdusp();
+	}
+	p->thread.ksp = (unsigned long)childregs;
+
+	return 0;
+}
+
+unsigned long thread_saved_pc(struct task_struct *tsk)
+{
+	return ((struct pt_regs *)tsk->thread.esp0)->pc;
+}
+
+unsigned long get_wchan(struct task_struct *p)
+{
+	unsigned long fp, pc;
+	unsigned long stack_page;
+	int count = 0;
+
+	if (!p || p == current || p->state == TASK_RUNNING)
+		return 0;
+
+	stack_page = (unsigned long)p;
+	fp = ((struct pt_regs *)p->thread.ksp)->er6;
+	do {
+		if (fp < stack_page+sizeof(struct thread_info) ||
+		    fp >= 8184+stack_page)
+			return 0;
+		pc = ((unsigned long *)fp)[1];
+		if (!in_sched_functions(pc))
+			return pc;
+		fp = *(unsigned long *) fp;
+	} while (count++ < 16);
+	return 0;
+}
+
+/* generic sys_clone is not enough registers */
+asmlinkage int sys_clone(unsigned long __user *args)
+{
+	unsigned long clone_flags;
+	unsigned long  newsp;
+	uintptr_t parent_tidptr;
+	uintptr_t child_tidptr;
+
+	get_user(clone_flags, &args[0]);
+	get_user(newsp, &args[1]);
+	get_user(parent_tidptr, &args[2]);
+	get_user(child_tidptr, &args[3]);
+	return do_fork(clone_flags, newsp, 0,
+		       (int __user *)parent_tidptr, (int __user *)child_tidptr);
+}
arch/h8300/kernel/ptrace.c new file +203 -0

203 lines not on this page · raw message

arch/h8300/kernel/signal.c new file +289 -0

289 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#14 lore raw

PATCH v10 11/19 h8300: CPU depend helpers

In reply to Yoshinori Sato

H8/3069 and H8S2678 have little different specification (interrupt and trace).
Its difference is absorbed here.

---
 arch/h8300/kernel/cpu/Makefile   |   2 +
 arch/h8300/kernel/cpu/irq_h.c    |  62 ++++++++++
 arch/h8300/kernel/cpu/irq_s.c    |  70 +++++++++++
 arch/h8300/kernel/cpu/ptrace_h.c | 256 +++++++++++++++++++++++++++++++++++++++
 arch/h8300/kernel/cpu/ptrace_s.c |  44 +++++++
 5 files changed, 434 insertions(+)
 create mode 100644 arch/h8300/kernel/cpu/Makefile
 create mode 100644 arch/h8300/kernel/cpu/irq_h.c
 create mode 100644 arch/h8300/kernel/cpu/irq_s.c
 create mode 100644 arch/h8300/kernel/cpu/ptrace_h.c
 create mode 100644 arch/h8300/kernel/cpu/ptrace_s.c
arch/h8300/kernel/cpu/Makefile new file +2 -0
new file mode 100644
index 0000000..1318128
@@ -0,0 +1,2 @@
+obj-$(CONFIG_CPU_H8300H) += ptrace_h.o irq_h.o
+obj-$(CONFIG_CPU_H8S) += ptrace_s.o irq_s.o
arch/h8300/kernel/cpu/irq_h.c new file +62 -0

62 lines not on this page · raw message

arch/h8300/kernel/cpu/irq_s.c new file +70 -0

70 lines not on this page · raw message

arch/h8300/kernel/cpu/ptrace_h.c new file +256 -0

256 lines not on this page · raw message

arch/h8300/kernel/cpu/ptrace_s.c new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#15 lore raw

PATCH v10 12/19 h8300: miscellaneous functions

In reply to Yoshinori Sato
---
 arch/h8300/kernel/asm-offsets.c | 67 ++++++++++++++++++++++++++++++++++
 arch/h8300/kernel/dma.c         | 69 +++++++++++++++++++++++++++++++++++
 arch/h8300/kernel/h8300_ksyms.c | 34 ++++++++++++++++++
 arch/h8300/kernel/module.c      | 70 ++++++++++++++++++++++++++++++++++++
 arch/h8300/kernel/sim-console.c | 79 +++++++++++++++++++++++++++++++++++++++++
 arch/h8300/kernel/syscalls.c    | 14 ++++++++
 6 files changed, 333 insertions(+)
 create mode 100644 arch/h8300/kernel/asm-offsets.c
 create mode 100644 arch/h8300/kernel/dma.c
 create mode 100644 arch/h8300/kernel/h8300_ksyms.c
 create mode 100644 arch/h8300/kernel/module.c
 create mode 100644 arch/h8300/kernel/sim-console.c
 create mode 100644 arch/h8300/kernel/syscalls.c
arch/h8300/kernel/asm-offsets.c new file +67 -0
new file mode 100644
index 0000000..dc2d16c
@@ -0,0 +1,67 @@
+/*
+ * This program is used to generate definitions needed by
+ * assembly language modules.
+ *
+ * We use the technique used in the OSF Mach kernel code:
+ * generate asm statements containing #defines,
+ * compile this file to assembler, and then extract the
+ * #defines from the assembly-language output.
+ */
+
+#include <linux/stddef.h>
+#include <linux/sched.h>
+#include <linux/kernel_stat.h>
+#include <linux/ptrace.h>
+#include <linux/hardirq.h>
+#include <linux/kbuild.h>
+#include <asm/irq.h>
+#include <asm/ptrace.h>
+
+int main(void)
+{
+	/* offsets into the task struct */
+	OFFSET(TASK_STATE, task_struct, state);
+	OFFSET(TASK_FLAGS, task_struct, flags);
+	OFFSET(TASK_PTRACE, task_struct, ptrace);
+	OFFSET(TASK_BLOCKED, task_struct, blocked);
+	OFFSET(TASK_THREAD, task_struct, thread);
+	OFFSET(TASK_THREAD_INFO, task_struct, stack);
+	OFFSET(TASK_MM, task_struct, mm);
+	OFFSET(TASK_ACTIVE_MM, task_struct, active_mm);
+
+	/* offsets into the irq_cpustat_t struct */
+	DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t,
+						 __softirq_pending));
+
+	/* offsets into the thread struct */
+	OFFSET(THREAD_KSP, thread_struct, ksp);
+	OFFSET(THREAD_USP, thread_struct, usp);
+	OFFSET(THREAD_CCR, thread_struct, ccr);
+
+	/* offsets into the pt_regs struct */
+	DEFINE(LER0,  offsetof(struct pt_regs, er0)      - sizeof(long));
+	DEFINE(LER1,  offsetof(struct pt_regs, er1)      - sizeof(long));
+	DEFINE(LER2,  offsetof(struct pt_regs, er2)      - sizeof(long));
+	DEFINE(LER3,  offsetof(struct pt_regs, er3)      - sizeof(long));
+	DEFINE(LER4,  offsetof(struct pt_regs, er4)      - sizeof(long));
+	DEFINE(LER5,  offsetof(struct pt_regs, er5)      - sizeof(long));
+	DEFINE(LER6,  offsetof(struct pt_regs, er6)      - sizeof(long));
+	DEFINE(LORIG, offsetof(struct pt_regs, orig_er0) - sizeof(long));
+	DEFINE(LSP,   offsetof(struct pt_regs, sp)       - sizeof(long));
+	DEFINE(LCCR,  offsetof(struct pt_regs, ccr)      - sizeof(long));
+	DEFINE(LVEC,  offsetof(struct pt_regs, vector)   - sizeof(long));
+#if defined(CONFIG_CPU_H8S)
+	DEFINE(LEXR,  offsetof(struct pt_regs, exr)      - sizeof(long));
+#endif
+	DEFINE(LRET,  offsetof(struct pt_regs, pc)       - sizeof(long));
+
+	DEFINE(PT_PTRACED, PT_PTRACED);
+
+	/* offsets in thread_info structure */
+	OFFSET(TI_TASK, thread_info, task);
+	OFFSET(TI_FLAGS, thread_info, flags);
+	OFFSET(TI_CPU, thread_info, cpu);
+	OFFSET(TI_PRE, thread_info, preempt_count);
+
+	return 0;
+}
arch/h8300/kernel/dma.c new file +69 -0

69 lines not on this page · raw message

arch/h8300/kernel/h8300_ksyms.c new file +34 -0
new file mode 100644
index 0000000..33bf96a
@@ -0,0 +1,34 @@
+#include <linux/module.h>
+#include <linux/linkage.h>
+
+/*
+ * libgcc functions - functions that are used internally by the
+ * compiler...  (prototypes are not correct though, but that
+ * doesn't really matter since they're not versioned).
+ */
+asmlinkage long long __ashldi3(long long, int);
+asmlinkage long long __ashrdi3(long long, int);
+asmlinkage long long __lshrdi3(long long, int);
+asmlinkage long __divsi3(long, long);
+asmlinkage long __modsi3(long, long);
+asmlinkage unsigned long __umodsi3(unsigned long, unsigned long);
+asmlinkage long long __muldi3(long long, long long);
+asmlinkage long __mulsi3(long, long);
+asmlinkage long __udivsi3(long, long);
+asmlinkage void *memcpy(void *, const void *, size_t);
+asmlinkage void *memset(void *, int, size_t);
+asmlinkage long strncpy_from_user(void *to, void *from, size_t n);
+
+	/* gcc lib functions */
+EXPORT_SYMBOL(__ashldi3);
+EXPORT_SYMBOL(__ashrdi3);
+EXPORT_SYMBOL(__lshrdi3);
+EXPORT_SYMBOL(__divsi3);
+EXPORT_SYMBOL(__modsi3);
+EXPORT_SYMBOL(__umodsi3);
+EXPORT_SYMBOL(__muldi3);
+EXPORT_SYMBOL(__mulsi3);
+EXPORT_SYMBOL(__udivsi3);
+EXPORT_SYMBOL(memcpy);
+EXPORT_SYMBOL(memset);
+EXPORT_SYMBOL(strncpy_from_user);
arch/h8300/kernel/module.c new file +70 -0

70 lines not on this page · raw message

arch/h8300/kernel/sim-console.c new file +79 -0

79 lines not on this page · raw message

arch/h8300/kernel/syscalls.c new file +14 -0
new file mode 100644
index 0000000..1f9123a
@@ -0,0 +1,14 @@
+#include <linux/syscalls.h>
+#include <linux/signal.h>
+#include <linux/unistd.h>
+
+#undef __SYSCALL
+#define __SYSCALL(nr, call) [nr] = (call),
+
+#define sys_mmap2 sys_mmap_pgoff
+
+asmlinkage int sys_rt_sigreturn(void);
+
+void *_sys_call_table[__NR_syscalls] = {
+#include <asm/unistd.h>
+};
Signature · 1 line
2.1.4
author maintainer
#17 lore raw

PATCH v10 14/19 h8300: Library functions

In reply to Yoshinori Sato

h8300 assembly functions and private libgcc.

---
 arch/h8300/lib/Makefile    |   8 +++
 arch/h8300/lib/abs.S       |  20 ++++++
 arch/h8300/lib/ashldi3.c   |  24 +++++++
 arch/h8300/lib/ashrdi3.c   |  24 +++++++
 arch/h8300/lib/checksum.c  | 167 +++++++++++++++++++++++++++++++++++++++++++++
 arch/h8300/lib/delay.c     |  40 +++++++++++
 arch/h8300/lib/libgcc.h    |  77 +++++++++++++++++++++
 arch/h8300/lib/lshrdi3.c   |  23 +++++++
 arch/h8300/lib/memcpy.S    |  85 +++++++++++++++++++++++
 arch/h8300/lib/memset.S    |  69 +++++++++++++++++++
 arch/h8300/lib/moddivsi3.S |  72 +++++++++++++++++++
 arch/h8300/lib/modsi3.S    |  72 +++++++++++++++++++
 arch/h8300/lib/muldi3.c    |  44 ++++++++++++
 arch/h8300/lib/mulsi3.S    |  38 +++++++++++
 arch/h8300/lib/strncpy.S   |  34 +++++++++
 arch/h8300/lib/ucmpdi2.c   |  17 +++++
 arch/h8300/lib/udivsi3.S   |  76 +++++++++++++++++++++
 17 files changed, 890 insertions(+)
 create mode 100644 arch/h8300/lib/Makefile
 create mode 100644 arch/h8300/lib/abs.S
 create mode 100644 arch/h8300/lib/ashldi3.c
 create mode 100644 arch/h8300/lib/ashrdi3.c
 create mode 100644 arch/h8300/lib/checksum.c
 create mode 100644 arch/h8300/lib/delay.c
 create mode 100644 arch/h8300/lib/libgcc.h
 create mode 100644 arch/h8300/lib/lshrdi3.c
 create mode 100644 arch/h8300/lib/memcpy.S
 create mode 100644 arch/h8300/lib/memset.S
 create mode 100644 arch/h8300/lib/moddivsi3.S
 create mode 100644 arch/h8300/lib/modsi3.S
 create mode 100644 arch/h8300/lib/muldi3.c
 create mode 100644 arch/h8300/lib/mulsi3.S
 create mode 100644 arch/h8300/lib/strncpy.S
 create mode 100644 arch/h8300/lib/ucmpdi2.c
 create mode 100644 arch/h8300/lib/udivsi3.S
arch/h8300/lib/Makefile new file +8 -0
new file mode 100644
index 0000000..60878c4
@@ -0,0 +1,8 @@
+#
+# Makefile for H8/300-specific library files..
+#
+
+lib-y  = checksum.o memcpy.o memset.o abs.o strncpy.o \
+	 mulsi3.o udivsi3.o muldi3.o moddivsi3.o \
+	 ashldi3.o lshrdi3.o ashrdi3.o ucmpdi2.o \
+	 delay.o
arch/h8300/lib/abs.S new file +20 -0
new file mode 100644
index 0000000..efda749
@@ -0,0 +1,20 @@
+;;; abs.S
+
+#include <asm/linkage.h>
+
+#if defined(CONFIG_CPU_H8300H)
+	.h8300h
+#endif
+#if defined(CONFIG_CPU_H8S)
+	.h8300s
+#endif
+	.text
+.global _abs
+
+;;; int abs(int n)
+_abs:
+	mov.l	er0,er0
+	bpl	1f
+	neg.l	er0
+1:
+	rts
arch/h8300/lib/ashldi3.c new file +24 -0
new file mode 100644
index 0000000..c6aa8ea
@@ -0,0 +1,24 @@
+#include "libgcc.h"
+
+DWtype
+__ashldi3(DWtype u, word_type b)
+{
+	const DWunion uu = {.ll = u};
+	const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
+	DWunion w;
+
+	if (b == 0)
+		return u;
+
+	if (bm <= 0) {
+		w.s.low = 0;
+		w.s.high = (UWtype) uu.s.low << -bm;
+	} else {
+		const UWtype carries = (UWtype) uu.s.low >> bm;
+
+		w.s.low = (UWtype) uu.s.low << b;
+		w.s.high = ((UWtype) uu.s.high << b) | carries;
+	}
+
+	return w.ll;
+}
arch/h8300/lib/ashrdi3.c new file +24 -0
new file mode 100644
index 0000000..070adf9
@@ -0,0 +1,24 @@
+#include "libgcc.h"
+
+DWtype __ashrdi3(DWtype u, word_type b)
+{
+	const DWunion uu = {.ll = u};
+	const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
+	DWunion w;
+
+	if (b == 0)
+		return u;
+
+	if (bm <= 0) {
+		/* w.s.high = 1..1 or 0..0 */
+		w.s.high = uu.s.high >> (sizeof (Wtype) * BITS_PER_UNIT - 1);
+		w.s.low = uu.s.high >> -bm;
+	} else {
+		const UWtype carries = (UWtype) uu.s.high << bm;
+
+		w.s.high = uu.s.high >> b;
+		w.s.low = ((UWtype) uu.s.low >> b) | carries;
+	}
+
+	return w.ll;
+}
arch/h8300/lib/checksum.c new file +167 -0

167 lines not on this page · raw message

arch/h8300/lib/delay.c new file +40 -0
new file mode 100644
index 0000000..463f6b3
@@ -0,0 +1,40 @@
+/*
+ * delay loops
+ *
+ * Copyright (C) 2015 Yoshinori Sato
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <asm/param.h>
+#include <asm/processor.h>
+#include <asm/timex.h>
+
+void __delay(unsigned long cycles)
+{
+	__asm__ volatile ("1: dec.l #1,%0\n\t"
+			  "bne 1b":"=r"(cycles):"0"(cycles));
+}
+EXPORT_SYMBOL(__delay);
+
+void __const_udelay(unsigned long xloops)
+{
+	u64 loops;
+
+	loops = (u64)xloops * loops_per_jiffy * HZ;
+
+	__delay(loops >> 32);
+}
+EXPORT_SYMBOL(__const_udelay);
+
+void __udelay(unsigned long usecs)
+{
+	__const_udelay(usecs * 0x10C7UL); /* 2**32 / 1000000 (rounded up) */
+}
+EXPORT_SYMBOL(__udelay);
+
+void __ndelay(unsigned long nsecs)
+{
+	__const_udelay(nsecs * 0x5UL); /* 2**32 / 1000000000 (rounded up) */
+}
+EXPORT_SYMBOL(__ndelay);
arch/h8300/lib/libgcc.h new file +77 -0

77 lines not on this page · raw message

arch/h8300/lib/lshrdi3.c new file +23 -0
new file mode 100644
index 0000000..a86bbe3
@@ -0,0 +1,23 @@
+#include "libgcc.h"
+
+DWtype __lshrdi3(DWtype u, word_type b)
+{
+	const DWunion uu = {.ll = u};
+	const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
+	DWunion w;
+
+	if (b == 0)
+		return u;
+
+	if (bm <= 0) {
+		w.s.high = 0;
+		w.s.low = (UWtype) uu.s.high >> -bm;
+	} else {
+		const UWtype carries = (UWtype) uu.s.high << bm;
+
+		w.s.high = (UWtype) uu.s.high >> b;
+		w.s.low = ((UWtype) uu.s.low >> b) | carries;
+	}
+
+	return w.ll;
+}
arch/h8300/lib/memcpy.S new file +85 -0

85 lines not on this page · raw message

arch/h8300/lib/memset.S new file +69 -0

69 lines not on this page · raw message

arch/h8300/lib/moddivsi3.S new file +72 -0

72 lines not on this page · raw message

arch/h8300/lib/modsi3.S new file +72 -0

72 lines not on this page · raw message

arch/h8300/lib/muldi3.c new file +44 -0

44 lines not on this page · raw message

arch/h8300/lib/mulsi3.S new file +38 -0
new file mode 100644
index 0000000..451f0e0
@@ -0,0 +1,38 @@
+;
+; mulsi3 for H8/300H - based on Renesas SH implementation
+;
+; by Toshiyasu Morita
+;
+; Old code:
+;
+; 16b * 16b = 372 states (worst case)
+; 32b * 32b = 724 states (worst case)
+;
+; New code:
+;
+; 16b * 16b =  48 states
+; 16b * 32b =  72 states
+; 32b * 32b =  92 states
+;
+
+	.global __mulsi3
+__mulsi3:
+	mov.w	r1,r2   ; ( 2 states) b * d
+	mulxu	r0,er2  ; (22 states)
+
+	mov.w	e0,r3   ; ( 2 states) a * d
+	beq	L_skip1 ; ( 4 states)
+	mulxu	r1,er3  ; (22 states)
+	add.w	r3,e2   ; ( 2 states)
+
+L_skip1:
+	mov.w	e1,r3   ; ( 2 states) c * b
+	beq	L_skip2 ; ( 4 states)
+	mulxu	r0,er3  ; (22 states)
+	add.w	r3,e2   ; ( 2 states)
+
+L_skip2:
+	mov.l	er2,er0	; ( 2 states)
+	rts		; (10 states)
+
+	.end
arch/h8300/lib/strncpy.S new file +34 -0
new file mode 100644
index 0000000..d00396a
@@ -0,0 +1,34 @@
+;;; strncpy.S
+
+#include <asm/linkage.h>
+
+	.text
+.global strncpy_from_user
+
+;;; long strncpy_from_user(void *to, void *from, size_t n)
+strncpy_from_user:
+	mov.l	er2,er2
+	bne	1f
+	sub.l	er0,er0
+	rts
+1:
+	mov.l	er4,@-sp
+	sub.l	er3,er3
+2:
+	mov.b	@er1+,r4l
+	mov.b	r4l,@er0
+	adds	#1,er0
+	beq	3f
+	inc.l	#1,er3
+	dec.l	#1,er2
+	bne	2b
+3:
+	dec.l	#1,er2
+4:
+	mov.b	r4l,@er0
+	adds	#1,er0
+	dec.l	#1,er2
+	bne	4b
+	mov.l	er3,er0
+	mov.l	@sp+,er4
+	rts
arch/h8300/lib/ucmpdi2.c new file +17 -0
new file mode 100644
index 0000000..772399d
@@ -0,0 +1,17 @@
+#include "libgcc.h"
+
+word_type __ucmpdi2(DWtype a, DWtype b)
+{
+	const DWunion au = {.ll = a};
+	const DWunion bu = {.ll = b};
+
+	if ((UWtype) au.s.high < (UWtype) bu.s.high)
+		return 0;
+	else if ((UWtype) au.s.high > (UWtype) bu.s.high)
+		return 2;
+	if ((UWtype) au.s.low < (UWtype) bu.s.low)
+		return 0;
+	else if ((UWtype) au.s.low > (UWtype) bu.s.low)
+		return 2;
+	return 1;
+}
arch/h8300/lib/udivsi3.S new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#21 lore raw

PATCH v10 18/19 h8300: configs

In reply to Yoshinori Sato
h8300h-sim_defconfig: H8/300H simulator config.
h8s-sim_defconfig:    H8S simulator config.
edosk2674_defconfig:  EDOSK2674R evalution board config.
---
 arch/h8300/configs/edosk2674_defconfig  | 49 ++++++++++++++++++++++++++++++
 arch/h8300/configs/h8300h-sim_defconfig | 53 +++++++++++++++++++++++++++++++++
 arch/h8300/configs/h8s-sim_defconfig    | 53 +++++++++++++++++++++++++++++++++
 3 files changed, 155 insertions(+)
 create mode 100644 arch/h8300/configs/edosk2674_defconfig
 create mode 100644 arch/h8300/configs/h8300h-sim_defconfig
 create mode 100644 arch/h8300/configs/h8s-sim_defconfig
arch/h8300/configs/edosk2674_defconfig new file +49 -0
new file mode 100644
index 0000000..86a46d6
@@ -0,0 +1,49 @@
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_USELIB is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_UID16 is not set
+# CONFIG_SYSFS_SYSCALL is not set
+# CONFIG_KALLSYMS is not set
+# CONFIG_BASE_FULL is not set
+# CONFIG_FUTEX is not set
+# CONFIG_EPOLL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_TIMERFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+# CONFIG_ADVISE_SYSCALLS is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLOB=y
+# CONFIG_BLOCK is not set
+CONFIG_H8S_EDOSK2674=y
+CONFIG_H8300_BUILTIN_DTB="edosk2674"
+# CONFIG_BINFMT_SCRIPT is not set
+CONFIG_BINFMT_FLAT=y
+# CONFIG_COREDUMP is not set
+# CONFIG_UEVENT_HELPER is not set
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_ALLOW_DEV_COREDUMP is not set
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_UNIX98_PTYS is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_SH_SCI=y
+CONFIG_SERIAL_SH_SCI_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY_USER is not set
+# CONFIG_PROC_FS is not set
+# CONFIG_SYSFS is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
arch/h8300/configs/h8300h-sim_defconfig new file +53 -0

53 lines not on this page · raw message

arch/h8300/configs/h8s-sim_defconfig new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#18 lore raw

PATCH v10 15/19 h8300: Build scripts

In reply to Yoshinori Sato

h8300's Makefile, Kconfig and memory layout.

---
 arch/h8300/Kconfig              | 75 +++++++++++++++++++++++++++++++
 arch/h8300/Kconfig.cpu          | 97 +++++++++++++++++++++++++++++++++++++++++
 arch/h8300/Makefile             | 55 +++++++++++++++++++++++
 arch/h8300/kernel/Makefile      | 16 +++++++
 arch/h8300/kernel/vmlinux.lds.S | 67 ++++++++++++++++++++++++++++
 5 files changed, 310 insertions(+)
 create mode 100644 arch/h8300/Kconfig
 create mode 100644 arch/h8300/Kconfig.cpu
 create mode 100644 arch/h8300/Makefile
 create mode 100644 arch/h8300/kernel/Makefile
 create mode 100644 arch/h8300/kernel/vmlinux.lds.S
arch/h8300/Kconfig new file +75 -0
new file mode 100644
index 0000000..f2ea4e1
@@ -0,0 +1,75 @@
+config H8300
+        def_bool y
+	select GENERIC_ATOMIC64
+	select HAVE_UID16
+	select VIRT_TO_BUS
+	select ARCH_WANT_IPC_PARSE_VERSION
+	select GENERIC_IRQ_SHOW
+	select FRAME_POINTER
+	select GENERIC_CPU_DEVICES
+	select MODULES_USE_ELF_RELA
+	select GENERIC_CLOCKEVENTS
+	select CLKDEV_LOOKUP
+	select COMMON_CLK
+	select ARCH_WANT_FRAME_POINTERS
+	select OF
+	select OF_EARLY_FLATTREE
+	select HAVE_MEMBLOCK
+	select IRQ_DOMAIN
+	select HANDLE_DOMAIN_IRQ
+	select HAVE_DMA_ATTRS
+
+config RWSEM_GENERIC_SPINLOCK
+	def_bool y
+
+config GENERIC_HWEIGHT
+	def_bool y
+
+config NO_IOPORT_MAP
+	def_bool y
+
+config HZ
+	int
+	default 100
+
+config NR_CPUS
+	int
+	default 1
+
+source "init/Kconfig"
+
+source "kernel/Kconfig.freezer"
+
+source "arch/h8300/Kconfig.cpu"
+
+menu "Kernel Features"
+
+source "kernel/Kconfig.preempt"
+
+source "mm/Kconfig"
+
+endmenu
+
+menu "Executable file formats"
+
+source "fs/Kconfig.binfmt"
+
+endmenu
+
+source "net/Kconfig"
+
+source "drivers/Kconfig"
+
+source "fs/Kconfig"
+
+menu "Kernel hacking"
+
+source "lib/Kconfig.debug"
+
+endmenu
+
+source "security/Kconfig"
+
+source "crypto/Kconfig"
+
+source "lib/Kconfig"
arch/h8300/Kconfig.cpu new file +97 -0

97 lines not on this page · raw message

arch/h8300/Makefile new file +55 -0

55 lines not on this page · raw message

arch/h8300/kernel/Makefile new file +16 -0
new file mode 100644
index 0000000..0b5fe00
@@ -0,0 +1,16 @@
+#
+# Makefile for the linux kernel.
+#
+
+extra-y := vmlinux.lds
+
+obj-y := process.o traps.o ptrace.o \
+	 signal.o setup.o syscalls.o \
+	 irq.o entry.o dma.o cpu/
+
+obj-$(CONFIG_ROMKERNEL) += head_rom.o
+obj-$(CONFIG_RAMKERNEL) += head_ram.o
+
+obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o
+obj-$(CONFIG_H8300H_SIM) += sim-console.o
+obj-$(CONFIG_H8S_SIM) += sim-console.o
arch/h8300/kernel/vmlinux.lds.S new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#19 lore raw

PATCH v10 16/19 h8300: clock driver

In reply to Yoshinori Sato

H8/300 clock driver
clk-div: common clock divier
clk-h8s2678: PLL driver

---
 .../bindings/clock/renesas,h8300-div-clock.txt     |  24 ++++
 .../bindings/clock/renesas,h8s2678-pll-clock.txt   |  23 ++++
 drivers/clk/Makefile                               |   1 +
 drivers/clk/h8300/Makefile                         |   2 +
 drivers/clk/h8300/clk-div.c                        |  53 ++++++++
 drivers/clk/h8300/clk-h8s2678.c                    | 147 +++++++++++++++++++++
 6 files changed, 250 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,h8s2678-pll-clock.txt
 create mode 100644 drivers/clk/h8300/Makefile
 create mode 100644 drivers/clk/h8300/clk-div.c
 create mode 100644 drivers/clk/h8300/clk-h8s2678.c
Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt new file +24 -0
new file mode 100644
index 0000000..36c2b52
@@ -0,0 +1,24 @@
+* Renesas H8/300 divider clock
+
+Required Properties:
+
+  - compatible: Must be "renesas,sh73a0-h8300-div-clock"
+
+  - clocks: Reference to the parent clocks ("extal1" and "extal2")
+
+  - #clock-cells: Must be 1
+
+  - reg: Base address and length of the divide rate selector
+
+  - renesas,width: bit width of selector
+
+Example
+-------
+
+		cclk: cclk {
+			compatible = "renesas,h8300-div-clock";
+			clocks = <&xclk>;
+			#clock-cells = <0>;
+			reg = <0xfee01b 2>;
+			renesas,width = <2>;
+		};
Documentation/devicetree/bindings/clock/renesas,h8s2678-pll-clock.txt new file +23 -0
new file mode 100644
index 0000000..500cdadb
@@ -0,0 +1,23 @@
+Renesas H8S2678 PLL clock
+
+This device is Clock multiplyer
+
+Required Properties:
+
+  - compatible: Must be "renesas,h8s2678-pll-clock"
+
+  - clocks: Reference to the parent clocks
+
+  - #clock-cells: Must be 0
+
+  - reg: Two rate selector (Multiply / Divide) register address
+
+Example
+-------
+
+		pllclk: pllclk {
+			compatible = "renesas,h8s2678-pll-clock";
+			clocks = <&xclk>;
+			#clock-cells = <0>;
+			reg = <0xfee03b 2>, <0xfee045 2>;
+		};
drivers/clk/Makefile +1 -0
index 3d00c25..9df871d 100644
@@ -73,3 +73,4 @@ obj-$(CONFIG_ARCH_U8500)		+= ux500/
 obj-$(CONFIG_COMMON_CLK_VERSATILE)	+= versatile/
 obj-$(CONFIG_X86)			+= x86/
 obj-$(CONFIG_ARCH_ZYNQ)			+= zynq/
+obj-$(CONFIG_H8300)		+= h8300/
drivers/clk/h8300/Makefile new file +2 -0
new file mode 100644
index 0000000..b86427c3
@@ -0,0 +1,2 @@
+obj-y += clk-div.o
+obj-$(CONFIG_H8S2678) += clk-h8s2678.o
drivers/clk/h8300/clk-div.c new file +53 -0

53 lines not on this page · raw message

drivers/clk/h8300/clk-h8s2678.c new file +147 -0

147 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#22 lore raw

PATCH v10 19/19 h8300: devicetree source

In reply to Yoshinori Sato
---
 Documentation/devicetree/bindings/h8300/cpu.txt    |  17 ++++
 .../interrupt-controller/renesas,h8300h-intc.txt   |  20 ++++
 .../interrupt-controller/renesas,h8s-intc.txt      |  20 ++++
 arch/h8300/boot/dts/Makefile                       |  11 ++
 arch/h8300/boot/dts/dt-bindings                    |   1 +
 arch/h8300/boot/dts/edosk2674.dts                  | 111 +++++++++++++++++++++
 arch/h8300/boot/dts/h8300h_sim.dts                 |  97 ++++++++++++++++++
 arch/h8300/boot/dts/h8s_sim.dts                    | 103 +++++++++++++++++++
 8 files changed, 380 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/h8300/cpu.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,h8300h-intc.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt
 create mode 100644 arch/h8300/boot/dts/Makefile
 create mode 120000 arch/h8300/boot/dts/dt-bindings
 create mode 100644 arch/h8300/boot/dts/edosk2674.dts
 create mode 100644 arch/h8300/boot/dts/h8300h_sim.dts
 create mode 100644 arch/h8300/boot/dts/h8s_sim.dts
Documentation/devicetree/bindings/h8300/cpu.txt new file +17 -0
new file mode 100644
index 0000000..f1287e0
@@ -0,0 +1,17 @@
+* H8/300 CPU bindings
+
+Required properties:
+
+- compatible: Compatible property value should be "renesas,h8300".
+- reg: Contains CPU index.
+- clock-frequency: Contains the clock frequency for CPU, in Hz.
+- renesas,bus-width: Contain the memory bus width.
+
+Example:
+
+		cpu@0 {
+			compatible = "renesas,h8300";
+			reg = <0>;
+			clock-frequency = <20000000>;
+			renesas,bus-width = <16>;
+		};
Documentation/devicetree/bindings/interrupt-controller/renesas,h8300h-intc.txt new file +20 -0
new file mode 100644
index 0000000..79053dd
@@ -0,0 +1,20 @@
+* H8/300H Interrupt controller
+
+Required properties:
+
+- compatible: has to be "renesas,h8300h-intc", "renesas,h8300-intc" as fallback.
+- #interrupt-cells: has to be <1>: an interrupt index and flags, as defined in
+  interrupts.txt in this directory
+
+Optional properties:
+
+- any properties, listed in interrupts.txt, and any standard resource allocation
+  properties
+
+Example:
+
+	h8intc: intc@0 {
+		compatible = "renesas,h8300h-intc", "renesas,h8300-intc";
+		#interrupt-cells = <1>;
+		interrupt-controller;
+	};
Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt new file +20 -0
new file mode 100644
index 0000000..1206191
@@ -0,0 +1,20 @@
+* H8S Interrupt controller
+
+Required properties:
+
+- compatible: has to be "renesas,h8s-intc", "renesas,h8300-intc" as fallback.
+- #interrupt-cells: has to be <1>: an interrupt index and flags, as defined in
+  interrupts.txt in this directory
+
+Optional properties:
+
+- any properties, listed in interrupts.txt, and any standard resource allocation
+  properties
+
+Example:
+
+	h8intc: intc@0 {
+		compatible = "renesas,h8s-intc", "renesas,h8300-intc";
+		#interrupt-cells = <1>;
+		interrupt-controller;
+	};
arch/h8300/boot/dts/Makefile new file +11 -0
new file mode 100644
index 0000000..bb123fa
@@ -0,0 +1,11 @@
+ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
+BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_H8300_BUILTIN_DTB)).dtb.o
+endif
+
+obj-y += $(BUILTIN_DTB)
+
+dtb-$(CONFIG_H8300H_SIM) := h8300h_sim.dtb
+dtb-$(CONFIG_H8S_SIM) := h8s_sim.dtb
+dtb-$(CONFIG_EDOSK2674) := edosk2674.dtb
+
+clean-files := *.dtb.S
arch/h8300/boot/dts/dt-bindings new file +1 -0
new file mode 120000
index 0000000..0cecb3d
@@ -0,0 +1 @@
+../../../../include/dt-bindings
\ No newline at end of file
arch/h8300/boot/dts/edosk2674.dts new file +111 -0

111 lines not on this page · raw message

arch/h8300/boot/dts/h8300h_sim.dts new file +97 -0

97 lines not on this page · raw message

arch/h8300/boot/dts/h8s_sim.dts new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.1.4
#23 lore raw

Re: [PATCH v10 19/19] h8300: devicetree source

CC devicetree

Quoted 452 lines · Yoshinori Sato
---
 Documentation/devicetree/bindings/h8300/cpu.txt    |  17 ++++
 .../interrupt-controller/renesas,h8300h-intc.txt   |  20 ++++
 .../interrupt-controller/renesas,h8s-intc.txt      |  20 ++++
 arch/h8300/boot/dts/Makefile                       |  11 ++
 arch/h8300/boot/dts/dt-bindings                    |   1 +
 arch/h8300/boot/dts/edosk2674.dts                  | 111 +++++++++++++++++++++
 arch/h8300/boot/dts/h8300h_sim.dts                 |  97 ++++++++++++++++++
 arch/h8300/boot/dts/h8s_sim.dts                    | 103 +++++++++++++++++++
 8 files changed, 380 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/h8300/cpu.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,h8300h-intc.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt
 create mode 100644 arch/h8300/boot/dts/Makefile
 create mode 120000 arch/h8300/boot/dts/dt-bindings
 create mode 100644 arch/h8300/boot/dts/edosk2674.dts
 create mode 100644 arch/h8300/boot/dts/h8300h_sim.dts
 create mode 100644 arch/h8300/boot/dts/h8s_sim.dts
Documentation/devicetree/bindings/h8300/cpu.txt new file +17 -0
new file mode 100644
index 0000000..f1287e0
@@ -0,0 +1,17 @@
+* H8/300 CPU bindings
+
+Required properties:
+
+- compatible: Compatible property value should be "renesas,h8300".
+- reg: Contains CPU index.
+- clock-frequency: Contains the clock frequency for CPU, in Hz.
+- renesas,bus-width: Contain the memory bus width.
+
+Example:
+
+               cpu@0 {
+                       compatible = "renesas,h8300";
+                       reg = <0>;
+                       clock-frequency = <20000000>;
+                       renesas,bus-width = <16>;
+               };
Documentation/devicetree/bindings/interrupt-controller/renesas,h8300h-intc.txt new file +20 -0
new file mode 100644
index 0000000..79053dd
@@ -0,0 +1,20 @@
+* H8/300H Interrupt controller
+
+Required properties:
+
+- compatible: has to be "renesas,h8300h-intc", "renesas,h8300-intc" as fallback.
+- #interrupt-cells: has to be <1>: an interrupt index and flags, as defined in
+  interrupts.txt in this directory
+
+Optional properties:
+
+- any properties, listed in interrupts.txt, and any standard resource allocation
+  properties
+
+Example:
+
+       h8intc: intc@0 {
+               compatible = "renesas,h8300h-intc", "renesas,h8300-intc";
+               #interrupt-cells = <1>;
+               interrupt-controller;
+       };
Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt new file +20 -0
new file mode 100644
index 0000000..1206191
@@ -0,0 +1,20 @@
+* H8S Interrupt controller
+
+Required properties:
+
+- compatible: has to be "renesas,h8s-intc", "renesas,h8300-intc" as fallback.
+- #interrupt-cells: has to be <1>: an interrupt index and flags, as defined in
+  interrupts.txt in this directory
+
+Optional properties:
+
+- any properties, listed in interrupts.txt, and any standard resource allocation
+  properties
+
+Example:
+
+       h8intc: intc@0 {
+               compatible = "renesas,h8s-intc", "renesas,h8300-intc";
+               #interrupt-cells = <1>;
+               interrupt-controller;
+       };
arch/h8300/boot/dts/Makefile new file +11 -0
new file mode 100644
index 0000000..bb123fa
@@ -0,0 +1,11 @@
+ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
+BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_H8300_BUILTIN_DTB)).dtb.o
+endif
+
+obj-y += $(BUILTIN_DTB)
+
+dtb-$(CONFIG_H8300H_SIM) := h8300h_sim.dtb
+dtb-$(CONFIG_H8S_SIM) := h8s_sim.dtb
+dtb-$(CONFIG_EDOSK2674) := edosk2674.dtb
+
+clean-files := *.dtb.S
arch/h8300/boot/dts/dt-bindings new file +1 -0
new file mode 120000
index 0000000..0cecb3d
@@ -0,0 +1 @@
+../../../../include/dt-bindings
\ No newline at end of file
arch/h8300/boot/dts/edosk2674.dts new file +111 -0
new file mode 100644
index 0000000..fe3c334
@@ -0,0 +1,111 @@
+#include <dt-bindings/clock/renesas,8bit-timer.h>
+
+/dts-v1/;
+/ {
+       compatible = "renesas,edosk2674";
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&h8intc>;
+
+       chosen {
+               bootargs = "console=ttySC2,38400";
+       };
+       aliases {
+               serial0 = &sci0;
+               serial1 = &sci1;
+               serial2 = &sci2;
+       };
+
+       clocks {
+               ranges;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               xclk: xclk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <33333333>;
+                       clock-output-names = "xtal";
+               };
+               pllclk: pllclk {
+                       compatible = "renesas,h8s2678-pll-clock";
+                       clocks = <&xclk>;
+                       #clock-cells = <0>;
+                       reg = <0xfee03b 2>, <0xfee045 2>;
+               };
+               cclk: cclk {
+                       compatible = "renesas,h8300-div-clock";
+                       clocks = <&pllclk>;
+                       #clock-cells = <0>;
+                       reg = <0xfee03b 2>;
+                       renesas,width = <3>;
+               };
+               pclk: pclk {
+                       compatible = "fixed-factor-clock";
+                       clocks = <&cclk>;
+                       #clock-cells = <0>;
+                       clock-div = <1>;
+                       clock-mult = <1>;
+               };
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x400000 0x800000>;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               cpu@0 {
+                       compatible = "renesas,h8300";
+                       reg = <0>;
+                       renesas,bus-width = <16>;
+                       clock-frequency = <33333333>;
+                       bus-width = <16>;
+               };
+       };
+
+       h8intc: intc@0 {
+               compatible = "renesas,h8s-intc", "renesas,h8300-intc";
+               #interrupt-cells = <1>;
+               interrupt-controller;
+       };
+       tpu: tpu@ffffe0 {
+               compatible = "renesas,tpu";
+               reg = <0xffffe0 16>, <0xfffff0 12>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+
+       timer8: timer@ffffb0 {
+               compatible = "renesas,8bit-timer";
+               reg = <0xffff80 10>;
+               interrupts = <72 75>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+               renesas,mode = <CLOCKEVENTDEVICE>;
+               renesas,div = <DIV_8>;
+       };
+
+       sci0: serial@ffff78 {
+               compatible = "renesas,sci";
+               reg = <0xffff78 8>;
+               interrupts = <88 89 90 91>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+       sci1: serial@ffff80 {
+               compatible = "renesas,sci";
+               reg = <0xffff80 8>;
+               interrupts = <92 93 94 95>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+       sci2: serial@ffff88 {
+               compatible = "renesas,sci";
+               reg = <0xffff88 8>;
+               interrupts = <96 97 98 99>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+};
arch/h8300/boot/dts/h8300h_sim.dts new file +97 -0
new file mode 100644
index 0000000..bd150fb
@@ -0,0 +1,97 @@
+#include <dt-bindings/clock/renesas,8bit-timer.h>
+
+/dts-v1/;
+/ {
+       compatible = "gnu,gdbsim";
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&h8intc>;
+
+       chosen {
+               bootargs = "console=ttySC0";
+       };
+       aliases {
+               serial0 = &sci0;
+               serial1 = &sci1;
+       };
+
+       clocks {
+               ranges;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               xclk: xclk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <20000000>;
+                       clock-output-names = "xtal";
+               };
+               cclk: cclk {
+                       compatible = "renesas,h8300-div-clock";
+                       clocks = <&xclk>;
+                       #clock-cells = <0>;
+                       reg = <0xfee01b 2>;
+                       renesas,width = <2>;
+               };
+               pclk: pclk {
+                       compatible = "fixed-factor-clock";
+                       clocks = <&cclk>;
+                       #clock-cells = <0>;
+                       clock-div = <1>;
+                       clock-mult = <1>;
+               };
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x400000 0x400000>;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               cpu@0 {
+                       compatible = "renesas,h8300";
+                       reg = <0>;
+                       clock-frequency = <20000000>;
+                       renesas,bus-width = <16>;
+               };
+       };
+
+       h8intc: intc@0 {
+               compatible = "renesas,h8300h-intc", "renesas,h8300-intc";
+               #interrupt-cells = <1>;
+               interrupt-controller;
+       };
+       timer8: timer@ffff80 {
+               compatible = "renesas,8bit-timer";
+               reg = <0xffff80 10>;
+               interrupts = <36 39>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+               renesas,mode = <CLOCKSOURCE>;
+               renesas,div = <DIV_8>;
+       };
+       timer16: timer@ffff68 {
+               compatible = "renesas,16bit-timer";
+               reg = <0xffff68 8>, <0xffff60 8>;
+               interrupts = <24>;
+               renesas,channel = <0>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+
+       sci0: serial@ffffb0 {
+               compatible = "renesas,sci";
+               reg = <0xffffb0 8>;
+               interrupts = <52 53 54 55>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+       sci1: serial@ffffb8 {
+               compatible = "renesas,sci";
+               reg = <0xffffb8 8>;
+               interrupts = <56 57 58 59>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+};
arch/h8300/boot/dts/h8s_sim.dts new file +103 -1
new file mode 100644
index 0000000..26b653d
@@ -0,0 +1,103 @@
+#include <dt-bindings/clock/renesas,8bit-timer.h>
+
+/dts-v1/;
+/ {
+       compatible = "gnu,gdbsim";
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&h8intc>;
+
+       chosen {
+               bootargs = "console=ttySC0";
+       };
+       aliases {
+               serial0 = &sci0;
+               serial1 = &sci1;
+       };
+
+       clocks {
+               ranges;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               xclk: xclk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <33333333>;
+                       clock-output-names = "xtal";
+               };
+               pllclk: pllclk {
+                       compatible = "renesas,h8s2678-pll-clock";
+                       clocks = <&xclk>;
+                       #clock-cells = <0>;
+                       reg = <0xfee03b 2>, <0xfee045 2>;
+               };
+               cclk: cclk {
+                       compatible = "renesas,h8300-div-clock";
+                       clocks = <&pllclk>;
+                       #clock-cells = <0>;
+                       reg = <0xfee03b 2>;
+                       renesas,width = <3>;
+               };
+               pclk: pclk {
+                       compatible = "fixed-factor-clock";
+                       clocks = <&cclk>;
+                       #clock-cells = <0>;
+                       clock-div = <1>;
+                       clock-mult = <1>;
+               };
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x400000 0x800000>;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               cpu@0 {
+                       compatible = "renesas,h8300";
+                       reg = <0>;
+                       renesas,bus-width = <16>;
+                       clock-frequency = <33333333>;
+                       bus-width = <16>;
+               };
+       };
+
+       h8intc: intc@0 {
+               compatible = "renesas,h8s-intc", "renesas,h8300-intc";
+               #interrupt-cells = <1>;
+               interrupt-controller;
+       };
+       tpu: tpu@ffffe0 {
+               compatible = "renesas,tpu";
+               reg = <0xffffe0 16>, <0xfffff0 12>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+
+       timer8: timer@ffffb0 {
+               compatible = "renesas,8bit-timer";
+               reg = <0xffff80 10>;
+               interrupts = <72 75>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+               renesas,mode = <CLOCKEVENTDEVICE>;
+               renesas,div = <DIV_8>;
+       };
+
+       sci0: serial@ffff78 {
+               compatible = "renesas,sci";
+               reg = <0xffff78 8>;
+               interrupts = <88 89 90 91>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+       sci1: serial@ffff80 {
+               compatible = "renesas,sci";
+               reg = <0xffff80 8>;
+               interrupts = <92 93 94 95>;
+               clocks = <&pclk>;
+               clock-names = "peripheral_clk";
+       };
+};
--

2.1.4

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v10 4/19
#5 lore raw

Re: [PATCH v10 04/19] sh-sci: Add H8/300 SCI.

In reply to Yoshinori Sato

CC devicetree

Quoted 5 lines · Yoshinori Sato

H8/300 internal serial controller of same as sh-sci. So h8300 use SH_SCI.
And add sci bindings.

Quoted 55 lines
---
 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt | 1 +
 drivers/tty/serial/Kconfig                                      | 2 +-
 drivers/tty/serial/sh-sci.c                                     | 6 ++++++
 3 files changed, 8 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/renesas,sci-serial.txt +1 -0
index ae73bb0..7534d46 100644
@@ -29,6 +29,7 @@ Required properties:
     - "renesas,scifa" for generic SCIFA compatible UART.
     - "renesas,scifb" for generic SCIFB compatible UART.
     - "renesas,hscif" for generic HSCIF compatible UART.
+    - "renesas,sci" for generic SCI compatible UART.
 
     When compatible with the generic version, nodes must list the
     SoC-specific version corresponding to the platform first followed by the
drivers/tty/serial/Kconfig +1 -1
index f8120c1..dea1eff 100644
@@ -728,7 +728,7 @@ config SERIAL_IP22_ZILOG_CONSOLE
 
 config SERIAL_SH_SCI
        tristate "SuperH SCI(F) serial port support"
-       depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
+       depends on SUPERH || ARCH_SHMOBILE || H8300 || COMPILE_TEST
        select SERIAL_CORE
 
 config SERIAL_SH_SCI_NR_UARTS
drivers/tty/serial/sh-sci.c +6 -1
index e7d6566..1468ec5 100644
@@ -2536,6 +2536,12 @@ static const struct of_device_id of_sci_match[] = {
                        .regtype = SCIx_HSCIF_REGTYPE,
                },
        }, {
+               .compatible = "renesas,sci",
+               .data = &(const struct sci_port_info) {
+                       .type = PORT_SCI,
+                       .regtype = SCIx_SCI_REGTYPE,
+               },
+       }, {
                /* Terminator */
        },
 };
--

2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#7 lore raw

Re: [PATCH v10 05/19] Add common asm-offsets.h

In reply to Yoshinori Sato
Quoted 13 lines · On Monday 04 May 2015 19:41:48 Yoshinori Sato wrote:
---
 include/asm-generic/asm-offsets.h | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 include/asm-generic/asm-offsets.h
include/asm-generic/asm-offsets.h new file +0 -0
new file mode 100644
index 0000000..d370ee3

include/asm-generic/asm-offsets.h line 1

Quoted 1 line
include/asm-generic/asm-offsets.h new file +1 -0
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>

Please add a short patch description, and my "Acked-by: Arnd Bergmann <[email protected]>", so it can get merged through your tree.

Arnd

maintainer
#24 lore raw

Re: [PATCH v10 19/19] h8300: devicetree source

In reply to Yoshinori Sato

Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt line 20

Quoted 6 lines · On Monday 04 May 2015 19:42:02 Yoshinori Sato wrote:
Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt new file +6 -0
+
+	h8intc: intc@0 {
+		compatible = "renesas,h8s-intc", "renesas,h8300-intc";
+		#interrupt-cells = <1>;
+		interrupt-controller;
+	};

The node name should be "interrupt-controller@0", not "intc@0", to follow the common conventions.

Quoted 7 lines
arch/h8300/boot/dts/edosk2674.dts new file +7 -0
+	tpu: tpu@ffffe0 {
+		compatible = "renesas,tpu";
+		reg = <0xffffe0 16>, <0xfffff0 12>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+

arch/h8300/boot/dts/edosk2674.dts line 89

Quoted 10 lines
arch/h8300/boot/dts/edosk2674.dts new file +10 -0
+	timer8: timer@ffffb0 {
+		compatible = "renesas,8bit-timer";
+		reg = <0xffff80 10>;
+		interrupts = <72 75>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+		renesas,mode = <CLOCKEVENTDEVICE>;
+		renesas,div = <DIV_8>;
+	};
+

The renesas,div property seems odd here. How about defining a "clock-frequency" property and figuring out the divider from the parent clock in the driver?

Your new binding makes it mandatory to have a "fclk" clock, which seems better suited than "peripheral_clk", so I'd suggest you change the code to match the documentation (rather than the other way round). Alternatively, you could make this an anonymous clock and not specify the name at all.

The renesas,mode property seems odd. Why is that needed? It sounds like you are encoding how you expect the device to be used by Linux, rather than what it can do in hardware. If you have multiple variants of the 8bit-timer hardware that have different features, better use separate compatible strings for them, or a boolean flag that announces the presence or absence of a feature.

If however, this is just a hint for Linux, maybe you can find a way for the driver to take a guess itself, e.g. using the first device it finds as a clockevent device, and only use a clocksource device if there is more than one?

Quoted 12 lines
arch/h8300/boot/dts/edosk2674.dts new file +12 -0
+	sci0: serial@ffff78 {
+		compatible = "renesas,sci";
+		reg = <0xffff78 8>;
+		interrupts = <88 89 90 91>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+	sci1: serial@ffff80 {
+		compatible = "renesas,sci";
+		reg = <0xffff80 8>;
+		interrupts = <92 93 94 95>;
+		clocks = <&pclk>;

arch/h8300/boot/dts/edosk2674.dts line 111

Quoted 10 lines
arch/h8300/boot/dts/edosk2674.dts new file +10 -0
+		clock-names = "peripheral_clk";
+	};
+	sci2: serial@ffff88 {
+		compatible = "renesas,sci";
+		reg = <0xffff88 8>;
+		interrupts = <96 97 98 99>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+};

The binding for sci requires the clock to be named "sci_ick", so please use that instead of "peripheral_clk". The driver can handle both.

Arnd

maintainer
#26 lore raw
In reply to Yoshinori Sato
Quoted 10 lines · On Monday 04 May 2015 19:41:43 Yoshinori Sato wrote:

Hello.
I will re-introducing h8300.

Changes for v10
- devicetree support
- header cleanup (use generic)
- optimized delay
- dma cleanup
- rebase to v4.1-rc2

Wow, that was quick, nice work overall!

Arnd

#27 lore raw
In reply to Yoshinori Sato
Quoted 3 lines · Yoshinori Sato

Hello.
I will re-introducing h8300.

Hi,

With "make ARCH=h8300 edosk2674_defconfig; make ARCH=h8300", I see the following build error:

scripts/Makefile.build:44: arch/h8300/boot/dtb/Makefile: No such file or directory make[1]: *** No rule to make target 'arch/h8300/boot/dtb/Makefile'. Stop.

After fixing this up with

arch/h8300/Makefile +1 -1
index c2b24c9..f547870 100644
@@ -26,7 +26,7 @@ CROSS_COMPILE := h8300-unknown-linux-
 
 core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/h8300/boot/dts/
 ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
-core-y += arch/h8300/boot/dtb/
+core-y += arch/h8300/boot/dts/
 endif
     
 libs-y += arch/$(ARCH)/lib/

I get

arch/h8300/boot/dts/built-in.o: In function `__dtb_edosk2674_end':
(.dtb.init.rodata+0x8fb): multiple definition of __dtb_edosk2674_end' arch/h8300/boot/dts/built-in.o:(.dtb.init.rodata+0x8fb): first defined here arch/h8300/boot/dts/built-in.o: In function __dtb_edosk2674_begin':
(.dtb.init.rodata+0x0): multiple definition of `__dtb_edosk2674_begin' arch/h8300/boot/dts/built-in.o:(.dtb.init.rodata+0x0): first defined here Makefile:932: recipe for target 'vmlinux' failed

This is with compiler and binutils built as you had provided earlier.

---

Other configurations fail to build with

h8300-unknown-linux-ld: cannot find arch/h8300/boot/dts/built-in.o: No such file or directory Makefile:932: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

---

Switching from edosk2674_defconfig to h8300h-sim_defconfig without "make mrproper" results in:

h8300-unknown-linux-ld: h8300s architecture of input file `arch/h8300/boot/dts/built-in.o' is incompatible with h8300h output

---

Results are with git://git.sourceforge.jp/gitroot/uclinux-h8/linux.git,
branch h8300.

Guenter

author maintainer
#28 lore raw

At Mon, 4 May 2015 19:27:00 -0700,

Quoted 58 lines · Guenter Roeck
Quoted 3 lines · Yoshinori Sato

Hello.
I will re-introducing h8300.

Hi,

With "make ARCH=h8300 edosk2674_defconfig; make ARCH=h8300", I see the following build error:

scripts/Makefile.build:44: arch/h8300/boot/dtb/Makefile: No such file or directory make[1]: *** No rule to make target 'arch/h8300/boot/dtb/Makefile'. Stop.

After fixing this up with

arch/h8300/Makefile +1 -1
index c2b24c9..f547870 100644
@@ -26,7 +26,7 @@ CROSS_COMPILE := h8300-unknown-linux-
 
 core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/h8300/boot/dts/
 ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
-core-y += arch/h8300/boot/dtb/
+core-y += arch/h8300/boot/dts/
 endif
 
 libs-y += arch/$(ARCH)/lib/

I get

arch/h8300/boot/dts/built-in.o: In function `__dtb_edosk2674_end':
(.dtb.init.rodata+0x8fb): multiple definition of __dtb_edosk2674_end' arch/h8300/boot/dts/built-in.o:(.dtb.init.rodata+0x8fb): first defined here arch/h8300/boot/dts/built-in.o: In function __dtb_edosk2674_begin':
(.dtb.init.rodata+0x0): multiple definition of `__dtb_edosk2674_begin' arch/h8300/boot/dts/built-in.o:(.dtb.init.rodata+0x0): first defined here Makefile:932: recipe for target 'vmlinux' failed

This is with compiler and binutils built as you had provided earlier.

---

Other configurations fail to build with

h8300-unknown-linux-ld: cannot find arch/h8300/boot/dts/built-in.o: No such file or directory Makefile:932: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

---

Switching from edosk2674_defconfig to h8300h-sim_defconfig without "make mrproper" results in:

h8300-unknown-linux-ld: h8300s architecture of input file `arch/h8300/boot/dts/built-in.o' is incompatible with h8300h output

Quoted 6 lines

---

Results are with git://git.sourceforge.jp/gitroot/uclinux-h8/linux.git,
branch h8300.

Guenter

Thanks testing.
It looks Makefile and defconfig problem.

I'll fix next release.

Signature · 2 lines
Yoshinori Sato
<[email protected]>
author maintainer
#8 lore raw

Re: [PATCH v10 05/19] Add common asm-offsets.h

In reply to Arnd Bergmann

At Mon, 04 May 2015 16:46:54 +0200,

Quoted 20 lines · Arnd Bergmann
Quoted 13 lines · On Monday 04 May 2015 19:41:48 Yoshinori Sato wrote:
---
 include/asm-generic/asm-offsets.h | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 include/asm-generic/asm-offsets.h
include/asm-generic/asm-offsets.h new file +0 -0
new file mode 100644
index 0000000..d370ee3

include/asm-generic/asm-offsets.h line 1

Quoted 1 line
include/asm-generic/asm-offsets.h new file +1 -0
@@ -0,0 +1 @@
+#include <generated/asm-offsets.h>

Please add a short patch description, and my "Acked-by: Arnd Bergmann <[email protected]>", so it can get merged through your tree.

Quoted 2 lines

Arnd

OK.
I'll add next patch.

Signature · 2 lines
Yoshinori Sato
<[email protected]>
author maintainer
#25 lore raw

Re: [PATCH v10 19/19] h8300: devicetree source

In reply to Arnd Bergmann

At Mon, 04 May 2015 17:09:21 +0200,

Quoted 11 lines · Arnd Bergmann

Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt line 20

Quoted 6 lines · On Monday 04 May 2015 19:42:02 Yoshinori Sato wrote:
Documentation/devicetree/bindings/interrupt-controller/renesas,h8s-intc.txt new file +6 -0
+
+	h8intc: intc@0 {
+		compatible = "renesas,h8s-intc", "renesas,h8300-intc";
+		#interrupt-cells = <1>;
+		interrupt-controller;
+	};

The node name should be "interrupt-controller@0", not "intc@0", to follow the common conventions.

OK.

Quoted 13 lines
Quoted 13 lines
arch/h8300/boot/dts/edosk2674.dts new file +13 -0
+	tpu: tpu@ffffe0 {
+		compatible = "renesas,tpu";
+		reg = <0xffffe0 16>, <0xfffff0 12>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+
+	timer8: timer@ffffb0 {
+		compatible = "renesas,8bit-timer";
+		reg = <0xffff80 10>;
+		interrupts = <72 75>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
Quoted 8 lines

arch/h8300/boot/dts/edosk2674.dts line 89

Quoted 4 lines
arch/h8300/boot/dts/edosk2674.dts new file +4 -0
+		renesas,mode = <CLOCKEVENTDEVICE>;
+		renesas,div = <DIV_8>;
+	};
+

The renesas,div property seems odd here. How about defining a "clock-frequency" property and figuring out the divider from the parent clock in the driver?

Hmm...
It more better idea.
I will fix.

Quoted 5 lines

Your new binding makes it mandatory to have a "fclk" clock, which seems better suited than "peripheral_clk", so I'd suggest you change the code to match the documentation (rather than the other way round). Alternatively, you could make this an anonymous clock and not specify the name at all.

OK.

Quoted 6 lines

The renesas,mode property seems odd. Why is that needed? It sounds like you are encoding how you expect the device to be used by Linux, rather than what it can do in hardware. If you have multiple variants of the 8bit-timer hardware that have different features, better use separate compatible strings for them, or a boolean flag that announces the presence or absence of a feature.

This timer have some mode. But driver using only one mode. I think it isn't necessary.

Quoted 4 lines

If however, this is just a hint for Linux, maybe you can find a way for the driver to take a guess itself, e.g. using the first device it finds as a clockevent device, and only use a clocksource device if there is more than one?

Many clocks are put in order.

Quoted 17 lines
Quoted 17 lines
arch/h8300/boot/dts/edosk2674.dts new file +17 -0
+	sci0: serial@ffff78 {
+		compatible = "renesas,sci";
+		reg = <0xffff78 8>;
+		interrupts = <88 89 90 91>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+	sci1: serial@ffff80 {
+		compatible = "renesas,sci";
+		reg = <0xffff80 8>;
+		interrupts = <92 93 94 95>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+	sci2: serial@ffff88 {
+		compatible = "renesas,sci";
+		reg = <0xffff88 8>;
Quoted 9 lines

arch/h8300/boot/dts/edosk2674.dts line 111

Quoted 5 lines
arch/h8300/boot/dts/edosk2674.dts new file +5 -0
+		interrupts = <96 97 98 99>;
+		clocks = <&pclk>;
+		clock-names = "peripheral_clk";
+	};
+};

The binding for sci requires the clock to be named "sci_ick", so please use that instead of "peripheral_clk". The driver can handle both.

OK.

Quoted 1 line

Arnd

Thanks.

Signature · 2 lines
Yoshinori Sato
<[email protected]>