projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nios2: Offer ft_board_setup() capability and call fdt_fixup_ethernet().
[platform/kernel/u-boot.git]
/
board
/
innokom
/
flash.c
diff --git
a/board/innokom/flash.c
b/board/innokom/flash.c
index
7f17ba6
..
ed4b987
100644
(file)
--- a/
board/innokom/flash.c
+++ b/
board/innokom/flash.c
@@
-72,7
+72,7
@@
#define MAIN_SECT_SIZE 0x00020000 /* 128k per sector */
#endif
#define MAIN_SECT_SIZE 0x00020000 /* 128k per sector */
#endif
-flash_info_t flash_info[C
FG
_MAX_FLASH_BANKS];
+flash_info_t flash_info[C
ONFIG_SYS
_MAX_FLASH_BANKS];
/**
* flash_init: - initialize data structures for flash chips
/**
* flash_init: - initialize data structures for flash chips
@@
-85,14
+85,14
@@
ulong flash_init(void)
int i, j;
ulong size = 0;
int i, j;
ulong size = 0;
- for (i = 0; i < C
FG
_MAX_FLASH_BANKS; i++) {
+ for (i = 0; i < C
ONFIG_SYS
_MAX_FLASH_BANKS; i++) {
ulong flashbase = 0;
flash_info[i].flash_id =
(INTEL_MANUFACT & FLASH_VENDMASK) |
(INTEL_ID_28F128J3 & FLASH_TYPEMASK);
flash_info[i].size = FLASH_BANK_SIZE;
ulong flashbase = 0;
flash_info[i].flash_id =
(INTEL_MANUFACT & FLASH_VENDMASK) |
(INTEL_ID_28F128J3 & FLASH_TYPEMASK);
flash_info[i].size = FLASH_BANK_SIZE;
- flash_info[i].sector_count = C
FG
_MAX_FLASH_SECT;
- memset(flash_info[i].protect, 0, C
FG
_MAX_FLASH_SECT);
+ flash_info[i].sector_count = C
ONFIG_SYS
_MAX_FLASH_SECT;
+ memset(flash_info[i].protect, 0, C
ONFIG_SYS
_MAX_FLASH_SECT);
switch (i) {
case 0:
switch (i) {
case 0:
@@
-110,8
+110,8
@@
ulong flash_init(void)
/* Protect u-boot sectors */
flash_protect(FLAG_PROTECT_SET,
/* Protect u-boot sectors */
flash_protect(FLAG_PROTECT_SET,
- C
FG
_FLASH_BASE,
- C
FG
_FLASH_BASE + (256*1024) - 1,
+ C
ONFIG_SYS
_FLASH_BASE,
+ C
ONFIG_SYS
_FLASH_BASE + (256*1024) - 1,
&flash_info[0]);
#ifdef CONFIG_ENV_IS_IN_FLASH
&flash_info[0]);
#ifdef CONFIG_ENV_IS_IN_FLASH
@@
-135,7
+135,7
@@
void flash_print_info (flash_info_t *info)
{
int i, j;
{
int i, j;
- for (j=0; j<C
FG
_MAX_FLASH_BANKS; j++) {
+ for (j=0; j<C
ONFIG_SYS
_MAX_FLASH_BANKS; j++) {
switch (info->flash_id & FLASH_VENDMASK) {
switch (info->flash_id & FLASH_VENDMASK) {
@@
-182,6
+182,7
@@
int flash_erase(flash_info_t *info, int s_first, int s_last)
{
int flag, prot, sect;
int rc = ERR_OK;
{
int flag, prot, sect;
int rc = ERR_OK;
+ ulong start;
if (info->flash_id == FLASH_UNKNOWN)
return ERR_UNKNOWN_FLASH_TYPE;
if (info->flash_id == FLASH_UNKNOWN)
return ERR_UNKNOWN_FLASH_TYPE;
@@
-218,7
+219,7
@@
int flash_erase(flash_info_t *info, int s_first, int s_last)
PRINTK("\n");
/* arm simple, non interrupt dependent timer */
PRINTK("\n");
/* arm simple, non interrupt dependent timer */
-
reset_timer_masked(
);
+
start = get_timer(0
);
if (info->protect[sect] == 0) { /* not protected */
u16 * volatile addr = (u16 * volatile)(info->start[sect]);
if (info->protect[sect] == 0) { /* not protected */
u16 * volatile addr = (u16 * volatile)(info->start[sect]);
@@
-235,7
+236,7
@@
int flash_erase(flash_info_t *info, int s_first, int s_last)
while ((*addr & 0x0080) != 0x0080) {
PRINTK(".");
while ((*addr & 0x0080) != 0x0080) {
PRINTK(".");
- if (get_timer
_masked() > CFG
_FLASH_ERASE_TOUT) {
+ if (get_timer
(start) > CONFIG_SYS
_FLASH_ERASE_TOUT) {
*addr = 0x00B0; /* suspend erase*/
*addr = 0x00FF; /* read mode */
rc = ERR_TIMOUT;
*addr = 0x00B0; /* suspend erase*/
*addr = 0x00FF; /* read mode */
rc = ERR_TIMOUT;
@@
-279,6
+280,7
@@
static int write_word (flash_info_t *info, ulong dest, ushort data)
volatile u16 *addr = (u16 *)dest, val;
int rc = ERR_OK;
int flag;
volatile u16 *addr = (u16 *)dest, val;
int rc = ERR_OK;
int flag;
+ ulong start;
/* Check if Flash is (sufficiently) erased */
if ((*addr & data) != data) return ERR_NOT_ERASED;
/* Check if Flash is (sufficiently) erased */
if ((*addr & data) != data) return ERR_NOT_ERASED;
@@
-302,11
+304,11
@@
static int write_word (flash_info_t *info, ulong dest, ushort data)
*addr = data;
/* arm simple, non interrupt dependent timer */
*addr = data;
/* arm simple, non interrupt dependent timer */
-
reset_timer_masked(
);
+
start = get_timer(0
);
/* wait while polling the status register */
while(((val = *addr) & 0x80) != 0x80) {
/* wait while polling the status register */
while(((val = *addr) & 0x80) != 0x80) {
- if (get_timer
_masked() > CFG
_FLASH_WRITE_TOUT) {
+ if (get_timer
(start) > CONFIG_SYS
_FLASH_WRITE_TOUT) {
rc = ERR_TIMOUT;
*addr = 0xB0; /* suspend program command */
goto outahere;
rc = ERR_TIMOUT;
*addr = 0xB0; /* suspend program command */
goto outahere;