Lines Matching +full:cmd +full:- +full:db
18 #include "libqtest-single.h"
21 #include "hw/i3c/remote-i3c.h"
46 FIELD(COMMAND_QUEUE_PORT, CMD, 7, 8)
56 FIELD(COMMAND_QUEUE_PORT, DB, 8, 8)
113 g_assert(sock != -1); in open_socket()
114 g_assert(bind(sock, (struct sockaddr *) &myaddr, sizeof(myaddr)) != -1); in open_socket()
118 g_assert(getsockname(sock, (struct sockaddr *) &myaddr , &addrlen) != -1); in open_socket()
119 g_assert(listen(sock, 1) != -1); in open_socket()
134 static AspeedI3CTransferCmd aspeed_i3c_create_xfer_cmd(uint8_t cmd, in aspeed_i3c_create_xfer_cmd() argument
142 .cmd = cmd, in aspeed_i3c_create_xfer_cmd()
143 .cp = (cmd != 0) ? 1 : 0, in aspeed_i3c_create_xfer_cmd()
148 .sdap = (cmd == 0x02) ? 1 : 0, /* Short data arg present. */ in aspeed_i3c_create_xfer_cmd()
155 static AspeedI3CTransferArg aspeed_i3c_create_xfer_arg(uint8_t db, in aspeed_i3c_create_xfer_arg() argument
160 .db = db, in aspeed_i3c_create_xfer_arg()
172 * Sanity check the enable write. I3C_RESUME is auto-cleared so don't in aspeed_i3c_enable()
194 AspeedI3CCmdQueueData cmd; in aspeed_i3c_send() local
216 * CMD is ignored due to this not being a CCC, and there is no defining in aspeed_i3c_send()
219 cmd.transfer_cmd = aspeed_i3c_create_xfer_cmd(0, dev_index, false, in aspeed_i3c_send()
224 writel(base + A_COMMAND_QUEUE_PORT, cmd.word); in aspeed_i3c_send()
230 AspeedI3CCmdQueueData cmd; in aspeed_i3c_send_ccc() local
233 cmd.transfer_cmd = aspeed_i3c_create_xfer_cmd(ccc_cmd, 0, false, in aspeed_i3c_send_ccc()
238 writel(base + A_COMMAND_QUEUE_PORT, cmd.word); in aspeed_i3c_send_ccc()
244 AspeedI3CCmdQueueData cmd; in aspeed_i3c_recv() local
253 * CMD is ignored due to this not being a CCC, and there is no defining in aspeed_i3c_recv()
256 cmd.transfer_cmd = aspeed_i3c_create_xfer_cmd(0, dev_index, true, in aspeed_i3c_recv()
258 uint16_t num_to_rx = (len - bytes_rxed) > ASPEED_I3C_RX_QUEUE_CAPACITY ? in aspeed_i3c_recv()
259 ASPEED_I3C_RX_QUEUE_CAPACITY : (len - bytes_rxed); in aspeed_i3c_recv()
263 writel(base + A_COMMAND_QUEUE_PORT, cmd.word); in aspeed_i3c_recv()
291 g_assert(ret != -1); in read_data()
314 * - an I3C_START event in add_targets_to_bus()
315 * - the size of the CCC packet as a LE uint32 in add_targets_to_bus()
316 * - the CCC in add_targets_to_bus()
317 * - then an I3C_STOP event. in add_targets_to_bus()
331 * - populate the table and send ENTDAA, then probe the addresses to see who in add_targets_to_bus()
333 * - SETAASA and then go through a list addresses to see who exists, probe in add_targets_to_bus()
367 /* Remote target RX, e.g. controller -> target. */
373 * The Aspeed controller expects data in 32-bit words, so make this 32-bits. in test_remote_i3c_rx()
451 /* Remote target TX, e.g. target -> controller. */
456 /* Non-const since the thread prototype needs a non-const pointer. */ in test_remote_i3c_tx()
474 target_thread = g_thread_new("remote-target", remote_target_thread, data); in test_remote_i3c_tx()
485 * - 1-byte REMOTE_I3C_IBI request. in remote_i3c_ibi()
486 * - 1-byte address of target sending the IBI. in remote_i3c_ibi()
487 * - 1-byte RnW bit. in remote_i3c_ibi()
488 * - 4-byte size of IBI payload. in remote_i3c_ibi()
489 * - n-byte IBI payload. in remote_i3c_ibi()
518 * ibi_buf_level should have 1-byte for IBI status, plus data size in words. in aspeed_i3c_read_ibi_and_verify()
531 * Read in the IBI bytes, if they aren't word-aligned, read in an extra in aspeed_i3c_read_ibi_and_verify()
566 * - Have the target IBI the controller by writing to the socket. in test_remote_i3c_ibi()
567 * - The controller ACKs and enqueues the IBI request. in test_remote_i3c_ibi()
568 * - The ACK is sent over socket, we verify it's there. in test_remote_i3c_ibi()
569 * - We read the request from the controller IBI queue. in test_remote_i3c_ibi()
583 global_qtest = qtest_initf("-machine ast2600-evb " in main()
584 "-chardev socket,id=remote-i3c-chr,port=%d,host=localhost " in main()
585 "-device %s," in main()
586 "chardev=remote-i3c-chr," in main()
587 "device-name=remote-target," in main()
592 "static-address=%d", in main()
596 /* Remote target RXing, i.e. controller -> target. */ in main()
597 qtest_add_data_func("remote-i3c-rx", (void *)&i3c_controller_num, in main()
599 /* Remote target TXing, i.e. controller -> target. */ in main()
600 qtest_add_data_func("remote-i3c-tx", (void *)&i3c_controller_num, in main()
603 qtest_add_data_func("remote-i3c-ibi", (void *)&i3c_controller_num, in main()