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
40a8f529
Commit
40a8f529
authored
Nov 29, 2016
by
Siarhei Siamashka
Committed by
GitHub
Nov 29, 2016
Browse files
Merge pull request #86 from wens/r40
R40 support for fel and uart0-helloworld
parents
8e53d2bf
e4806339
Changes
3
Hide whitespace changes
Inline
Side-by-side
fel.c
View file @
40a8f529
...
...
@@ -265,6 +265,7 @@ void aw_fel_print_version(libusb_device_handle *usb)
case
0x1667
:
soc_name
=
"A33"
;
break
;
case
0x1673
:
soc_name
=
"A83T"
;
break
;
case
0x1680
:
soc_name
=
"H3"
;
break
;
case
0x1701
:
soc_name
=
"R40"
;
break
;
case
0x1718
:
soc_name
=
"H5"
;
break
;
}
...
...
soc_info.c
View file @
40a8f529
...
...
@@ -167,6 +167,12 @@ soc_info_t soc_info_table[] = {
.
swap_buffers
=
a64_sram_swap_buffers
,
.
sid_addr
=
0x01C14200
,
.
rvbar_reg
=
0x017000A0
,
},{
.
soc_id
=
0x1701
,
/* Allwinner R40 */
.
scratch_addr
=
0x1000
,
.
thunk_addr
=
0xA200
,
.
thunk_size
=
0x200
,
.
swap_buffers
=
a10_a13_a20_sram_swap_buffers
,
.
sid_addr
=
0x01C1B200
,
},{
.
swap_buffers
=
NULL
/* End of the table */
}
...
...
uart0-helloworld-sdboot.c
View file @
40a8f529
...
...
@@ -256,6 +256,7 @@ void soc_detection_init(void)
#define soc_is_a64() (soc_id == 0x1689)
#define soc_is_h3() (soc_id == 0x1680)
#define soc_is_h5() (soc_id == 0x1718)
#define soc_is_r40() (soc_id == 0x1701)
/* A10s and A13 share the same ID, so we need a little more effort on those */
...
...
@@ -303,7 +304,7 @@ void clock_init_uart(void)
void
gpio_init
(
void
)
{
if
(
soc_is_a10
()
||
soc_is_a20
())
{
if
(
soc_is_a10
()
||
soc_is_a20
()
||
soc_is_r40
()
)
{
sunxi_gpio_set_cfgpin
(
SUNXI_GPB
(
22
),
SUN4I_GPB_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPB
(
23
),
SUN4I_GPB_UART0
);
sunxi_gpio_set_pull
(
SUNXI_GPB
(
23
),
SUNXI_GPIO_PULL_UP
);
...
...
@@ -446,6 +447,8 @@ int main(void)
uart0_puts
(
"Allwinner H3!
\n
"
);
else
if
(
soc_is_h5
())
uart0_puts
(
"Allwinner H5!
\n
"
);
else
if
(
soc_is_r40
())
uart0_puts
(
"Allwinner R40!
\n
"
);
else
uart0_puts
(
"unknown Allwinner SoC!
\n
"
);
...
...
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