From: Marc H. <mhu...@lo...> - 2009-06-06 01:01:42
|
Try changing orr r0, r0, #0x4 ;@ set bit 2 -- the C bit to orr r0, r0, #0x1000 ; set bit 12 -- the I bit Extracted from PXA255Microarchitecture.pdf datasheet. Marc -------------------------------------------------------- Marc Humphreys LogicLink Design, Inc. 22 Simon Willard Rd. Acton, MA 01720 Office: 978-274-5673 e-mail: mhu...@lo... url: www.logiclinkdesign.com --------------------------------------------------------- > -----Original Message----- > From: Pablo Yanez Trujillo [mailto:sh...@sa...] > Sent: Friday, June 05, 2009 7:27 PM > To: General mailing list for gumstix users. > Subject: [Gumstix-users] system freezes when data cache is enabled > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi > > I'm currently writting a microkernel for the gumstix connex400xm > powered by an intel xscale pxa255. I'm trying to > determine the power consumption with different system configurations > (frequence, caches, etc) and the system freezes > when I enable the data cache. > > I've already read the intel xscale core devs manual and also the ARM > Architecture Reference Manual several time and I'm > sure that I did implement the "data-cache-enable" routine correctly. > > the code that enables the MMU is (where CONFIG_MAP_ADDR is 0xa2000000): > > void pxa_init_memory_map(void) > { > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0xa0000000, 0xa0000000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0xa1000000, 0xa1000000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0x00000000, 0xa0000000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0x40100000, 0x40100000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0x40a00000, 0x40a00000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0x40d00000, 0x40d00000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0x40300000, 0x40300000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0x41300000, 0x41300000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, 0x48000000, 0x48000000, > TRUE); > pxa_set_fld_page_prop(CONFIG_MAP_ADDR, CONFIG_MAP_ADDR, > CONFIG_MAP_ADDR, TRUE); > } > > > /* sets the First-level Descriptors */ > void pxa_set_fld_page_prop(uint32_t base, uint32_t virtual_addr, > uint32_t physical_addr, bool cacheable) > { > /* See Intel XScale(R) Core Developer’s Manual, page 30 */ > physical_addr &= 0xfff00000; > physical_addr |= 0xc02; > if(cacheable) > physical_addr |= 0xc; /* Setting C and B bits */ > > virtual_addr >>= 18; > > *((uint32_t*) (base | virtual_addr)) = physical_addr; > } > > this works fine, I've been running this code for a long time without > problems. > > The next code is the routine that enables the data cache: > > #define CP15WAIT(reg) \ > mrc p15, 0, reg, c2, c0, 0;\ > mov r0, r0 > > #define EXPORT_FUNCTION(func) \ > .type func, function; \ > .global func > > > ;@ Invalidate the instruction cache and branch target buffer > #define INVALIDATE_DATA_CACHE(reg) \ > mcr p15, 0, reg, c7, c6, 0; \ > CP15WAIT(reg) > > > ;@void pxa_enable_inst_cache(void); > EXPORT_FUNCTION(pxa_enable_data_cache) > pxa_enable_data_cache: > stmfd sp!, {r0} > mcr p15, 0, r0, c7, c10, 4 ;@ Drain pending data operations... > mrc p15, 0, r0, c1, c0, 0 ;@ get control register > orr r0, r0, #0x4 ;@ set bit 2 -- the C bit > mcr p15, 0, r0, c1, c0, 0 ;@ set control register <<<<< freezes > INVALIDATE_DATA_CACHE(r0); > ldmfd sp!, {r0} > mov pc, lr > > After I execute the pxa_enable_data_cache() function the system > freezes, nothing happens afterwards, no interrupts are > handled, etc. I've written a small test after mcr that arises a data > abort exception and not even this exception is > arised. When I comment the mcr, then the data abort exception is fired > and my handler warns me. > > Do I have errors? I've checked everything a couple of times but *I* > don't see any error *cry*. Am I missing something? > > Thanks > > regards > Pablo > > - -- > Pablo Yanez Trujillo > http://www.sakuranohana.org > My public key: http://www.sakuranohana.org/gpg/shaoran.asc > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.11 (GNU/Linux) > > iEYEARECAAYFAkopqaoACgkQDzf8xo+0xRVHVACeMw+1cYEbVXpMz9b0HhlX0DPj > H2gAniYXYnTMJCrctPbcKnyXQYX6bhoq > =yV4i > -----END PGP SIGNATURE----- > > ----------------------------------------------------------------------- > ------- > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the > latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users |