}
#endif
+enum k3_device_type get_device_type(void)
+{
+ u32 sys_status = readl(K3_SEC_MGR_SYS_STATUS);
+
+ u32 sys_dev_type = (sys_status & SYS_STATUS_DEV_TYPE_MASK) >>
+ SYS_STATUS_DEV_TYPE_SHIFT;
+
+ u32 sys_sub_type = (sys_status & SYS_STATUS_SUB_TYPE_MASK) >>
+ SYS_STATUS_SUB_TYPE_SHIFT;
+
+ switch (sys_dev_type) {
+ case SYS_STATUS_DEV_TYPE_GP:
+ return K3_DEVICE_TYPE_GP;
+ case SYS_STATUS_DEV_TYPE_TEST:
+ return K3_DEVICE_TYPE_TEST;
+ case SYS_STATUS_DEV_TYPE_EMU:
+ return K3_DEVICE_TYPE_EMU;
+ case SYS_STATUS_DEV_TYPE_HS:
+ if (sys_sub_type == SYS_STATUS_SUB_TYPE_VAL_FS)
+ return K3_DEVICE_TYPE_HS_FS;
+ else
+ return K3_DEVICE_TYPE_HS_SE;
+ default:
+ return K3_DEVICE_TYPE_BAD;
+ }
+}
+
#if defined(CONFIG_DISPLAY_CPUINFO)
+static const char *get_device_type_name(void)
+{
+ enum k3_device_type type = get_device_type();
+
+ switch (type) {
+ case K3_DEVICE_TYPE_GP:
+ return "GP";
+ case K3_DEVICE_TYPE_TEST:
+ return "TEST";
+ case K3_DEVICE_TYPE_EMU:
+ return "EMU";
+ case K3_DEVICE_TYPE_HS_FS:
+ return "HS-FS";
+ case K3_DEVICE_TYPE_HS_SE:
+ return "HS-SE";
+ default:
+ return "BAD";
+ }
+}
+
int print_cpuinfo(void)
{
struct udevice *soc;
ret = soc_get_revision(soc, name, 64);
if (!ret) {
- printf("%s\n", name);
+ printf("%s ", name);
}
+ printf("%s\n", get_device_type_name());
+
return 0;
}
#endif
u16 regions;
};
+enum k3_device_type {
+ K3_DEVICE_TYPE_BAD,
+ K3_DEVICE_TYPE_GP,
+ K3_DEVICE_TYPE_TEST,
+ K3_DEVICE_TYPE_EMU,
+ K3_DEVICE_TYPE_HS_FS,
+ K3_DEVICE_TYPE_HS_SE,
+};
+
void setup_k3_mpu_regions(void);
int early_console_init(void);
void disable_linefill_optimization(void);
void spl_enable_dcache(void);
void mmr_unlock(phys_addr_t base, u32 partition);
bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
+enum k3_device_type get_device_type(void);
void ti_secure_image_post_process(void **p_image, size_t *p_size);
#define JTAG_ID_VARIANT_MASK (0xf << 28)
#define JTAG_ID_PARTNO_SHIFT 12
#define JTAG_ID_PARTNO_MASK (0xffff << 12)
+#define K3_SEC_MGR_SYS_STATUS 0x44234100
+#define SYS_STATUS_DEV_TYPE_SHIFT 0
+#define SYS_STATUS_DEV_TYPE_MASK (0xf)
+#define SYS_STATUS_DEV_TYPE_GP 0x3
+#define SYS_STATUS_DEV_TYPE_TEST 0x5
+#define SYS_STATUS_DEV_TYPE_EMU 0x9
+#define SYS_STATUS_DEV_TYPE_HS 0xa
+#define SYS_STATUS_SUB_TYPE_SHIFT 8
+#define SYS_STATUS_SUB_TYPE_MASK (0xf << 8)
+#define SYS_STATUS_SUB_TYPE_VAL_FS 0xa
#define K3_ROM_BOOT_HEADER_MAGIC "EXTBOOT"