blob: 7291e2f11a4748e64f22475b6b1be2efc8fba304 [file] [log] [blame]
Nobuhiro Iwamatsu32910e22009-03-17 05:54:37 +00001/*
Masanari Iida02582e92012-08-22 19:11:26 +09002 * Data Technology Inc. ESPT-GIGA board support
Nobuhiro Iwamatsu32910e22009-03-17 05:54:37 +00003 *
4 * Copyright (C) 2008, 2009 Renesas Solutions Corp.
5 * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/interrupt.h>
14#include <linux/mtd/physmap.h>
15#include <linux/io.h>
Yoshihiro Shimodacf8e56b2011-09-28 16:49:14 +090016#include <linux/sh_eth.h>
Paul Mundtd5d7e782012-05-18 14:57:21 +090017#include <linux/sh_intc.h>
Nobuhiro Iwamatsu32910e22009-03-17 05:54:37 +000018#include <asm/machvec.h>
19#include <asm/sizes.h>
Nobuhiro Iwamatsu32910e22009-03-17 05:54:37 +000020
21/* NOR Flash */
22static struct mtd_partition espt_nor_flash_partitions[] = {
23 {
24 .name = "U-Boot",
25 .offset = 0,
26 .size = (2 * SZ_128K),
27 .mask_flags = MTD_WRITEABLE, /* Read-only */
28 }, {
29 .name = "Linux-Kernel",
30 .offset = MTDPART_OFS_APPEND,
31 .size = (20 * SZ_128K),
32 }, {
33 .name = "Root Filesystem",
34 .offset = MTDPART_OFS_APPEND,
35 .size = MTDPART_SIZ_FULL,
36 },
37};
38
39static struct physmap_flash_data espt_nor_flash_data = {
40 .width = 2,
41 .parts = espt_nor_flash_partitions,
42 .nr_parts = ARRAY_SIZE(espt_nor_flash_partitions),
43};
44
45static struct resource espt_nor_flash_resources[] = {
46 [0] = {
47 .name = "NOR Flash",
48 .start = 0,
49 .end = SZ_8M - 1,
50 .flags = IORESOURCE_MEM,
51 },
52};
53
54static struct platform_device espt_nor_flash_device = {
55 .name = "physmap-flash",
56 .resource = espt_nor_flash_resources,
57 .num_resources = ARRAY_SIZE(espt_nor_flash_resources),
58 .dev = {
59 .platform_data = &espt_nor_flash_data,
60 },
61};
62
63/* SH-Ether */
64static struct resource sh_eth_resources[] = {
65 {
66 .start = 0xFEE00800, /* use eth1 */
67 .end = 0xFEE00F7C - 1,
68 .flags = IORESOURCE_MEM,
69 }, {
Yoshihiro Shimoda9055f892011-03-08 08:00:04 +000070 .start = 0xFEE01800, /* TSU */
71 .end = 0xFEE01FFF,
72 .flags = IORESOURCE_MEM,
73 }, {
74
Paul Mundtd5d7e782012-05-18 14:57:21 +090075 .start = evt2irq(0x920), /* irq number */
Nobuhiro Iwamatsu32910e22009-03-17 05:54:37 +000076 .flags = IORESOURCE_IRQ,
77 },
78};
79
80static struct sh_eth_plat_data sh7763_eth_pdata = {
81 .phy = 0,
82 .edmac_endian = EDMAC_LITTLE_ENDIAN,
Yoshihiro Shimoda9055f892011-03-08 08:00:04 +000083 .phy_interface = PHY_INTERFACE_MODE_MII,
Nobuhiro Iwamatsu32910e22009-03-17 05:54:37 +000084};
85
86static struct platform_device espt_eth_device = {
Sergei Shtylyovf5d12762013-06-07 13:58:18 +000087 .name = "sh7763-gether",
Nobuhiro Iwamatsu32910e22009-03-17 05:54:37 +000088 .resource = sh_eth_resources,
89 .num_resources = ARRAY_SIZE(sh_eth_resources),
90 .dev = {
91 .platform_data = &sh7763_eth_pdata,
92 },
93};
94
95static struct platform_device *espt_devices[] __initdata = {
96 &espt_nor_flash_device,
97 &espt_eth_device,
98};
99
100static int __init espt_devices_setup(void)
101{
102 return platform_add_devices(espt_devices,
103 ARRAY_SIZE(espt_devices));
104}
105device_initcall(espt_devices_setup);
106
107static struct sh_machine_vector mv_espt __initmv = {
108 .mv_name = "ESPT-GIGA",
109};