1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-22 16:12:03 +00:00

Utilize hekate's BDK for hekate main and Nyx

This commit is contained in:
CTCaer 2020-06-14 16:45:45 +03:00
parent 185526d134
commit 6e256d29c7
186 changed files with 1138 additions and 1016 deletions

View file

@ -16,7 +16,10 @@ TARGET := hekate
BUILDDIR := build
OUTPUTDIR := output
SOURCEDIR = bootloader
BDKDIR := bdk
BDKINC := -I./$(BDKDIR)
VPATH = $(dir ./$(SOURCEDIR)/) $(dir $(wildcard ./$(SOURCEDIR)/*/)) $(dir $(wildcard ./$(SOURCEDIR)/*/*/))
VPATH += $(dir $(wildcard ./$(BDKDIR)/*/)) $(dir $(wildcard ./$(BDKDIR)/*/*/))
# Main and graphics.
OBJS = $(addprefix $(BUILDDIR)/$(TARGET)/, \
@ -54,11 +57,15 @@ OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
elfload.o elfreloc_arm.o \
)
GFX_INC := '"../$(SOURCEDIR)/gfx/gfx.h"'
FFCFG_INC := '"../$(SOURCEDIR)/libs/fatfs/ffconf.h"'
################################################################################
CUSTOMDEFINES := -DIPL_LOAD_ADDR=$(IPL_LOAD_ADDR) -DBL_MAGIC=$(IPL_MAGIC)
CUSTOMDEFINES += -DBL_VER_MJ=$(BLVERSION_MAJOR) -DBL_VER_MN=$(BLVERSION_MINOR) -DBL_VER_HF=$(BLVERSION_HOTFX) -DBL_RESERVED=$(BLVERSION_RSVD)
CUSTOMDEFINES += -DNYX_VER_MJ=$(NYXVERSION_MAJOR) -DNYX_VER_MN=$(NYXVERSION_MINOR) -DNYX_VER_HF=$(NYXVERSION_HOTFX) -DNYX_RESERVED=$(NYXVERSION_RSVD)
CUSTOMDEFINES += -DGFX_INC=$(GFX_INC) -DFFCFG_INC=$(FFCFG_INC)
# 0: UART_A, 1: UART_B.
#CUSTOMDEFINES += -DDEBUG_UART_PORT=0
@ -104,7 +111,7 @@ $(BUILDDIR)/$(TARGET)/$(TARGET).elf: $(OBJS)
$(BUILDDIR)/$(TARGET)/%.o: %.c
@echo Building $@
@$(CC) $(CFLAGS) -c $< -o $@
@$(CC) $(CFLAGS) $(BDKINC) -c $< -o $@
$(BUILDDIR)/$(TARGET)/%.o: %.S
@echo Building $@

View file

@ -1,6 +1,5 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (c) 2018 M4xw
* Copyright (c) 2020 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -13,29 +12,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#pragma once
//TODO: Move it to BDK
#include "../bootloader/utils/types.h"
#ifndef _FATFS_CFG_H_
#define _FATFS_CFG_H_
typedef struct _hnode
{
int used;
u32 size;
struct _hnode *prev;
struct _hnode *next;
u32 align[4]; // Align to arch cache line size.
} hnode_t;
#ifdef FFCFG_INC
#include FFCFG_INC
#endif
typedef struct _heap
{
u32 start;
hnode_t *first;
} heap_t;
typedef struct
{
u32 total;
u32 used;
} heap_monitor_t;
#endif

View file

@ -18,16 +18,15 @@
#include <string.h>
#include "di.h"
#include "../gfx/gfx.h"
#include "../power/max77620.h"
#include "../power/max7762x.h"
#include "../soc/clock.h"
#include "../soc/gpio.h"
#include "../soc/i2c.h"
#include "../soc/pinmux.h"
#include "../soc/pmc.h"
#include "../soc/t210.h"
#include "../utils/util.h"
#include <power/max77620.h>
#include <power/max7762x.h>
#include <soc/clock.h>
#include <soc/gpio.h>
#include <soc/i2c.h>
#include <soc/pinmux.h>
#include <soc/pmc.h>
#include <soc/t210.h>
#include <utils/util.h>
#include "di.inl"

View file

@ -18,8 +18,8 @@
#ifndef _DI_H_
#define _DI_H_
#include "../../common/memory_map.h"
#include "../utils/types.h"
#include <memory_map.h>
#include <utils/types.h>
/*! Display registers. */
#define _DIREG(reg) ((reg) * 4)

View file

@ -1,8 +1,5 @@
/*
* Common Gfx Header
* Copyright (c) 2018 naehrwert
* Copyright (c) 2018 CTCaer
* Copyright (c) 2018 M4xw
* Copyright (c) 2020 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -15,30 +12,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#pragma once
//TODO: Move it to BDK
#include "../bootloader/utils/types.h"
#ifndef _GFX_UTILS_H_
#define _GFX_UTILS_H_
typedef struct _gfx_ctxt_t
{
u32 *fb;
u32 width;
u32 height;
u32 stride;
} gfx_ctxt_t;
#ifdef GFX_INC
#include GFX_INC
#endif
typedef struct _gfx_con_t
{
gfx_ctxt_t *gfx_ctxt;
u32 fntsz;
u32 x;
u32 y;
u32 savedx;
u32 savedy;
u32 fgcol;
int fillbg;
u32 bgcol;
bool mute;
} gfx_con_t;
#endif

View file

@ -22,10 +22,10 @@
#include "elfarch.h"
#include "elf.h"
#include "../../utils/types.h"
#include <utils/types.h>
#ifdef DEBUG
#include "../../gfx/gfx.h"
#include <gfx_utils.h>
#define EL_DEBUG(format, ...) \
gfx_printf(format __VA_OPT__(, ) __VA_ARGS__)
#else

View file

@ -18,12 +18,13 @@
#include <string.h>
#include "ianos.h"
#include "../../common/common_module.h"
#include "../gfx/gfx.h"
#include "../libs/elfload/elfload.h"
#include "../mem/heap.h"
#include "../storage/nx_sd.h"
#include "../utils/types.h"
#include "elfload/elfload.h"
#include <module.h>
#include <mem/heap.h>
#include <storage/nx_sd.h>
#include <utils/types.h>
#include <gfx_utils.h>
#define IRAM_LIB_ADDR 0x4002B000
#define DRAM_LIB_ADDR 0xE0000000
@ -36,8 +37,8 @@ void *fileBuf = NULL;
static void _ianos_call_ep(moduleEntrypoint_t entrypoint, void *moduleConfig)
{
bdkParams_t bdkParameters = (bdkParams_t)malloc(sizeof(struct _bdkParams_t));
bdkParameters->gfxCon = &gfx_con;
bdkParameters->gfxCtx = &gfx_ctxt;
bdkParameters->gfxCon = (void *)&gfx_con;
bdkParameters->gfxCtx = (void *)&gfx_ctxt;
bdkParameters->memcpy = (memcpy_t)&memcpy;
bdkParameters->memset = (memset_t)&memset;
bdkParameters->sharedHeap = &_heap;

View file

@ -18,7 +18,7 @@
#ifndef IANOS_H
#define IANOS_H
#include "../utils/types.h"
#include <utils/types.h>
typedef enum
{

View file

@ -17,11 +17,11 @@
*/
#include "als.h"
#include "../power/max77620.h"
#include "../soc/clock.h"
#include "../soc/i2c.h"
#include "../soc/pinmux.h"
#include "../utils/util.h"
#include <power/max77620.h>
#include <soc/clock.h>
#include <soc/i2c.h>
#include <soc/pinmux.h>
#include <utils/util.h>
#define HOS_GAIN BH1730_GAIN_64X
#define HOS_ITIME 38

View file

@ -19,7 +19,7 @@
#ifndef __ALS_H_
#define __ALS_H_
#include "../utils/types.h"
#include <utils/types.h>
#define BH1730_I2C_ADDR 0x29

View file

@ -19,19 +19,19 @@
#include <string.h>
#include "joycon.h"
#include "../gfx/gfx.h"
#include "../power/max17050.h"
#include "../power/regulator_5v.h"
#include "../soc/bpmp.h"
#include "../soc/clock.h"
#include "../soc/gpio.h"
#include "../soc/pinmux.h"
#include "../soc/uart.h"
#include "../soc/t210.h"
#include "../utils/util.h"
#include <gfx_utils.h>
#include <power/max17050.h>
#include <power/regulator_5v.h>
#include <soc/bpmp.h>
#include <soc/clock.h>
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/uart.h>
#include <soc/t210.h>
#include <utils/util.h>
// For disabling driver when logging is enabled.
#include "../libs/lvgl/lvgl.h"
#include <libs/lv_conf.h>
#define JC_WIRED_CMD 0x91
#define JC_WIRED_HID 0x92

View file

@ -19,7 +19,7 @@
#ifndef __JOYCON_H_
#define __JOYCON_H_
#include "../utils/types.h"
#include <utils/types.h>
#define JC_BTNS_DIRECTION_PAD 0xF0000
#define JC_BTNS_PREV_NEXT 0x800080

View file

@ -19,19 +19,19 @@
#include <string.h>
#include "../soc/clock.h"
#include "../soc/i2c.h"
#include "../soc/pinmux.h"
#include "../power/max7762x.h"
#include "../power/max77620.h"
#include "../soc/gpio.h"
#include "../soc/t210.h"
#include "../utils/btn.h"
#include "../utils/util.h"
#include <soc/clock.h>
#include <soc/i2c.h>
#include <soc/pinmux.h>
#include <power/max7762x.h>
#include <power/max77620.h>
#include <soc/gpio.h>
#include <soc/t210.h>
#include <utils/btn.h>
#include <utils/util.h>
#include "touch.h"
#include "../gfx/gfx.h"
#include <gfx_utils.h>
#define DPRINTF(...) gfx_printf(__VA_ARGS__)
static int touch_command(u8 cmd, u8 *buf, u8 size)

View file

@ -20,7 +20,7 @@
#ifndef __TOUCH_H_
#define __TOUCH_H_
#include "../utils/types.h"
#include <utils/types.h>
#define STMFTS_I2C_ADDR 0x49

View file

@ -17,7 +17,7 @@
#ifndef _BLZ_H_
#define _BLZ_H_
#include "../../utils/types.h"
#include <utils/types.h>
typedef struct _blz_footer
{

View file

@ -9,7 +9,7 @@
extern "C" {
#endif
#include "../../utils/types.h"
#include <utils/types.h>
/* Status of Disk Functions */
typedef BYTE DSTATUS;

View file

@ -38,7 +38,7 @@
#include "ff.h" /* Declarations of FatFs API */
#include "diskio.h" /* Declarations of device I/O functions */
#include "../../gfx/gfx.h"
#include <gfx_utils.h>
#define EFSPRINTF(text, ...) print_error(); gfx_printf("%k"text"%k\n", 0xFFFFFF00, 0xFFFFFFFF);
//#define EFSPRINTF(...)

View file

@ -26,8 +26,8 @@
extern "C" {
#endif
#include "../../utils/types.h" /* Basic integer types */
#include "ffconf.h" /* FatFs configuration options */
#include <utils/types.h> /* Basic integer types */
#include <fatfs_cfg.h> /* FatFs configuration options */
#if FF_DEFINED != FFCONF_DEF
#error Wrong configuration file (ffconf.h).

View file

@ -17,8 +17,8 @@
#ifndef LV_CONF_H
#define LV_CONF_H
#include "../utils/types.h"
#include "../../../common/memory_map.h"
#include <utils/types.h>
#include <memory_map.h>
/*===================
Dynamic memory
*===================*/
@ -32,7 +32,7 @@
# define LV_MEM_ADR NYX_LV_MEM_ADR /*Set an address for memory pool instead of allocation it as an array. Can be in external SRAM too.*/
# define LV_MEM_AUTO_DEFRAG 1 /*Automatically defrag on free*/
#else /*LV_MEM_CUSTOM*/
# define LV_MEM_CUSTOM_INCLUDE "../../../mem/heap.h" /*Header for the dynamic memory function*/
# define LV_MEM_CUSTOM_INCLUDE <mem/heap.h> /*Header for the dynamic memory function*/
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
@ -149,7 +149,7 @@
/*HAL settings*/
#define LV_TICK_CUSTOM 1 /*1: use a custom tick source (removing the need to manually update the tick with `lv_tick_inc`) */
#if LV_TICK_CUSTOM == 1
#define LV_TICK_CUSTOM_INCLUDE "../../../utils/util.h" /*Header for the sys time function*/
#define LV_TICK_CUSTOM_INCLUDE <utils/util.h> /*Header for the sys time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (get_tmr_ms()) /*Expression evaluating to current systime in ms*/
#endif /*LV_TICK_CUSTOM*/

View file

@ -16,7 +16,7 @@
#include "../lv_misc/lv_font.h"
#include "../../../../../common/memory_map.h"
#include <memory_map.h>
#if USE_HEKATE_SYMBOL_120 != 0 /*Can be enabled in lv_conf.h*/

View file

@ -16,7 +16,7 @@
#include "../lv_misc/lv_font.h"
#include "../../../../../common/memory_map.h"
#include <memory_map.h>
#if USE_HEKATE_SYMBOL_20 != 0 /*Can be enabled in lv_conf.h*/

View file

@ -16,7 +16,7 @@
#include "../lv_misc/lv_font.h"
#include "../../../../../common/memory_map.h"
#include <memory_map.h>
#if USE_HEKATE_SYMBOL_30 != 0 /*Can be enabled in lv_conf.h*/

View file

@ -16,7 +16,7 @@
#include "../lv_misc/lv_font.h"
#include "../../../../../common/memory_map.h"
#include <memory_map.h>
#if USE_INTERUI_20 != 0 /*Can be enabled in lv_conf.h*/

View file

@ -16,7 +16,7 @@
#include "../lv_misc/lv_font.h"
#include "../../../../../common/memory_map.h"
#include <memory_map.h>
#if USE_INTERUI_30 != 0 /*Can be enabled in lv_conf.h*/

View file

@ -16,7 +16,7 @@
#include "../lv_misc/lv_font.h"
#include "../../../../../common/memory_map.h"
#include <memory_map.h>
#if USE_UBUNTU_MONO != 0 /*Can be enabled in lv_conf.h*/

View file

@ -17,7 +17,7 @@ extern "C" {
*********************/
#include <stdint.h>
#include "lv_hal.h"
#include "../../../utils/types.h"
#include <utils/types.h>
#include "../lv_misc/lv_area.h"
#include "../lv_core/lv_obj.h"

View file

@ -15,7 +15,7 @@ extern "C" {
* INCLUDES
*********************/
#include <string.h>
#include "../../../utils/types.h"
#include <utils/types.h>
/*********************
* DEFINES

View file

@ -16,7 +16,7 @@ extern "C" {
*********************/
#include <stddef.h>
#include "lv_area.h"
#include "../../../utils/types.h"
#include <utils/types.h>
/*********************
* DEFINES

View file

@ -11,9 +11,9 @@
#if LV_LOG_PRINTF
#include <string.h>
#include "../../../mem/heap.h"
#include "../../../soc/uart.h"
#include "../../../utils/sprintf.h"
#include <mem/heap.h>
#include <soc/uart.h>
#include <utils/sprintf.h>
#endif
/*********************
* DEFINES

View file

@ -1,7 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (c) 2018-2020 CTCaer
* Copyright (c) 2018 M4xw
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -18,8 +17,7 @@
#include <string.h>
#include "heap.h"
#include "../gfx/gfx.h"
#include "../../common/common_heap.h"
#include <gfx_utils.h>
static void _heap_create(heap_t *heap, u32 start)
{

View file

@ -18,8 +18,28 @@
#ifndef _HEAP_H_
#define _HEAP_H_
#include "../utils/types.h"
#include "../../common/common_heap.h"
#include <utils/types.h>
typedef struct _hnode
{
int used;
u32 size;
struct _hnode *prev;
struct _hnode *next;
u32 align[4]; // Align to arch cache line size.
} hnode_t;
typedef struct _heap
{
u32 start;
hnode_t *first;
} heap_t;
typedef struct
{
u32 total;
u32 used;
} heap_monitor_t;
void heap_init(u32 base);
void heap_copy(heap_t *heap);

View file

@ -1,7 +1,24 @@
#include "../mem/mc.h"
#include "../soc/t210.h"
#include "../soc/clock.h"
#include "../utils/util.h"
/*
* Copyright (c) 2018 naehrwert
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <mem/mc.h>
#include <soc/t210.h>
#include <soc/clock.h>
#include <utils/util.h>
void mc_config_tsec_carveout(u32 bom, u32 size1mb, bool lock)
{

View file

@ -1,8 +1,24 @@
/*
* Copyright (c) 2018 naehrwert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MC_H_
#define _MC_H_
#include "../utils/types.h"
#include "../mem/mc_t210.h"
#include <utils/types.h>
#include <mem/mc_t210.h>
void mc_config_tsec_carveout(u32 bom, u32 size1mb, bool lock);
void mc_config_carveout();

View file

@ -18,13 +18,13 @@
#include <stdlib.h>
#include "minerva.h"
#include "../soc/fuse.h"
#include "../utils/util.h"
#include "../soc/clock.h"
#include "../ianos/ianos.h"
#include "../soc/fuse.h"
#include "../soc/t210.h"
#include <soc/clock.h>
#include <ianos/ianos.h>
#include <soc/clock.h>
#include <soc/fuse.h>
#include <soc/t210.h>
#include <utils/util.h>
extern volatile nyx_storage_t *nyx_str;

View file

@ -18,7 +18,7 @@
#define _FE_MINERVA_H_
#include "mtc_table.h"
#include "../utils/types.h"
#include <utils/types.h>
#define MTC_INIT_MAGIC 0x3043544D
#define MTC_NEW_MAGIC 0x5243544D

View file

@ -20,7 +20,7 @@
#ifndef _MTC_TABLE_H_
#define _MTC_TABLE_H_
#include "../utils/types.h"
#include <utils/types.h>
typedef struct
{

View file

@ -18,23 +18,23 @@
#include <string.h>
#include "mc.h"
#include "emc.h"
#include "sdram_param_t210.h"
#include "../../common/memory_map.h"
#include "../power/max77620.h"
#include "../power/max7762x.h"
#include "../soc/clock.h"
#include "../soc/fuse.h"
#include "../soc/i2c.h"
#include "../soc/pmc.h"
#include "../soc/t210.h"
#include "../utils/util.h"
#include <mem/mc.h>
#include <mem/emc.h>
#include <mem/sdram_param_t210.h>
#include <memory_map.h>
#include <power/max77620.h>
#include <power/max7762x.h>
#include <soc/clock.h>
#include <soc/fuse.h>
#include <soc/i2c.h>
#include <soc/pmc.h>
#include <soc/t210.h>
#include <utils/util.h>
#define CONFIG_SDRAM_KEEP_ALIVE
#ifdef CONFIG_SDRAM_COMPRESS_CFG
#include "../libs/compr/lz.h"
#include <libs/compr/lz.h>
#include "sdram_config_lz.inl"
#else
#include "sdram_config.inl"

View file

@ -17,8 +17,8 @@
#ifndef _SDRAM_H_
#define _SDRAM_H_
#include "emc.h"
#include "sdram_param_t210.h"
#include <mem/emc.h>
#include <mem/sdram_param_t210.h>
void sdram_init();
sdram_params_t *sdram_get_params();

View file

@ -14,9 +14,9 @@
* more details.
*/
#include "../soc/t210.h"
#include "../soc/pmc_lp0_t210.h"
#include "sdram_lp0_param_t210.h"
#include <soc/t210.h>
#include <soc/pmc_lp0_t210.h>
#include <mem/sdram_lp0_param_t210.h>
/*
* This function reads SDRAM parameters from the common BCT format and

View file

@ -23,7 +23,7 @@
#ifndef __SOC_NVIDIA_TEGRA210_SDRAM_PARAM_H__
#define __SOC_NVIDIA_TEGRA210_SDRAM_PARAM_H__
#include "../utils/types.h"
#include <utils/types.h>
enum
{

View file

@ -17,12 +17,12 @@
#include <string.h>
#include "smmu.h"
#include "../soc/ccplex.h"
#include "../soc/t210.h"
#include "../mem/mc_t210.h"
#include "../utils/util.h"
#include "../utils/aarch64_util.h"
#include <soc/ccplex.h>
#include <soc/t210.h>
#include <mem/mc_t210.h>
#include <mem/smmu.h>
#include <utils/util.h>
#include <utils/aarch64_util.h>
bool smmu_used = false;
u8 *_pageheap = (u8 *)SMMU_HEAP_ADDR;

View file

@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../utils/types.h"
#include <utils/types.h>
#define SMMU_HEAP_ADDR 0xA0000000

View file

@ -15,11 +15,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef _MODULE_H_
#define _MODULE_H_
#include <stddef.h>
//TODO: Move it to BDK
#include "common_gfx.h"
#include "common_heap.h"
#include <mem/heap.h>
// Module Callback
typedef void (*cbMainModule_t)(const char *s);
@ -28,8 +28,8 @@ typedef void (*memset_t)(void *, int, size_t);
typedef struct _bdkParams_t
{
gfx_con_t *gfxCon;
gfx_ctxt_t *gfxCtx;
void *gfxCon;
void *gfxCtx;
heap_t *sharedHeap;
memcpy_t memcpy;
memset_t memset;
@ -37,3 +37,5 @@ typedef struct _bdkParams_t
// Module Entrypoint
typedef void (*moduleEntrypoint_t)(void *, bdkParams_t);
#endif

View file

@ -17,8 +17,8 @@
*/
#include "bq24193.h"
#include "../soc/i2c.h"
#include "../utils/util.h"
#include <soc/i2c.h>
#include <utils/util.h>
static u8 bq24193_get_reg(u8 reg)
{

View file

@ -23,8 +23,8 @@
*/
#include "max17050.h"
#include "../soc/i2c.h"
#include "../utils/util.h"
#include <soc/i2c.h>
#include <utils/util.h>
/* Status register bits */
#define STATUS_POR_BIT (1 << 1)

View file

@ -24,7 +24,7 @@
#ifndef __MAX17050_H_
#define __MAX17050_H_
#include "../utils/types.h"
#include <utils/types.h>
#define MAX17050_STATUS_BattAbsent (1 << 3)
#define MAX17050_DEFAULT_SNS_RESISTOR 10000

View file

@ -15,10 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "max7762x.h"
#include "max77620.h"
#include "../soc/i2c.h"
#include "../utils/util.h"
#include <power/max7762x.h>
#include <power/max77620.h>
#include <soc/i2c.h>
#include <utils/util.h>
#define REGULATOR_SD 0
#define REGULATOR_LDO 1

View file

@ -18,7 +18,7 @@
#ifndef _MAX7762X_H_
#define _MAX7762X_H_
#include "../utils/types.h"
#include <utils/types.h>
/*
* Switch Power domains (max77620):

View file

@ -14,11 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../soc/gpio.h"
#include "../soc/pinmux.h"
#include "../soc/pmc.h"
#include "../soc/t210.h"
#include "../utils/types.h"
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/pmc.h>
#include <soc/t210.h>
#include <utils/types.h>
static u8 reg_5v_dev = 0;

View file

@ -17,7 +17,7 @@
#ifndef _REGULATOR_5V_H_
#define _REGULATOR_5V_H_
#include "../utils/types.h"
#include <utils/types.h>
enum
{

View file

@ -17,9 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "max77620-rtc.h"
#include "../soc/i2c.h"
#include "../utils/util.h"
#include <rtc/max77620-rtc.h>
#include <soc/i2c.h>
#include <utils/util.h>
void max77620_rtc_get_time(rtc_time_t *time)
{

View file

@ -19,7 +19,7 @@
#ifndef _MFD_MAX77620_RTC_H_
#define _MFD_MAX77620_RTC_H_
#include "../utils/types.h"
#include <utils/types.h>
#define MAX77620_RTC_I2C_ADDR 0x68

View file

@ -17,12 +17,12 @@
#include <string.h>
#include "../sec/se.h"
#include "../mem/heap.h"
#include "../soc/bpmp.h"
#include "../soc/t210.h"
#include "../sec/se_t210.h"
#include "../utils/util.h"
#include "se.h"
#include "se_t210.h"
#include <mem/heap.h>
#include <soc/bpmp.h>
#include <soc/t210.h>
#include <utils/util.h>
typedef struct _se_ll_t
{

View file

@ -17,7 +17,7 @@
#ifndef _SE_H_
#define _SE_H_
#include "../utils/types.h"
#include <utils/types.h>
void se_rsa_acc_ctrl(u32 rs, u32 flags);
void se_key_acc_ctrl(u32 ks, u32 flags);

View file

@ -21,7 +21,7 @@
#ifndef _CRYPTO_TEGRA_SE_H
#define _CRYPTO_TEGRA_SE_H
#include "../utils/types.h"
#include <utils/types.h>
#define TEGRA_SE_CRA_PRIORITY 300
#define TEGRA_SE_COMPOSITE_PRIORITY 400

View file

@ -18,19 +18,19 @@
#include <string.h>
#include "../sec/tsec.h"
#include "../sec/tsec_t210.h"
#include "../sec/se_t210.h"
#include "../soc/bpmp.h"
#include "../soc/clock.h"
#include "../soc/kfuse.h"
#include "../soc/smmu.h"
#include "../soc/t210.h"
#include "../mem/heap.h"
#include "../mem/mc.h"
#include "../utils/util.h"
#include "tsec.h"
#include "tsec_t210.h"
#include <sec/se_t210.h>
#include <soc/bpmp.h>
#include <soc/clock.h>
#include <soc/kfuse.h>
#include <soc/t210.h>
#include <mem/heap.h>
#include <mem/mc.h>
#include <mem/smmu.h>
#include <utils/util.h>
// #include "../gfx/gfx.h"
// #include <gfx_utils.h>
#define PKG11_MAGIC 0x31314B50
#define KB_TSEC_FW_EMU_COMPAT 6 // KB ID for HOS 6.2.0.

View file

@ -18,7 +18,7 @@
#ifndef _TSEC_H_
#define _TSEC_H_
#include "../utils/types.h"
#include <utils/types.h>
typedef struct _tsec_ctxt_t
{

View file

@ -16,11 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bpmp.h"
#include "clock.h"
#include "t210.h"
#include "../../common/memory_map.h"
#include "../utils/util.h"
#include <soc/bpmp.h>
#include <soc/clock.h>
#include <soc/t210.h>
#include <memory_map.h>
#include <utils/util.h>
#define BPMP_MMU_CACHE_LINE_SIZE 0x20

View file

@ -19,7 +19,7 @@
#ifndef _BPMP_H_
#define _BPMP_H_
#include "../utils/types.h"
#include <utils/types.h>
typedef enum
{

View file

@ -14,14 +14,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../soc/ccplex.h"
#include "../soc/i2c.h"
#include "../soc/clock.h"
#include "../utils/util.h"
#include "../soc/pmc.h"
#include "../soc/t210.h"
#include "../power/max77620.h"
#include "../power/max7762x.h"
#include <soc/ccplex.h>
#include <soc/i2c.h>
#include <soc/clock.h>
#include <utils/util.h>
#include <soc/pmc.h>
#include <soc/t210.h>
#include <power/max77620.h>
#include <power/max7762x.h>
void _ccplex_enable_power()
{

View file

@ -17,7 +17,7 @@
#ifndef _CCPLEX_H_
#define _CCPLEX_H_
#include "../utils/types.h"
#include <utils/types.h>
void ccplex_boot_cpu0(u32 entry);

View file

@ -15,10 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../soc/clock.h"
#include "../soc/t210.h"
#include "../utils/util.h"
#include "../storage/sdmmc.h"
#include <soc/clock.h>
#include <soc/t210.h>
#include <storage/sdmmc.h>
#include <utils/util.h>
/*
* CLOCK Peripherals:

View file

@ -18,7 +18,7 @@
#ifndef _CLOCK_H_
#define _CLOCK_H_
#include "../utils/types.h"
#include <utils/types.h>
/*! Clock registers. */
#define CLK_RST_CONTROLLER_RST_SOURCE 0x0

View file

@ -19,8 +19,8 @@
#include <string.h>
#include "../soc/fuse.h"
#include "../soc/t210.h"
#include <soc/fuse.h>
#include <soc/t210.h>
#define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))

View file

@ -19,7 +19,7 @@
#ifndef _FUSE_H_
#define _FUSE_H_
#include "../utils/types.h"
#include <utils/types.h>
/*! Fuse registers. */
#define FUSE_CTRL 0x0

View file

@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "gpio.h"
#include "t210.h"
#include <soc/gpio.h>
#include <soc/t210.h>
#define GPIO_BANK_IDX(port) (port >> 2)

View file

@ -18,7 +18,7 @@
#ifndef _GPIO_H_
#define _GPIO_H_
#include "../utils/types.h"
#include <utils/types.h>
#define GPIO_MODE_SPIO 0
#define GPIO_MODE_GPIO 1

View file

@ -17,32 +17,32 @@
#include <string.h>
#include "hw_init.h"
#include "bpmp.h"
#include "clock.h"
#include "fuse.h"
#include "gpio.h"
#include "i2c.h"
#include "pinmux.h"
#include "pmc.h"
#include "uart.h"
#include "t210.h"
#include "../input/joycon.h"
#include "../input/touch.h"
#include "../gfx/di.h"
#include "../mem/mc.h"
#include "../mem/minerva.h"
#include "../mem/sdram.h"
#include "../sec/se.h"
#include "../sec/se_t210.h"
#include "../power/max77620.h"
#include "../power/max7762x.h"
#include "../gfx/di.h"
#include "../power/regulator_5v.h"
#include "../storage/nx_sd.h"
#include "../storage/sdmmc.h"
#include "../thermal/fan.h"
#include "../utils/util.h"
#include <soc/hw_init.h>
#include <gfx/di.h>
#include <input/joycon.h>
#include <input/touch.h>
#include <sec/se.h>
#include <sec/se_t210.h>
#include <soc/bpmp.h>
#include <soc/clock.h>
#include <soc/fuse.h>
#include <soc/gpio.h>
#include <soc/i2c.h>
#include <soc/pinmux.h>
#include <soc/pmc.h>
#include <soc/uart.h>
#include <soc/t210.h>
#include <mem/mc.h>
#include <mem/minerva.h>
#include <mem/sdram.h>
#include <power/bq24193.h>
#include <power/max77620.h>
#include <power/max7762x.h>
#include <power/regulator_5v.h>
#include <storage/nx_sd.h>
#include <storage/sdmmc.h>
#include <thermal/fan.h>
#include <utils/util.h>
extern boot_cfg_t b_cfg;
extern volatile nyx_storage_t *nyx_str;

View file

@ -18,7 +18,7 @@
#ifndef _HW_INIT_H_
#define _HW_INIT_H_
#include "../utils/types.h"
#include <utils/types.h>
void config_hw();
void reconfig_hw_workaround(bool extra_reconfig, u32 magic);

View file

@ -17,8 +17,8 @@
#include <string.h>
#include "i2c.h"
#include "../utils/util.h"
#include <soc/i2c.h>
#include <utils/util.h>
static const u32 i2c_addrs[] = {
0x7000C000, 0x7000C400, 0x7000C500,

View file

@ -18,7 +18,7 @@
#ifndef _I2C_H_
#define _I2C_H_
#include "../utils/types.h"
#include <utils/types.h>
#define I2C_1 0
#define I2C_2 1

View file

@ -19,9 +19,9 @@
#include <string.h>
#include "irq.h"
#include "t210.h"
#include "../gfx/gfx.h"
#include "../mem/heap.h"
#include <soc/t210.h>
#include <gfx_utils.h>
#include <mem/heap.h>
//#define DPRINTF(...) gfx_printf(__VA_ARGS__)
#define DPRINTF(...)

View file

@ -19,7 +19,7 @@
#ifndef IRQ_H
#define IRQ_H
#include "../utils/types.h"
#include <utils/types.h>
#define IRQ_MAX_HANDLERS 16

View file

@ -14,9 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../soc/kfuse.h"
#include "../soc/clock.h"
#include "../soc/t210.h"
#include <soc/kfuse.h>
#include <soc/clock.h>
#include <soc/t210.h>
int kfuse_wait_ready()
{

View file

@ -17,7 +17,7 @@
#ifndef _KFUSE_H_
#define _KFUSE_H_
#include "../utils/types.h"
#include <utils/types.h>
#define KFUSE_STATE_SOFTRESET (1 << 31)
#define KFUSE_STATE_STOP (1 << 25)

View file

@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../soc/pinmux.h"
#include "../soc/t210.h"
#include <soc/pinmux.h>
#include <soc/t210.h>
void pinmux_config_uart(u32 idx)
{

View file

@ -17,7 +17,7 @@
#ifndef _PINMUX_H_
#define _PINMUX_H_
#include "../utils/types.h"
#include <utils/types.h>
/*! APB MISC registers. */
#define APB_MISC_GP_SDMMC1_CLK_LPBK_CONTROL 0x8D4

View file

@ -14,7 +14,7 @@
#ifndef _TEGRA210_PMC_H_
#define _TEGRA210_PMC_H_
#include "../utils/types.h"
#include <utils/types.h>
struct tegra_pmc_regs
{

View file

@ -17,7 +17,7 @@
#ifndef _T210_H_
#define _T210_H_
#include "../utils/types.h"
#include <utils/types.h>
#define BOOTROM_BASE 0x100000
#define IRAM_BASE 0x40000000
@ -162,6 +162,8 @@
#define APB_MISC_PP_STRAPPING_OPT_A 0x08
#define APB_MISC_PP_PINMUX_GLOBAL 0x40
#define APB_MISC_GP_HIDREV 0x804
#define GP_HIDREV_MAJOR_T210 0x1
#define GP_HIDREV_MAJOR_T210B01 0x2
#define APB_MISC_GP_AUD_MCLK_CFGPADCTRL 0x8F4
#define APB_MISC_GP_LCD_BL_PWM_CFGPADCTRL 0xA34
#define APB_MISC_GP_SDMMC1_PAD_CFGPADCTRL 0xA98

View file

@ -15,10 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../soc/uart.h"
#include "../soc/clock.h"
#include "../soc/t210.h"
#include "../utils/util.h"
#include <soc/uart.h>
#include <soc/clock.h>
#include <soc/t210.h>
#include <utils/util.h>
/* UART A, B, C, D and E. */
static const u32 uart_baseoff[5] = { 0, 0x40, 0x200, 0x300, 0x400 };

View file

@ -18,7 +18,7 @@
#ifndef _UART_H_
#define _UART_H_
#include "../utils/types.h"
#include <utils/types.h>
#define UART_A 0
#define UART_B 1

View file

@ -18,7 +18,7 @@
#ifndef MBR_GPT_H
#define MBR_GPT_H
#include "../utils/types.h"
#include <utils/types.h>
typedef struct _mbr_chs_t
{

View file

@ -18,9 +18,9 @@
#ifndef NX_SD_H
#define NX_SD_H
#include "sdmmc.h"
#include "sdmmc_driver.h"
#include "../libs/fatfs/ff.h"
#include <storage/sdmmc.h>
#include <storage/sdmmc_driver.h>
#include <libs/fatfs/ff.h>
enum
{

View file

@ -19,10 +19,10 @@
#include <string.h>
#include "ramdisk.h"
#include "../mem/heap.h"
#include "../utils/types.h"
#include <mem/heap.h>
#include <utils/types.h>
#include "../../../common/memory_map.h"
#include <memory_map.h>
int ram_disk_init(FATFS *ram_fs)
{

View file

@ -19,7 +19,7 @@
#ifndef RAM_DISK_H
#define RAM_DISK_H
#include "../libs/fatfs/ff.h"
#include <libs/fatfs/ff.h>
#define RAMDISK_CLUSTER_SZ 32768

View file

@ -16,14 +16,14 @@
*/
#include <string.h>
#include "sdmmc.h"
#include "mmc.h"
#include "nx_sd.h"
#include "sd.h"
#include "../../common/memory_map.h"
#include "../gfx/gfx.h"
#include "../mem/heap.h"
#include "../utils/util.h"
#include <storage/sdmmc.h>
#include <storage/mmc.h>
#include <storage/nx_sd.h>
#include <storage/sd.h>
#include <memory_map.h>
#include <gfx_utils.h>
#include <mem/heap.h>
#include <utils/util.h>
//#define DPRINTF(...) gfx_printf(__VA_ARGS__)
#define DPRINTF(...)

View file

@ -18,8 +18,8 @@
#ifndef _SDMMC_H_
#define _SDMMC_H_
#include "../utils/types.h"
#include "sdmmc_driver.h"
#include <utils/types.h>
#include <storage/sdmmc_driver.h>
extern u32 sd_power_cycle_time_start;

View file

@ -17,17 +17,17 @@
#include <string.h>
#include "mmc.h"
#include "sdmmc.h"
#include "../gfx/gfx.h"
#include "../power/max7762x.h"
#include "../soc/bpmp.h"
#include "../soc/clock.h"
#include "../soc/gpio.h"
#include "../soc/pinmux.h"
#include "../soc/pmc.h"
#include "../soc/t210.h"
#include "../utils/util.h"
#include <storage/mmc.h>
#include <storage/sdmmc.h>
#include <gfx_utils.h>
#include <power/max7762x.h>
#include <soc/bpmp.h>
#include <soc/clock.h>
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/pmc.h>
#include <soc/t210.h>
#include <utils/util.h>
//#define DPRINTF(...) gfx_printf(__VA_ARGS__)
//#define ERROR_EXTRA_PRINTING

View file

@ -18,8 +18,8 @@
#ifndef _SDMMC_DRIVER_H_
#define _SDMMC_DRIVER_H_
#include "../utils/types.h"
#include "sdmmc_t210.h"
#include <utils/types.h>
#include <storage/sdmmc_t210.h>
/*! SDMMC controller IDs. */
#define SDMMC_1 0

View file

@ -18,7 +18,7 @@
#ifndef _SDMMC_T210_H_
#define _SDMMC_T210_H_
#include "../utils/types.h"
#include <utils/types.h>
#define TEGRA_MMC_VNDR_TUN_CTRL0_TAP_VAL_UPDATED_BY_HW 0x20000
#define TEGRA_MMC_DLLCAL_CFG_EN_CALIBRATE 0x80000000

View file

@ -16,12 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "fan.h"
#include "../power/regulator_5v.h"
#include "../soc/gpio.h"
#include "../soc/pinmux.h"
#include "../soc/t210.h"
#include "../utils/util.h"
#include <thermal/fan.h>
#include <power/regulator_5v.h>
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/t210.h>
#include <utils/util.h>
void set_fan_duty(u32 duty)
{

View file

@ -19,7 +19,7 @@
#ifndef __FAN_H_
#define __FAN_H_
#include "../utils/types.h"
#include <utils/types.h>
// Disable: 0 (0 RPM), min duty: 1 (960 RPM), max duty 235 (11000 RPM).
void set_fan_duty(u32 duty);

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tmp451.h"
#include "../soc/i2c.h"
#include <soc/i2c.h>
#include <thermal/tmp451.h>
u16 tmp451_get_soc_temp(bool intenger)
{

View file

@ -19,7 +19,7 @@
#ifndef __TMP451_H_
#define __TMP451_H_
#include "../utils/types.h"
#include <utils/types.h>
#define TMP451_I2C_ADDR 0x4C

View file

@ -19,7 +19,7 @@
#ifndef _USB_DESCRIPTORS_H_
#define _USB_DESCRIPTORS_H_
#include "../utils/types.h"
#include <utils/types.h>
typedef enum {
USB_DESCRIPTOR_DEVICE = 1,

View file

@ -18,13 +18,13 @@
#include <string.h>
#include "usbd.h"
#include "../gfx/gfx.h"
#include "../input/joycon.h"
#include "../input/touch.h"
#include "../utils/util.h"
#include <usb/usbd.h>
#include <gfx_utils.h>
#include <input/joycon.h>
#include <input/touch.h>
#include <utils/util.h>
#include "../../../common/memory_map.h"
#include <memory_map.h>
//#define DPRINTF(...) gfx_printf(__VA_ARGS__)
#define DPRINTF(...)

View file

@ -21,16 +21,16 @@
#include <string.h>
#include "usbd.h"
#include "../gfx/gfx.h"
#include "../storage/nx_sd.h"
#include "../storage/sdmmc.h"
#include "../storage/sdmmc_driver.h"
#include "../utils/btn.h"
#include "../utils/sprintf.h"
#include "../utils/util.h"
#include <usb/usbd.h>
#include <gfx_utils.h>
#include <storage/nx_sd.h>
#include <storage/sdmmc.h>
#include <storage/sdmmc_driver.h>
#include <utils/btn.h>
#include <utils/sprintf.h>
#include <utils/util.h>
#include "../../../common/memory_map.h"
#include <memory_map.h>
//#define DPRINTF(...) gfx_printf(__VA_ARGS__)
#define DPRINTF(...)

View file

@ -19,7 +19,7 @@
#ifndef _USB_T210_H_
#define _USB_T210_H_
#include "../utils/types.h"
#include <utils/types.h>
/* General USB registers */
#define USB1_IF_USB_SUSP_CTRL 0x400

View file

@ -19,22 +19,22 @@
#include <string.h>
#include <stdlib.h>
#include "usbd.h"
#include "usb_descriptors.h"
#include "usb_t210.h"
#include <usb/usbd.h>
#include <usb/usb_descriptors.h>
#include <usb/usb_t210.h>
#include "../gfx/gfx.h"
#include "../soc/bpmp.h"
#include "../soc/clock.h"
#include "../soc/fuse.h"
#include "../soc/gpio.h"
#include "../soc/pinmux.h"
#include "../soc/pmc.h"
#include "../soc/t210.h"
#include "../utils/btn.h"
#include "../utils/util.h"
#include <gfx_utils.h>
#include <soc/bpmp.h>
#include <soc/clock.h>
#include <soc/fuse.h>
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/pmc.h>
#include <soc/t210.h>
#include <utils/btn.h>
#include <utils/util.h>
#include "../../../common/memory_map.h"
#include <memory_map.h>
typedef enum
{

View file

@ -19,7 +19,7 @@
#ifndef _USB_H_
#define _USB_H_
#include "../utils/types.h"
#include <utils/types.h>
#define USB_TD_BUFFER_PAGE_SIZE 0x1000
#define USB_TD_BUFFER_MAX_SIZE (USB_TD_BUFFER_PAGE_SIZE * 4)

Some files were not shown because too many files have changed in this diff Show more