2 * Copyright (C) 2008 Embedded Alley Solutions Inc.
4 * (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Most of 378x SoC registers are associated with four addresses
25 * used for different operations - read/write, set, clear and toggle bits.
27 * Some of registers do not implement such feature and, thus, should be
28 * accessed/manipulated via single address in common way.
30 #define REG_RD(x) (*(volatile unsigned int *)(x))
31 #define REG_WR(x, v) ((*(volatile unsigned int *)(x)) = (v))
32 #define REG_SET(x, v) ((*(volatile unsigned int *)((x) + 0x04)) = (v))
33 #define REG_CLR(x, v) ((*(volatile unsigned int *)((x) + 0x08)) = (v))
34 #define REG_TOG(x, v) ((*(volatile unsigned int *)((x) + 0x0c)) = (v))
36 #define MX23_OCRAM_BASE 0x00000000
37 #define MX23_SDRAM_BASE 0x40000000
38 #define MX23_REGS_BASE 0x80000000
40 #endif /* STMP378X_H */