luckfox-pico-sdk/sysdrv/source/kernel/arch/arm/mach-rockchip/rkpm_uart.h
luckfox-eng29 8f34c2760d project:build.sh: Added fastboot support; custom modifications to U-Boot and kernel implemented using patches.
project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between
the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door
for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more
usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp:
Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for
compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem.
sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device
tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately.
sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick
boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades.
sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for
fastboot.

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
2024-10-14 09:47:04 +08:00

61 lines
1.4 KiB
C

/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2023 Rockchip Electronics Co., Ltd.
*/
#ifndef RKPM_URAT_H
#define RKPM_URAT_H
#include "rkpm_helpers.h"
/* UART16550 Registers */
#define UARTTX 0x0
#define UARTRX 0x0
#define UARTDLL 0x0
#define UARTIER 0x4
#define UARTDLLM 0x4
#define UARTIIR 0x8
#define UARTFCR 0x8
#define UARTLCR 0xc
#define UARTMCR 0x10
#define UARTLSR 0x14
#define UARTMSR 0x18
#define UARTSPR 0x1c
#define UARTCSR 0x20
#define UARTUSR 0x7c
#define UARTSRR 0x88
#define UART_MCR_LOOP BIT(4)
#define UART_RESET BIT(0)
#define RCVR_FIFO_RESET BIT(1)
#define XMIT_FIFO_RESET BIT(2)
/* UART_USR bits */
#define UARTUSR_BUSY BIT(0)
#define UARTUSR_TFIFO_N_FULL BIT(1)
#define UARTUSR_TFIFO_EMPTY BIT(2)
#define UARTUSR_RRIFO_N_EMPTY BIT(3)
#define UARTUSR_RFIFO_FULL BIT(4)
#define UARTFCR_FIFOEN (1 << 0) /* Enable the Tx/Rx FIFO */
#define UARTLCR_DLAB (1 << 7) /* Divisor Latch Access */
struct uart_debug_ctx {
u32 uart_dll;
u32 uart_dlh;
u32 uart_ier;
u32 uart_fcr;
u32 uart_mcr;
u32 uart_lcr;
};
void rkpm_uart_debug_init(void __iomem *base,
unsigned int uart_clk,
unsigned int baud_rate);
void rkpm_uart_debug_save(void __iomem *base,
struct uart_debug_ctx *ctx);
void rkpm_uart_debug_restore(void __iomem *base,
struct uart_debug_ctx *ctx);
#endif