aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/kernel/setup.c')
-rw-r--r--arch/tile/kernel/setup.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index dd87f3420390..6a649a4462d3 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -23,6 +23,7 @@
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/kexec.h> 24#include <linux/kexec.h>
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/swiotlb.h>
26#include <linux/initrd.h> 27#include <linux/initrd.h>
27#include <linux/io.h> 28#include <linux/io.h>
28#include <linux/highmem.h> 29#include <linux/highmem.h>
@@ -109,7 +110,7 @@ static unsigned int __initdata maxnodemem_pfn[MAX_NUMNODES] = {
109}; 110};
110static nodemask_t __initdata isolnodes; 111static nodemask_t __initdata isolnodes;
111 112
112#ifdef CONFIG_PCI 113#if defined(CONFIG_PCI) && !defined(__tilegx__)
113enum { DEFAULT_PCI_RESERVE_MB = 64 }; 114enum { DEFAULT_PCI_RESERVE_MB = 64 };
114static unsigned int __initdata pci_reserve_mb = DEFAULT_PCI_RESERVE_MB; 115static unsigned int __initdata pci_reserve_mb = DEFAULT_PCI_RESERVE_MB;
115unsigned long __initdata pci_reserve_start_pfn = -1U; 116unsigned long __initdata pci_reserve_start_pfn = -1U;
@@ -160,7 +161,7 @@ static int __init setup_isolnodes(char *str)
160} 161}
161early_param("isolnodes", setup_isolnodes); 162early_param("isolnodes", setup_isolnodes);
162 163
163#ifdef CONFIG_PCI 164#if defined(CONFIG_PCI) && !defined(__tilegx__)
164static int __init setup_pci_reserve(char* str) 165static int __init setup_pci_reserve(char* str)
165{ 166{
166 unsigned long mb; 167 unsigned long mb;
@@ -171,7 +172,7 @@ static int __init setup_pci_reserve(char* str)
171 172
172 pci_reserve_mb = mb; 173 pci_reserve_mb = mb;
173 pr_info("Reserving %dMB for PCIE root complex mappings\n", 174 pr_info("Reserving %dMB for PCIE root complex mappings\n",
174 pci_reserve_mb); 175 pci_reserve_mb);
175 return 0; 176 return 0;
176} 177}
177early_param("pci_reserve", setup_pci_reserve); 178early_param("pci_reserve", setup_pci_reserve);
@@ -411,7 +412,7 @@ static void __init setup_memory(void)
411 continue; 412 continue;
412 } 413 }
413#endif 414#endif
414#ifdef CONFIG_PCI 415#if defined(CONFIG_PCI) && !defined(__tilegx__)
415 /* 416 /*
416 * Blocks that overlap the pci reserved region must 417 * Blocks that overlap the pci reserved region must
417 * have enough space to hold the maximum percpu data 418 * have enough space to hold the maximum percpu data
@@ -604,11 +605,9 @@ static void __init setup_bootmem_allocator_node(int i)
604 /* Free all the space back into the allocator. */ 605 /* Free all the space back into the allocator. */
605 free_bootmem(PFN_PHYS(start), PFN_PHYS(end - start)); 606 free_bootmem(PFN_PHYS(start), PFN_PHYS(end - start));
606 607
607#if defined(CONFIG_PCI) 608#if defined(CONFIG_PCI) && !defined(__tilegx__)
608 /* 609 /*
609 * Throw away any memory aliased by the PCI region. FIXME: this 610 * Throw away any memory aliased by the PCI region.
610 * is a temporary hack to work around bug 10502, and needs to be
611 * fixed properly.
612 */ 611 */
613 if (pci_reserve_start_pfn < end && pci_reserve_end_pfn > start) 612 if (pci_reserve_start_pfn < end && pci_reserve_end_pfn > start)
614 reserve_bootmem(PFN_PHYS(pci_reserve_start_pfn), 613 reserve_bootmem(PFN_PHYS(pci_reserve_start_pfn),
@@ -658,6 +657,8 @@ static void __init zone_sizes_init(void)
658 unsigned long zones_size[MAX_NR_ZONES] = { 0 }; 657 unsigned long zones_size[MAX_NR_ZONES] = { 0 };
659 int size = percpu_size(); 658 int size = percpu_size();
660 int num_cpus = smp_height * smp_width; 659 int num_cpus = smp_height * smp_width;
660 const unsigned long dma_end = (1UL << (32 - PAGE_SHIFT));
661
661 int i; 662 int i;
662 663
663 for (i = 0; i < num_cpus; ++i) 664 for (i = 0; i < num_cpus; ++i)
@@ -729,6 +730,14 @@ static void __init zone_sizes_init(void)
729 zones_size[ZONE_NORMAL] = end - start; 730 zones_size[ZONE_NORMAL] = end - start;
730#endif 731#endif
731 732
733 if (start < dma_end) {
734 zones_size[ZONE_DMA] = min(zones_size[ZONE_NORMAL],
735 dma_end - start);
736 zones_size[ZONE_NORMAL] -= zones_size[ZONE_DMA];
737 } else {
738 zones_size[ZONE_DMA] = 0;
739 }
740
732 /* Take zone metadata from controller 0 if we're isolnode. */ 741 /* Take zone metadata from controller 0 if we're isolnode. */
733 if (node_isset(i, isolnodes)) 742 if (node_isset(i, isolnodes))
734 NODE_DATA(i)->bdata = &bootmem_node_data[0]; 743 NODE_DATA(i)->bdata = &bootmem_node_data[0];
@@ -738,7 +747,7 @@ static void __init zone_sizes_init(void)
738 PFN_UP(node_percpu[i])); 747 PFN_UP(node_percpu[i]));
739 748
740 /* Track the type of memory on each node */ 749 /* Track the type of memory on each node */
741 if (zones_size[ZONE_NORMAL]) 750 if (zones_size[ZONE_NORMAL] || zones_size[ZONE_DMA])
742 node_set_state(i, N_NORMAL_MEMORY); 751 node_set_state(i, N_NORMAL_MEMORY);
743#ifdef CONFIG_HIGHMEM 752#ifdef CONFIG_HIGHMEM
744 if (end != start) 753 if (end != start)
@@ -1343,7 +1352,7 @@ void __init setup_arch(char **cmdline_p)
1343 setup_cpu_maps(); 1352 setup_cpu_maps();
1344 1353
1345 1354
1346#ifdef CONFIG_PCI 1355#if defined(CONFIG_PCI) && !defined(__tilegx__)
1347 /* 1356 /*
1348 * Initialize the PCI structures. This is done before memory 1357 * Initialize the PCI structures. This is done before memory
1349 * setup so that we know whether or not a pci_reserve region 1358 * setup so that we know whether or not a pci_reserve region
@@ -1372,6 +1381,10 @@ void __init setup_arch(char **cmdline_p)
1372 * any memory using the bootmem allocator. 1381 * any memory using the bootmem allocator.
1373 */ 1382 */
1374 1383
1384#ifdef CONFIG_SWIOTLB
1385 swiotlb_init(0);
1386#endif
1387
1375 paging_init(); 1388 paging_init();
1376 setup_numa_mapping(); 1389 setup_numa_mapping();
1377 zone_sizes_init(); 1390 zone_sizes_init();
@@ -1522,11 +1535,10 @@ static struct resource code_resource = {
1522}; 1535};
1523 1536
1524/* 1537/*
1525 * We reserve all resources above 4GB so that PCI won't try to put 1538 * On Pro, we reserve all resources above 4GB so that PCI won't try to put
1526 * mappings above 4GB; the standard allows that for some devices but 1539 * mappings above 4GB.
1527 * the probing code trunates values to 32 bits.
1528 */ 1540 */
1529#ifdef CONFIG_PCI 1541#if defined(CONFIG_PCI) && !defined(__tilegx__)
1530static struct resource* __init 1542static struct resource* __init
1531insert_non_bus_resource(void) 1543insert_non_bus_resource(void)
1532{ 1544{
@@ -1571,8 +1583,7 @@ static int __init request_standard_resources(void)
1571 int i; 1583 int i;
1572 enum { CODE_DELTA = MEM_SV_INTRPT - PAGE_OFFSET }; 1584 enum { CODE_DELTA = MEM_SV_INTRPT - PAGE_OFFSET };
1573 1585
1574 iomem_resource.end = -1LL; 1586#if defined(CONFIG_PCI) && !defined(__tilegx__)
1575#ifdef CONFIG_PCI
1576 insert_non_bus_resource(); 1587 insert_non_bus_resource();
1577#endif 1588#endif
1578 1589
@@ -1580,7 +1591,7 @@ static int __init request_standard_resources(void)
1580 u64 start_pfn = node_start_pfn[i]; 1591 u64 start_pfn = node_start_pfn[i];
1581 u64 end_pfn = node_end_pfn[i]; 1592 u64 end_pfn = node_end_pfn[i];
1582 1593
1583#ifdef CONFIG_PCI 1594#if defined(CONFIG_PCI) && !defined(__tilegx__)
1584 if (start_pfn <= pci_reserve_start_pfn && 1595 if (start_pfn <= pci_reserve_start_pfn &&
1585 end_pfn > pci_reserve_start_pfn) { 1596 end_pfn > pci_reserve_start_pfn) {
1586 if (end_pfn > pci_reserve_end_pfn) 1597 if (end_pfn > pci_reserve_end_pfn)