15a469608STimur Tabi /**
25a469608STimur Tabi  * Copyright 2010 Freescale Semiconductor
35a469608STimur Tabi  * Author: Timur Tabi <timur@freescale.com>
45a469608STimur Tabi  *
55a469608STimur Tabi  * This program is free software; you can redistribute it and/or modify it
65a469608STimur Tabi  * under the terms of the GNU General Public License as published by the Free
75a469608STimur Tabi  * Software Foundation; either version 2 of the License, or (at your option)
85a469608STimur Tabi  * any later version.
95a469608STimur Tabi  *
105a469608STimur Tabi  * This file provides support for the ngPIXIS, a board-specific FPGA used on
115a469608STimur Tabi  * some Freescale reference boards.
125a469608STimur Tabi  */
135a469608STimur Tabi 
145a469608STimur Tabi /* ngPIXIS register set. Hopefully, this won't change too much over time.
155a469608STimur Tabi  * Feel free to add board-specific #ifdefs where necessary.
165a469608STimur Tabi  */
175a469608STimur Tabi typedef struct ngpixis {
185a469608STimur Tabi 	u8 id;
195a469608STimur Tabi 	u8 arch;
205a469608STimur Tabi 	u8 scver;
215a469608STimur Tabi 	u8 csr;
225a469608STimur Tabi 	u8 rst;
235a469608STimur Tabi 	u8 res1;
245a469608STimur Tabi 	u8 aux;
255a469608STimur Tabi 	u8 spd;
265a469608STimur Tabi 	u8 brdcfg0;
275f4d3682STimur Tabi 	u8 brdcfg1;	/* On some boards, this register is called 'dma' */
285a469608STimur Tabi 	u8 addr;
295a469608STimur Tabi 	u8 res2[2];
305a469608STimur Tabi 	u8 data;
315a469608STimur Tabi 	u8 led;
325a469608STimur Tabi 	u8 res3;
335a469608STimur Tabi 	u8 vctl;
345a469608STimur Tabi 	u8 vstat;
355a469608STimur Tabi 	u8 vcfgen0;
365a469608STimur Tabi 	u8 res4;
375a469608STimur Tabi 	u8 ocmcsr;
385a469608STimur Tabi 	u8 ocmmsg;
395a469608STimur Tabi 	u8 gmdbg;
405a469608STimur Tabi 	u8 res5[2];
415a469608STimur Tabi 	u8 sclk[3];
425a469608STimur Tabi 	u8 dclk[3];
435a469608STimur Tabi 	u8 watch;
445a469608STimur Tabi 	struct {
455a469608STimur Tabi 		u8 sw;
465a469608STimur Tabi 		u8 en;
475a469608STimur Tabi 	} s[8];
48*b4a60e52SKumar Gala } __attribute__ ((packed)) ngpixis_t;
495a469608STimur Tabi 
505a469608STimur Tabi /* Pointer to the PIXIS register set */
515a469608STimur Tabi #define pixis ((ngpixis_t *)PIXIS_BASE)
525a469608STimur Tabi 
535a469608STimur Tabi /* The PIXIS SW register that corresponds to board switch X, where x >= 1 */
545a469608STimur Tabi #define PIXIS_SW(x)		(pixis->s[(x) - 1].sw)
555a469608STimur Tabi 
565a469608STimur Tabi /* The PIXIS EN register that corresponds to board switch X, where x >= 1 */
575a469608STimur Tabi #define PIXIS_EN(x)		(pixis->s[(x) - 1].en)
58