Commit faed452d authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: linux,tce* changes

Remove linux,has-tce-table since we can just look for linux,tce-base and
linux,tce-size.  Make linux,tce-base store real addresses instead of virtual
ones, the wrapper may not know the translation the kernel will use.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 79565b84
...@@ -321,19 +321,16 @@ static void iommu_table_setparms(struct pci_controller *phb, ...@@ -321,19 +321,16 @@ static void iommu_table_setparms(struct pci_controller *phb,
node = (struct device_node *)phb->arch_data; node = (struct device_node *)phb->arch_data;
if (get_property(node, "linux,has-tce-table", NULL) == NULL) {
printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has no tce table !\n",
dn->full_name);
return;
}
basep = (unsigned long *)get_property(node, "linux,tce-base", NULL); basep = (unsigned long *)get_property(node, "linux,tce-base", NULL);
sizep = (unsigned int *)get_property(node, "linux,tce-size", NULL); sizep = (unsigned int *)get_property(node, "linux,tce-size", NULL);
if (basep == NULL || sizep == NULL) { if (basep == NULL || sizep == NULL) {
printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has missing tce" printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has "
" entries !\n", dn->full_name); "missing tce entries !\n", dn->full_name);
return; return;
} }
memset((void *)(*basep), 0, *sizep);
tbl->it_base = (unsigned long)__va(*basep);
memset((void *)tbl->it_base, 0, *sizep);
tbl->it_busno = phb->bus->number; tbl->it_busno = phb->bus->number;
...@@ -357,7 +354,6 @@ static void iommu_table_setparms(struct pci_controller *phb, ...@@ -357,7 +354,6 @@ static void iommu_table_setparms(struct pci_controller *phb,
if (phb->dma_window_base_cur > (1 << 19)) if (phb->dma_window_base_cur > (1 << 19))
panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n"); panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
tbl->it_base = *basep;
tbl->it_index = 0; tbl->it_index = 0;
tbl->it_entrysize = sizeof(union tce_entry); tbl->it_entrysize = sizeof(union tce_entry);
tbl->it_blocksize = 16; tbl->it_blocksize = 16;
......
...@@ -760,7 +760,7 @@ static void __init prom_initialize_tce_table(void) ...@@ -760,7 +760,7 @@ static void __init prom_initialize_tce_table(void)
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
char compatible[64], type[64], model[64]; char compatible[64], type[64], model[64];
char *path = RELOC(prom_scratch); char *path = RELOC(prom_scratch);
u64 base, vbase, align; u64 base, align;
u32 minalign, minsize; u32 minalign, minsize;
u64 tce_entry, *tce_entryp; u64 tce_entry, *tce_entryp;
u64 local_alloc_top, local_alloc_bottom; u64 local_alloc_top, local_alloc_bottom;
...@@ -832,12 +832,9 @@ static void __init prom_initialize_tce_table(void) ...@@ -832,12 +832,9 @@ static void __init prom_initialize_tce_table(void)
if (base < local_alloc_bottom) if (base < local_alloc_bottom)
local_alloc_bottom = base; local_alloc_bottom = base;
vbase = (unsigned long)abs_to_virt(base);
/* Save away the TCE table attributes for later use. */ /* Save away the TCE table attributes for later use. */
prom_setprop(node, "linux,tce-base", &vbase, sizeof(vbase)); prom_setprop(node, "linux,tce-base", &base, sizeof(base));
prom_setprop(node, "linux,tce-size", &minsize, sizeof(minsize)); prom_setprop(node, "linux,tce-size", &minsize, sizeof(minsize));
prom_setprop(node, "linux,has-tce-table", NULL, 0);
/* It seems OF doesn't null-terminate the path :-( */ /* It seems OF doesn't null-terminate the path :-( */
memset(path, 0, sizeof(path)); memset(path, 0, sizeof(path));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment