Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
7fe60242
Unverified
Commit
7fe60242
authored
Mar 18, 2019
by
Chen-Yu Tsai
Committed by
GitHub
Mar 18, 2019
Browse files
Merge pull request #119 from plaes/spi-a20
Add support for SPI on A20
parents
6d598a0e
5831d54a
Changes
1
Hide whitespace changes
Inline
Side-by-side
fel-spiflash.c
View file @
7fe60242
...
...
@@ -144,8 +144,11 @@ static bool spi0_init(feldev_handle *dev)
{
uint32_t
reg_val
;
soc_info_t
*
soc_info
=
dev
->
soc_info
;
if
(
!
soc_info
)
if
(
!
soc_info
)
{
printf
(
"Unable to fetch device information. "
"Possibly unknown device.
\n
"
);
return
false
;
}
/* Setup SPI0 pins muxing */
switch
(
soc_info
->
soc_id
)
{
...
...
@@ -157,6 +160,12 @@ static bool spi0_init(feldev_handle *dev)
gpio_set_cfgpin
(
dev
,
PC
,
2
,
SUNXI_GPC_SPI0
);
gpio_set_cfgpin
(
dev
,
PC
,
3
,
SUNXI_GPC_SPI0
);
break
;
case
0x1651
:
/* Allwinner A20 */
gpio_set_cfgpin
(
dev
,
PC
,
0
,
SUNXI_GPC_SPI0
);
gpio_set_cfgpin
(
dev
,
PC
,
1
,
SUNXI_GPC_SPI0
);
gpio_set_cfgpin
(
dev
,
PC
,
2
,
SUNXI_GPC_SPI0
);
gpio_set_cfgpin
(
dev
,
PC
,
23
,
SUNXI_GPC_SPI0
);
break
;
case
0x1689
:
/* Allwinner A64 */
gpio_set_cfgpin
(
dev
,
PC
,
0
,
SUN50I_GPC_SPI0
);
gpio_set_cfgpin
(
dev
,
PC
,
1
,
SUN50I_GPC_SPI0
);
...
...
@@ -164,6 +173,8 @@ static bool spi0_init(feldev_handle *dev)
gpio_set_cfgpin
(
dev
,
PC
,
3
,
SUN50I_GPC_SPI0
);
break
;
default:
/* Unknown/Unsupported SoC */
printf
(
"SPI support not implemented yet for %x (%s)!
\n
"
,
soc_info
->
soc_id
,
soc_info
->
name
);
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment