OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/rtos/ecos-2.0/packages/devs/flash/mips
    from Rev 27 to Rev 174
    Reverse comparison

Rev 27 → Rev 174

/vrc437x/v2_0/cdl/flash_mips_vrc437x.cdl
0,0 → 1,70
# ====================================================================
#
# flash_mips_vrc437x.cdl
#
# FLASH memory - Hardware support for VRC437X board
#
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License along
## with eCos; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
##
## As a special exception, if other files instantiate templates or use macros
## or inline functions from this file, or you compile this file and link it
## with other works to produce a work based on this file, this file does not
## by itself cause the resulting work to be covered by the GNU General Public
## License. However the source code for this file must still be made available
## in accordance with section (3) of the GNU General Public License.
##
## This exception does not invalidate any other reasons why a work based on
## this file might be covered by the GNU General Public License.
##
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
## at http://sources.redhat.com/ecos/ecos-license/
## -------------------------------------------
#####ECOSGPLCOPYRIGHTEND####
# ====================================================================
######DESCRIPTIONBEGIN####
#
# Author(s): jskov
# Contributors: jskov, nickg
# Date: 2001-19-10
#
#####DESCRIPTIONEND####
#
# ====================================================================
 
cdl_package CYGPKG_DEVS_FLASH_MIPS_VRC437X {
display "Flash memory support for VRC437X board"
 
parent CYGPKG_IO_FLASH
active_if CYGPKG_IO_FLASH
requires CYGPKG_HAL_MIPS_VR4300_VRC437X
 
implements CYGHWR_IO_FLASH_DEVICE
 
compile mips_vrc437x_flash.c
 
# Arguably this should do in the generic package
# but then there is a logic loop so you can never enable it.
cdl_interface CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED {
display "AMD AM29F040B driver required"
}
 
implements CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED
requires CYGHWR_DEVS_FLASH_AMD_AM29F040B
}
/vrc437x/v2_0/src/mips_vrc437x_flash.c
0,0 → 1,69
//==========================================================================
//
// mips_vrc437x_flash.c
//
// Flash programming for AMD device on NEC VRC437X board
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): jskov
// Contributors: jskov, nickg
// Date: 2001-09-10
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
//--------------------------------------------------------------------------
// Device properties
 
#define CYGNUM_FLASH_INTERLEAVE (1)
#define CYGNUM_FLASH_SERIES (1)
#define CYGNUM_FLASH_WIDTH (8)
#define CYGNUM_FLASH_BASE (0xbfc00000u)
 
//--------------------------------------------------------------------------
// Platform specific extras
 
//--------------------------------------------------------------------------
// Now include the driver code.
#include "cyg/io/flash_am29xxxxx.inl"
 
// ------------------------------------------------------------------------
// EOF mips_vrc437x_flash.c
/vrc437x/v2_0/ChangeLog
0,0 → 1,40
2001-09-10 Nick Garnett <nickg@redhat.com>
 
* cdl/flash_mips_vrc437x.cdl:
* src/mips_vrc437x_flash.c:
Created by copying the ocelot package.
 
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================
/atlas/v2_0/cdl/flash_atlas.cdl
0,0 → 1,109
# ====================================================================
#
# flash_atlas.cdl
#
# FLASH memory - Hardware support on MIPS32 Atlas board.
#
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License along
## with eCos; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
##
## As a special exception, if other files instantiate templates or use macros
## or inline functions from this file, or you compile this file and link it
## with other works to produce a work based on this file, this file does not
## by itself cause the resulting work to be covered by the GNU General Public
## License. However the source code for this file must still be made available
## in accordance with section (3) of the GNU General Public License.
##
## This exception does not invalidate any other reasons why a work based on
## this file might be covered by the GNU General Public License.
##
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
## at http://sources.redhat.com/ecos/ecos-license/
## -------------------------------------------
#####ECOSGPLCOPYRIGHTEND####
# ====================================================================
######DESCRIPTIONBEGIN####
#
# Author(s): msalter
# Original data: gthomas
# Contributors: msalter
# Date: 2000-07-26
#
#####DESCRIPTIONEND####
#
# ====================================================================
 
cdl_package CYGPKG_DEVS_FLASH_ATLAS {
display "MIPS Atlas FLASH memory support"
 
parent CYGPKG_IO_FLASH
active_if CYGPKG_IO_FLASH
requires CYGPKG_HAL_MIPS_ATLAS
 
implements CYGHWR_IO_FLASH_DEVICE
implements CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM
implements CYGHWR_IO_FLASH_BLOCK_LOCKING
 
include_dir .
include_files ; # none _exported_ whatsoever
description "FLASH memory device support for MIPS Atlas"
compile atlas_flash.c
 
make -priority 1 {
flash_erase_block.o: $(REPOSITORY)/$(PACKAGE)/src/flash_erase_block.c
$(CC) -S $(INCLUDE_PATH) $(CFLAGS) -EL -g0 -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_erase_block.c
echo " .globl flash_erase_block_end" >>flash_erase_block.s
echo "flash_erase_block_end:" >>flash_erase_block.s
$(CC) -c -EL -o flash_erase_block.o flash_erase_block.s
$(AR) rcs $(PREFIX)/lib/libtarget.a flash_erase_block.o
}
make -priority 1 {
flash_program_buf.o: $(REPOSITORY)/$(PACKAGE)/src/flash_program_buf.c
$(CC) -S $(INCLUDE_PATH) $(CFLAGS) -EL -g0 -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_program_buf.c
echo " .globl flash_program_buf_end" >>flash_program_buf.s
echo "flash_program_buf_end:" >>flash_program_buf.s
$(CC) -c -EL -o flash_program_buf.o flash_program_buf.s
$(AR) rcs $(PREFIX)/lib/libtarget.a flash_program_buf.o
}
make -priority 1 {
flash_query.o: $(REPOSITORY)/$(PACKAGE)/src/flash_query.c
$(CC) -S $(INCLUDE_PATH) $(CFLAGS) -EL -g0 -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_query.c
echo " .globl flash_query_end" >>flash_query.s
echo "flash_query_end:" >>flash_query.s
$(CC) -c -EL -o flash_query.o flash_query.s
$(AR) rcs $(PREFIX)/lib/libtarget.a flash_query.o
}
make -priority 1 {
flash_lock_block.o: $(REPOSITORY)/$(PACKAGE)/src/flash_lock_block.c
$(CC) -S $(INCLUDE_PATH) $(CFLAGS) -EL -g0 -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_lock_block.c
echo " .globl flash_lock_block_end" >>flash_lock_block.s
echo "flash_lock_block_end:" >>flash_lock_block.s
$(CC) -c -EL -o flash_lock_block.o flash_lock_block.s
$(AR) rcs $(PREFIX)/lib/libtarget.a flash_lock_block.o
}
make -priority 1 {
flash_unlock_block.o: $(REPOSITORY)/$(PACKAGE)/src/flash_unlock_block.c
$(CC) -S $(INCLUDE_PATH) $(CFLAGS) -EL -g0 -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_unlock_block.c
echo " .globl flash_unlock_block_end" >>flash_unlock_block.s
echo "flash_unlock_block_end:" >>flash_unlock_block.s
$(CC) -c -EL -o flash_unlock_block.o flash_unlock_block.s
$(AR) rcs $(PREFIX)/lib/libtarget.a flash_unlock_block.o
}
}
 
/atlas/v2_0/src/flash_lock_block.c
0,0 → 1,89
//==========================================================================
//
// flash_lock_block.c
//
// Flash programming
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
// Contributors: gthomas, msalter
// Date: 2000-12-07
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
#include "flash.h"
#include <cyg/hal/hal_arch.h>
 
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
// it must not contain any code which might be position dependent!
//
 
int
flash_lock_block(volatile unsigned long *block)
{
volatile unsigned long *ROM;
unsigned long stat;
int timeout = 5000000;
 
FLASH_WRITE_ENABLE();
 
block = (volatile unsigned long *)CYGARC_UNCACHED_ADDRESS((unsigned long)block);
ROM = (volatile unsigned long *)((unsigned long)block & FLASH_BASE_MASK);
 
// Clear any error conditions
ROM[0] = FLASH_Clear_Status;
 
// Set lock bit
block[0] = FLASH_Set_Lock;
block[0] = FLASH_Set_Lock_Confirm; // Confirmation
while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) break;
}
 
// Restore ROM to "normal" mode
ROM[0] = FLASH_Reset;
 
FLASH_WRITE_DISABLE();
 
return stat;
}
/atlas/v2_0/src/flash_program_buf.c
0,0 → 1,105
//==========================================================================
//
// flash_program_buf.c
//
// Flash programming
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
// Contributors: gthomas, msalter
// Date: 2000-12-07
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
#include "flash.h"
 
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
 
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
// it must not contain any code which might be position dependent!
//
 
int
flash_program_buf(volatile unsigned long *addr, unsigned long *data, int len)
{
volatile unsigned long *ROM;
unsigned long stat = 0;
int timeout = 50000;
 
FLASH_WRITE_ENABLE();
 
addr = (volatile unsigned long *)CYGARC_UNCACHED_ADDRESS((unsigned long)addr);
ROM = (volatile unsigned long *)((unsigned long)addr & FLASH_BASE_MASK);
 
// Clear any error conditions
ROM[0] = FLASH_Clear_Status;
 
while (len > 0) {
ROM[0] = FLASH_Program;
*addr = *data;
timeout = 5000000;
while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) {
goto bad;
}
}
if (stat & 0x007E007E) {
break;
}
ROM[0] = FLASH_Reset;
if (*addr++ != *data++) {
stat = 0x99109910;
break;
}
len -= 4;
}
 
// Restore ROM to "normal" mode
bad:
ROM[0] = FLASH_Reset;
 
FLASH_WRITE_DISABLE();
 
return stat;
}
/atlas/v2_0/src/atlas_flash.c
0,0 → 1,140
//==========================================================================
//
// atlas_flash.c
//
// Flash programming
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
// Contributors: gthomas, msalter
// Date: 2000-12-06
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
#include <cyg/hal/hal_cache.h>
 
#define _FLASH_PRIVATE_
#include <cyg/io/flash.h>
 
#include "flash.h"
 
#define _si(p) ((p[1]<<8)|p[0])
 
int
flash_hwr_init(void)
{
struct FLASH_query data, *qp;
extern char flash_query, flash_query_end;
typedef int code_fun(unsigned char *);
code_fun *_flash_query;
int code_len, stat, num_regions, region_size;
 
// Copy 'program' code to RAM for execution
code_len = (unsigned long)&flash_query_end - (unsigned long)&flash_query;
_flash_query = (code_fun *)flash_info.work_space;
memcpy(_flash_query, &flash_query, code_len);
 
HAL_DCACHE_SYNC(); // Should guarantee this code will run
HAL_ICACHE_INVALIDATE_ALL(); // is also required to avoid old contents
stat = (*_flash_query)(&data);
 
qp = &data;
if (/*(qp->manuf_code == FLASH_Intel_code) && */
(strncmp(qp->id, "QRY", 3) == 0)) {
num_regions = _si(qp->num_regions)+1;
region_size = _si(qp->region_size)*256;
 
flash_info.block_size = region_size*2; // Pairs of chips in parallel
flash_info.blocks = num_regions*2; // and pairs of chips in serial
flash_info.start = (void *)0x9c000000;
flash_info.end = (void *)0x9e000000;
return FLASH_ERR_OK;
} else {
(*flash_info.pf)("Can't identify FLASH, sorry\n");
diag_dump_buf(data, sizeof(data));
return FLASH_ERR_HWR;
}
}
 
// Map a hardware status to a package error
int
flash_hwr_map_error(int err)
{
if (err & 0x007E007E) {
(*flash_info.pf)("Err = %x\n", err);
if (err & 0x00100010) {
return FLASH_ERR_PROGRAM;
} else
if (err & 0x00200020) {
return FLASH_ERR_ERASE;
} else
return FLASH_ERR_HWR; // FIXME
} else {
return FLASH_ERR_OK;
}
}
 
// See if a range of FLASH addresses overlaps currently running code
bool
flash_code_overlaps(void *start, void *end)
{
extern char _stext[], _etext[];
unsigned long p_stext, pstart, p_etext, pend;
 
p_stext = CYGARC_PHYSICAL_ADDRESS((unsigned long)&_stext);
p_etext = CYGARC_PHYSICAL_ADDRESS((unsigned long)&_etext);
 
// if _stext/_etext in boot shadow region, convert to
// system flash address
if ((p_stext >= 0x1fc00000) && (p_etext <= 0x20000000)) {
p_stext -= 0x02000000;
p_etext -= 0x02000000;
}
 
pstart = CYGARC_PHYSICAL_ADDRESS((unsigned long)start);
pend = CYGARC_PHYSICAL_ADDRESS((unsigned long)end);
 
return (((p_stext >= pstart) && (p_stext < pend)) ||
((p_etext >= pstart) && (p_etext < pend)));
}
/atlas/v2_0/src/flash.h
0,0 → 1,105
//==========================================================================
//
// flash.h
//
// Flash programming - device constants, etc.
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
// Contributors: gthomas
// Date: 2000-07-26
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
#ifndef _FLASH_HWR_H_
#define _FLASH_HWR_H_
 
#define FLASH_Intel_code 0x89
 
#define FLASH_Read_ID 0x00900090
#define FLASH_Read_Query 0x00980098
#define FLASH_Read_Status 0x00700070
#define FLASH_Clear_Status 0x00500050
#define FLASH_Status_Ready 0x00800080
#define FLASH_Write_Buffer 0x00E800E8
#define FLASH_Program 0x00100010
#define FLASH_Block_Erase 0x00200020
#define FLASH_Set_Lock 0x00600060
#define FLASH_Set_Lock_Confirm 0x00010001
#define FLASH_Clear_Locks 0x00600060
#define FLASH_Clear_Locks_Confirm 0x00D000D0
#define FLASH_Confirm 0x00D000D0
#define FLASH_Configure 0x00B800B8
#define FLASH_Configure_ReadyWait 0x00000000
#define FLASH_Configure_PulseOnErase 0x00010001
#define FLASH_Configure_PulseOnProgram 0x00020002
#define FLASH_Configure_PulseOnBoth 0x00030003
#define FLASH_Reset 0x00FF00FF
 
#define FLASH_BLOCK_SIZE 0x40000
 
#define FLASH_Intel_code 0x89
 
#define FLASH_BASE_MASK 0xff000000
 
// Extended query information
struct FLASH_query {
unsigned char manuf_code;
unsigned char device_code;
unsigned char _unused0[14];
unsigned char id[3]; // Q R Y
unsigned char _unused1[20];
unsigned char device_size;
unsigned char device_interface[2];
unsigned char buffer_size[2];
unsigned char is_block_oriented;
unsigned char num_regions[2];
unsigned char region_size[2];
};
 
#define ATLAS_SFWCTRL *((volatile unsigned *)0xbf000700)
#define ATLAS_WEN_MAGIC 0xc7
 
#define FLASH_WRITE_ENABLE() (ATLAS_SFWCTRL = ATLAS_WEN_MAGIC)
#define FLASH_WRITE_DISABLE() (ATLAS_SFWCTRL = 0)
 
#endif // _FLASH_HWR_H_
/atlas/v2_0/src/flash_unlock_block.c
0,0 → 1,130
//==========================================================================
//
// flash_unlock_block.c
//
// Flash programming
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
// Contributors: gthomas
// Date: 2000-09-10
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
#include "flash.h"
 
#include <cyg/hal/hal_arch.h>
 
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
// it must not contain any code which might be position dependent!
//
 
//
// The difficulty with this operation is that the hardware does not support
// unlocking single blocks. However, the logical layer would like this to
// be the case, so this routine emulates it. The hardware can clear all of
// the locks in the device at once. This routine will use that approach and
// then reset the regions which are known to be locked.
//
 
#define MAX_FLASH_BLOCKS 128
 
int
flash_unlock_block(volatile unsigned long *block, int block_size, int blocks)
{
volatile unsigned long *ROM, *bp;
unsigned long stat;
int timeout = 5000000;
unsigned char is_locked[MAX_FLASH_BLOCKS];
int i;
 
FLASH_WRITE_ENABLE();
 
block = (volatile unsigned long *)CYGARC_UNCACHED_ADDRESS((unsigned long)block);
ROM = (volatile unsigned long *)((unsigned long)block & FLASH_BASE_MASK);
 
// Clear any error conditions
ROM[0] = FLASH_Clear_Status;
 
// Get current block lock state. This needs to access each block on
// the device so currently locked blocks can be re-locked.
bp = ROM;
for (i = 0; i < (blocks/2); i++) {
if (bp == block) {
is_locked[i] = 0;
} else {
*bp = FLASH_Read_Query;
is_locked[i] = bp[2];
}
bp += block_size / sizeof(*bp);
}
 
// Clears all lock bits
block[0] = FLASH_Clear_Locks;
block[0] = FLASH_Clear_Locks_Confirm; // Confirmation
timeout = 5000000;
while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) break;
}
 
// Restore the lock state
bp = ROM;
for (i = 0; i < (blocks/2); i++) {
if (is_locked[i]) {
*bp = FLASH_Set_Lock;
*bp = FLASH_Set_Lock_Confirm; // Confirmation
timeout = 5000000;
while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) break;
}
}
bp += block_size / sizeof(*bp);
}
 
// Restore ROM to "normal" mode
ROM[0] = FLASH_Reset;
 
FLASH_WRITE_DISABLE();
 
return stat;
}
/atlas/v2_0/src/flash_query.c
0,0 → 1,84
//==========================================================================
//
// flash_query.c
//
// Flash programming - query device
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
// Contributors: gthomas
// Date: 2000-07-26
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
#include "flash.h"
 
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
#include <cyg/hal/hal_cache.h>
#include CYGHWR_MEMORY_LAYOUT_H
 
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
// it must not contain any code which might be position dependent!
//
 
#define CNT 20*1000*10 // Approx 20ms
 
int
flash_query(unsigned char *data)
{
volatile unsigned long *ROM;
int i, cnt;
 
ROM = (volatile unsigned long *)0xBC000000; // base of system flash
 
ROM[0] = FLASH_Read_Query;
for (cnt = CNT; cnt > 0; cnt--) ;
for (i = 0; i < sizeof(struct FLASH_query); i++) {
*data++ = *ROM++;
}
 
ROM[0] = FLASH_Reset;
 
return 0;
}
/atlas/v2_0/src/flash_erase_block.c
0,0 → 1,103
//==========================================================================
//
// flash_erase_block.c
//
// Flash programming
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas
// Contributors: gthomas, msalter
// Date: 2000-12-07
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
#include "flash.h"
 
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
#include <cyg/hal/hal_cache.h>
 
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
// it must not contain any code which might be position dependent!
//
 
int flash_erase_block(volatile unsigned long *block)
{
volatile unsigned long *ROM;
unsigned long stat;
int timeout = 50000;
int len;
 
FLASH_WRITE_ENABLE();
 
block = (volatile unsigned long *)CYGARC_UNCACHED_ADDRESS((unsigned long)block);
ROM = (volatile unsigned long *)((unsigned long)block & FLASH_BASE_MASK);
 
// Clear any error conditions
ROM[0] = FLASH_Clear_Status;
 
// Erase block
ROM[0] = FLASH_Block_Erase;
*block = FLASH_Confirm;
timeout = 5000000;
while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) break;
}
 
// Restore ROM to "normal" mode
ROM[0] = FLASH_Reset;
 
// If an error was reported, see if the block erased anyway
if (stat & 0x007E007E) {
len = FLASH_BLOCK_SIZE;
while (len > 0) {
if (*block++ != 0xFFFFFFFF) break;
len -= sizeof(*block);
}
if (len == 0) stat = 0;
}
 
FLASH_WRITE_DISABLE();
 
return stat;
}
/atlas/v2_0/ChangeLog
0,0 → 1,43
2001-06-11 Gary Thomas <gthomas@redhat.com>
 
* src/atlas_flash.c: Remove dependency on printf() via user functions.
 
2001-05-23 Jesper Skov <jskov@redhat.com>
 
* cdl/flash_atlas.cdl: Needs IO controller to copy functions to
RAM.
 
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================
/ocelot/v2_0/cdl/flash_mips_ocelot.cdl
0,0 → 1,70
# ====================================================================
#
# flash_mips_ocelot.cdl
#
# FLASH memory - Hardware support for PMC-Sierra Ocelot board
#
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License along
## with eCos; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
##
## As a special exception, if other files instantiate templates or use macros
## or inline functions from this file, or you compile this file and link it
## with other works to produce a work based on this file, this file does not
## by itself cause the resulting work to be covered by the GNU General Public
## License. However the source code for this file must still be made available
## in accordance with section (3) of the GNU General Public License.
##
## This exception does not invalidate any other reasons why a work based on
## this file might be covered by the GNU General Public License.
##
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
## at http://sources.redhat.com/ecos/ecos-license/
## -------------------------------------------
#####ECOSGPLCOPYRIGHTEND####
# ====================================================================
######DESCRIPTIONBEGIN####
#
# Author(s): jskov
# Contributors: jskov
# Date: 2000-12-05
#
#####DESCRIPTIONEND####
#
# ====================================================================
 
cdl_package CYGPKG_DEVS_FLASH_MIPS_OCELOT {
display "Flash memory support for PMC-Sierra Ocelot board"
 
parent CYGPKG_IO_FLASH
active_if CYGPKG_IO_FLASH
requires CYGPKG_HAL_MIPS_RM7000_OCELOT
 
implements CYGHWR_IO_FLASH_DEVICE
 
compile mips_ocelot_flash.c
 
# Arguably this should do in the generic package
# but then there is a logic loop so you can never enable it.
cdl_interface CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED {
display "AMD AM29F040B driver required"
}
 
implements CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED
requires CYGHWR_DEVS_FLASH_AMD_AM29F040B
}
/ocelot/v2_0/src/mips_ocelot_flash.c
0,0 → 1,69
//==========================================================================
//
// mips_ocelot_flash.c
//
// Flash programming for AMD device on MIPS Ocelot board
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): jskov
// Contributors: jskov
// Date: 2001-05-22
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
//--------------------------------------------------------------------------
// Device properties
 
#define CYGNUM_FLASH_INTERLEAVE (1)
#define CYGNUM_FLASH_SERIES (1)
#define CYGNUM_FLASH_WIDTH (8)
#define CYGNUM_FLASH_BASE (0xbfc00000u)
 
//--------------------------------------------------------------------------
// Platform specific extras
 
//--------------------------------------------------------------------------
// Now include the driver code.
#include "cyg/io/flash_am29xxxxx.inl"
 
// ------------------------------------------------------------------------
// EOF mips_ocelot_flash.c
/ocelot/v2_0/ChangeLog
0,0 → 1,52
2001-06-08 Jesper Skov <jskov@redhat.com>
 
* cdl/flash_mips_ocelot.cdl: Require AM29F040B support.
 
2001-05-28 Jesper Skov <jskov@redhat.com>
 
* src/mips_ocelot_flash.c: Specify data width now driver
autodetects part.
 
2001-05-22 Jesper Skov <jskov@redhat.com>
 
* cdl/flash_mips_ocelot.cdl: QED renamed to PMC-Sierra.
* include/devs_flash_mips_ocelot.inl: Same.
 
2000-12-05 Jesper Skov <jskov@redhat.com>
 
* Created.
 
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================
/idt79s334a/v2_0/cdl/flash_mips_refidt334.cdl
0,0 → 1,72
# ====================================================================
#
# flash_mips_refidt334.cdl
#
# FLASH memory - Hardware support for IDT board
#
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License along
## with eCos; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
##
## As a special exception, if other files instantiate templates or use macros
## or inline functions from this file, or you compile this file and link it
## with other works to produce a work based on this file, this file does not
## by itself cause the resulting work to be covered by the GNU General Public
## License. However the source code for this file must still be made available
## in accordance with section (3) of the GNU General Public License.
##
## This exception does not invalidate any other reasons why a work based on
## this file might be covered by the GNU General Public License.
##
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
## at http://sources.redhat.com/ecos/ecos-license/
## -------------------------------------------
#####ECOSGPLCOPYRIGHTEND####
# ====================================================================
######DESCRIPTIONBEGIN####
#
# Author(s): tmichals
# Contributors: jskov
# Date: 2003-02-13
#
#####DESCRIPTIONEND####
#
# ====================================================================
 
cdl_package CYGPKG_DEVS_FLASH_MIPS_REFIDT334 {
display "IDT 79RC32334 reference platform flash support"
 
parent CYGPKG_IO_FLASH
active_if CYGPKG_IO_FLASH
requires CYGPKG_HAL_MIPS_IDT32334_REFIDT334
 
implements CYGHWR_IO_FLASH_DEVICE
 
compile mips_idt334a_flash.c
 
# Arguably this should do in the generic package
# but then there is a logic loop so you can never enable it.
cdl_interface CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED {
display "AMD AM29F040B driver required"
}
 
implements CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED
requires CYGHWR_DEVS_FLASH_AMD_AM29F040B
}
 
# flash_mips_refidt334.cdl
/idt79s334a/v2_0/src/mips_idt334a_flash.c
0,0 → 1,69
//==========================================================================
//
// mips_idt334a_flash.c
//
// Flash programming for AMD device on MIPS IDT 79s334a reference board
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): tmichals
// Contributors: jskov
// Date: 2003-02-13
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
//--------------------------------------------------------------------------
// Device properties
 
#define CYGNUM_FLASH_INTERLEAVE (1)
#define CYGNUM_FLASH_SERIES (1)
#define CYGNUM_FLASH_WIDTH (8)
#define CYGNUM_FLASH_BASE (0xbfc00000u)
 
//--------------------------------------------------------------------------
// Platform specific extras
 
//--------------------------------------------------------------------------
// Now include the driver code.
#include "cyg/io/flash_am29xxxxx.inl"
 
// ------------------------------------------------------------------------
// EOF mips_idt334a_flash.c
/idt79s334a/v2_0/ChangeLog
0,0 → 1,39
2003-02-13 Tim Michals <t.michals@attbi.com>
2003-02-13 Jonathan Larmour <jifl@eCosCentric.com>
 
* New package - support for MIPS IDT 79s334a board.
 
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================
/malta/v2_0/cdl/flash_malta.cdl
0,0 → 1,71
# ====================================================================
#
# flash_malta.cdl
#
# FLASH memory - Hardware support on MIPS Malta
#
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
## for more details.
##
## You should have received a copy of the GNU General Public License along
## with eCos; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
##
## As a special exception, if other files instantiate templates or use macros
## or inline functions from this file, or you compile this file and link it
## with other works to produce a work based on this file, this file does not
## by itself cause the resulting work to be covered by the GNU General Public
## License. However the source code for this file must still be made available
## in accordance with section (3) of the GNU General Public License.
##
## This exception does not invalidate any other reasons why a work based on
## this file might be covered by the GNU General Public License.
##
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
## at http://sources.redhat.com/ecos/ecos-license/
## -------------------------------------------
#####ECOSGPLCOPYRIGHTEND####
# ====================================================================
######DESCRIPTIONBEGIN####
#
# Author(s): jskov
# Contributors:
# Date: 2001-03-21
#
#####DESCRIPTIONEND####
#
# ====================================================================
 
cdl_package CYGPKG_DEVS_FLASH_MALTA {
display "MIPS Malta FLASH memory support"
 
parent CYGPKG_IO_FLASH
active_if CYGPKG_IO_FLASH
requires CYGPKG_HAL_MIPS_MALTA
 
implements CYGHWR_IO_FLASH_DEVICE
 
compile mips_malta_flash.c
 
# Arguably this should do in the generic package
# but then there is a logic loop so you can never enable it.
cdl_interface CYGINT_DEVS_FLASH_INTEL_28FXXX_REQUIRED {
display "Generic Intel FlashFile driver required"
}
 
implements CYGINT_DEVS_FLASH_INTEL_28FXXX_REQUIRED
 
requires CYGHWR_DEVS_FLASH_INTEL_28F160S5
}
/malta/v2_0/src/mips_malta_flash.c
0,0 → 1,70
//==========================================================================
//
// mips_malta_flash.c
//
// Flash programming for Intel FlashFile devices on MIPS Malta board
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): jskov
// Contributors: jskov
// Date: 2001-03-21
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
 
//--------------------------------------------------------------------------
// Device properties
 
// We use the two Intel FlashFile 28F160 parts on the Malta board.
#define CYGNUM_FLASH_INTERLEAVE (2)
#define CYGNUM_FLASH_SERIES (1)
#define CYGNUM_FLASH_WIDTH (16)
#define CYGNUM_FLASH_BASE (0xbe000000u)
 
//--------------------------------------------------------------------------
// Platform specific extras
 
//--------------------------------------------------------------------------
// Now include the driver code.
#include "cyg/io/flash_28fxxx.inl"
 
// ------------------------------------------------------------------------
// EOF mips_malta_flash.c
/malta/v2_0/ChangeLog
0,0 → 1,54
2001-08-10 Jesper Skov <jskov@redhat.com>
 
* src/mips_malta_flash.c: Define width.
 
* cdl/flash_malta.cdl: Require 28F160S5 support.
 
2001-03-23 Jesper Skov <jskov@redhat.com>
 
* src/mips_malta_flash.c (CYGNUM_FLASH_BASE): Changed again to
non-cached area at 0x1e000000 to avoid problem with board ID
word.
 
2001-03-22 Jesper Skov <jskov@redhat.com>
 
* src/mips_malta_flash.c (CYGNUM_FLASH_BASE): Changed.
 
2001-03-21 Jesper Skov <jskov@redhat.com>
 
* Use generic Intel driver.
 
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.