Skip to content

Commit 4cec1a3

Browse files
Nobuhiro Iwamatsupmundt
authored andcommitted
sh: Renesas Solutions SH7763RDP board support
This patch adds basic support for the SH7763RDP board. This supports a basic stuff provided in SH7763, like SCIF, NOR Flash and USB host. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent c63847a commit 4cec1a3

8 files changed

Lines changed: 1289 additions & 0 deletions

File tree

‎arch/sh/Kconfig‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@ config SH_AP325RXA
509509
Renesas "AP-325RXA" support.
510510
Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
511511

512+
config SH_SH7763RDP
513+
bool "SH7763RDP"
514+
depends on CPU_SUBTYPE_SH7763
515+
help
516+
Select SH7763RDP if configuring for a Renesas SH7763
517+
evaluation board.
518+
512519
config SH_EDOSK7705
513520
bool "EDOSK7705"
514521
depends on CPU_SUBTYPE_SH7705

‎arch/sh/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ machdir-$(CONFIG_SH_SDK7780) += renesas/sdk7780
123123
machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto
124124
machdir-$(CONFIG_SH_RSK7203) += renesas/rsk7203
125125
machdir-$(CONFIG_SH_AP325RXA) += renesas/ap325rxa
126+
machdir-$(CONFIG_SH_SH7763RDP) += renesas/sh7763rdp
126127
machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev
127128
machdir-$(CONFIG_SH_LANDISK) += landisk
128129
machdir-$(CONFIG_SH_TITAN) += titan
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-y := setup.o irq.o
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* linux/arch/sh/boards/renesas/sh7763rdp/irq.c
3+
*
4+
* Renesas Solutions SH7763RDP Support.
5+
*
6+
* Copyright (C) 2008 Renesas Solutions Corp.
7+
* Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
8+
*
9+
* This file is subject to the terms and conditions of the GNU General Public
10+
* License. See the file "COPYING" in the main directory of this archive
11+
* for more details.
12+
*/
13+
14+
#include <linux/init.h>
15+
#include <linux/irq.h>
16+
#include <asm/io.h>
17+
#include <asm/irq.h>
18+
#include <asm/sh7763rdp.h>
19+
20+
#define INTC_BASE (0xFFD00000)
21+
#define INTC_INT2PRI7 (INTC_BASE+0x4001C)
22+
#define INTC_INT2MSKCR (INTC_BASE+0x4003C)
23+
#define INTC_INT2MSKCR1 (INTC_BASE+0x400D4)
24+
25+
/*
26+
* Initialize IRQ setting
27+
*/
28+
void __init init_sh7763rdp_IRQ(void)
29+
{
30+
/* GPIO enabled */
31+
ctrl_outl(1 << 25, INTC_INT2MSKCR);
32+
33+
/* enable GPIO interrupts */
34+
ctrl_outl((ctrl_inl(INTC_INT2PRI7) & 0xFF00FFFF) | 0x000F0000,
35+
INTC_INT2PRI7);
36+
37+
/* USBH enabled */
38+
ctrl_outl(1 << 17, INTC_INT2MSKCR1);
39+
40+
/* GETHER enabled */
41+
ctrl_outl(1 << 16, INTC_INT2MSKCR1);
42+
43+
/* DMAC enabled */
44+
ctrl_outl(1 << 8, INTC_INT2MSKCR);
45+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/*
2+
* linux/arch/sh/boards/renesas/sh7763rdp/setup.c
3+
*
4+
* Renesas Solutions sh7763rdp board
5+
*
6+
* Copyright (C) 2008 Renesas Solutions Corp.
7+
* Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
8+
*
9+
* This file is subject to the terms and conditions of the GNU General Public
10+
* License. See the file "COPYING" in the main directory of this archive
11+
* for more details.
12+
*/
13+
#include <linux/init.h>
14+
#include <linux/platform_device.h>
15+
#include <linux/interrupt.h>
16+
#include <linux/input.h>
17+
#include <linux/mtd/physmap.h>
18+
#include <asm/io.h>
19+
#include <asm/sh7763rdp.h>
20+
21+
/* NOR Flash */
22+
static struct mtd_partition sh7763rdp_nor_flash_partitions[] = {
23+
{
24+
.name = "U-Boot",
25+
.offset = 0,
26+
.size = (2 * 128 * 1024),
27+
.mask_flags = MTD_WRITEABLE, /* Read-only */
28+
}, {
29+
.name = "Linux-Kernel",
30+
.offset = MTDPART_OFS_APPEND,
31+
.size = (20 * 128 * 1024),
32+
}, {
33+
.name = "Root Filesystem",
34+
.offset = MTDPART_OFS_APPEND,
35+
.size = MTDPART_SIZ_FULL,
36+
},
37+
};
38+
39+
static struct physmap_flash_data sh7763rdp_nor_flash_data = {
40+
.width = 2,
41+
.parts = sh7763rdp_nor_flash_partitions,
42+
.nr_parts = ARRAY_SIZE(sh7763rdp_nor_flash_partitions),
43+
};
44+
45+
static struct resource sh7763rdp_nor_flash_resources[] = {
46+
[0] = {
47+
.name = "NOR Flash",
48+
.start = 0,
49+
.end = (64 * 1024 * 1024),
50+
.flags = IORESOURCE_MEM,
51+
},
52+
};
53+
54+
static struct platform_device sh7763rdp_nor_flash_device = {
55+
.name = "physmap-flash",
56+
.resource = sh7763rdp_nor_flash_resources,
57+
.num_resources = ARRAY_SIZE(sh7763rdp_nor_flash_resources),
58+
.dev = {
59+
.platform_data = &sh7763rdp_nor_flash_data,
60+
},
61+
};
62+
63+
static struct platform_device *sh7763rdp_devices[] __initdata = {
64+
&sh7763rdp_nor_flash_device,
65+
};
66+
67+
static int __init sh7763rdp_devices_setup(void)
68+
{
69+
return platform_add_devices(sh7763rdp_devices,
70+
ARRAY_SIZE(sh7763rdp_devices));
71+
}
72+
__initcall(sh7763rdp_devices_setup);
73+
74+
static void __init sh7763rdp_setup(char **cmdline_p)
75+
{
76+
/* Board version check */
77+
if (ctrl_inw(CPLD_BOARD_ID_ERV_REG) == 0xECB1)
78+
printk(KERN_INFO "RTE Standard Configuration\n");
79+
else
80+
printk(KERN_INFO "RTA Standard Configuration\n");
81+
82+
/* USB pin select bits (clear bit 5-2 to 0) */
83+
ctrl_outw((ctrl_inw(PORT_PSEL2) & 0xFFC3), PORT_PSEL2);
84+
/* USBH setup port I controls to other (clear bits 4-9 to 0) */
85+
ctrl_outw(ctrl_inw(PORT_PICR) & 0xFC0F, PORT_PICR);
86+
87+
/* Select USB Host controller */
88+
ctrl_outw(0x00, USB_USBHSC);
89+
90+
/* For LCD */
91+
/* set PTJ7-1, bits 15-2 of PJCR to 0 */
92+
ctrl_outw(ctrl_inw(PORT_PJCR) & 0x0003, PORT_PJCR);
93+
/* set PTI5, bits 11-10 of PICR to 0 */
94+
ctrl_outw(ctrl_inw(PORT_PICR) & 0xF3FF, PORT_PICR);
95+
ctrl_outw(0, PORT_PKCR);
96+
ctrl_outw(0, PORT_PLCR);
97+
/* set PSEL2 bits 14-8, 5-4, of PSEL2 to 0 */
98+
ctrl_outw((ctrl_inw(PORT_PSEL2) & 0x00C0), PORT_PSEL2);
99+
/* set PSEL3 bits 14-12, 6-4, 2-0 of PSEL3 to 0 */
100+
ctrl_outw((ctrl_inw(PORT_PSEL3) & 0x0700), PORT_PSEL3);
101+
102+
/* For HAC */
103+
/* bit3-0 0100:HAC & SSI1 enable */
104+
ctrl_outw((ctrl_inw(PORT_PSEL1) & 0xFFF0) | 0x0004, PORT_PSEL1);
105+
/* bit14 1:SSI_HAC_CLK enable */
106+
ctrl_outw(ctrl_inw(PORT_PSEL4) | 0x4000, PORT_PSEL4);
107+
108+
/* SH-Ether */
109+
ctrl_outw((ctrl_inw(PORT_PSEL1) & ~0xff00) | 0x2400, PORT_PSEL1);
110+
ctrl_outw(0x0, PORT_PFCR);
111+
ctrl_outw(0x0, PORT_PFCR);
112+
ctrl_outw(0x0, PORT_PFCR);
113+
114+
/* MMC */
115+
/*selects SCIF and MMC other functions */
116+
ctrl_outw(0x0001, PORT_PSEL0);
117+
/* MMC clock operates */
118+
ctrl_outl(ctrl_inl(MSTPCR1) & ~0x8, MSTPCR1);
119+
ctrl_outw(ctrl_inw(PORT_PACR) & ~0x3000, PORT_PACR);
120+
ctrl_outw(ctrl_inw(PORT_PCCR) & ~0xCFC3, PORT_PCCR);
121+
}
122+
123+
static struct sh_machine_vector mv_sh7763rdp __initmv = {
124+
.mv_name = "sh7763drp",
125+
.mv_setup = sh7763rdp_setup,
126+
.mv_nr_irqs = 112,
127+
.mv_init_irq = init_sh7763rdp_IRQ,
128+
};

0 commit comments

Comments
 (0)