[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Improving Performance



Geert,
On Tue, 11 Mar 2014, Michael Schmitz wrote:
People that need to use ST RAM because the have too little TT RAM, could
still use the -s kernel option and enable ST RAM for kernel.

Perhaps an option to specify the video RAM adress space is easier to
implement to the existing memory model?
The address space set aside for video still needs to be mapped. The current
stram_alloc() interface does reqire that mapping to be set up by the generic
memory map initialization first. That's what I mentioned below - I haven't
found a quick and easy way to change that at first glance. Suggestions welcome
- I can't spend much time on this at present.

Does the hack below (not even compile-tested) work? It maps pool_size
(default 1 MiB) of ST-RAM and makes the pool use that.

Sort of - boots with kernel in ST-RAM, but nothing shown on the screen. SCSI appears to allocate DMA-able memory though:

Linux version 3.14.0-rc6-atari-164136-g430db49 (schmitz@xplor) (gcc version 4.6
.3 (GCC) ) #189 Thu Mar 13 20:43:55 NZDT 2014
console [debug0] enabled
Atari hardware found: VIDEL STDMA-SCSI ST_MFP YM2149 PCM CODEC DSP56K SCC_DMA S
CC ANALOG_JOY BLITTER IDE TT_CLK FDC_SPEED
Ignoring memory chunk at 0x0:0xe00000 before the first chunk
Fix your bootloader or use a memfile to make use of this area!
On node 0 totalpages: 130688
free_area_init_node: node 0, pgdat 002b7490, node_mem_map 00372000
 DMA zone: 1149 pages used for memmap
 DMA zone: 0 pages reserved
 DMA zone: 130688 pages, LIFO batch:31
atari_stram pool: size = 1048576 bytes, resource = [??? 0x007f4000-0x008f3fff f
lags 0x0]
atari_stram pool: start = 7f4000, end = 8f3fff
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129539
....
atafb_init: start
atafb_init: initializing Falcon hw
atafb: screen_base 007f4000 real_screen_base 007f4000 screen_len 69632
Determined 640x400, depth 1
  virtual 640x870
Console: switching to mono frame buffer device 80x25
fb0: frame buffer device, using 68K of video memory

Doesn't reboot cleanly, though. Machine is not recognized as a Falcon by TOS on reboot (hard reboot sorts that out).

My version of your patch (minus verbosity additions) attached - booting in ST-RAM still works as it should. I've left the normal case allocs in atari_stram_reserve_pages(), and your change in atari_stram_init() for simplicity. Should probably both go into the same function if possible.

More debugging of atafb needed - I have a hunch that the ioremapped kernel virtual address is being used as physical address for atafb.

Need to batten down the hatches now - we expect cyclone Lusi to hit from tomorrow.

Cheers,

   Michael




Make sure the ST-RAM is not mentioned in your memfile.

diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c
index e8e797e672e0..f658421e9a08 100644
--- a/arch/m68k/atari/stram.c
+++ b/arch/m68k/atari/stram.c
@@ -66,25 +66,17 @@ early_param("stram_pool", atari_stram_setup);
  */
 void __init atari_stram_init(void)
 {
-	int i;
-	void *stram_start;
-
 	/*
-	 * determine whether kernel code resides in ST-RAM
-	 * (then ST-RAM is the first memory block at virtual 0x0)
+	 * Skip page 0, as the fhe first 2 KiB are supervisor-only!
 	 */
-	stram_start = phys_to_virt(0);
-	kernel_in_stram = (stram_start == 0);
-return;
-
-	for (i = 0; i < m68k_num_memory; ++i) {
-		if (m68k_memory[i].addr == 0) {
-			return;
-		}
-	}
+	void *stram_start = ioremap(PAGE_SIZE, pool_size);
+
+	stram_pool.start = (resource_size_t)stram_start;
+	stram_pool.end = stram_pool.start + pool_size - 1;
+	request_resource(&iomem_resource, &stram_pool);
- /* Should never come here! (There is always ST-Ram!) */
-	panic("atari_stram_init: no ST-RAM found!");
+	pr_debug("atari_stram pool: size = %lu bytes, resource = %pR\n",
+		 pool_size, &stram_pool);
 }
@@ -94,19 +86,6 @@ return;
  */
 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);
-
-	pr_debug("atari_stram pool: size = %lu bytes, resource = %pR\n",
-		 pool_size, &stram_pool);
 }
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c
index 0810c8d..8cd9532 100644
--- a/arch/m68k/atari/stram.c
+++ b/arch/m68k/atari/stram.c
@@ -76,6 +76,20 @@ void __init atari_stram_init(void)
 	stram_start = phys_to_virt(0);
 	kernel_in_stram = (stram_start == 0);
 
+	if (!kernel_in_stram) {
+		/*
+		 * Skip page 0, as the fhe first 2 KiB are supervisor-only!
+		 */
+		stram_start = ioremap(PAGE_SIZE, pool_size);
+
+		stram_pool.start = (resource_size_t)stram_start;
+		stram_pool.end = stram_pool.start + pool_size - 1;
+		request_resource(&iomem_resource, &stram_pool);
+  
+		pr_debug("atari_stram pool: size = %lu bytes, resource = %pR\n",
+			 pool_size, &stram_pool);		
+	}
+
 	for (i = 0; i < m68k_num_memory; ++i) {
 		if (m68k_memory[i].addr == 0) {
 			return;
@@ -93,19 +107,15 @@ 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);
+	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);
+		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);
 
-	pr_debug("atari_stram pool: size = %lu bytes, resource = %pR\n",
-		 pool_size, &stram_pool);
+		pr_debug("atari_stram pool: size = %lu bytes, resource = %pR\n",
+			 pool_size, &stram_pool);
+	}
 }
 
 

Reply to: