diff --git a/bdk/soc/fuse.c b/bdk/soc/fuse.c index 466a7a2..b493809 100644 --- a/bdk/soc/fuse.c +++ b/bdk/soc/fuse.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -67,6 +68,22 @@ u32 fuse_read_odm_keygen_rev() return 0; } +u32 fuse_read_hw_type() +{ + if (hw_get_chip_id() == GP_HIDREV_MAJOR_T210B01) + { + switch ((fuse_read_odm(4) & 0xF0000) >> 16) + { + case 1: + return FUSE_NX_HW_TYPE_IOWA; + case 2: + return FUSE_NX_HW_TYPE_HOAG; + } + } + + return FUSE_NX_HW_TYPE_ICOSA; +} + u8 fuse_count_burnt(u32 val) { u8 burnt_fuses = 0; @@ -339,8 +356,8 @@ int fuse_read_evp_thunk(u32 *iram_evp_thunks, u32 *iram_evp_thunks_len) bool fuse_check_patched_rcm() { - // Check if XUSB in use. - if (FUSE(FUSE_RESERVED_SW) & (1<<7)) + // Check if XUSB in use or Tegra X1+. + if (FUSE(FUSE_RESERVED_SW) & (1<<7) || hw_get_chip_id() == GP_HIDREV_MAJOR_T210B01) return true; // Check if RCM is ipatched. diff --git a/bdk/soc/fuse.h b/bdk/soc/fuse.h index ae96096..3d33fdc 100644 --- a/bdk/soc/fuse.h +++ b/bdk/soc/fuse.h @@ -75,9 +75,17 @@ /*! Fuse cache registers. */ #define FUSE_RESERVED_ODMX(x) (0x1C8 + 4 * (x)) +enum +{ + FUSE_NX_HW_TYPE_ICOSA, + FUSE_NX_HW_TYPE_IOWA, + FUSE_NX_HW_TYPE_HOAG +}; + void fuse_disable_program(); u32 fuse_read_odm(u32 idx); u32 fuse_read_odm_keygen_rev(); +u32 fuse_read_hw_type(); u8 fuse_count_burnt(u32 val); void fuse_wait_idle(); int fuse_read_ipatch(void (*ipatch)(u32 offset, u32 value));