1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| void get_log_page_process(command_p command) { u32 bytes_to_return = ((command->get_log_page_dw10.number_of_dwords_lower & 0xFFF) + 1) << 2; if (emmc_firmware_executing_task_completion != 1) { store_admin_command(command, FUNC_TYPE_GET_LOGPAGE); return; } fn_memset_4bytes((void *)BAYBRIDGE_DATA_BUFFER, 0, 0x1000); switch (command->get_log_page_dw10.log_page_identifier) { case 0x01: error_information_process(command, bytes_to_return); break; case 0x02: smart_health_information_process(command, bytes_to_return); break; case 0x03: firmware_slot_information_process(command, bytes_to_return); break; case 0x05: commands_supported_and_effects(command, bytes_to_return); break; case 0xC0: read_out_header_parameter_process(command, bytes_to_return); break; default: send_complete(command->command_identifier, 0, 0, DO_NOT_RETRY | SCT_GENERIC_COMMAND_STATUS | SC_INVALID_FIELD_IN_COMMAND); break; } }
static void smart_health_information_process(command_p command, u32 bytes_to_return) { smart_health_information_log_t info = {0}; info.critical_warning_and_temperature = smart_data.critical_warning_and_temperature; info.percentage_used = smart_data.percentage_used; info.critical_warning_and_temperature |= 0x64 << 24; info.percentage_used |= 0x0A; info.data_units_read_low = leon2_cpu_64bits_swap(smart_data.data_units_read_low); info.data_units_written_low = leon2_cpu_64bits_swap(smart_data.data_units_written_low); info.host_read_commands_low = leon2_cpu_64bits_swap(smart_data.host_read_commands_low); info.host_write_commands_low = leon2_cpu_64bits_swap(smart_data.host_write_commands_low); info.power_cycles_low = leon2_cpu_64bits_swap(smart_data.power_cycles_low); info.power_on_hours_low = leon2_cpu_64bits_swap(smart_data.power_on_hours_low); fn_memcpy_4bytes((void *)BAYBRIDGE_DATA_BUFFER, &info, bytes_to_return); dma_data_transfer(command->prp.prp_entry1, command->prp.prp_entry2, bytes_to_return, 1, 1); send_complete(command->command_identifier, 0, 0, 0); }
|