Skip to content

Commit

Permalink
Merge pull request RedPill-TTG#13 from fbelavenuto/jim3ma-patches
Browse files Browse the repository at this point in the history
Patches by @jim3ma to fix power supply issues
  • Loading branch information
fbelavenuto authored Dec 19, 2022
2 parents 6ccfbe4 + de375e5 commit c297b1d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions shim/bios/bios_shims_collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ static int bios_get_buz_clr(unsigned char *state)
return 0;
}

static int bios_get_power_status(POWER_INFO *power)
{
power->power_1 = POWER_STATUS_GOOD;
power->power_2 = POWER_STATUS_GOOD;
return 0;
}

/***************************************** Debug shims for unknown bios functions **************************************/
DECLARE_NULL_ZERO_INT(VTK_SET_FAN_STATE);
DECLARE_NULL_ZERO_INT(VTK_SET_DISK_LED);
Expand Down Expand Up @@ -137,6 +144,7 @@ bool shim_bios_module(const struct hw_config *hw, struct module *mod, unsigned l
SHIM_TO_NULL_ZERO_INT(VTK_SET_ALR_LED);
_shim_bios_module_entry(VTK_GET_BUZ_CLR, bios_get_buz_clr);
SHIM_TO_NULL_ZERO_INT(VTK_SET_BUZ_CLR);
_shim_bios_module_entry(VTK_GET_PWR_STATUS, bios_get_power_status);
SHIM_TO_NULL_ZERO_INT(VTK_SET_CPU_FAN_STATUS);
SHIM_TO_NULL_ZERO_INT(VTK_SET_PHY_LED);
SHIM_TO_NULL_ZERO_INT(VTK_SET_HDD_ACT_LED);
Expand Down
10 changes: 10 additions & 0 deletions shim/bios/mfgbios_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ enum MfgCompatCopyBtnState {
MFGC_BTN_UP = 1, //aka not pressed
};

typedef enum {
POWER_STATUS_BAD = 0,
POWER_STATUS_GOOD,
} SYNO_POWER_STATUS;

typedef struct _tag_POWER_INFO {
SYNO_POWER_STATUS power_1;
SYNO_POWER_STATUS power_2;
} POWER_INFO;

typedef int (*mfgc_void_cb)(void); //int f(void)
typedef int (*mfgc_time_cb)(struct MfgCompatTime *); //int f(MfgCompatTime *)
typedef int (*mfgc_get_fan_state_cb)(int, enum MfgCompatFanStatus *); //int f(int, MfgCompatFanStatus *)
Expand Down
2 changes: 2 additions & 0 deletions shim/disable_exectutables.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define BOOTLOADER_UPDATE1_PATH "uboot_do_upd.sh"
#define BOOTLOADER_UPDATE2_PATH "./uboot_do_upd.sh"
#define SAS_FW_UPDATE_PATH "/tmpData/upd@te/sas_fw_upgrade_tool"
#define OOB_FW_UPDATE_PATH "/usr/syno/sbin/syno_oob_fw_upgrade"

int register_disable_executables_shim(void)
{
Expand All @@ -20,6 +21,7 @@ int register_disable_executables_shim(void)
|| (out = add_blocked_execve_filename(BOOTLOADER_UPDATE2_PATH)) != 0
|| (out = add_blocked_execve_filename(PSTORE_PATH)) != 0
|| (out = add_blocked_execve_filename(SAS_FW_UPDATE_PATH)) != 0
|| (out = add_blocked_execve_filename(OOB_FW_UPDATE_PATH)) != 0
) {
pr_loc_bug("Failed to disable some executables");
return out;
Expand Down

0 comments on commit c297b1d

Please sign in to comment.