mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-23 23:23:02 +00:00
soc: Added UART bases for A7-A11, T2 SoCs.
Add UART bases for A7-A11, T2 SoCs. Signed-off-by: Nick Chan <towinchenmi@gmail.com>
This commit is contained in:
parent
e98f3a3525
commit
226ec5298d
3 changed files with 37 additions and 3 deletions
2
config.h
2
config.h
|
@ -20,6 +20,8 @@
|
|||
|
||||
// Target for device-specific debug builds
|
||||
//#define TARGET T8103
|
||||
// Some devices like Apple TV HD use other uarts for debug console
|
||||
//#define TARGET_BOARD 0x34
|
||||
|
||||
#ifdef RELEASE
|
||||
# define FB_SILENT_MODE
|
||||
|
|
25
src/soc.h
25
src/soc.h
|
@ -5,6 +5,17 @@
|
|||
|
||||
#include "../config.h"
|
||||
|
||||
#define S5L8960X 0x8960
|
||||
#define T7000 0x7000
|
||||
#define T7001 0x7001
|
||||
#define S8000 0x8000
|
||||
#define S8001 0x8001
|
||||
#define S8003 0x8003
|
||||
#define T8010 0x8010
|
||||
#define T8011 0x8011
|
||||
#define T8012 0x8012
|
||||
#define T8015 0x8015
|
||||
|
||||
#define T8103 0x8103
|
||||
#define T8112 0x8112
|
||||
#define T8122 0x8122
|
||||
|
@ -28,6 +39,20 @@
|
|||
#define EARLY_UART_BASE 0x235200000
|
||||
#elif TARGET == T6034 || TARGET == T6031
|
||||
#define EARLY_UART_BASE 0x391200000
|
||||
#elif TARGET == T8015
|
||||
#define EARLY_UART_BASE 0x22e600000
|
||||
#elif TARGET == T7000 || TARGET == T7001 || TARGET == S8000 || TARGET == S8001 || \
|
||||
TARGET == S8003 || TARGET == T8010 || TARGET == T8011
|
||||
#if TARGET == T7000 && defined(TARGET_BOARD) && TARGET_BOARD == 0x34 // Apple TV HD
|
||||
#define EARLY_UART_BASE 0x20a0d8000
|
||||
#else
|
||||
#define EARLY_UART_BASE 0x20a0c0000
|
||||
#endif
|
||||
|
||||
#elif TARGET == T8012
|
||||
#define EARLY_UART_BASE 0x20a600000
|
||||
#elif TARGET == S5L8960X
|
||||
#define EARLY_UART_BASE 0x20a0a0000
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
13
src/uart.c
13
src/uart.c
|
@ -17,13 +17,20 @@ static u64 uart_base = 0;
|
|||
int uart_init(void)
|
||||
{
|
||||
int path[8];
|
||||
int node = adt_path_offset_trace(adt, "/arm-io/uart0", path);
|
||||
const char *uart_path;
|
||||
|
||||
if (node < 0) {
|
||||
printf("!!! UART node not found!\n");
|
||||
if (adt_path_offset_trace(adt, "/arm-io/uart6/debug-console", NULL) > 0) {
|
||||
uart_path = "/arm-io/uart6";
|
||||
/* T2 ADT does not have /arm-io/uart0/debug-console, but it is the correct UART */
|
||||
} else if (adt_path_offset_trace(adt, "/arm-io/uart0", NULL) > 0) {
|
||||
uart_path = "/arm-io/uart0";
|
||||
} else {
|
||||
printf("!!!Debug UART node not found!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
adt_path_offset_trace(adt, uart_path, path);
|
||||
|
||||
if (adt_get_reg(adt, path, "reg", 0, &uart_base, NULL)) {
|
||||
printf("!!! Failed to get UART reg property!\n");
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue