search for: readl

Displaying 20 results from an estimated 250 matches for "readl".

Did you mean: read
2014 Dec 19
5
[RFC] virtio-mmio: Update the device to OASIS spec version
...NU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features |= readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATU...
2014 Dec 19
5
[RFC] virtio-mmio: Update the device to OASIS spec version
...NU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features |= readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATU...
2015 Jan 20
4
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...NU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features |= readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATU...
2015 Jan 20
4
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...NU GPL, version 2 or later. @@ -145,11 +115,16 @@ struct virtio_mmio_vq_info { static u64 vm_get_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; + + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features |= readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATU...
2015 Jan 20
1
[PATCH] virtio-mmio: Update the device to OASIS spec version
...features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - return readl(vm_dev->base + VIRTIO_MMIO_HOST_FEATURES); + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features |= readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + + return features; } stat...
2015 Jan 20
1
[PATCH] virtio-mmio: Update the device to OASIS spec version
...features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 features; - /* TODO: Features > 32 bits */ - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + features <<= 32; - return readl(vm_dev->base + VIRTIO_MMIO_HOST_FEATURES); + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); + features |= readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); + + return features; } stat...
2015 Jan 20
0
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); > + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features |= readl(vm_dev->b...
2015 Jan 20
0
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); > + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features |= readl(vm_dev->b...
2015 Jan 15
0
[RFC] virtio-mmio: Update the device to OASIS spec version
...,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); > + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features |= readl(vm_dev->b...
2015 Jan 15
0
[RFC] virtio-mmio: Update the device to OASIS spec version
...,11 +115,16 @@ struct virtio_mmio_vq_info { > static u64 vm_get_features(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + u64 features; > + > + writel(1, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features = readl(vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES); > + features <<= 32; > > - /* TODO: Features > 32 bits */ > - writel(0, vm_dev->base + VIRTIO_MMIO_HOST_FEATURES_SEL); > + writel(0, vm_dev->base + VIRTIO_MMIO_DEVICE_FEATURES_SEL); > + features |= readl(vm_dev->b...
2013 Feb 13
1
[RFC PATCH] virt_mmio: fix signature checking for BE guests
Using readl() to read the magic value and then memcmp() to check it fails on BE, as bytes will be the other way around (by virtue of the registers to follow the endianess of the guest). Fix it by encoding the magic as an integer instead of a string. Cc: Rusty Russell <rusty at rustcorp.com.au> Cc: Mich...
2013 Feb 13
1
[RFC PATCH] virt_mmio: fix signature checking for BE guests
Using readl() to read the magic value and then memcmp() to check it fails on BE, as bytes will be the other way around (by virtue of the registers to follow the endianess of the guest). Fix it by encoding the magic as an integer instead of a string. Cc: Rusty Russell <rusty at rustcorp.com.au> Cc: Mich...
2015 Mar 05
3
[PATCH] virtio_mmio: fix endian-ness for mmio
...; i < len; i++) + ptr[i] = readb(base + offset + i); + return; + } + + switch (len) { + case 1: + b = readb(base + offset); + memcpy(buf, &b, sizeof b); + break; + case 2: + w = cpu_to_le16(readw(base + offset)); + memcpy(buf, &w, sizeof w); + break; + case 4: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + break; + case 8: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + l = cpu_to_le32(ioread32(base + offset + sizeof l)); + memcpy(buf + sizeof l, &l, sizeof l); + break; + default: + BUG(); + } } static voi...
2015 Mar 05
3
[PATCH] virtio_mmio: fix endian-ness for mmio
...; i < len; i++) + ptr[i] = readb(base + offset + i); + return; + } + + switch (len) { + case 1: + b = readb(base + offset); + memcpy(buf, &b, sizeof b); + break; + case 2: + w = cpu_to_le16(readw(base + offset)); + memcpy(buf, &w, sizeof w); + break; + case 4: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + break; + case 8: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + l = cpu_to_le32(ioread32(base + offset + sizeof l)); + memcpy(buf + sizeof l, &l, sizeof l); + break; + default: + BUG(); + } } static voi...
2005 Aug 09
1
RE: Compiling legacy LSI megaraid drivers (Linux 2.6.11)with xen 2.0.7?
...raid.c:1195: warning: passing arg 2 of > `writel'' makes pointer from integer without a cast > drivers/scsi/megaraid.c:1208: warning: passing arg 2 of > `writel'' makes pointer from integer without a cast > drivers/scsi/megaraid.c:1210: warning: passing arg 1 of > `readl'' makes pointer from integer without a cast > drivers/scsi/megaraid.c: In function `megaraid_isr_memmapped'': > drivers/scsi/megaraid.c:1340: warning: passing arg 1 of > `readl'' makes pointer from integer without a cast > drivers/scsi/megaraid.c:1347: warning:...
2020 Aug 19
0
[PATCH v3 05/18] virtio: Implement get_shm_region for MMIO transport
...vice *vdev, + struct virtio_shm_region *region, u8 id) +{ + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + u64 len, addr; + + /* Select the region we're interested in */ + writel(id, vm_dev->base + VIRTIO_MMIO_SHM_SEL); + + /* Read the region size */ + len = (u64) readl(vm_dev->base + VIRTIO_MMIO_SHM_LEN_LOW); + len |= (u64) readl(vm_dev->base + VIRTIO_MMIO_SHM_LEN_HIGH) << 32; + + region->len = len; + + /* Check if region length is -1. If that's the case, the shared memory + * region does not exist and there is no need to proceed further. + *...
2017 Dec 12
2
[PATCH] virtio_mmio: fix devm cleanup
...*pdev) spin_lock_init(&vm_dev->lock); vm_dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); - if (vm_dev->base == NULL) { - rc = -EFAULT; - goto free_vmdev; - } + if (vm_dev->base == NULL) + return -EFAULT; /* Check magic value */ magic = readl(vm_dev->base + VIRTIO_MMIO_MAGIC_VALUE); if (magic != ('v' | 'i' << 8 | 'r' << 16 | 't' << 24)) { dev_warn(&pdev->dev, "Wrong magic value 0x%08lx!\n", magic); - rc = -ENODEV; - goto unmap; + return -ENODEV; } /* Che...
2017 Dec 12
2
[PATCH] virtio_mmio: fix devm cleanup
...*pdev) spin_lock_init(&vm_dev->lock); vm_dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); - if (vm_dev->base == NULL) { - rc = -EFAULT; - goto free_vmdev; - } + if (vm_dev->base == NULL) + return -EFAULT; /* Check magic value */ magic = readl(vm_dev->base + VIRTIO_MMIO_MAGIC_VALUE); if (magic != ('v' | 'i' << 8 | 'r' << 16 | 't' << 24)) { dev_warn(&pdev->dev, "Wrong magic value 0x%08lx!\n", magic); - rc = -ENODEV; - goto unmap; + return -ENODEV; } /* Che...
2015 Mar 12
2
[PATCH] virtio_mmio: fix endian-ness for mmio
...t; return device config values in LE format when using virtio 1.0. > > Borrow code from virtio_pci_modern to do this correctly. > > AFAICT, it doesn't need to. The endian correction is done by the > callers. > > The only reason that virtio_pci_modern() does it is because readl() etc > do endian conversion, and we don't want them to. And the PCI part of > the spec says to use "natural" accessors, so we don't do byte-at-a-time. > > Cheers, > Rusty. You are right, the endina-ness is not an issue, so the commit log I wrote is wrong, but I...
2015 Mar 12
2
[PATCH] virtio_mmio: fix endian-ness for mmio
...t; return device config values in LE format when using virtio 1.0. > > Borrow code from virtio_pci_modern to do this correctly. > > AFAICT, it doesn't need to. The endian correction is done by the > callers. > > The only reason that virtio_pci_modern() does it is because readl() etc > do endian conversion, and we don't want them to. And the PCI part of > the spec says to use "natural" accessors, so we don't do byte-at-a-time. > > Cheers, > Rusty. You are right, the endina-ness is not an issue, so the commit log I wrote is wrong, but I...