Configure early debug features by SoC type

To build a version with early UART support, set it in config.h

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-11-01 13:36:05 +09:00
parent b15be6bcd7
commit 38fc7a0780
5 changed files with 27 additions and 6 deletions

View file

@ -5,4 +5,7 @@
#define USE_FB
// Target for device-specific debug builds
//#define TARGET T8103
#endif

View file

@ -2,6 +2,7 @@
#include "cpufreq.h"
#include "adt.h"
#include "soc.h"
#include "utils.h"
#define CLUSTER_PSTATE 0x20

21
src/soc.h Normal file
View file

@ -0,0 +1,21 @@
/* SPDX-License-Identifier: MIT */
#ifndef __SOC_H__
#define __SOC_H__
#include "../config.h"
#define T8103 0x8103
#define T6000 0x6000
#define T6001 0x6001
#ifdef TARGET
#if TARGET == T8103
#define EARLY_UART_BASE 0x235200000
#elif TARGET == T6000 || TARGET == T6001
#define EARLY_UART_BASE 0x39b200000
#endif
#endif
#endif

View file

@ -1,8 +1,6 @@
/* SPDX-License-Identifier: MIT */
#if defined(EARLY_UART) && !defined(EARLY_UART_BASE)
#error EARLY_UART_BASE must be defined to the UART base address
#endif
#include "soc.h"
#define UTRSTAT 0x010
#define UTXH 0x020
@ -153,7 +151,7 @@ cpu_reset:
.globl debug_putc
.type debug_putc, @function
debug_putc:
#ifdef EARLY_UART
#ifdef EARLY_UART_BASE
ldr x1, =EARLY_UART_BASE
1:

View file

@ -406,8 +406,6 @@ struct vector_args {
extern u32 board_id, chip_id;
#define T8103 0x8103
extern struct vector_args next_stage;
void deep_wfi(void);