2 * Copyright 2010-2011 Freescale Semiconductor
3 * Author: Timur Tabi <timur@freescale.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
10 * This file provides support for the ngPIXIS, a board-specific FPGA used on
11 * some Freescale reference boards.
14 /* ngPIXIS register set. Hopefully, this won't change too much over time.
15 * Feel free to add board-specific #ifdefs where necessary.
17 typedef struct ngpixis {
27 u8 brdcfg1; /* On some boards, this register is called 'dma' */
49 } __attribute__ ((packed)) ngpixis_t;
51 /* Pointer to the PIXIS register set */
52 #define pixis ((ngpixis_t *)PIXIS_BASE)
54 /* The PIXIS SW register that corresponds to board switch X, where x >= 1 */
55 #define PIXIS_SW(x) (pixis->s[(x) - 1].sw)
57 /* The PIXIS EN register that corresponds to board switch X, where x >= 1 */
58 #define PIXIS_EN(x) (pixis->s[(x) - 1].en)
60 u8 pixis_read(unsigned int reg);
61 void pixis_write(unsigned int reg, u8 value);
63 #define PIXIS_READ(reg) pixis_read(offsetof(ngpixis_t, reg))
64 #define PIXIS_WRITE(reg, value) pixis_write(offsetof(ngpixis_t, reg), value)