Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
23c5189e
Commit
23c5189e
authored
17 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
git://www.denx.de/git/u-boot-cfi-flash
parents
6de54203
97bf85d7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/mtd/cfi_flash.c
+38
-10
38 additions, 10 deletions
drivers/mtd/cfi_flash.c
drivers/mtd/jedec_flash.c
+19
-0
19 additions, 0 deletions
drivers/mtd/jedec_flash.c
with
57 additions
and
10 deletions
drivers/mtd/cfi_flash.c
+
38
−
10
View file @
23c5189e
...
@@ -239,12 +239,14 @@ static u32 flash_read32(void *addr)
...
@@ -239,12 +239,14 @@ static u32 flash_read32(void *addr)
return
__raw_readl
(
addr
);
return
__raw_readl
(
addr
);
}
}
static
u64
flash_read64
(
void
*
addr
)
static
u64
__
flash_read64
(
void
*
addr
)
{
{
/* No architectures currently implement __raw_readq() */
/* No architectures currently implement __raw_readq() */
return
*
(
volatile
u64
*
)
addr
;
return
*
(
volatile
u64
*
)
addr
;
}
}
u64
flash_read64
(
void
*
addr
)
__attribute__
((
weak
,
alias
(
"__flash_read64"
)));
/*-----------------------------------------------------------------------
/*-----------------------------------------------------------------------
*/
*/
#if defined(CFG_ENV_IS_IN_FLASH) || defined(CFG_ENV_ADDR_REDUND) || (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
#if defined(CFG_ENV_IS_IN_FLASH) || defined(CFG_ENV_ADDR_REDUND) || (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
...
@@ -364,6 +366,20 @@ static inline uchar flash_read_uchar (flash_info_t * info, uint offset)
...
@@ -364,6 +366,20 @@ static inline uchar flash_read_uchar (flash_info_t * info, uint offset)
return
retval
;
return
retval
;
}
}
/*-----------------------------------------------------------------------
* read a word at a port width address, assume 16bit bus
*/
static
inline
ushort
flash_read_word
(
flash_info_t
*
info
,
uint
offset
)
{
ushort
*
addr
,
retval
;
addr
=
flash_map
(
info
,
0
,
offset
);
retval
=
flash_read16
(
addr
);
flash_unmap
(
info
,
0
,
offset
,
addr
);
return
retval
;
}
/*-----------------------------------------------------------------------
/*-----------------------------------------------------------------------
* read a long word by picking the least significant byte of each maximum
* read a long word by picking the least significant byte of each maximum
* port size word. Swap for ppc format.
* port size word. Swap for ppc format.
...
@@ -1449,8 +1465,12 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
...
@@ -1449,8 +1465,12 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
flash_unlock_seq
(
info
,
0
);
flash_unlock_seq
(
info
,
0
);
flash_write_cmd
(
info
,
0
,
info
->
addr_unlock1
,
FLASH_CMD_READ_ID
);
flash_write_cmd
(
info
,
0
,
info
->
addr_unlock1
,
FLASH_CMD_READ_ID
);
udelay
(
1000
);
/* some flash are slow to respond */
udelay
(
1000
);
/* some flash are slow to respond */
info
->
manufacturer_id
=
flash_read_uchar
(
info
,
info
->
manufacturer_id
=
flash_read_uchar
(
info
,
FLASH_OFFSET_MANUFACTURER_ID
);
FLASH_OFFSET_MANUFACTURER_ID
);
switch
(
info
->
chipwidth
){
case
FLASH_CFI_8BIT
:
info
->
device_id
=
flash_read_uchar
(
info
,
info
->
device_id
=
flash_read_uchar
(
info
,
FLASH_OFFSET_DEVICE_ID
);
FLASH_OFFSET_DEVICE_ID
);
if
(
info
->
device_id
==
0x7E
)
{
if
(
info
->
device_id
==
0x7E
)
{
...
@@ -1461,6 +1481,14 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
...
@@ -1461,6 +1481,14 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
info
->
device_id2
|=
flash_read_uchar
(
info
,
info
->
device_id2
|=
flash_read_uchar
(
info
,
FLASH_OFFSET_DEVICE_ID3
);
FLASH_OFFSET_DEVICE_ID3
);
}
}
break
;
case
FLASH_CFI_16BIT
:
info
->
device_id
=
flash_read_word
(
info
,
FLASH_OFFSET_DEVICE_ID
);
break
;
default:
break
;
}
flash_write_cmd
(
info
,
0
,
0
,
AMD_CMD_RESET
);
flash_write_cmd
(
info
,
0
,
0
,
AMD_CMD_RESET
);
}
}
...
...
This diff is collapsed.
Click to expand it.
drivers/mtd/jedec_flash.c
+
19
−
0
View file @
23c5189e
...
@@ -216,6 +216,25 @@ static const struct amd_flash_info jedec_table[] = {
...
@@ -216,6 +216,25 @@ static const struct amd_flash_info jedec_table[] = {
}
}
},
},
#endif
#endif
#ifdef CFG_FLASH_LEGACY_512Kx16
{
.
mfr_id
=
MANUFACTURER_AMD
,
.
dev_id
=
AM29LV400BB
,
.
name
=
"AMD AM29LV400BB"
,
.
uaddr
=
{
[
1
]
=
MTD_UADDR_0x0555_0x02AA
/* x16 */
},
.
DevSize
=
SIZE_512KiB
,
.
CmdSet
=
CFI_CMDSET_AMD_LEGACY
,
.
NumEraseRegions
=
4
,
.
regions
=
{
ERASEINFO
(
0x04000
,
1
),
ERASEINFO
(
0x02000
,
2
),
ERASEINFO
(
0x08000
,
1
),
ERASEINFO
(
0x10000
,
7
),
}
},
#endif
};
};
static
inline
void
fill_info
(
flash_info_t
*
info
,
const
struct
amd_flash_info
*
jedec_entry
,
ulong
base
)
static
inline
void
fill_info
(
flash_info_t
*
info
,
const
struct
amd_flash_info
*
jedec_entry
,
ulong
base
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment