Commit 0911d952631df97e5b69d816cceebcbccbca34cf

Authored by Lokesh Vutla
Committed by Tom Rini
1 parent 3980b16137

board: ti: am654: a53: Add initial support for am654

Add initial support for AM654 based EVM running on A53. Enable
4GB of DDR available on the EVM so that kernel DTB file
can be updated accordingly.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[Andreas: Added 4GB ddr support]
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>

Showing 7 changed files with 273 additions and 0 deletions Side-by-side Diff

arch/arm/mach-k3/Kconfig
... ... @@ -47,5 +47,6 @@
47 47 Address at which ROM stores the value which determines if SPL
48 48 is booted up by primary boot media or secondary boot media.
49 49  
  50 +source "board/ti/am65x/Kconfig"
50 51 endif
board/ti/am65x/Kconfig
  1 +# SPDX-License-Identifier: GPL-2.0+
  2 +#
  3 +# Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
  4 +# Lokesh Vutla <lokeshvutla@ti.com>
  5 +
  6 +choice
  7 + prompt "K3 AM65 based boards"
  8 + optional
  9 +
  10 +config TARGET_AM654_A53_EVM
  11 + bool "TI K3 based AM654 EVM running on A53"
  12 + select ARM64
  13 + select SOC_K3_AM6
  14 +
  15 +endchoice
  16 +
  17 +if TARGET_AM654_A53_EVM
  18 +
  19 +config SYS_BOARD
  20 + default "am65x"
  21 +
  22 +config SYS_VENDOR
  23 + default "ti"
  24 +
  25 +config SYS_CONFIG_NAME
  26 + default "am65x_evm"
  27 +
  28 +endif
board/ti/am65x/MAINTAINERS
  1 +AM65x BOARD
  2 +M: Lokesh Vutla <lokeshvutla@ti.com>
  3 +S: Maintained
  4 +F: board/ti/am65x/
  5 +F: include/configs/am65x_evm.h
board/ti/am65x/Makefile
  1 +#
  2 +# Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
  3 +# Lokesh Vutla <lokeshvutla@ti.com>
  4 +#
  5 +# SPDX-License-Identifier: GPL-2.0+
  6 +#
  7 +
  8 +obj-y := evm.o
board/ti/am65x/README
  1 +Introduction:
  2 +-------------
  3 +The AM65x family of SoCs is the first device family from K3 Multicore
  4 +SoC architecture, targeted for broad market and industrial control with
  5 +aim to meet the complex processing needs of modern embedded products.
  6 +
  7 +The device is built over three domains, each containing specific processing
  8 +cores, voltage domains and peripherals:
  9 +1. Wake-up (WKUP) domain:
  10 + - Device Management and Security Controller (DMSC)
  11 +2. Microcontroller (MCU) domain:
  12 + - Dual Core ARM Cortex-R5F processor
  13 +3. MAIN domain:
  14 + - Quad core 64-bit ARM Cortex-A53
  15 +
  16 +More info can be found in TRM: http://www.ti.com/lit/pdf/spruid7
  17 +
  18 +Boot Flow:
  19 +----------
  20 +On AM65x family devices, ROM supports boot only via MCU(R5). This means that
  21 +bootloader has to run on R5 core. In order to meet this constraint, and for
  22 +the following reasons the boot flow is designed as mentioned:
  23 +1. Need to move away from R5 asap, so that we want to start *any*
  24 +firmware on the r5 cores like.... autosar can be loaded to receive CAN
  25 +response and other safety operations to be started. This operation is
  26 +very time critical and is applicable for all automotive use cases.
  27 +2. U-Boot on A53 should start other remotecores for various
  28 +applications. This should happen before running Linux.
  29 +3. In production boot flow, we might not like to use full u-boot,
  30 +instead use Flacon boot flow to reduce boot time.
  31 +
  32 ++------------------------------------------------------------------------+
  33 +| DMSC | R5 | A53 |
  34 ++------------------------------------------------------------------------+
  35 +| +--------+ | | |
  36 +| | Reset | | | |
  37 +| +--------+ | | |
  38 +| : | | |
  39 +| +--------+ | +-----------+ | |
  40 +| | *rom* |----------|-->| Reset rls | | |
  41 +| +--------+ | +-----------+ | |
  42 +| | | | : | |
  43 +| | rom | | : | |
  44 +| |services| | : | |
  45 +| | | | +-------------+ | |
  46 +| | | | | *R5 rom* | | |
  47 +| | | | +-------------+ | |
  48 +| | |<---------|---|Load and auth| | |
  49 +| | | | | tiboot3.bin | | |
  50 +| | | | +-------------+ | |
  51 +| | | | : | |
  52 +| | | | : | |
  53 +| | | | : | |
  54 +| | | | +-------------+ | |
  55 +| | Start | | | *R5 SPL* | | |
  56 +| | System | | +-------------+ | |
  57 +| |Firmware|<---------|---|Load and auth| | |
  58 +| +--------+ | | sysfw bin | | |
  59 +| : | +-------------+ | |
  60 +| +---------+ | | DDR | | |
  61 +| | *SYSFW* | | | config | | |
  62 +| +---------+ | +-------------+ | |
  63 +| | |<--------|---| Load | | |
  64 +| | | | | tispl.bin | | |
  65 +| | | | +-------------+ | |
  66 +| | |<--------|---| Start A53 | | |
  67 +| | | | | and Reset | | |
  68 +| | | | +-------------+ | |
  69 +| | | | | +-----------+ |
  70 +| | |---------|-----------------------|---->| Reset rls | |
  71 +| | | | | +-----------+ |
  72 +| | DMSC | | | : |
  73 +| |Services | | | +-----------+ |
  74 +| | |<--------|-----------------------|---->|*ATF/OPTEE*| |
  75 +| | | | | +-----------+ |
  76 +| | | | | : |
  77 +| | | | | +-----------+ |
  78 +| | |<--------|-----------------------|---->| *A53 SPL* | |
  79 +| | | | | +-----------+ |
  80 +| | | | | | Load | |
  81 +| | | | | | u-boot.img| |
  82 +| | | | | +-----------+ |
  83 +| | | | | : |
  84 +| | | | | +-----------+ |
  85 +| | |<--------|-----------------------|---->| *u-boot* | |
  86 +| | | | | +-----------+ |
  87 +| | | | | | prompt | |
  88 +| | | | | +-----------+ |
  89 +| +---------+ | | |
  90 +| | | |
  91 ++------------------------------------------------------------------------+
  92 +
  93 +- Here DMSC acts as master and provides all the critical services. R5/A53
  94 +requests DMSC to get these services done as shown in the above diagram.
  95 +
  96 +Sources:
  97 +--------
  98 +1. SYSFW:
  99 + System Firmware repo is closed source and the binaries are delivered
  100 + to users with NDA. Please contact TI to get the System Firmware
  101 + Binary named ti-sci-firmware-am6x.bin that runs on AM65x SoC.
  102 +
  103 +2. ATF:
  104 + Tree: https://github.com/ARM-software/arm-trusted-firmware.git
  105 + Branch: master
  106 +
  107 +3. OPTEE:
  108 + Tree: https://github.com/OP-TEE/optee_os.git
  109 + Branch: master
  110 +
  111 +4. U-Boot:
  112 + Tree: http://git.denx.de/u-boot.git
  113 + Branch: master
  114 +
  115 +Build procedure:
  116 +----------------
  117 +1. SYSFW:
  118 + ROM expects a signed binary that contains the X509 certificate. So
  119 +the binary ti-sci-firmware-am6x.bin cannot be uses as-is and needs to be signed.
  120 +Contact TI on the procedure to sign the system firmware binary.
  121 +
  122 +2. ATF:
  123 +$ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed
  124 +
  125 +3. OPTEE:
  126 +$ make PLATFORM=k3-am65x CFG_ARM64_core=y
  127 +
  128 +4. U-Boot:
  129 +
  130 +4.1. R5:
  131 + TBD.
  132 +
  133 +4.2. A53:
  134 +$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- am65x_evm_a53_defconfig O=/tmp/a53
  135 +$ 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/a53
  136 +
  137 +Target Images
  138 +--------------
  139 +Copy the below images to an SD card and boot:
  140 +- tiboot3.bin from step 4.1
  141 +- tispl.bin, u-boot.img from 4.2
board/ti/am65x/evm.c
  1 +// SPDX-License-Identifier: GPL-2.0+
  2 +/*
  3 + * Board specific initialization for AM654 EVM
  4 + *
  5 + * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
  6 + * Lokesh Vutla <lokeshvutla@ti.com>
  7 + *
  8 + */
  9 +
  10 +#include <common.h>
  11 +#include <asm/io.h>
  12 +#include <spl.h>
  13 +
  14 +DECLARE_GLOBAL_DATA_PTR;
  15 +
  16 +int board_init(void)
  17 +{
  18 + return 0;
  19 +}
  20 +
  21 +int dram_init(void)
  22 +{
  23 +#ifdef CONFIG_PHYS_64BIT
  24 + gd->ram_size = 0x100000000;
  25 +#else
  26 + gd->ram_size = 0x80000000;
  27 +#endif
  28 +
  29 + return 0;
  30 +}
  31 +
  32 +ulong board_get_usable_ram_top(ulong total_size)
  33 +{
  34 +#ifdef CONFIG_PHYS_64BIT
  35 + /* Limit RAM used by U-Boot to the DDR low region */
  36 + if (gd->ram_top > 0x100000000)
  37 + return 0x100000000;
  38 +#endif
  39 +
  40 + return gd->ram_top;
  41 +}
  42 +
  43 +int dram_init_banksize(void)
  44 +{
  45 + /* Bank 0 declares the memory available in the DDR low region */
  46 + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  47 + gd->bd->bi_dram[0].size = 0x80000000;
  48 +
  49 +#ifdef CONFIG_PHYS_64BIT
  50 + /* Bank 1 declares the memory available in the DDR high region */
  51 + gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE1;
  52 + gd->bd->bi_dram[1].size = 0x80000000;
  53 +#endif
  54 +
  55 + return 0;
  56 +}
include/configs/am65x_evm.h
  1 +/* SPDX-License-Identifier: GPL-2.0+ */
  2 +/*
  3 + * Configuration header file for K3 AM654 EVM
  4 + *
  5 + * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
  6 + * Lokesh Vutla <lokeshvutla@ti.com>
  7 + */
  8 +
  9 +#ifndef __CONFIG_AM654_EVM_H
  10 +#define __CONFIG_AM654_EVM_H
  11 +
  12 +#include <linux/sizes.h>
  13 +#include <config_distro_bootcmd.h>
  14 +
  15 +#define CONFIG_ENV_SIZE (128 << 10)
  16 +
  17 +/* DDR Configuration */
  18 +#define CONFIG_SYS_SDRAM_BASE1 0x880000000
  19 +
  20 +/* SPL Loader Configuration */
  21 +#ifdef CONFIG_TARGET_AM654_A53_EVM
  22 +#define CONFIG_SPL_TEXT_BASE 0x80080000
  23 +#endif
  24 +
  25 +#define CONFIG_SKIP_LOWLEVEL_INIT
  26 +
  27 +#define CONFIG_SPL_MAX_SIZE CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
  28 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \
  29 + CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4)
  30 +
  31 +/* Now for the remaining common defines */
  32 +#include <configs/ti_armv7_common.h>
  33 +
  34 +#endif /* __CONFIG_AM654_EVM_H */