{"action":"created","issue":{"url":"https://api.github.com/repos/OP-TEE/optee_os/issues/1208","repository_url":"https://api.github.com/repos/OP-TEE/optee_os","labels_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/1208/labels{/name}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/1208/comments","events_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/1208/events","html_url":"https://github.com/OP-TEE/optee_os/issues/1208","id":192849741,"number":1208,"title":"SPI Test for HiKey: Size of Tx seems to be limited to first transaction?","user":{"login":"gitfineon","id":11716650,"avatar_url":"https://avatars.githubusercontent.com/u/11716650?v=3","gravatar_id":"","url":"https://api.github.com/users/gitfineon","html_url":"https://github.com/gitfineon","followers_url":"https://api.github.com/users/gitfineon/followers","following_url":"https://api.github.com/users/gitfineon/following{/other_user}","gists_url":"https://api.github.com/users/gitfineon/gists{/gist_id}","starred_url":"https://api.github.com/users/gitfineon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitfineon/subscriptions","organizations_url":"https://api.github.com/users/gitfineon/orgs","repos_url":"https://api.github.com/users/gitfineon/repos","events_url":"https://api.github.com/users/gitfineon/events{/privacy}","received_events_url":"https://api.github.com/users/gitfineon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-12-01T13:41:55Z","updated_at":"2016-12-18T06:28:34Z","closed_at":null,"body":"Hey @vchong ,\r\nare you aware of this behavior or can you give me a hint how to fix it?\r\n\r\nAdding a second transaction to **spi_test.c** with longer arrays fails after sending number of bytes of the first array:\r\n```\r\n\tuint8_t tx_string[8] = {\"opteespi\"};\r\n\tuint8_t rx_string[8] = {0};\r\n\tsize_t len_string = 8;\r\n```\r\n\r\n```\r\n\tDMSG(\"SPI test to send a string\\n\");\r\n\tplatform_pl022_data.chip.ops->txrx8\r\n\t\t(&platform_pl022_data.chip, tx_string, rx_string, len_string, &num_rxpkts);\r\n\tfor (i = 0; i < num_rxpkts; i++)\r\n\t\tDMSG(\"rx[%zu] = 0x%x\\n\", i, rx_string[i]);\r\n```\r\nThe logic analyzer shows SPI_ENABLE is only LOW for the first 4 bytes, MOSI sends all 8 bytes. There is no obvious problem if the first array had 16 bytes, but I don't see any common context because of using separate variables.\r\n\r\nDiggin' deeper without interruption of DMSG output:\r\n```\r\n\tuint8_t tx[4] = {0x01, 0x80, 0x00, 0x42};\r\n\tuint8_t tx_string[2] = {\"2b\"};\r\n\tuint8_t tx_long[8] = {\"8 bytes\"};\r\n\tuint8_t rx[4] = {0};\r\n\tuint8_t rx_string[2] = {0};\r\n\tuint8_t rx_long[8] = {0};\r\n\tsize_t j, num_rxpkts, len = 4, len_string = 2, len_long = 8, num_rxpkts_long;\r\n```\r\n```\r\n\tpl022_start(&platform_pl022_data);\r\n\r\n\tfor (j = 0; j < 2; j++) {\r\n\t\tplatform_pl022_data.chip.ops->txrx8(&platform_pl022_data.chip,\r\n\t\t\t\t\t\ttx, rx, len, &num_rxpkts);\r\n\t\tudelay(20);\r\n\t}\r\n\tudelay(20);\r\n\t\r\n\tplatform_pl022_data.chip.ops->txrx8\r\n\t\t(&platform_pl022_data.chip, tx_string, rx_string, len_string, &num_rxpkts);\r\n\tudelay(40);\r\n\t\r\n\tplatform_pl022_data.chip.ops->txrx8\r\n\t\t(&platform_pl022_data.chip, tx_long, rx_long, len_long, &num_rxpkts_long);\r\n\tudelay(40);\r\n\r\n\tfor (j = 0; j < 2; j++) {\r\n\t\tplatform_pl022_data.chip.ops->txrx8(&platform_pl022_data.chip,\r\n\t\t\t\t\t\ttx, rx, len, &num_rxpkts);\r\n\t\tudelay(20);\r\n\t}\r\n\tudelay(20);\r\n\r\n\tfor (j = 0; j < 2; j++) {\r\n\t\tplatform_pl022_data.chip.ops->txrx8(&platform_pl022_data.chip,\r\n\t\t\t\t\t\ttx, rx, len, &num_rxpkts);\r\n\t\tudelay(20);\r\n\t}\r\n\tudelay(40);\r\n\r\n\tpl022_end(&platform_pl022_data);\r\n```\r\n![logic_025_crop](https://cloud.githubusercontent.com/assets/11716650/20795749/0fe26e9a-b7d3-11e6-82b3-4941b2bd6b3e.png)\r\nMaybe it helps to see the problem in more detail\r\n![logic_026_crop](https://cloud.githubusercontent.com/assets/11716650/20795748/0fdc7634-b7d3-11e6-8192-381035d3a40a.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OP-TEE/optee_os/issues/comments/267805995","html_url":"https://github.com/OP-TEE/optee_os/issues/1208#issuecomment-267805995","issue_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/1208","id":267805995,"user":{"login":"vchong","id":7334750,"avatar_url":"https://avatars.githubusercontent.com/u/7334750?v=3","gravatar_id":"","url":"https://api.github.com/users/vchong","html_url":"https://github.com/vchong","followers_url":"https://api.github.com/users/vchong/followers","following_url":"https://api.github.com/users/vchong/following{/other_user}","gists_url":"https://api.github.com/users/vchong/gists{/gist_id}","starred_url":"https://api.github.com/users/vchong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vchong/subscriptions","organizations_url":"https://api.github.com/users/vchong/orgs","repos_url":"https://api.github.com/users/vchong/repos","events_url":"https://api.github.com/users/vchong/events{/privacy}","received_events_url":"https://api.github.com/users/vchong/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T06:28:34Z","updated_at":"2016-12-18T06:28:34Z","body":"Sorry but I'm a bit confused. I thought we were talking about spi tx and rx, so why the sudden change to mmio read and write which aren't really directly related?"}}
{"actor":{"display_login":"vchong"}}