fdt: Fix fdt_pci_dma_ranges handling of 64-bit ranges
authorKumar Gala <galak@kernel.crashing.org>
Wed, 5 Aug 2009 14:03:54 +0000 (09:03 -0500)
committerWolfgang Denk <wd@denx.de>
Sun, 9 Aug 2009 21:13:56 +0000 (23:13 +0200)
If the size of a region equal to 4G it can't be represnted in a 32-bit
BAR so we should have marked that case as MEM64.

Additionally bump the number of inbound windows up to 4 to handle the
fact that Freescale PPCs that have an implicit window for CCSRBAR.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
common/fdt_support.c

index fc077e82927b420202a6b7ae2ff130f237c8627c..89164a12d73d7569021f14493f31c07c12fb7b7b 100644 (file)
@@ -625,7 +625,7 @@ int fdt_resize(void *blob)
 }
 
 #ifdef CONFIG_PCI
-#define CONFIG_SYS_PCI_NR_INBOUND_WIN 3
+#define CONFIG_SYS_PCI_NR_INBOUND_WIN 4
 
 #define FDT_PCI_PREFETCH       (0x40000000)
 #define FDT_PCI_MEM32          (0x02000000)
@@ -655,7 +655,7 @@ int fdt_pci_dma_ranges(void *blob, int phb_off, struct pci_controller *hose) {
                size = (u64)hose->regions[r].size;
 
                dma_range[0] = 0;
-               if (size > 0x100000000ull)
+               if (size >= 0x100000000ull)
                        dma_range[0] |= FDT_PCI_MEM64;
                else
                        dma_range[0] |= FDT_PCI_MEM32;