@@ -93,21 +92,54 @@ void __init atari_stram_init(void)
*/
void __init atari_stram_reserve_pages(void *start_mem)
{
- /*
- * always reserve first page of ST-RAM, the first 2 KiB are
- * supervisor-only!
- */
- if (!kernel_in_stram)
- reserve_bootmem(0, PAGE_SIZE, BOOTMEM_DEFAULT);
-
- stram_pool.start = (resource_size_t)alloc_bootmem_low_pages(pool_size);
- stram_pool.end = stram_pool.start + pool_size - 1;
- request_resource(&iomem_resource, &stram_pool);
+ if (kernel_in_stram) {
+
+ stram_pool.start = (resource_size_t)alloc_bootmem_low_pages(pool_size);
+ stram_pool.end = stram_pool.start + pool_size - 1;
+ request_resource(&iomem_resource, &stram_pool);
+
+ printk("atari_stram pool: kernel in ST-RAM, using alloc_bootmem!\n");
+
+ printk("atari_stram pool: size = %lu bytes, resource = %pR\n",
+ pool_size, &stram_pool);
+ printk("atari_stram pool: start = %p, end = %p\n",
+ (void *) stram_pool.start, (void *) stram_pool.end);
+ printk("atari_stram pool: stram_virt_offset = %p\n",
+ (void *) stram_virt_offset);
+ } else {
+ /*
+ * Skip page 0, as the fhe first 2 KiB are supervisor-only!
+ */
+
+ printk("atari_stram pool: kernel not in ST-RAM, using ioremap!\n");
+
+ stram_pool.start = PAGE_SIZE;
+ stram_pool.end = stram_pool.start + pool_size - 1;
+
+ request_resource(&iomem_resource, &stram_pool);
+
+ printk("atari_stram pool: size = %lu bytes, resource = %pR\n",
+ pool_size, &stram_pool);
+ printk("atari_stram pool: start = %p, end = %p\n",
+ (void *) stram_pool.start, (void *) stram_pool.end);
+
+ /* stram_virt_offset = ioremap(stram_pool.start, pool_size); */
+ stram_virt_offset = (unsigned long) 0xFF000000;
+
+ printk("atari_stram pool: stram_virt_offset = %p\n",
+ (void *) stram_virt_offset);
+ }