/*******************************************************************************
 * DISCLAIMER
 * This software is supplied by Renesas Electronics Corporation and is only
 * intended for use with Renesas products. No other uses are authorized. This
 * software is owned by Renesas Electronics Corporation and is protected under
 * all applicable laws, including copyright laws.
 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 * Renesas reserves the right, without notice, to make changes to this software
 * and to discontinue the availability of this software. By using this software,
 * you agree to the additional terms and conditions found by accessing the
 * following link:
 * http://www.renesas.com/disclaimer
 * Copyright 2021-2022 Renesas Electronics Corporation All rights reserved.
 *******************************************************************************/

/*******************************************************************************
 * DESCRIPTION   : R-Car RAM header
 ******************************************************************************/

#ifndef RAM_DEF_H_
#define RAM_DEF_H_

#include "remap_register.h"

/* DRAM address */
#define DRAM_BASE       (0x40000000U)
#define DRAM_SIZE       (0x80000000U)
#define DRAM_END        ((DRAM_BASE + DRAM_SIZE) - 1U)
#define SDRAM_40BIT_ADDR_TOP    (0x0400000000ULL)
/* RT-SRAM */
#define RTSRAM_BASE     (0xEB200000U)
#define RTSRAM_SIZE     ((1024U - 16U) * 1024U) /* 1MB - 16KB(stack size) */
#define RTSRAM_END      ((RTSRAM_BASE + RTSRAM_SIZE) - 1U)
/* RT-VRAM */
#define RTVRAM_BASE             (0xE2000000U)
#define RTVRAM_SIZE             (1024U * 1024U) /* 1MB */
#define RTVRAM_END              ((RTVRAM_BASE + RTVRAM_SIZE) - 1U)
/* RT-VRAM extend mode */
#define RTVRAM_VBUF_TOP         (RTVRAM_BASE + RTVRAM_SIZE) /* 0xE2100000 */
#define RTVRAM_VBUF_4M          (4U)   /* 4MB */
#define RTVRAM_VBUF_8M          (8U)   /* 8MB */
#define RTVRAM_VBUF_12M         (12U)  /* 12MB */
#define RTVRAM_VBUF_16M         (16U)  /* 16MB */
#define RTVRAM_VBUF_20M         (20U)  /* 20MB */
#define RTVRAM_VBUF_24M         (24U)  /* 24MB */
#define RTVRAM_VBUF_28M         (28U)  /* 28MB */
#define RTVRAM_VBUF_SIZE        ((RTVRAM_VBUF_28M - 1U) * 1024U * 1024U)   /* 3MB to 27MB (The first 1MB is actual RAM.) */
#define RTVRAM_VBUF_AREA_SIZE   (4U * 1024U * 1024U)    /* 4MB */
#define RTVRAM_VBUF_END         ((RTVRAM_VBUF_TOP + RTVRAM_VBUF_SIZE) - 1U)

/* Code SRAM */
#if (BOOT_MCU != 0U)
#define CODESRAM_BASE   (0x10000000U)
#define CODESRAM_SIZE   (6U * 1024U * 1024U)     /* 6MB */
#define CODESRAM_END    ((CODESRAM_BASE + CODESRAM_SIZE) - 1U)
#endif /* (BOOT_MCU != 0U) */

/* System RAM */
#define SYSRAM_BASE (0xE6300000U)
#define SYSRAM_SIZE (384U * 1024U)  /* 384KB */
#define SYSRAM_END  ((SYSRAM_BASE + SYSRAM_SIZE) - 1U)

/* Local RAM */
#define LOCAL_RAM_BASE  (0xFEDE0000U)
#define LOCAL_RAM_SIZE  (0x00020000U)   /* 128KB */
#define LOCAL_RAM_END   ((LOCAL_RAM_BASE + LOCAL_RAM_SIZE) - 1U)

/* Data-SRAM */
#define DATA_SRAM_BASE	(0xDF200000U)

#endif /* RAM_DEF_H_ */

