2017-06-23 13:57:25 +08:00
|
|
|
/*
|
2019-06-10 07:26:46 +08:00
|
|
|
* Copyright (c) 2019 Intel Corporation
|
2017-06-23 13:57:25 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __INC_MEMORY_H
|
|
|
|
#define __INC_MEMORY_H
|
|
|
|
|
2018-12-14 19:25:43 +08:00
|
|
|
#include <autoconf.h>
|
|
|
|
|
2017-06-23 13:57:25 +08:00
|
|
|
/* L2 HP SRAM */
|
|
|
|
#define L2_VECTOR_SIZE 0x1000
|
|
|
|
|
2020-04-25 03:32:37 +08:00
|
|
|
#define L2_SRAM_BASE (DT_REG_ADDR(DT_NODELABEL(sram0)))
|
|
|
|
#define L2_SRAM_SIZE (DT_REG_SIZE(DT_NODELABEL(sram0)))
|
|
|
|
|
2018-12-14 19:25:43 +08:00
|
|
|
#ifdef CONFIG_BOOTLOADER_MCUBOOT
|
2020-04-25 03:32:37 +08:00
|
|
|
#define SRAM_BASE (L2_SRAM_BASE + CONFIG_BOOTLOADER_SRAM_SIZE * 1K)
|
|
|
|
#define SRAM_SIZE (L2_SRAM_SIZE - CONFIG_BOOTLOADER_SRAM_SIZE * 1K)
|
2018-12-14 19:25:43 +08:00
|
|
|
#else
|
2020-04-25 03:32:37 +08:00
|
|
|
#define SRAM_BASE (L2_SRAM_BASE)
|
|
|
|
#define SRAM_SIZE (L2_SRAM_SIZE)
|
2018-12-14 19:25:43 +08:00
|
|
|
#endif
|
|
|
|
|
2017-06-23 13:57:25 +08:00
|
|
|
/* The reset vector address in SRAM and its size */
|
2018-12-14 19:25:43 +08:00
|
|
|
#define XCHAL_RESET_VECTOR0_PADDR_SRAM SRAM_BASE
|
2017-06-23 13:57:25 +08:00
|
|
|
#define MEM_RESET_TEXT_SIZE 0x268
|
|
|
|
#define MEM_RESET_LIT_SIZE 0x8
|
|
|
|
|
|
|
|
/* This is the base address of all the vectors defined in SRAM */
|
2018-12-14 19:25:43 +08:00
|
|
|
#define XCHAL_VECBASE_RESET_PADDR_SRAM (SRAM_BASE + 0x400)
|
2017-06-23 13:57:25 +08:00
|
|
|
#define MEM_VECBASE_LIT_SIZE 0x178
|
|
|
|
|
|
|
|
/* The addresses of the vectors in SRAM.
|
|
|
|
* Only the memerror vector continues to point to its ROM address.
|
|
|
|
*/
|
2018-12-14 19:25:43 +08:00
|
|
|
#define XCHAL_INTLEVEL2_VECTOR_PADDR_SRAM (SRAM_BASE + 0x580)
|
|
|
|
#define XCHAL_INTLEVEL3_VECTOR_PADDR_SRAM (SRAM_BASE + 0x5C0)
|
|
|
|
#define XCHAL_INTLEVEL4_VECTOR_PADDR_SRAM (SRAM_BASE + 0x600)
|
|
|
|
#define XCHAL_INTLEVEL5_VECTOR_PADDR_SRAM (SRAM_BASE + 0x640)
|
|
|
|
#define XCHAL_INTLEVEL6_VECTOR_PADDR_SRAM (SRAM_BASE + 0x680)
|
|
|
|
#define XCHAL_INTLEVEL7_VECTOR_PADDR_SRAM (SRAM_BASE + 0x6C0)
|
|
|
|
#define XCHAL_KERNEL_VECTOR_PADDR_SRAM (SRAM_BASE + 0x700)
|
|
|
|
#define XCHAL_USER_VECTOR_PADDR_SRAM (SRAM_BASE + 0x740)
|
|
|
|
#define XCHAL_DOUBLEEXC_VECTOR_PADDR_SRAM (SRAM_BASE + 0x7C0)
|
2017-06-23 13:57:25 +08:00
|
|
|
|
|
|
|
/* Vector and literal sizes */
|
|
|
|
#define MEM_VECT_LIT_SIZE 0x8
|
|
|
|
#define MEM_VECT_TEXT_SIZE 0x38
|
|
|
|
#define MEM_VECT_SIZE (MEM_VECT_TEXT_SIZE +\
|
|
|
|
MEM_VECT_LIT_SIZE)
|
|
|
|
|
|
|
|
#define MEM_ERROR_TEXT_SIZE 0x180
|
|
|
|
#define MEM_ERROR_LIT_SIZE 0x8
|
|
|
|
|
2018-11-10 22:05:55 +08:00
|
|
|
/* text and data share the same L2 HP SRAM on Intel S1000.
|
|
|
|
* So, they lie next to each other.
|
|
|
|
*/
|
2018-12-14 19:25:43 +08:00
|
|
|
#define RAM_BASE (SRAM_BASE + L2_VECTOR_SIZE)
|
|
|
|
#define RAM_SIZE (SRAM_SIZE - L2_VECTOR_SIZE)
|
2018-11-10 22:05:55 +08:00
|
|
|
|
|
|
|
/* Location for the intList section which is later used to construct the
|
|
|
|
* Interrupt Descriptor Table (IDT). This is a bogus address as this
|
|
|
|
* section will be stripped off in the final image.
|
|
|
|
*/
|
2019-02-27 08:16:11 +08:00
|
|
|
#define IDT_BASE (RAM_BASE + RAM_SIZE)
|
2017-06-23 13:57:25 +08:00
|
|
|
|
|
|
|
/* size of the Interrupt Descriptor Table (IDT) */
|
|
|
|
#define IDT_SIZE 0x2000
|
|
|
|
|
2019-06-10 07:26:46 +08:00
|
|
|
/* low power ram where DMA buffers are typically placed */
|
2020-04-25 03:32:37 +08:00
|
|
|
#define LPRAM_BASE (DT_REG_ADDR(DT_NODELABEL(sram1)))
|
|
|
|
#define LPRAM_SIZE (DT_REG_SIZE(DT_NODELABEL(sram1)))
|
2019-06-10 07:26:46 +08:00
|
|
|
|
2019-02-22 07:05:30 +08:00
|
|
|
/* Boot vector resideing in LP-SRAM for core #1 */
|
2020-04-30 02:09:40 +08:00
|
|
|
#define LPSRAM_BOOT_VECTOR_ADDR (LPRAM_BASE + 0x08)
|
2019-02-22 07:05:30 +08:00
|
|
|
|
2020-09-24 02:55:51 +08:00
|
|
|
#define IPC_DSP_SIZE 0x00000080
|
|
|
|
#define IPC_DSP_BASE(x) (0x00001200 + x * IPC_DSP_SIZE)
|
|
|
|
|
2017-06-23 13:57:25 +08:00
|
|
|
#endif /* __INC_MEMORY_H */
|