aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r--arch/x86/kernel/setup_32.c106
1 files changed, 103 insertions, 3 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index 236d30b264d8..32edf70d6b0d 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -73,9 +73,80 @@ int disable_pse __cpuinitdata = 0;
73/* 73/*
74 * Machine setup.. 74 * Machine setup..
75 */ 75 */
76extern struct resource code_resource; 76static struct resource data_resource = {
77extern struct resource data_resource; 77 .name = "Kernel data",
78extern struct resource bss_resource; 78 .start = 0,
79 .end = 0,
80 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
81};
82
83static struct resource code_resource = {
84 .name = "Kernel code",
85 .start = 0,
86 .end = 0,
87 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
88};
89
90static struct resource bss_resource = {
91 .name = "Kernel bss",
92 .start = 0,
93 .end = 0,
94 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
95};
96
97static struct resource video_ram_resource = {
98 .name = "Video RAM area",
99 .start = 0xa0000,
100 .end = 0xbffff,
101 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
102};
103
104static struct resource standard_io_resources[] = { {
105 .name = "dma1",
106 .start = 0x0000,
107 .end = 0x001f,
108 .flags = IORESOURCE_BUSY | IORESOURCE_IO
109}, {
110 .name = "pic1",
111 .start = 0x0020,
112 .end = 0x0021,
113 .flags = IORESOURCE_BUSY | IORESOURCE_IO
114}, {
115 .name = "timer0",
116 .start = 0x0040,
117 .end = 0x0043,
118 .flags = IORESOURCE_BUSY | IORESOURCE_IO
119}, {
120 .name = "timer1",
121 .start = 0x0050,
122 .end = 0x0053,
123 .flags = IORESOURCE_BUSY | IORESOURCE_IO
124}, {
125 .name = "keyboard",
126 .start = 0x0060,
127 .end = 0x006f,
128 .flags = IORESOURCE_BUSY | IORESOURCE_IO
129}, {
130 .name = "dma page reg",
131 .start = 0x0080,
132 .end = 0x008f,
133 .flags = IORESOURCE_BUSY | IORESOURCE_IO
134}, {
135 .name = "pic2",
136 .start = 0x00a0,
137 .end = 0x00a1,
138 .flags = IORESOURCE_BUSY | IORESOURCE_IO
139}, {
140 .name = "dma2",
141 .start = 0x00c0,
142 .end = 0x00df,
143 .flags = IORESOURCE_BUSY | IORESOURCE_IO
144}, {
145 .name = "fpu",
146 .start = 0x00f0,
147 .end = 0x00ff,
148 .flags = IORESOURCE_BUSY | IORESOURCE_IO
149} };
79 150
80/* cpu data as detected by the assembly code in head.S */ 151/* cpu data as detected by the assembly code in head.S */
81struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 152struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
@@ -693,3 +764,32 @@ void __init setup_arch(char **cmdline_p)
693#endif 764#endif
694#endif 765#endif
695} 766}
767
768/*
769 * Request address space for all standard resources
770 *
771 * This is called just before pcibios_init(), which is also a
772 * subsys_initcall, but is linked in later (in arch/i386/pci/common.c).
773 */
774static int __init request_standard_resources(void)
775{
776 int i;
777
778 printk(KERN_INFO "Setting up standard PCI resources\n");
779 if (efi_enabled)
780 efi_initialize_iomem_resources(&code_resource,
781 &data_resource, &bss_resource);
782 else
783 legacy_init_iomem_resources(&code_resource,
784 &data_resource, &bss_resource);
785
786 /* EFI systems may still have VGA */
787 request_resource(&iomem_resource, &video_ram_resource);
788
789 /* request I/O space for devices used on all i[345]86 PCs */
790 for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
791 request_resource(&ioport_resource, &standard_io_resources[i]);
792 return 0;
793}
794
795subsys_initcall(request_standard_resources);