Commit e10b87d2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x

* 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x: (39 commits)
  SH: static should be at beginning of declaration
  sh: move CLKDEV_xxx_ID macro to sh_clk.h
  sh: clock-shx3: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7786: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7785: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7343: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7722: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7724: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: modify I2C clock settings
  sh: clock-sh7343: modify I2C clock settings
  sh: clock-sh7723: modify I2C clock settings
  sh: clock-sh7722: modify I2C clock settings
  sh: clock-sh7724: modify I2C clock settings
  serial: sh-sci: Fix up pretty name printing for port IRQs.
  serial: sh-sci: Kill off per-port enable/disable callbacks.
  serial: sh-sci: Add missing module description/author bits.
  serial: sh-sci: Regtype probing doesn't need to be fatal.
  sh: Tidy up pre-clkdev clk_get() error handling.
  ...
parents 3da3f872 536628d0
...@@ -259,9 +259,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -259,9 +259,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[CMMSTP003] = MSTP(&r_clk, CMMSTPCR0, 3, 0), /* KEYSC */ [CMMSTP003] = MSTP(&r_clk, CMMSTPCR0, 3, 0), /* KEYSC */
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("r_clk", &r_clk), CLKDEV_CON_ID("r_clk", &r_clk),
......
...@@ -561,10 +561,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -561,10 +561,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("dv_clki_div2_clk", &sh7372_dv_clki_div2_clk), CLKDEV_CON_ID("dv_clki_div2_clk", &sh7372_dv_clki_div2_clk),
......
...@@ -267,9 +267,6 @@ static struct clk mstp_clks[] = { ...@@ -267,9 +267,6 @@ static struct clk mstp_clks[] = {
[MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("r_clk", &r_clk), CLKDEV_CON_ID("r_clk", &r_clk),
......
...@@ -306,10 +306,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -306,10 +306,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("r_clk", &r_clk), CLKDEV_CON_ID("r_clk", &r_clk),
......
...@@ -173,6 +173,7 @@ core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ ...@@ -173,6 +173,7 @@ core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/
cpuincdir-$(CONFIG_CPU_SH2A) += cpu-sh2a cpuincdir-$(CONFIG_CPU_SH2A) += cpu-sh2a
cpuincdir-$(CONFIG_CPU_SH2) += cpu-sh2 cpuincdir-$(CONFIG_CPU_SH2) += cpu-sh2
cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3 cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3
cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a
cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4 cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4
cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5
cpuincdir-y += cpu-common # Must be last cpuincdir-y += cpu-common # Must be last
......
...@@ -116,7 +116,7 @@ static int apsh4a3a_clk_init(void) ...@@ -116,7 +116,7 @@ static int apsh4a3a_clk_init(void)
int ret; int ret;
clk = clk_get(NULL, "extal"); clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333000); ret = clk_set_rate(clk, 33333000);
clk_put(clk); clk_put(clk);
......
...@@ -94,7 +94,7 @@ static int apsh4ad0a_clk_init(void) ...@@ -94,7 +94,7 @@ static int apsh4ad0a_clk_init(void)
int ret; int ret;
clk = clk_get(NULL, "extal"); clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333000); ret = clk_set_rate(clk, 33333000);
clk_put(clk); clk_put(clk);
......
...@@ -299,7 +299,7 @@ static int sh7785lcr_clk_init(void) ...@@ -299,7 +299,7 @@ static int sh7785lcr_clk_init(void)
int ret; int ret;
clk = clk_get(NULL, "extal"); clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333333); ret = clk_set_rate(clk, 33333333);
clk_put(clk); clk_put(clk);
......
...@@ -190,7 +190,7 @@ static int urquell_clk_init(void) ...@@ -190,7 +190,7 @@ static int urquell_clk_init(void)
return -EINVAL; return -EINVAL;
clk = clk_get(NULL, "extal"); clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333333); ret = clk_set_rate(clk, 33333333);
clk_put(clk); clk_put(clk);
......
...@@ -335,8 +335,6 @@ static struct clk *r7780rp_clocks[] = { ...@@ -335,8 +335,6 @@ static struct clk *r7780rp_clocks[] = {
&ivdr_clk, &ivdr_clk,
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("ivdr_clk", &ivdr_clk), CLKDEV_CON_ID("ivdr_clk", &ivdr_clk),
......
...@@ -194,7 +194,7 @@ static int sdk7786_clk_init(void) ...@@ -194,7 +194,7 @@ static int sdk7786_clk_init(void)
return -EINVAL; return -EINVAL;
clk = clk_get(NULL, "extal"); clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333333); ret = clk_set_rate(clk, 33333333);
clk_put(clk); clk_put(clk);
......
#ifndef __CPU_SH3_SERIAL_H
#define __CPU_SH3_SERIAL_H
#include <linux/serial_sci.h>
extern struct plat_sci_port_ops sh770x_sci_port_ops;
extern struct plat_sci_port_ops sh7710_sci_port_ops;
extern struct plat_sci_port_ops sh7720_sci_port_ops;
#endif /* __CPU_SH3_SERIAL_H */
#ifndef __CPU_SH4A_SERIAL_H
#define __CPU_SH4A_SERIAL_H
/* arch/sh/kernel/cpu/sh4a/serial-sh7722.c */
extern struct plat_sci_port_ops sh7722_sci_port_ops;
#endif /* __CPU_SH4A_SERIAL_H */
...@@ -35,8 +35,6 @@ static struct clk *onchip_clocks[] = { ...@@ -35,8 +35,6 @@ static struct clk *onchip_clocks[] = {
&cpu_clk, &cpu_clk,
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("master_clk", &master_clk), CLKDEV_CON_ID("master_clk", &master_clk),
......
...@@ -7,15 +7,15 @@ obj-y := ex.o probe.o entry.o setup-sh3.o ...@@ -7,15 +7,15 @@ obj-y := ex.o probe.o entry.o setup-sh3.o
obj-$(CONFIG_HIBERNATION) += swsusp.o obj-$(CONFIG_HIBERNATION) += swsusp.o
# CPU subtype setup # CPU subtype setup
obj-$(CONFIG_CPU_SUBTYPE_SH7705) += setup-sh7705.o obj-$(CONFIG_CPU_SUBTYPE_SH7705) += setup-sh7705.o serial-sh770x.o
obj-$(CONFIG_CPU_SUBTYPE_SH7706) += setup-sh770x.o obj-$(CONFIG_CPU_SUBTYPE_SH7706) += setup-sh770x.o serial-sh770x.o
obj-$(CONFIG_CPU_SUBTYPE_SH7707) += setup-sh770x.o obj-$(CONFIG_CPU_SUBTYPE_SH7707) += setup-sh770x.o serial-sh770x.o
obj-$(CONFIG_CPU_SUBTYPE_SH7708) += setup-sh770x.o obj-$(CONFIG_CPU_SUBTYPE_SH7708) += setup-sh770x.o serial-sh770x.o
obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh770x.o obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh770x.o serial-sh770x.o
obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o serial-sh7710.o
obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o serial-sh7710.o
obj-$(CONFIG_CPU_SUBTYPE_SH7720) += setup-sh7720.o obj-$(CONFIG_CPU_SUBTYPE_SH7720) += setup-sh7720.o serial-sh7720.o
obj-$(CONFIG_CPU_SUBTYPE_SH7721) += setup-sh7720.o obj-$(CONFIG_CPU_SUBTYPE_SH7721) += setup-sh7720.o serial-sh7720.o
# Primary on-chip clocks (common) # Primary on-chip clocks (common)
clock-$(CONFIG_CPU_SH3) := clock-sh3.o clock-$(CONFIG_CPU_SH3) := clock-sh3.o
......
#include <linux/serial_sci.h>
#include <linux/serial_core.h>
#include <linux/io.h>
#include <cpu/serial.h>
#define SCPCR 0xA4000116
#define SCPDR 0xA4000136
static void sh770x_sci_init_pins(struct uart_port *port, unsigned int cflag)
{
unsigned short data;
/* We need to set SCPCR to enable RTS/CTS */
data = __raw_readw(SCPCR);
/* Clear out SCP7MD1,0, SCP6MD1,0, SCP4MD1,0*/
__raw_writew(data & 0x0fcf, SCPCR);
if (!(cflag & CRTSCTS)) {
/* We need to set SCPCR to enable RTS/CTS */
data = __raw_readw(SCPCR);
/* Clear out SCP7MD1,0, SCP4MD1,0,
Set SCP6MD1,0 = {01} (output) */
__raw_writew((data & 0x0fcf) | 0x1000, SCPCR);
data = __raw_readb(SCPDR);
/* Set /RTS2 (bit6) = 0 */
__raw_writeb(data & 0xbf, SCPDR);
}
}
struct plat_sci_port_ops sh770x_sci_port_ops = {
.init_pins = sh770x_sci_init_pins,
};
#include <linux/serial_sci.h>
#include <linux/serial_core.h>
#include <linux/io.h>
#include <cpu/serial.h>
#define PACR 0xa4050100
#define PBCR 0xa4050102
static void sh7710_sci_init_pins(struct uart_port *port, unsigned int cflag)
{
if (port->mapbase == 0xA4400000) {
__raw_writew(__raw_readw(PACR) & 0xffc0, PACR);
__raw_writew(__raw_readw(PBCR) & 0x0fff, PBCR);
} else if (port->mapbase == 0xA4410000)
__raw_writew(__raw_readw(PBCR) & 0xf003, PBCR);
}
struct plat_sci_port_ops sh7710_sci_port_ops = {
.init_pins = sh7710_sci_init_pins,
};
#include <linux/serial_sci.h>
#include <linux/serial_core.h>
#include <linux/io.h>
#include <cpu/serial.h>
#include <asm/gpio.h>
static void sh7720_sci_init_pins(struct uart_port *port, unsigned int cflag)
{
unsigned short data;
if (cflag & CRTSCTS) {
/* enable RTS/CTS */
if (port->mapbase == 0xa4430000) { /* SCIF0 */
/* Clear PTCR bit 9-2; enable all scif pins but sck */
data = __raw_readw(PORT_PTCR);
__raw_writew((data & 0xfc03), PORT_PTCR);
} else if (port->mapbase == 0xa4438000) { /* SCIF1 */
/* Clear PVCR bit 9-2 */
data = __raw_readw(PORT_PVCR);
__raw_writew((data & 0xfc03), PORT_PVCR);
}
} else {
if (port->mapbase == 0xa4430000) { /* SCIF0 */
/* Clear PTCR bit 5-2; enable only tx and rx */
data = __raw_readw(PORT_PTCR);
__raw_writew((data & 0xffc3), PORT_PTCR);
} else if (port->mapbase == 0xa4438000) { /* SCIF1 */
/* Clear PVCR bit 5-2 */
data = __raw_readw(PORT_PVCR);
__raw_writew((data & 0xffc3), PORT_PVCR);
}
}
}
struct plat_sci_port_ops sh7720_sci_port_ops = {
.init_pins = sh7720_sci_init_pins,
};
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <asm/rtc.h> #include <asm/rtc.h>
#include <cpu/serial.h>
enum { enum {
UNUSED = 0, UNUSED = 0,
...@@ -75,6 +76,8 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -75,6 +76,8 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_4, .scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 56, 56, 56 }, .irqs = { 56, 56, 56 },
.ops = &sh770x_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -92,6 +95,8 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -92,6 +95,8 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_4, .scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 52, 52, 52 }, .irqs = { 52, 52, 52 },
.ops = &sh770x_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <cpu/serial.h>
enum { enum {
UNUSED = 0, UNUSED = 0,
...@@ -108,11 +109,14 @@ static struct platform_device rtc_device = { ...@@ -108,11 +109,14 @@ static struct platform_device rtc_device = {
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
.mapbase = 0xfffffe80, .mapbase = 0xfffffe80,
.port_reg = 0xa4000136,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE, .scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCI, .type = PORT_SCI,
.irqs = { 23, 23, 23, 0 }, .irqs = { 23, 23, 23, 0 },
.ops = &sh770x_sci_port_ops,
.regshift = 1,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -132,6 +136,8 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -132,6 +136,8 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 56, 56, 56, 56 }, .irqs = { 56, 56, 56, 56 },
.ops = &sh770x_sci_port_ops,
.regtype = SCIx_SH3_SCIF_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -146,11 +152,14 @@ static struct platform_device scif1_device = { ...@@ -146,11 +152,14 @@ static struct platform_device scif1_device = {
defined(CONFIG_CPU_SUBTYPE_SH7709) defined(CONFIG_CPU_SUBTYPE_SH7709)
static struct plat_sci_port scif2_platform_data = { static struct plat_sci_port scif2_platform_data = {
.mapbase = 0xa4000140, .mapbase = 0xa4000140,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE, .scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_IRDA, .type = PORT_IRDA,
.irqs = { 52, 52, 52, 52 }, .irqs = { 52, 52, 52, 52 },
.ops = &sh770x_sci_port_ops,
.regshift = 1,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <asm/rtc.h> #include <asm/rtc.h>
#include <cpu/serial.h>
static struct resource rtc_resources[] = { static struct resource rtc_resources[] = {
[0] = { [0] = {
...@@ -55,6 +56,8 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -55,6 +56,8 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_4, .scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 80, 80, 80, 80 }, .irqs = { 80, 80, 80, 80 },
.ops = &sh7720_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -72,6 +75,8 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -72,6 +75,8 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_4, .scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 81, 81, 81, 81 }, .irqs = { 81, 81, 81, 81 },
.ops = &sh7720_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
......
...@@ -147,8 +147,6 @@ static struct clk *sh4202_onchip_clocks[] = { ...@@ -147,8 +147,6 @@ static struct clk *sh4202_onchip_clocks[] = {
&sh4202_shoc_clk, &sh4202_shoc_clk,
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("emi_clk", &sh4202_emi_clk), CLKDEV_CON_ID("emi_clk", &sh4202_emi_clk),
......
/* /*
* SH7750/SH7751 Setup * SH7091/SH7750/SH7750S/SH7750R/SH7751/SH7751R Setup
* *
* Copyright (C) 2006 Paul Mundt * Copyright (C) 2006 Paul Mundt
* Copyright (C) 2006 Jamie Lenehan * Copyright (C) 2006 Jamie Lenehan
...@@ -38,11 +38,13 @@ static struct platform_device rtc_device = { ...@@ -38,11 +38,13 @@ static struct platform_device rtc_device = {
static struct plat_sci_port sci_platform_data = { static struct plat_sci_port sci_platform_data = {
.mapbase = 0xffe00000, .mapbase = 0xffe00000,
.port_reg = 0xffe0001C,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE, .scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCI, .type = PORT_SCI,
.irqs = { 23, 23, 23, 0 }, .irqs = { 23, 23, 23, 0 },
.regshift = 2,
}; };
static struct platform_device sci_device = { static struct platform_device sci_device = {
......
...@@ -133,6 +133,7 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -133,6 +133,7 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 52, 53, 55, 54 }, .irqs = { 52, 53, 55, 54 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -150,6 +151,7 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -150,6 +151,7 @@ static struct plat_sci_port scif1_platform_data = {
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.irqs = { 72, 73, 75, 74 }, .irqs = { 72, 73, 75, 74 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -167,6 +169,7 @@ static struct plat_sci_port scif2_platform_data = { ...@@ -167,6 +169,7 @@ static struct plat_sci_port scif2_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 76, 77, 79, 78 }, .irqs = { 76, 77, 79, 78 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
...@@ -184,6 +187,7 @@ static struct plat_sci_port scif3_platform_data = { ...@@ -184,6 +187,7 @@ static struct plat_sci_port scif3_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCI, .type = PORT_SCI,
.irqs = { 80, 81, 82, 0 }, .irqs = { 80, 81, 82, 0 },
.regshift = 2,
}; };
static struct platform_device scif3_device = { static struct platform_device scif3_device = {
......
...@@ -10,7 +10,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o ...@@ -10,7 +10,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o
obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o
obj-$(CONFIG_CPU_SUBTYPE_SH7786) += setup-sh7786.o intc-shx3.o obj-$(CONFIG_CPU_SUBTYPE_SH7786) += setup-sh7786.o intc-shx3.o
obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o
obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o serial-sh7722.o
obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o
obj-$(CONFIG_CPU_SUBTYPE_SH7724) += setup-sh7724.o obj-$(CONFIG_CPU_SUBTYPE_SH7724) += setup-sh7724.o
obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o
......
...@@ -194,8 +194,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -194,8 +194,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP200] = MSTP(&div4_clks[DIV4_B], MSTPCR2, 0, 0), [MSTP200] = MSTP(&div4_clks[DIV4_B], MSTPCR2, 0, 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("rclk", &r_clk), CLKDEV_CON_ID("rclk", &r_clk),
...@@ -233,32 +231,17 @@ static struct clk_lookup lookups[] = { ...@@ -233,32 +231,17 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]), CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),
CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]), CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
{
/* SCIF0 */ CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP007]),
.dev_id = "sh-sci.0", CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP006]),
.con_id = "sci_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP005]),
.clk = &mstp_clks[MSTP007], CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP004]),
}, {
/* SCIF1 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP006],
}, {
/* SCIF2 */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP005],
}, {
/* SCIF3 */
.dev_id = "sh-sci.3",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP004],
},
CLKDEV_CON_ID("sio0", &mstp_clks[MSTP003]), CLKDEV_CON_ID("sio0", &mstp_clks[MSTP003]),
CLKDEV_CON_ID("siof0", &mstp_clks[MSTP002]), CLKDEV_CON_ID("siof0", &mstp_clks[MSTP002]),
CLKDEV_CON_ID("siof1", &mstp_clks[MSTP001]), CLKDEV_CON_ID("siof1", &mstp_clks[MSTP001]),
CLKDEV_CON_ID("i2c0", &mstp_clks[MSTP109]), CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP109]),
CLKDEV_CON_ID("i2c1", &mstp_clks[MSTP108]), CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP108]),
CLKDEV_CON_ID("tpu0", &mstp_clks[MSTP225]), CLKDEV_CON_ID("tpu0", &mstp_clks[MSTP225]),
CLKDEV_CON_ID("irda0", &mstp_clks[MSTP224]), CLKDEV_CON_ID("irda0", &mstp_clks[MSTP224]),
CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP218]), CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP218]),
......
...@@ -192,8 +192,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -192,8 +192,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP200] = MSTP(&div4_clks[DIV4_B], MSTPCR2, 0, 0), [MSTP200] = MSTP(&div4_clks[DIV4_B], MSTPCR2, 0, 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("rclk", &r_clk), CLKDEV_CON_ID("rclk", &r_clk),
...@@ -231,25 +229,14 @@ static struct clk_lookup lookups[] = { ...@@ -231,25 +229,14 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]), CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),
CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]), CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
{
/* SCIF0 */ CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP007]),
.dev_id = "sh-sci.0", CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP006]),
.con_id = "sci_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP005]),
.clk = &mstp_clks[MSTP007],
}, {
/* SCIF1 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP006],
}, {
/* SCIF2 */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP005],
},
CLKDEV_CON_ID("msiof0", &mstp_clks[MSTP002]), CLKDEV_CON_ID("msiof0", &mstp_clks[MSTP002]),
CLKDEV_CON_ID("sbr0", &mstp_clks[MSTP001]), CLKDEV_CON_ID("sbr0", &mstp_clks[MSTP001]),
CLKDEV_CON_ID("i2c0", &mstp_clks[MSTP109]), CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP109]),
CLKDEV_CON_ID("icb0", &mstp_clks[MSTP227]), CLKDEV_CON_ID("icb0", &mstp_clks[MSTP227]),
CLKDEV_CON_ID("meram0", &mstp_clks[MSTP226]), CLKDEV_CON_ID("meram0", &mstp_clks[MSTP226]),
CLKDEV_CON_ID("dacy1", &mstp_clks[MSTP224]), CLKDEV_CON_ID("dacy1", &mstp_clks[MSTP224]),
......
...@@ -175,8 +175,6 @@ static struct clk mstp_clks[HWBLK_NR] = { ...@@ -175,8 +175,6 @@ static struct clk mstp_clks[HWBLK_NR] = {
SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_P], 0), SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_P], 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("rclk", &r_clk), CLKDEV_CON_ID("rclk", &r_clk),
...@@ -201,42 +199,20 @@ static struct clk_lookup lookups[] = { ...@@ -201,42 +199,20 @@ static struct clk_lookup lookups[] = {
/* MSTP clocks */ /* MSTP clocks */
CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]), CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]),
CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]), CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]),
{
/* TMU0 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU]),
.dev_id = "sh_tmu.0", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]),
.clk = &mstp_clks[HWBLK_TMU],
}, {
/* TMU1 */
.dev_id = "sh_tmu.1",
.con_id = "tmu_fck",
.clk = &mstp_clks[HWBLK_TMU],
}, {
/* TMU2 */
.dev_id = "sh_tmu.2",
.con_id = "tmu_fck",
.clk = &mstp_clks[HWBLK_TMU],
},
CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]), CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
{
/* SCIF0 */ CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
.dev_id = "sh-sci.0", CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
.con_id = "sci_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
.clk = &mstp_clks[HWBLK_SCIF0],
}, { CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]),
/* SCIF1 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF1],
}, {
/* SCIF2 */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF2],
},
CLKDEV_CON_ID("i2c0", &mstp_clks[HWBLK_IIC]),
CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI]), CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI]),
CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]), CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
......
...@@ -200,8 +200,6 @@ static struct clk mstp_clks[] = { ...@@ -200,8 +200,6 @@ static struct clk mstp_clks[] = {
SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_B], 0), SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_B], 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("rclk", &r_clk), CLKDEV_CON_ID("rclk", &r_clk),
...@@ -305,7 +303,7 @@ static struct clk_lookup lookups[] = { ...@@ -305,7 +303,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]), CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]),
CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]), CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]),
CLKDEV_CON_ID("meram0", &mstp_clks[HWBLK_MERAM]), CLKDEV_CON_ID("meram0", &mstp_clks[HWBLK_MERAM]),
CLKDEV_CON_ID("i2c0", &mstp_clks[HWBLK_IIC]), CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]),
CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]), CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
CLKDEV_CON_ID("adc0", &mstp_clks[HWBLK_ADC]), CLKDEV_CON_ID("adc0", &mstp_clks[HWBLK_ADC]),
......
...@@ -252,8 +252,6 @@ static struct clk mstp_clks[HWBLK_NR] = { ...@@ -252,8 +252,6 @@ static struct clk mstp_clks[HWBLK_NR] = {
SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_B], 0), SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_B], 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("rclk", &r_clk), CLKDEV_CON_ID("rclk", &r_clk),
...@@ -289,77 +287,31 @@ static struct clk_lookup lookups[] = { ...@@ -289,77 +287,31 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]), CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]), CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
{
/* TMU0 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]),
.dev_id = "sh_tmu.0", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
.clk = &mstp_clks[HWBLK_TMU0], CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
}, {
/* TMU1 */
.dev_id = "sh_tmu.1",
.con_id = "tmu_fck",
.clk = &mstp_clks[HWBLK_TMU0],
}, {
/* TMU2 */
.dev_id = "sh_tmu.2",
.con_id = "tmu_fck",
.clk = &mstp_clks[HWBLK_TMU0],
}, {
/* TMU3 */
.dev_id = "sh_tmu.3",
.con_id = "tmu_fck",
.clk = &mstp_clks[HWBLK_TMU1],
},
CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]), CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
CLKDEV_CON_ID("dmac1", &mstp_clks[HWBLK_DMAC1]), CLKDEV_CON_ID("dmac1", &mstp_clks[HWBLK_DMAC1]),
{
/* TMU4 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
.dev_id = "sh_tmu.4", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
.clk = &mstp_clks[HWBLK_TMU1], CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
}, { CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
/* TMU5 */ CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[HWBLK_SCIF3]),
.dev_id = "sh_tmu.5", CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[HWBLK_SCIF4]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[HWBLK_SCIF5]),
.clk = &mstp_clks[HWBLK_TMU1],
}, {
/* SCIF0 */
.dev_id = "sh-sci.0",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF0],
}, {
/* SCIF1 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF1],
}, {
/* SCIF2 */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF2],
}, {
/* SCIF3 */
.dev_id = "sh-sci.3",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF3],
}, {
/* SCIF4 */
.dev_id = "sh-sci.4",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF4],
}, {
/* SCIF5 */
.dev_id = "sh-sci.5",
.con_id = "sci_fck",
.clk = &mstp_clks[HWBLK_SCIF5],
},
CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]), CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]),
CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]), CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]),
CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]), CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
CLKDEV_CON_ID("i2c0", &mstp_clks[HWBLK_IIC0]), CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC0]),
CLKDEV_CON_ID("i2c1", &mstp_clks[HWBLK_IIC1]), CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[HWBLK_IIC1]),
CLKDEV_CON_ID("mmc0", &mstp_clks[HWBLK_MMC]), CLKDEV_CON_ID("mmc0", &mstp_clks[HWBLK_MMC]),
CLKDEV_CON_ID("eth0", &mstp_clks[HWBLK_ETHER]), CLKDEV_CON_ID("eth0", &mstp_clks[HWBLK_ETHER]),
CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]), CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
......
...@@ -101,8 +101,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -101,8 +101,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP220] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 20, 0), [MSTP220] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 20, 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("extal", &extal_clk), CLKDEV_CON_ID("extal", &extal_clk),
...@@ -116,33 +114,13 @@ static struct clk_lookup lookups[] = { ...@@ -116,33 +114,13 @@ static struct clk_lookup lookups[] = {
/* MSTP32 clocks */ /* MSTP32 clocks */
CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]), CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]),
CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]), CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]),
{
/* TMU0 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]),
.dev_id = "sh_tmu.0", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]),
.clk = &mstp_clks[MSTP113], CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
}, { CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
/* TMU1 */
.dev_id = "sh_tmu.1",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP114],
},
{
/* SCIF4 (But, ID is 2) */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP112],
}, {
/* SCIF3 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP111],
}, {
/* SCIF2 */
.dev_id = "sh-sci.0",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP110],
},
CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]), CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]),
CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]), CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
}; };
......
...@@ -91,8 +91,6 @@ static struct clk *sh7763_onchip_clocks[] = { ...@@ -91,8 +91,6 @@ static struct clk *sh7763_onchip_clocks[] = {
&sh7763_shyway_clk, &sh7763_shyway_clk,
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("shyway_clk", &sh7763_shyway_clk), CLKDEV_CON_ID("shyway_clk", &sh7763_shyway_clk),
......
...@@ -97,8 +97,6 @@ static struct clk *sh7780_onchip_clocks[] = { ...@@ -97,8 +97,6 @@ static struct clk *sh7780_onchip_clocks[] = {
&sh7780_shyway_clk, &sh7780_shyway_clk,
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("shyway_clk", &sh7780_shyway_clk), CLKDEV_CON_ID("shyway_clk", &sh7780_shyway_clk),
......
...@@ -116,8 +116,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -116,8 +116,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP100] = SH_CLK_MSTP32(NULL, MSTPCR1, 0, 0), [MSTP100] = SH_CLK_MSTP32(NULL, MSTPCR1, 0, 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("extal", &extal_clk), CLKDEV_CON_ID("extal", &extal_clk),
...@@ -134,74 +132,27 @@ static struct clk_lookup lookups[] = { ...@@ -134,74 +132,27 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
/* MSTP32 clocks */ /* MSTP32 clocks */
{ CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP029]),
/* SCIF5 */ CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP028]),
.dev_id = "sh-sci.5", CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP027]),
.con_id = "sci_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP026]),
.clk = &mstp_clks[MSTP029], CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP025]),
}, { CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP024]),
/* SCIF4 */
.dev_id = "sh-sci.4",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP028],
}, {
/* SCIF3 */
.dev_id = "sh-sci.3",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP027],
}, {
/* SCIF2 */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP026],
}, {
/* SCIF1 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP025],
}, {
/* SCIF0 */
.dev_id = "sh-sci.0",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP024],
},
CLKDEV_CON_ID("ssi1_fck", &mstp_clks[MSTP021]), CLKDEV_CON_ID("ssi1_fck", &mstp_clks[MSTP021]),
CLKDEV_CON_ID("ssi0_fck", &mstp_clks[MSTP020]), CLKDEV_CON_ID("ssi0_fck", &mstp_clks[MSTP020]),
CLKDEV_CON_ID("hac1_fck", &mstp_clks[MSTP017]), CLKDEV_CON_ID("hac1_fck", &mstp_clks[MSTP017]),
CLKDEV_CON_ID("hac0_fck", &mstp_clks[MSTP016]), CLKDEV_CON_ID("hac0_fck", &mstp_clks[MSTP016]),
CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]), CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]),
CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]), CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]),
{
/* TMU0 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]),
.dev_id = "sh_tmu.0", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
.clk = &mstp_clks[MSTP008], CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
}, { CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
/* TMU1 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
.dev_id = "sh_tmu.1",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP008],
}, {
/* TMU2 */
.dev_id = "sh_tmu.2",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP008],
}, {
/* TMU3 */
.dev_id = "sh_tmu.3",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
}, {
/* TMU4 */
.dev_id = "sh_tmu.4",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
}, {
/* TMU5 */
.dev_id = "sh_tmu.5",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
},
CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]), CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]),
CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]), CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]),
CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]), CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),
......
...@@ -125,8 +125,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -125,8 +125,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP102] = SH_CLK_MSTP32(NULL, MSTPCR1, 2, 0), [MSTP102] = SH_CLK_MSTP32(NULL, MSTPCR1, 2, 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("extal", &extal_clk), CLKDEV_CON_ID("extal", &extal_clk),
...@@ -141,37 +139,13 @@ static struct clk_lookup lookups[] = { ...@@ -141,37 +139,13 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
/* MSTP32 clocks */ /* MSTP32 clocks */
{ CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP029]),
/* SCIF5 */ CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP028]),
.dev_id = "sh-sci.5", CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP027]),
.con_id = "sci_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP026]),
.clk = &mstp_clks[MSTP029], CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP025]),
}, { CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP024]),
/* SCIF4 */
.dev_id = "sh-sci.4",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP028],
}, {
/* SCIF3 */
.dev_id = "sh-sci.3",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP027],
}, {
/* SCIF2 */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP026],
}, {
/* SCIF1 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP025],
}, {
/* SCIF0 */
.dev_id = "sh-sci.0",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP024],
},
CLKDEV_CON_ID("ssi3_fck", &mstp_clks[MSTP023]), CLKDEV_CON_ID("ssi3_fck", &mstp_clks[MSTP023]),
CLKDEV_CON_ID("ssi2_fck", &mstp_clks[MSTP022]), CLKDEV_CON_ID("ssi2_fck", &mstp_clks[MSTP022]),
CLKDEV_CON_ID("ssi1_fck", &mstp_clks[MSTP021]), CLKDEV_CON_ID("ssi1_fck", &mstp_clks[MSTP021]),
...@@ -180,67 +154,20 @@ static struct clk_lookup lookups[] = { ...@@ -180,67 +154,20 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("hac0_fck", &mstp_clks[MSTP016]), CLKDEV_CON_ID("hac0_fck", &mstp_clks[MSTP016]),
CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]), CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]),
CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]), CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]),
{
/* TMU0 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]),
.dev_id = "sh_tmu.0", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
.clk = &mstp_clks[MSTP008], CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
}, { CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
/* TMU1 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
.dev_id = "sh_tmu.1", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP010]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP010]),
.clk = &mstp_clks[MSTP008], CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP010]),
}, { CLKDEV_ICK_ID("tmu_fck", "sh_tmu.9", &mstp_clks[MSTP011]),
/* TMU2 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.10", &mstp_clks[MSTP011]),
.dev_id = "sh_tmu.2", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.11", &mstp_clks[MSTP011]),
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP008],
}, {
/* TMU3 */
.dev_id = "sh_tmu.3",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
}, {
/* TMU4 */
.dev_id = "sh_tmu.4",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
}, {
/* TMU5 */
.dev_id = "sh_tmu.5",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
}, {
/* TMU6 */
.dev_id = "sh_tmu.6",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP010],
}, {
/* TMU7 */
.dev_id = "sh_tmu.7",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP010],
}, {
/* TMU8 */
.dev_id = "sh_tmu.8",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP010],
}, {
/* TMU9 */
.dev_id = "sh_tmu.9",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP011],
}, {
/* TMU10 */
.dev_id = "sh_tmu.10",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP011],
}, {
/* TMU11 */
.dev_id = "sh_tmu.11",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP011],
},
CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]), CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]),
CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]), CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]),
CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]), CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]),
......
...@@ -100,8 +100,6 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -100,8 +100,6 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP104] = SH_CLK_MSTP32(NULL, MSTPCR1, 4, 0), [MSTP104] = SH_CLK_MSTP32(NULL, MSTPCR1, 4, 0),
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
/* main clocks */ /* main clocks */
CLKDEV_CON_ID("extal", &extal_clk), CLKDEV_CON_ID("extal", &extal_clk),
...@@ -116,62 +114,23 @@ static struct clk_lookup lookups[] = { ...@@ -116,62 +114,23 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
/* MSTP32 clocks */ /* MSTP32 clocks */
{ CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP027]),
/* SCIF3 */ CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP026]),
.dev_id = "sh-sci.3", CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP025]),
.con_id = "sci_fck", CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP024]),
.clk = &mstp_clks[MSTP027],
}, {
/* SCIF2 */
.dev_id = "sh-sci.2",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP026],
}, {
/* SCIF1 */
.dev_id = "sh-sci.1",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP025],
}, {
/* SCIF0 */
.dev_id = "sh-sci.0",
.con_id = "sci_fck",
.clk = &mstp_clks[MSTP024],
},
CLKDEV_CON_ID("h8ex_fck", &mstp_clks[MSTP003]), CLKDEV_CON_ID("h8ex_fck", &mstp_clks[MSTP003]),
CLKDEV_CON_ID("csm_fck", &mstp_clks[MSTP002]), CLKDEV_CON_ID("csm_fck", &mstp_clks[MSTP002]),
CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]), CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]),
CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]), CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]),
{
/* TMU0 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]),
.dev_id = "sh_tmu.0", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]),
.con_id = "tmu_fck", CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
.clk = &mstp_clks[MSTP008], CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
}, { CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
/* TMU1 */ CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
.dev_id = "sh_tmu.1",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP008],
}, {
/* TMU2 */
.dev_id = "sh_tmu.2",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP008],
}, {
/* TMU3 */
.dev_id = "sh_tmu.3",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
}, {
/* TMU4 */
.dev_id = "sh_tmu.4",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
}, {
/* TMU5 */
.dev_id = "sh_tmu.5",
.con_id = "tmu_fck",
.clk = &mstp_clks[MSTP009],
},
CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]), CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),
CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]), CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]),
CLKDEV_CON_ID("dmac_5_0_fck", &mstp_clks[MSTP104]), CLKDEV_CON_ID("dmac_5_0_fck", &mstp_clks[MSTP104]),
......
#include <linux/serial_sci.h>
#include <linux/serial_core.h>
#include <linux/io.h>
#define PSCR 0xA405011E
static void sh7722_sci_init_pins(struct uart_port *port, unsigned int cflag)
{
unsigned short data;
if (port->mapbase == 0xffe00000) {
data = __raw_readw(PSCR);
data &= ~0x03cf;
if (!(cflag & CRTSCTS))
data |= 0x0340;
__raw_writew(data, PSCR);
}
}
struct plat_sci_port_ops sh7722_sci_port_ops = {
.init_pins = sh7722_sci_init_pins,
};
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
.mapbase = 0xffe00000, .mapbase = 0xffe00000,
.port_reg = 0xa405013e,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
#include <cpu/sh7722.h> #include <cpu/sh7722.h>
#include <cpu/serial.h>
static const struct sh_dmae_slave_config sh7722_dmae_slaves[] = { static const struct sh_dmae_slave_config sh7722_dmae_slaves[] = {
{ {
...@@ -185,6 +186,8 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -185,6 +186,8 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 80, 80, 80, 80 }, .irqs = { 80, 80, 80, 80 },
.ops = &sh7722_sci_port_ops,
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -202,6 +205,8 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -202,6 +205,8 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 81, 81, 81, 81 }, .irqs = { 81, 81, 81, 81 },
.ops = &sh7722_sci_port_ops,
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -219,6 +224,8 @@ static struct plat_sci_port scif2_platform_data = { ...@@ -219,6 +224,8 @@ static struct plat_sci_port scif2_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 82, 82, 82, 82 }, .irqs = { 82, 82, 82, 82 },
.ops = &sh7722_sci_port_ops,
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
......
...@@ -23,11 +23,13 @@ ...@@ -23,11 +23,13 @@
/* Serial */ /* Serial */
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
.mapbase = 0xffe00000, .mapbase = 0xffe00000,
.port_reg = 0xa4050160,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 80, 80, 80, 80 }, .irqs = { 80, 80, 80, 80 },
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -40,11 +42,13 @@ static struct platform_device scif0_device = { ...@@ -40,11 +42,13 @@ static struct platform_device scif0_device = {
static struct plat_sci_port scif1_platform_data = { static struct plat_sci_port scif1_platform_data = {
.mapbase = 0xffe10000, .mapbase = 0xffe10000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 81, 81, 81, 81 }, .irqs = { 81, 81, 81, 81 },
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -57,11 +61,13 @@ static struct platform_device scif1_device = { ...@@ -57,11 +61,13 @@ static struct platform_device scif1_device = {
static struct plat_sci_port scif2_platform_data = { static struct plat_sci_port scif2_platform_data = {
.mapbase = 0xffe20000, .mapbase = 0xffe20000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 82, 82, 82, 82 }, .irqs = { 82, 82, 82, 82 },
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
...@@ -75,6 +81,7 @@ static struct platform_device scif2_device = { ...@@ -75,6 +81,7 @@ static struct platform_device scif2_device = {
static struct plat_sci_port scif3_platform_data = { static struct plat_sci_port scif3_platform_data = {
.mapbase = 0xa4e30000, .mapbase = 0xa4e30000,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.port_reg = SCIx_NOT_SUPPORTED,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_3, .scbrr_algo_id = SCBRR_ALGO_3,
.type = PORT_SCIFA, .type = PORT_SCIFA,
...@@ -91,6 +98,7 @@ static struct platform_device scif3_device = { ...@@ -91,6 +98,7 @@ static struct platform_device scif3_device = {
static struct plat_sci_port scif4_platform_data = { static struct plat_sci_port scif4_platform_data = {
.mapbase = 0xa4e40000, .mapbase = 0xa4e40000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_3, .scbrr_algo_id = SCBRR_ALGO_3,
...@@ -108,6 +116,7 @@ static struct platform_device scif4_device = { ...@@ -108,6 +116,7 @@ static struct platform_device scif4_device = {
static struct plat_sci_port scif5_platform_data = { static struct plat_sci_port scif5_platform_data = {
.mapbase = 0xa4e50000, .mapbase = 0xa4e50000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_3, .scbrr_algo_id = SCBRR_ALGO_3,
......
...@@ -296,11 +296,13 @@ static struct platform_device dma1_device = { ...@@ -296,11 +296,13 @@ static struct platform_device dma1_device = {
/* Serial */ /* Serial */
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
.mapbase = 0xffe00000, .mapbase = 0xffe00000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 80, 80, 80, 80 }, .irqs = { 80, 80, 80, 80 },
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -313,11 +315,13 @@ static struct platform_device scif0_device = { ...@@ -313,11 +315,13 @@ static struct platform_device scif0_device = {
static struct plat_sci_port scif1_platform_data = { static struct plat_sci_port scif1_platform_data = {
.mapbase = 0xffe10000, .mapbase = 0xffe10000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 81, 81, 81, 81 }, .irqs = { 81, 81, 81, 81 },
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -330,11 +334,13 @@ static struct platform_device scif1_device = { ...@@ -330,11 +334,13 @@ static struct platform_device scif1_device = {
static struct plat_sci_port scif2_platform_data = { static struct plat_sci_port scif2_platform_data = {
.mapbase = 0xffe20000, .mapbase = 0xffe20000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 82, 82, 82, 82 }, .irqs = { 82, 82, 82, 82 },
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
...@@ -347,6 +353,7 @@ static struct platform_device scif2_device = { ...@@ -347,6 +353,7 @@ static struct platform_device scif2_device = {
static struct plat_sci_port scif3_platform_data = { static struct plat_sci_port scif3_platform_data = {
.mapbase = 0xa4e30000, .mapbase = 0xa4e30000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE, .scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_3, .scbrr_algo_id = SCBRR_ALGO_3,
...@@ -364,6 +371,7 @@ static struct platform_device scif3_device = { ...@@ -364,6 +371,7 @@ static struct platform_device scif3_device = {
static struct plat_sci_port scif4_platform_data = { static struct plat_sci_port scif4_platform_data = {
.mapbase = 0xa4e40000, .mapbase = 0xa4e40000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE, .scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_3, .scbrr_algo_id = SCBRR_ALGO_3,
...@@ -381,6 +389,7 @@ static struct platform_device scif4_device = { ...@@ -381,6 +389,7 @@ static struct platform_device scif4_device = {
static struct plat_sci_port scif5_platform_data = { static struct plat_sci_port scif5_platform_data = {
.mapbase = 0xa4e50000, .mapbase = 0xa4e50000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE, .scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_3, .scbrr_algo_id = SCBRR_ALGO_3,
......
...@@ -23,6 +23,7 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -23,6 +23,7 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 40, 40, 40, 40 }, .irqs = { 40, 40, 40, 40 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -40,6 +41,7 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -40,6 +41,7 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 76, 76, 76, 76 }, .irqs = { 76, 76, 76, 76 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -57,6 +59,7 @@ static struct plat_sci_port scif2_platform_data = { ...@@ -57,6 +59,7 @@ static struct plat_sci_port scif2_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_2, .scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 104, 104, 104, 104 }, .irqs = { 104, 104, 104, 104 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_dma.h> #include <linux/sh_dma.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
...@@ -24,6 +23,7 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -24,6 +23,7 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 40, 40, 40, 40 }, .irqs = { 40, 40, 40, 40 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -41,6 +41,7 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -41,6 +41,7 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 76, 76, 76, 76 }, .irqs = { 76, 76, 76, 76 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sh_dma.h> #include <linux/sh_dma.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
...@@ -27,6 +25,7 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -27,6 +25,7 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 40, 40, 40, 40 }, .irqs = { 40, 40, 40, 40 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -44,6 +43,7 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -44,6 +43,7 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 44, 44, 44, 44 }, .irqs = { 44, 44, 44, 44 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -61,6 +61,7 @@ static struct plat_sci_port scif2_platform_data = { ...@@ -61,6 +61,7 @@ static struct plat_sci_port scif2_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 60, 60, 60, 60 }, .irqs = { 60, 60, 60, 60 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
...@@ -78,6 +79,7 @@ static struct plat_sci_port scif3_platform_data = { ...@@ -78,6 +79,7 @@ static struct plat_sci_port scif3_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 61, 61, 61, 61 }, .irqs = { 61, 61, 61, 61 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif3_device = { static struct platform_device scif3_device = {
...@@ -95,6 +97,7 @@ static struct plat_sci_port scif4_platform_data = { ...@@ -95,6 +97,7 @@ static struct plat_sci_port scif4_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 62, 62, 62, 62 }, .irqs = { 62, 62, 62, 62 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif4_device = { static struct platform_device scif4_device = {
...@@ -112,6 +115,7 @@ static struct plat_sci_port scif5_platform_data = { ...@@ -112,6 +115,7 @@ static struct plat_sci_port scif5_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 63, 63, 63, 63 }, .irqs = { 63, 63, 63, 63 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif5_device = { static struct platform_device scif5_device = {
......
/* /*
* SH7786 Setup * SH7786 Setup
* *
* Copyright (C) 2009 - 2010 Renesas Solutions Corp. * Copyright (C) 2009 - 2011 Renesas Solutions Corp.
* Kuninori Morimoto <morimoto.kuninori@renesas.com> * Kuninori Morimoto <morimoto.kuninori@renesas.com>
* Paul Mundt <paul.mundt@renesas.com> * Paul Mundt <paul.mundt@renesas.com>
* *
...@@ -33,6 +33,7 @@ static struct plat_sci_port scif0_platform_data = { ...@@ -33,6 +33,7 @@ static struct plat_sci_port scif0_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 40, 41, 43, 42 }, .irqs = { 40, 41, 43, 42 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif0_device = { static struct platform_device scif0_device = {
...@@ -53,6 +54,7 @@ static struct plat_sci_port scif1_platform_data = { ...@@ -53,6 +54,7 @@ static struct plat_sci_port scif1_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 44, 44, 44, 44 }, .irqs = { 44, 44, 44, 44 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif1_device = { static struct platform_device scif1_device = {
...@@ -70,6 +72,7 @@ static struct plat_sci_port scif2_platform_data = { ...@@ -70,6 +72,7 @@ static struct plat_sci_port scif2_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 50, 50, 50, 50 }, .irqs = { 50, 50, 50, 50 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif2_device = { static struct platform_device scif2_device = {
...@@ -87,6 +90,7 @@ static struct plat_sci_port scif3_platform_data = { ...@@ -87,6 +90,7 @@ static struct plat_sci_port scif3_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 51, 51, 51, 51 }, .irqs = { 51, 51, 51, 51 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif3_device = { static struct platform_device scif3_device = {
...@@ -104,6 +108,7 @@ static struct plat_sci_port scif4_platform_data = { ...@@ -104,6 +108,7 @@ static struct plat_sci_port scif4_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 52, 52, 52, 52 }, .irqs = { 52, 52, 52, 52 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif4_device = { static struct platform_device scif4_device = {
...@@ -121,6 +126,7 @@ static struct plat_sci_port scif5_platform_data = { ...@@ -121,6 +126,7 @@ static struct plat_sci_port scif5_platform_data = {
.scbrr_algo_id = SCBRR_ALGO_1, .scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF, .type = PORT_SCIF,
.irqs = { 53, 53, 53, 53 }, .irqs = { 53, 53, 53, 53 },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
}; };
static struct platform_device scif5_device = { static struct platform_device scif5_device = {
......
...@@ -70,12 +70,36 @@ static u32 sh_dmae_readl(struct sh_dmae_chan *sh_dc, u32 reg) ...@@ -70,12 +70,36 @@ static u32 sh_dmae_readl(struct sh_dmae_chan *sh_dc, u32 reg)
static u16 dmaor_read(struct sh_dmae_device *shdev) static u16 dmaor_read(struct sh_dmae_device *shdev)
{ {
return __raw_readw(shdev->chan_reg + DMAOR / sizeof(u32)); u32 __iomem *addr = shdev->chan_reg + DMAOR / sizeof(u32);
if (shdev->pdata->dmaor_is_32bit)
return __raw_readl(addr);
else
return __raw_readw(addr);
} }
static void dmaor_write(struct sh_dmae_device *shdev, u16 data) static void dmaor_write(struct sh_dmae_device *shdev, u16 data)
{ {
__raw_writew(data, shdev->chan_reg + DMAOR / sizeof(u32)); u32 __iomem *addr = shdev->chan_reg + DMAOR / sizeof(u32);
if (shdev->pdata->dmaor_is_32bit)
__raw_writel(data, addr);
else
__raw_writew(data, addr);
}
static void chcr_write(struct sh_dmae_chan *sh_dc, u32 data)
{
struct sh_dmae_device *shdev = to_sh_dev(sh_dc);
__raw_writel(data, sh_dc->base + shdev->chcr_offset / sizeof(u32));
}
static u32 chcr_read(struct sh_dmae_chan *sh_dc)
{
struct sh_dmae_device *shdev = to_sh_dev(sh_dc);
return __raw_readl(sh_dc->base + shdev->chcr_offset / sizeof(u32));
} }
/* /*
...@@ -120,7 +144,7 @@ static int sh_dmae_rst(struct sh_dmae_device *shdev) ...@@ -120,7 +144,7 @@ static int sh_dmae_rst(struct sh_dmae_device *shdev)
static bool dmae_is_busy(struct sh_dmae_chan *sh_chan) static bool dmae_is_busy(struct sh_dmae_chan *sh_chan)
{ {
u32 chcr = sh_dmae_readl(sh_chan, CHCR); u32 chcr = chcr_read(sh_chan);
if ((chcr & (CHCR_DE | CHCR_TE)) == CHCR_DE) if ((chcr & (CHCR_DE | CHCR_TE)) == CHCR_DE)
return true; /* working */ return true; /* working */
...@@ -130,8 +154,7 @@ static bool dmae_is_busy(struct sh_dmae_chan *sh_chan) ...@@ -130,8 +154,7 @@ static bool dmae_is_busy(struct sh_dmae_chan *sh_chan)
static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr) static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr)
{ {
struct sh_dmae_device *shdev = container_of(sh_chan->common.device, struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
struct sh_dmae_device, common);
struct sh_dmae_pdata *pdata = shdev->pdata; struct sh_dmae_pdata *pdata = shdev->pdata;
int cnt = ((chcr & pdata->ts_low_mask) >> pdata->ts_low_shift) | int cnt = ((chcr & pdata->ts_low_mask) >> pdata->ts_low_shift) |
((chcr & pdata->ts_high_mask) >> pdata->ts_high_shift); ((chcr & pdata->ts_high_mask) >> pdata->ts_high_shift);
...@@ -144,8 +167,7 @@ static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr) ...@@ -144,8 +167,7 @@ static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr)
static u32 log2size_to_chcr(struct sh_dmae_chan *sh_chan, int l2size) static u32 log2size_to_chcr(struct sh_dmae_chan *sh_chan, int l2size)
{ {
struct sh_dmae_device *shdev = container_of(sh_chan->common.device, struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
struct sh_dmae_device, common);
struct sh_dmae_pdata *pdata = shdev->pdata; struct sh_dmae_pdata *pdata = shdev->pdata;
int i; int i;
...@@ -169,18 +191,23 @@ static void dmae_set_reg(struct sh_dmae_chan *sh_chan, struct sh_dmae_regs *hw) ...@@ -169,18 +191,23 @@ static void dmae_set_reg(struct sh_dmae_chan *sh_chan, struct sh_dmae_regs *hw)
static void dmae_start(struct sh_dmae_chan *sh_chan) static void dmae_start(struct sh_dmae_chan *sh_chan)
{ {
u32 chcr = sh_dmae_readl(sh_chan, CHCR); struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
u32 chcr = chcr_read(sh_chan);
if (shdev->pdata->needs_tend_set)
sh_dmae_writel(sh_chan, 0xFFFFFFFF, TEND);
chcr |= CHCR_DE | CHCR_IE; chcr |= CHCR_DE | shdev->chcr_ie_bit;
sh_dmae_writel(sh_chan, chcr & ~CHCR_TE, CHCR); chcr_write(sh_chan, chcr & ~CHCR_TE);
} }
static void dmae_halt(struct sh_dmae_chan *sh_chan) static void dmae_halt(struct sh_dmae_chan *sh_chan)
{ {
u32 chcr = sh_dmae_readl(sh_chan, CHCR); struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
u32 chcr = chcr_read(sh_chan);
chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE); chcr &= ~(CHCR_DE | CHCR_TE | shdev->chcr_ie_bit);
sh_dmae_writel(sh_chan, chcr, CHCR); chcr_write(sh_chan, chcr);
} }
static void dmae_init(struct sh_dmae_chan *sh_chan) static void dmae_init(struct sh_dmae_chan *sh_chan)
...@@ -192,7 +219,7 @@ static void dmae_init(struct sh_dmae_chan *sh_chan) ...@@ -192,7 +219,7 @@ static void dmae_init(struct sh_dmae_chan *sh_chan)
u32 chcr = DM_INC | SM_INC | 0x400 | log2size_to_chcr(sh_chan, u32 chcr = DM_INC | SM_INC | 0x400 | log2size_to_chcr(sh_chan,
LOG2_DEFAULT_XFER_SIZE); LOG2_DEFAULT_XFER_SIZE);
sh_chan->xmit_shift = calc_xmit_shift(sh_chan, chcr); sh_chan->xmit_shift = calc_xmit_shift(sh_chan, chcr);
sh_dmae_writel(sh_chan, chcr, CHCR); chcr_write(sh_chan, chcr);
} }
static int dmae_set_chcr(struct sh_dmae_chan *sh_chan, u32 val) static int dmae_set_chcr(struct sh_dmae_chan *sh_chan, u32 val)
...@@ -202,23 +229,25 @@ static int dmae_set_chcr(struct sh_dmae_chan *sh_chan, u32 val) ...@@ -202,23 +229,25 @@ static int dmae_set_chcr(struct sh_dmae_chan *sh_chan, u32 val)
return -EBUSY; return -EBUSY;
sh_chan->xmit_shift = calc_xmit_shift(sh_chan, val); sh_chan->xmit_shift = calc_xmit_shift(sh_chan, val);
sh_dmae_writel(sh_chan, val, CHCR); chcr_write(sh_chan, val);
return 0; return 0;
} }
static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val) static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val)
{ {
struct sh_dmae_device *shdev = container_of(sh_chan->common.device, struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
struct sh_dmae_device, common);
struct sh_dmae_pdata *pdata = shdev->pdata; struct sh_dmae_pdata *pdata = shdev->pdata;
const struct sh_dmae_channel *chan_pdata = &pdata->channel[sh_chan->id]; const struct sh_dmae_channel *chan_pdata = &pdata->channel[sh_chan->id];
u16 __iomem *addr = shdev->dmars; u16 __iomem *addr = shdev->dmars;
int shift = chan_pdata->dmars_bit; unsigned int shift = chan_pdata->dmars_bit;
if (dmae_is_busy(sh_chan)) if (dmae_is_busy(sh_chan))
return -EBUSY; return -EBUSY;
if (pdata->no_dmars)
return 0;
/* in the case of a missing DMARS resource use first memory window */ /* in the case of a missing DMARS resource use first memory window */
if (!addr) if (!addr)
addr = (u16 __iomem *)shdev->chan_reg; addr = (u16 __iomem *)shdev->chan_reg;
...@@ -296,9 +325,7 @@ static struct sh_desc *sh_dmae_get_desc(struct sh_dmae_chan *sh_chan) ...@@ -296,9 +325,7 @@ static struct sh_desc *sh_dmae_get_desc(struct sh_dmae_chan *sh_chan)
static const struct sh_dmae_slave_config *sh_dmae_find_slave( static const struct sh_dmae_slave_config *sh_dmae_find_slave(
struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *param) struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *param)
{ {
struct dma_device *dma_dev = sh_chan->common.device; struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
struct sh_dmae_device *shdev = container_of(dma_dev,
struct sh_dmae_device, common);
struct sh_dmae_pdata *pdata = shdev->pdata; struct sh_dmae_pdata *pdata = shdev->pdata;
int i; int i;
...@@ -771,10 +798,8 @@ static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan) ...@@ -771,10 +798,8 @@ static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan)
spin_lock_bh(&sh_chan->desc_lock); spin_lock_bh(&sh_chan->desc_lock);
/* DMA work check */ /* DMA work check */
if (dmae_is_busy(sh_chan)) { if (dmae_is_busy(sh_chan))
spin_unlock_bh(&sh_chan->desc_lock); goto sh_chan_xfer_ld_queue_end;
return;
}
/* Find the first not transferred descriptor */ /* Find the first not transferred descriptor */
list_for_each_entry(desc, &sh_chan->ld_queue, node) list_for_each_entry(desc, &sh_chan->ld_queue, node)
...@@ -788,6 +813,7 @@ static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan) ...@@ -788,6 +813,7 @@ static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan)
break; break;
} }
sh_chan_xfer_ld_queue_end:
spin_unlock_bh(&sh_chan->desc_lock); spin_unlock_bh(&sh_chan->desc_lock);
} }
...@@ -846,7 +872,7 @@ static irqreturn_t sh_dmae_interrupt(int irq, void *data) ...@@ -846,7 +872,7 @@ static irqreturn_t sh_dmae_interrupt(int irq, void *data)
spin_lock(&sh_chan->desc_lock); spin_lock(&sh_chan->desc_lock);
chcr = sh_dmae_readl(sh_chan, CHCR); chcr = chcr_read(sh_chan);
if (chcr & CHCR_TE) { if (chcr & CHCR_TE) {
/* DMA stop */ /* DMA stop */
...@@ -1144,6 +1170,16 @@ static int __init sh_dmae_probe(struct platform_device *pdev) ...@@ -1144,6 +1170,16 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
/* platform data */ /* platform data */
shdev->pdata = pdata; shdev->pdata = pdata;
if (pdata->chcr_offset)
shdev->chcr_offset = pdata->chcr_offset;
else
shdev->chcr_offset = CHCR;
if (pdata->chcr_ie_bit)
shdev->chcr_ie_bit = pdata->chcr_ie_bit;
else
shdev->chcr_ie_bit = CHCR_IE;
platform_set_drvdata(pdev, shdev); platform_set_drvdata(pdev, shdev);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
......
...@@ -47,10 +47,14 @@ struct sh_dmae_device { ...@@ -47,10 +47,14 @@ struct sh_dmae_device {
struct list_head node; struct list_head node;
u32 __iomem *chan_reg; u32 __iomem *chan_reg;
u16 __iomem *dmars; u16 __iomem *dmars;
unsigned int chcr_offset;
u32 chcr_ie_bit;
}; };
#define to_sh_chan(chan) container_of(chan, struct sh_dmae_chan, common) #define to_sh_chan(chan) container_of(chan, struct sh_dmae_chan, common)
#define to_sh_desc(lh) container_of(lh, struct sh_desc, node) #define to_sh_desc(lh) container_of(lh, struct sh_desc, node)
#define tx_to_sh_desc(tx) container_of(tx, struct sh_desc, async_tx) #define tx_to_sh_desc(tx) container_of(tx, struct sh_desc, async_tx)
#define to_sh_dev(chan) container_of(chan->common.device,\
struct sh_dmae_device, common)
#endif /* __DMA_SHDMA_H */ #endif /* __DMA_SHDMA_H */
...@@ -34,6 +34,9 @@ static LIST_HEAD(clock_list); ...@@ -34,6 +34,9 @@ static LIST_HEAD(clock_list);
static DEFINE_SPINLOCK(clock_lock); static DEFINE_SPINLOCK(clock_lock);
static DEFINE_MUTEX(clock_list_sem); static DEFINE_MUTEX(clock_list_sem);
/* clock disable operations are not passed on to hardware during boot */
static int allow_disable;
void clk_rate_table_build(struct clk *clk, void clk_rate_table_build(struct clk *clk,
struct cpufreq_frequency_table *freq_table, struct cpufreq_frequency_table *freq_table,
int nr_freqs, int nr_freqs,
...@@ -228,7 +231,7 @@ static void __clk_disable(struct clk *clk) ...@@ -228,7 +231,7 @@ static void __clk_disable(struct clk *clk)
return; return;
if (!(--clk->usecount)) { if (!(--clk->usecount)) {
if (likely(clk->ops && clk->ops->disable)) if (likely(allow_disable && clk->ops && clk->ops->disable))
clk->ops->disable(clk); clk->ops->disable(clk);
if (likely(clk->parent)) if (likely(clk->parent))
__clk_disable(clk->parent); __clk_disable(clk->parent);
...@@ -393,7 +396,7 @@ int clk_register(struct clk *clk) ...@@ -393,7 +396,7 @@ int clk_register(struct clk *clk)
{ {
int ret; int ret;
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return -EINVAL; return -EINVAL;
/* /*
...@@ -744,3 +747,25 @@ static int __init clk_debugfs_init(void) ...@@ -744,3 +747,25 @@ static int __init clk_debugfs_init(void)
return err; return err;
} }
late_initcall(clk_debugfs_init); late_initcall(clk_debugfs_init);
static int __init clk_late_init(void)
{
unsigned long flags;
struct clk *clk;
/* disable all clocks with zero use count */
mutex_lock(&clock_list_sem);
spin_lock_irqsave(&clock_lock, flags);
list_for_each_entry(clk, &clock_list, node)
if (!clk->usecount && clk->ops && clk->ops->disable)
clk->ops->disable(clk);
/* from now on allow clock disable operations */
allow_disable = 1;
spin_unlock_irqrestore(&clock_lock, flags);
mutex_unlock(&clock_list_sem);
return 0;
}
late_initcall(clk_late_init);
...@@ -959,7 +959,7 @@ config SERIAL_IP22_ZILOG_CONSOLE ...@@ -959,7 +959,7 @@ config SERIAL_IP22_ZILOG_CONSOLE
config SERIAL_SH_SCI config SERIAL_SH_SCI
tristate "SuperH SCI(F) serial port support" tristate "SuperH SCI(F) serial port support"
depends on HAVE_CLK && (SUPERH || H8300 || ARCH_SHMOBILE) depends on HAVE_CLK && (SUPERH || ARCH_SHMOBILE)
select SERIAL_CORE select SERIAL_CORE
config SERIAL_SH_SCI_NR_UARTS config SERIAL_SH_SCI_NR_UARTS
......
This diff is collapsed.
This diff is collapsed.
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
* Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
*/ */
#define SCIx_NOT_SUPPORTED (-1)
enum { enum {
SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
...@@ -25,6 +27,28 @@ enum { ...@@ -25,6 +27,28 @@ enum {
#define SCSCR_CKE1 (1 << 1) #define SCSCR_CKE1 (1 << 1)
#define SCSCR_CKE0 (1 << 0) #define SCSCR_CKE0 (1 << 0)
/* SCxSR SCI */
#define SCI_TDRE 0x80
#define SCI_RDRF 0x40
#define SCI_ORER 0x20
#define SCI_FER 0x10
#define SCI_PER 0x08
#define SCI_TEND 0x04
#define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER)
/* SCxSR SCIF */
#define SCIF_ER 0x0080
#define SCIF_TEND 0x0040
#define SCIF_TDFE 0x0020
#define SCIF_BRK 0x0010
#define SCIF_FER 0x0008
#define SCIF_PER 0x0004
#define SCIF_RDF 0x0002
#define SCIF_DR 0x0001
#define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
/* Offsets into the sci_port->irqs array */ /* Offsets into the sci_port->irqs array */
enum { enum {
SCIx_ERI_IRQ, SCIx_ERI_IRQ,
...@@ -32,6 +56,24 @@ enum { ...@@ -32,6 +56,24 @@ enum {
SCIx_TXI_IRQ, SCIx_TXI_IRQ,
SCIx_BRI_IRQ, SCIx_BRI_IRQ,
SCIx_NR_IRQS, SCIx_NR_IRQS,
SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
};
enum {
SCIx_PROBE_REGTYPE,
SCIx_SCI_REGTYPE,
SCIx_IRDA_REGTYPE,
SCIx_SCIFA_REGTYPE,
SCIx_SCIFB_REGTYPE,
SCIx_SH3_SCIF_REGTYPE,
SCIx_SH4_SCIF_REGTYPE,
SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
SCIx_SH4_SCIF_FIFODATA_REGTYPE,
SCIx_SH7705_SCIF_REGTYPE,
SCIx_NR_REGTYPES,
}; };
#define SCIx_IRQ_MUXED(irq) \ #define SCIx_IRQ_MUXED(irq) \
...@@ -42,8 +84,29 @@ enum { ...@@ -42,8 +84,29 @@ enum {
[SCIx_BRI_IRQ] = (irq), \ [SCIx_BRI_IRQ] = (irq), \
} }
#define SCIx_IRQ_IS_MUXED(port) \
((port)->cfg->irqs[SCIx_ERI_IRQ] == \
(port)->cfg->irqs[SCIx_RXI_IRQ]) || \
((port)->cfg->irqs[SCIx_ERI_IRQ] && \
!(port)->cfg->irqs[SCIx_RXI_IRQ])
/*
* SCI register subset common for all port types.
* Not all registers will exist on all parts.
*/
enum {
SCSMR, SCBRR, SCSCR, SCxSR,
SCFCR, SCFDR, SCxTDR, SCxRDR,
SCLSR, SCTFDR, SCRFDR, SCSPTR,
SCIx_NR_REGS,
};
struct device; struct device;
struct plat_sci_port_ops {
void (*init_pins)(struct uart_port *, unsigned int cflag);
};
/* /*
* Platform device specific platform_data struct * Platform device specific platform_data struct
*/ */
...@@ -56,6 +119,18 @@ struct plat_sci_port { ...@@ -56,6 +119,18 @@ struct plat_sci_port {
unsigned int scbrr_algo_id; /* SCBRR calculation algo */ unsigned int scbrr_algo_id; /* SCBRR calculation algo */
unsigned int scscr; /* SCSCR initialization */ unsigned int scscr; /* SCSCR initialization */
/*
* Platform overrides if necessary, defaults otherwise.
*/
int overrun_bit;
unsigned int error_mask;
int port_reg;
unsigned char regshift;
unsigned char regtype;
struct plat_sci_port_ops *ops;
struct device *dma_dev; struct device *dma_dev;
unsigned int dma_slave_tx; unsigned int dma_slave_tx;
......
...@@ -147,4 +147,8 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr, ...@@ -147,4 +147,8 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
int sh_clk_div6_register(struct clk *clks, int nr); int sh_clk_div6_register(struct clk *clks, int nr);
int sh_clk_div6_reparent_register(struct clk *clks, int nr); int sh_clk_div6_reparent_register(struct clk *clks, int nr);
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
#endif /* __SH_CLOCK_H */ #endif /* __SH_CLOCK_H */
...@@ -62,6 +62,12 @@ struct sh_dmae_pdata { ...@@ -62,6 +62,12 @@ struct sh_dmae_pdata {
const unsigned int *ts_shift; const unsigned int *ts_shift;
int ts_shift_num; int ts_shift_num;
u16 dmaor_init; u16 dmaor_init;
unsigned int chcr_offset;
u32 chcr_ie_bit;
unsigned int dmaor_is_32bit:1;
unsigned int needs_tend_set:1;
unsigned int no_dmars:1;
}; };
/* DMA register */ /* DMA register */
...@@ -71,6 +77,8 @@ struct sh_dmae_pdata { ...@@ -71,6 +77,8 @@ struct sh_dmae_pdata {
#define CHCR 0x0C #define CHCR 0x0C
#define DMAOR 0x40 #define DMAOR 0x40
#define TEND 0x18 /* USB-DMAC */
/* DMAOR definitions */ /* DMAOR definitions */
#define DMAOR_AE 0x00000004 #define DMAOR_AE 0x00000004
#define DMAOR_NMIF 0x00000002 #define DMAOR_NMIF 0x00000002
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment