T Michael Turney | b97e6f7 | 2021-03-18 09:16:44 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <arch/stages.h> |
Ravi Kumar Bokka | d11c814 | 2021-07-05 21:03:56 +0530 | [diff] [blame] | 4 | #include <soc/usb/usb_common.h> |
T Michael Turney | b97e6f7 | 2021-03-18 09:16:44 -0700 | [diff] [blame] | 5 | #include <soc/qclib_common.h> |
Shelley Chen | ffebd49 | 2021-09-28 12:42:11 -0700 | [diff] [blame] | 6 | #include "board.h" |
Ravi Kumar Bokka | 5afeba3 | 2021-01-04 14:28:14 +0530 | [diff] [blame] | 7 | #include <soc/shrm.h> |
Sudheer Kumar Amrabadi | dfe817e | 2022-03-22 20:00:29 +0530 | [diff] [blame^] | 8 | #include <soc/cpucp.h> |
T Michael Turney | b97e6f7 | 2021-03-18 09:16:44 -0700 | [diff] [blame] | 9 | |
Ravi Kumar Bokka | d11c814 | 2021-07-05 21:03:56 +0530 | [diff] [blame] | 10 | static void prepare_usb(void) |
| 11 | { |
| 12 | /* |
| 13 | * Do DWC3 core and phy reset. Kick these resets |
| 14 | * off early so they get at least 1ms to settle. |
| 15 | */ |
| 16 | reset_usb0(); |
| 17 | } |
| 18 | |
T Michael Turney | b97e6f7 | 2021-03-18 09:16:44 -0700 | [diff] [blame] | 19 | void platform_romstage_main(void) |
| 20 | { |
Ravi Kumar Bokka | 5afeba3 | 2021-01-04 14:28:14 +0530 | [diff] [blame] | 21 | shrm_fw_load_reset(); |
Sudheer Kumar Amrabadi | dfe817e | 2022-03-22 20:00:29 +0530 | [diff] [blame^] | 22 | cpucp_prepare(); |
T Michael Turney | b97e6f7 | 2021-03-18 09:16:44 -0700 | [diff] [blame] | 23 | /* QCLib: DDR init & train */ |
| 24 | qclib_load_and_run(); |
Ravi Kumar Bokka | d11c814 | 2021-07-05 21:03:56 +0530 | [diff] [blame] | 25 | prepare_usb(); |
Shelley Chen | ffebd49 | 2021-09-28 12:42:11 -0700 | [diff] [blame] | 26 | /* This rail needs to be stable by the time we take the FPMCU out of |
| 27 | reset in ramstage, so already turn it on here. This needs to happen |
| 28 | at least 200ms after this pin was first driven low in the bootblock. */ |
| 29 | if (CONFIG(HEROBRINE_HAS_FINGERPRINT)) |
| 30 | gpio_output(GPIO_EN_FP_RAILS, 1); |
T Michael Turney | b97e6f7 | 2021-03-18 09:16:44 -0700 | [diff] [blame] | 31 | } |