Initial support Texas Instrument's AM654 Platform
Subsystems (3)
PATCH v2 1/3 Initial support Texas Instrument's AM654 Platform
The AM654 SoC is a lead device of the K3 Multicore SoC architecture platform, targeted for broad market and industrial control with aim to meet the complex processing needs of modern embedded products.
The device is partitioned into three functional domains, each containing specific processing cores and peripherals:
Some highlights in each domain are:
- MAIN Domain:
--------------
* Quad ARMv8 A53 cores split over two clusters
* GICv3 compliant GIC500
* Configurable L3 Cache and IO-coherent architecture
* DDR Subsystem (DDRSS) with Error Correcting Code (ECC)
* Three Gigabit Industrial Communication Subsystems (ICSSG), each with dual PRUs and dual RTUs
* Hardware accelerator block containing AES/DES/SHA/MD5 called SA2UL
* eQEP/eCAP, eHRPWM.
* Multimedia capability with CAL, DSS7-UL, SGX544, McASP
* Peripheral connectivity including USB3, PCIE, MMC/SD, GPMC, I2C, SPI, GPIO
- MCU Domain:
-------------
* Dual lock-step capable R5F uC for safety-critical applications
* Flash subsystem with OSPI and Hyperbus interfaces
* High data throughput capable distributed DMA architecture under MCU NAVSS
* Dual ADCSS, Dual CAN-FD.
- WKUP Domain:
--------------
* Centralized System Controller for Security, Power, and Resource management.
For further deails see AM65x Technical Reference Manual (SPRUID7, April 2018):
http://www.ti.com/lit/pdf/spruid7
This is a complex SoC and the support to add this SoC is very huge. So I tried to split into 3 separate series:
[1/3] Adding base SoC support
[2/3] Base drivers that allow minimal boot.
[3/3] EVM support with dts and defconfig changes.
This series adds base SoC support. The rest of the two series will be a follow up of this series.
On AM65x family devices, ROM supports boot only via MCU(R5). This means that bootloader has to run on R5 core. In order to meet this constraint, keeping safety in picture and to have faster boot time, the software boot architecture is designed as: https://pastebin.ubuntu.com/p/NxSvDbMtSk/
Any feedback is highly appreciated.
Changes since v1:
-----------------
- Enabled OMAP_SERIAL by default for ARCH_K3
- Update SoC specific Kconfig entries so that user cannot configure them.
- Appended the kconfig symbols with SYS_K3_
- Removed #define ing the macoro inside __get_backup_bootmedia() function.
- Added/Updated SPDX tag
Andreas Dannenberg (1):
arm: K3: am654: Unlock control module registers during init
Lokesh Vutla (7):
arm: K3: Add initial support for TI's K3 generation of SoCs
arm: K3: Add support for AM654 SoC definition
arm: K3: Update _start instruction
arm: K3: am654: Add support for boot device detection
armv8: K3: am654: Add custom MMU support
armv8: K3: am654: Introduce FIT generator script
armv8: K3: am654: Add support for generating build targets
Kconfig | 2 +- MAINTAINERS | 1 + arch/arm/Kconfig | 8 ++ arch/arm/Makefile | 1 + arch/arm/include/asm/spl.h | 2 +- arch/arm/lib/vectors.S | 8 ++ arch/arm/mach-k3/Kconfig | 50 ++++++++ arch/arm/mach-k3/Makefile | 7 ++ arch/arm/mach-k3/am6_init.c | 126 +++++++++++++++++++ arch/arm/mach-k3/arm64-mmu.c | 45 +++++++ arch/arm/mach-k3/config.mk | 19 +++ arch/arm/mach-k3/include/mach/am6_hardware.h | 44 +++++++ arch/arm/mach-k3/include/mach/am6_spl.h | 36 ++++++ arch/arm/mach-k3/include/mach/clock.h | 16 +++ arch/arm/mach-k3/include/mach/hardware.h | 12 ++ arch/arm/mach-k3/include/mach/spl.h | 12 ++ common/spl/Kconfig | 2 +- drivers/serial/Kconfig | 2 +- scripts/Makefile.spl | 9 ++ tools/k3_fit_atf.sh | 99 +++++++++++++++ 20 files changed, 497 insertions(+), 4 deletions(-) create mode 100644 arch/arm/mach-k3/Kconfig create mode 100644 arch/arm/mach-k3/Makefile create mode 100644 arch/arm/mach-k3/am6_init.c create mode 100644 arch/arm/mach-k3/arm64-mmu.c create mode 100644 arch/arm/mach-k3/config.mk create mode 100644 arch/arm/mach-k3/include/mach/am6_hardware.h create mode 100644 arch/arm/mach-k3/include/mach/am6_spl.h create mode 100644 arch/arm/mach-k3/include/mach/clock.h create mode 100644 arch/arm/mach-k3/include/mach/hardware.h create mode 100644 arch/arm/mach-k3/include/mach/spl.h create mode 100755 tools/k3_fit_atf.sh
Signature · 1 line
2.18.0
PATCH v2 1/8 arm: K3: Add initial support for TI's K3 generation of SoCs
Add support for Texas Instruments' K3 Generation Processor families.
--- Kconfig | 2 +- MAINTAINERS | 1 + arch/arm/Kconfig | 8 ++++++++ arch/arm/Makefile | 1 + arch/arm/mach-k3/Kconfig | 12 ++++++++++++ common/spl/Kconfig | 2 +- drivers/serial/Kconfig | 2 +- 7 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-k3/Kconfig
Kconfig +1 -1
@@ -453,7 +453,7 @@ config SYS_EXTRA_OPTIONS config SYS_TEXT_BASE depends on !NIOS2 && !XTENSA depends on !EFI_APP - default 0x80800000 if ARCH_OMAP2PLUS + default 0x80800000 if ARCH_OMAP2PLUS || ARCH_K3 default 0x4a000000 if ARCH_SUNXI && !MACH_SUN9I && !MACH_SUN8I_V3S default 0x2a000000 if ARCH_SUNXI && MACH_SUN9I default 0x42e00000 if ARCH_SUNXI && MACH_SUN8I_V3S
MAINTAINERS +1 -0
@@ -272,6 +272,7 @@ M: Tom Rini <[email protected]> S: Maintained T: git git://git.denx.de/u-boot-ti.git F: arch/arm/mach-davinci/ +F: arch/arm/mach-k3/ F: arch/arm/mach-keystone/ F: arch/arm/include/asm/arch-omap*/ F: arch/arm/include/asm/ti-common/
arch/arm/Kconfig +8 -0
@@ -646,6 +646,12 @@ config ARCH_KEYSTONE imply CMD_SAVES imply FIT +config ARCH_K3 + bool "Texas Instruments' K3 Architecture" + select SPL + select SUPPORT_SPL + select FIT + config ARCH_OMAP2PLUS bool "TI OMAP2+" select CPU_V7A
@@ -1377,6 +1383,8 @@ source "arch/arm/mach-highbank/Kconfig" source "arch/arm/mach-integrator/Kconfig" +source "arch/arm/mach-k3/Kconfig" + source "arch/arm/mach-keystone/Kconfig" source "arch/arm/mach-kirkwood/Kconfig"
arch/arm/Makefile +1 -0
@@ -58,6 +58,7 @@ machine-$(CONFIG_ARCH_BCMSTB) += bcmstb machine-$(CONFIG_ARCH_DAVINCI) += davinci machine-$(CONFIG_ARCH_EXYNOS) += exynos machine-$(CONFIG_ARCH_HIGHBANK) += highbank +machine-$(CONFIG_ARCH_K3) += k3 machine-$(CONFIG_ARCH_KEYSTONE) += keystone # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD machine-$(CONFIG_KIRKWOOD) += kirkwood
arch/arm/mach-k3/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if ARCH_K3 + +choice + prompt "Texas Instruments' K3 based SoC select" + optional + +endchoice + +config SYS_SOC + default "k3" + +endif
common/spl/Kconfig +1 -1
@@ -171,7 +171,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR default 0x140 if ARCH_MVEBU default 0x200 if ARCH_SOCFPGA || ARCH_AT91 default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \ - OMAP54XX || AM33XX || AM43XX + OMAP54XX || AM33XX || AM43XX || ARCH_K3 default 0x4000 if ARCH_ROCKCHIP help Address on the MMC to load U-Boot from, when the MMC is being used
drivers/serial/Kconfig +1 -1
@@ -628,7 +628,7 @@ config MSM_SERIAL config OMAP_SERIAL bool "Support for OMAP specific UART" depends on DM_SERIAL - default y if ARCH_OMAP2PLUS + default y if (ARCH_OMAP2PLUS || ARCH_K3) select SYS_NS16550 help If you have an TI based SoC and want to use the on-chip serial
Signature · 1 line
2.18.0
PATCH v2 1/8 arm: K3: Add initial support for TI's K3 generation of SoCs
Quoted 4 lines · Lokesh Vutla
Add support for Texas Instruments' K3 Generation Processor families.
Signed-off-by Lokesh Vutla <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180827/24f9b999/attachment.sig>
PATCH v2 1/8 arm: K3: Add initial support for TI's K3 generation of SoCs
In reply to Lokesh VutlaQuoted 5 lines · Lokesh Vutla
Add support for Texas Instruments' K3 Generation Processor families.
Signed-off-by Lokesh Vutla <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/8627b67e/attachment.sig>
PATCH v2 2/8 arm: K3: Add support for AM654 SoC definition
In reply to Lokesh VutlaThe AM654 device is designed for industrial automation and PLC controller class platforms among other applications. Introduce base support for AM654 SoC.
--- arch/arm/mach-k3/Kconfig | 31 ++++++++++++++++++++++++++ arch/arm/mach-k3/Makefile | 6 +++++ arch/arm/mach-k3/am6_init.c | 32 +++++++++++++++++++++++++++ arch/arm/mach-k3/include/mach/clock.h | 16 ++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 arch/arm/mach-k3/Makefile create mode 100644 arch/arm/mach-k3/am6_init.c create mode 100644 arch/arm/mach-k3/include/mach/clock.h
arch/arm/mach-k3/Kconfig +31 -0
@@ -4,9 +4,40 @@ choice prompt "Texas Instruments' K3 based SoC select" optional +config SOC_K3_AM6 + bool "TI's K3 based AM6 SoC Family Support" + endchoice config SYS_SOC default "k3" +config SYS_K3_NON_SECURE_MSRAM_SIZE + hex + default 0x80000 + help + Describes the total size of the MCU MSRAM. This doesn't + specify the total size of SPL as ROM can use some part + of this RAM. Once ROM gives control to SPL then this + complete size can be usable. + +config SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE + hex + default 0x58000 + help + Describes the maximum size of the image that ROM can download + from any boot media. + +config SYS_K3_MCU_SCRATCHPAD_BASE + hex + default 0x40280000 if SOC_K3_AM6 + help + Describes the base address of MCU Scratchpad RAM. + +config SYS_K3_MCU_SCRATCHPAD_SIZE + hex + default 0x200 if SOC_K3_AM6 + help + Describes the size of MCU Scratchpad RAM. + endif
arch/arm/mach-k3/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ +# Lokesh Vutla <[email protected]> + +obj-$(CONFIG_SOC_K3_AM6) += am6_init.o
arch/arm/mach-k3/am6_init.c new file +32 -0
@@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* K3: Architecture initialization +* +* Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ +* Lokesh Vutla <[email protected]> +*/ + +#include <common.h> +#include <spl.h> + +#ifdef CONFIG_SPL_BUILD +void board_init_f (ulong dummy) +{ +/* Init DM early in-order to invoke system controller */ +spl_early_init (); + +/* Prepare console output */ +preloader_console_init (); +} + +u32 spl_boot_device (void ) +{ +return BOOT_DEVICE_RAM ; +} +#endif + +#ifndef CONFIG_SYSRESET +void reset_cpu (ulong ignored) +{ +} +#endif
arch/arm/mach-k3/include/mach/clock.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* K3: Common SoC clock definitions. +* +* (C) Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ +*/ +#ifndef __ASM_ARCH_CLOCK_H +#define __ASM_ARCH_CLOCK_H + +#include <config.h> + +/* Clock Defines */ +#define V_OSCK 24000000 +#define V_SCLK V_OSCK + +#endif /* __ASM_ARCH_CLOCK_H */
Signature · 1 line
2.18.0
PATCH v2 2/8 arm: K3: Add support for AM654 SoC definition
Quoted 5 lines · Lokesh Vutla
The AM654 device is designed for industrial automation and PLC controller class platforms among other applications. Introduce base support for AM654 SoC.
Signed-off-by Lokesh Vutla <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180827/5f8f84cb/attachment.sig>
PATCH v2 2/8 arm: K3: Add support for AM654 SoC definition
In reply to Lokesh VutlaQuoted 6 lines · Lokesh Vutla
The AM654 device is designed for industrial automation and PLC controller class platforms among other applications. Introduce base support for AM654 SoC.
Signed-off-by Lokesh Vutla <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/15eaac24/attachment.sig>
PATCH v2 3/8 arm: K3: Update _start instruction
In reply to Lokesh VutlaOn K3 family SoCs, once the ROM loads image on R5, M3 resets R5 and expects to start executing from 0x0. In order to handle this ROM updates the boot vector of R5 such that first 64 bytes of image load address are mapped to 0x0.
In this case, it is SPL's responsibility to jump to the proper image location. So, update the PC with address of reset vector(like how other exception vectors are handled), instead of branching to reset.
--- arch/arm/lib/vectors.S | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/lib/vectors.S +8 -0
@@ -19,7 +19,11 @@ * for the non-boot0 case or by a boot0-header. */ .macro ARM_VECTORS +#ifdef CONFIG_ARCH_K3 + ldr pc, _reset +#else b reset +#endif ldr pc, _undefined_instruction ldr pc, _software_interrupt ldr pc, _prefetch_abort
@@ -94,6 +98,7 @@ _start: ************************************************************************* */ + .globl _reset .globl _undefined_instruction .globl _software_interrupt .globl _prefetch_abort
@@ -102,6 +107,9 @@ _start: .globl _irq .globl _fiq +#ifdef CONFIG_ARCH_K3 +_reset: .word reset +#endif _undefined_instruction: .word undefined_instruction _software_interrupt: .word software_interrupt _prefetch_abort: .word prefetch_abort
Signature · 1 line
2.18.0
PATCH v2 3/8 arm: K3: Update _start instruction
Quoted 11 lines · Lokesh Vutla
On K3 family SoCs, once the ROM loads image on R5, M3 resets R5 and expects to start executing from
0x0. In order to handle this ROM updates the boot vector of R5 such that first 64 bytes of image load address are mapped to0x0.In this case, it is SPL's responsibility to jump to the proper image location. So, update the PC with address of reset vector(like how other exception vectors are handled), instead of branching to reset.
Reviewed-by Tom Rini <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/b191e8e6/attachment.sig>
PATCH v2 4/8 arm: K3: am654: Add support for boot device detection
In reply to Lokesh VutlaAM654 allows for booting from primary or backup boot media. Both media can be chosen individually based on switch settings. ROM looks for a valid image in primary boot media, if not found then looks in backup boot media. In order to pass this boot media information to boot loader, ROM stores a value at a particular address. Add support for reading this information and determining the boot media correctly.
--- arch/arm/include/asm/spl.h | 2 +- arch/arm/mach-k3/Kconfig | 7 +++ arch/arm/mach-k3/am6_init.c | 58 +++++++++++++++++++- arch/arm/mach-k3/include/mach/am6_hardware.h | 23 ++++++++ arch/arm/mach-k3/include/mach/am6_spl.h | 36 ++++++++++++ arch/arm/mach-k3/include/mach/hardware.h | 12 ++++ arch/arm/mach-k3/include/mach/spl.h | 12 ++++ 7 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-k3/include/mach/am6_hardware.h create mode 100644 arch/arm/mach-k3/include/mach/am6_spl.h create mode 100644 arch/arm/mach-k3/include/mach/hardware.h create mode 100644 arch/arm/mach-k3/include/mach/spl.h
arch/arm/include/asm/spl.h +1 -1
@@ -8,7 +8,7 @@#if defined(CONFIG_ARCH_OMAP2PLUS ) \ || defined(CONFIG_EXYNOS4 ) || defined(CONFIG_EXYNOS5 ) \ - || defined(CONFIG_EXYNOS4210 ) + || defined(CONFIG_EXYNOS4210 ) || defined(CONFIG_ARCH_K3 )/* Platform-specific defines */ #include <asm/arch/spl.h>
arch/arm/mach-k3/Kconfig +7 -0
@@ -40,4 +40,11 @@ config SYS_K3_MCU_SCRATCHPAD_SIZE help Describes the size of MCU Scratchpad RAM. +config SYS_K3_BOOT_PARAM_TABLE_INDEX + hex + default 0x41c7fbfc if SOC_K3_AM6 + help + Address at which ROM stores the value which determines if SPL + is booted up by primary boot media or secondary boot media. + endif
arch/arm/mach-k3/am6_init.c +57 -1
78 lines not on this page · raw message
arch/arm/mach-k3/include/mach/am6_hardware.h new file +23 -0
@@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* K3: AM6 SoC definitions, structures etc. +* +* (C) Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ +*/ +#ifndef __ASM_ARCH_AM6_HARDWARE_H +#define __ASM_ARCH_AM6_HARDWARE_H + +#include <config.h> + +#define CTRL_MMR0_BASE 0x00100000 +#define CTRLMMR_MAIN_DEVSTAT (CTRL_MMR0_BASE + 0x30) + +#define CTRLMMR_MAIN_DEVSTAT_BOOTMODE_MASK GENMASK(3, 0) +#define CTRLMMR_MAIN_DEVSTAT_BOOTMODE_SHIFT 0 +#define CTRLMMR_MAIN_DEVSTAT_BKUP_BOOTMODE_MASK GENMASK(6, 4) +#define CTRLMMR_MAIN_DEVSTAT_BKUP_BOOTMODE_SHIFT 4 + +/* MCU SCRATCHPAD usage */ +#define K3_BOOT_PARAM_TABLE_INDEX_VAL CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE + +#endif /* __ASM_ARCH_AM6_HARDWARE_H */
arch/arm/mach-k3/include/mach/am6_spl.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ +* Lokesh Vutla <[email protected]> +*/ +#ifndef _ASM_ARCH_AM6_SPL_H_ +#define _ASM_ARCH_AM6_SPL_H_ + +#define BOOT_DEVICE_RAM 0x00 +#define BOOT_DEVICE_OSPI 0x01 +#define BOOT_DEVICE_QSPI 0x02 +#define BOOT_DEVICE_HYPERFLASH 0x03 +#define BOOT_DEVICE_SPI 0x04 +#define BOOT_DEVICE_I2C 0x05 +#define BOOT_DEVICE_MMC2 0x06 +#define BOOT_DEVICE_ETHERNET 0x07 +#define BOOT_DEVICE_USB 0x08 +#define BOOT_DEVICE_PCIE 0x09 +#define BOOT_DEVICE_UART 0x0a +#define BOOT_DEVICE_NAND 0x0c +#define BOOT_DEVICE_MMC1 0x0d +#define BOOT_DEVICE_MMC2_2 0x0e + +#define BACKUP_BOOT_DEVICE_RAM 0x0 +#define BACKUP_BOOT_DEVICE_USB 0x1 +#define BACKUP_BOOT_DEVICE_UART 0x2 +#define BACKUP_BOOT_DEVICE_ETHERNET 0x3 +#define BACKUP_BOOT_DEVICE_MMC2 0x4 +#define BACKUP_BOOT_DEVICE_SPI 0x5 +#define BACKUP_BOOT_DEVICE_HYPERFLASH 0x6 +#define BACKUP_BOOT_DEVICE_I2C 0x7 + +#define K3_PRIMARY_BOOTMODE 0x0 +#define K3_BACKUP_BOOTMODE 0x1 + +#endif
arch/arm/mach-k3/include/mach/hardware.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ +* Lokesh Vutla <[email protected]> +*/ +#ifndef _ASM_ARCH_HARDWARE_H_ +#define _ASM_ARCH_HARDWARE_H_ + +#ifdef CONFIG_SOC_K3_AM6 +#include "am6_hardware.h" +#endif +#endif /* _ASM_ARCH_HARDWARE_H_ */
arch/arm/mach-k3/include/mach/spl.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ +* Lokesh Vutla <[email protected]> +*/ +#ifndef _ASM_ARCH_SPL_H_ +#define _ASM_ARCH_SPL_H_ + +#ifdef CONFIG_SOC_K3_AM6 +#include "am6_spl.h" +#endif +#endif /* _ASM_ARCH_SPL_H_ */
Signature · 1 line
2.18.0
PATCH v2 4/8 arm: K3: am654: Add support for boot device detection
Quoted 11 lines · Lokesh Vutla
AM654 allows for booting from primary or backup boot media. Both media can be chosen individually based on switch settings. ROM looks for a valid image in primary boot media, if not found then looks in backup boot media. In order to pass this boot media information to boot loader, ROM stores a value at a particular address. Add support for reading this information and determining the boot media correctly.
Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Andreas Dannenberg <[email protected]>Signed-off-by Vignesh R <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180827/0c8cdb2f/attachment.sig>
PATCH v2 4/8 arm: K3: am654: Add support for boot device detection
In reply to Lokesh VutlaQuoted 8 lines · Lokesh Vutla
AM654 allows for booting from primary or backup boot media. Both media can be chosen individually based on switch settings. ROM looks for a valid image in primary boot media, if not found then looks in backup boot media. In order to pass this boot media information to boot loader, ROM stores a value at a particular address. Add support for reading this information and determining the boot media correctly.
Quoted 4 lines
Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Andreas Dannenberg <[email protected]>Signed-off-by Vignesh R <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/f0f36464/attachment.sig>
PATCH v2 5/8 arm: K3: am654: Unlock control module registers during init
In reply to Lokesh VutlaFrom: Andreas Dannenberg <[email protected]>
By default the device control module registers are locked, preventing any writes to its registers.
Unlock those registers as part of the init flow.
--- arch/arm/mach-k3/am6_init.c | 38 ++++++++++++++++++++ arch/arm/mach-k3/include/mach/am6_hardware.h | 21 +++++++++++ 2 files changed, 59 insertions(+)
arch/arm/mach-k3/am6_init.c +38 -0
@@ -12,6 +12,41 @@#include <asm/arch/hardware.h> #ifdef CONFIG_SPL_BUILD +static void mmr_unlock (u32 base,u32 partition) +{ +/* Translate the base address */ +phys_addr_t part_base = base + partition *CTRL_MMR0_PARTITION_SIZE ; + +/* Unlock the requested partition if locked using two-step sequence */ +writel (CTRLMMR_LOCK_KICK0_UNLOCK_VAL , part_base +CTRLMMR_LOCK_KICK0 ); +writel (CTRLMMR_LOCK_KICK1_UNLOCK_VAL , part_base +CTRLMMR_LOCK_KICK1 ); +} + +static void ctrl_mmr_unlock (void ) +{ +/* Unlock all WKUP_CTRL_MMR0 module registers */ +mmr_unlock (WKUP_CTRL_MMR0_BASE ,0 ); +mmr_unlock (WKUP_CTRL_MMR0_BASE ,1 ); +mmr_unlock (WKUP_CTRL_MMR0_BASE ,2 ); +mmr_unlock (WKUP_CTRL_MMR0_BASE ,3 ); +mmr_unlock (WKUP_CTRL_MMR0_BASE ,6 ); +mmr_unlock (WKUP_CTRL_MMR0_BASE ,7 ); + +/* Unlock all MCU_CTRL_MMR0 module registers */ +mmr_unlock (MCU_CTRL_MMR0_BASE ,0 ); +mmr_unlock (MCU_CTRL_MMR0_BASE ,1 ); +mmr_unlock (MCU_CTRL_MMR0_BASE ,2 ); +mmr_unlock (MCU_CTRL_MMR0_BASE ,6 ); + +/* Unlock all CTRL_MMR0 module registers */ +mmr_unlock (CTRL_MMR0_BASE ,0 ); +mmr_unlock (CTRL_MMR0_BASE ,1 ); +mmr_unlock (CTRL_MMR0_BASE ,2 ); +mmr_unlock (CTRL_MMR0_BASE ,3 ); +mmr_unlock (CTRL_MMR0_BASE ,6 ); +mmr_unlock (CTRL_MMR0_BASE ,7 ); +} +static void store_boot_index_from_rom (void ) {u32 *boot_index = (u32 *)K3_BOOT_PARAM_TABLE_INDEX_VAL ;
@@ -27,6 +62,9 @@ void board_init_f(ulong dummy)*/ store_boot_index_from_rom (); +/* Make all control module registers accessible */ +ctrl_mmr_unlock (); +/* Init DM early in-order to invoke system controller */ spl_early_init ();
arch/arm/mach-k3/include/mach/am6_hardware.h +21 -0
@@ -17,6 +17,27 @@#define CTRLMMR_MAIN_DEVSTAT_BKUP_BOOTMODE_MASK GENMASK(6, 4)#define CTRLMMR_MAIN_DEVSTAT_BKUP_BOOTMODE_SHIFT 4 +#define WKUP_CTRL_MMR0_BASE 0x43000000 +#define MCU_CTRL_MMR0_BASE 0x40f00000 + +/* +* The CTRL_MMR0 memory space is divided into several equally-spaced +* partitions, so defining the partition size allows us to determine +* register addresses common to those partitions. +*/ +#define CTRL_MMR0_PARTITION_SIZE 0x4000 + +/* +* CTRL_MMR0, WKUP_CTRL_MMR0, and MCU_CTR_MMR0 lock/kick-mechanism +* shared register definitions. +*/ +#define CTRLMMR_LOCK_KICK0 0x01008 +#define CTRLMMR_LOCK_KICK0_UNLOCK_VAL 0x68ef3490 +#define CTRLMMR_LOCK_KICK0_UNLOCKED_MASK BIT(0) +#define CTRLMMR_LOCK_KICK0_UNLOCKED_SHIFT 0 +#define CTRLMMR_LOCK_KICK1 0x0100c +#define CTRLMMR_LOCK_KICK1_UNLOCK_VAL 0xd172bc5a +/* MCU SCRATCHPAD usage */ #define K3_BOOT_PARAM_TABLE_INDEX_VAL CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
Signature · 1 line
2.18.0
PATCH v2 5/8 arm: K3: am654: Unlock control module registers during init
Quoted 9 lines · Lokesh Vutla
From: Andreas Dannenberg <[email protected]>
By default the device control module registers are locked, preventing any writes to its registers.
Unlock those registers as part of the init flow.Reviewed-by Tom Rini <[email protected]>Signed-off-by Andreas Dannenberg <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/7a9770f0/attachment.sig>
PATCH v2 6/8 armv8: K3: am654: Add custom MMU support
In reply to Lokesh VutlaAdd MMU mappings for AM654 SoC.
--- arch/arm/mach-k3/Makefile | 1 + arch/arm/mach-k3/arm64-mmu.c | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 arch/arm/mach-k3/arm64-mmu.c
arch/arm/mach-k3/Makefile +1 -0
@@ -4,3 +4,4 @@ # Lokesh Vutla <[email protected]> obj-$(CONFIG_SOC_K3_AM6) += am6_init.o +obj-$(CONFIG_ARM64) += arm64-mmu.o
arch/arm/mach-k3/arm64-mmu.c new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH v2 6/8 armv8: K3: am654: Add custom MMU support
Quoted 4 lines · Lokesh Vutla
Add MMU mappings for AM654 SoC.
Reviewed-by Tom Rini <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/db9f95d7/attachment.sig>
PATCH v2 7/8 armv8: K3: am654: Introduce FIT generator script
In reply to Lokesh VutlaAdd a script that is capable of generating a FIT image source file that combines ATF, SPL(64 bit) and DT. This combined image is used by R5 SPL and start ATF on ARMv8 core.
--- tools/k3_fit_atf.sh | 99 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100755 tools/k3_fit_atf.sh
tools/k3_fit_atf.sh new file +99 -0
@@ -0,0 +1,99 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0+ +# +# script to generate FIT image source for K3 Family boards with +# ATF, OPTEE, SPL and multiple device trees (given on the command line). +# Inspired from board/sunxi/mksunxi_fit_atf.sh +# +# usage: $0 <dt_name> [<dt_name> [<dt_name] ...] + +[ -z "$ATF" ] && ATF="bl31.bin" + +if [ ! -f $ATF ]; then + echo "WARNING ATF file $ATF NOT found, resulting binary is non-functional" >&2 + ATF=/dev/null +fi + +[ -z "$TEE" ] && TEE="bl32.bin" + +if [ ! -f $TEE ]; then + echo "WARNING OPTEE file $TEE NOT found, resulting might be non-functional" >&2 + TEE=/dev/null +fi + +cat << __HEADER_EOF +/dts-v1/; + +/ { + description = "Configuration to load ATF and SPL"; + #address-cells = <1>; + + images { + atf { + description = "ARM Trusted Firmware"; + data = /incbin/("$ATF"); + type = "firmware"; + arch = "arm64"; + compression = "none"; + os = "arm-trusted-firmware"; + load = <0x70000000>; + entry = <0x70000000>; + }; + tee { + description = "OPTEE"; + data = /incbin/("$TEE"); + type = "tee"; + arch = "arm64"; + compression = "none"; + os = "tee"; + load = <0x9e800000>; + entry = <0x9e800000>; + }; + spl { + description = "SPL (64-bit)"; + data = /incbin/("spl/u-boot-spl-nodtb.bin"); + type = "standalone"; + os = "U-Boot"; + arch = "arm64"; + compression = "none"; + load = <0x80080000>; + entry = <0x80080000>; + }; +__HEADER_EOF + +for dtname in $* +do + cat << __FDT_IMAGE_EOF + $(basename $dtname) { + description = "$(basename $dtname .dtb)"; + data = /incbin/("$dtname"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + }; +__FDT_IMAGE_EOF +done + +cat << __CONF_HEADER_EOF + }; + configurations { + default = "$(basename $1)"; + +__CONF_HEADER_EOF + +for dtname in $* +do + cat << __CONF_SECTION_EOF + $(basename $dtname) { + description = "$(basename $dtname .dtb)"; + firmware = "atf"; + loadables = "tee", "spl"; + fdt = "$(basename $dtname)"; + }; +__CONF_SECTION_EOF +done + +cat << __ITS_EOF + }; +}; +__ITS_EOF
Signature · 1 line
2.18.0
PATCH v2 7/8 armv8: K3: am654: Introduce FIT generator script
Quoted 6 lines · Lokesh Vutla
Add a script that is capable of generating a FIT image source file that combines ATF, SPL(64 bit) and DT. This combined image is used by R5 SPL and start ATF on ARMv8 core.
Signed-off-by Lokesh Vutla <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180827/6ac1ab97/attachment.sig>
PATCH v2 7/8 armv8: K3: am654: Introduce FIT generator script
In reply to Lokesh VutlaQuoted 7 lines · Lokesh Vutla
Add a script that is capable of generating a FIT image source file that combines ATF, SPL(64 bit) and DT. This combined image is used by R5 SPL and start ATF on ARMv8 core.
Signed-off-by Lokesh Vutla <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/b609f82f/attachment.sig>
PATCH v2 8/8 armv8: K3: am654: Add support for generating build targets
In reply to Lokesh VutlaUpdate Makefile to generate
- tispl.bin: First stage bootloader on ARMv8 core
- u-boot.img: Second stage bootloader on ARMv8 core.
--- arch/arm/mach-k3/config.mk | 19 +++++++++++++++++++ scripts/Makefile.spl | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 arch/arm/mach-k3/config.mk
arch/arm/mach-k3/config.mk new file +19 -0
@@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ +# Lokesh Vutla <[email protected]> + +ifdef CONFIG_SPL_BUILD + +ifdef CONFIG_ARM64 +SPL_ITS := u-boot-spl-k3.its +$(SPL_ITS): FORCE + $(srctree)/tools/k3_fit_atf.sh \ + $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST))) > $@ + +ALL-y += tispl.bin +endif + +else +ALL-y += u-boot.img +endif
scripts/Makefile.spl +9 -0
@@ -144,6 +144,10 @@ quiet_cmd_mkimage = MKIMAGE $@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT)) +quiet_cmd_mkfitimage = MKIMAGE $@ +cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(SPL_ITS) -E $@ \ + $(if $(KBUILD_VERBOSE:1=), MKIMAGEOUTPUT) + MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE) MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE)
@@ -407,3 +411,8 @@ $(obj)/$(SPL_BIN).multidtb.fit.gz: $(obj)/$(SPL_BIN).multidtb.fit $(obj)/$(SPL_BIN).multidtb.fit.lzo: $(obj)/$(SPL_BIN).multidtb.fit @lzop -f9 $< > $@ + +ifdef CONFIG_ARCH_K3 +tispl.bin: $(obj)/u-boot-spl-nodtb.bin $(SHRUNK_ARCH_DTB) $(SPL_ITS) FORCE + $(call if_changed,mkfitimage) +endif
Signature · 1 line
2.18.0
PATCH v2 8/8 armv8: K3: am654: Add support for generating build targets
Quoted 6 lines · Lokesh Vutla
Update
Makefileto generate
- tispl.bin: First stage bootloader on ARMv8 core
- u-boot.img: Second stage bootloader on ARMv8 core.Reviewed-by Tom Rini <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180911/67257b5c/attachment.sig>
PATCH v2 1/3 Initial support Texas Instrument's AM654 Platform
In reply to Lokesh VutlaQuoted 33 lines · Lokesh Vutla
The AM654 SoC is a lead device of the K3 Multicore SoC architecture platform, targeted for broad market and industrial control with aim to meet the complex processing needs of modern embedded products.
The device is partitioned into three functional domains, each containing specific processing cores and peripherals:
Some highlights in each domain are:
- MAIN Domain:
--------------
* Quad ARMv8 A53 cores split over two clusters
* GICv3 compliant GIC500
* Configurable L3 Cache and IO-coherent architecture
* DDR Subsystem (DDRSS) with Error Correcting Code (ECC)
* Three Gigabit Industrial Communication Subsystems (ICSSG), each with dual PRUs and dual RTUs
* Hardware accelerator block containing AES/DES/SHA/MD5 called SA2UL
* eQEP/eCAP, eHRPWM.
* Multimedia capability with CAL, DSS7-UL, SGX544, McASP
* Peripheral connectivity including USB3, PCIE, MMC/SD, GPMC, I2C, SPI, GPIO- MCU Domain:
-------------
* Dual lock-step capable R5F uC for safety-critical applications
* Flash subsystem with OSPI and Hyperbus interfaces
* High data throughput capable distributed DMA architecture under MCU NAVSS
* Dual ADCSS, Dual CAN-FD.- WKUP Domain:
--------------
* Centralized System Controller for Security, Power, and Resource management.
Quoted 8 lines
For further deails see AM65x Technical Reference Manual (SPRUID7, April 2018):
http://www.ti.com/lit/pdf/spruid7This is a complex SoC and the support to add this SoC is very huge. So I tried to split into 3 separate series:
[1/3] Adding base SoC support
[2/3] Base drivers that allow minimal boot.
[3/3] EVM support with dts and defconfig changes.
TravisCI build report with the consolidation of 3 series:
https://travis-ci.org/lokeshvutla/u-boot/builds/421033268
Thanks and regards,
Lokesh