params_setup.c 765 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2019, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <lib/bl_aux_params/bl_aux_params.h>
  7. #include <common/debug.h>
  8. #include <plat_params.h>
  9. #include <string.h>
  10. static struct bl_aux_gpio_info rst_gpio;
  11. struct bl_aux_gpio_info *plat_get_mtk_gpio_reset(void)
  12. {
  13. return &rst_gpio;
  14. }
  15. static bool mtk_aux_param_handler(struct bl_aux_param_header *param)
  16. {
  17. /* Store platform parameters for later processing if needed. */
  18. switch (param->type) {
  19. case BL_AUX_PARAM_MTK_RESET_GPIO:
  20. rst_gpio = ((struct bl_aux_param_gpio *)param)->gpio;
  21. return true;
  22. }
  23. return false;
  24. }
  25. void params_early_setup(u_register_t plat_param_from_bl2)
  26. {
  27. bl_aux_params_parse(plat_param_from_bl2, mtk_aux_param_handler);
  28. }