Gabor Ambrus | 54a1008 | 2023-08-14 21:56:06 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | * Copied from trustedfirmware-a and stripped down. |
| 7 | */ |
| 8 | |
| 9 | #ifndef MMIO_H |
| 10 | #define MMIO_H |
| 11 | |
| 12 | #include <stdint.h> |
| 13 | |
| 14 | static inline void mmio_write_32(uintptr_t addr, uint32_t value) |
| 15 | { |
| 16 | *(volatile uint32_t *)addr = value; |
| 17 | } |
| 18 | |
| 19 | static inline uint32_t mmio_read_32(uintptr_t addr) |
| 20 | { |
| 21 | return *(volatile uint32_t *)addr; |
| 22 | } |
| 23 | |
| 24 | #endif /* MMIO_H */ |