home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!dog.ee.lbl.gov!lbl.gov!vxwexplo
- From: prb@aplexus.jhuapl.edu (Paul R. Bade)
- Newsgroups: comp.os.vxworks
- Subject: re: MVME167 and RealTime Clock
- Message-ID: <9211131334.AA03262@aplexus.jhuapl.edu>
- Date: 13 Nov 92 13:34:35 GMT
- Sender: vxwexplo@lbl.gov
- Organization: Lawrence Berkeley Laboratory, Berkeley CA
- Lines: 65
- NNTP-Posting-Host: 128.3.112.16
- Originator: daemon@vxw.ee.lbl.gov
-
- Happy Friday the 13th,
-
- In our discussions on setting up the Prescaler on the MV167
- Fred Roeber writes:
-
- -> I agree that it would be nice to set up the board so it works at any
- -> frequency. Paul is reading a value out of the battery backed RAM to do this.
- -> I wonder why we couldn't just use the value set in the memory
- -> bus clock register (see MEMC_BCR register on pg 4-12 of the HW guide).
- -> This register is set up by diagnostics so that the board functions correctly
- -> It contains the integer clock speed value.
-
- I was unaware of the existence of the Bus Clock Register (MEMC_BCR).
- That is why I read the battery backed RAM.
-
- However, on closer examination of the MEMC_BCR, it turns out that
- this register is initialized in the romInit.s file by
- -> moveb #MEMC_BCR_25MHZ,MEMC_BCR
-
- Since this is hardcoded, MEMC_BCR will have the incorrect value
- for the 33MHZ board. Thus, we need to also initialize this register based on the
- battery backed RAM. From reading the MVME-167 manual, the MEMC_BCR reg
- controls the refresh timer. I would expect that initializing the MEMC_BCR
- with MEMC_BCR_25MHZ on a 33 MHZ board will only result in the DRAMS
- being refreshed more often than needed. But why loose performance by
- refreshing when you don't need to. Since performance is generally
- irrelevant during booting and assembly is not much fun, I plan to
- only make the changes only in sysLib.c
- Thus:
-
- strncpy ( oscFreq, (char*)0xfffc1f28, 4); /* read clk speed from BBRAM */
- oscFreq[4] = NULL; /* terminate string */
-
- if (!strncmp(oscFreq, "33", 2))
- {
- *((unsigned char)MEMC_BCR) = 33; /* Set the DRAM Refresh Rate */
- *PCC2_PRESCALE = -33;
- *PCC2_PRESCALE_CLK_ADJ = -33;
- }
-
- else /* if (strncmp(oscFreq, "2500", 4)) */
- {
- *((unsigned char)MEMC_BCR) = 25; /* Set the DRAM Refresh Rate */
- *PCC2_PRESCALE = -25;
- *PCC2_PRESCALE_CLK_ADJ = -25;
- }
-
- As for the MEMC_RCR_SWAIT bit, from what I know, the comments by WRS
- make no sense. It is my understanding from working with the
- board designers at Motorola, that the SWAIT bit need only be set
- on boards containing rev 0 of the MEMC chip when using bus snooping.
- Thus, in my code where I set up the MMU I do the following:
-
- /* Check Rev of memc040 chip */
- /* *MEMC_RCR |= MEMC_RCR_SWAIT; Needed for errata when bus snooping */
- if(*MEMC_REVISION == 0x00) /* MEMC_REVISION can be read as a byte */
- *MEMC_RCR |= MEMC_RCR_SWAIT; /* |= works for 8 bit reg */
-
- Anybody else agree?
-
-
- Paul R. Bade
- Johns Hopkins University / Applied Physics Lab
- (301)-953-5000 x8681
- prb@aplexus.jhuapl.edu
-