aboutsummaryrefslogtreecommitdiff
path: root/board/trab
diff options
context:
space:
mode:
authorwdenk2003-03-12 10:41:04 +0000
committerwdenk2003-03-12 10:41:04 +0000
commit3bac351370ef7cbf9d2af27ba52bee1703ad677e (patch)
tree689fbd22fcde4e63a0f4909acb3ea65475099e9c /board/trab
parent1cb8e980c41e86760fa93de63f4e4cf643bef9d9 (diff)
* Patch by Josef Wagner, 12 Mar 2003:
- 16/32 MB and 50/80 MHz support with auto-detection for IP860 - ETH05 and BEDBUG support for CU824 - added support for MicroSys CPC45 - new BOOTROM/FLASH0 and DOC base for PM826 * Patch by Robert Schwebel, 12 Mar 2003: Fix the chpart command on innokom board * Name cleanup: mv include/asm-i386/ppcboot-i386.h include/asm-i386/u-boot-i386.h s/PPCBoot/U-Boot/ in some files s/pImage/uImage/ in some files * Patch by Detlev Zundel, 15 Jan 2003: Fix '' command line quoting * Patch by The LEOX team, 19 Jan 2003: - add support for the ELPT860 board - add support for Dallas ds164x RTC
Diffstat (limited to 'board/trab')
-rw-r--r--board/trab/flash.c9
-rw-r--r--board/trab/vfd.c42
2 files changed, 23 insertions, 28 deletions
diff --git a/board/trab/flash.c b/board/trab/flash.c
index d86c4bf7706..27c2a5b490e 100644
--- a/board/trab/flash.c
+++ b/board/trab/flash.c
@@ -185,9 +185,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
return ERR_INVAL;
}
- if ((info->flash_id & FLASH_VENDMASK) !=
- (FLASH_MAN_AMD & FLASH_VENDMASK)) {
- return ERR_UNKNOWN_FLASH_VENDOR;
+ switch (info->flash_id & FLASH_VENDMASK) {
+ case (FLASH_MAN_AMD & FLASH_VENDMASK): break; /* OK */
+ case (FLASH_MAN_FUJ & FLASH_VENDMASK): break; /* OK */
+ default:
+ debug ("## flash_erase: unknown manufacturer\n");
+ return (ERR_UNKNOWN_FLASH_VENDOR);
}
prot = 0;
diff --git a/board/trab/vfd.c b/board/trab/vfd.c
index 5e601ef7947..894e3157d68 100644
--- a/board/trab/vfd.c
+++ b/board/trab/vfd.c
@@ -55,7 +55,8 @@
#define BLAU 0x0C
#define VIOLETT 0X0D
-ulong frame_buf_size;
+/* MAGIC */
+#define FRAME_BUF_SIZE ((256*4*56)/8)
#define frame_buf_offs 4
/* Supported VFD Types */
@@ -75,19 +76,13 @@ void init_grid_ctrl(void)
ulong adr, grid_cycle;
unsigned int bit, display;
unsigned char temp, bit_nr;
- ulong val;
/*
* clear frame buffer (logical clear => set to "black")
*/
- if (gd->vfd_inv_data == 0)
- val = 0;
- else
- val = ~0;
-
- for (adr = gd->fb_base; adr <= (gd->fb_base+7168); adr += 4) {
- (*(volatile ulong*)(adr)) = val;
- }
+ memset ((void *)(gd->fb_base),
+ gd->vfd_inv_data ? 0xFF : 0,
+ FRAME_BUF_SIZE);
switch (gd->vfd_type) {
case VFD_TYPE_T119C:
@@ -97,8 +92,8 @@ void init_grid_ctrl(void)
(grid_cycle + 200) * 4 +
frame_buf_offs + display;
/* wrap arround if offset (see manual S3C2400) */
- if (bit>=frame_buf_size*8)
- bit = bit - (frame_buf_size * 8);
+ if (bit>=FRAME_BUF_SIZE*8)
+ bit = bit - (FRAME_BUF_SIZE * 8);
adr = gd->fb_base + (bit/32) * 4 + (3 - (bit%32) / 8);
bit_nr = bit % 8;
bit_nr = (bit_nr > 3) ? bit_nr-4 : bit_nr+4;
@@ -114,8 +109,8 @@ void init_grid_ctrl(void)
else
bit = grid_cycle*256*4+200*4+frame_buf_offs+display-4; /* grid nr. 0 */
/* wrap arround if offset (see manual S3C2400) */
- if (bit>=frame_buf_size*8)
- bit = bit-(frame_buf_size*8);
+ if (bit>=FRAME_BUF_SIZE*8)
+ bit = bit-(FRAME_BUF_SIZE*8);
adr = gd->fb_base+(bit/32)*4+(3-(bit%32)/8);
bit_nr = bit%8;
bit_nr = (bit_nr>3)?bit_nr-4:bit_nr+4;
@@ -135,8 +130,8 @@ void init_grid_ctrl(void)
(253 - grid_cycle) * 4 +
frame_buf_offs + display;
/* wrap arround if offset (see manual S3C2400) */
- if (bit>=frame_buf_size*8)
- bit = bit - (frame_buf_size * 8);
+ if (bit>=FRAME_BUF_SIZE*8)
+ bit = bit - (FRAME_BUF_SIZE * 8);
adr = gd->fb_base + (bit/32) * 4 + (3 - (bit%32) / 8);
bit_nr = bit % 8;
bit_nr = (bit_nr > 3) ? bit_nr-4 : bit_nr+4;
@@ -151,8 +146,8 @@ void init_grid_ctrl(void)
bit = grid_cycle*256*4+(252-grid_cycle)*4+frame_buf_offs+display;
/* wrap arround if offset (see manual S3C2400) */
- if (bit>=frame_buf_size*8)
- bit = bit-(frame_buf_size*8);
+ if (bit>=FRAME_BUF_SIZE*8)
+ bit = bit-(FRAME_BUF_SIZE*8);
adr = gd->fb_base+(bit/32)*4+(3-(bit%32)/8);
bit_nr = bit%8;
bit_nr = (bit_nr>3)?bit_nr-4:bit_nr+4;
@@ -263,8 +258,8 @@ void create_vfd_table(void)
* wrap arround if offset
* (see manual S3C2400)
*/
- if (pixel>=frame_buf_size*8)
- pixel = pixel-(frame_buf_size*8);
+ if (pixel>=FRAME_BUF_SIZE*8)
+ pixel = pixel-(FRAME_BUF_SIZE*8);
adr = gd->fb_base+(pixel/32)*4+(3-(pixel%32)/8);
bit_nr = pixel%8;
bit_nr = (bit_nr>3)?bit_nr-4:bit_nr+4;
@@ -466,7 +461,7 @@ int drv_vfd_init(void)
/* frame buffer startadr */
rLCDSADDR1 = gd->fb_base >> 1;
/* frame buffer endadr */
- rLCDSADDR2 = (gd->fb_base + frame_buf_size) >> 1;
+ rLCDSADDR2 = (gd->fb_base + FRAME_BUF_SIZE) >> 1;
rLCDSADDR3 = ((256/4));
debug ("LCDSADDR1: %lX\n", rLCDSADDR1);
@@ -490,11 +485,8 @@ ulong vfd_setmem (ulong addr)
{
ulong size;
- /* MAGIC */
- frame_buf_size = (256*4*56)/8;
-
/* Round up to nearest full page */
- size = (frame_buf_size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+ size = (FRAME_BUF_SIZE + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
debug ("Reserving %ldk for VFD Framebuffer at: %08lx\n", size>>10, addr);