From mboxrd@z Thu Jan 1 00:00:00 1970 From: risingsunxy@googlemail.com (Xu Yang) Date: Wed, 2 Sep 2009 15:38:45 +0200 Subject: how to restrict the arm1176 cache size to 16K in the linux kernel? Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi guys, I would like to restirct the cache size to 16K to make it compatible with another configuration. according to the arm1176 documentation 6.11.3 I added the followings three lines: mrc p15, 0, r0, c1, c0, 1 orr r0, r0, #(1<<6) mcr p15, 0, r0, c1, c0, 1 after /arch/arm/mm/proc-v6.S line 163 (mcr p15, 0, r0, c7, c10, 4 @drain write buffer) to restrict the cache size to 16. but it seems that it leads kernel panic after "Freeing init memory:104K BUG: soft lockup - CPU#0 stuck for 61s! [linuxrc:1] Modules linked in: Pid: 1, comm: linuxrc CPU: 0 Not tainted (2.6.29 #37) PC is at handle_mm_fault+0x47c/0x5b4 LR is@0xc3a02890 pc : [] lr : [] psr: 00000113 sp : c381fc78 ip : 01903a58 fp : c381fccc r10: c21ec000 r9 : c39c7000 r8 : 40024000 r7 : c3a2a1b8 r6 : 605241cf r5 : 40024000 r4 : 00001000 r3 : 00100090 r2 : c3a02800 r1 : 00000090 r0 : c39c7000 Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 00c5387d Table: 621ec008 DAC: 00000015 [] (show_regs+0x0/0x50) from [] (softlockup_tick+0x108/0x158) r4:026258ea [] (softlockup_tick+0x0/0x158) from [] (run_local_timers+0x1c/0x20) [] (run_local_timers+0x0/0x20) from [] (update_process_times+0x2c/0x5c) [] (update_process_times+0x0/0x5c) from [] (timer_tick+0xe8/0x10c) r5:00000000 r4:c036a050 [] (timer_tick+0x0/0x10c) from [] (xgold_timer_interrupt+0x58/0x64) r5:00000000 r4:c02ed344 [] (xgold_timer_interrupt+0x0/0x64) from [] (handle_IRQ_event+0x3c/0x74) [] (handle_IRQ_event+0x0/0x74) from [] (handle_level_irq+0xd4/0xf0) r7:c3a2a1b8 r6:e0000484 r5:00000055 r4:c02f0ec0 [] (handle_level_irq+0x0/0xf0) from [] (__exception_text_start+0x54/0x6c) r5:00000000 r4:00000055 [] (__exception_text_start+0x0/0x6c) from [] (__irq_svc+0x30/0x60) Exception stack(0xc381fc30 to 0xc381fc78) fc20: c39c7000 00000090 c3a02800 00100090 fc40: 00001000 40024000 605241cf c3a2a1b8 40024000 c39c7000 c21ec000 c381fccc fc60: 01903a58 c381fc78 c3a02890 c0080958 00000113 ffffffff r5:c381fc64 r4:ffffffff [] (handle_mm_fault+0x0/0x5b4) from [] (do_page_fault+0x118/0x268) [] (do_page_fault+0x0/0x268) from [] (do_translation_fault+0x1c/0x84) [] (do_translation_fault+0x0/0x84) from [] (do_DataAbort+0x3c/0xa0) r6:00000805 r5:c02ec650 r4:ffffffff [] (do_DataAbort+0x0/0xa0) from [] (__dabt_svc+0x4c/0x60) Exception stack(0xc381fde8 to 0xc381fe30) fde0: 4002464c 000009ac 00000000 00000000 c22326e0 00023db0 fe00: 40000000 c2232600 c2281c80 4002464c 40023000 c381fe44 00000000 c381fe30 fe20: c00c7a44 c012dc58 20000113 ffffffff r8:c2281c80 r7:c2232600 r6:40000000 r5:c381fe1c r4:ffffffff [] (padzero+0x0/0x5c) from [] (load_elf_binary+0xa68/0x1200) [] (load_elf_binary+0x0/0x1200) from [] (search_binary_handler+0xb0/0x258) [] (search_binary_handler+0x0/0x258) from [] (do_execve+0x168/0x218) [] (do_execve+0x0/0x218) from [] (kernel_execve+0x40/0x88) [] (kernel_execve+0x0/0x88) from [] (run_init_process+0x20/0x2c) r7:00000000 r6:00000000 r5:c001ee2c r4:c0346374 [] (run_init_process+0x0/0x2c) from [] (init_post+0xa4/0x108) [] (init_post+0x0/0x108) from [] (kernel_init+0xb4/0xd8) r4:c0346378 [] (kernel_init+0x0/0xd8) from [] (do_exit+0x0/0x6b4) r5:00000000 r4:00000000 is there anything else I should do in order to restrict the cache size? or I added the code to the wrong place? thanks, Best regards, Yang