Nobuhiro Iwamatsu | 32910e2 | 2009-03-17 05:54:37 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Data Technology Inc. ESPT-GIGA board suport |
| 3 | * |
| 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 Shimoda | cf8e56b | 2011-09-28 16:49:14 +0900 | [diff] [blame] | 16 | #include <linux/sh_eth.h> |
Nobuhiro Iwamatsu | 32910e2 | 2009-03-17 05:54:37 +0000 | [diff] [blame] | 17 | #include <asm/machvec.h> |
| 18 | #include <asm/sizes.h> |
Nobuhiro Iwamatsu | 32910e2 | 2009-03-17 05:54:37 +0000 | [diff] [blame] | 19 | |
| 20 | /* NOR Flash */ |
| 21 | static struct mtd_partition espt_nor_flash_partitions[] = { |
| 22 | { |
| 23 | .name = "U-Boot", |
| 24 | .offset = 0, |
| 25 | .size = (2 * SZ_128K), |
| 26 | .mask_flags = MTD_WRITEABLE, /* Read-only */ |
| 27 | }, { |
| 28 | .name = "Linux-Kernel", |
| 29 | .offset = MTDPART_OFS_APPEND, |
| 30 | .size = (20 * SZ_128K), |
| 31 | }, { |
| 32 | .name = "Root Filesystem", |
| 33 | .offset = MTDPART_OFS_APPEND, |
| 34 | .size = MTDPART_SIZ_FULL, |
| 35 | }, |
| 36 | }; |
| 37 | |
| 38 | static struct physmap_flash_data espt_nor_flash_data = { |
| 39 | .width = 2, |
| 40 | .parts = espt_nor_flash_partitions, |
| 41 | .nr_parts = ARRAY_SIZE(espt_nor_flash_partitions), |
| 42 | }; |
| 43 | |
| 44 | static struct resource espt_nor_flash_resources[] = { |
| 45 | [0] = { |
| 46 | .name = "NOR Flash", |
| 47 | .start = 0, |
| 48 | .end = SZ_8M - 1, |
| 49 | .flags = IORESOURCE_MEM, |
| 50 | }, |
| 51 | }; |
| 52 | |
| 53 | static struct platform_device espt_nor_flash_device = { |
| 54 | .name = "physmap-flash", |
| 55 | .resource = espt_nor_flash_resources, |
| 56 | .num_resources = ARRAY_SIZE(espt_nor_flash_resources), |
| 57 | .dev = { |
| 58 | .platform_data = &espt_nor_flash_data, |
| 59 | }, |
| 60 | }; |
| 61 | |
| 62 | /* SH-Ether */ |
| 63 | static struct resource sh_eth_resources[] = { |
| 64 | { |
| 65 | .start = 0xFEE00800, /* use eth1 */ |
| 66 | .end = 0xFEE00F7C - 1, |
| 67 | .flags = IORESOURCE_MEM, |
| 68 | }, { |
Yoshihiro Shimoda | 9055f89 | 2011-03-08 08:00:04 +0000 | [diff] [blame] | 69 | .start = 0xFEE01800, /* TSU */ |
| 70 | .end = 0xFEE01FFF, |
| 71 | .flags = IORESOURCE_MEM, |
| 72 | }, { |
| 73 | |
Nobuhiro Iwamatsu | 32910e2 | 2009-03-17 05:54:37 +0000 | [diff] [blame] | 74 | .start = 57, /* irq number */ |
| 75 | .flags = IORESOURCE_IRQ, |
| 76 | }, |
| 77 | }; |
| 78 | |
| 79 | static struct sh_eth_plat_data sh7763_eth_pdata = { |
| 80 | .phy = 0, |
| 81 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
Yoshihiro Shimoda | 9055f89 | 2011-03-08 08:00:04 +0000 | [diff] [blame] | 82 | .register_type = SH_ETH_REG_GIGABIT, |
| 83 | .phy_interface = PHY_INTERFACE_MODE_MII, |
Nobuhiro Iwamatsu | 32910e2 | 2009-03-17 05:54:37 +0000 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | static struct platform_device espt_eth_device = { |
| 87 | .name = "sh-eth", |
| 88 | .resource = sh_eth_resources, |
| 89 | .num_resources = ARRAY_SIZE(sh_eth_resources), |
| 90 | .dev = { |
| 91 | .platform_data = &sh7763_eth_pdata, |
| 92 | }, |
| 93 | }; |
| 94 | |
| 95 | static struct platform_device *espt_devices[] __initdata = { |
| 96 | &espt_nor_flash_device, |
| 97 | &espt_eth_device, |
| 98 | }; |
| 99 | |
| 100 | static int __init espt_devices_setup(void) |
| 101 | { |
| 102 | return platform_add_devices(espt_devices, |
| 103 | ARRAY_SIZE(espt_devices)); |
| 104 | } |
| 105 | device_initcall(espt_devices_setup); |
| 106 | |
| 107 | static struct sh_machine_vector mv_espt __initmv = { |
| 108 | .mv_name = "ESPT-GIGA", |
| 109 | }; |