save changes
Signed-off-by: Heinrich Toews <ht@twx-software.de>
This commit is contained in:
parent
7c67e64fc8
commit
e777786d99
@ -1277,6 +1277,10 @@ static ssize_t cqspi_write(struct cqspi_flash_pdata *f_pdata,
|
|||||||
*/
|
*/
|
||||||
if (!op->cmd.dtr && cqspi->use_direct_mode &&
|
if (!op->cmd.dtr && cqspi->use_direct_mode &&
|
||||||
cqspi->use_direct_mode_wr && ((to + len) <= cqspi->ahb_size)) {
|
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);
|
memcpy_toio(cqspi->ahb_base + to, buf, len);
|
||||||
return cqspi_wait_idle(cqspi);
|
return cqspi_wait_idle(cqspi);
|
||||||
}
|
}
|
||||||
@ -1702,7 +1706,10 @@ static int cqspi_probe(struct platform_device *pdev)
|
|||||||
struct cqspi_st *cqspi;
|
struct cqspi_st *cqspi;
|
||||||
int ret;
|
int ret;
|
||||||
int irq;
|
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));
|
host = devm_spi_alloc_host(&pdev->dev, sizeof(*cqspi));
|
||||||
if (!host) {
|
if (!host) {
|
||||||
@ -1897,18 +1904,20 @@ static int cqspi_probe(struct platform_device *pdev)
|
|||||||
__func__, __LINE__,
|
__func__, __LINE__,
|
||||||
cqspi->use_direct_mode_wr ? "enabled" : "disabled");
|
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__,
|
__func__, __LINE__,
|
||||||
test_buf, strlen(test_buf));
|
test_buf, strlen(test_buf), to);
|
||||||
|
|
||||||
memcpy_toio(cqspi->ahb_base, test_buf, strlen(test_buf));
|
|
||||||
|
|
||||||
|
memcpy_toio(cqspi->ahb_base + to, test_buf, strlen(test_buf));
|
||||||
cqspi_wait_idle(cqspi);
|
cqspi_wait_idle(cqspi);
|
||||||
|
|
||||||
print_hex_dump(KERN_INFO, "TWx ahb_base:", DUMP_PREFIX_OFFSET,
|
print_hex_dump(KERN_INFO, "TWx ahb_base:", DUMP_PREFIX_OFFSET,
|
||||||
16, 1, cqspi->ahb_base, 64, true);
|
16, 1, cqspi->ahb_base, 64, true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
probe_setup_failed:
|
probe_setup_failed:
|
||||||
cqspi_controller_enable(cqspi, 0);
|
cqspi_controller_enable(cqspi, 0);
|
||||||
probe_reset_failed:
|
probe_reset_failed:
|
||||||
|
|||||||
@ -730,19 +730,25 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
|
|||||||
int mi = uio_find_mem_index(vma);
|
int mi = uio_find_mem_index(vma);
|
||||||
struct uio_mem *mem;
|
struct uio_mem *mem;
|
||||||
|
|
||||||
|
pr_info("TWx: %s:%d\n", __func__, __LINE__);
|
||||||
|
|
||||||
if (mi < 0)
|
if (mi < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
mem = idev->info->mem + mi;
|
mem = idev->info->mem + mi;
|
||||||
|
|
||||||
|
pr_info("TWx: %s:%d\n", __func__, __LINE__);
|
||||||
if (mem->addr & ~PAGE_MASK)
|
if (mem->addr & ~PAGE_MASK)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
pr_info("TWx: %s:%d\n", __func__, __LINE__);
|
||||||
if (vma->vm_end - vma->vm_start > mem->size)
|
if (vma->vm_end - vma->vm_start > mem->size)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
pr_info("TWx: %s:%d\n", __func__, __LINE__);
|
||||||
vma->vm_ops = &uio_physical_vm_ops;
|
vma->vm_ops = &uio_physical_vm_ops;
|
||||||
if (idev->info->mem[mi].memtype == UIO_MEM_PHYS)
|
if (idev->info->mem[mi].memtype == UIO_MEM_PHYS)
|
||||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
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,
|
* We cannot use the vm_iomap_memory() helper here,
|
||||||
* because vma->vm_pgoff is the map index we looked
|
* 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) {
|
switch (idev->info->mem[mi].memtype) {
|
||||||
case UIO_MEM_IOVA:
|
case UIO_MEM_IOVA:
|
||||||
case UIO_MEM_PHYS:
|
case UIO_MEM_PHYS:
|
||||||
|
pr_info("TWx: %s:%d\n", __func__, __LINE__);
|
||||||
ret = uio_mmap_physical(vma);
|
ret = uio_mmap_physical(vma);
|
||||||
|
pr_info("TWx: %s:%d ret = %d\n",__func__, __LINE__, ret);
|
||||||
break;
|
break;
|
||||||
case UIO_MEM_LOGICAL:
|
case UIO_MEM_LOGICAL:
|
||||||
case UIO_MEM_VIRTUAL:
|
case UIO_MEM_VIRTUAL:
|
||||||
|
pr_info("TWx: %s:%d\n", __func__, __LINE__);
|
||||||
ret = uio_mmap_logical(vma);
|
ret = uio_mmap_logical(vma);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user