xref: /openbmc/linux/arch/m68k/include/asm/mcfqspi.h (revision 91d60417)
191d60417SSteven King /*
291d60417SSteven King  * Definitions for Freescale Coldfire QSPI module
391d60417SSteven King  *
491d60417SSteven King  * Copyright 2010 Steven King <sfking@fdwdc.com>
591d60417SSteven King  *
691d60417SSteven King  * This program is free software; you can redistribute it and/or modify
791d60417SSteven King  * it under the terms of the GNU General Public License version 2
891d60417SSteven King  * as published by the Free Software Foundation.
991d60417SSteven King  *
1091d60417SSteven King  * This program is distributed in the hope that it will be useful,
1191d60417SSteven King  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1291d60417SSteven King  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1391d60417SSteven King  * GNU General Public License for more details.
1491d60417SSteven King  *
1591d60417SSteven King  * You should have received a copy of the GNU General Public License along
1691d60417SSteven King  * with this program; if not, write to the Free Software Foundation, Inc.,
1791d60417SSteven King  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1891d60417SSteven King  *
1991d60417SSteven King */
2091d60417SSteven King 
2191d60417SSteven King #ifndef mcfqspi_h
2291d60417SSteven King #define mcfqspi_h
2391d60417SSteven King 
2491d60417SSteven King #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
2591d60417SSteven King #define	MCFQSPI_IOBASE		(MCF_IPSBAR + 0x340)
2691d60417SSteven King #elif defined(CONFIG_M5249)
2791d60417SSteven King #define MCFQSPI_IOBASE		(MCF_MBAR + 0x300)
2891d60417SSteven King #elif defined(CONFIG_M520x) || defined(CONFIG_M532x)
2991d60417SSteven King #define MCFQSPI_IOBASE		0xFC058000
3091d60417SSteven King #endif
3191d60417SSteven King #define MCFQSPI_IOSIZE		0x40
3291d60417SSteven King 
3391d60417SSteven King /**
3491d60417SSteven King  * struct mcfqspi_cs_control - chip select control for the coldfire qspi driver
3591d60417SSteven King  * @setup: setup the control; allocate gpio's, etc. May be NULL.
3691d60417SSteven King  * @teardown: finish with the control; free gpio's, etc. May be NULL.
3791d60417SSteven King  * @select: output the signals to select the device.  Can not be NULL.
3891d60417SSteven King  * @deselect: output the signals to deselect the device. Can not be NULL.
3991d60417SSteven King  *
4091d60417SSteven King  * The QSPI module has 4 hardware chip selects.  We don't use them.  Instead
4191d60417SSteven King  * platforms are required to supply a mcfqspi_cs_control as a part of the
4291d60417SSteven King  * platform data for each QSPI master controller.  Only the select and
4391d60417SSteven King  * deselect functions are required.
4491d60417SSteven King */
4591d60417SSteven King struct mcfqspi_cs_control {
4691d60417SSteven King 	int 	(*setup)(struct mcfqspi_cs_control *);
4791d60417SSteven King 	void	(*teardown)(struct mcfqspi_cs_control *);
4891d60417SSteven King 	void	(*select)(struct mcfqspi_cs_control *, u8, bool);
4991d60417SSteven King 	void	(*deselect)(struct mcfqspi_cs_control *, u8, bool);
5091d60417SSteven King };
5191d60417SSteven King 
5291d60417SSteven King /**
5391d60417SSteven King  * struct mcfqspi_platform_data - platform data for the coldfire qspi driver
5491d60417SSteven King  * @bus_num: board specific identifier for this qspi driver.
5591d60417SSteven King  * @num_chipselects: number of chip selects supported by this qspi driver.
5691d60417SSteven King  * @cs_control: platform dependent chip select control.
5791d60417SSteven King */
5891d60417SSteven King struct mcfqspi_platform_data {
5991d60417SSteven King 	s16	bus_num;
6091d60417SSteven King 	u16	num_chipselect;
6191d60417SSteven King 	struct mcfqspi_cs_control *cs_control;
6291d60417SSteven King };
6391d60417SSteven King 
6491d60417SSteven King #endif /* mcfqspi_h */
65