aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2020-11-17 09:12:36 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2020-11-17 09:12:36 +1100
commite5afedde24451009af1f6b258044f6a1fa88a860 (patch)
tree6e1a59f2231d6149be66a11a6529c6375b8d0df7
parent7971ecb730669a175168636e26d5900fc0eb1354 (diff)
parent8808515be0ed4e33de9bfdc65f4c1b547ee11065 (diff)
downloadlinux-next-e5afedde24451009af1f6b258044f6a1fa88a860.tar.gz
Merge remote-tracking branch 'h8300/h8300-next' into master
Notice: this object is not reachable from any branch.
Notice: this object is not reachable from any branch.
-rw-r--r--arch/h8300/Kconfig.cpu4
-rw-r--r--arch/h8300/boot/dts/edosk2674.dts10
-rw-r--r--arch/h8300/boot/dts/h8300h_sim.dts2
-rw-r--r--arch/h8300/boot/dts/h8s_sim.dts2
-rw-r--r--arch/h8300/configs/edosk2674_defconfig10
-rw-r--r--arch/h8300/configs/h8300h-sim_defconfig8
-rw-r--r--arch/h8300/configs/h8s-sim_defconfig8
-rw-r--r--arch/h8300/kernel/setup.c2
-rw-r--r--arch/h8300/lib/memset.S17
-rw-r--r--drivers/clocksource/h8300_timer8.c20
-rw-r--r--drivers/irqchip/irq-renesas-h8300h.c19
-rw-r--r--drivers/irqchip/irq-renesas-h8s.c67
-rw-r--r--drivers/net/ethernet/smsc/Kconfig1
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c10
-rw-r--r--drivers/tty/serial/sh-sci.c5
15 files changed, 123 insertions, 62 deletions
diff --git a/arch/h8300/Kconfig.cpu b/arch/h8300/Kconfig.cpu
index b5e14d513e622..2b9cbaf41cd00 100644
--- a/arch/h8300/Kconfig.cpu
+++ b/arch/h8300/Kconfig.cpu
@@ -97,4 +97,8 @@ config OFFSET
hex "Load offset"
default 0
+config BOOT_LINK_OFFSET
+ hex "zImage link offset"
+ default 0x200000
+
endmenu
diff --git a/arch/h8300/boot/dts/edosk2674.dts b/arch/h8300/boot/dts/edosk2674.dts
index d1733805ea67a..f9731fe8c7d09 100644
--- a/arch/h8300/boot/dts/edosk2674.dts
+++ b/arch/h8300/boot/dts/edosk2674.dts
@@ -61,7 +61,7 @@
compatible = "renesas,h8s-intc", "renesas,h8300-intc";
#interrupt-cells = <2>;
interrupt-controller;
- reg = <0xfffe00 24>;
+ reg = <0xfffe00 24>, <0xffff30 6>;
};
bsc: memory-controller@fffec0 {
@@ -79,7 +79,7 @@
timer8: timer@ffffb0 {
compatible = "renesas,8bit-timer";
reg = <0xffffb0 10>;
- interrupts = <72 0>;
+ interrupts = <72 0>, <73 0>, <74 0>;
clocks = <&fclk>;
clock-names = "fck";
};
@@ -105,4 +105,10 @@
clocks = <&fclk>;
clock-names = "fck";
};
+ ethernet: ethernet@f80000 {
+ compatible = "smsc,lan91c94";
+ reg = <0xf80000 0xfbffff>;
+ reg-io-width = <1>;
+ interrupts = <16 0>;
+ };
};
diff --git a/arch/h8300/boot/dts/h8300h_sim.dts b/arch/h8300/boot/dts/h8300h_sim.dts
index 595398b9d0180..e1d4d9b7f6b40 100644
--- a/arch/h8300/boot/dts/h8300h_sim.dts
+++ b/arch/h8300/boot/dts/h8300h_sim.dts
@@ -8,7 +8,7 @@
chosen {
bootargs = "earlyprintk=h8300-sim";
- stdout-path = <&sci0>;
+ stdout-path = &sci0;
};
aliases {
serial0 = &sci0;
diff --git a/arch/h8300/boot/dts/h8s_sim.dts b/arch/h8300/boot/dts/h8s_sim.dts
index 932cc3c5a81bc..4848e40e607ec 100644
--- a/arch/h8300/boot/dts/h8s_sim.dts
+++ b/arch/h8300/boot/dts/h8s_sim.dts
@@ -8,7 +8,7 @@
chosen {
bootargs = "earlyprintk=h8300-sim";
- stdout-path = <&sci0>;
+ stdout-path = &sci0;
};
aliases {
serial0 = &sci0;
diff --git a/arch/h8300/configs/edosk2674_defconfig b/arch/h8300/configs/edosk2674_defconfig
index 23791dcf6c259..bcf2edb8fff94 100644
--- a/arch/h8300/configs/edosk2674_defconfig
+++ b/arch/h8300/configs/edosk2674_defconfig
@@ -1,9 +1,7 @@
# 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
@@ -12,17 +10,17 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_EVENTFD is not set
# CONFIG_AIO is not set
# CONFIG_ADVISE_SYSCALLS is not set
+# CONFIG_KALLSYMS is not set
CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLOB=y
+CONFIG_BOOT_LINK_OFFSET=0x400000
+CONFIG_H8S_EDOSK2674=y
# CONFIG_BLOCK is not set
-CONFIG_H8S_SIM=y
-CONFIG_H8300_BUILTIN_DTB="h8s_sim"
# 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
@@ -32,9 +30,7 @@ CONFIG_BINFMT_FLAT=y
# 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
diff --git a/arch/h8300/configs/h8300h-sim_defconfig b/arch/h8300/configs/h8300h-sim_defconfig
index 7fc9c2f0acc00..1b90399758f3a 100644
--- a/arch/h8300/configs/h8300h-sim_defconfig
+++ b/arch/h8300/configs/h8300h-sim_defconfig
@@ -1,9 +1,7 @@
# 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
@@ -12,17 +10,17 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_EVENTFD is not set
# CONFIG_AIO is not set
# CONFIG_ADVISE_SYSCALLS is not set
+# CONFIG_KALLSYMS 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_H8300H_SIM=y
CONFIG_H8300_BUILTIN_DTB="h8300h_sim"
+# CONFIG_BLOCK is not set
# 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
@@ -32,9 +30,7 @@ CONFIG_BINFMT_FLAT=y
# 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_EARLYCON=y
# CONFIG_HW_RANDOM is not set
# CONFIG_HWMON is not set
# CONFIG_USB_SUPPORT is not set
diff --git a/arch/h8300/configs/h8s-sim_defconfig b/arch/h8300/configs/h8s-sim_defconfig
index 23791dcf6c259..4d46adcc21a48 100644
--- a/arch/h8300/configs/h8s-sim_defconfig
+++ b/arch/h8300/configs/h8s-sim_defconfig
@@ -1,9 +1,7 @@
# 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
@@ -12,17 +10,17 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_EVENTFD is not set
# CONFIG_AIO is not set
# CONFIG_ADVISE_SYSCALLS is not set
+# CONFIG_KALLSYMS 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_SIM=y
CONFIG_H8300_BUILTIN_DTB="h8s_sim"
+# CONFIG_BLOCK is not set
# 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
@@ -32,9 +30,7 @@ CONFIG_BINFMT_FLAT=y
# 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
diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c
index 0281f92eea3d9..15280af7251c1 100644
--- a/arch/h8300/kernel/setup.c
+++ b/arch/h8300/kernel/setup.c
@@ -24,7 +24,7 @@
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/of_address.h>
-#include <linux/clk-provider.h>
+#include <linux/of_clk.h>
#include <linux/memblock.h>
#include <linux/screen_info.h>
#include <linux/clocksource.h>
diff --git a/arch/h8300/lib/memset.S b/arch/h8300/lib/memset.S
index 2d1abc37fd08b..df873779bb5e0 100644
--- a/arch/h8300/lib/memset.S
+++ b/arch/h8300/lib/memset.S
@@ -19,13 +19,15 @@
;; c = er1(r1l)
;; count = er2
memset:
- btst #0,r0l
+ mov.l er4,@-sp
+ mov.l er0,er4
+ btst #0,r4l
beq 2f
;; odd address
1:
- mov.b r1l,@er0
- adds #1,er0
+ mov.b r1l,@er4
+ adds #1,er4
dec.l #1,er2
beq 6f
@@ -46,8 +48,8 @@ memset:
mov.b r1l,r1h
mov.w r1,e1
3:
- mov.l er1,@er0
- adds #4,er0
+ mov.l er1,@er4
+ adds #4,er4
dec.l #1,er2
bne 3b
4:
@@ -55,11 +57,12 @@ memset:
and.b #3,r3l
beq 6f
5:
- mov.b r1l,@er0
- adds #1,er0
+ mov.b r1l,@er4
+ adds #1,er4
dec.b r3l
bne 5b
6:
+ mov.l @sp+,er4
rts
clear_user:
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 47114c2a7cb54..03e8065f26795 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -25,8 +25,8 @@
#define TCORB 6
#define _8TCNT 8
-#define CMIEA 6
-#define CMFA 6
+#define OVIE 5
+#define OVF 5
#define FLAG_STARTED (1 << 3)
@@ -40,6 +40,7 @@ struct timer8_priv {
void __iomem *mapbase;
unsigned long flags;
unsigned int rate;
+ uint16_t cnt;
};
static irqreturn_t timer8_interrupt(int irq, void *dev_id)
@@ -51,7 +52,8 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
p->ced.event_handler(&p->ced);
- bclr(CMFA, p->mapbase + _8TCSR);
+ iowrite16be(p->cnt, p->mapbase + _8TCNT);
+ bclr(OVF, p->mapbase + _8TCSR);
return IRQ_HANDLED;
}
@@ -60,16 +62,14 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
{
if (delta >= 0x10000)
pr_warn("delta out of range\n");
- bclr(CMIEA, p->mapbase + _8TCR);
- iowrite16be(delta, p->mapbase + TCORA);
- iowrite16be(0x0000, p->mapbase + _8TCNT);
- bclr(CMFA, p->mapbase + _8TCSR);
- bset(CMIEA, p->mapbase + _8TCR);
+ p->cnt = 0x10000 - delta;
+ iowrite16be(p->cnt, p->mapbase + _8TCNT);
+ bclr(OVF, p->mapbase + _8TCSR);
+ bset(OVIE, p->mapbase + _8TCR);
}
static int timer8_enable(struct timer8_priv *p)
{
- iowrite16be(0xffff, p->mapbase + TCORA);
iowrite16be(0x0000, p->mapbase + _8TCNT);
iowrite16be(0x0c02, p->mapbase + _8TCR);
@@ -177,7 +177,7 @@ static int __init h8300_8timer_init(struct device_node *node)
}
ret = -EINVAL;
- irq = irq_of_parse_and_map(node, 0);
+ irq = irq_of_parse_and_map(node, 2);
if (!irq) {
pr_err("failed to get irq for clockevent\n");
goto unmap_reg;
diff --git a/drivers/irqchip/irq-renesas-h8300h.c b/drivers/irqchip/irq-renesas-h8300h.c
index 1054d74b7edde..42e2918eee2fe 100644
--- a/drivers/irqchip/irq-renesas-h8300h.c
+++ b/drivers/irqchip/irq-renesas-h8300h.c
@@ -24,7 +24,10 @@ static const char ipr_bit[] = {
static void __iomem *intc_baseaddr;
-#define IPR (intc_baseaddr + 6)
+#define ICSR (intc_baseaddr + 2)
+#define IER (intc_baseaddr + 3)
+#define ISR (intc_baseaddr + 4)
+#define IPR (intc_baseaddr + 6)
static void h8300h_disable_irq(struct irq_data *data)
{
@@ -38,6 +41,8 @@ static void h8300h_disable_irq(struct irq_data *data)
else
ctrl_bclr(bit & 7, (IPR+1));
}
+ if (irq < 6)
+ ctrl_bclr(irq, IER);
}
static void h8300h_enable_irq(struct irq_data *data)
@@ -52,12 +57,24 @@ static void h8300h_enable_irq(struct irq_data *data)
else
ctrl_bset(bit & 7, (IPR+1));
}
+ if (irq < 6)
+ ctrl_bset(irq, IER);
+}
+
+static void h8300h_ack_irq(struct irq_data *data)
+{
+ int bit;
+ int irq = data->irq - 12;
+
+ if (irq < 6)
+ ctrl_bclr(irq, ISR);
}
struct irq_chip h8300h_irq_chip = {
.name = "H8/300H-INTC",
.irq_enable = h8300h_enable_irq,
.irq_disable = h8300h_disable_irq,
+ .irq_eoi = h8300h_ack_irq,
};
static int irq_map(struct irq_domain *h, unsigned int virq,
diff --git a/drivers/irqchip/irq-renesas-h8s.c b/drivers/irqchip/irq-renesas-h8s.c
index 4e2461bae944d..0b8d9d7ef2ee1 100644
--- a/drivers/irqchip/irq-renesas-h8s.c
+++ b/drivers/irqchip/irq-renesas-h8s.c
@@ -11,8 +11,11 @@
#include <linux/of_irq.h>
#include <asm/io.h>
-static void *intc_baseaddr;
-#define IPRA (intc_baseaddr)
+static void *ipr_base;
+static void *icr_base;
+#define IPRA (ipr_base)
+#define IER (icr_base + 2)
+#define ISR (icr_base + 4)
static const unsigned char ipr_table[] = {
0x03, 0x02, 0x01, 0x00, 0x13, 0x12, 0x11, 0x10, /* 16 - 23 */
@@ -36,13 +39,22 @@ static void h8s_disable_irq(struct irq_data *data)
int pos;
void __iomem *addr;
unsigned short pri;
- int irq = data->irq;
+ int irq = data->irq - 16;
+ unsigned short ier;
+
+ if (irq < 0)
+ return;
- addr = IPRA + ((ipr_table[irq - 16] & 0xf0) >> 3);
- pos = (ipr_table[irq - 16] & 0x0f) * 4;
+ addr = IPRA + ((ipr_table[irq] & 0xf0) >> 3);
+ pos = (ipr_table[irq] & 0x0f) * 4;
pri = ~(0x000f << pos);
- pri &= readw(addr);
- writew(pri, addr);
+ pri &= __raw_readw(addr);
+ __raw_writew(pri, addr);
+ if (irq < 16) {
+ ier = __raw_readw(IER);
+ ier &= ~(1 << irq);
+ __raw_writew(ier, IER);
+ }
}
static void h8s_enable_irq(struct irq_data *data)
@@ -50,20 +62,43 @@ static void h8s_enable_irq(struct irq_data *data)
int pos;
void __iomem *addr;
unsigned short pri;
- int irq = data->irq;
+ int irq = data->irq - 16;
+ unsigned short ier;
+
+ if (irq < 0)
+ return;
- addr = IPRA + ((ipr_table[irq - 16] & 0xf0) >> 3);
- pos = (ipr_table[irq - 16] & 0x0f) * 4;
+ addr = IPRA + ((ipr_table[irq] & 0xf0) >> 3);
+ pos = (ipr_table[irq] & 0x0f) * 4;
pri = ~(0x000f << pos);
- pri &= readw(addr);
+ pri &= __raw_readw(addr);
pri |= 1 << pos;
- writew(pri, addr);
+ __raw_writew(pri, addr);
+ if (irq < 16) {
+ ier = __raw_readw(IER);
+ ier &= ~(1 << irq);
+ __raw_writew(ier, IER);
+ }
+}
+
+static void h8s_ack_irq(struct irq_data *data)
+{
+ int irq = data->irq;
+ uint16_t isr;
+
+ if (irq >= 16 && irq < 32) {
+ irq -= 16;
+ isr = __raw_readw(ISR);
+ isr &= ~(1 << irq);
+ __raw_writew(isr, ISR);
+ }
}
struct irq_chip h8s_irq_chip = {
.name = "H8S-INTC",
.irq_enable = h8s_enable_irq,
.irq_disable = h8s_disable_irq,
+ .irq_ack = h8s_ack_irq,
};
static __init int irq_map(struct irq_domain *h, unsigned int virq,
@@ -85,14 +120,16 @@ static int __init h8s_intc_of_init(struct device_node *intc,
struct irq_domain *domain;
int n;
- intc_baseaddr = of_iomap(intc, 0);
- BUG_ON(!intc_baseaddr);
+ ipr_base = of_iomap(intc, 0);
+ icr_base = of_iomap(intc, 1);
+ BUG_ON(!ipr_base || !icr_base);
/* All interrupt priority is 0 (disable) */
/* IPRA to IPRK */
for (n = 0; n <= 'k' - 'a'; n++)
- writew(0x0000, IPRA + (n * 2));
+ __raw_writew(0x0000, IPRA + (n * 2));
+ __raw_writew(0xffff, IER);
domain = irq_domain_add_linear(intc, NR_IRQS, &irq_ops, NULL);
BUG_ON(!domain);
irq_set_default_host(domain);
diff --git a/drivers/net/ethernet/smsc/Kconfig b/drivers/net/ethernet/smsc/Kconfig
index b77e427e6729b..cc900412f55d1 100644
--- a/drivers/net/ethernet/smsc/Kconfig
+++ b/drivers/net/ethernet/smsc/Kconfig
@@ -37,7 +37,6 @@ config SMC91X
tristate "SMC 91C9x/91C1xxx support"
select CRC32
select MII
- depends on !OF || GPIOLIB
depends on ARM || ARM64 || ATARI_ETHERNAT || COLDFIRE || \
MIPS || NIOS2 || SUPERH || XTENSA || H8300
help
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index f6b73afd1879a..b5d053292e717 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2189,6 +2189,7 @@ static const struct of_device_id smc91x_match[] = {
};
MODULE_DEVICE_TABLE(of, smc91x_match);
+#if defined(CONFIG_GPIOLIB)
/**
* of_try_set_control_gpio - configure a gpio if it exists
*/
@@ -2213,6 +2214,15 @@ static int try_toggle_control_gpio(struct device *dev,
return 0;
}
+#else
+static int try_toggle_control_gpio(struct device *dev,
+ struct gpio_desc **desc,
+ const char *name, int index,
+ int value, unsigned int nsdelay)
+{
+ return 0;
+}
+#endif
#endif
/*
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index e1179e74a2b89..ae8463aa8e0fb 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2972,10 +2972,7 @@ static int sci_init_single(struct platform_device *dev,
port->fifosize = sci_port->params->fifosize;
if (port->type == PORT_SCI) {
- if (sci_port->reg_size >= 0x20)
- port->regshift = 2;
- else
- port->regshift = 1;
+ port->regshift = sci_port->reg_size >> 4;
}
/*