board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support
[pandora-u-boot.git] / board / phytec / phycore_imx93 / phycore-imx93.c
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (C) 2023 PHYTEC Messtechnik GmbH
4  * Author: Christoph Stoidner <c.stoidner@phytec.de>
5  * Copyright (C) 2024 Mathieu Othacehe <m.othacehe@gmail.com>
6  */
7
8 #include <asm/arch-imx9/ccm_regs.h>
9 #include <asm/arch/sys_proto.h>
10 #include <asm/arch-imx9/imx93_pins.h>
11 #include <asm/arch/clock.h>
12 #include <asm/global_data.h>
13 #include <asm/mach-imx/boot_mode.h>
14 #include <env.h>
15
16 DECLARE_GLOBAL_DATA_PTR;
17
18 int board_init(void)
19 {
20         return 0;
21 }
22
23 int board_mmc_get_env_dev(int devno)
24 {
25         return devno;
26 }
27
28 int board_late_init(void)
29 {
30         switch (get_boot_device()) {
31         case SD2_BOOT:
32                 env_set_ulong("mmcdev", 1);
33                 break;
34         case MMC1_BOOT:
35                 env_set_ulong("mmcdev", 0);
36                 break;
37         default:
38                 break;
39         }
40
41         return 0;
42 }