1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2010-2011 Freescale Semiconductor
4 * Author: Timur Tabi <timur@freescale.com>
6 * This file provides support for the ngPIXIS, a board-specific FPGA used on
7 * some Freescale reference boards.
10 /* ngPIXIS register set. Hopefully, this won't change too much over time.
11 * Feel free to add board-specific #ifdefs where necessary.
13 typedef struct ngpixis {
23 u8 brdcfg1; /* On some boards, this register is called 'dma' */
44 } s[9]; /* s[0]..s[7] is SW1..SW8, and s[8] is SW11 */
45 } __attribute__ ((packed)) ngpixis_t;
47 /* Pointer to the PIXIS register set */
48 #define pixis ((ngpixis_t *)PIXIS_BASE)
50 /* The PIXIS SW register that corresponds to board switch X, where x >= 1 */
51 #define PIXIS_SW(x) (pixis->s[(x) - 1].sw)
53 /* The PIXIS EN register that corresponds to board switch X, where x >= 1 */
54 #define PIXIS_EN(x) (pixis->s[(x) - 1].en)
56 u8 pixis_read(unsigned int reg);
57 void pixis_write(unsigned int reg, u8 value);
59 #define PIXIS_READ(reg) pixis_read(offsetof(ngpixis_t, reg))
60 #define PIXIS_WRITE(reg, value) pixis_write(offsetof(ngpixis_t, reg), value)