Commit 40a8f529 authored by Siarhei Siamashka's avatar Siarhei Siamashka Committed by GitHub
Browse files

Merge pull request #86 from wens/r40

R40 support for fel and uart0-helloworld
parents 8e53d2bf e4806339
......@@ -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;
}
......
......@@ -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 */
}
......
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment