/*******************************************************************************
 * 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   : dummy flash data for sector 0(0x00000)
 ******************************************************************************/

#include <stdint.h>

#define BOOT_PARAM      (0x00000000U)
#define SFLASH_CLKSELR  (0x00000005U) /* H'05 = B'0000_0101 = 80MHz Quad I/O */
#define SFLASH_DMCYC    (0xFFFFFFFFU)
// #define SFLASH_DMCYC    (0x00000007U) /* H'07 = B'0_0111 = 8 Dummy Cycles */
/* Actually setting the dummy cycles to 0x7 causes a boot error,
    but setting 0xFFFFFFFF will let it go to default value of 0x7 - that works. */
/* Botting QSPI wiht CLKSELR+DMCYC works
    with MODEMR[1:0]: 0x0 0x820509ac - Wont work with 0x820109AC */
#define CERT_MAGIC      (0xE291F358U)
#define LOADER_ADDR     (0xEB210000U)
#define LOADER_SIZE     (128U * 1024U / 4U)

/* SA0 */
/* boot parameter */
__attribute__ ((section(".sa0_boot"))) const uint32_t boot[] = {
    [0] = BOOT_PARAM,
#if 0
    [1] = SFLASH_CLKSELR,
    [2] = SFLASH_DMCYC,
    [3] = 0xFFFFFFFFU,
#else
    [1] = 0xFFFFFF02U,   /* for 133MHz Quad read output */
#endif
    // [1] = 0xFFFFFF00U,   /* for 80MHz Quad read output or Single Fast Read */
};


/* A-side contents Key (0x3000) */
__attribute__ ((section(".sa0_content_a"))) const uint32_t content_a[872 / 4] = {
//  [0x000 / 4] = CERT_MAGIC,   /* magic */
    [0x00C / 4] = 0x00000000U,  /* magic */
    [0x154 / 4] = LOADER_ADDR,  /* address */
    [0x264 / 4] = LOADER_SIZE,  /* size */
};
