STRUCT EC_RESPONSE_FLASH_INFO_1(9)
π
struct ec_r...flash_info_1(9) β Kernel API Manual, but make it make sense
okay so bestie, welcome to the kernel API manual 9 section, and today's main character is struct ec_response_flash_info_1 π that's the response you get back from the flash info v1 command. iconic little reply struct, honestly.
β¨ NAME β¨
struct ec_response_flash_info_1 β the response to the flash info v1 command π that's it, that's the vibe.
πΈ SYNOPSIS πΈ
struct ec_response_flash_info_1 {
uint32_t flash_size;
uint32_t write_block_size;
uint32_t erase_block_size;
uint32_t protect_block_size;
uint32_t write_ideal_size;
uint32_t flags;
};
look at her. six uint32_t fields. no notes. π«Ά
π Members π
flash_sizeβ usable flash size, in bytes. that's the actual usable capacity bestie, not the marketing number πwrite_block_sizeβ write block size. your write offset and size both have to be a multiple of this. no cap, no exceptions β¨erase_block_sizeβ erase block size. erase offset and size must be a multiple of this too. match the vibe or it's not happening πprotect_block_sizeβ protection block size. protection offset and size must be a multiple of this. same energy, protection edition π₯write_ideal_sizeβ ideal write size in bytes β writes go fastest when the size is exactly this and the offset is a multiple of this. think about it: an EC might have a write buffer that can do half-page operations when the data is aligned, plus a slower word-at-a-time write mode. so like, aligned = slay, unaligned = π periodt.flagsβ flags! go look atEC_FLASH_INFO_*, that's where the lore lives π
π¦ Description π¦
so version 1 gives you the same initial fields as version 0, and then additional fields following after. it's giving glow-up, not rewrite π
also, tiny little compiler drama for you: gcc anonymous structs don't seem to get along with the __packed directive π and if they did β if they did β we'd define the version 0 structure as a sub-structure of this one. but they don't. so we can't. moving on. π
and version 2? version 2 supports flash banks of different sizes π here's how that goes:
- the caller specified the number of banks it has preallocated (
num_banks_desc) - the EC returns the number of banks describing the flash memory
- it adds banks descriptions up to
num_banks_desc
fr fr, that's the whole system.
π SEE ALSO π
kernel file ./include/linux/platform_data/cros_ec_commands.h β that's home base, go read it π
and the whole extended friend group:
struct ec_lpc_host_args(9)struct ec_host_request(9)struct ec_host_response(9)struct ec_response_proto_version(9)struct ec_params_hello(9)struct ec_response_hello(9)struct ec_response_get_version(9)struct ec_params_read_test(9)struct ec_response_read_test(9)struct ec_response_get_chip_info(9)struct ec_response_board_version(9)struct ec_params_read_memmap(9)struct ec_params_get_cmd_versions(9)struct ec_params_get_cmd_versions_v1(9)struct ec_response_get_cmd_versions(9)struct ec_response_get_comms_status(9)struct ec_response_get_protocol_info(9)struct ec_response_flash_info(9)struct ec_params_flash_read(9)struct ec_params_flash_write(9)struct ec_params_flash_erase(9)struct ec_params_flash_erase_v1(9)struct ec_params_flash_protect(9)struct ec_response_flash_protect(9)struct ec_params_flash_region_info(9)struct ec_params_flash_select(9)struct ec_params_cec_write(9)struct ec_params_cec_write_v1(9)struct ec_params_cec_read(9)struct ec_response_cec_read(9)struct ec_params_cec_set(9)struct ec_params_cec_get(9)struct ec_response_cec_get(9)struct ec_response_cec_port_count(9)struct ec_params_battery_static_info(9)struct ec_response_battery_static_info(9)struct ec_params_battery_dynamic_info(9)struct ec_response_battery_dynamic_info(9)struct ec_params_charger_control(9)
bestie the whole flash + cec + battery + charger cinematic universe is right there. iykyk π
okay that's the page!! π§ sign-off time: this one lives in ./include/linux/platform_data, dated October 2026, and the man page is struct ec_r...flash_info_1(9) β go forth and align your writes, ily, bye π
β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms