2018-05-06 22:27:01 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
|
2018-03-19 18:09:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015-2017, STMicroelectronics - All Rights Reserved
|
|
|
|
*/
|
|
|
|
|
2022-05-20 16:24:46 +00:00
|
|
|
/* ID = Device Version (bit31:16) + Device Part Number (RPN) (bit15:0) */
|
2019-02-27 16:01:13 +00:00
|
|
|
#define CPU_STM32MP157Cxx 0x05000000
|
|
|
|
#define CPU_STM32MP157Axx 0x05000001
|
|
|
|
#define CPU_STM32MP153Cxx 0x05000024
|
|
|
|
#define CPU_STM32MP153Axx 0x05000025
|
|
|
|
#define CPU_STM32MP151Cxx 0x0500002E
|
|
|
|
#define CPU_STM32MP151Axx 0x0500002F
|
2020-02-26 10:26:43 +00:00
|
|
|
#define CPU_STM32MP157Fxx 0x05000080
|
|
|
|
#define CPU_STM32MP157Dxx 0x05000081
|
|
|
|
#define CPU_STM32MP153Fxx 0x050000A4
|
|
|
|
#define CPU_STM32MP153Dxx 0x050000A5
|
|
|
|
#define CPU_STM32MP151Fxx 0x050000AE
|
|
|
|
#define CPU_STM32MP151Dxx 0x050000AF
|
2018-03-19 18:09:21 +00:00
|
|
|
|
2022-05-20 16:24:46 +00:00
|
|
|
#define CPU_STM32MP135Cxx 0x05010000
|
|
|
|
#define CPU_STM32MP135Axx 0x05010001
|
|
|
|
#define CPU_STM32MP133Cxx 0x050100C0
|
|
|
|
#define CPU_STM32MP133Axx 0x050100C1
|
|
|
|
#define CPU_STM32MP131Cxx 0x050106C8
|
|
|
|
#define CPU_STM32MP131Axx 0x050106C9
|
|
|
|
#define CPU_STM32MP135Fxx 0x05010800
|
|
|
|
#define CPU_STM32MP135Dxx 0x05010801
|
|
|
|
#define CPU_STM32MP133Fxx 0x050108C0
|
|
|
|
#define CPU_STM32MP133Dxx 0x050108C1
|
|
|
|
#define CPU_STM32MP131Fxx 0x05010EC8
|
|
|
|
#define CPU_STM32MP131Dxx 0x05010EC9
|
|
|
|
|
2019-02-27 16:01:13 +00:00
|
|
|
/* return CPU_STMP32MP...Xxx constants */
|
2018-03-19 18:09:21 +00:00
|
|
|
u32 get_cpu_type(void);
|
|
|
|
|
2020-03-18 08:24:48 +00:00
|
|
|
#define CPU_DEV_STM32MP15 0x500
|
2022-05-20 16:24:46 +00:00
|
|
|
#define CPU_DEV_STM32MP13 0x501
|
2020-03-18 08:24:48 +00:00
|
|
|
|
|
|
|
/* return CPU_DEV constants */
|
|
|
|
u32 get_cpu_dev(void);
|
|
|
|
|
2022-04-15 13:00:43 +00:00
|
|
|
#define CPU_REV1 0x1000
|
|
|
|
#define CPU_REV1_1 0x1001
|
2022-06-30 08:20:16 +00:00
|
|
|
#define CPU_REV1_2 0x1003
|
2022-04-15 13:00:43 +00:00
|
|
|
#define CPU_REV2 0x2000
|
|
|
|
#define CPU_REV2_1 0x2001
|
2018-03-19 18:09:21 +00:00
|
|
|
|
2022-04-15 13:00:43 +00:00
|
|
|
/* return Silicon revision = REV_ID[15:0] of Device Version */
|
2018-03-19 18:09:21 +00:00
|
|
|
u32 get_cpu_rev(void);
|
2019-07-05 15:20:13 +00:00
|
|
|
|
|
|
|
/* Get Package options from OTP */
|
|
|
|
u32 get_cpu_package(void);
|
|
|
|
|
2022-05-20 16:24:42 +00:00
|
|
|
/* package used for STM32MP15x */
|
|
|
|
#define STM32MP15_PKG_AA_LBGA448 4
|
|
|
|
#define STM32MP15_PKG_AB_LBGA354 3
|
|
|
|
#define STM32MP15_PKG_AC_TFBGA361 2
|
|
|
|
#define STM32MP15_PKG_AD_TFBGA257 1
|
|
|
|
#define STM32MP15_PKG_UNKNOWN 0
|
2019-07-05 15:20:13 +00:00
|
|
|
|
2020-02-12 18:37:43 +00:00
|
|
|
/* Get SOC name */
|
|
|
|
#define SOC_NAME_SIZE 20
|
|
|
|
void get_soc_name(char name[SOC_NAME_SIZE]);
|
|
|
|
|
2019-02-27 16:01:12 +00:00
|
|
|
/* return boot mode */
|
|
|
|
u32 get_bootmode(void);
|
2019-12-18 15:52:19 +00:00
|
|
|
|
2022-05-20 16:24:47 +00:00
|
|
|
int get_eth_nb(void);
|
2019-12-18 15:52:19 +00:00
|
|
|
int setup_mac_address(void);
|
2020-05-25 10:19:45 +00:00
|
|
|
|
|
|
|
/* board power management : configure vddcore according OPP */
|
|
|
|
void board_vddcore_init(u32 voltage_mv);
|
2022-05-20 16:24:41 +00:00
|
|
|
|
2022-05-20 16:24:42 +00:00
|
|
|
/* weak function */
|
|
|
|
void stm32mp_cpu_init(void);
|
|
|
|
void stm32mp_misc_init(void);
|
|
|
|
|
2022-05-20 16:24:41 +00:00
|
|
|
/* helper function: read data from OTP */
|
|
|
|
u32 get_otp(int index, int shift, int mask);
|