From: wdenk Date: Fri, 19 Oct 2001 11:23:54 +0000 (+0000) Subject: Updated GTH Board - Patch by Thomas Lange, 18 Oct 2001 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e8c94a4ee49737a0a6572169fcc84e09cf895c8e;p=users%2Frw%2Fppcboot.git Updated GTH Board - Patch by Thomas Lange, 18 Oct 2001 --- diff --git a/CHANGELOG b/CHANGELOG index 8d4c244..2a932e3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -56,6 +56,9 @@ To do: Modifications for 1.1.0: ====================================================================== +* Updated GTH Board + Patch by Thomas Lange, 18 Oct 2001 + * Extend LWMON keyboard driver to allow for more than one key-coded pre-boot command (we now support an unlimited number of keys) diff --git a/board/gth/flash.c b/board/gth/flash.c index 531b5ef..54dc308 100644 --- a/board/gth/flash.c +++ b/board/gth/flash.c @@ -51,7 +51,7 @@ unsigned long flash_init (void) /*printf("faking");*/ - return(0x4fffff); + return(0x1fffff); /* Init: no FLASHes known */ for (i=0; i < CFG_MAX_FLASH_BANKS; ++i) diff --git a/board/gth/gth.c b/board/gth/gth.c index 5e7a1ae..18a3709 100644 --- a/board/gth/gth.c +++ b/board/gth/gth.c @@ -147,9 +147,10 @@ const uint fpga_table[] = { /* Exception, Offset 0x3C */ 0xfffffc04, 0xfffffc05, _NOT_USED_, _NOT_USED_ }; -int _initsdram(uint base, uint noMbytes){ +int _initsdram(uint base, uint *noMbytes){ volatile immap_t *immap = (immap_t *)CFG_IMMR; volatile memctl8xx_t *mc = &immap->im_memctl; + volatile u32 *memptr; mc->memc_mptpr = MPTPR_PTP_DIV16; /* (16-17) */ @@ -177,12 +178,28 @@ int _initsdram(uint base, uint noMbytes){ /* Lower 2 bits are not connected to chip */ mc->memc_mcr = 0x80002114; /* run upm a at 0x14 (16-15) */ - /* FIXME when not 32MB */ - /* CS1, base 0x0000000 - 32 Mbyte, use UPM A */ - - mc->memc_or1 = 0xfe000000|OR_CSNT_SAM; + /* CS1, base 0x0000000 - 64 Mbyte, use UPM A */ + mc->memc_or1 = 0xfc000000|OR_CSNT_SAM; mc->memc_br1 = BR_MS_UPMA|BR_V; /* SDRAM base always 0 */ + /* Test if we really have 64 MB SDRAM */ + memptr = (u32*)0; + *memptr = 0; + + memptr = (u32*)0x2000000; /* First u32 in upper 32 MB */ + *memptr = 0x12345678; + + memptr = (u32*)0; + if(*memptr==0x12345678){ + /* Wrapped, only have 32 MB */ + mc->memc_or1 = 0xfe000000|OR_CSNT_SAM; + *noMbytes=32; + } + else{ + /* 64 MB */ + *noMbytes=64; + } + /* Setup FPGA in UPMB */ upmconfig(UPMB, (uint *)fpga_table,sizeof(fpga_table)/sizeof(uint)); @@ -216,8 +233,6 @@ void _sdramdisable(void) int initsdram(uint base, uint *noMbytes) { - uint m; - *noMbytes = 32; #ifdef CONFIG_START_IN_RAM @@ -225,7 +240,7 @@ int initsdram(uint base, uint *noMbytes) return 0; #else - if(!_initsdram(base, m)) + if(!_initsdram(base, noMbytes)) { return 0; @@ -269,6 +284,10 @@ long int initdram (int board_type) *(i+1) = ~(j+(j<<18)); } +#if defined(CONFIG_WATCHDOG) + watchdog_reset (); +#endif /* CONFIG_WATCHDOG */ + printf("."); for(i=(u32*)0,j=0;(u32)i