[realtek-ambz2] Make compiling base core possible

This commit is contained in:
Kuba Szczodrzyński
2023-05-19 10:42:59 +02:00
parent 27a7faaab7
commit 07e9aa1ded
14 changed files with 321 additions and 3 deletions

View File

@@ -40,6 +40,8 @@ typedef enum {
RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC), // CHIPID_8711BG / QFN68
MX1290 = RTL8710BN,
MX1290V2 = RTL8710BX,
// Realtek AmebaZ2
RTL8720CF = CPU_MODEL(F_RTL8720C, 0x00), // TODO
// Beken 72XX
BK7231T = CPU_MODEL(F_BK7231U, 0x1A), // *SCTRL_CHIP_ID = 0x7231a
BK7231N = CPU_MODEL(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c

View File

@@ -20,6 +20,7 @@ extern "C" {
#include <rtl8710b.h>
#endif
#if LT_RTL8720C
#include <hal.h>
#include <rtl8710c.h>
#endif

View File

@@ -0,0 +1,3 @@
/* Copyright (c) Kuba Szczodrzyński 2023-04-12. */
void shell_cmd_init() {}

View File

@@ -0,0 +1,38 @@
/* Copyright (c) Kuba Szczodrzyński 2023-04-12. */
#include <libretiny.h>
#include <sdk_private.h>
#include <printf/printf.h>
static UART0_Type *uart_dev[4] = {
UART0,
UART1,
UART2,
UART3,
};
uint8_t lt_uart_port = 2;
void putchar_(char c) {
putchar_p(c, lt_uart_port);
}
void putchar_p(char c, unsigned long port) {
// while (UART_Writable(uart_dev[port]) == 0) {}
uart_dev[port]->thr = c;
}
WRAP_PRINTF(rtl_printf);
WRAP_SPRINTF(rtl_sprintf);
WRAP_SNPRINTF(rtl_snprintf);
WRAP_VSNPRINTF(rtl_vsnprintf);
WRAP_VSNPRINTF(rtl_vsnprintf_r);
WRAP_VPRINTF(rtl_vprintf);
WRAP_PRINTF(DiagPrintf);
WRAP_SPRINTF(DiagSPrintf);
WRAP_SNPRINTF(DiagSnPrintf);
WRAP_PRINTF(prvDiagPrintf);
WRAP_SPRINTF(prvDiagSPrintf);
WRAP_VSPRINTF(VSprintf);
WRAP_PRINTF(LOG_PRINTF);

View File

@@ -0,0 +1,18 @@
/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */
#pragma once
#include <printf_config.h>
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
WRAP_DISABLE_DEF(rtl_printf);
WRAP_DISABLE_DEF(DiagPrintf);
WRAP_DISABLE_DEF(prvDiagPrintf);
WRAP_DISABLE_DEF(LOG_PRINTF);
#ifdef __cplusplus
} // extern "C"
#endif