Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rk3576 Downstream U-Boot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor 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
Nicolas Frattaroli
Rk3576 Downstream U-Boot
Commits
28b62f0d
Commit
28b62f0d
authored
10 years ago
by
Tom Rini
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
git://git.denx.de/u-boot-spi
parents
61e76f53
1f436a6d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
drivers/mtd/spi/sf_params.c
+1
-0
1 addition, 0 deletions
drivers/mtd/spi/sf_params.c
drivers/mtd/spi/sf_probe.c
+10
-10
10 additions, 10 deletions
drivers/mtd/spi/sf_probe.c
drivers/spi/soft_spi.c
+12
-6
12 additions, 6 deletions
drivers/spi/soft_spi.c
with
23 additions
and
16 deletions
drivers/mtd/spi/sf_params.c
+
1
−
0
View file @
28b62f0d
...
@@ -60,6 +60,7 @@ const struct spi_flash_params spi_flash_params_table[] = {
...
@@ -60,6 +60,7 @@ const struct spi_flash_params spi_flash_params_table[] = {
{
"S25FL256S_64K"
,
0x010219
,
0x4d01
,
64
*
1024
,
512
,
RD_FULL
,
WR_QPP
},
{
"S25FL256S_64K"
,
0x010219
,
0x4d01
,
64
*
1024
,
512
,
RD_FULL
,
WR_QPP
},
{
"S25FL512S_256K"
,
0x010220
,
0x4d00
,
256
*
1024
,
256
,
RD_FULL
,
WR_QPP
},
{
"S25FL512S_256K"
,
0x010220
,
0x4d00
,
256
*
1024
,
256
,
RD_FULL
,
WR_QPP
},
{
"S25FL512S_64K"
,
0x010220
,
0x4d01
,
64
*
1024
,
1024
,
RD_FULL
,
WR_QPP
},
{
"S25FL512S_64K"
,
0x010220
,
0x4d01
,
64
*
1024
,
1024
,
RD_FULL
,
WR_QPP
},
{
"S25FL512S_512K"
,
0x010220
,
0x4f00
,
256
*
1024
,
256
,
RD_FULL
,
WR_QPP
},
#endif
#endif
#ifdef CONFIG_SPI_FLASH_STMICRO
/* STMICRO */
#ifdef CONFIG_SPI_FLASH_STMICRO
/* STMICRO */
{
"M25P10"
,
0x202011
,
0x0
,
32
*
1024
,
4
,
0
,
0
},
{
"M25P10"
,
0x202011
,
0x0
,
32
*
1024
,
4
,
0
,
0
},
...
...
This diff is collapsed.
Click to expand it.
drivers/mtd/spi/sf_probe.c
+
10
−
10
View file @
28b62f0d
...
@@ -197,16 +197,6 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,
...
@@ -197,16 +197,6 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,
/* Go for default supported write cmd */
/* Go for default supported write cmd */
flash
->
write_cmd
=
CMD_PAGE_PROGRAM
;
flash
->
write_cmd
=
CMD_PAGE_PROGRAM
;
/* Set the quad enable bit - only for quad commands */
if
((
flash
->
read_cmd
==
CMD_READ_QUAD_OUTPUT_FAST
)
||
(
flash
->
read_cmd
==
CMD_READ_QUAD_IO_FAST
)
||
(
flash
->
write_cmd
==
CMD_QUAD_PAGE_PROGRAM
))
{
if
(
spi_flash_set_qeb
(
flash
,
idcode
[
0
]))
{
debug
(
"SF: Fail to set QEB for %02x
\n
"
,
idcode
[
0
]);
return
NULL
;
}
}
/* Read dummy_byte: dummy byte is determined based on the
/* Read dummy_byte: dummy byte is determined based on the
* dummy cycles of a particular command.
* dummy cycles of a particular command.
* Fast commands - dummy_byte = dummy_cycles/8
* Fast commands - dummy_byte = dummy_cycles/8
...
@@ -327,6 +317,16 @@ static struct spi_flash *spi_flash_probe_slave(struct spi_slave *spi)
...
@@ -327,6 +317,16 @@ static struct spi_flash *spi_flash_probe_slave(struct spi_slave *spi)
if
(
!
flash
)
if
(
!
flash
)
goto
err_read_id
;
goto
err_read_id
;
/* Set the quad enable bit - only for quad commands */
if
((
flash
->
read_cmd
==
CMD_READ_QUAD_OUTPUT_FAST
)
||
(
flash
->
read_cmd
==
CMD_READ_QUAD_IO_FAST
)
||
(
flash
->
write_cmd
==
CMD_QUAD_PAGE_PROGRAM
))
{
if
(
spi_flash_set_qeb
(
flash
,
idcode
[
0
]))
{
debug
(
"SF: Fail to set QEB for %02x
\n
"
,
idcode
[
0
]);
return
NULL
;
}
}
#ifdef CONFIG_OF_CONTROL
#ifdef CONFIG_OF_CONTROL
if
(
spi_flash_decode_fdt
(
gd
->
fdt_blob
,
flash
))
{
if
(
spi_flash_decode_fdt
(
gd
->
fdt_blob
,
flash
))
{
debug
(
"SF: FDT decode error
\n
"
);
debug
(
"SF: FDT decode error
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
drivers/spi/soft_spi.c
+
12
−
6
View file @
28b62f0d
...
@@ -136,10 +136,14 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
...
@@ -136,10 +136,14 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
/*
/*
* Check if it is time to work on a new byte.
* Check if it is time to work on a new byte.
*/
*/
if
((
j
%
8
)
==
0
)
{
if
((
j
%
8
)
==
0
)
{
tmpdout
=
*
txd
++
;
if
(
txd
)
tmpdout
=
*
txd
++
;
else
tmpdout
=
0
;
if
(
j
!=
0
)
{
if
(
j
!=
0
)
{
*
rxd
++
=
tmpdin
;
if
(
rxd
)
*
rxd
++
=
tmpdin
;
}
}
tmpdin
=
0
;
tmpdin
=
0
;
}
}
...
@@ -164,9 +168,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
...
@@ -164,9 +168,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
* bits over to left-justify them. Then store the last byte
* bits over to left-justify them. Then store the last byte
* read in.
* read in.
*/
*/
if
((
bitlen
%
8
)
!=
0
)
if
(
rxd
)
{
tmpdin
<<=
8
-
(
bitlen
%
8
);
if
((
bitlen
%
8
)
!=
0
)
*
rxd
++
=
tmpdin
;
tmpdin
<<=
8
-
(
bitlen
%
8
);
*
rxd
++
=
tmpdin
;
}
if
(
flags
&
SPI_XFER_END
)
if
(
flags
&
SPI_XFER_END
)
spi_cs_deactivate
(
slave
);
spi_cs_deactivate
(
slave
);
...
...
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