cmdq_pkt_write_s(9)
π cmdq_pkt_write_s β like, the CMDQ packet write_s appender bestie
okay so real talk, this is a page from the Kernel API Manual (yes the (9) section, we love a kernel-internals moment β¨) and it's all about cmdq_pkt_write_s. Buckle up, it's giving "low-level but make it cute".
πΈ NAME πΈ
cmdq_pkt_write_s β append a write_s command to the CMDQ packet. that's it, that's the whole personality π
β¨ SYNOPSIS β¨
int cmdq_pkt_write_s (struct cmdq_pkt *pkt , u16 high_addr_reg_idx , u16
addr_low , u16 src_reg_idx );
literally the whole signature, don't @ me, it returns an int π
π«Ά ARGUMENTS π«Ά
pktβ the CMDQ packet. the main character, the canvas, the whole vibe πhigh_addr_reg_idxβ the internal register ID that's holding the high address of pa. yep, it's au16, and yep, it's an index not an address, lowkey important πaddr_lowβ the low address of pa. the bottom half of the address situation πsrc_reg_idxβ the CMDQ internal register ID that caches the source value. so like, where the value's coming from π¦
π RETURN π
0 for success π β otherwise the error code gets returned. not zero? not slay. go check that error code bestie π
π₯ DESCRIPTION π₯
so the whole point: this supports writing a value to a physical address without subsys. no subsys needed, we're going direct, main character energy fr fr π
here's the little ritual you gotta do tho, don't skip steps:
- use
CMDQ_ADDR_HIGHto get the high address, then callcmdq_pkt_assignto assign that value into an internal reg β¨ - also use
CMDQ_ADDR_LOWto get the low address, and that's what you pass as theaddr_lowparameter when you call this function π
that's the recipe. high goes through the reg + cmdq_pkt_assign, low goes straight in as addr_low. iconic, honestly π§
π SEE ALSO π
kernel file ./include/linux/soc/mediatek/mtk-cmdq.h β go read it, it's the source of truth π
and the whole friend group (yes, all of them, no we're not leaving anyone out):
cmdq_dev_get_client_reg(9), cmdq_mbox_create(9), cmdq_mbox_destroy(9), cmdq_pkt_create(9), cmdq_pkt_destroy(9), cmdq_pkt_write(9), cmdq_pkt_write_pa(9), cmdq_pkt_write_subsys(9), cmdq_pkt_write_mask(9), cmdq_pkt_write_mask_pa(9), cmdq_pkt_write_mask_subsys(9), cmdq_pkt_write_s_mask(9), cmdq_pkt_write_s_value(9), cmdq_pkt_write_s_mask_value(9), cmdq_pkt_mem_move(9), cmdq_pkt_wfe(9), cmdq_pkt_acquire_event(9), cmdq_pkt_clear_event(9), cmdq_pkt_set_event(9), cmdq_pkt_poll(9), cmdq_pkt_poll_mask(9), cmdq_pkt_logic_command(9), cmdq_pkt_assign(9), cmdq_pkt_poll_addr(9), cmdq_pkt_jump_abs(9), cmdq_pkt_jump_rel(9), cmdq_pkt_jump_rel_temp(9), cmdq_pkt_eoc(9) π
ngl if you got all the way here you're officially a CMDQ girlie now, no cap π«Ά
alright that's the page!! it lives at ./include/linux/soc/mediatek, dated October 2026, and the page itself is cmdq_pkt_write_s(9) β mwah, bye bestie ππ
π¦ 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