-
Notifications
You must be signed in to change notification settings - Fork 1.6k
arch/arm/rtl8721f: add UART character driver support #19588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dcgong2917
wants to merge
1
commit into
apache:master
Choose a base branch
from
dcgong2917:rtl8721f-uart-pr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /**************************************************************************** | ||
| * arch/arm/src/rtl8721f/ameba_uart_chip.h | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. The | ||
| * ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance with the | ||
| * License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations | ||
| * under the License. | ||
| * | ||
| ****************************************************************************/ | ||
|
|
||
| #ifndef __ARCH_ARM_SRC_RTL8721F_AMEBA_UART_CHIP_H | ||
| #define __ARCH_ARM_SRC_RTL8721F_AMEBA_UART_CHIP_H | ||
|
|
||
| /**************************************************************************** | ||
| * Included Files | ||
| ****************************************************************************/ | ||
|
|
||
| #include <nuttx/config.h> | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include <nuttx/irq.h> | ||
|
|
||
| /**************************************************************************** | ||
| * Pre-processor Definitions | ||
| ****************************************************************************/ | ||
|
|
||
| /* Per-chip UART wiring for RTL8721F (amebagreen2). The shared driver | ||
| * (arch/arm/src/common/ameba/ameba_uart.c) includes this header to learn how | ||
| * many general-purpose UARTs the chip exposes and, for each, its register | ||
| * base, peripheral-clock masks, NVIC vector and crossbar pad-mux codes. See | ||
| * the RTL8721DX version of this header for the full contract; the notes | ||
| * below cover only what differs on this chip. | ||
| * | ||
| * The AP core is km4tz (TrustZone secure) here, but the fwlib UART_DEV_TABLE | ||
| * (fwlib/ram_common/ameba_uart.c) points at the *non-secure* UARTx_DEV bases | ||
| * unconditionally, so -- exactly as on RTL8721DX -- the driver programs the | ||
| * controllers through the non-secure alias (0x4080_C000 / 0x4080_D000). The | ||
| * APBPeriph function/clock masks match RTL8721DX; only the register bases, | ||
| * NVIC vectors and pad-mux function codes are chip-specific. | ||
| */ | ||
|
|
||
| #define AMEBA_NUART 2 | ||
|
|
||
| #define AMEBA_UART_PORT_BASES { 0x4080c000ul, 0x4080d000ul } | ||
|
|
||
| #define AMEBA_UART_PORT_IRQS { RTL8721F_IRQ_UART0, RTL8721F_IRQ_UART1 } | ||
|
|
||
| /* APBPeriph_UARTx (function) and APBPeriph_UARTx_CLOCK masks. Equal on this | ||
| * chip; kept as two lists so chips where they differ can supply both. | ||
| */ | ||
|
|
||
| #define AMEBA_UART_APBPERIPH \ | ||
| { (((uint32_t)1 << 30) | ((uint32_t)1 << 6)), \ | ||
| (((uint32_t)1 << 30) | ((uint32_t)1 << 7)) } | ||
|
|
||
| #define AMEBA_UART_APBPERIPH_CLK \ | ||
| { (((uint32_t)1 << 30) | ((uint32_t)1 << 6)), \ | ||
| (((uint32_t)1 << 30) | ((uint32_t)1 << 7)) } | ||
|
|
||
| /* Direction-specific crossbar pad-mux function codes (PINMUX_FUNCTION_*). */ | ||
|
|
||
| #define AMEBA_UART_TXFID { 95, 99 } /* UART0_TXD, UART1_TXD */ | ||
| #define AMEBA_UART_RXFID { 96, 100 } /* UART0_RXD, UART1_RXD */ | ||
|
|
||
| #endif /* __ARCH_ARM_SRC_RTL8721F_AMEBA_UART_CHIP_H */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # | ||
| # This file is autogenerated: PLEASE DO NOT EDIT IT. | ||
| # | ||
| # You can use "make menuconfig" to make any modifications to the installed .config file. | ||
| # You can then do "make savedefconfig" to generate a new defconfig file that includes your | ||
| # modifications. | ||
| # | ||
| # CONFIG_DEBUG_WARN is not set | ||
| CONFIG_AMEBA_UART=y | ||
| CONFIG_ARCH="arm" | ||
| CONFIG_ARCH_BOARD="rtl8721f_evb" | ||
| CONFIG_ARCH_BOARD_RTL8721F_EVB=y | ||
| CONFIG_ARCH_CHIP="rtl8721f" | ||
| CONFIG_ARCH_CHIP_RTL8721F=y | ||
| CONFIG_ARCH_INTERRUPTSTACK=2048 | ||
| CONFIG_ARCH_STACKDUMP=y | ||
| CONFIG_ARMV8M_SYSTICK=y | ||
| CONFIG_BUILTIN=y | ||
| CONFIG_DEBUG_ASSERTIONS=y | ||
| CONFIG_DEBUG_FEATURES=y | ||
| CONFIG_DEBUG_FULLOPT=y | ||
| CONFIG_DEBUG_SYMBOLS=y | ||
| CONFIG_DEFAULT_TASK_STACKSIZE=4096 | ||
| CONFIG_EXAMPLES_HELLO=y | ||
| CONFIG_EXAMPLES_SERIALBLASTER=y | ||
| CONFIG_EXAMPLES_SERIALBLASTER_DEVPATH="/dev/ttyS1" | ||
| CONFIG_EXAMPLES_SERIALRX=y | ||
| CONFIG_EXAMPLES_SERIALRX_DEVPATH="/dev/ttyS1" | ||
| CONFIG_FS_PROCFS=y | ||
| CONFIG_FS_TMPFS=y | ||
| CONFIG_IDLETHREAD_STACKSIZE=4096 | ||
| CONFIG_INIT_ENTRYPOINT="nsh_main" | ||
| CONFIG_LIBC_MEMFD_ERROR=y | ||
| CONFIG_MM_DEFAULT_ALIGNMENT=32 | ||
| CONFIG_NSH_BUILTIN_APPS=y | ||
| CONFIG_NSH_FILEIOSIZE=512 | ||
| CONFIG_NSH_READLINE=y | ||
| CONFIG_PREALLOC_TIMERS=4 | ||
| CONFIG_RAM_SIZE=401408 | ||
| CONFIG_RAM_START=0x20006000 | ||
| CONFIG_RR_INTERVAL=200 | ||
| CONFIG_SCHED_HPWORK=y | ||
| CONFIG_SCHED_HPWORKPRIORITY=192 | ||
| CONFIG_SCHED_LPWORK=y | ||
| CONFIG_SERIAL_TERMIOS=y | ||
| CONFIG_STACK_COLORATION=y | ||
| CONFIG_START_DAY=16 | ||
| CONFIG_START_MONTH=6 | ||
| CONFIG_START_YEAR=2026 | ||
| CONFIG_SYSTEM_NSH=y | ||
| CONFIG_SYSTEM_NSH_STACKSIZE=2500 | ||
| CONFIG_TIMER=y | ||
| CONFIG_TIMER_ARCH=y | ||
| CONFIG_USEC_PER_TICK=1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcgong2917 please add the board picture that was missing in the previous PR