GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
|
||||
# Lokesh Vutla <lokeshvutla@ti.com>
|
||||
|
||||
choice
|
||||
prompt "K3 J721E based boards"
|
||||
optional
|
||||
|
||||
config TARGET_J721E_A72_EVM
|
||||
bool "TI K3 based J721E EVM running on A72"
|
||||
select ARM64
|
||||
select SOC_K3_J721E
|
||||
select SYS_DISABLE_DCACHE_OPS
|
||||
|
||||
config TARGET_J721E_R5_EVM
|
||||
bool "TI K3 based J721E EVM running on R5"
|
||||
select CPU_V7R
|
||||
select SYS_THUMB_BUILD
|
||||
select SOC_K3_J721E
|
||||
select K3_LOAD_SYSFW
|
||||
select RAM
|
||||
select SPL_RAM
|
||||
select K3_J721E_DDRSS
|
||||
imply SYS_K3_SPL_ATF
|
||||
|
||||
endchoice
|
||||
|
||||
if TARGET_J721E_A72_EVM
|
||||
|
||||
config SYS_BOARD
|
||||
default "j721e"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "ti"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "j721e_evm"
|
||||
|
||||
endif
|
||||
|
||||
if TARGET_J721E_R5_EVM
|
||||
|
||||
config SYS_BOARD
|
||||
default "j721e"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "ti"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "j721e_evm"
|
||||
|
||||
config SPL_LDSCRIPT
|
||||
default "arch/arm/mach-omap2/u-boot-spl.lds"
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,7 @@
|
||||
J721E BOARD
|
||||
M: Lokesh Vutla <lokeshvutla@ti.com>
|
||||
S: Maintained
|
||||
F: board/ti/j721e
|
||||
F: include/configs/j721e_evm.h
|
||||
F: configs/j721e_evm_r5_defconfig
|
||||
F: configs/j721e_evm_a72_defconfig
|
||||
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
|
||||
# Lokesh Vutla <lokeshvutla@ti.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += evm.o
|
||||
@@ -0,0 +1,227 @@
|
||||
Introduction:
|
||||
-------------
|
||||
The J721e family of SoCs are part of K3 Multicore SoC architecture platform
|
||||
targeting automotive applications. They are designed as a low power, high
|
||||
performance and highly integrated device architecture, adding significant
|
||||
enhancement on processing power, graphics capability, video and imaging
|
||||
processing, virtualization and coherent memory support.
|
||||
|
||||
The device is partitioned into three functional domains, each containing
|
||||
specific processing cores and peripherals:
|
||||
1. Wake-up (WKUP) domain:
|
||||
- Device Management and Security Controller (DMSC)
|
||||
2. Microcontroller (MCU) domain:
|
||||
- Dual Core ARM Cortex-R5F processor
|
||||
3. MAIN domain:
|
||||
- Dual core 64-bit ARM Cortex-A72
|
||||
- 2 x Dual cortex ARM Cortex-R5 subsystem
|
||||
- 2 x C66x Digital signal processor sub system
|
||||
- C71x Digital signal processor sub-system with MMA.
|
||||
|
||||
More info can be found in TRM: http://www.ti.com/lit/pdf/spruil1
|
||||
|
||||
Boot Flow:
|
||||
----------
|
||||
Boot flow is similar to that of AM65x SoC and extending it with remoteproc
|
||||
support. Below is the pictorial representation of boot flow:
|
||||
|
||||
+------------------------------------------------------------------------+-----------------------+
|
||||
| DMSC | MCU R5 | A72 | MAIN R5/C66x/C7x |
|
||||
+------------------------------------------------------------------------+-----------------------+
|
||||
| +--------+ | | | |
|
||||
| | Reset | | | | |
|
||||
| +--------+ | | | |
|
||||
| : | | | |
|
||||
| +--------+ | +-----------+ | | |
|
||||
| | *ROM* |----------|-->| Reset rls | | | |
|
||||
| +--------+ | +-----------+ | | |
|
||||
| | | | : | | |
|
||||
| | ROM | | : | | |
|
||||
| |services| | : | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | | *R5 ROM* | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | |<---------|---|Load and auth| | | |
|
||||
| | | | | tiboot3.bin | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | : | | |
|
||||
| | | | : | | |
|
||||
| | | | : | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | | *R5 SPL* | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | | Load | | | |
|
||||
| | | | | sysfw.itb | | | |
|
||||
| | Start | | +-------------+ | | |
|
||||
| | System |<---------|---| Start | | | |
|
||||
| |Firmware| | | SYSFW | | | |
|
||||
| +--------+ | +-------------+ | | |
|
||||
| : | | | | | |
|
||||
| +---------+ | | Load | | | |
|
||||
| | *SYSFW* | | | system | | | |
|
||||
| +---------+ | | Config data | | | |
|
||||
| | |<--------|---| | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | | DDR | | | |
|
||||
| | | | | config | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | | Load | | | |
|
||||
| | | | | tispl.bin | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | | Load R5 | | | |
|
||||
| | | | | firmware | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | |<--------|---| Start A72 | | | |
|
||||
| | | | | and jump to | | | |
|
||||
| | | | | next image | | | |
|
||||
| | | | +-------------+ | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | |---------|-----------------------|---->| Reset rls | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | DMSC | | | : | |
|
||||
| |Services | | | +-----------+ | |
|
||||
| | |<--------|-----------------------|---->|*ATF/OPTEE*| | |
|
||||
| | | | | +-----------+ | |
|
||||
| | | | | : | |
|
||||
| | | | | +-----------+ | |
|
||||
| | |<--------|-----------------------|---->| *A72 SPL* | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | | | | | Load | | |
|
||||
| | | | | | u-boot.img| | |
|
||||
| | | | | +-----------+ | |
|
||||
| | | | | : | |
|
||||
| | | | | +-----------+ | |
|
||||
| | |<--------|-----------------------|---->| *U-Boot* | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | | | | | prompt | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | | | | | Load R5 | | |
|
||||
| | | | | | Firmware | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | |<--------|-----------------------|-----| Start R5 | | +-----------+ |
|
||||
| | |---------|-----------------------|-----+-----------+-----|----->| R5 starts | |
|
||||
| | | | | | Load C6 | | +-----------+ |
|
||||
| | | | | | Firmware | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | |<--------|-----------------------|-----| Start C6 | | +-----------+ |
|
||||
| | |---------|-----------------------|-----+-----------+-----|----->| C6 starts | |
|
||||
| | | | | | Load C7 | | +-----------+ |
|
||||
| | | | | | Firmware | | |
|
||||
| | | | | +-----------+ | |
|
||||
| | |<--------|-----------------------|-----| Start C7 | | +-----------+ |
|
||||
| | |---------|-----------------------|-----+-----------+-----|----->| C7 starts | |
|
||||
| +---------+ | | | +-----------+ |
|
||||
| | | | |
|
||||
+------------------------------------------------------------------------+-----------------------+
|
||||
|
||||
- Here DMSC acts as master and provides all the critical services. R5/A72
|
||||
requests DMSC to get these services done as shown in the above diagram.
|
||||
|
||||
Sources:
|
||||
--------
|
||||
1. SYSFW:
|
||||
Tree: git://git.ti.com/processor-firmware/system-firmware-image-gen.git
|
||||
Branch: master
|
||||
|
||||
2. ATF:
|
||||
Tree: https://github.com/ARM-software/arm-trusted-firmware.git
|
||||
Branch: master
|
||||
|
||||
3. OPTEE:
|
||||
Tree: https://github.com/OP-TEE/optee_os.git
|
||||
Branch: master
|
||||
|
||||
4. U-Boot:
|
||||
Tree: https://gitlab.denx.de/u-boot/u-boot
|
||||
Branch: master
|
||||
|
||||
Build procedure:
|
||||
----------------
|
||||
1. SYSFW:
|
||||
$ make CROSS_COMPILE=arm-linux-gnueabihf-
|
||||
|
||||
2. ATF:
|
||||
$ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed
|
||||
|
||||
3. OPTEE:
|
||||
$ make PLATFORM=k3-j721e CFG_ARM64_core=y
|
||||
|
||||
4. U-Boot:
|
||||
|
||||
4.1. R5:
|
||||
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- j721e_evm_r5_defconfig O=/tmp/r5
|
||||
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=/tmp/r5
|
||||
|
||||
4.2. A72:
|
||||
$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- j721e_evm_a72_defconfig O=/tmp/a72
|
||||
$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- ATF=<path to ATF dir>/build/k3/generic/release/bl31.bin TEE=<path to OPTEE OS dir>/out/arm-plat-k3/core/tee-pager.bin O=/tmp/a72
|
||||
|
||||
Target Images
|
||||
--------------
|
||||
Copy the below images to an SD card and boot:
|
||||
- sysfw.itb from step 1
|
||||
- tiboot3.bin from step 4.1
|
||||
- tispl.bin, u-boot.img from 4.2
|
||||
|
||||
Image formats:
|
||||
--------------
|
||||
|
||||
- tiboot3.bin:
|
||||
+-----------------------+
|
||||
| X.509 |
|
||||
| Certificate |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | R5 | |
|
||||
| | u-boot-spl.bin | |
|
||||
| | | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | FIT header | |
|
||||
| | +---------------+ | |
|
||||
| | | | | |
|
||||
| | | DTB 1...N | | |
|
||||
| | +---------------+ | |
|
||||
| +-------------------+ |
|
||||
+-----------------------+
|
||||
|
||||
- tispl.bin
|
||||
+-----------------------+
|
||||
| |
|
||||
| FIT HEADER |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | A72 ATF | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | A72 OPTEE | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | A72 SPL | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | SPL DTB 1...N | |
|
||||
| +-------------------+ |
|
||||
+-----------------------+
|
||||
|
||||
- sysfw.itb
|
||||
+-----------------------+
|
||||
| |
|
||||
| FIT HEADER |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | sysfw.bin | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | board config | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | PM config | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | RM config | |
|
||||
| +-------------------+ |
|
||||
| | | |
|
||||
| | Secure config | |
|
||||
| +-------------------+ |
|
||||
+-----------------------+
|
||||
@@ -0,0 +1,83 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Board specific initialization for J721E EVM
|
||||
*
|
||||
* Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
|
||||
* Lokesh Vutla <lokeshvutla@ti.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <asm/io.h>
|
||||
#include <spl.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
#ifdef CONFIG_PHYS_64BIT
|
||||
gd->ram_size = 0x100000000;
|
||||
#else
|
||||
gd->ram_size = 0x80000000;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ulong board_get_usable_ram_top(ulong total_size)
|
||||
{
|
||||
#ifdef CONFIG_PHYS_64BIT
|
||||
/* Limit RAM used by U-Boot to the DDR low region */
|
||||
if (gd->ram_top > 0x100000000)
|
||||
return 0x100000000;
|
||||
#endif
|
||||
|
||||
return gd->ram_top;
|
||||
}
|
||||
|
||||
int dram_init_banksize(void)
|
||||
{
|
||||
/* Bank 0 declares the memory available in the DDR low region */
|
||||
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
|
||||
gd->bd->bi_dram[0].size = 0x80000000;
|
||||
gd->ram_size = 0x80000000;
|
||||
|
||||
#ifdef CONFIG_PHYS_64BIT
|
||||
/* Bank 1 declares the memory available in the DDR high region */
|
||||
gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE1;
|
||||
gd->bd->bi_dram[1].size = 0x80000000;
|
||||
gd->ram_size = 0x100000000;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_LOAD_FIT
|
||||
int board_fit_config_name_match(const char *name)
|
||||
{
|
||||
if (!strcmp(name, "k3-j721e-common-proc-board"))
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
|
||||
int ft_board_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", "sram@70000000");
|
||||
if (ret)
|
||||
printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user