STRUCT EC_RESPONSE_FLASH_INFO_1(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 at EC_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