blob: 4866f096ffce228bec7f540e824034c57949edea [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Kevin Wells437db592010-02-26 15:53:38 -08002/*
3 * arch/arm/mach-lpc32xx/include/mach/hardware.h
4 *
5 * Copyright (c) 2005 MontaVista Software, Inc. <source@mvista.com>
Kevin Wells437db592010-02-26 15:53:38 -08006 */
7
8#ifndef __ASM_ARCH_HARDWARE_H
9#define __ASM_ARCH_HARDWARE_H
10
11/*
12 * Start of virtual addresses for IO devices
13 */
14#define IO_BASE 0xF0000000
15
16/*
17 * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0
18 */
Arnd Bergmanndf38b242012-09-14 20:20:24 +000019#define IO_ADDRESS(x) IOMEM(((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\
Kevin Wells437db592010-02-26 15:53:38 -080020 IO_BASE)
21
22#define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x))
23#define io_v2p(x) ((((x) & 0x0ff00000) << 4) | ((x) & 0x000fffff))
24
25#endif