Tom Rini | 8b0c8a1 | 2018-05-06 18:27:01 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ |
Patrick Delaunay | 01e3afe | 2018-03-19 19:09:21 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015-2017, STMicroelectronics - All Rights Reserved |
Patrick Delaunay | 01e3afe | 2018-03-19 19:09:21 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
Patrick Delaunay | db33b0e | 2020-02-26 11:26:43 +0100 | [diff] [blame] | 6 | /* ID = Device Version (bit31:16) + Device Part Number (RPN) (bit7:0) */ |
Patrick Delaunay | 45c82d2 | 2019-02-27 17:01:13 +0100 | [diff] [blame] | 7 | #define CPU_STM32MP157Cxx 0x05000000 |
| 8 | #define CPU_STM32MP157Axx 0x05000001 |
| 9 | #define CPU_STM32MP153Cxx 0x05000024 |
| 10 | #define CPU_STM32MP153Axx 0x05000025 |
| 11 | #define CPU_STM32MP151Cxx 0x0500002E |
| 12 | #define CPU_STM32MP151Axx 0x0500002F |
Patrick Delaunay | db33b0e | 2020-02-26 11:26:43 +0100 | [diff] [blame] | 13 | #define CPU_STM32MP157Fxx 0x05000080 |
| 14 | #define CPU_STM32MP157Dxx 0x05000081 |
| 15 | #define CPU_STM32MP153Fxx 0x050000A4 |
| 16 | #define CPU_STM32MP153Dxx 0x050000A5 |
| 17 | #define CPU_STM32MP151Fxx 0x050000AE |
| 18 | #define CPU_STM32MP151Dxx 0x050000AF |
Patrick Delaunay | 01e3afe | 2018-03-19 19:09:21 +0100 | [diff] [blame] | 19 | |
Patrick Delaunay | 45c82d2 | 2019-02-27 17:01:13 +0100 | [diff] [blame] | 20 | /* return CPU_STMP32MP...Xxx constants */ |
Patrick Delaunay | 01e3afe | 2018-03-19 19:09:21 +0100 | [diff] [blame] | 21 | u32 get_cpu_type(void); |
| 22 | |
Patrick Delaunay | 79bc640 | 2020-03-18 09:24:48 +0100 | [diff] [blame^] | 23 | #define CPU_DEV_STM32MP15 0x500 |
| 24 | |
| 25 | /* return CPU_DEV constants */ |
| 26 | u32 get_cpu_dev(void); |
| 27 | |
Patrick Delaunay | 01e3afe | 2018-03-19 19:09:21 +0100 | [diff] [blame] | 28 | #define CPU_REVA 0x1000 |
| 29 | #define CPU_REVB 0x2000 |
Patrick Delaunay | c8d4afe | 2020-01-28 10:11:06 +0100 | [diff] [blame] | 30 | #define CPU_REVZ 0x2001 |
Patrick Delaunay | 01e3afe | 2018-03-19 19:09:21 +0100 | [diff] [blame] | 31 | |
| 32 | /* return CPU_REV constants */ |
| 33 | u32 get_cpu_rev(void); |
Patrick Delaunay | c74d634 | 2019-07-05 17:20:13 +0200 | [diff] [blame] | 34 | |
| 35 | /* Get Package options from OTP */ |
| 36 | u32 get_cpu_package(void); |
| 37 | |
| 38 | #define PKG_AA_LBGA448 4 |
| 39 | #define PKG_AB_LBGA354 3 |
| 40 | #define PKG_AC_TFBGA361 2 |
| 41 | #define PKG_AD_TFBGA257 1 |
| 42 | |
Patrick Delaunay | 3e738f2 | 2020-02-12 19:37:43 +0100 | [diff] [blame] | 43 | /* Get SOC name */ |
| 44 | #define SOC_NAME_SIZE 20 |
| 45 | void get_soc_name(char name[SOC_NAME_SIZE]); |
| 46 | |
Patrick Delaunay | 18660a6 | 2019-02-27 17:01:12 +0100 | [diff] [blame] | 47 | /* return boot mode */ |
| 48 | u32 get_bootmode(void); |
Marek Vasut | 187cae2 | 2019-12-18 16:52:19 +0100 | [diff] [blame] | 49 | |
| 50 | int setup_mac_address(void); |