#include <errno.h>
#include <asm/io.h>
#include <asm/imx-common/sci/sci.h>
+#include <asm/imx-common/boot_mode.h>
#include <asm/arch/i2c.h>
#include <asm/arch/clock.h>
#include <asm/armv8/mmu.h>
#include <elf.h>
#include <asm/arch/sid.h>
#include <asm/arch-imx/cpu.h>
+#include <asm/arch/sys_proto.h>
DECLARE_GLOBAL_DATA_PTR;
#define FUSE_MAC0_WORD0 452
#define FUSE_MAC0_WORD1 453
#define FUSE_MAC1_WORD0 454
-#define FUSE_MAC1_WORD1 455
+#define FUSE_MAC1_WORD1 455
void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
{
sc_err_t err;
imx8_config_smmu_sid(dev_sids, ARRAY_SIZE(dev_sids));
}
#endif
+
+enum boot_device get_boot_device(void)
+{
+ struct rom_sw_info_t **p =
+ (struct rom_sw_info_t **)ROM_SW_INFO_ADDR;
+
+ enum boot_device boot_dev = SD1_BOOT;
+ uint8_t boot_type = (*p)->boot_dev_info.dev_type;
+ uint8_t boot_instance = (*p)->boot_dev_info.instance;
+
+ switch (boot_type) {
+ case FLASH_TYPE_SD:
+ boot_dev = boot_instance + SD1_BOOT;
+ break;
+ case FLASH_TYPE_MMC:
+ boot_dev = boot_instance + MMC1_BOOT;
+ break;
+ case FLASH_TYPE_NAND:
+ boot_dev = NAND_BOOT;
+ break;
+ case FLASH_TYPE_FLEXSPINOR:
+ boot_dev = QSPI_BOOT;
+ break;
+ case BT_DEV_TYPE_SATA_DISK:
+ boot_dev = SATA_BOOT;
+ break;
+ case BT_DEV_TYPE_USB:
+ boot_dev = USB_BOOT;
+ break;
+ default:
+ break;
+ }
+
+ return boot_dev;
+}
*/
#include <asm/imx-common/sys_proto.h>
+#include <linux/types.h>
+
+enum boot_dev_type {
+ FLASH_TYPE_SD = 1,
+ FLASH_TYPE_MMC = 2,
+ FLASH_TYPE_NAND = 3,
+ FLASH_TYPE_FLEXSPINOR = 4,
+ FLASH_TYPE_WEIM = 5,
+ FLASH_TYPE_EEPROM = 6,
+ BT_DEV_TYPE_SATA_DISK = 7,
+
+ BT_DEV_TYPE_CAN = 0xC,
+ BT_DEV_TYPE_UART = 0xD,
+ BT_DEV_TYPE_USB = 0xE,
+ BT_DEV_TYPE_MEM_DEV = 0xF
+};
+
+struct boot_dev_info_t {
+ uint8_t bt_type;
+ uint8_t instance;
+ uint8_t dev_type;
+ uint8_t rsvd2;
+};
+
+struct rom_sw_info_t {
+ struct boot_dev_info_t boot_dev_info;
+ uint32_t core_freq;
+ uint32_t axi_freq;
+ uint32_t ddr_freq;
+ uint32_t rom_tick_freq;
+ uint32_t rsvd[3];
+};
int init_qspi_power(void);
int init_usb_power(void);