Index: uspace/drv/bus/usb/xhci/hc.c
===================================================================
--- uspace/drv/bus/usb/xhci/hc.c	(revision c9c0e4127425d563b96b6263d2bdee6502389e30)
+++ uspace/drv/bus/usb/xhci/hc.c	(revision fd9f4ffe9046f4159dadaaa386b188bac0191bc9)
@@ -41,5 +41,4 @@
 #include "hc.h"
 #include "hw_struct/trb.h"
-#include "scratchpad.h"
 #include "commands.h"
 
Index: uspace/drv/bus/usb/xhci/hc.h
===================================================================
--- uspace/drv/bus/usb/xhci/hc.h	(revision c9c0e4127425d563b96b6263d2bdee6502389e30)
+++ uspace/drv/bus/usb/xhci/hc.h	(revision fd9f4ffe9046f4159dadaaa386b188bac0191bc9)
@@ -40,4 +40,5 @@
 #include "hw_struct/regs.h"
 #include "hw_struct/context.h"
+#include "scratchpad.h"
 #include "trb_ring.h"
 
@@ -66,4 +67,5 @@
 	xhci_event_ring_t event_ring;
 	xhci_device_ctx_t **dcbaa;
+	xhci_scratchpad_t *scratchpad;
 
 	/* Cached capabilities */
Index: uspace/drv/bus/usb/xhci/scratchpad.c
===================================================================
--- uspace/drv/bus/usb/xhci/scratchpad.c	(revision c9c0e4127425d563b96b6263d2bdee6502389e30)
+++ uspace/drv/bus/usb/xhci/scratchpad.c	(revision fd9f4ffe9046f4159dadaaa386b188bac0191bc9)
@@ -54,5 +54,5 @@
 {
 	unsigned num_bufs, allocated;
-	xhci_scratchpad_t *buf_array;
+	xhci_scratchpad_t *bufs;
 
 	num_bufs = xhci_scratchpad_count(hc);
@@ -61,21 +61,37 @@
 		return EOK;
 
-	buf_array = malloc32(num_bufs * sizeof(xhci_scratchpad_t));
-	if (!buf_array)
+	bufs = malloc32(sizeof(xhci_scratchpad_t));
+	if (!bufs)
 		return ENOMEM;
 
-	hc->dcbaa[0] = (xhci_device_ctx_t *) buf_array;
+	allocated = 0;
 
-	allocated = 0;
+	uint64_t *phys_array = malloc32(num_bufs * sizeof(uint64_t));
+	if(phys_array == NULL)
+		goto err_phys_array;
+
+	uint64_t *virt_array = malloc32(num_bufs * sizeof(uint64_t));
+	if(virt_array == NULL)
+		goto err_virt_array;
+
 	for (unsigned i = 0; i < num_bufs; ++i) {
-		buf_array[i].sp_ptr = (uint64_t) malloc32(PAGE_SIZE);
+		void *buf = malloc32(PAGE_SIZE);
+		phys_array[i] = host2xhci(64, (uint64_t) addr_to_phys(buf));
+		virt_array[i] = (uint64_t) buf;
 
-		if (buf_array[i].sp_ptr)
+		if (buf != NULL)
 			++allocated;
 		else
 			goto err_page_alloc;
 
-		memset((void *) buf_array[i].sp_ptr, 0, PAGE_SIZE);
+		memset(buf, 0, PAGE_SIZE);
 	}
+
+	bufs->phys_ptr = host2xhci(64, (uint64_t) addr_to_phys(phys_array));
+	bufs->virt_ptr = (uint64_t) virt_array;
+	bufs->phys_bck = (uint64_t) phys_array;
+
+	hc->dcbaa[0] = (xhci_device_ctx_t *) bufs->phys_ptr;
+	hc->scratchpad = bufs;
 
 	usb_log_debug2("Allocated %d scratchpad buffers.", num_bufs);
@@ -85,5 +101,12 @@
 err_page_alloc:
 	for (unsigned i = 0; i < allocated; ++i)
-		free32((void *) buf_array[i].sp_ptr);
+		free32((void *) virt_array[i]);
+	free32(virt_array);
+
+err_virt_array:
+	free32(phys_array);
+
+err_phys_array:
+	free32(bufs);
 
 	return ENOMEM;
@@ -93,15 +116,18 @@
 {
 	unsigned num_bufs;
-	xhci_scratchpad_t *buf_array;
-
+	xhci_scratchpad_t *scratchpad;
+	uint64_t *virt_array;
+	
 	num_bufs = xhci_scratchpad_count(hc);
 	if(!num_bufs)
 		return;
 
-	buf_array = (xhci_scratchpad_t *) hc->dcbaa[0];
+	scratchpad =  hc->scratchpad;
+	virt_array = (uint64_t *) scratchpad->virt_ptr;
 
 	for (unsigned i = 0; i < num_bufs; ++i)
-		free32((void *) buf_array[i].sp_ptr);
-	free32(buf_array);
+		free32((void *) virt_array[i]);
+	free32((void *) scratchpad->virt_ptr);
+	free32((void *) scratchpad->phys_bck);
 
 	hc->dcbaa[0] = NULL;
Index: uspace/drv/bus/usb/xhci/scratchpad.h
===================================================================
--- uspace/drv/bus/usb/xhci/scratchpad.h	(revision c9c0e4127425d563b96b6263d2bdee6502389e30)
+++ uspace/drv/bus/usb/xhci/scratchpad.h	(revision fd9f4ffe9046f4159dadaaa386b188bac0191bc9)
@@ -41,6 +41,13 @@
 #define XHCI_SCRATCHPAD_H
 
+typedef struct xhci_hc xhci_hc_t;
+
 typedef struct xhci_scratchpad {
-	uint64_t sp_ptr;
+	/* Pointers to scratchpad buffers used by the xHC. */
+	uint64_t phys_ptr;
+	/* Pointers to scratchpad buffers used for deallocation. */
+	uint64_t virt_ptr;
+	/* Pointers to the scratchpad array used for deallocation. */
+	uint64_t phys_bck;
 } xhci_scratchpad_t;
 
