18c2ecf20Sopenharmony_ciHisilicon Hi6220 Mailbox Driver 28c2ecf20Sopenharmony_ci=============================== 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciHisilicon Hi6220 mailbox supports up to 32 channels. Each channel 58c2ecf20Sopenharmony_ciis unidirectional with a maximum message size of 8 words. I/O is 68c2ecf20Sopenharmony_ciperformed using register access (there is no DMA) and the cell 78c2ecf20Sopenharmony_ciraises an interrupt when messages are received. 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciMailbox Device Node: 108c2ecf20Sopenharmony_ci==================== 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciRequired properties: 138c2ecf20Sopenharmony_ci-------------------- 148c2ecf20Sopenharmony_ci- compatible: Shall be "hisilicon,hi6220-mbox" 158c2ecf20Sopenharmony_ci- reg: Contains the mailbox register address range (base 168c2ecf20Sopenharmony_ci address and length); the first item is for IPC 178c2ecf20Sopenharmony_ci registers, the second item is shared buffer for 188c2ecf20Sopenharmony_ci slots. 198c2ecf20Sopenharmony_ci- #mbox-cells: Common mailbox binding property to identify the number 208c2ecf20Sopenharmony_ci of cells required for the mailbox specifier. Must be 3. 218c2ecf20Sopenharmony_ci <&phandle slot_id dst_irq ack_irq> 228c2ecf20Sopenharmony_ci phandle: Label name of mailbox controller 238c2ecf20Sopenharmony_ci slot_id: Slot id used either for TX or RX 248c2ecf20Sopenharmony_ci dst_irq: IRQ identifier index number which used by MCU 258c2ecf20Sopenharmony_ci ack_irq: IRQ identifier index number with generating a 268c2ecf20Sopenharmony_ci TX/RX interrupt to application processor, 278c2ecf20Sopenharmony_ci mailbox driver uses it to acknowledge interrupt 288c2ecf20Sopenharmony_ci- interrupts: Contains the interrupt information for the mailbox 298c2ecf20Sopenharmony_ci device. The format is dependent on which interrupt 308c2ecf20Sopenharmony_ci controller the SoCs use. 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciOptional Properties: 338c2ecf20Sopenharmony_ci-------------------- 348c2ecf20Sopenharmony_ci- hi6220,mbox-tx-noirq: Property of MCU firmware's feature, so mailbox driver 358c2ecf20Sopenharmony_ci use this flag to ask MCU to enable "automatic idle 368c2ecf20Sopenharmony_ci flag" mode or IRQ generated mode to acknowledge a TX 378c2ecf20Sopenharmony_ci completion. 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciExample: 408c2ecf20Sopenharmony_ci-------- 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci mailbox: mailbox@f7510000 { 438c2ecf20Sopenharmony_ci compatible = "hisilicon,hi6220-mbox"; 448c2ecf20Sopenharmony_ci reg = <0x0 0xf7510000 0x0 0x1000>, /* IPC_S */ 458c2ecf20Sopenharmony_ci <0x0 0x06dff800 0x0 0x0800>; /* Mailbox */ 468c2ecf20Sopenharmony_ci interrupt-parent = <&gic>; 478c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; 488c2ecf20Sopenharmony_ci #mbox-cells = <3>; 498c2ecf20Sopenharmony_ci }; 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ciMailbox client 538c2ecf20Sopenharmony_ci=============== 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ciRequired properties: 568c2ecf20Sopenharmony_ci-------------------- 578c2ecf20Sopenharmony_ci- compatible: Many (See the client docs). 588c2ecf20Sopenharmony_ci- mboxes: Standard property to specify a Mailbox (See ./mailbox.txt) 598c2ecf20Sopenharmony_ci Cells must match 'mbox-cells' (See Mailbox Device Node above). 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ciOptional Properties: 628c2ecf20Sopenharmony_ci-------------------- 638c2ecf20Sopenharmony_ci- mbox-names: Name given to channels seen in the 'mboxes' property. 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ciExample: 668c2ecf20Sopenharmony_ci-------- 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci stub_clock: stub_clock { 698c2ecf20Sopenharmony_ci compatible = "hisilicon,hi6220-stub-clk"; 708c2ecf20Sopenharmony_ci hisilicon,hi6220-clk-sram = <&sram>; 718c2ecf20Sopenharmony_ci #clock-cells = <1>; 728c2ecf20Sopenharmony_ci mbox-names = "mbox-tx", "mbox-rx"; 738c2ecf20Sopenharmony_ci mboxes = <&mailbox 1 0 11>, <&mailbox 0 1 10>; 748c2ecf20Sopenharmony_ci }; 75