2018-02-23 09:12:38 +00:00
|
|
|
#ifndef EXOSPHERE_MC_H
|
|
|
|
#define EXOSPHERE_MC_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2018-02-24 16:13:42 +00:00
|
|
|
#include "memory_map.h"
|
2018-02-23 09:12:38 +00:00
|
|
|
|
|
|
|
/* Exosphere driver for the Tegra X1 Memory Controller. */
|
|
|
|
|
2018-02-26 21:09:35 +00:00
|
|
|
static inline uintptr_t get_mc_base(void) {
|
|
|
|
return MMIO_GET_DEVICE_ADDRESS(MMIO_DEVID_MC);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define MC_BASE (get_mc_base())
|
2018-02-23 09:12:38 +00:00
|
|
|
|
|
|
|
#define CARVEOUT_ID_MIN 1
|
|
|
|
#define CARVEOUT_ID_MAX 5
|
|
|
|
|
|
|
|
#define KERNEL_CARVEOUT_SIZE_MAX 0x1FFE0000
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t allowed_clients;
|
|
|
|
uint32_t paddr_low;
|
|
|
|
uint32_t paddr_high;
|
|
|
|
uint32_t size_big_pages;
|
|
|
|
uint32_t flags_0;
|
|
|
|
uint32_t flags_1;
|
|
|
|
uint32_t flags_2;
|
|
|
|
uint32_t flags_3;
|
|
|
|
uint32_t flags_4;
|
|
|
|
uint32_t flags_5;
|
|
|
|
uint32_t flags_6;
|
|
|
|
uint32_t flags_7;
|
|
|
|
uint32_t flags_8;
|
|
|
|
uint32_t flags_9;
|
|
|
|
uint8_t padding[0x28];
|
|
|
|
} security_carveout_t;
|
|
|
|
|
|
|
|
|
|
|
|
volatile security_carveout_t *get_carveout_by_id(unsigned int carveout);
|
|
|
|
void configure_default_carveouts(void);
|
|
|
|
void configure_kernel_carveout(unsigned int carveout_id, uint64_t address, uint64_t size);
|
|
|
|
|
|
|
|
|
2018-02-24 16:13:42 +00:00
|
|
|
#endif
|