serial: sh-sci: Compute the regshift value for SCI ports

SCI instances found in SH SoCs have different spacing between registers
depending on the SoC. The platform data contains a regshift field that
tells the driver by how many bits to shift the register offset to
compute its address. We can compute the regshift value automatically
based on the memory resource size, there's no need to pass the value
through platform data.

Fix the sh7750 SCI and sh7760 SIM port memory resources length to ensure
proper computation of the regshift value.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Laurent Pinchart
2017-01-11 16:43:40 +02:00
committed by Greg Kroah-Hartman
父節點 97ed9790c5
當前提交 dfc80387ae
共有 5 個文件被更改,包括 16 次插入7 次删除

查看文件

@@ -111,7 +111,6 @@ static struct platform_device rtc_device = {
static struct plat_sci_port scif0_platform_data = {
.type = PORT_SCI,
.ops = &sh770x_sci_port_ops,
.regshift = 1,
};
static struct resource scif0_resources[] = {

查看文件

@@ -39,11 +39,10 @@ static struct platform_device rtc_device = {
static struct plat_sci_port sci_platform_data = {
.type = PORT_SCI,
.regshift = 2,
};
static struct resource sci_resources[] = {
DEFINE_RES_MEM(0xffe00000, 0x100),
DEFINE_RES_MEM(0xffe00000, 0x20),
DEFINE_RES_IRQ(evt2irq(0x4e0)),
};

查看文件

@@ -200,12 +200,18 @@ static struct platform_device scif2_device = {
};
static struct plat_sci_port scif3_platform_data = {
/*
* This is actually a SIM card module serial port, based on an SCI with
* additional registers. The sh-sci driver doesn't support the SIM port
* type, declare it as a SCI. Don't declare the additional registers in
* the memory resource or the driver will compute an incorrect regshift
* value.
*/
.type = PORT_SCI,
.regshift = 2,
};
static struct resource scif3_resources[] = {
DEFINE_RES_MEM(0xfe480000, 0x100),
DEFINE_RES_MEM(0xfe480000, 0x10),
DEFINE_RES_IRQ(evt2irq(0xc00)),
DEFINE_RES_IRQ(evt2irq(0xc20)),
DEFINE_RES_IRQ(evt2irq(0xc40)),