Configure QSPI Bus Width and Frequency in Pre-Boot Loader Stage on QorIQ LS Series Processors

Similar documents
Building U-Boot in CodeWarrior ARMv8

Configuring DDR in U-Boot using QCVS

i.mx 7 Dual/Solo Product Lifetime Usage

i.mx 6ULL Product Usage Lifetime Estimates

i.mxrt1050 Product Lifetime Usage Estimates

i.mx 6UltraLite Product Usage Lifetime Estimates

Getting Started with the MCU Flashloader

Collecting Linux Trace without using CodeWarrior

i.mx 6ULZ Migration Guide

Using an External GCC Toolchain with CodeWarrior for Power Architecture

Collect Linux Hardware Trace for ARMv8 User Space and Kernel Space Applications

How to use FlexMemory as D-Flash and EEPROM in KE1xF

Processor Expert Software for i.mx Processors Version 1.0

Kinetis USB-KW41Z Wireless Protocol Sniffer Quick Start Guide

DDR Validation Tool Getting Started Guide

i.mxrt1060 Product Lifetime Usage Estimates

Power Consumption and Measurement of i.mx RT1020

TWR-LS1021A Getting Started

MCUXpresso SDK USB Power Delivery

IMXPINSQSUG Quick Start Guide on Pins Tool for i.mx Processors

QN9080 QN908x RF Certification Guide

Offline Flash Programmer for Kinetis K- and L-series MCUs

S12Z MagniV LIN Bootloader

MQX RTOS Release Notes for Kinetis SDK v1.2.0 for KL33Z64 for FRDM-KL43Z Freescale Freedom Development Platform

Using FCCU on MPC5744P

How to Reduce SoC Power when Running M4 with A53 on i.mx8m

FRDM-K64F Board Errata

Measuring Interrupt Latency

TWR-LS1021A Getting Started

QCVS SerDes Tool User Guide

KW41Z IEEE and BLE Coexistence Performance

How to setup pre-build steps in CodeWarrior for Microcontrollers v10.x

How to Enable Boot from QSPI Flash

Getting Started with MCUXpresso SDK CMSIS Packs

S32K1xx Bootloader. 1. Introduction. 2. Architecture description. NXP Semiconductors. Application Notes Rev. 1, 10/2018. Contents

Adding a run control interface into an existing CodeWarrior for MCU v10.x project

WPR1500-LDO MP Receiver V2.1 Reference Design User s Guide

AN5016. Trigonometry approximations. Document information

CodeWarrior Development Studio for StarCore 3900FP DSP v SP3 Release Notes

PICO-i.MX6UL Development Platform for Android Things Quick Start Guide

Smart Plug Software Design Reference Manual

MQX RTOS Release Notes for Kinetis SDK FRDM- KV10Z Freescale Freedom Development Platform

MCU Bootloader Release Notes

Load Position-Independent Code (PIC) on a Kinetis Platform Using the IAR EWARM Compiler

Migrating Applications from MC9S12VR64 to MC9S12VR32 by: Manuel Rodríguez

IMXPINSQSUG Pins Tool for i.mx Processors Installation User's Guide

Getting Started with Freescale MQX RTOS for Kinetis SDK and MDK-ARM Keil

Exception and fault checking on S32K1xx

Using VRC_CTL to Control an External VDD_LV Supply on the MPC5748G

Kinetis Bootloader v1.2.0 Release Notes

Freedom FRDM-MC-LVBLDC Development Platform User s Guide

Getting Started with Freescale MQX RTOS for Kinetis SDK and ARM GCC

Kinetis Flash Tool User's Guide

SPI topics: watchdog, serial output and parity check

How to Enable Boot from HyperFlash and SD Card

Kinetis Flash Tool User's Guide

QCVS Frame Distributor Wizard User Guide

P1010RDB-PB Quick Start Guide

Working around ERR7026 according to application needs

NADK Reflector Application Debug

CodeWarrior U-Boot Debugging

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

Emulating I2S bus on KE06

Getting Started with FreeRTOS BSP for i.mx 7Dual

i.mx 6ULL Migration Guide

i.mx 6Solo/6DualLite Product Lifetime Usage Estimates

AIOP Task Aware Debug

Kinetis Updater User's Guide

QCVS Hardware Device Tree Editor User Guide

Kinetis SDK Release Notes for the TWR-K24F120M Tower System Module

OpenSDA on TWR-KW2x. User s Guide Rev 1.1

Getting Started with Pins Tool User's Guide

Contents 2. Contents

Emulating Dual SPI Using FlexIO

Component Development Environment Getting Started Guide

WCT1011A/WCT1013A Automotive MP-A9 V4.0 Run-Time Debugging

Generating a Quick and Controlled Waveform With the DAC

Freescale MQX USB Stack for TWR-K24F120M GA User s Guide

Kinetis KE1xF512 MCUs

TWR-KV10Z32 Sample Code Guide for CodeWarrior Board configuration, software, and development tools

How to Implement USB Suspend/Resume Feature with MCUXpresso SDK USB Stack

Kinetis SDK Freescale Freedom FRDM-KL03Z Platform User s Guide

i.mx 6 Android JB 4.3_1.1.1 Patch Release Notes

MAC57D5xx Start-Up Sequence

CodeWarrior Development Studio Processor Expert RTOS Adapter User Guide

Using the i.mxrt L1 Cache

General C Functions for the etpu Covers the MCF523x, MPC5500, MPC5600, MPC5700, MPX40 and all etpu-equipped Devices

PCIe Certification Guide for i.mx 6Dual/6Quad and i.mx 6Solo/6DualLite

HVP-KV31F120M User s Guide

Quick Start Guide for FRDM-KL05Z

for Freescale MPC55xx/MPC56xx Microcontrollers V2.10 Quick Start

for ColdFire Architectures V7.2 Quick Start

Single Chip Module (SCM) Package-on- Package (PoP) Assembly Guide

MIMXRT1020 EVK Board Hardware User s Guide

CodeWarrior Development Studio

Freescale MKW40Z IEEE Software Quick Start Guide

Using the MPC5777M MCAN Module to Exchange CAN FD Messages

Three-Phase Power Meter Hardware Design Reference Manual

HVP-KV10Z32 User s Guide

Integrate TWR-EPD Software with MQX RTOS Based on the TWR-K21F120M Platform

Transcription:

NXP Semiconductors Document Number: AN12279 Application Note Rev. Configure QSPI Bus Width and Frequency in Pre-Boot Loader Stage on QorIQ LS Series Processors 1 Introduction When QSPI is selected as the boot source, PBL accesses QSPI flash in single bit mode and fetches RCW/PBI at a low speed. If the boot loader is also in the QSPI flash, the boot loader instructions will also be fetched at the same speed. This slows down the boot process. By increasing QSPI clock frequency and expanding QSPI bus width at an early stage in boot process, the boot process can be sped up. This application note is intended for users who want to optimize boot time in their applications when QSPI is selected as the boot source. The purpose of this document is to allow users to reconfigure the QSPI mode in pre-boot loader stage to operate at higher frequency and wider bus width. Contents 1 Introduction...1 2 Pre-boot process... 1 3 Increasing QSPI bus frequency... 2 4 Increasing QSPI bus width... 2 5 PBL configuration using CodeWarrior QCVS tool... 7 6 Summary...... 8 7 Revision history...... 8 2 Pre-boot process The table below shows cfg_rcw_src values for different QorIQ LS series processors to select QSPI as the boot source.

Increasing QSPI bus frequency Table 1. cfg_rcw_src values for LS series processors SoC cfg_rcw_src value (in binary) LS1012A 1 LS1021A 0_0100_010x LS1043A LS1046A 3 Increasing QSPI bus frequency QSPI bus frequency can be increased by writing to SCFG_QSPI_CFG register in PBI. For example, in below PBI command, base frequency is divided by 32 to achieve higher QSPI bus frequency with SCFG_QSPI_CFG[CLK_SEL] = 4 b0010: 0957015C 40100000 QSPI bus frequency can be modified at any stage, but it must not exceed the maximum QSPI bus frequency mentioned in the SoC data sheet. 4 Increasing QSPI bus width QSPI bus width should be increased when QSPI bus is not in use. A small firmware can be used to change QSPI bus width. The firmware can be made to execute from OCRAM. The firmware can be loaded to OCRAM using PBI commands. SCFG_SCRATCHRW1/2 registers can be written to make Core 0 execute the firmware in OCRAM. The firmware finally jumps to the actual boot loader residing in QSPI. All further instructions fetched from QSPI will be with increased bus width. For increasing QSPI bus width, minimal firmware is required that can perform the following functions: Unlock QSPI LUTs so that they can be programmed Update QSPI LUTs to change QSPI mode Lock QSPI LUTs to protect them from writing Jump to U-Boot code on QSPI The minimal firmware changes QSPI mode by configuring LUTs with the required QSPI mode commands and number of QSPI pads to be used. PBL programs OCRAM with minimal firmware for executing above functions. QCVS tool of CodeWarrior for Armv8 is used for modifying PBL file. See QCVS PBL Tool User Guide to know how to work with the PBL configuration tool. 4.1 Unlock LUTs Perform the following steps to unlock QSPI LUTs: 1. Program QuadSPI_LUTKEY at 0x1550300 as 0x5AF05AF0. 2. Set QuadSPI_LCKCR[UNLOCK] at 0x1550304. 2 NXP Semiconductors

Increasing QSPI bus width 4.2 Update LUTs for Dual-Bit mode Perform the following steps to update QSPI LUTs for Dual-Bit mode: 1. Update LUT0 at 0x1550310 0x091804bb. 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 1 0 1 1 INSTR1 ADDR 0b000010 PAD1 Two pads 0b01 OPRND1 24 address bits 0b00011000 INSTR0 CMD 0b000001 PAD0 One pad 0b00 OPRND0 Dual I/O read 0b10111011 1 1. This vaue is meant for S25FS128S Cypress QSPI flash. For any other flash device, see data sheet of the flash device. 2. Update LUT1 at 0x1550314 0x1d080d0c. 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 1 0 0 INSTR1 READ 0b000111 PAD1 Two pads 0b01 OPRND1 8 bytes read data size 0b00001000 Table continues on the next page... NXP Semiconductors 3

Increasing QSPI bus width INSTR0 DUMMY 0b000011 PAD0 Two pads 0b01 OPRND0 12 dummy clock cycles 1 0b00001100 1. The number of dummy clock cycles is determined by the latency code in the configuration register (CR2V[3:0]) of QSPI flash. See data sheet of the flash device for more details. 3. Update LUT2 at 0x1550318 0x00002400. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 INSTR1 0b000000 PAD1 0b00 OPRND1 0b00000000 INSTR0 JUMP_ON_CS 0b001001 PAD0 One pad 0b00 OPRND0 Jumps to instruction number 0 when CS is deasserted 0b00000000 4.3 Update LUTs for Quad-Bit mode Perform the following steps to update QSPI LUTs for Quad-Bit mode: 1. Update LUT0 at 0x1550310 0x0a1804eb. 0 0 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 4 NXP Semiconductors

Increasing QSPI bus width INSTR1 ADDR 0b000010 PAD1 Four pads 0b10 OPRND1 24 address bits 0b00011000 INSTR0 CMD 0b000001 PAD0 One pad 0b00 OPRND0 Quad I/O read 0b11101011 1 1. This vaue is meant for S25FS128S Cypress QSPI flash. For any other flash device, see data sheet of the flash device. 2. Update LUT1 at 0x1550314 0x1e080e0a. 0 0 0 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 1 0 INSTR1 READ 0b000111 PAD1 Four pads 0b10 OPRND1 8 bytes read data size 0b00001000 INSTR0 DUMMY 0b000011 PAD0 Four pads 0b10 OPRND0 12 dummy clock cycles 1 0b00001010 1. The number of dummy clock cycles is determined by the latency code in the configuration register (CR2V[3:0]) of QSPI flash. See data sheet of the flash device for more details. 3. Update LUT2 at 0x1550318 0x00002400. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Table continues on the next page... NXP Semiconductors 5

Increasing QSPI bus width 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 INSTR1 0b000000 PAD1 0b00 OPRND1 0b00000000 INSTR0 JUMP_ON_CS 0b001001 PAD0 One pad 0b00 OPRND0 Jumps to instruction number 0 when CS is deasserted 0b00000000 4.4 Lock LUTs Perform the following steps to lock QSPI LUTs: 1. Program QuadSPI_LUTKEY at 0x1550300 as 0x5AF05AF0. 2. Set QuadSPI_LCKCR[LOCK] at 0x1550304. 4.5 Jump to boot loader Jump to 0x40100000 address of QSPI where actual boot loader resides. 4.6 Assembly code for Dual-Bit mode Below is the assembly code to increase QSPI bus width by switching QSPI to Dual-Bit mode: //Unlock LUTs ldr x2,=0x1550300 ldr w3,=0xf05af05a ldr x2,=0x1550304 ldr w3,=0x02000000 //Update LUT0 ldr x2,=0x1550310 ldr w3,=0xbb041809 //Update LUT1 ldr x2,=0x1550314 ldr w3,=0x0c0d081d //Update LUT2 ldr x2,=0x1550318 ldr w3,=0x00240000 //Lock LUTs ldr x2,=0x1550304 ldr w3,=0x01000000 6 NXP Semiconductors

PBL configuration using CodeWarrior QCVS tool //Jump to U-Boot of QSPI mov x30,#0x40100000 br x30 4.7 Assembly code for Quad-Bit mode Below is the assembly code to increase QSPI bus width by switching QSPI to Quad-Bit mode: //Unlock LUTs ldr x2,=0x1550300 ldr w3,=0xf05af05a ldr x2,=0x1550304 ldr w3,=0x02000000 //Update LUT0 ldr x2,=0x1550310 ldr w3,=0xeb04180a //Update LUT1 ldr x2,=0x1550314 ldr w3,=0x0a0e081e //Update LUT2 ldr x2,=0x1550318 ldr w3,=0x00240000 //Lock LUTs ldr x2,=0x1550304 ldr w3,=0x01000000 //Jump to U-Boot of QSPI mov x30,#0x40100000 br x30 4.8 Generate binary file of SPL code The SPL code is in assembly language. Follow below steps to create binary file of SPL code in Ubuntu: 1. Make object (.o) file from assembly (.S) file: aarch64-linux-gnu-gcc -c <assembly_filename.s> 2. Make binary (.bin) file from object (.o) file: aarch64-linux-gnu-objcopy -O binary <object_filename.o> <binary_filename.bin> 5 PBL configuration using CodeWarrior QCVS tool NXP Semiconductors 7

Summary It is recommended to use CodeWarrior QCVS tool to generate the PBI image. See QCVS PBL Tool User Guide to know how to work with the PBL configuration tool, for example, how to create a new QorIQ configuration project, how to configure the PBL component, and how to perform basic operations using the PBL configuration tool, such as generating RCW+PBI binary file. Following changes are required in PBI commands using QCVS tool: 1. Write 0x10000000 (the location of OCRAM) on the SCFG_SCRATCHRW2 register (at 0x1570604) and 0x00000000 on the SCFG_SCRATCHRW1 register (at 0x1570600), using the following PBI commands: 09570600 00000000 09570604 00000000 2. Program OCRAM with minimal firmware using the following PBI commands: 09570158 00001000 81000000 <64 bytes binary data> 81000040 <64 bytes binary data> NOTE Zeros must be added at the end of binary file of minimal firmware to make the file size a multiple of 128 bytes. 6 Summary The QSPI bus frequency can be increased by writing to a register in PBI. For increasing QSPI bus width, example given in this document can be used to load a firmware on OCRAM. The firmware changes LUTs accordingly and jumps to the existing boot loader code in QSPI flash. Increasing frequency and bus width can help optimize boot time when QSPI flash is the boot source. 7 Revision history The table below summarizes revisions to this document. Table 2. Revision history Revision Date Topic cross-reference Change description Rev. 0 11/2018 Initial public release 8 NXP Semiconductors

How to Reach Us: Home Page: nxp.com Web Support: nxp.com/support Information in this document is provided solely to enable system and software implementers to use NXP products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. NXP reserves the right to make changes without further notice to any products herein. NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does NXP assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters that may be provided in NXP data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including "typicals," must be validated for each customer application by customer's technical experts. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of sale, which can be found at the following address: nxp.com/salestermsandconditions. While NXP has implemented advanced security features, all products may be subject to unidentified vulnerabilities. Customers are responsible for the design and operation of their applications and products to reduce the effect of these vulnerabilities on customer's applications and products, and NXP accepts no liability for any vulnerability that is discovered. Customers should implement appropriate design and operating safeguards to minimize the risks associated with their applications and products. NXP, the NXP logo, Freescale, the Freescale logo, CodeWarrior, Layerscape, and QorIQ are trademarks of NXP B.V. All other product or service names are the property of their respective owners. Arm and Cortex are trademarks or registered trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. The related technology may be protected by any or all of patents, copyrights, designs and trade secrets. All rights reserved. 2018 NXP B.V. Document Number AN12279 Revision