2 * Copyright (C) 2011 Xilinx
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * You should have received a copy of the GNU General Public License
10 * along with this program; if not, write to the Free Software
11 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 #include <linux/types.h>
15 #include <linux/init.h>
16 #include <linux/of_platform.h>
18 #include <linux/spi/spi.h>
19 #include <linux/spi/eeprom.h>
20 #include <linux/platform_device.h>
21 #include <linux/device.h>
22 #include <linux/mtd/physmap.h>
23 #include <linux/spi/flash.h>
24 #include <linux/xilinx_devices.h>
25 #include <linux/i2c.h>
26 #include <linux/i2c/si570.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
31 #include <asm/hardware/gic.h>
37 #ifdef CONFIG_SPI_SPIDEV
39 static struct xspi_platform_data spi_0_pdata
= {
47 static struct spi_eeprom at25640_0
= {
54 static struct spi_board_info spi_devs
[] __initdata
= {
57 .max_speed_hz
= 1000000,
60 .platform_data
= &at25640_0
,
66 #if defined(CONFIG_SI570)
68 static struct si570_platform_data si570_0
= {
69 .factory_fout
= 10000000LL,
70 .initial_fout
= 133000000,
73 static struct i2c_board_info __initdata si570_board_info
[] = {
75 I2C_BOARD_INFO("si570", 0x55),
76 .platform_data
= &si570_0
,
80 #endif /* CONFIG_SI570 */
82 extern struct sys_timer xttcpss_sys_timer
;
84 static void __init
board_zc770_xm013_init(void)
87 /* initialize the xilinx common code before the board
90 xilinx_init_machine();
92 #ifndef CONFIG_SPI_SPIDEV
93 spi_register_board_info(&spi_devs
[0],
94 ARRAY_SIZE(spi_devs
));
97 #if defined(CONFIG_SI570)
98 i2c_register_board_info(0, si570_board_info
,
99 ARRAY_SIZE(si570_board_info
));
104 static const char *xilinx_dt_match
[] = {
105 "xlnx,zynq-zc770-xm013",
109 MACHINE_START(XILINX_EP107
, "Xilinx Zynq Platform")
110 .map_io
= xilinx_map_io
,
111 .init_irq
= xilinx_irq_init
,
112 .handle_irq
= gic_handle_irq
,
113 .init_machine
= board_zc770_xm013_init
,
114 .timer
= &xttcpss_sys_timer
,
115 .dt_compat
= xilinx_dt_match
,
116 .reserve
= xilinx_memory_init
,