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
8347b645
Unverified
Commit
8347b645
authored
Nov 23, 2020
by
Icenowy Zheng
Committed by
GitHub
Nov 23, 2020
Browse files
Merge pull request #151 from apritzel/spiflash-h616
spi: Add H616 support
parents
2601dfa0
63ce5ad5
Changes
1
Show whitespace changes
Inline
Side-by-side
fel-spiflash.c
View file @
8347b645
...
@@ -124,6 +124,7 @@ static uint32_t gpio_base(feldev_handle *dev)
...
@@ -124,6 +124,7 @@ static uint32_t gpio_base(feldev_handle *dev)
switch
(
soc_info
->
soc_id
)
{
switch
(
soc_info
->
soc_id
)
{
case
0x1817
:
/* V831 */
case
0x1817
:
/* V831 */
case
0x1728
:
/* H6 */
case
0x1728
:
/* H6 */
case
0x1823
:
/* H616 */
return
0x0300B000
;
return
0x0300B000
;
default:
default:
return
0x01C20800
;
return
0x01C20800
;
...
@@ -141,6 +142,7 @@ static uint32_t spi_base(feldev_handle *dev)
...
@@ -141,6 +142,7 @@ static uint32_t spi_base(feldev_handle *dev)
return
0x01C05000
;
return
0x01C05000
;
case
0x1817
:
/* V831 */
case
0x1817
:
/* V831 */
case
0x1728
:
/* H6 */
case
0x1728
:
/* H6 */
case
0x1823
:
/* H616 */
return
0x05010000
;
return
0x05010000
;
default:
default:
return
0x01C68000
;
return
0x01C68000
;
...
@@ -181,6 +183,7 @@ static bool soc_is_h6_style(feldev_handle *dev)
...
@@ -181,6 +183,7 @@ static bool soc_is_h6_style(feldev_handle *dev)
switch
(
soc_info
->
soc_id
)
{
switch
(
soc_info
->
soc_id
)
{
case
0x1817
:
/* V831 */
case
0x1817
:
/* V831 */
case
0x1728
:
/* H6 */
case
0x1728
:
/* H6 */
case
0x1823
:
/* H616 */
return
true
;
return
true
;
default:
default:
return
false
;
return
false
;
...
@@ -235,6 +238,12 @@ static bool spi0_init(feldev_handle *dev)
...
@@ -235,6 +238,12 @@ static bool spi0_init(feldev_handle *dev)
/* PC5 is SPI0-CS on the H6, and SPI0-HOLD on the V831 */
/* PC5 is SPI0-CS on the H6, and SPI0-HOLD on the V831 */
gpio_set_cfgpin
(
dev
,
PC
,
5
,
SUN50I_GPC_SPI0
);
gpio_set_cfgpin
(
dev
,
PC
,
5
,
SUN50I_GPC_SPI0
);
break
;
break
;
case
0x1823
:
/* Allwinner H616 */
gpio_set_cfgpin
(
dev
,
PC
,
0
,
SUN50I_GPC_SPI0
);
/* SPI0_CLK */
gpio_set_cfgpin
(
dev
,
PC
,
2
,
SUN50I_GPC_SPI0
);
/* SPI0_MOSI */
gpio_set_cfgpin
(
dev
,
PC
,
3
,
SUN50I_GPC_SPI0
);
/* SPI0_CS0 */
gpio_set_cfgpin
(
dev
,
PC
,
4
,
SUN50I_GPC_SPI0
);
/* SPI0_MISO */
break
;
default:
/* Unknown/Unsupported SoC */
default:
/* Unknown/Unsupported SoC */
printf
(
"SPI support not implemented yet for %x (%s)!
\n
"
,
printf
(
"SPI support not implemented yet for %x (%s)!
\n
"
,
soc_info
->
soc_id
,
soc_info
->
name
);
soc_info
->
soc_id
,
soc_info
->
name
);
...
...
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