Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12602 Discussions

what is the file"flash_28fxxx.inl"

Altera_Forum
Honored Contributor II
986 Views

hi: 

the flash of UP3 kit, which is coming from Altera, is "LH28F160s3t-13a" ,now I want to transplant ecos to the kit. So I should to copmile a "CDL " and ".c" files about it ,the "CDL" is belown: 

 

cdl_package CYGPKG_ALTERA_AVALON_LH28F160_FLASH { 

display "Altera Avalon LH28F160 FLASH memory support" 

 

parent CYGPKG_IO_FLASH 

active_if CYGPKG_IO_FLASH 

active_if {!CYGHWR_DETECTED_SOPC_DEVICES || is_substr (CYGHWR_DETECTED_SOPC_DEVICE_LIST, " altera_avalon_cfi_flash ")} 

 

implements CYGHWR_IO_FLASH_DEVICE 

 

description " 

This option enables the LH28F160S3T-L13A driver for the 

Altera Avalon CFI flash device. This driver will automatically be configured to 

match the addresses used in an associated SOPC builder project. Currently only 

the driver can only access one flash device. Which device to use is controled 

using a configuration option." 

 

compile altera_avalon_LH28F160_flash.c 

 

cdl_option ALTERA_AVALON_LH28F160_FLASH_DEV { 

display "flash device" 

flavor data 

default_value { "default" } 

description " 

The name of the SOPC builder device connected to the flash  

driver. If this is set to 'default'  

then the first device found will be used." 

 

 

 

and the "compile altera_avalon_LH28F160_flash.c " is 

 

# include <pkgconf/system.h># include <pkgconf/altera_avalon_lh28f160_flash.h># include <cyg/hal/system.h># include <cyg/hal/hal_arch.h># include <cyg/infra/cyg_type.h> 

 

/* Device properties */ 

# define CYGNUM_FLASH_INTERLEAVE (1)# define CYGNUM_FLASH_SERIES (1)# define CYGNUM_FLASH_WIDTH (8)# define CYGNUM_FLASH_BASE altera_avalon_lh28f160_base 

# define CYGHWR_FLASH_LH28F160_PLF_INIT altera_avalon_lh28f160_init 

 

/* local variables used to store the flash parameters */ 

 

static cyg_uint8* altera_avalon_lh28f160_base = (void*) 0; 

 

/* Macros used below to initialise the flash parameters */ 

# define _DEV_NAME(dev) "/dev/"# dev# define DEV_NAME(dev) _DEV_NAME(dev) 

# define ALTERA_AVALON_CFI_FLASH_INSTANCE(name, device)  

if (!__builtin_strcmp(DEV_NAME(ALTERA_AVALON_LH28F160_FLASH_DEV), name##_NAME) ||  

(!__builtin_strcmp(DEV_NAME(ALTERA_AVALON_LH28F160_FLASH_DEV), "/dev/default") &&  

!found))  

{  

altera_avalon_lh28f160_base = (cyg_uint8*) CYGARC_UNCACHED_ADDRESS(name##_BASE);  

found = 1;  

 

/* Function used to initialise the flash parameters */ 

 

static void altera_avalon_lh28f160_init (void) 

int found = 0; 

# include <cyg/hal/devices.h> 

 

/* Now include the driver code. */ 

# include "cyg/io/flash_lh28f160.inl" 

 

 

now I have some questions: 

1)what is "CYGNUM_FLASH_INTERLEAVE, CYGNUM_FLASH_SERIES , CYGNUM_FLASH_WIDTH ,  

CYGNUM_FLASH_BASE " and how to set the number of them?  

whether the "CYGNUM_FLASH_INTERLEAVE" is the flash&#39;s number on the kit ?  

and the "CYGNUM_FLASH_WIDTH " is the width of the data of the flash ? 

but about the "CYGNUM_FLASH_SERIES " I don&#39;t know , what is it ? 

 

2) what is "flash_lh28f160.inl" and how to design it ? I think it is driver code about the flash , but I don&#39;t konw how to design ? 

3) I found a same file in "F:\altera\components\ecos\ecoscurrent\packages\devs\flash\intel\28fxxx\current\include" , which is "flash_28fxxx.inl" , and in the same directoy there is a file "flash_28fxxx_parts.inl" , in which there is a list about the "SHARP_LH28F016SCT_Z4" . The "LH28F016SCT_Z4" and "LH28F160s3t-13a" are all coming from sharp, but the LH28F016SCT_Z4 is used 8-bits data ,while the LH28F160s3t-13a is 16-bits.  

what is the relation between "flash_28fxxx.inl" and "flash_28fxxx_parts.inl" ? if can I add a list about "LH28F160s3t-13a " on the "flash_28fxxx_parts.inl" the problem is soluted?
0 Kudos
0 Replies
Reply