Path: blob/master/arch/arm/mach-mxs/include/mach/mxs.h
10820 views
/*1* Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License along14* with this program; if not, write to the Free Software Foundation, Inc.,15* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.16*/1718#ifndef __MACH_MXS_H__19#define __MACH_MXS_H__2021#ifndef __ASSEMBLER__22#include <linux/io.h>23#endif24#include <asm/mach-types.h>25#include <mach/hardware.h>2627/*28* MXS CPU types29*/30#define cpu_is_mx23() ( \31machine_is_mx23evk() || \320)33#define cpu_is_mx28() ( \34machine_is_mx28evk() || \35machine_is_tx28() || \360)3738/*39* IO addresses common to MXS-based40*/41#define MXS_IO_BASE_ADDR 0x8000000042#define MXS_IO_SIZE SZ_1M4344#define MXS_ICOLL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x000000)45#define MXS_APBH_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x004000)46#define MXS_BCH_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00a000)47#define MXS_GPMI_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00c000)48#define MXS_PINCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x018000)49#define MXS_DIGCTL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x01c000)50#define MXS_APBX_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x024000)51#define MXS_DCP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x028000)52#define MXS_PXP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02a000)53#define MXS_OCOTP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02c000)54#define MXS_AXI_AHB0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02e000)55#define MXS_LCDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x030000)56#define MXS_CLKCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x040000)57#define MXS_SAIF0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x042000)58#define MXS_POWER_BASE_ADDR (MXS_IO_BASE_ADDR + 0x044000)59#define MXS_SAIF1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x046000)60#define MXS_LRADC_BASE_ADDR (MXS_IO_BASE_ADDR + 0x050000)61#define MXS_SPDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x054000)62#define MXS_I2C0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x058000)63#define MXS_PWM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x064000)64#define MXS_TIMROT_BASE_ADDR (MXS_IO_BASE_ADDR + 0x068000)65#define MXS_AUART1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06c000)66#define MXS_AUART2_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06e000)67#define MXS_DRAM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x0e0000)6869/*70* It maps the whole address space to [0xf4000000, 0xf50fffff].71*72* OCRAM 0x00000000+0x020000 -> 0xf4000000+0x02000073* IO 0x80000000+0x100000 -> 0xf5000000+0x10000074*/75#define MXS_IO_P2V(x) (0xf4000000 + \76(((x) & 0x80000000) >> 7) + \77(((x) & 0x000fffff)))7879#define MXS_IO_ADDRESS(x) IOMEM(MXS_IO_P2V(x))8081#define mxs_map_entry(soc, name, _type) { \82.virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \83.pfn = __phys_to_pfn(soc ## _ ## name ## _BASE_ADDR), \84.length = soc ## _ ## name ## _SIZE, \85.type = _type, \86}8788#define MXS_SET_ADDR 0x489#define MXS_CLR_ADDR 0x890#define MXS_TOG_ADDR 0xc9192#ifndef __ASSEMBLER__93static inline void __mxs_setl(u32 mask, void __iomem *reg)94{95__raw_writel(mask, reg + MXS_SET_ADDR);96}9798static inline void __mxs_clrl(u32 mask, void __iomem *reg)99{100__raw_writel(mask, reg + MXS_CLR_ADDR);101}102103static inline void __mxs_togl(u32 mask, void __iomem *reg)104{105__raw_writel(mask, reg + MXS_TOG_ADDR);106}107#endif108109#endif /* __MACH_MXS_H__ */110111112