hil_proc: Use logical address in proc_vring
authorWendy Liang <jliang@xilinx.com>
Thu, 7 Jul 2016 23:35:39 +0000 (16:35 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:44 +0000 (22:01 -0700)
It is not necessary to maintain the physical address in hil_proc,
and actually the physical address field phy_addr is already used
as logical address. This patch is to rename the physical address
data field to logical address.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/include/openamp/hil.h
lib/include/openamp/virtqueue.h
lib/remoteproc/rsc_table_parser.c
lib/rpmsg/remote_device.c
lib/virtio/virtqueue.c

index fc8efd58f3767c8fbd80ab71ddc55ddcbc90e706..39908693824331bb6c0dcf1146c7138ab0a577d6 100644 (file)
@@ -100,8 +100,8 @@ struct proc_intr {
 struct proc_vring {
        /* Pointer to virtqueue encapsulating the vring */
        struct virtqueue *vq;
-       /* Vring physical address */
-       void *phy_addr;
+       /* Vring logical address */
+       void *vaddr;
        /* Number of vring descriptors */
        unsigned short num_descs;
        /* Vring alignment */
index 9bac20edec6034f52ae58537c5663f2fbd7f7037..83d2fb54f551797b4a38c43df23d76c319d4930b 100644 (file)
@@ -142,7 +142,7 @@ struct virtqueue {
 
 /* struct to hold vring specific information */
 struct vring_alloc_info {
-       void *phy_addr;
+       void *vaddr;
        uint32_t align;
        uint16_t num_descs;
        uint16_t pad;
index fba5c39517147c1bcdb0a562f764ebb758418928..3e39b690d5f53220c9cef0d908e4f41ed824cdd8 100644 (file)
@@ -218,7 +218,8 @@ int handle_vdev_rsc(struct remote_proc *rproc, void *rsc)
                vring = &vdev_rsc->vring[idx];
 
                /* Initialize HIL vring resources */
-               vring_table[idx].phy_addr = (void *)vring->da;
+               vring_table[idx].vaddr =
+                       env_map_patova((unsigned long)vring->da);
                vring_table[idx].num_descs = vring->num;
                vring_table[idx].align = vring->align;
 
index 76f18ed77616725ece2ce4d671b555bf6ba835ff..ed132fc9cf72b9c1f40b8202992b2ac743da33e6 100644 (file)
@@ -52,7 +52,7 @@
 
 /* Macro to initialize vring HW info */
 #define INIT_VRING_ALLOC_INFO(ring_info,vring_hw)                             \
-                         (ring_info).phy_addr  = (vring_hw).phy_addr;         \
+                         (ring_info).vaddr  = (vring_hw).vaddr;               \
                          (ring_info).align     = (vring_hw).align;             \
                          (ring_info).num_descs = (vring_hw).num_descs
 
@@ -405,7 +405,7 @@ int rpmsg_rdev_create_virtqueues(struct virtio_device *dev, int flags, int nvqs,
                INIT_VRING_ALLOC_INFO(ring_info, vring_table[idx]);
 
                if (rdev->role == RPMSG_REMOTE) {
-                       memset((void *)ring_info.phy_addr, 0x00,
+                       memset((void *)ring_info.vaddr, 0x00,
                               vring_size(vring_table[idx].num_descs, vring_table[idx].align));
                }
 
index 03418a8cd583a7951d67c4ce9ff2ad366268eb79..3e1639be9be9b900e36199de490cee866124c06f 100644 (file)
@@ -95,7 +95,7 @@ int virtqueue_create(struct virtio_device *virt_dev, unsigned short id,
 
                //TODO : Whether we want to support indirect addition or not.
                vq->vq_ring_size = vring_size(ring->num_descs, ring->align);
-               vq->vq_ring_mem = (void *)ring->phy_addr;
+               vq->vq_ring_mem = (void *)ring->vaddr;
 
                /* Initialize vring control block in virtqueue. */
                vq_ring_init(vq);