This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Adapting SH3 77x9SE01 platform to 7729R


I have adapted the existing eCos SH3 77x9SE01 platform code for use with
the 7729RSE01 board.  I wanted to document my procedure here for anyone
else interested in using this board.  I don't have any prior experience
with eCos, so I didn't feel up to creating a "true" separate platform
with more .cdl modifications at this time.

The 7729R on the board runs internally at 200MHz, compared to 133 MHz
for the 7729.  The oscillator is 66 MHz instead of 33 MHz on the 7729
board.  These are the only differences between the boards afaik.

You need to modify some eCos files (I'm using V2.0b1).

In /packages/hal/sh/se77x9/v2_0b1/cdl/hal_sh_sh77x9_se77x9.cdl
	change CYGNUM_HAL_SH_OOC_XTAL_DEFAULT's	default_value 	from:	33333300
	to:	66666600

	change CYGNUM_HAL_SH_OOC_XTAL's	legal_values	
	from: 	8000000 to 33333300
	to:	8000000 to 66666600	

In /packages/hal/sh/se77x9/v2_0b1/include/platform.inc
	after the tag BSC_settings_table:, make the 2 changes noted in
	the following code snippet:  

//----------- cut -----------------------------------
BSC_settings_table:
	// change for se7729r 
        // .word   CYGARC_REG_WTCSR, 0xA502
        .word   CYGARC_REG_WTCSR, 0xA504
        .word   CYGARC_REG_WTCNT, 0x5A00
        .word   CYGARC_REG_FRQCR, CYGARC_REG_FRQCR_INIT
	# Settings from Hitachi docs for SE7709A
#ifdef CYGNUM_HAL_SH_SE77X9_SDRAM_SETUP
	.word   CYGARC_REG_BCR1,  0x0008
#else
	.word   CYGARC_REG_BCR1,  0x0810
#endif
        .word   CYGARC_REG_BCR2,  0x2ef0
        .word   CYGARC_REG_BCR3,  0x0000
        .word   CYGARC_REG_WCR1,  0x0c30
#ifdef CYGNUM_HAL_SH_SE77X9_SDRAM_SETUP
	// change for se7729r 
	// .word   CYGARC_REG_WCR2,  0x7ddb
        .word   CYGARC_REG_WCR2,  0xbfdd
        .word   CYGARC_REG_MCR,   0x002c
#else
//----------- cut -----------------------------------

Note that the changes above in these 2 files may cause a bad package to
be generated if you later need to build support for the "normal"
7729SE01 or the 7709SE01.  There really should be a separate package (or
a separate option in the existing package) for the 7729R instead of my
kludge.   

I found what I think are 2 bugs in the existing eCos 77x9SE01 platform
that need to be fixed to get this board to work:

Flash support will not work unless you make this change.  This is also a
problem for the regular 7729/7709 board, too I think.
In /packages/devs/flash/sh/se77x9/v2_0b1/src/sh_se77x9_flash.c
	In plf_flash_init() change
	from:	flash_data_t id[2];
	to:	flash_data_t id[4];

The setting for the oscillator control Divider2 divide-by-6 is
incorrect.  This causes an illegal FRQCR value to be built and you won't
get a reliable boot up from reset (I could get the system to boot about
1 out of 25 times).  Also, the SCIF2 serial port won't work (bad baud
rate generation because of incorrect peripheral clock value).  
In /packages/hal/sh/sh3/v2_0b1/include/mod_regs_cpg.h
	For the V3 (last) group of conditional compilation statements,
	following the statement #elif (CYGHWR_HAL_SH_00C_DIVIDER_2 == 6)
	change	from:	# define CYGARC_REG_FRQCR_INIT_DIVIDER2 0x2002
		to:	# define CYGARC_REG_FRQCR_INIT_DIVIDER2 0x2001

After making these changes, generate a project for the 7729SE01.  You
need to change some of the oscillator-related settings.  In the
configuration tool, under "Hitachi/SH77X9 SE77X9 board" -> "SH on-chip
platform clock controls", change the "SH clock PLL circuit 1" value to 3
and the "SH clock divider 2" value to 6.

I have successfully created and used RedBoot following these steps,
exercising the flash file system, the 2 serial ports and Ethernet.  To
date I have not used it for much else - for example, I have not run any
of the eCos test suites on it yet. 


      
 









-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]