Signed-off-by: Heinrich Toews <ht@twx-software.de>
This commit is contained in:
Heinrich Toews 2025-11-06 08:52:22 +01:00
parent b911ee989b
commit 3f96c98631
3 changed files with 24 additions and 6 deletions

@ -1277,6 +1277,10 @@ static ssize_t cqspi_write(struct cqspi_flash_pdata *f_pdata,
*/
if (!op->cmd.dtr && cqspi->use_direct_mode &&
cqspi->use_direct_mode_wr && ((to + len) <= cqspi->ahb_size)) {
pr_info("TWx: %s:%d - Writing <%lu> bytes with offset <%lld> to ahb_base <%p>\n",
__func__, __LINE__, len, to, cqspi->ahb_base + to);
print_hex_dump(KERN_INFO, "TWx write buf:", DUMP_PREFIX_OFFSET,
16, 1, buf, len, true);
memcpy_toio(cqspi->ahb_base + to, buf, len);
return cqspi_wait_idle(cqspi);
}
@ -1702,7 +1706,10 @@ static int cqspi_probe(struct platform_device *pdev)
struct cqspi_st *cqspi;
int ret;
int irq;
const u_char *test_buf = "THIS IS TWx.";
const u_char *test_buf = "TWX-111-000";
loff_t to;
pr_info("TWx: %s:%d.\n", __func__, __LINE__);
host = devm_spi_alloc_host(&pdev->dev, sizeof(*cqspi));
if (!host) {
@ -1897,18 +1904,20 @@ static int cqspi_probe(struct platform_device *pdev)
__func__, __LINE__,
cqspi->use_direct_mode_wr ? "enabled" : "disabled");
pr_info("TWx: %s:%d - Writing %s, size %lu to ahb_base 0x0\n",
to = 5;
pr_info("TWx: %s:%d - Writing %s, size %lu to ahb_base %lld\n",
__func__, __LINE__,
test_buf, strlen(test_buf));
memcpy_toio(cqspi->ahb_base, test_buf, strlen(test_buf));
test_buf, strlen(test_buf), to);
memcpy_toio(cqspi->ahb_base + to, test_buf, strlen(test_buf));
cqspi_wait_idle(cqspi);
print_hex_dump(KERN_INFO, "TWx ahb_base:", DUMP_PREFIX_OFFSET,
16, 1, cqspi->ahb_base, 64, true);
return 0;
probe_setup_failed:
cqspi_controller_enable(cqspi, 0);
probe_reset_failed:

@ -730,19 +730,25 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
int mi = uio_find_mem_index(vma);
struct uio_mem *mem;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
if (mi < 0)
return -EINVAL;
mem = idev->info->mem + mi;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
if (mem->addr & ~PAGE_MASK)
return -ENODEV;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
if (vma->vm_end - vma->vm_start > mem->size)
return -EINVAL;
pr_info("TWx: %s:%d\n", __func__, __LINE__);
vma->vm_ops = &uio_physical_vm_ops;
if (idev->info->mem[mi].memtype == UIO_MEM_PHYS)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
pr_info("TWx: %s:%d\n", __func__, __LINE__);
/*
* We cannot use the vm_iomap_memory() helper here,
* because vma->vm_pgoff is the map index we looked
@ -800,10 +806,13 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
switch (idev->info->mem[mi].memtype) {
case UIO_MEM_IOVA:
case UIO_MEM_PHYS:
pr_info("TWx: %s:%d\n", __func__, __LINE__);
ret = uio_mmap_physical(vma);
pr_info("TWx: %s:%d ret = %d\n",__func__, __LINE__, ret);
break;
case UIO_MEM_LOGICAL:
case UIO_MEM_VIRTUAL:
pr_info("TWx: %s:%d\n", __func__, __LINE__);
ret = uio_mmap_logical(vma);
break;
default:

@ -1 +1 @@
Subproject commit 284f50148360c4dbd8e243a42b2534a0e0b66804
Subproject commit 705c63ebb290e1da8f8de0cc4d5ef5547e4528f0