mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
Merge changes Ic79429c3,Ie2d5272e,Iec73f9c5,Ie63f48dc,I951da75a, ... into integration
* changes: feat(stm32mp2): load FW binaries to DDR feat(stm32mp2-fdts): update STM32MP257F-EV1 DT feat(fdts): add DDR4 files for STM32MP2 feat(stm32mp25-fdts): add DDRCTRL and DDRPHY settings in DDR node feat(stm32mp25-fdts): add DDR power supplies feat(stm32mp2-fdts): add memory node feat(stm32mp2): enable DDR driver
This commit is contained in:
commit
3f31ccaea6
7 changed files with 890 additions and 0 deletions
253
fdts/stm32mp25-ddr.dtsi
Normal file
253
fdts/stm32mp25-ddr.dtsi
Normal file
|
@ -0,0 +1,253 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2024, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
&ddr{
|
||||
st,mem-name = DDR_MEM_NAME;
|
||||
st,mem-speed = <DDR_MEM_SPEED>;
|
||||
st,mem-size = <(DDR_MEM_SIZE >> 32) (DDR_MEM_SIZE & 0xFFFFFFFF)>;
|
||||
|
||||
st,ctl-reg = <
|
||||
DDR_MSTR
|
||||
DDR_MRCTRL0
|
||||
DDR_MRCTRL1
|
||||
DDR_MRCTRL2
|
||||
DDR_DERATEEN
|
||||
DDR_DERATEINT
|
||||
DDR_DERATECTL
|
||||
DDR_PWRCTL
|
||||
DDR_PWRTMG
|
||||
DDR_HWLPCTL
|
||||
DDR_RFSHCTL0
|
||||
DDR_RFSHCTL1
|
||||
DDR_RFSHCTL3
|
||||
DDR_CRCPARCTL0
|
||||
DDR_CRCPARCTL1
|
||||
DDR_INIT0
|
||||
DDR_INIT1
|
||||
DDR_INIT2
|
||||
DDR_INIT3
|
||||
DDR_INIT4
|
||||
DDR_INIT5
|
||||
DDR_INIT6
|
||||
DDR_INIT7
|
||||
DDR_DIMMCTL
|
||||
DDR_RANKCTL
|
||||
DDR_RANKCTL1
|
||||
DDR_ZQCTL0
|
||||
DDR_ZQCTL1
|
||||
DDR_ZQCTL2
|
||||
DDR_DFITMG0
|
||||
DDR_DFITMG1
|
||||
DDR_DFILPCFG0
|
||||
DDR_DFILPCFG1
|
||||
DDR_DFIUPD0
|
||||
DDR_DFIUPD1
|
||||
DDR_DFIUPD2
|
||||
DDR_DFIMISC
|
||||
DDR_DFITMG2
|
||||
DDR_DFITMG3
|
||||
DDR_DBICTL
|
||||
DDR_DFIPHYMSTR
|
||||
DDR_DBG0
|
||||
DDR_DBG1
|
||||
DDR_DBGCMD
|
||||
DDR_SWCTL
|
||||
DDR_SWCTLSTATIC
|
||||
DDR_POISONCFG
|
||||
DDR_PCCFG
|
||||
>;
|
||||
|
||||
st,ctl-timing = <
|
||||
DDR_RFSHTMG
|
||||
DDR_RFSHTMG1
|
||||
DDR_DRAMTMG0
|
||||
DDR_DRAMTMG1
|
||||
DDR_DRAMTMG2
|
||||
DDR_DRAMTMG3
|
||||
DDR_DRAMTMG4
|
||||
DDR_DRAMTMG5
|
||||
DDR_DRAMTMG6
|
||||
DDR_DRAMTMG7
|
||||
DDR_DRAMTMG8
|
||||
DDR_DRAMTMG9
|
||||
DDR_DRAMTMG10
|
||||
DDR_DRAMTMG11
|
||||
DDR_DRAMTMG12
|
||||
DDR_DRAMTMG13
|
||||
DDR_DRAMTMG14
|
||||
DDR_DRAMTMG15
|
||||
DDR_ODTCFG
|
||||
DDR_ODTMAP
|
||||
>;
|
||||
|
||||
st,ctl-map = <
|
||||
DDR_ADDRMAP0
|
||||
DDR_ADDRMAP1
|
||||
DDR_ADDRMAP2
|
||||
DDR_ADDRMAP3
|
||||
DDR_ADDRMAP4
|
||||
DDR_ADDRMAP5
|
||||
DDR_ADDRMAP6
|
||||
DDR_ADDRMAP7
|
||||
DDR_ADDRMAP8
|
||||
DDR_ADDRMAP9
|
||||
DDR_ADDRMAP10
|
||||
DDR_ADDRMAP11
|
||||
>;
|
||||
|
||||
st,ctl-perf = <
|
||||
DDR_SCHED
|
||||
DDR_SCHED1
|
||||
DDR_PERFHPR1
|
||||
DDR_PERFLPR1
|
||||
DDR_PERFWR1
|
||||
DDR_SCHED3
|
||||
DDR_SCHED4
|
||||
DDR_PCFGR_0
|
||||
DDR_PCFGW_0
|
||||
DDR_PCTRL_0
|
||||
DDR_PCFGQOS0_0
|
||||
DDR_PCFGQOS1_0
|
||||
DDR_PCFGWQOS0_0
|
||||
DDR_PCFGWQOS1_0
|
||||
DDR_PCFGR_1
|
||||
DDR_PCFGW_1
|
||||
DDR_PCTRL_1
|
||||
DDR_PCFGQOS0_1
|
||||
DDR_PCFGQOS1_1
|
||||
DDR_PCFGWQOS0_1
|
||||
DDR_PCFGWQOS1_1
|
||||
>;
|
||||
|
||||
st,phy-basic = <
|
||||
DDR_UIB_DRAMTYPE
|
||||
DDR_UIB_DIMMTYPE
|
||||
DDR_UIB_LP4XMODE
|
||||
DDR_UIB_NUMDBYTE
|
||||
DDR_UIB_NUMACTIVEDBYTEDFI0
|
||||
DDR_UIB_NUMACTIVEDBYTEDFI1
|
||||
DDR_UIB_NUMANIB
|
||||
DDR_UIB_NUMRANK_DFI0
|
||||
DDR_UIB_NUMRANK_DFI1
|
||||
DDR_UIB_DRAMDATAWIDTH
|
||||
DDR_UIB_NUMPSTATES
|
||||
DDR_UIB_FREQUENCY_0
|
||||
DDR_UIB_PLLBYPASS_0
|
||||
DDR_UIB_DFIFREQRATIO_0
|
||||
DDR_UIB_DFI1EXISTS
|
||||
DDR_UIB_TRAIN2D
|
||||
DDR_UIB_HARDMACROVER
|
||||
DDR_UIB_READDBIENABLE_0
|
||||
DDR_UIB_DFIMODE
|
||||
>;
|
||||
|
||||
st,phy-advanced = <
|
||||
DDR_UIA_LP4RXPREAMBLEMODE_0
|
||||
DDR_UIA_LP4POSTAMBLEEXT_0
|
||||
DDR_UIA_D4RXPREAMBLELENGTH_0
|
||||
DDR_UIA_D4TXPREAMBLELENGTH_0
|
||||
DDR_UIA_EXTCALRESVAL
|
||||
DDR_UIA_IS2TTIMING_0
|
||||
DDR_UIA_ODTIMPEDANCE_0
|
||||
DDR_UIA_TXIMPEDANCE_0
|
||||
DDR_UIA_ATXIMPEDANCE
|
||||
DDR_UIA_MEMALERTEN
|
||||
DDR_UIA_MEMALERTPUIMP
|
||||
DDR_UIA_MEMALERTVREFLEVEL
|
||||
DDR_UIA_MEMALERTSYNCBYPASS
|
||||
DDR_UIA_DISDYNADRTRI_0
|
||||
DDR_UIA_PHYMSTRTRAININTERVAL_0
|
||||
DDR_UIA_PHYMSTRMAXREQTOACK_0
|
||||
DDR_UIA_WDQSEXT
|
||||
DDR_UIA_CALINTERVAL
|
||||
DDR_UIA_CALONCE
|
||||
DDR_UIA_LP4RL_0
|
||||
DDR_UIA_LP4WL_0
|
||||
DDR_UIA_LP4WLS_0
|
||||
DDR_UIA_LP4DBIRD_0
|
||||
DDR_UIA_LP4DBIWR_0
|
||||
DDR_UIA_LP4NWR_0
|
||||
DDR_UIA_LP4LOWPOWERDRV
|
||||
DDR_UIA_DRAMBYTESWAP
|
||||
DDR_UIA_RXENBACKOFF
|
||||
DDR_UIA_TRAINSEQUENCECTRL
|
||||
DDR_UIA_SNPSUMCTLOPT
|
||||
DDR_UIA_SNPSUMCTLF0RC5X_0
|
||||
DDR_UIA_TXSLEWRISEDQ_0
|
||||
DDR_UIA_TXSLEWFALLDQ_0
|
||||
DDR_UIA_TXSLEWRISEAC
|
||||
DDR_UIA_TXSLEWFALLAC
|
||||
DDR_UIA_DISABLERETRAINING
|
||||
DDR_UIA_DISABLEPHYUPDATE
|
||||
DDR_UIA_ENABLEHIGHCLKSKEWFIX
|
||||
DDR_UIA_DISABLEUNUSEDADDRLNS
|
||||
DDR_UIA_PHYINITSEQUENCENUM
|
||||
DDR_UIA_ENABLEDFICSPOLARITYFIX
|
||||
DDR_UIA_PHYVREF
|
||||
DDR_UIA_SEQUENCECTRL_0
|
||||
>;
|
||||
|
||||
st,phy-mr = <
|
||||
DDR_UIM_MR0_0
|
||||
DDR_UIM_MR1_0
|
||||
DDR_UIM_MR2_0
|
||||
DDR_UIM_MR3_0
|
||||
DDR_UIM_MR4_0
|
||||
DDR_UIM_MR5_0
|
||||
DDR_UIM_MR6_0
|
||||
DDR_UIM_MR11_0
|
||||
DDR_UIM_MR12_0
|
||||
DDR_UIM_MR13_0
|
||||
DDR_UIM_MR14_0
|
||||
DDR_UIM_MR22_0
|
||||
>;
|
||||
|
||||
st,phy-swizzle = <
|
||||
DDR_UIS_SWIZZLE_0
|
||||
DDR_UIS_SWIZZLE_1
|
||||
DDR_UIS_SWIZZLE_2
|
||||
DDR_UIS_SWIZZLE_3
|
||||
DDR_UIS_SWIZZLE_4
|
||||
DDR_UIS_SWIZZLE_5
|
||||
DDR_UIS_SWIZZLE_6
|
||||
DDR_UIS_SWIZZLE_7
|
||||
DDR_UIS_SWIZZLE_8
|
||||
DDR_UIS_SWIZZLE_9
|
||||
DDR_UIS_SWIZZLE_10
|
||||
DDR_UIS_SWIZZLE_11
|
||||
DDR_UIS_SWIZZLE_12
|
||||
DDR_UIS_SWIZZLE_13
|
||||
DDR_UIS_SWIZZLE_14
|
||||
DDR_UIS_SWIZZLE_15
|
||||
DDR_UIS_SWIZZLE_16
|
||||
DDR_UIS_SWIZZLE_17
|
||||
DDR_UIS_SWIZZLE_18
|
||||
DDR_UIS_SWIZZLE_19
|
||||
DDR_UIS_SWIZZLE_20
|
||||
DDR_UIS_SWIZZLE_21
|
||||
DDR_UIS_SWIZZLE_22
|
||||
DDR_UIS_SWIZZLE_23
|
||||
DDR_UIS_SWIZZLE_24
|
||||
DDR_UIS_SWIZZLE_25
|
||||
DDR_UIS_SWIZZLE_26
|
||||
DDR_UIS_SWIZZLE_27
|
||||
DDR_UIS_SWIZZLE_28
|
||||
DDR_UIS_SWIZZLE_29
|
||||
DDR_UIS_SWIZZLE_30
|
||||
DDR_UIS_SWIZZLE_31
|
||||
DDR_UIS_SWIZZLE_32
|
||||
DDR_UIS_SWIZZLE_33
|
||||
DDR_UIS_SWIZZLE_34
|
||||
DDR_UIS_SWIZZLE_35
|
||||
DDR_UIS_SWIZZLE_36
|
||||
DDR_UIS_SWIZZLE_37
|
||||
DDR_UIS_SWIZZLE_38
|
||||
DDR_UIS_SWIZZLE_39
|
||||
DDR_UIS_SWIZZLE_40
|
||||
DDR_UIS_SWIZZLE_41
|
||||
DDR_UIS_SWIZZLE_42
|
||||
DDR_UIS_SWIZZLE_43
|
||||
>;
|
||||
};
|
249
fdts/stm32mp25-ddr4-2x16Gbits-2x16bits-1200MHz.dtsi
Normal file
249
fdts/stm32mp25-ddr4-2x16Gbits-2x16bits-1200MHz.dtsi
Normal file
|
@ -0,0 +1,249 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2022-2024, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
/*
|
||||
* STM32MP25 DDR4 board configuration
|
||||
* DDR4 2x16Gbits 2x16bits 1200MHz
|
||||
*
|
||||
* version 2
|
||||
* package 1 Package selection (14x14 and 18x18)
|
||||
* memclk 1200MHz (2x DFI clock) + range check
|
||||
* Speed_Bin Worse from JEDEC
|
||||
* device_width 16 x16 by default
|
||||
* width 32 32: full width / 16: half width
|
||||
* density 16Gbits (per 16bit device)
|
||||
* Addressing RBC row/bank interleaving
|
||||
* RDBI No Read DBI
|
||||
*/
|
||||
|
||||
#define DDR_MEM_NAME "DDR4 2x16Gbits 2x16bits 1200MHz"
|
||||
#define DDR_MEM_SPEED 1200000
|
||||
#define DDR_MEM_SIZE 0x100000000
|
||||
|
||||
#define DDR_MSTR 0x01040010
|
||||
#define DDR_MRCTRL0 0x00000030
|
||||
#define DDR_MRCTRL1 0x00000000
|
||||
#define DDR_MRCTRL2 0x00000000
|
||||
#define DDR_DERATEEN 0x00000000
|
||||
#define DDR_DERATEINT 0x00000000
|
||||
#define DDR_DERATECTL 0x00000000
|
||||
#define DDR_PWRCTL 0x00000000
|
||||
#define DDR_PWRTMG 0x00130001
|
||||
#define DDR_HWLPCTL 0x00000002
|
||||
#define DDR_RFSHCTL0 0x00210010
|
||||
#define DDR_RFSHCTL1 0x00000000
|
||||
#define DDR_RFSHCTL3 0x00000000
|
||||
#define DDR_RFSHTMG 0x0092014A
|
||||
#define DDR_RFSHTMG1 0x008C0000
|
||||
#define DDR_CRCPARCTL0 0x00000000
|
||||
#define DDR_CRCPARCTL1 0x00001000
|
||||
#define DDR_INIT0 0xC0020002
|
||||
#define DDR_INIT1 0x00010002
|
||||
#define DDR_INIT2 0x00000D00
|
||||
#define DDR_INIT3 0x09400103
|
||||
#define DDR_INIT4 0x00180000
|
||||
#define DDR_INIT5 0x00100004
|
||||
#define DDR_INIT6 0x00080460
|
||||
#define DDR_INIT7 0x00000C16
|
||||
#define DDR_DIMMCTL 0x00000000
|
||||
#define DDR_RANKCTL 0x0000066F
|
||||
#define DDR_RANKCTL1 0x0000000D
|
||||
#define DDR_DRAMTMG0 0x11152815
|
||||
#define DDR_DRAMTMG1 0x0004051E
|
||||
#define DDR_DRAMTMG2 0x0609060D
|
||||
#define DDR_DRAMTMG3 0x0050400C
|
||||
#define DDR_DRAMTMG4 0x0904050A
|
||||
#define DDR_DRAMTMG5 0x06060403
|
||||
#define DDR_DRAMTMG6 0x02020005
|
||||
#define DDR_DRAMTMG7 0x00000202
|
||||
#define DDR_DRAMTMG8 0x0606100B
|
||||
#define DDR_DRAMTMG9 0x0002040A
|
||||
#define DDR_DRAMTMG10 0x001C180A
|
||||
#define DDR_DRAMTMG11 0x4408021C
|
||||
#define DDR_DRAMTMG12 0x0C020010
|
||||
#define DDR_DRAMTMG13 0x1C200004
|
||||
#define DDR_DRAMTMG14 0x000000A0
|
||||
#define DDR_DRAMTMG15 0x00000000
|
||||
#define DDR_ZQCTL0 0x01000040
|
||||
#define DDR_ZQCTL1 0x2000493E
|
||||
#define DDR_ZQCTL2 0x00000000
|
||||
#define DDR_DFITMG0 0x038F8209
|
||||
#define DDR_DFITMG1 0x00080303
|
||||
#define DDR_DFILPCFG0 0x07004111
|
||||
#define DDR_DFILPCFG1 0x00000000
|
||||
#define DDR_DFIUPD0 0xC0300018
|
||||
#define DDR_DFIUPD1 0x005700B4
|
||||
#define DDR_DFIUPD2 0x80000000
|
||||
#define DDR_DFIMISC 0x00000041
|
||||
#define DDR_DFITMG2 0x00000F09
|
||||
#define DDR_DFITMG3 0x00000000
|
||||
#define DDR_DBICTL 0x00000001
|
||||
#define DDR_DFIPHYMSTR 0x80000000
|
||||
#define DDR_ADDRMAP0 0x0000001F
|
||||
#define DDR_ADDRMAP1 0x003F0909
|
||||
#define DDR_ADDRMAP2 0x00000700
|
||||
#define DDR_ADDRMAP3 0x00000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x070F0707
|
||||
#define DDR_ADDRMAP6 0x07070707
|
||||
#define DDR_ADDRMAP7 0x00000F07
|
||||
#define DDR_ADDRMAP8 0x00003F01
|
||||
#define DDR_ADDRMAP9 0x07070707
|
||||
#define DDR_ADDRMAP10 0x07070707
|
||||
#define DDR_ADDRMAP11 0x00000007
|
||||
#define DDR_ODTCFG 0x06000618
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x80001B00
|
||||
#define DDR_SCHED1 0x00000000
|
||||
#define DDR_PERFHPR1 0x04000200
|
||||
#define DDR_PERFLPR1 0x08000080
|
||||
#define DDR_PERFWR1 0x08000400
|
||||
#define DDR_SCHED3 0x04040208
|
||||
#define DDR_SCHED4 0x08400810
|
||||
#define DDR_DBG0 0x00000000
|
||||
#define DDR_DBG1 0x00000000
|
||||
#define DDR_DBGCMD 0x00000000
|
||||
#define DDR_SWCTL 0x00000000
|
||||
#define DDR_SWCTLSTATIC 0x00000000
|
||||
#define DDR_POISONCFG 0x00000000
|
||||
#define DDR_PCCFG 0x00000000
|
||||
#define DDR_PCFGR_0 0x00704100
|
||||
#define DDR_PCFGW_0 0x00004100
|
||||
#define DDR_PCTRL_0 0x00000000
|
||||
#define DDR_PCFGQOS0_0 0x0021000C
|
||||
#define DDR_PCFGQOS1_0 0x01000080
|
||||
#define DDR_PCFGWQOS0_0 0x01100C07
|
||||
#define DDR_PCFGWQOS1_0 0x04000200
|
||||
#define DDR_PCFGR_1 0x00704100
|
||||
#define DDR_PCFGW_1 0x00004100
|
||||
#define DDR_PCTRL_1 0x00000000
|
||||
#define DDR_PCFGQOS0_1 0x00100007
|
||||
#define DDR_PCFGQOS1_1 0x01000080
|
||||
#define DDR_PCFGWQOS0_1 0x01100C07
|
||||
#define DDR_PCFGWQOS1_1 0x04000200
|
||||
|
||||
#define DDR_UIB_DRAMTYPE 0x00000000
|
||||
#define DDR_UIB_DIMMTYPE 0x00000004
|
||||
#define DDR_UIB_LP4XMODE 0x00000000
|
||||
#define DDR_UIB_NUMDBYTE 0x00000004
|
||||
#define DDR_UIB_NUMACTIVEDBYTEDFI0 0x00000004
|
||||
#define DDR_UIB_NUMACTIVEDBYTEDFI1 0x00000000
|
||||
#define DDR_UIB_NUMANIB 0x00000008
|
||||
#define DDR_UIB_NUMRANK_DFI0 0x00000001
|
||||
#define DDR_UIB_NUMRANK_DFI1 0x00000001
|
||||
#define DDR_UIB_DRAMDATAWIDTH 0x00000010
|
||||
#define DDR_UIB_NUMPSTATES 0x00000001
|
||||
#define DDR_UIB_FREQUENCY_0 0x000004B0
|
||||
#define DDR_UIB_PLLBYPASS_0 0x00000000
|
||||
#define DDR_UIB_DFIFREQRATIO_0 0x00000001
|
||||
#define DDR_UIB_DFI1EXISTS 0x00000001
|
||||
#define DDR_UIB_TRAIN2D 0x00000000
|
||||
#define DDR_UIB_HARDMACROVER 0x00000003
|
||||
#define DDR_UIB_READDBIENABLE_0 0x00000000
|
||||
#define DDR_UIB_DFIMODE 0x00000000
|
||||
|
||||
#define DDR_UIA_LP4RXPREAMBLEMODE_0 0x00000000
|
||||
#define DDR_UIA_LP4POSTAMBLEEXT_0 0x00000000
|
||||
#define DDR_UIA_D4RXPREAMBLELENGTH_0 0x00000000
|
||||
#define DDR_UIA_D4TXPREAMBLELENGTH_0 0x00000000
|
||||
#define DDR_UIA_EXTCALRESVAL 0x00000000
|
||||
#define DDR_UIA_IS2TTIMING_0 0x00000000
|
||||
#define DDR_UIA_ODTIMPEDANCE_0 0x00000035
|
||||
#define DDR_UIA_TXIMPEDANCE_0 0x00000028
|
||||
#define DDR_UIA_ATXIMPEDANCE 0x00000028
|
||||
#define DDR_UIA_MEMALERTEN 0x00000000
|
||||
#define DDR_UIA_MEMALERTPUIMP 0x00000000
|
||||
#define DDR_UIA_MEMALERTVREFLEVEL 0x00000000
|
||||
#define DDR_UIA_MEMALERTSYNCBYPASS 0x00000000
|
||||
#define DDR_UIA_DISDYNADRTRI_0 0x00000001
|
||||
#define DDR_UIA_PHYMSTRTRAININTERVAL_0 0x00000000
|
||||
#define DDR_UIA_PHYMSTRMAXREQTOACK_0 0x00000000
|
||||
#define DDR_UIA_WDQSEXT 0x00000000
|
||||
#define DDR_UIA_CALINTERVAL 0x00000009
|
||||
#define DDR_UIA_CALONCE 0x00000000
|
||||
#define DDR_UIA_LP4RL_0 0x00000000
|
||||
#define DDR_UIA_LP4WL_0 0x00000000
|
||||
#define DDR_UIA_LP4WLS_0 0x00000000
|
||||
#define DDR_UIA_LP4DBIRD_0 0x00000000
|
||||
#define DDR_UIA_LP4DBIWR_0 0x00000000
|
||||
#define DDR_UIA_LP4NWR_0 0x00000000
|
||||
#define DDR_UIA_LP4LOWPOWERDRV 0x00000000
|
||||
#define DDR_UIA_DRAMBYTESWAP 0x00000000
|
||||
#define DDR_UIA_RXENBACKOFF 0x00000000
|
||||
#define DDR_UIA_TRAINSEQUENCECTRL 0x00000000
|
||||
#define DDR_UIA_SNPSUMCTLOPT 0x00000000
|
||||
#define DDR_UIA_SNPSUMCTLF0RC5X_0 0x00000000
|
||||
#define DDR_UIA_TXSLEWRISEDQ_0 0x0000000F
|
||||
#define DDR_UIA_TXSLEWFALLDQ_0 0x0000000F
|
||||
#define DDR_UIA_TXSLEWRISEAC 0x0000000F
|
||||
#define DDR_UIA_TXSLEWFALLAC 0x0000000F
|
||||
#define DDR_UIA_DISABLERETRAINING 0x00000001
|
||||
#define DDR_UIA_DISABLEPHYUPDATE 0x00000000
|
||||
#define DDR_UIA_ENABLEHIGHCLKSKEWFIX 0x00000000
|
||||
#define DDR_UIA_DISABLEUNUSEDADDRLNS 0x00000001
|
||||
#define DDR_UIA_PHYINITSEQUENCENUM 0x00000000
|
||||
#define DDR_UIA_ENABLEDFICSPOLARITYFIX 0x00000000
|
||||
#define DDR_UIA_PHYVREF 0x0000005E
|
||||
#define DDR_UIA_SEQUENCECTRL_0 0x0000031F
|
||||
|
||||
#define DDR_UIM_MR0_0 0x00000940
|
||||
#define DDR_UIM_MR1_0 0x00000103
|
||||
#define DDR_UIM_MR2_0 0x00000018
|
||||
#define DDR_UIM_MR3_0 0x00000000
|
||||
#define DDR_UIM_MR4_0 0x00000008
|
||||
#define DDR_UIM_MR5_0 0x00000460
|
||||
#define DDR_UIM_MR6_0 0x00000C16
|
||||
#define DDR_UIM_MR11_0 0x00000000
|
||||
#define DDR_UIM_MR12_0 0x00000000
|
||||
#define DDR_UIM_MR13_0 0x00000000
|
||||
#define DDR_UIM_MR14_0 0x00000000
|
||||
#define DDR_UIM_MR22_0 0x00000000
|
||||
|
||||
#define DDR_UIS_SWIZZLE_0 0x0000000C
|
||||
#define DDR_UIS_SWIZZLE_1 0x00000005
|
||||
#define DDR_UIS_SWIZZLE_2 0x00000013
|
||||
#define DDR_UIS_SWIZZLE_3 0x0000001A
|
||||
#define DDR_UIS_SWIZZLE_4 0x00000009
|
||||
#define DDR_UIS_SWIZZLE_5 0x00000003
|
||||
#define DDR_UIS_SWIZZLE_6 0x00000001
|
||||
#define DDR_UIS_SWIZZLE_7 0x00000019
|
||||
#define DDR_UIS_SWIZZLE_8 0x00000007
|
||||
#define DDR_UIS_SWIZZLE_9 0x00000004
|
||||
#define DDR_UIS_SWIZZLE_10 0x0000000A
|
||||
#define DDR_UIS_SWIZZLE_11 0x0000000D
|
||||
#define DDR_UIS_SWIZZLE_12 0x00000014
|
||||
#define DDR_UIS_SWIZZLE_13 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_14 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_15 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_16 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_17 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_18 0x00000006
|
||||
#define DDR_UIS_SWIZZLE_19 0x0000000B
|
||||
#define DDR_UIS_SWIZZLE_20 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_21 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_22 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_23 0x00000008
|
||||
#define DDR_UIS_SWIZZLE_24 0x00000002
|
||||
#define DDR_UIS_SWIZZLE_25 0x00000018
|
||||
#define DDR_UIS_SWIZZLE_26 0x1A13050C
|
||||
#define DDR_UIS_SWIZZLE_27 0x19010309
|
||||
#define DDR_UIS_SWIZZLE_28 0x0D0A0407
|
||||
#define DDR_UIS_SWIZZLE_29 0x00000014
|
||||
#define DDR_UIS_SWIZZLE_30 0x000B0600
|
||||
#define DDR_UIS_SWIZZLE_31 0x02080000
|
||||
#define DDR_UIS_SWIZZLE_32 0x00000018
|
||||
#define DDR_UIS_SWIZZLE_33 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_34 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_35 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_36 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_37 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_38 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_39 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_40 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_41 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_42 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_43 0x00000000
|
||||
|
||||
#include "stm32mp25-ddr.dtsi"
|
245
fdts/stm32mp25-ddr4-2x8Gbits-2x16bits-1200MHz.dtsi
Normal file
245
fdts/stm32mp25-ddr4-2x8Gbits-2x16bits-1200MHz.dtsi
Normal file
|
@ -0,0 +1,245 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2022-2024, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
/*
|
||||
* STM32MP25 DDR4 board configuration
|
||||
* DDR4 2x8Gbits 2x16bits 1200MHz
|
||||
*
|
||||
* version 1
|
||||
* package 1 Package selection (14x14 and 18x18)
|
||||
* memclk 1200MHz (2x DFI clock) + range check
|
||||
* Speed_Bin Worse from JEDEC
|
||||
* width 32 32: full width / 16: half width
|
||||
* ranks 1 Single or Dual rank
|
||||
* density 8Gbits (per 16bit device)
|
||||
* Addressing RBC row/bank interleaving
|
||||
* RDBI No Read DBI
|
||||
*/
|
||||
|
||||
#define DDR_MEM_NAME "DDR4 2x8Gbits 2x16bits 1200MHz"
|
||||
#define DDR_MEM_SPEED 1200000
|
||||
#define DDR_MEM_SIZE 0x80000000
|
||||
|
||||
#define DDR_MSTR 0x01040010
|
||||
#define DDR_MRCTRL0 0x00000030
|
||||
#define DDR_MRCTRL1 0x00000000
|
||||
#define DDR_MRCTRL2 0x00000000
|
||||
#define DDR_DERATEEN 0x00000000
|
||||
#define DDR_DERATEINT 0x00000000
|
||||
#define DDR_DERATECTL 0x00000000
|
||||
#define DDR_PWRCTL 0x00000000
|
||||
#define DDR_PWRTMG 0x00130001
|
||||
#define DDR_HWLPCTL 0x00000002
|
||||
#define DDR_RFSHCTL0 0x00210010
|
||||
#define DDR_RFSHCTL1 0x00000000
|
||||
#define DDR_RFSHCTL3 0x00000000
|
||||
#define DDR_RFSHTMG 0x009200D2
|
||||
#define DDR_RFSHTMG1 0x008C0000
|
||||
#define DDR_CRCPARCTL0 0x00000000
|
||||
#define DDR_CRCPARCTL1 0x00001000
|
||||
#define DDR_INIT0 0xC0020002
|
||||
#define DDR_INIT1 0x00010002
|
||||
#define DDR_INIT2 0x00000D00
|
||||
#define DDR_INIT3 0x09400103
|
||||
#define DDR_INIT4 0x00180000
|
||||
#define DDR_INIT5 0x00100004
|
||||
#define DDR_INIT6 0x00080460
|
||||
#define DDR_INIT7 0x00000C16
|
||||
#define DDR_DIMMCTL 0x00000000
|
||||
#define DDR_RANKCTL 0x0000066F
|
||||
#define DDR_DRAMTMG0 0x11152815
|
||||
#define DDR_DRAMTMG1 0x0004051E
|
||||
#define DDR_DRAMTMG2 0x0609060D
|
||||
#define DDR_DRAMTMG3 0x0050400C
|
||||
#define DDR_DRAMTMG4 0x0904050A
|
||||
#define DDR_DRAMTMG5 0x06060403
|
||||
#define DDR_DRAMTMG6 0x02020005
|
||||
#define DDR_DRAMTMG7 0x00000202
|
||||
#define DDR_DRAMTMG8 0x04041007
|
||||
#define DDR_DRAMTMG9 0x0002040A
|
||||
#define DDR_DRAMTMG10 0x001C180A
|
||||
#define DDR_DRAMTMG11 0x4408021C
|
||||
#define DDR_DRAMTMG12 0x0C020010
|
||||
#define DDR_DRAMTMG13 0x1C200004
|
||||
#define DDR_DRAMTMG14 0x000000A0
|
||||
#define DDR_DRAMTMG15 0x00000000
|
||||
#define DDR_ZQCTL0 0x01000040
|
||||
#define DDR_ZQCTL1 0x2000493E
|
||||
#define DDR_ZQCTL2 0x00000000
|
||||
#define DDR_DFITMG0 0x038F8209
|
||||
#define DDR_DFITMG1 0x00080303
|
||||
#define DDR_DFILPCFG0 0x07004111
|
||||
#define DDR_DFILPCFG1 0x00000000
|
||||
#define DDR_DFIUPD0 0xC0300018
|
||||
#define DDR_DFIUPD1 0x005700B4
|
||||
#define DDR_DFIUPD2 0x80000000
|
||||
#define DDR_DFIMISC 0x00000041
|
||||
#define DDR_DFITMG2 0x00000F09
|
||||
#define DDR_DFITMG3 0x00000000
|
||||
#define DDR_DBICTL 0x00000001
|
||||
#define DDR_DFIPHYMSTR 0x80000000
|
||||
#define DDR_ADDRMAP0 0x0000001F
|
||||
#define DDR_ADDRMAP1 0x003F0909
|
||||
#define DDR_ADDRMAP2 0x00000700
|
||||
#define DDR_ADDRMAP3 0x00000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x070F0707
|
||||
#define DDR_ADDRMAP6 0x07070707
|
||||
#define DDR_ADDRMAP7 0x00000F0F
|
||||
#define DDR_ADDRMAP8 0x00003F01
|
||||
#define DDR_ADDRMAP9 0x07070707
|
||||
#define DDR_ADDRMAP10 0x07070707
|
||||
#define DDR_ADDRMAP11 0x00000007
|
||||
#define DDR_ODTCFG 0x06000618
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x00000F00
|
||||
#define DDR_SCHED1 0x00000000
|
||||
#define DDR_PERFHPR1 0x0F000001
|
||||
#define DDR_PERFLPR1 0x0F000080
|
||||
#define DDR_PERFWR1 0x01000200
|
||||
#define DDR_DBG0 0x00000000
|
||||
#define DDR_DBG1 0x00000000
|
||||
#define DDR_DBGCMD 0x00000000
|
||||
#define DDR_SWCTL 0x00000000
|
||||
#define DDR_POISONCFG 0x00000000
|
||||
#define DDR_PCCFG 0x00000000
|
||||
#define DDR_PCFGR_0 0x00004100
|
||||
#define DDR_PCFGW_0 0x00004100
|
||||
#define DDR_PCTRL_0 0x00000000
|
||||
#define DDR_PCFGQOS0_0 0x00200007
|
||||
#define DDR_PCFGQOS1_0 0x01000100
|
||||
#define DDR_PCFGWQOS0_0 0x00000C07
|
||||
#define DDR_PCFGWQOS1_0 0x02000200
|
||||
#define DDR_PCFGR_1 0x00004100
|
||||
#define DDR_PCFGW_1 0x00004100
|
||||
#define DDR_PCTRL_1 0x00000000
|
||||
#define DDR_PCFGQOS0_1 0x00200007
|
||||
#define DDR_PCFGQOS1_1 0x01000180
|
||||
#define DDR_PCFGWQOS0_1 0x00000C07
|
||||
#define DDR_PCFGWQOS1_1 0x04000400
|
||||
|
||||
#define DDR_UIB_DRAMTYPE 0x00000000
|
||||
#define DDR_UIB_DIMMTYPE 0x00000004
|
||||
#define DDR_UIB_LP4XMODE 0x00000000
|
||||
#define DDR_UIB_NUMDBYTE 0x00000004
|
||||
#define DDR_UIB_NUMACTIVEDBYTEDFI0 0x00000004
|
||||
#define DDR_UIB_NUMACTIVEDBYTEDFI1 0x00000000
|
||||
#define DDR_UIB_NUMANIB 0x00000008
|
||||
#define DDR_UIB_NUMRANK_DFI0 0x00000001
|
||||
#define DDR_UIB_NUMRANK_DFI1 0x00000001
|
||||
#define DDR_UIB_DRAMDATAWIDTH 0x00000010
|
||||
#define DDR_UIB_NUMPSTATES 0x00000001
|
||||
#define DDR_UIB_FREQUENCY_0 0x000004B0
|
||||
#define DDR_UIB_PLLBYPASS_0 0x00000000
|
||||
#define DDR_UIB_DFIFREQRATIO_0 0x00000001
|
||||
#define DDR_UIB_DFI1EXISTS 0x00000001
|
||||
#define DDR_UIB_TRAIN2D 0x00000000
|
||||
#define DDR_UIB_HARDMACROVER 0x00000003
|
||||
#define DDR_UIB_READDBIENABLE_0 0x00000000
|
||||
#define DDR_UIB_DFIMODE 0x00000000
|
||||
|
||||
#define DDR_UIA_LP4RXPREAMBLEMODE_0 0x00000000
|
||||
#define DDR_UIA_LP4POSTAMBLEEXT_0 0x00000000
|
||||
#define DDR_UIA_D4RXPREAMBLELENGTH_0 0x00000000
|
||||
#define DDR_UIA_D4TXPREAMBLELENGTH_0 0x00000000
|
||||
#define DDR_UIA_EXTCALRESVAL 0x00000000
|
||||
#define DDR_UIA_IS2TTIMING_0 0x00000000
|
||||
#define DDR_UIA_ODTIMPEDANCE_0 0x00000035
|
||||
#define DDR_UIA_TXIMPEDANCE_0 0x00000028
|
||||
#define DDR_UIA_ATXIMPEDANCE 0x00000028
|
||||
#define DDR_UIA_MEMALERTEN 0x00000000
|
||||
#define DDR_UIA_MEMALERTPUIMP 0x00000000
|
||||
#define DDR_UIA_MEMALERTVREFLEVEL 0x00000000
|
||||
#define DDR_UIA_MEMALERTSYNCBYPASS 0x00000000
|
||||
#define DDR_UIA_DISDYNADRTRI_0 0x00000001
|
||||
#define DDR_UIA_PHYMSTRTRAININTERVAL_0 0x00000000
|
||||
#define DDR_UIA_PHYMSTRMAXREQTOACK_0 0x00000000
|
||||
#define DDR_UIA_WDQSEXT 0x00000000
|
||||
#define DDR_UIA_CALINTERVAL 0x00000009
|
||||
#define DDR_UIA_CALONCE 0x00000000
|
||||
#define DDR_UIA_LP4RL_0 0x00000000
|
||||
#define DDR_UIA_LP4WL_0 0x00000000
|
||||
#define DDR_UIA_LP4WLS_0 0x00000000
|
||||
#define DDR_UIA_LP4DBIRD_0 0x00000000
|
||||
#define DDR_UIA_LP4DBIWR_0 0x00000000
|
||||
#define DDR_UIA_LP4NWR_0 0x00000000
|
||||
#define DDR_UIA_LP4LOWPOWERDRV 0x00000000
|
||||
#define DDR_UIA_DRAMBYTESWAP 0x00000000
|
||||
#define DDR_UIA_RXENBACKOFF 0x00000000
|
||||
#define DDR_UIA_TRAINSEQUENCECTRL 0x00000000
|
||||
#define DDR_UIA_SNPSUMCTLOPT 0x00000000
|
||||
#define DDR_UIA_SNPSUMCTLF0RC5X_0 0x00000000
|
||||
#define DDR_UIA_TXSLEWRISEDQ_0 0x0000000F
|
||||
#define DDR_UIA_TXSLEWFALLDQ_0 0x0000000F
|
||||
#define DDR_UIA_TXSLEWRISEAC 0x0000000F
|
||||
#define DDR_UIA_TXSLEWFALLAC 0x0000000F
|
||||
#define DDR_UIA_DISABLERETRAINING 0x00000001
|
||||
#define DDR_UIA_DISABLEPHYUPDATE 0x00000000
|
||||
#define DDR_UIA_ENABLEHIGHCLKSKEWFIX 0x00000000
|
||||
#define DDR_UIA_DISABLEUNUSEDADDRLNS 0x00000001
|
||||
#define DDR_UIA_PHYINITSEQUENCENUM 0x00000000
|
||||
#define DDR_UIA_ENABLEDFICSPOLARITYFIX 0x00000000
|
||||
#define DDR_UIA_PHYVREF 0x0000005E
|
||||
#define DDR_UIA_SEQUENCECTRL_0 0x0000031F
|
||||
|
||||
#define DDR_UIM_MR0_0 0x00000940
|
||||
#define DDR_UIM_MR1_0 0x00000103
|
||||
#define DDR_UIM_MR2_0 0x00000018
|
||||
#define DDR_UIM_MR3_0 0x00000000
|
||||
#define DDR_UIM_MR4_0 0x00000008
|
||||
#define DDR_UIM_MR5_0 0x00000460
|
||||
#define DDR_UIM_MR6_0 0x00000C16
|
||||
#define DDR_UIM_MR11_0 0x00000000
|
||||
#define DDR_UIM_MR12_0 0x00000000
|
||||
#define DDR_UIM_MR13_0 0x00000000
|
||||
#define DDR_UIM_MR14_0 0x00000000
|
||||
#define DDR_UIM_MR22_0 0x00000000
|
||||
|
||||
#define DDR_UIS_SWIZZLE_0 0x0000000C
|
||||
#define DDR_UIS_SWIZZLE_1 0x00000005
|
||||
#define DDR_UIS_SWIZZLE_2 0x00000013
|
||||
#define DDR_UIS_SWIZZLE_3 0x0000001A
|
||||
#define DDR_UIS_SWIZZLE_4 0x00000009
|
||||
#define DDR_UIS_SWIZZLE_5 0x00000003
|
||||
#define DDR_UIS_SWIZZLE_6 0x00000001
|
||||
#define DDR_UIS_SWIZZLE_7 0x00000019
|
||||
#define DDR_UIS_SWIZZLE_8 0x00000007
|
||||
#define DDR_UIS_SWIZZLE_9 0x00000004
|
||||
#define DDR_UIS_SWIZZLE_10 0x0000000A
|
||||
#define DDR_UIS_SWIZZLE_11 0x0000000D
|
||||
#define DDR_UIS_SWIZZLE_12 0x00000014
|
||||
#define DDR_UIS_SWIZZLE_13 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_14 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_15 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_16 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_17 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_18 0x00000006
|
||||
#define DDR_UIS_SWIZZLE_19 0x0000000B
|
||||
#define DDR_UIS_SWIZZLE_20 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_21 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_22 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_23 0x00000008
|
||||
#define DDR_UIS_SWIZZLE_24 0x00000002
|
||||
#define DDR_UIS_SWIZZLE_25 0x00000018
|
||||
#define DDR_UIS_SWIZZLE_26 0x1A13050C
|
||||
#define DDR_UIS_SWIZZLE_27 0x19010309
|
||||
#define DDR_UIS_SWIZZLE_28 0x0D0A0407
|
||||
#define DDR_UIS_SWIZZLE_29 0x00000014
|
||||
#define DDR_UIS_SWIZZLE_30 0x000B0600
|
||||
#define DDR_UIS_SWIZZLE_31 0x02080000
|
||||
#define DDR_UIS_SWIZZLE_32 0x00000018
|
||||
#define DDR_UIS_SWIZZLE_33 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_34 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_35 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_36 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_37 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_38 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_39 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_40 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_41 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_42 0x00000000
|
||||
#define DDR_UIS_SWIZZLE_43 0x00000000
|
||||
|
||||
#include "stm32mp25-ddr.dtsi"
|
|
@ -328,6 +328,13 @@
|
|||
reg = <0x44230000 0x10000>;
|
||||
};
|
||||
|
||||
ddr: ddr@48040000 {
|
||||
compatible = "st,stm32mp2-ddr";
|
||||
reg = <0x48040000 0x10000>,
|
||||
<0x48c00000 0x400000>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
pinctrl: pinctrl@44240000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "stm32mp257.dtsi"
|
||||
#include "stm32mp25xf.dtsi"
|
||||
#include "stm32mp257f-ev1-ca35tdcid-rcc.dtsi"
|
||||
#include "stm32mp25-ddr4-2x16Gbits-2x16bits-1200MHz.dtsi"
|
||||
#include "stm32mp25-pinctrl.dtsi"
|
||||
#include "stm32mp25xxai-pinctrl.dtsi"
|
||||
|
||||
|
@ -37,6 +38,13 @@
|
|||
};
|
||||
};
|
||||
|
||||
&ddr {
|
||||
vdd-supply = <&vdd_ddr>;
|
||||
vtt-supply = <&vtt_ddr>;
|
||||
vpp-supply = <&vpp_ddr>;
|
||||
vref-supply = <&vref_ddr>;
|
||||
};
|
||||
|
||||
&i2c7 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c7_pins_a>;
|
||||
|
|
|
@ -15,11 +15,13 @@
|
|||
#include <drivers/mmc.h>
|
||||
#include <drivers/st/regulator_fixed.h>
|
||||
#include <drivers/st/stm32mp2_ddr_helpers.h>
|
||||
#include <drivers/st/stm32mp2_ram.h>
|
||||
#include <drivers/st/stm32mp_pmic2.h>
|
||||
#include <drivers/st/stm32mp_risab_regs.h>
|
||||
#include <lib/fconf/fconf.h>
|
||||
#include <lib/fconf/fconf_dyn_cfg_getter.h>
|
||||
#include <lib/mmio.h>
|
||||
#include <lib/optee_utils.h>
|
||||
#include <lib/xlat_tables/xlat_tables_v2.h>
|
||||
#include <plat/common/platform.h>
|
||||
|
||||
|
@ -135,6 +137,21 @@ void bl2_el3_early_platform_setup(u_register_t arg0 __unused,
|
|||
|
||||
void bl2_platform_setup(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = stm32mp2_ddr_probe();
|
||||
if (ret != 0) {
|
||||
ERROR("DDR probe: error %d\n", ret);
|
||||
panic();
|
||||
}
|
||||
|
||||
/* Map DDR for binary load, now with cacheable attribute */
|
||||
ret = mmap_add_dynamic_region(STM32MP_DDR_BASE, STM32MP_DDR_BASE,
|
||||
STM32MP_DDR_MAX_SIZE, MT_MEMORY | MT_RW | MT_SECURE);
|
||||
if (ret < 0) {
|
||||
ERROR("DDR mapping: error %d\n", ret);
|
||||
panic();
|
||||
}
|
||||
}
|
||||
|
||||
static void reset_backup_domain(void)
|
||||
|
@ -258,10 +275,14 @@ int bl2_plat_handle_post_image_load(unsigned int image_id)
|
|||
{
|
||||
int err = 0;
|
||||
bl_mem_params_node_t *bl_mem_params = get_bl_mem_params_node(image_id);
|
||||
bl_mem_params_node_t *pager_mem_params;
|
||||
const struct dyn_cfg_dtb_info_t *config_info;
|
||||
unsigned int i;
|
||||
const unsigned int image_ids[] = {
|
||||
BL31_IMAGE_ID,
|
||||
BL32_IMAGE_ID,
|
||||
BL33_IMAGE_ID,
|
||||
HW_CONFIG_ID,
|
||||
};
|
||||
|
||||
assert(bl_mem_params != NULL);
|
||||
|
@ -305,6 +326,27 @@ int bl2_plat_handle_post_image_load(unsigned int image_id)
|
|||
case BL31_IMAGE_ID:
|
||||
bl_mem_params->ep_info.pc = config_info->config_addr;
|
||||
break;
|
||||
|
||||
case BL32_IMAGE_ID:
|
||||
bl_mem_params->ep_info.pc = config_info->config_addr;
|
||||
|
||||
/* In case of OPTEE, initialize address space with tos_fw addr */
|
||||
pager_mem_params = get_bl_mem_params_node(BL32_EXTRA1_IMAGE_ID);
|
||||
if (pager_mem_params != NULL) {
|
||||
pager_mem_params->image_info.image_base =
|
||||
config_info->config_addr;
|
||||
pager_mem_params->image_info.image_max_size =
|
||||
config_info->config_max_size;
|
||||
}
|
||||
break;
|
||||
|
||||
case BL33_IMAGE_ID:
|
||||
bl_mem_params->ep_info.pc = config_info->config_addr;
|
||||
break;
|
||||
|
||||
case HW_CONFIG_ID:
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -317,6 +359,30 @@ int bl2_plat_handle_post_image_load(unsigned int image_id)
|
|||
|
||||
break;
|
||||
|
||||
case BL32_IMAGE_ID:
|
||||
if ((bl_mem_params->image_info.image_base != 0UL) &&
|
||||
(optee_header_is_valid(bl_mem_params->image_info.image_base))) {
|
||||
/* BL32 is OP-TEE header */
|
||||
bl_mem_params->ep_info.pc = bl_mem_params->image_info.image_base;
|
||||
pager_mem_params = get_bl_mem_params_node(BL32_EXTRA1_IMAGE_ID);
|
||||
assert(pager_mem_params != NULL);
|
||||
|
||||
err = parse_optee_header(&bl_mem_params->ep_info,
|
||||
&pager_mem_params->image_info,
|
||||
NULL);
|
||||
if (err != 0) {
|
||||
ERROR("OPTEE header parse error.\n");
|
||||
panic();
|
||||
}
|
||||
|
||||
/* Set optee boot info from parsed header data */
|
||||
bl_mem_params->ep_info.args.arg0 = 0U; /* Unused */
|
||||
bl_mem_params->ep_info.args.arg1 = 0U; /* Unused */
|
||||
bl_mem_params->ep_info.args.arg2 = 0U; /* No DT supported */
|
||||
}
|
||||
break;
|
||||
|
||||
case BL33_IMAGE_ID:
|
||||
default:
|
||||
/* Do nothing in default case */
|
||||
break;
|
||||
|
|
|
@ -63,12 +63,74 @@ static bl_mem_params_node_t bl2_mem_params_descs[] = {
|
|||
|
||||
.ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS),
|
||||
|
||||
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
|
||||
VERSION_2, image_info_t,
|
||||
IMAGE_ATTRIB_SKIP_LOADING),
|
||||
|
||||
.next_handoff_image_id = BL32_IMAGE_ID,
|
||||
},
|
||||
|
||||
/* Fill BL32 related information */
|
||||
{
|
||||
.image_id = BL32_IMAGE_ID,
|
||||
|
||||
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
|
||||
VERSION_2, entry_point_info_t,
|
||||
SECURE | EXECUTABLE),
|
||||
|
||||
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
|
||||
VERSION_2, image_info_t,
|
||||
IMAGE_ATTRIB_SKIP_LOADING),
|
||||
|
||||
.next_handoff_image_id = BL33_IMAGE_ID,
|
||||
},
|
||||
|
||||
/* Fill BL32 external 1 image related information */
|
||||
{
|
||||
.image_id = BL32_EXTRA1_IMAGE_ID,
|
||||
|
||||
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
|
||||
VERSION_2, entry_point_info_t,
|
||||
SECURE | NON_EXECUTABLE),
|
||||
|
||||
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
|
||||
VERSION_2, image_info_t,
|
||||
IMAGE_ATTRIB_SKIP_LOADING),
|
||||
|
||||
.next_handoff_image_id = INVALID_IMAGE_ID,
|
||||
},
|
||||
|
||||
/* Fill HW_CONFIG related information if it exists */
|
||||
{
|
||||
.image_id = HW_CONFIG_ID,
|
||||
|
||||
SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
|
||||
VERSION_2, entry_point_info_t,
|
||||
NON_SECURE | NON_EXECUTABLE),
|
||||
|
||||
SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
|
||||
VERSION_2, image_info_t,
|
||||
IMAGE_ATTRIB_SKIP_LOADING),
|
||||
|
||||
.next_handoff_image_id = INVALID_IMAGE_ID,
|
||||
},
|
||||
|
||||
/* Fill BL33 related information */
|
||||
{
|
||||
.image_id = BL33_IMAGE_ID,
|
||||
|
||||
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
|
||||
VERSION_2, entry_point_info_t,
|
||||
NON_SECURE | EXECUTABLE),
|
||||
|
||||
.ep_info.spsr = SPSR_64(MODE_EL1, MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS),
|
||||
|
||||
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
|
||||
VERSION_2, image_info_t,
|
||||
IMAGE_ATTRIB_SKIP_LOADING),
|
||||
|
||||
.next_handoff_image_id = INVALID_IMAGE_ID,
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)
|
||||
|
|
Loading…
Add table
Reference in a new issue