11 #include <linux/module.h>
12 #include <linux/types.h>
13 #include <linux/kernel.h>
16 #include <linux/bitops.h>
17 #include <linux/string.h>
19 #include <linux/slab.h>
21 #include <asm/setup.h>
84 static void __init mark_region(
unsigned long start,
unsigned long end,
88 start += Z2RAM_CHUNKMASK;
90 end += Z2RAM_CHUNKMASK;
91 start &= ~Z2RAM_CHUNKMASK;
92 end &= ~Z2RAM_CHUNKMASK;
94 if (end <= Z2RAM_START || start >= Z2RAM_END)
96 start = start < Z2RAM_START ? 0x00000000 : start-Z2RAM_START;
97 end = end > Z2RAM_END ? Z2RAM_SIZE : end-Z2RAM_START;
101 set_bit(chunk, zorro_unused_z2ram);
104 start += Z2RAM_CHUNKSIZE;
116 if (zorro_resource_start(z) >= r->
start &&
117 zorro_resource_end(z) <= r->
end)
138 bus->
dev.parent = &pdev->
dev;
142 pr_err(
"Zorro: Error registering zorro_bus\n");
147 platform_set_drvdata(pdev, bus);
149 pr_info(
"Zorro: Probing AutoConfig expansion devices: %u device%s\n",
155 z->id = (z->rom.er_Manufacturer<<16) | (z->rom.er_Product<<8);
158 unsigned long magic = zorro_resource_start(z)+0x8000;
161 sprintf(z->name,
"Zorro device %08x", z->id);
163 z->resource.name = z->name;
164 r = zorro_find_parent_resource(pdev, z);
168 "Address space collision on device %s %pR\n",
169 z->name, &z->resource);
171 z->dev.parent = &bus->
dev;
180 dev_err(&bus->
dev,
"Error registering device %s\n",
187 dev_err(&z->dev,
"Error creating sysfs files\n");
191 zorro_for_each_dev(z) {
193 mark_region(zorro_resource_start(z),
194 zorro_resource_end(z)+1, 1);
209 .name =
"amiga-zorro",
214 static int __init amiga_zorro_init(
void)