// SPDX-License-Identifier: Zlib
// SPDX-FileNotice: Modified from the original version by the BlocksDS project.
//
// Copyright (C) 2016 Dave Murphy (WinterMute)

/// @file nds/arm9/cache.h
///
/// @brief ARM9 cache defines.

#ifndef LIBNDS_NDS_ARM9_CACHE_ASM_H__
#define LIBNDS_NDS_ARM9_CACHE_ASM_H__

#define PAGE_4K         (0b01011 << 1)
#define PAGE_8K         (0b01100 << 1)
#define PAGE_16K        (0b01101 << 1)
#define PAGE_32K        (0b01110 << 1)
#define PAGE_64K        (0b01111 << 1)
#define PAGE_128K       (0b10000 << 1)
#define PAGE_256K       (0b10001 << 1)
#define PAGE_512K       (0b10010 << 1)
#define PAGE_1M         (0b10011 << 1)
#define PAGE_2M         (0b10100 << 1)
#define PAGE_4M         (0b10101 << 1)
#define PAGE_8M         (0b10110 << 1)
#define PAGE_16M        (0b10111 << 1)
#define PAGE_32M        (0b11000 << 1)
#define PAGE_64M        (0b11001 << 1)
#define PAGE_128M       (0b11010 << 1)
#define PAGE_256M       (0b11011 << 1)
#define PAGE_512M       (0b11100 << 1)
#define PAGE_1G         (0b11101 << 1)
#define PAGE_2G         (0b11110 << 1)
#define PAGE_4G         (0b11111 << 1)

#define ITCM_LOAD       (1 << 19)
#define ITCM_ENABLE     (1 << 18)
#define DTCM_LOAD       (1 << 17)
#define DTCM_ENABLE     (1 << 16)
#define DISABLE_TBIT    (1 << 15)
#define ROUND_ROBIN     (1 << 14)
#define ALT_VECTORS     (1 << 13)
#define ICACHE_ENABLE   (1 << 12)
#define BIG_ENDIAN      (1 << 7)
#define DCACHE_ENABLE   (1 << 2)
#define PROTECT_ENABLE  (1 << 0)

#endif // LIBNDS_NDS_ARM9_CACHE_ASM_H__
