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
3fb85399
Unverified
Commit
3fb85399
authored
Oct 06, 2020
by
Icenowy Zheng
Committed by
GitHub
Oct 06, 2020
Browse files
Merge pull request #142 from jernejsk/h616
Add support for H616
parents
7cc37c88
40ac9daf
Changes
2
Show whitespace changes
Inline
Side-by-side
soc_info.c
View file @
3fb85399
...
@@ -125,6 +125,12 @@ sram_swap_buffers v831_sram_swap_buffers[] = {
...
@@ -125,6 +125,12 @@ sram_swap_buffers v831_sram_swap_buffers[] = {
{
.
size
=
0
}
/* End of the table */
{
.
size
=
0
}
/* End of the table */
};
};
/* H616 situation is the same as V831 one, except it has 32 KiB of SRAM A1. */
sram_swap_buffers
h616_sram_swap_buffers
[]
=
{
{
.
buf1
=
0x21000
,
.
buf2
=
0x28000
,
.
size
=
0x1000
},
{
.
size
=
0
}
/* End of the table */
};
const
watchdog_info
wd_a10_compat
=
{
const
watchdog_info
wd_a10_compat
=
{
.
reg_mode
=
0x01C20C94
,
.
reg_mode
=
0x01C20C94
,
.
reg_mode_value
=
3
,
.
reg_mode_value
=
3
,
...
@@ -274,6 +280,16 @@ soc_info_t soc_info_table[] = {
...
@@ -274,6 +280,16 @@ soc_info_t soc_info_table[] = {
.
swap_buffers
=
v831_sram_swap_buffers
,
.
swap_buffers
=
v831_sram_swap_buffers
,
.
sid_base
=
0x03006000
,
.
sid_base
=
0x03006000
,
.
sid_offset
=
0x200
,
.
sid_offset
=
0x200
,
},{
.
soc_id
=
0x1823
,
/* Allwinner H616 */
.
name
=
"H616"
,
.
spl_addr
=
0x20000
,
.
scratch_addr
=
0x21000
,
.
thunk_addr
=
0x2A200
,
.
thunk_size
=
0x200
,
.
swap_buffers
=
h616_sram_swap_buffers
,
.
sid_base
=
0x03006000
,
.
sid_offset
=
0x200
,
.
rvbar_reg
=
0x09010040
,
},{
},{
.
swap_buffers
=
NULL
/* End of the table */
.
swap_buffers
=
NULL
/* End of the table */
}
}
...
...
uart0-helloworld-sdboot.c
View file @
3fb85399
...
@@ -147,6 +147,7 @@ enum sunxi_gpio_number {
...
@@ -147,6 +147,7 @@ enum sunxi_gpio_number {
#define SUN8I_V831_GPH_UART0 (5)
#define SUN8I_V831_GPH_UART0 (5)
#define SUN50I_H5_GPA_UART0 (2)
#define SUN50I_H5_GPA_UART0 (2)
#define SUN50I_H6_GPH_UART0 (2)
#define SUN50I_H6_GPH_UART0 (2)
#define SUN50I_H616_GPH_UART0 (2)
#define SUN50I_A64_GPB_UART0 (4)
#define SUN50I_A64_GPB_UART0 (4)
#define SUNXI_GPF_UART0 (4)
#define SUNXI_GPF_UART0 (4)
...
@@ -306,6 +307,7 @@ void soc_detection_init(void)
...
@@ -306,6 +307,7 @@ void soc_detection_init(void)
#define soc_is_a64() (soc_id == 0x1689)
#define soc_is_a64() (soc_id == 0x1689)
#define soc_is_h5() (soc_id == 0x1718)
#define soc_is_h5() (soc_id == 0x1718)
#define soc_is_h6() (soc_id == 0x1728)
#define soc_is_h6() (soc_id == 0x1728)
#define soc_is_h616() (soc_id == 0x1823)
#define soc_is_r40() (soc_id == 0x1701)
#define soc_is_r40() (soc_id == 0x1701)
#define soc_is_v3s() (soc_id == 0x1681)
#define soc_is_v3s() (soc_id == 0x1681)
#define soc_is_v831() (soc_id == 0x1817)
#define soc_is_v831() (soc_id == 0x1817)
...
@@ -384,7 +386,7 @@ void clock_init_uart_h6(void)
...
@@ -384,7 +386,7 @@ void clock_init_uart_h6(void)
void
clock_init_uart
(
void
)
void
clock_init_uart
(
void
)
{
{
if
(
soc_is_h6
()
||
soc_is_v831
())
if
(
soc_is_h6
()
||
soc_is_v831
()
||
soc_is_h616
()
)
clock_init_uart_h6
();
clock_init_uart_h6
();
else
else
clock_init_uart_legacy
();
clock_init_uart_legacy
();
...
@@ -434,6 +436,10 @@ void gpio_init(void)
...
@@ -434,6 +436,10 @@ void gpio_init(void)
sunxi_gpio_set_cfgpin
(
SUNXI_GPH
(
0
),
SUN50I_H6_GPH_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPH
(
0
),
SUN50I_H6_GPH_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPH
(
1
),
SUN50I_H6_GPH_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPH
(
1
),
SUN50I_H6_GPH_UART0
);
sunxi_gpio_set_pull
(
SUNXI_GPH
(
1
),
SUNXI_GPIO_PULL_UP
);
sunxi_gpio_set_pull
(
SUNXI_GPH
(
1
),
SUNXI_GPIO_PULL_UP
);
}
else
if
(
soc_is_h616
())
{
sunxi_gpio_set_cfgpin
(
SUNXI_GPH
(
0
),
SUN50I_H616_GPH_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPH
(
1
),
SUN50I_H616_GPH_UART0
);
sunxi_gpio_set_pull
(
SUNXI_GPH
(
1
),
SUNXI_GPIO_PULL_UP
);
}
else
if
(
soc_is_v3s
())
{
}
else
if
(
soc_is_v3s
())
{
sunxi_gpio_set_cfgpin
(
SUNXI_GPB
(
8
),
SUN8I_V3S_GPB_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPB
(
8
),
SUN8I_V3S_GPB_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPB
(
9
),
SUN8I_V3S_GPB_UART0
);
sunxi_gpio_set_cfgpin
(
SUNXI_GPB
(
9
),
SUN8I_V3S_GPB_UART0
);
...
@@ -518,7 +524,7 @@ int get_boot_device(void)
...
@@ -518,7 +524,7 @@ int get_boot_device(void)
u32
*
spl_signature
=
(
void
*
)
0x4
;
u32
*
spl_signature
=
(
void
*
)
0x4
;
if
(
soc_is_a64
()
||
soc_is_a80
()
||
soc_is_h5
())
if
(
soc_is_a64
()
||
soc_is_a80
()
||
soc_is_h5
())
spl_signature
=
(
void
*
)
0x10004
;
spl_signature
=
(
void
*
)
0x10004
;
if
(
soc_is_h6
()
||
soc_is_v831
())
if
(
soc_is_h6
()
||
soc_is_v831
()
||
soc_is_h616
()
)
spl_signature
=
(
void
*
)
0x20004
;
spl_signature
=
(
void
*
)
0x20004
;
/* Check the eGON.BT0 magic in the SPL header */
/* Check the eGON.BT0 magic in the SPL header */
...
@@ -536,7 +542,7 @@ int get_boot_device(void)
...
@@ -536,7 +542,7 @@ int get_boot_device(void)
void
bases_init
(
void
)
void
bases_init
(
void
)
{
{
if
(
soc_is_h6
()
||
soc_is_v831
())
{
if
(
soc_is_h6
()
||
soc_is_v831
()
||
soc_is_h616
()
)
{
pio_base
=
H6_PIO_BASE
;
pio_base
=
H6_PIO_BASE
;
uart0_base
=
H6_UART0_BASE
;
uart0_base
=
H6_UART0_BASE
;
}
else
{
}
else
{
...
@@ -573,6 +579,8 @@ int main(void)
...
@@ -573,6 +579,8 @@ int main(void)
uart0_puts
(
"Allwinner H5!
\n
"
);
uart0_puts
(
"Allwinner H5!
\n
"
);
else
if
(
soc_is_h6
())
else
if
(
soc_is_h6
())
uart0_puts
(
"Allwinner H6!
\n
"
);
uart0_puts
(
"Allwinner H6!
\n
"
);
else
if
(
soc_is_h616
())
uart0_puts
(
"Allwinner H616!
\n
"
);
else
if
(
soc_is_r40
())
else
if
(
soc_is_r40
())
uart0_puts
(
"Allwinner R40!
\n
"
);
uart0_puts
(
"Allwinner R40!
\n
"
);
else
if
(
soc_is_v3s
())
else
if
(
soc_is_v3s
())
...
...
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