home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / vxworks / 1013 < prev    next >
Encoding:
Internet Message Format  |  1992-11-13  |  3.1 KB

  1. 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
  2. From: prb@aplexus.jhuapl.edu (Paul R. Bade)
  3. Newsgroups: comp.os.vxworks
  4. Subject: re: MVME167 and RealTime Clock
  5. Message-ID: <9211131334.AA03262@aplexus.jhuapl.edu>
  6. Date: 13 Nov 92 13:34:35 GMT
  7. Sender: vxwexplo@lbl.gov
  8. Organization: Lawrence Berkeley Laboratory, Berkeley CA
  9. Lines: 65
  10. NNTP-Posting-Host: 128.3.112.16
  11. Originator: daemon@vxw.ee.lbl.gov
  12.  
  13. Happy Friday the 13th,
  14.  
  15. In our discussions on setting up the Prescaler on the MV167
  16. Fred Roeber writes:
  17.  
  18. ->  I agree that it would be nice to set up the board so it works at any 
  19. ->  frequency. Paul is reading a value out of the battery backed RAM to do this.
  20. ->  I wonder why we couldn't just use the value set in the memory 
  21. ->  bus clock register (see MEMC_BCR register on pg 4-12 of the HW guide).
  22. ->  This register is set up by diagnostics so that the board functions correctly
  23. ->   It contains the integer clock speed value.  
  24.  
  25. I was unaware of the existence of the Bus Clock Register (MEMC_BCR).
  26. That is why I read the battery backed RAM.
  27.  
  28. However, on closer examination of the MEMC_BCR, it turns out that
  29. this register is initialized in the romInit.s file by
  30.   ->  moveb   #MEMC_BCR_25MHZ,MEMC_BCR
  31.  
  32. Since this is hardcoded, MEMC_BCR will have the incorrect value 
  33. for the 33MHZ board. Thus, we need to also initialize this register based on the
  34. battery backed RAM. From reading the MVME-167 manual, the MEMC_BCR reg
  35. controls the refresh timer. I would expect that initializing the MEMC_BCR
  36. with MEMC_BCR_25MHZ on a 33 MHZ board will only result in the DRAMS
  37. being refreshed more often than needed. But why loose performance by
  38. refreshing when you don't need to. Since performance is generally
  39. irrelevant during booting and assembly is not much fun, I plan to
  40. only make the changes only in sysLib.c
  41. Thus:
  42.  
  43.     strncpy ( oscFreq, (char*)0xfffc1f28, 4);  /* read clk speed from BBRAM */
  44.     oscFreq[4] = NULL; /* terminate string */
  45.  
  46.     if (!strncmp(oscFreq, "33", 2))
  47.     {
  48.       *((unsigned char)MEMC_BCR) = 33; /* Set the DRAM Refresh Rate */
  49.       *PCC2_PRESCALE        = -33;  
  50.       *PCC2_PRESCALE_CLK_ADJ  = -33;
  51.     }    
  52.  
  53.     else /* if (strncmp(oscFreq, "2500", 4))   */
  54.     {
  55.       *((unsigned char)MEMC_BCR) = 25; /* Set the DRAM Refresh Rate */
  56.       *PCC2_PRESCALE        = -25;
  57.       *PCC2_PRESCALE_CLK_ADJ  = -25;
  58.     }    
  59.  
  60. As for the MEMC_RCR_SWAIT bit, from what I know, the comments by WRS
  61. make no sense. It is my understanding from working with the 
  62. board designers at Motorola, that the SWAIT bit need only be set
  63. on boards containing rev 0 of the MEMC chip when using bus snooping. 
  64. Thus, in my code where I set up the MMU I do the following:
  65.  
  66.     /* Check Rev of memc040 chip */
  67.     /*  *MEMC_RCR |= MEMC_RCR_SWAIT;   Needed for errata when bus snooping */
  68.     if(*MEMC_REVISION == 0x00) /* MEMC_REVISION can be read as a byte */
  69.       *MEMC_RCR |= MEMC_RCR_SWAIT; /* |= works for 8 bit reg */
  70.  
  71. Anybody else agree?
  72.  
  73.  
  74.         Paul R. Bade
  75.         Johns Hopkins University / Applied Physics Lab
  76.         (301)-953-5000 x8681
  77.         prb@aplexus.jhuapl.edu
  78.